• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2022 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.google.cloud.asset.v1;
18 
19 import com.google.api.core.ApiFuture;
20 import com.google.api.core.ApiFutures;
21 import com.google.api.core.BetaApi;
22 import com.google.api.gax.core.BackgroundResource;
23 import com.google.api.gax.httpjson.longrunning.OperationsClient;
24 import com.google.api.gax.longrunning.OperationFuture;
25 import com.google.api.gax.paging.AbstractFixedSizeCollection;
26 import com.google.api.gax.paging.AbstractPage;
27 import com.google.api.gax.paging.AbstractPagedListResponse;
28 import com.google.api.gax.rpc.OperationCallable;
29 import com.google.api.gax.rpc.PageContext;
30 import com.google.api.gax.rpc.UnaryCallable;
31 import com.google.api.resourcenames.ResourceName;
32 import com.google.cloud.asset.v1.stub.AssetServiceStub;
33 import com.google.cloud.asset.v1.stub.AssetServiceStubSettings;
34 import com.google.common.util.concurrent.MoreExecutors;
35 import com.google.longrunning.Operation;
36 import com.google.protobuf.Empty;
37 import com.google.protobuf.FieldMask;
38 import java.io.IOException;
39 import java.util.List;
40 import java.util.concurrent.TimeUnit;
41 import javax.annotation.Generated;
42 
43 // AUTO-GENERATED DOCUMENTATION AND CLASS.
44 /**
45  * Service Description: Asset service definition.
46  *
47  * <p>This class provides the ability to make remote calls to the backing service through method
48  * calls that map to API methods. Sample code to get started:
49  *
50  * <pre>{@code
51  * // This snippet has been automatically generated and should be regarded as a code template only.
52  * // It will require modifications to work:
53  * // - It may require correct/in-range values for request initialization.
54  * // - It may require specifying regional endpoints when creating the service client as shown in
55  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
56  * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
57  *   BatchGetAssetsHistoryRequest request =
58  *       BatchGetAssetsHistoryRequest.newBuilder()
59  *           .setParent(FolderName.of("[FOLDER]").toString())
60  *           .addAllAssetNames(new ArrayList<String>())
61  *           .setContentType(ContentType.forNumber(0))
62  *           .setReadTimeWindow(TimeWindow.newBuilder().build())
63  *           .addAllRelationshipTypes(new ArrayList<String>())
64  *           .build();
65  *   BatchGetAssetsHistoryResponse response = assetServiceClient.batchGetAssetsHistory(request);
66  * }
67  * }</pre>
68  *
69  * <p>Note: close() needs to be called on the AssetServiceClient object to clean up resources such
70  * as threads. In the example above, try-with-resources is used, which automatically calls close().
71  *
72  * <p>The surface of this class includes several types of Java methods for each of the API's
73  * methods:
74  *
75  * <ol>
76  *   <li>A "flattened" method. With this type of method, the fields of the request type have been
77  *       converted into function parameters. It may be the case that not all fields are available as
78  *       parameters, and not every API method will have a flattened method entry point.
79  *   <li>A "request object" method. This type of method only takes one parameter, a request object,
80  *       which must be constructed before the call. Not every API method will have a request object
81  *       method.
82  *   <li>A "callable" method. This type of method takes no parameters and returns an immutable API
83  *       callable object, which can be used to initiate calls to the service.
84  * </ol>
85  *
86  * <p>See the individual methods for example code.
87  *
88  * <p>Many parameters require resource names to be formatted in a particular way. To assist with
89  * these names, this class includes a format method for each type of name, and additionally a parse
90  * method to extract the individual identifiers contained within names that are returned.
91  *
92  * <p>This class can be customized by passing in a custom instance of AssetServiceSettings to
93  * create(). For example:
94  *
95  * <p>To customize credentials:
96  *
97  * <pre>{@code
98  * // This snippet has been automatically generated and should be regarded as a code template only.
99  * // It will require modifications to work:
100  * // - It may require correct/in-range values for request initialization.
101  * // - It may require specifying regional endpoints when creating the service client as shown in
102  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
103  * AssetServiceSettings assetServiceSettings =
104  *     AssetServiceSettings.newBuilder()
105  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
106  *         .build();
107  * AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings);
108  * }</pre>
109  *
110  * <p>To customize the endpoint:
111  *
112  * <pre>{@code
113  * // This snippet has been automatically generated and should be regarded as a code template only.
114  * // It will require modifications to work:
115  * // - It may require correct/in-range values for request initialization.
116  * // - It may require specifying regional endpoints when creating the service client as shown in
117  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
118  * AssetServiceSettings assetServiceSettings =
119  *     AssetServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
120  * AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings);
121  * }</pre>
122  *
123  * <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
124  * the wire:
125  *
126  * <pre>{@code
127  * // This snippet has been automatically generated and should be regarded as a code template only.
128  * // It will require modifications to work:
129  * // - It may require correct/in-range values for request initialization.
130  * // - It may require specifying regional endpoints when creating the service client as shown in
131  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
132  * AssetServiceSettings assetServiceSettings = AssetServiceSettings.newHttpJsonBuilder().build();
133  * AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings);
134  * }</pre>
135  *
136  * <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
137  */
138 @Generated("by gapic-generator-java")
139 public class AssetServiceClient implements BackgroundResource {
140   private final AssetServiceSettings settings;
141   private final AssetServiceStub stub;
142   private final OperationsClient httpJsonOperationsClient;
143   private final com.google.longrunning.OperationsClient operationsClient;
144 
145   /** Constructs an instance of AssetServiceClient with default settings. */
create()146   public static final AssetServiceClient create() throws IOException {
147     return create(AssetServiceSettings.newBuilder().build());
148   }
149 
150   /**
151    * Constructs an instance of AssetServiceClient, using the given settings. The channels are
152    * created based on the settings passed in, or defaults for any settings that are not set.
153    */
create(AssetServiceSettings settings)154   public static final AssetServiceClient create(AssetServiceSettings settings) throws IOException {
155     return new AssetServiceClient(settings);
156   }
157 
158   /**
159    * Constructs an instance of AssetServiceClient, using the given stub for making calls. This is
160    * for advanced usage - prefer using create(AssetServiceSettings).
161    */
create(AssetServiceStub stub)162   public static final AssetServiceClient create(AssetServiceStub stub) {
163     return new AssetServiceClient(stub);
164   }
165 
166   /**
167    * Constructs an instance of AssetServiceClient, using the given settings. This is protected so
168    * that it is easy to make a subclass, but otherwise, the static factory methods should be
169    * preferred.
170    */
AssetServiceClient(AssetServiceSettings settings)171   protected AssetServiceClient(AssetServiceSettings settings) throws IOException {
172     this.settings = settings;
173     this.stub = ((AssetServiceStubSettings) settings.getStubSettings()).createStub();
174     this.operationsClient =
175         com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
176     this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
177   }
178 
AssetServiceClient(AssetServiceStub stub)179   protected AssetServiceClient(AssetServiceStub stub) {
180     this.settings = null;
181     this.stub = stub;
182     this.operationsClient =
183         com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
184     this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
185   }
186 
getSettings()187   public final AssetServiceSettings getSettings() {
188     return settings;
189   }
190 
getStub()191   public AssetServiceStub getStub() {
192     return stub;
193   }
194 
195   /**
196    * Returns the OperationsClient that can be used to query the status of a long-running operation
197    * returned by another API method call.
198    */
getOperationsClient()199   public final com.google.longrunning.OperationsClient getOperationsClient() {
200     return operationsClient;
201   }
202 
203   /**
204    * Returns the OperationsClient that can be used to query the status of a long-running operation
205    * returned by another API method call.
206    */
207   @BetaApi
getHttpJsonOperationsClient()208   public final OperationsClient getHttpJsonOperationsClient() {
209     return httpJsonOperationsClient;
210   }
211 
212   // AUTO-GENERATED DOCUMENTATION AND METHOD.
213   /**
214    * Exports assets with time and resource types to a given Cloud Storage location/BigQuery table.
215    * For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line
216    * represents a [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for
217    * BigQuery table destinations, the output table stores the fields in asset Protobuf as columns.
218    * This API implements the [google.longrunning.Operation][google.longrunning.Operation] API, which
219    * allows you to keep track of the export. We recommend intervals of at least 2 seconds with
220    * exponential retry to poll the export operation result. For regular-size resource parent, the
221    * export operation usually finishes within 5 minutes.
222    *
223    * <p>Sample code:
224    *
225    * <pre>{@code
226    * // This snippet has been automatically generated and should be regarded as a code template only.
227    * // It will require modifications to work:
228    * // - It may require correct/in-range values for request initialization.
229    * // - It may require specifying regional endpoints when creating the service client as shown in
230    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
231    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
232    *   ExportAssetsRequest request =
233    *       ExportAssetsRequest.newBuilder()
234    *           .setParent(FolderName.of("[FOLDER]").toString())
235    *           .setReadTime(Timestamp.newBuilder().build())
236    *           .addAllAssetTypes(new ArrayList<String>())
237    *           .setContentType(ContentType.forNumber(0))
238    *           .setOutputConfig(OutputConfig.newBuilder().build())
239    *           .addAllRelationshipTypes(new ArrayList<String>())
240    *           .build();
241    *   ExportAssetsResponse response = assetServiceClient.exportAssetsAsync(request).get();
242    * }
243    * }</pre>
244    *
245    * @param request The request object containing all of the parameters for the API call.
246    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
247    */
exportAssetsAsync( ExportAssetsRequest request)248   public final OperationFuture<ExportAssetsResponse, ExportAssetsRequest> exportAssetsAsync(
249       ExportAssetsRequest request) {
250     return exportAssetsOperationCallable().futureCall(request);
251   }
252 
253   // AUTO-GENERATED DOCUMENTATION AND METHOD.
254   /**
255    * Exports assets with time and resource types to a given Cloud Storage location/BigQuery table.
256    * For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line
257    * represents a [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for
258    * BigQuery table destinations, the output table stores the fields in asset Protobuf as columns.
259    * This API implements the [google.longrunning.Operation][google.longrunning.Operation] API, which
260    * allows you to keep track of the export. We recommend intervals of at least 2 seconds with
261    * exponential retry to poll the export operation result. For regular-size resource parent, the
262    * export operation usually finishes within 5 minutes.
263    *
264    * <p>Sample code:
265    *
266    * <pre>{@code
267    * // This snippet has been automatically generated and should be regarded as a code template only.
268    * // It will require modifications to work:
269    * // - It may require correct/in-range values for request initialization.
270    * // - It may require specifying regional endpoints when creating the service client as shown in
271    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
272    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
273    *   ExportAssetsRequest request =
274    *       ExportAssetsRequest.newBuilder()
275    *           .setParent(FolderName.of("[FOLDER]").toString())
276    *           .setReadTime(Timestamp.newBuilder().build())
277    *           .addAllAssetTypes(new ArrayList<String>())
278    *           .setContentType(ContentType.forNumber(0))
279    *           .setOutputConfig(OutputConfig.newBuilder().build())
280    *           .addAllRelationshipTypes(new ArrayList<String>())
281    *           .build();
282    *   OperationFuture<ExportAssetsResponse, ExportAssetsRequest> future =
283    *       assetServiceClient.exportAssetsOperationCallable().futureCall(request);
284    *   // Do something.
285    *   ExportAssetsResponse response = future.get();
286    * }
287    * }</pre>
288    */
289   public final OperationCallable<ExportAssetsRequest, ExportAssetsResponse, ExportAssetsRequest>
exportAssetsOperationCallable()290       exportAssetsOperationCallable() {
291     return stub.exportAssetsOperationCallable();
292   }
293 
294   // AUTO-GENERATED DOCUMENTATION AND METHOD.
295   /**
296    * Exports assets with time and resource types to a given Cloud Storage location/BigQuery table.
297    * For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line
298    * represents a [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for
299    * BigQuery table destinations, the output table stores the fields in asset Protobuf as columns.
300    * This API implements the [google.longrunning.Operation][google.longrunning.Operation] API, which
301    * allows you to keep track of the export. We recommend intervals of at least 2 seconds with
302    * exponential retry to poll the export operation result. For regular-size resource parent, the
303    * export operation usually finishes within 5 minutes.
304    *
305    * <p>Sample code:
306    *
307    * <pre>{@code
308    * // This snippet has been automatically generated and should be regarded as a code template only.
309    * // It will require modifications to work:
310    * // - It may require correct/in-range values for request initialization.
311    * // - It may require specifying regional endpoints when creating the service client as shown in
312    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
313    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
314    *   ExportAssetsRequest request =
315    *       ExportAssetsRequest.newBuilder()
316    *           .setParent(FolderName.of("[FOLDER]").toString())
317    *           .setReadTime(Timestamp.newBuilder().build())
318    *           .addAllAssetTypes(new ArrayList<String>())
319    *           .setContentType(ContentType.forNumber(0))
320    *           .setOutputConfig(OutputConfig.newBuilder().build())
321    *           .addAllRelationshipTypes(new ArrayList<String>())
322    *           .build();
323    *   ApiFuture<Operation> future = assetServiceClient.exportAssetsCallable().futureCall(request);
324    *   // Do something.
325    *   Operation response = future.get();
326    * }
327    * }</pre>
328    */
exportAssetsCallable()329   public final UnaryCallable<ExportAssetsRequest, Operation> exportAssetsCallable() {
330     return stub.exportAssetsCallable();
331   }
332 
333   // AUTO-GENERATED DOCUMENTATION AND METHOD.
334   /**
335    * Lists assets with time and resource types and returns paged results in response.
336    *
337    * <p>Sample code:
338    *
339    * <pre>{@code
340    * // This snippet has been automatically generated and should be regarded as a code template only.
341    * // It will require modifications to work:
342    * // - It may require correct/in-range values for request initialization.
343    * // - It may require specifying regional endpoints when creating the service client as shown in
344    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
345    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
346    *   ResourceName parent = FolderName.of("[FOLDER]");
347    *   for (Asset element : assetServiceClient.listAssets(parent).iterateAll()) {
348    *     // doThingsWith(element);
349    *   }
350    * }
351    * }</pre>
352    *
353    * @param parent Required. Name of the organization, folder, or project the assets belong to.
354    *     Format: "organizations/[organization-number]" (such as "organizations/123"),
355    *     "projects/[project-id]" (such as "projects/my-project-id"), "projects/[project-number]"
356    *     (such as "projects/12345"), or "folders/[folder-number]" (such as "folders/12345").
357    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
358    */
listAssets(ResourceName parent)359   public final ListAssetsPagedResponse listAssets(ResourceName parent) {
360     ListAssetsRequest request =
361         ListAssetsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
362     return listAssets(request);
363   }
364 
365   // AUTO-GENERATED DOCUMENTATION AND METHOD.
366   /**
367    * Lists assets with time and resource types and returns paged results in response.
368    *
369    * <p>Sample code:
370    *
371    * <pre>{@code
372    * // This snippet has been automatically generated and should be regarded as a code template only.
373    * // It will require modifications to work:
374    * // - It may require correct/in-range values for request initialization.
375    * // - It may require specifying regional endpoints when creating the service client as shown in
376    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
377    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
378    *   String parent = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString();
379    *   for (Asset element : assetServiceClient.listAssets(parent).iterateAll()) {
380    *     // doThingsWith(element);
381    *   }
382    * }
383    * }</pre>
384    *
385    * @param parent Required. Name of the organization, folder, or project the assets belong to.
386    *     Format: "organizations/[organization-number]" (such as "organizations/123"),
387    *     "projects/[project-id]" (such as "projects/my-project-id"), "projects/[project-number]"
388    *     (such as "projects/12345"), or "folders/[folder-number]" (such as "folders/12345").
389    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
390    */
listAssets(String parent)391   public final ListAssetsPagedResponse listAssets(String parent) {
392     ListAssetsRequest request = ListAssetsRequest.newBuilder().setParent(parent).build();
393     return listAssets(request);
394   }
395 
396   // AUTO-GENERATED DOCUMENTATION AND METHOD.
397   /**
398    * Lists assets with time and resource types and returns paged results in response.
399    *
400    * <p>Sample code:
401    *
402    * <pre>{@code
403    * // This snippet has been automatically generated and should be regarded as a code template only.
404    * // It will require modifications to work:
405    * // - It may require correct/in-range values for request initialization.
406    * // - It may require specifying regional endpoints when creating the service client as shown in
407    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
408    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
409    *   ListAssetsRequest request =
410    *       ListAssetsRequest.newBuilder()
411    *           .setParent(FolderName.of("[FOLDER]").toString())
412    *           .setReadTime(Timestamp.newBuilder().build())
413    *           .addAllAssetTypes(new ArrayList<String>())
414    *           .setContentType(ContentType.forNumber(0))
415    *           .setPageSize(883849137)
416    *           .setPageToken("pageToken873572522")
417    *           .addAllRelationshipTypes(new ArrayList<String>())
418    *           .build();
419    *   for (Asset element : assetServiceClient.listAssets(request).iterateAll()) {
420    *     // doThingsWith(element);
421    *   }
422    * }
423    * }</pre>
424    *
425    * @param request The request object containing all of the parameters for the API call.
426    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
427    */
listAssets(ListAssetsRequest request)428   public final ListAssetsPagedResponse listAssets(ListAssetsRequest request) {
429     return listAssetsPagedCallable().call(request);
430   }
431 
432   // AUTO-GENERATED DOCUMENTATION AND METHOD.
433   /**
434    * Lists assets with time and resource types and returns paged results in response.
435    *
436    * <p>Sample code:
437    *
438    * <pre>{@code
439    * // This snippet has been automatically generated and should be regarded as a code template only.
440    * // It will require modifications to work:
441    * // - It may require correct/in-range values for request initialization.
442    * // - It may require specifying regional endpoints when creating the service client as shown in
443    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
444    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
445    *   ListAssetsRequest request =
446    *       ListAssetsRequest.newBuilder()
447    *           .setParent(FolderName.of("[FOLDER]").toString())
448    *           .setReadTime(Timestamp.newBuilder().build())
449    *           .addAllAssetTypes(new ArrayList<String>())
450    *           .setContentType(ContentType.forNumber(0))
451    *           .setPageSize(883849137)
452    *           .setPageToken("pageToken873572522")
453    *           .addAllRelationshipTypes(new ArrayList<String>())
454    *           .build();
455    *   ApiFuture<Asset> future = assetServiceClient.listAssetsPagedCallable().futureCall(request);
456    *   // Do something.
457    *   for (Asset element : future.get().iterateAll()) {
458    *     // doThingsWith(element);
459    *   }
460    * }
461    * }</pre>
462    */
listAssetsPagedCallable()463   public final UnaryCallable<ListAssetsRequest, ListAssetsPagedResponse> listAssetsPagedCallable() {
464     return stub.listAssetsPagedCallable();
465   }
466 
467   // AUTO-GENERATED DOCUMENTATION AND METHOD.
468   /**
469    * Lists assets with time and resource types and returns paged results in response.
470    *
471    * <p>Sample code:
472    *
473    * <pre>{@code
474    * // This snippet has been automatically generated and should be regarded as a code template only.
475    * // It will require modifications to work:
476    * // - It may require correct/in-range values for request initialization.
477    * // - It may require specifying regional endpoints when creating the service client as shown in
478    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
479    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
480    *   ListAssetsRequest request =
481    *       ListAssetsRequest.newBuilder()
482    *           .setParent(FolderName.of("[FOLDER]").toString())
483    *           .setReadTime(Timestamp.newBuilder().build())
484    *           .addAllAssetTypes(new ArrayList<String>())
485    *           .setContentType(ContentType.forNumber(0))
486    *           .setPageSize(883849137)
487    *           .setPageToken("pageToken873572522")
488    *           .addAllRelationshipTypes(new ArrayList<String>())
489    *           .build();
490    *   while (true) {
491    *     ListAssetsResponse response = assetServiceClient.listAssetsCallable().call(request);
492    *     for (Asset element : response.getAssetsList()) {
493    *       // doThingsWith(element);
494    *     }
495    *     String nextPageToken = response.getNextPageToken();
496    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
497    *       request = request.toBuilder().setPageToken(nextPageToken).build();
498    *     } else {
499    *       break;
500    *     }
501    *   }
502    * }
503    * }</pre>
504    */
listAssetsCallable()505   public final UnaryCallable<ListAssetsRequest, ListAssetsResponse> listAssetsCallable() {
506     return stub.listAssetsCallable();
507   }
508 
509   // AUTO-GENERATED DOCUMENTATION AND METHOD.
510   /**
511    * Batch gets the update history of assets that overlap a time window. For IAM_POLICY content,
512    * this API outputs history when the asset and its attached IAM POLICY both exist. This can create
513    * gaps in the output history. Otherwise, this API outputs history with asset in both non-delete
514    * or deleted status. If a specified asset does not exist, this API returns an INVALID_ARGUMENT
515    * error.
516    *
517    * <p>Sample code:
518    *
519    * <pre>{@code
520    * // This snippet has been automatically generated and should be regarded as a code template only.
521    * // It will require modifications to work:
522    * // - It may require correct/in-range values for request initialization.
523    * // - It may require specifying regional endpoints when creating the service client as shown in
524    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
525    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
526    *   BatchGetAssetsHistoryRequest request =
527    *       BatchGetAssetsHistoryRequest.newBuilder()
528    *           .setParent(FolderName.of("[FOLDER]").toString())
529    *           .addAllAssetNames(new ArrayList<String>())
530    *           .setContentType(ContentType.forNumber(0))
531    *           .setReadTimeWindow(TimeWindow.newBuilder().build())
532    *           .addAllRelationshipTypes(new ArrayList<String>())
533    *           .build();
534    *   BatchGetAssetsHistoryResponse response = assetServiceClient.batchGetAssetsHistory(request);
535    * }
536    * }</pre>
537    *
538    * @param request The request object containing all of the parameters for the API call.
539    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
540    */
batchGetAssetsHistory( BatchGetAssetsHistoryRequest request)541   public final BatchGetAssetsHistoryResponse batchGetAssetsHistory(
542       BatchGetAssetsHistoryRequest request) {
543     return batchGetAssetsHistoryCallable().call(request);
544   }
545 
546   // AUTO-GENERATED DOCUMENTATION AND METHOD.
547   /**
548    * Batch gets the update history of assets that overlap a time window. For IAM_POLICY content,
549    * this API outputs history when the asset and its attached IAM POLICY both exist. This can create
550    * gaps in the output history. Otherwise, this API outputs history with asset in both non-delete
551    * or deleted status. If a specified asset does not exist, this API returns an INVALID_ARGUMENT
552    * error.
553    *
554    * <p>Sample code:
555    *
556    * <pre>{@code
557    * // This snippet has been automatically generated and should be regarded as a code template only.
558    * // It will require modifications to work:
559    * // - It may require correct/in-range values for request initialization.
560    * // - It may require specifying regional endpoints when creating the service client as shown in
561    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
562    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
563    *   BatchGetAssetsHistoryRequest request =
564    *       BatchGetAssetsHistoryRequest.newBuilder()
565    *           .setParent(FolderName.of("[FOLDER]").toString())
566    *           .addAllAssetNames(new ArrayList<String>())
567    *           .setContentType(ContentType.forNumber(0))
568    *           .setReadTimeWindow(TimeWindow.newBuilder().build())
569    *           .addAllRelationshipTypes(new ArrayList<String>())
570    *           .build();
571    *   ApiFuture<BatchGetAssetsHistoryResponse> future =
572    *       assetServiceClient.batchGetAssetsHistoryCallable().futureCall(request);
573    *   // Do something.
574    *   BatchGetAssetsHistoryResponse response = future.get();
575    * }
576    * }</pre>
577    */
578   public final UnaryCallable<BatchGetAssetsHistoryRequest, BatchGetAssetsHistoryResponse>
batchGetAssetsHistoryCallable()579       batchGetAssetsHistoryCallable() {
580     return stub.batchGetAssetsHistoryCallable();
581   }
582 
583   // AUTO-GENERATED DOCUMENTATION AND METHOD.
584   /**
585    * Creates a feed in a parent project/folder/organization to listen to its asset updates.
586    *
587    * <p>Sample code:
588    *
589    * <pre>{@code
590    * // This snippet has been automatically generated and should be regarded as a code template only.
591    * // It will require modifications to work:
592    * // - It may require correct/in-range values for request initialization.
593    * // - It may require specifying regional endpoints when creating the service client as shown in
594    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
595    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
596    *   String parent = "parent-995424086";
597    *   Feed response = assetServiceClient.createFeed(parent);
598    * }
599    * }</pre>
600    *
601    * @param parent Required. The name of the project/folder/organization where this feed should be
602    *     created in. It can only be an organization number (such as "organizations/123"), a folder
603    *     number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a
604    *     project number (such as "projects/12345").
605    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
606    */
createFeed(String parent)607   public final Feed createFeed(String parent) {
608     CreateFeedRequest request = CreateFeedRequest.newBuilder().setParent(parent).build();
609     return createFeed(request);
610   }
611 
612   // AUTO-GENERATED DOCUMENTATION AND METHOD.
613   /**
614    * Creates a feed in a parent project/folder/organization to listen to its asset updates.
615    *
616    * <p>Sample code:
617    *
618    * <pre>{@code
619    * // This snippet has been automatically generated and should be regarded as a code template only.
620    * // It will require modifications to work:
621    * // - It may require correct/in-range values for request initialization.
622    * // - It may require specifying regional endpoints when creating the service client as shown in
623    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
624    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
625    *   CreateFeedRequest request =
626    *       CreateFeedRequest.newBuilder()
627    *           .setParent("parent-995424086")
628    *           .setFeedId("feedId-1278410919")
629    *           .setFeed(Feed.newBuilder().build())
630    *           .build();
631    *   Feed response = assetServiceClient.createFeed(request);
632    * }
633    * }</pre>
634    *
635    * @param request The request object containing all of the parameters for the API call.
636    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
637    */
createFeed(CreateFeedRequest request)638   public final Feed createFeed(CreateFeedRequest request) {
639     return createFeedCallable().call(request);
640   }
641 
642   // AUTO-GENERATED DOCUMENTATION AND METHOD.
643   /**
644    * Creates a feed in a parent project/folder/organization to listen to its asset updates.
645    *
646    * <p>Sample code:
647    *
648    * <pre>{@code
649    * // This snippet has been automatically generated and should be regarded as a code template only.
650    * // It will require modifications to work:
651    * // - It may require correct/in-range values for request initialization.
652    * // - It may require specifying regional endpoints when creating the service client as shown in
653    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
654    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
655    *   CreateFeedRequest request =
656    *       CreateFeedRequest.newBuilder()
657    *           .setParent("parent-995424086")
658    *           .setFeedId("feedId-1278410919")
659    *           .setFeed(Feed.newBuilder().build())
660    *           .build();
661    *   ApiFuture<Feed> future = assetServiceClient.createFeedCallable().futureCall(request);
662    *   // Do something.
663    *   Feed response = future.get();
664    * }
665    * }</pre>
666    */
createFeedCallable()667   public final UnaryCallable<CreateFeedRequest, Feed> createFeedCallable() {
668     return stub.createFeedCallable();
669   }
670 
671   // AUTO-GENERATED DOCUMENTATION AND METHOD.
672   /**
673    * Gets details about an asset feed.
674    *
675    * <p>Sample code:
676    *
677    * <pre>{@code
678    * // This snippet has been automatically generated and should be regarded as a code template only.
679    * // It will require modifications to work:
680    * // - It may require correct/in-range values for request initialization.
681    * // - It may require specifying regional endpoints when creating the service client as shown in
682    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
683    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
684    *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
685    *   Feed response = assetServiceClient.getFeed(name);
686    * }
687    * }</pre>
688    *
689    * @param name Required. The name of the Feed and it must be in the format of:
690    *     projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id
691    *     organizations/organization_number/feeds/feed_id
692    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
693    */
getFeed(FeedName name)694   public final Feed getFeed(FeedName name) {
695     GetFeedRequest request =
696         GetFeedRequest.newBuilder().setName(name == null ? null : name.toString()).build();
697     return getFeed(request);
698   }
699 
700   // AUTO-GENERATED DOCUMENTATION AND METHOD.
701   /**
702    * Gets details about an asset feed.
703    *
704    * <p>Sample code:
705    *
706    * <pre>{@code
707    * // This snippet has been automatically generated and should be regarded as a code template only.
708    * // It will require modifications to work:
709    * // - It may require correct/in-range values for request initialization.
710    * // - It may require specifying regional endpoints when creating the service client as shown in
711    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
712    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
713    *   String name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString();
714    *   Feed response = assetServiceClient.getFeed(name);
715    * }
716    * }</pre>
717    *
718    * @param name Required. The name of the Feed and it must be in the format of:
719    *     projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id
720    *     organizations/organization_number/feeds/feed_id
721    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
722    */
getFeed(String name)723   public final Feed getFeed(String name) {
724     GetFeedRequest request = GetFeedRequest.newBuilder().setName(name).build();
725     return getFeed(request);
726   }
727 
728   // AUTO-GENERATED DOCUMENTATION AND METHOD.
729   /**
730    * Gets details about an asset feed.
731    *
732    * <p>Sample code:
733    *
734    * <pre>{@code
735    * // This snippet has been automatically generated and should be regarded as a code template only.
736    * // It will require modifications to work:
737    * // - It may require correct/in-range values for request initialization.
738    * // - It may require specifying regional endpoints when creating the service client as shown in
739    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
740    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
741    *   GetFeedRequest request =
742    *       GetFeedRequest.newBuilder()
743    *           .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString())
744    *           .build();
745    *   Feed response = assetServiceClient.getFeed(request);
746    * }
747    * }</pre>
748    *
749    * @param request The request object containing all of the parameters for the API call.
750    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
751    */
getFeed(GetFeedRequest request)752   public final Feed getFeed(GetFeedRequest request) {
753     return getFeedCallable().call(request);
754   }
755 
756   // AUTO-GENERATED DOCUMENTATION AND METHOD.
757   /**
758    * Gets details about an asset feed.
759    *
760    * <p>Sample code:
761    *
762    * <pre>{@code
763    * // This snippet has been automatically generated and should be regarded as a code template only.
764    * // It will require modifications to work:
765    * // - It may require correct/in-range values for request initialization.
766    * // - It may require specifying regional endpoints when creating the service client as shown in
767    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
768    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
769    *   GetFeedRequest request =
770    *       GetFeedRequest.newBuilder()
771    *           .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString())
772    *           .build();
773    *   ApiFuture<Feed> future = assetServiceClient.getFeedCallable().futureCall(request);
774    *   // Do something.
775    *   Feed response = future.get();
776    * }
777    * }</pre>
778    */
getFeedCallable()779   public final UnaryCallable<GetFeedRequest, Feed> getFeedCallable() {
780     return stub.getFeedCallable();
781   }
782 
783   // AUTO-GENERATED DOCUMENTATION AND METHOD.
784   /**
785    * Lists all asset feeds in a parent project/folder/organization.
786    *
787    * <p>Sample code:
788    *
789    * <pre>{@code
790    * // This snippet has been automatically generated and should be regarded as a code template only.
791    * // It will require modifications to work:
792    * // - It may require correct/in-range values for request initialization.
793    * // - It may require specifying regional endpoints when creating the service client as shown in
794    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
795    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
796    *   String parent = "parent-995424086";
797    *   ListFeedsResponse response = assetServiceClient.listFeeds(parent);
798    * }
799    * }</pre>
800    *
801    * @param parent Required. The parent project/folder/organization whose feeds are to be listed. It
802    *     can only be using project/folder/organization number (such as "folders/12345")", or a
803    *     project ID (such as "projects/my-project-id").
804    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
805    */
listFeeds(String parent)806   public final ListFeedsResponse listFeeds(String parent) {
807     ListFeedsRequest request = ListFeedsRequest.newBuilder().setParent(parent).build();
808     return listFeeds(request);
809   }
810 
811   // AUTO-GENERATED DOCUMENTATION AND METHOD.
812   /**
813    * Lists all asset feeds in a parent project/folder/organization.
814    *
815    * <p>Sample code:
816    *
817    * <pre>{@code
818    * // This snippet has been automatically generated and should be regarded as a code template only.
819    * // It will require modifications to work:
820    * // - It may require correct/in-range values for request initialization.
821    * // - It may require specifying regional endpoints when creating the service client as shown in
822    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
823    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
824    *   ListFeedsRequest request =
825    *       ListFeedsRequest.newBuilder().setParent("parent-995424086").build();
826    *   ListFeedsResponse response = assetServiceClient.listFeeds(request);
827    * }
828    * }</pre>
829    *
830    * @param request The request object containing all of the parameters for the API call.
831    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
832    */
listFeeds(ListFeedsRequest request)833   public final ListFeedsResponse listFeeds(ListFeedsRequest request) {
834     return listFeedsCallable().call(request);
835   }
836 
837   // AUTO-GENERATED DOCUMENTATION AND METHOD.
838   /**
839    * Lists all asset feeds in a parent project/folder/organization.
840    *
841    * <p>Sample code:
842    *
843    * <pre>{@code
844    * // This snippet has been automatically generated and should be regarded as a code template only.
845    * // It will require modifications to work:
846    * // - It may require correct/in-range values for request initialization.
847    * // - It may require specifying regional endpoints when creating the service client as shown in
848    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
849    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
850    *   ListFeedsRequest request =
851    *       ListFeedsRequest.newBuilder().setParent("parent-995424086").build();
852    *   ApiFuture<ListFeedsResponse> future =
853    *       assetServiceClient.listFeedsCallable().futureCall(request);
854    *   // Do something.
855    *   ListFeedsResponse response = future.get();
856    * }
857    * }</pre>
858    */
listFeedsCallable()859   public final UnaryCallable<ListFeedsRequest, ListFeedsResponse> listFeedsCallable() {
860     return stub.listFeedsCallable();
861   }
862 
863   // AUTO-GENERATED DOCUMENTATION AND METHOD.
864   /**
865    * Updates an asset feed configuration.
866    *
867    * <p>Sample code:
868    *
869    * <pre>{@code
870    * // This snippet has been automatically generated and should be regarded as a code template only.
871    * // It will require modifications to work:
872    * // - It may require correct/in-range values for request initialization.
873    * // - It may require specifying regional endpoints when creating the service client as shown in
874    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
875    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
876    *   Feed feed = Feed.newBuilder().build();
877    *   Feed response = assetServiceClient.updateFeed(feed);
878    * }
879    * }</pre>
880    *
881    * @param feed Required. The new values of feed details. It must match an existing feed and the
882    *     field `name` must be in the format of: projects/project_number/feeds/feed_id or
883    *     folders/folder_number/feeds/feed_id or organizations/organization_number/feeds/feed_id.
884    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
885    */
updateFeed(Feed feed)886   public final Feed updateFeed(Feed feed) {
887     UpdateFeedRequest request = UpdateFeedRequest.newBuilder().setFeed(feed).build();
888     return updateFeed(request);
889   }
890 
891   // AUTO-GENERATED DOCUMENTATION AND METHOD.
892   /**
893    * Updates an asset feed configuration.
894    *
895    * <p>Sample code:
896    *
897    * <pre>{@code
898    * // This snippet has been automatically generated and should be regarded as a code template only.
899    * // It will require modifications to work:
900    * // - It may require correct/in-range values for request initialization.
901    * // - It may require specifying regional endpoints when creating the service client as shown in
902    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
903    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
904    *   UpdateFeedRequest request =
905    *       UpdateFeedRequest.newBuilder()
906    *           .setFeed(Feed.newBuilder().build())
907    *           .setUpdateMask(FieldMask.newBuilder().build())
908    *           .build();
909    *   Feed response = assetServiceClient.updateFeed(request);
910    * }
911    * }</pre>
912    *
913    * @param request The request object containing all of the parameters for the API call.
914    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
915    */
updateFeed(UpdateFeedRequest request)916   public final Feed updateFeed(UpdateFeedRequest request) {
917     return updateFeedCallable().call(request);
918   }
919 
920   // AUTO-GENERATED DOCUMENTATION AND METHOD.
921   /**
922    * Updates an asset feed configuration.
923    *
924    * <p>Sample code:
925    *
926    * <pre>{@code
927    * // This snippet has been automatically generated and should be regarded as a code template only.
928    * // It will require modifications to work:
929    * // - It may require correct/in-range values for request initialization.
930    * // - It may require specifying regional endpoints when creating the service client as shown in
931    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
932    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
933    *   UpdateFeedRequest request =
934    *       UpdateFeedRequest.newBuilder()
935    *           .setFeed(Feed.newBuilder().build())
936    *           .setUpdateMask(FieldMask.newBuilder().build())
937    *           .build();
938    *   ApiFuture<Feed> future = assetServiceClient.updateFeedCallable().futureCall(request);
939    *   // Do something.
940    *   Feed response = future.get();
941    * }
942    * }</pre>
943    */
updateFeedCallable()944   public final UnaryCallable<UpdateFeedRequest, Feed> updateFeedCallable() {
945     return stub.updateFeedCallable();
946   }
947 
948   // AUTO-GENERATED DOCUMENTATION AND METHOD.
949   /**
950    * Deletes an asset feed.
951    *
952    * <p>Sample code:
953    *
954    * <pre>{@code
955    * // This snippet has been automatically generated and should be regarded as a code template only.
956    * // It will require modifications to work:
957    * // - It may require correct/in-range values for request initialization.
958    * // - It may require specifying regional endpoints when creating the service client as shown in
959    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
960    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
961    *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
962    *   assetServiceClient.deleteFeed(name);
963    * }
964    * }</pre>
965    *
966    * @param name Required. The name of the feed and it must be in the format of:
967    *     projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id
968    *     organizations/organization_number/feeds/feed_id
969    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
970    */
deleteFeed(FeedName name)971   public final void deleteFeed(FeedName name) {
972     DeleteFeedRequest request =
973         DeleteFeedRequest.newBuilder().setName(name == null ? null : name.toString()).build();
974     deleteFeed(request);
975   }
976 
977   // AUTO-GENERATED DOCUMENTATION AND METHOD.
978   /**
979    * Deletes an asset feed.
980    *
981    * <p>Sample code:
982    *
983    * <pre>{@code
984    * // This snippet has been automatically generated and should be regarded as a code template only.
985    * // It will require modifications to work:
986    * // - It may require correct/in-range values for request initialization.
987    * // - It may require specifying regional endpoints when creating the service client as shown in
988    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
989    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
990    *   String name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString();
991    *   assetServiceClient.deleteFeed(name);
992    * }
993    * }</pre>
994    *
995    * @param name Required. The name of the feed and it must be in the format of:
996    *     projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id
997    *     organizations/organization_number/feeds/feed_id
998    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
999    */
deleteFeed(String name)1000   public final void deleteFeed(String name) {
1001     DeleteFeedRequest request = DeleteFeedRequest.newBuilder().setName(name).build();
1002     deleteFeed(request);
1003   }
1004 
1005   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1006   /**
1007    * Deletes an asset feed.
1008    *
1009    * <p>Sample code:
1010    *
1011    * <pre>{@code
1012    * // This snippet has been automatically generated and should be regarded as a code template only.
1013    * // It will require modifications to work:
1014    * // - It may require correct/in-range values for request initialization.
1015    * // - It may require specifying regional endpoints when creating the service client as shown in
1016    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1017    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1018    *   DeleteFeedRequest request =
1019    *       DeleteFeedRequest.newBuilder()
1020    *           .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString())
1021    *           .build();
1022    *   assetServiceClient.deleteFeed(request);
1023    * }
1024    * }</pre>
1025    *
1026    * @param request The request object containing all of the parameters for the API call.
1027    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1028    */
deleteFeed(DeleteFeedRequest request)1029   public final void deleteFeed(DeleteFeedRequest request) {
1030     deleteFeedCallable().call(request);
1031   }
1032 
1033   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1034   /**
1035    * Deletes an asset feed.
1036    *
1037    * <p>Sample code:
1038    *
1039    * <pre>{@code
1040    * // This snippet has been automatically generated and should be regarded as a code template only.
1041    * // It will require modifications to work:
1042    * // - It may require correct/in-range values for request initialization.
1043    * // - It may require specifying regional endpoints when creating the service client as shown in
1044    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1045    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1046    *   DeleteFeedRequest request =
1047    *       DeleteFeedRequest.newBuilder()
1048    *           .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString())
1049    *           .build();
1050    *   ApiFuture<Empty> future = assetServiceClient.deleteFeedCallable().futureCall(request);
1051    *   // Do something.
1052    *   future.get();
1053    * }
1054    * }</pre>
1055    */
deleteFeedCallable()1056   public final UnaryCallable<DeleteFeedRequest, Empty> deleteFeedCallable() {
1057     return stub.deleteFeedCallable();
1058   }
1059 
1060   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1061   /**
1062    * Searches all Google Cloud resources within the specified scope, such as a project, folder, or
1063    * organization. The caller must be granted the `cloudasset.assets.searchAllResources` permission
1064    * on the desired scope, otherwise the request will be rejected.
1065    *
1066    * <p>Sample code:
1067    *
1068    * <pre>{@code
1069    * // This snippet has been automatically generated and should be regarded as a code template only.
1070    * // It will require modifications to work:
1071    * // - It may require correct/in-range values for request initialization.
1072    * // - It may require specifying regional endpoints when creating the service client as shown in
1073    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1074    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1075    *   String scope = "scope109264468";
1076    *   String query = "query107944136";
1077    *   List<String> assetTypes = new ArrayList<>();
1078    *   for (ResourceSearchResult element :
1079    *       assetServiceClient.searchAllResources(scope, query, assetTypes).iterateAll()) {
1080    *     // doThingsWith(element);
1081    *   }
1082    * }
1083    * }</pre>
1084    *
1085    * @param scope Required. A scope can be a project, a folder, or an organization. The search is
1086    *     limited to the resources within the `scope`. The caller must be granted the
1087    *     [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
1088    *     permission on the desired scope.
1089    *     <p>The allowed values are:
1090    *     <ul>
1091    *       <li>projects/{PROJECT_ID} (e.g., "projects/foo-bar")
1092    *       <li>projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
1093    *       <li>folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
1094    *       <li>organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
1095    *     </ul>
1096    *
1097    * @param query Optional. The query statement. See [how to construct a
1098    *     query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query)
1099    *     for more information. If not specified or empty, it will search all the resources within
1100    *     the specified `scope`.
1101    *     <p>Examples:
1102    *     <ul>
1103    *       <li>`name:Important` to find Google Cloud resources whose name contains "Important" as a
1104    *           word.
1105    *       <li>`name=Important` to find the Google Cloud resource whose name is exactly "Important".
1106    *       <li>`displayName:Impor&#42;` to find Google Cloud resources whose display name contains
1107    *           "Impor" as a prefix of any word in the field.
1108    *       <li>`location:us-west&#42;` to find Google Cloud resources whose location contains both
1109    *           "us" and "west" as prefixes.
1110    *       <li>`labels:prod` to find Google Cloud resources whose labels contain "prod" as a key or
1111    *           value.
1112    *       <li>`labels.env:prod` to find Google Cloud resources that have a label "env" and its
1113    *           value is "prod".
1114    *       <li>`labels.env:&#42;` to find Google Cloud resources that have a label "env".
1115    *       <li>`kmsKey:key` to find Google Cloud resources encrypted with a customer-managed
1116    *           encryption key whose name contains "key" as a word. This field is deprecated. Please
1117    *           use the `kmsKeys` field to retrieve Cloud KMS key information.
1118    *       <li>`kmsKeys:key` to find Google Cloud resources encrypted with customer-managed
1119    *           encryption keys whose name contains the word "key".
1120    *       <li>`relationships:instance-group-1` to find Google Cloud resources that have
1121    *           relationships with "instance-group-1" in the related resource name.
1122    *       <li>`relationships:INSTANCE_TO_INSTANCEGROUP` to find Compute Engine instances that have
1123    *           relationships of type "INSTANCE_TO_INSTANCEGROUP".
1124    *       <li>`relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find Compute Engine
1125    *           instances that have relationships with "instance-group-1" in the Compute Engine
1126    *           instance group resource name, for relationship type "INSTANCE_TO_INSTANCEGROUP".
1127    *       <li>`state:ACTIVE` to find Google Cloud resources whose state contains "ACTIVE" as a
1128    *           word.
1129    *       <li>`NOT state:ACTIVE` to find Google Cloud resources whose state doesn't contain
1130    *           "ACTIVE" as a word.
1131    *       <li>`createTime&lt;1609459200` to find Google Cloud resources that were created before
1132    *           "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of "2021-01-01 00:00:00
1133    *           UTC" in seconds.
1134    *       <li>`updateTime&gt;1609459200` to find Google Cloud resources that were updated after
1135    *           "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of "2021-01-01 00:00:00
1136    *           UTC" in seconds.
1137    *       <li>`Important` to find Google Cloud resources that contain "Important" as a word in any
1138    *           of the searchable fields.
1139    *       <li>`Impor&#42;` to find Google Cloud resources that contain "Impor" as a prefix of any
1140    *           word in any of the searchable fields.
1141    *       <li>`Important location:(us-west1 OR global)` to find Google Cloud resources that contain
1142    *           "Important" as a word in any of the searchable fields and are also located in the
1143    *           "us-west1" region or the "global" location.
1144    *     </ul>
1145    *
1146    * @param assetTypes Optional. A list of asset types that this request searches for. If empty, it
1147    *     will search all the [searchable asset
1148    *     types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
1149    *     <p>Regular expressions are also supported. For example:
1150    *     <ul>
1151    *       <li>"compute.googleapis.com.&#42;" snapshots resources whose asset type starts with
1152    *           "compute.googleapis.com".
1153    *       <li>".&#42;Instance" snapshots resources whose asset type ends with "Instance".
1154    *       <li>".&#42;Instance.&#42;" snapshots resources whose asset type contains "Instance".
1155    *     </ul>
1156    *     <p>See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported regular
1157    *     expression syntax. If the regular expression does not match any supported asset type, an
1158    *     INVALID_ARGUMENT error will be returned.
1159    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1160    */
searchAllResources( String scope, String query, List<String> assetTypes)1161   public final SearchAllResourcesPagedResponse searchAllResources(
1162       String scope, String query, List<String> assetTypes) {
1163     SearchAllResourcesRequest request =
1164         SearchAllResourcesRequest.newBuilder()
1165             .setScope(scope)
1166             .setQuery(query)
1167             .addAllAssetTypes(assetTypes)
1168             .build();
1169     return searchAllResources(request);
1170   }
1171 
1172   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1173   /**
1174    * Searches all Google Cloud resources within the specified scope, such as a project, folder, or
1175    * organization. The caller must be granted the `cloudasset.assets.searchAllResources` permission
1176    * on the desired scope, otherwise the request will be rejected.
1177    *
1178    * <p>Sample code:
1179    *
1180    * <pre>{@code
1181    * // This snippet has been automatically generated and should be regarded as a code template only.
1182    * // It will require modifications to work:
1183    * // - It may require correct/in-range values for request initialization.
1184    * // - It may require specifying regional endpoints when creating the service client as shown in
1185    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1186    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1187    *   SearchAllResourcesRequest request =
1188    *       SearchAllResourcesRequest.newBuilder()
1189    *           .setScope("scope109264468")
1190    *           .setQuery("query107944136")
1191    *           .addAllAssetTypes(new ArrayList<String>())
1192    *           .setPageSize(883849137)
1193    *           .setPageToken("pageToken873572522")
1194    *           .setOrderBy("orderBy-1207110587")
1195    *           .setReadMask(FieldMask.newBuilder().build())
1196    *           .build();
1197    *   for (ResourceSearchResult element :
1198    *       assetServiceClient.searchAllResources(request).iterateAll()) {
1199    *     // doThingsWith(element);
1200    *   }
1201    * }
1202    * }</pre>
1203    *
1204    * @param request The request object containing all of the parameters for the API call.
1205    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1206    */
searchAllResources( SearchAllResourcesRequest request)1207   public final SearchAllResourcesPagedResponse searchAllResources(
1208       SearchAllResourcesRequest request) {
1209     return searchAllResourcesPagedCallable().call(request);
1210   }
1211 
1212   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1213   /**
1214    * Searches all Google Cloud resources within the specified scope, such as a project, folder, or
1215    * organization. The caller must be granted the `cloudasset.assets.searchAllResources` permission
1216    * on the desired scope, otherwise the request will be rejected.
1217    *
1218    * <p>Sample code:
1219    *
1220    * <pre>{@code
1221    * // This snippet has been automatically generated and should be regarded as a code template only.
1222    * // It will require modifications to work:
1223    * // - It may require correct/in-range values for request initialization.
1224    * // - It may require specifying regional endpoints when creating the service client as shown in
1225    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1226    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1227    *   SearchAllResourcesRequest request =
1228    *       SearchAllResourcesRequest.newBuilder()
1229    *           .setScope("scope109264468")
1230    *           .setQuery("query107944136")
1231    *           .addAllAssetTypes(new ArrayList<String>())
1232    *           .setPageSize(883849137)
1233    *           .setPageToken("pageToken873572522")
1234    *           .setOrderBy("orderBy-1207110587")
1235    *           .setReadMask(FieldMask.newBuilder().build())
1236    *           .build();
1237    *   ApiFuture<ResourceSearchResult> future =
1238    *       assetServiceClient.searchAllResourcesPagedCallable().futureCall(request);
1239    *   // Do something.
1240    *   for (ResourceSearchResult element : future.get().iterateAll()) {
1241    *     // doThingsWith(element);
1242    *   }
1243    * }
1244    * }</pre>
1245    */
1246   public final UnaryCallable<SearchAllResourcesRequest, SearchAllResourcesPagedResponse>
searchAllResourcesPagedCallable()1247       searchAllResourcesPagedCallable() {
1248     return stub.searchAllResourcesPagedCallable();
1249   }
1250 
1251   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1252   /**
1253    * Searches all Google Cloud resources within the specified scope, such as a project, folder, or
1254    * organization. The caller must be granted the `cloudasset.assets.searchAllResources` permission
1255    * on the desired scope, otherwise the request will be rejected.
1256    *
1257    * <p>Sample code:
1258    *
1259    * <pre>{@code
1260    * // This snippet has been automatically generated and should be regarded as a code template only.
1261    * // It will require modifications to work:
1262    * // - It may require correct/in-range values for request initialization.
1263    * // - It may require specifying regional endpoints when creating the service client as shown in
1264    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1265    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1266    *   SearchAllResourcesRequest request =
1267    *       SearchAllResourcesRequest.newBuilder()
1268    *           .setScope("scope109264468")
1269    *           .setQuery("query107944136")
1270    *           .addAllAssetTypes(new ArrayList<String>())
1271    *           .setPageSize(883849137)
1272    *           .setPageToken("pageToken873572522")
1273    *           .setOrderBy("orderBy-1207110587")
1274    *           .setReadMask(FieldMask.newBuilder().build())
1275    *           .build();
1276    *   while (true) {
1277    *     SearchAllResourcesResponse response =
1278    *         assetServiceClient.searchAllResourcesCallable().call(request);
1279    *     for (ResourceSearchResult element : response.getResultsList()) {
1280    *       // doThingsWith(element);
1281    *     }
1282    *     String nextPageToken = response.getNextPageToken();
1283    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
1284    *       request = request.toBuilder().setPageToken(nextPageToken).build();
1285    *     } else {
1286    *       break;
1287    *     }
1288    *   }
1289    * }
1290    * }</pre>
1291    */
1292   public final UnaryCallable<SearchAllResourcesRequest, SearchAllResourcesResponse>
searchAllResourcesCallable()1293       searchAllResourcesCallable() {
1294     return stub.searchAllResourcesCallable();
1295   }
1296 
1297   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1298   /**
1299    * Searches all IAM policies within the specified scope, such as a project, folder, or
1300    * organization. The caller must be granted the `cloudasset.assets.searchAllIamPolicies`
1301    * permission on the desired scope, otherwise the request will be rejected.
1302    *
1303    * <p>Sample code:
1304    *
1305    * <pre>{@code
1306    * // This snippet has been automatically generated and should be regarded as a code template only.
1307    * // It will require modifications to work:
1308    * // - It may require correct/in-range values for request initialization.
1309    * // - It may require specifying regional endpoints when creating the service client as shown in
1310    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1311    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1312    *   String scope = "scope109264468";
1313    *   String query = "query107944136";
1314    *   for (IamPolicySearchResult element :
1315    *       assetServiceClient.searchAllIamPolicies(scope, query).iterateAll()) {
1316    *     // doThingsWith(element);
1317    *   }
1318    * }
1319    * }</pre>
1320    *
1321    * @param scope Required. A scope can be a project, a folder, or an organization. The search is
1322    *     limited to the IAM policies within the `scope`. The caller must be granted the
1323    *     [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
1324    *     permission on the desired scope.
1325    *     <p>The allowed values are:
1326    *     <ul>
1327    *       <li>projects/{PROJECT_ID} (e.g., "projects/foo-bar")
1328    *       <li>projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
1329    *       <li>folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
1330    *       <li>organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
1331    *     </ul>
1332    *
1333    * @param query Optional. The query statement. See [how to construct a
1334    *     query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query)
1335    *     for more information. If not specified or empty, it will search all the IAM policies within
1336    *     the specified `scope`. Note that the query string is compared against each IAM policy
1337    *     binding, including its principals, roles, and IAM conditions. The returned IAM policies
1338    *     will only contain the bindings that match your query. To learn more about the IAM policy
1339    *     structure, see the [IAM policy
1340    *     documentation](https://cloud.google.com/iam/help/allow-policies/structure).
1341    *     <p>Examples:
1342    *     <ul>
1343    *       <li>`policy:amy{@literal @}gmail.com` to find IAM policy bindings that specify user
1344    *           "amy{@literal @}gmail.com".
1345    *       <li>`policy:roles/compute.admin` to find IAM policy bindings that specify the Compute
1346    *           Admin role.
1347    *       <li>`policy:comp&#42;` to find IAM policy bindings that contain "comp" as a prefix of any
1348    *           word in the binding.
1349    *       <li>`policy.role.permissions:storage.buckets.update` to find IAM policy bindings that
1350    *           specify a role containing "storage.buckets.update" permission. Note that if callers
1351    *           don't have `iam.roles.get` access to a role's included permissions, policy bindings
1352    *           that specify this role will be dropped from the search results.
1353    *       <li>`policy.role.permissions:upd&#42;` to find IAM policy bindings that specify a role
1354    *           containing "upd" as a prefix of any word in the role permission. Note that if callers
1355    *           don't have `iam.roles.get` access to a role's included permissions, policy bindings
1356    *           that specify this role will be dropped from the search results.
1357    *       <li>`resource:organizations/123456` to find IAM policy bindings that are set on
1358    *           "organizations/123456".
1359    *       <li>`resource=//cloudresourcemanager.googleapis.com/projects/myproject` to find IAM
1360    *           policy bindings that are set on the project named "myproject".
1361    *       <li>`Important` to find IAM policy bindings that contain "Important" as a word in any of
1362    *           the searchable fields (except for the included permissions).
1363    *       <li>`resource:(instance1 OR instance2) policy:amy` to find IAM policy bindings that are
1364    *           set on resources "instance1" or "instance2" and also specify user "amy".
1365    *       <li>`roles:roles/compute.admin` to find IAM policy bindings that specify the Compute
1366    *           Admin role.
1367    *       <li>`memberTypes:user` to find IAM policy bindings that contain the principal type
1368    *           "user".
1369    *     </ul>
1370    *
1371    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1372    */
searchAllIamPolicies(String scope, String query)1373   public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies(String scope, String query) {
1374     SearchAllIamPoliciesRequest request =
1375         SearchAllIamPoliciesRequest.newBuilder().setScope(scope).setQuery(query).build();
1376     return searchAllIamPolicies(request);
1377   }
1378 
1379   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1380   /**
1381    * Searches all IAM policies within the specified scope, such as a project, folder, or
1382    * organization. The caller must be granted the `cloudasset.assets.searchAllIamPolicies`
1383    * permission on the desired scope, otherwise the request will be rejected.
1384    *
1385    * <p>Sample code:
1386    *
1387    * <pre>{@code
1388    * // This snippet has been automatically generated and should be regarded as a code template only.
1389    * // It will require modifications to work:
1390    * // - It may require correct/in-range values for request initialization.
1391    * // - It may require specifying regional endpoints when creating the service client as shown in
1392    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1393    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1394    *   SearchAllIamPoliciesRequest request =
1395    *       SearchAllIamPoliciesRequest.newBuilder()
1396    *           .setScope("scope109264468")
1397    *           .setQuery("query107944136")
1398    *           .setPageSize(883849137)
1399    *           .setPageToken("pageToken873572522")
1400    *           .addAllAssetTypes(new ArrayList<String>())
1401    *           .setOrderBy("orderBy-1207110587")
1402    *           .build();
1403    *   for (IamPolicySearchResult element :
1404    *       assetServiceClient.searchAllIamPolicies(request).iterateAll()) {
1405    *     // doThingsWith(element);
1406    *   }
1407    * }
1408    * }</pre>
1409    *
1410    * @param request The request object containing all of the parameters for the API call.
1411    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1412    */
searchAllIamPolicies( SearchAllIamPoliciesRequest request)1413   public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies(
1414       SearchAllIamPoliciesRequest request) {
1415     return searchAllIamPoliciesPagedCallable().call(request);
1416   }
1417 
1418   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1419   /**
1420    * Searches all IAM policies within the specified scope, such as a project, folder, or
1421    * organization. The caller must be granted the `cloudasset.assets.searchAllIamPolicies`
1422    * permission on the desired scope, otherwise the request will be rejected.
1423    *
1424    * <p>Sample code:
1425    *
1426    * <pre>{@code
1427    * // This snippet has been automatically generated and should be regarded as a code template only.
1428    * // It will require modifications to work:
1429    * // - It may require correct/in-range values for request initialization.
1430    * // - It may require specifying regional endpoints when creating the service client as shown in
1431    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1432    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1433    *   SearchAllIamPoliciesRequest request =
1434    *       SearchAllIamPoliciesRequest.newBuilder()
1435    *           .setScope("scope109264468")
1436    *           .setQuery("query107944136")
1437    *           .setPageSize(883849137)
1438    *           .setPageToken("pageToken873572522")
1439    *           .addAllAssetTypes(new ArrayList<String>())
1440    *           .setOrderBy("orderBy-1207110587")
1441    *           .build();
1442    *   ApiFuture<IamPolicySearchResult> future =
1443    *       assetServiceClient.searchAllIamPoliciesPagedCallable().futureCall(request);
1444    *   // Do something.
1445    *   for (IamPolicySearchResult element : future.get().iterateAll()) {
1446    *     // doThingsWith(element);
1447    *   }
1448    * }
1449    * }</pre>
1450    */
1451   public final UnaryCallable<SearchAllIamPoliciesRequest, SearchAllIamPoliciesPagedResponse>
searchAllIamPoliciesPagedCallable()1452       searchAllIamPoliciesPagedCallable() {
1453     return stub.searchAllIamPoliciesPagedCallable();
1454   }
1455 
1456   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1457   /**
1458    * Searches all IAM policies within the specified scope, such as a project, folder, or
1459    * organization. The caller must be granted the `cloudasset.assets.searchAllIamPolicies`
1460    * permission on the desired scope, otherwise the request will be rejected.
1461    *
1462    * <p>Sample code:
1463    *
1464    * <pre>{@code
1465    * // This snippet has been automatically generated and should be regarded as a code template only.
1466    * // It will require modifications to work:
1467    * // - It may require correct/in-range values for request initialization.
1468    * // - It may require specifying regional endpoints when creating the service client as shown in
1469    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1470    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1471    *   SearchAllIamPoliciesRequest request =
1472    *       SearchAllIamPoliciesRequest.newBuilder()
1473    *           .setScope("scope109264468")
1474    *           .setQuery("query107944136")
1475    *           .setPageSize(883849137)
1476    *           .setPageToken("pageToken873572522")
1477    *           .addAllAssetTypes(new ArrayList<String>())
1478    *           .setOrderBy("orderBy-1207110587")
1479    *           .build();
1480    *   while (true) {
1481    *     SearchAllIamPoliciesResponse response =
1482    *         assetServiceClient.searchAllIamPoliciesCallable().call(request);
1483    *     for (IamPolicySearchResult element : response.getResultsList()) {
1484    *       // doThingsWith(element);
1485    *     }
1486    *     String nextPageToken = response.getNextPageToken();
1487    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
1488    *       request = request.toBuilder().setPageToken(nextPageToken).build();
1489    *     } else {
1490    *       break;
1491    *     }
1492    *   }
1493    * }
1494    * }</pre>
1495    */
1496   public final UnaryCallable<SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse>
searchAllIamPoliciesCallable()1497       searchAllIamPoliciesCallable() {
1498     return stub.searchAllIamPoliciesCallable();
1499   }
1500 
1501   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1502   /**
1503    * Analyzes IAM policies to answer which identities have what accesses on which resources.
1504    *
1505    * <p>Sample code:
1506    *
1507    * <pre>{@code
1508    * // This snippet has been automatically generated and should be regarded as a code template only.
1509    * // It will require modifications to work:
1510    * // - It may require correct/in-range values for request initialization.
1511    * // - It may require specifying regional endpoints when creating the service client as shown in
1512    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1513    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1514    *   AnalyzeIamPolicyRequest request =
1515    *       AnalyzeIamPolicyRequest.newBuilder()
1516    *           .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build())
1517    *           .setSavedAnalysisQuery("savedAnalysisQuery376058885")
1518    *           .setExecutionTimeout(Duration.newBuilder().build())
1519    *           .build();
1520    *   AnalyzeIamPolicyResponse response = assetServiceClient.analyzeIamPolicy(request);
1521    * }
1522    * }</pre>
1523    *
1524    * @param request The request object containing all of the parameters for the API call.
1525    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1526    */
analyzeIamPolicy(AnalyzeIamPolicyRequest request)1527   public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest request) {
1528     return analyzeIamPolicyCallable().call(request);
1529   }
1530 
1531   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1532   /**
1533    * Analyzes IAM policies to answer which identities have what accesses on which resources.
1534    *
1535    * <p>Sample code:
1536    *
1537    * <pre>{@code
1538    * // This snippet has been automatically generated and should be regarded as a code template only.
1539    * // It will require modifications to work:
1540    * // - It may require correct/in-range values for request initialization.
1541    * // - It may require specifying regional endpoints when creating the service client as shown in
1542    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1543    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1544    *   AnalyzeIamPolicyRequest request =
1545    *       AnalyzeIamPolicyRequest.newBuilder()
1546    *           .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build())
1547    *           .setSavedAnalysisQuery("savedAnalysisQuery376058885")
1548    *           .setExecutionTimeout(Duration.newBuilder().build())
1549    *           .build();
1550    *   ApiFuture<AnalyzeIamPolicyResponse> future =
1551    *       assetServiceClient.analyzeIamPolicyCallable().futureCall(request);
1552    *   // Do something.
1553    *   AnalyzeIamPolicyResponse response = future.get();
1554    * }
1555    * }</pre>
1556    */
1557   public final UnaryCallable<AnalyzeIamPolicyRequest, AnalyzeIamPolicyResponse>
analyzeIamPolicyCallable()1558       analyzeIamPolicyCallable() {
1559     return stub.analyzeIamPolicyCallable();
1560   }
1561 
1562   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1563   /**
1564    * Analyzes IAM policies asynchronously to answer which identities have what accesses on which
1565    * resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination.
1566    * For Cloud Storage destination, the output format is the JSON format that represents a
1567    * [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method
1568    * implements the [google.longrunning.Operation][google.longrunning.Operation], which allows you
1569    * to track the operation status. We recommend intervals of at least 2 seconds with exponential
1570    * backoff retry to poll the operation result. The metadata contains the metadata for the
1571    * long-running operation.
1572    *
1573    * <p>Sample code:
1574    *
1575    * <pre>{@code
1576    * // This snippet has been automatically generated and should be regarded as a code template only.
1577    * // It will require modifications to work:
1578    * // - It may require correct/in-range values for request initialization.
1579    * // - It may require specifying regional endpoints when creating the service client as shown in
1580    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1581    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1582    *   AnalyzeIamPolicyLongrunningRequest request =
1583    *       AnalyzeIamPolicyLongrunningRequest.newBuilder()
1584    *           .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build())
1585    *           .setSavedAnalysisQuery("savedAnalysisQuery376058885")
1586    *           .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build())
1587    *           .build();
1588    *   AnalyzeIamPolicyLongrunningResponse response =
1589    *       assetServiceClient.analyzeIamPolicyLongrunningAsync(request).get();
1590    * }
1591    * }</pre>
1592    *
1593    * @param request The request object containing all of the parameters for the API call.
1594    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1595    */
1596   public final OperationFuture<
1597           AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningMetadata>
analyzeIamPolicyLongrunningAsync(AnalyzeIamPolicyLongrunningRequest request)1598       analyzeIamPolicyLongrunningAsync(AnalyzeIamPolicyLongrunningRequest request) {
1599     return analyzeIamPolicyLongrunningOperationCallable().futureCall(request);
1600   }
1601 
1602   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1603   /**
1604    * Analyzes IAM policies asynchronously to answer which identities have what accesses on which
1605    * resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination.
1606    * For Cloud Storage destination, the output format is the JSON format that represents a
1607    * [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method
1608    * implements the [google.longrunning.Operation][google.longrunning.Operation], which allows you
1609    * to track the operation status. We recommend intervals of at least 2 seconds with exponential
1610    * backoff retry to poll the operation result. The metadata contains the metadata for the
1611    * long-running operation.
1612    *
1613    * <p>Sample code:
1614    *
1615    * <pre>{@code
1616    * // This snippet has been automatically generated and should be regarded as a code template only.
1617    * // It will require modifications to work:
1618    * // - It may require correct/in-range values for request initialization.
1619    * // - It may require specifying regional endpoints when creating the service client as shown in
1620    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1621    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1622    *   AnalyzeIamPolicyLongrunningRequest request =
1623    *       AnalyzeIamPolicyLongrunningRequest.newBuilder()
1624    *           .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build())
1625    *           .setSavedAnalysisQuery("savedAnalysisQuery376058885")
1626    *           .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build())
1627    *           .build();
1628    *   OperationFuture<AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningMetadata>
1629    *       future =
1630    *           assetServiceClient.analyzeIamPolicyLongrunningOperationCallable().futureCall(request);
1631    *   // Do something.
1632    *   AnalyzeIamPolicyLongrunningResponse response = future.get();
1633    * }
1634    * }</pre>
1635    */
1636   public final OperationCallable<
1637           AnalyzeIamPolicyLongrunningRequest,
1638           AnalyzeIamPolicyLongrunningResponse,
1639           AnalyzeIamPolicyLongrunningMetadata>
analyzeIamPolicyLongrunningOperationCallable()1640       analyzeIamPolicyLongrunningOperationCallable() {
1641     return stub.analyzeIamPolicyLongrunningOperationCallable();
1642   }
1643 
1644   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1645   /**
1646    * Analyzes IAM policies asynchronously to answer which identities have what accesses on which
1647    * resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination.
1648    * For Cloud Storage destination, the output format is the JSON format that represents a
1649    * [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method
1650    * implements the [google.longrunning.Operation][google.longrunning.Operation], which allows you
1651    * to track the operation status. We recommend intervals of at least 2 seconds with exponential
1652    * backoff retry to poll the operation result. The metadata contains the metadata for the
1653    * long-running operation.
1654    *
1655    * <p>Sample code:
1656    *
1657    * <pre>{@code
1658    * // This snippet has been automatically generated and should be regarded as a code template only.
1659    * // It will require modifications to work:
1660    * // - It may require correct/in-range values for request initialization.
1661    * // - It may require specifying regional endpoints when creating the service client as shown in
1662    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1663    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1664    *   AnalyzeIamPolicyLongrunningRequest request =
1665    *       AnalyzeIamPolicyLongrunningRequest.newBuilder()
1666    *           .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build())
1667    *           .setSavedAnalysisQuery("savedAnalysisQuery376058885")
1668    *           .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build())
1669    *           .build();
1670    *   ApiFuture<Operation> future =
1671    *       assetServiceClient.analyzeIamPolicyLongrunningCallable().futureCall(request);
1672    *   // Do something.
1673    *   Operation response = future.get();
1674    * }
1675    * }</pre>
1676    */
1677   public final UnaryCallable<AnalyzeIamPolicyLongrunningRequest, Operation>
analyzeIamPolicyLongrunningCallable()1678       analyzeIamPolicyLongrunningCallable() {
1679     return stub.analyzeIamPolicyLongrunningCallable();
1680   }
1681 
1682   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1683   /**
1684    * Analyze moving a resource to a specified destination without kicking off the actual move. The
1685    * analysis is best effort depending on the user's permissions of viewing different hierarchical
1686    * policies and configurations. The policies and configuration are subject to change before the
1687    * actual resource migration takes place.
1688    *
1689    * <p>Sample code:
1690    *
1691    * <pre>{@code
1692    * // This snippet has been automatically generated and should be regarded as a code template only.
1693    * // It will require modifications to work:
1694    * // - It may require correct/in-range values for request initialization.
1695    * // - It may require specifying regional endpoints when creating the service client as shown in
1696    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1697    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1698    *   AnalyzeMoveRequest request =
1699    *       AnalyzeMoveRequest.newBuilder()
1700    *           .setResource("resource-341064690")
1701    *           .setDestinationParent("destinationParent-1733659048")
1702    *           .build();
1703    *   AnalyzeMoveResponse response = assetServiceClient.analyzeMove(request);
1704    * }
1705    * }</pre>
1706    *
1707    * @param request The request object containing all of the parameters for the API call.
1708    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1709    */
analyzeMove(AnalyzeMoveRequest request)1710   public final AnalyzeMoveResponse analyzeMove(AnalyzeMoveRequest request) {
1711     return analyzeMoveCallable().call(request);
1712   }
1713 
1714   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1715   /**
1716    * Analyze moving a resource to a specified destination without kicking off the actual move. The
1717    * analysis is best effort depending on the user's permissions of viewing different hierarchical
1718    * policies and configurations. The policies and configuration are subject to change before the
1719    * actual resource migration takes place.
1720    *
1721    * <p>Sample code:
1722    *
1723    * <pre>{@code
1724    * // This snippet has been automatically generated and should be regarded as a code template only.
1725    * // It will require modifications to work:
1726    * // - It may require correct/in-range values for request initialization.
1727    * // - It may require specifying regional endpoints when creating the service client as shown in
1728    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1729    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1730    *   AnalyzeMoveRequest request =
1731    *       AnalyzeMoveRequest.newBuilder()
1732    *           .setResource("resource-341064690")
1733    *           .setDestinationParent("destinationParent-1733659048")
1734    *           .build();
1735    *   ApiFuture<AnalyzeMoveResponse> future =
1736    *       assetServiceClient.analyzeMoveCallable().futureCall(request);
1737    *   // Do something.
1738    *   AnalyzeMoveResponse response = future.get();
1739    * }
1740    * }</pre>
1741    */
analyzeMoveCallable()1742   public final UnaryCallable<AnalyzeMoveRequest, AnalyzeMoveResponse> analyzeMoveCallable() {
1743     return stub.analyzeMoveCallable();
1744   }
1745 
1746   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1747   /**
1748    * Issue a job that queries assets using a SQL statement compatible with [BigQuery Standard
1749    * SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
1750    *
1751    * <p>If the query execution finishes within timeout and there's no pagination, the full query
1752    * results will be returned in the `QueryAssetsResponse`.
1753    *
1754    * <p>Otherwise, full query results can be obtained by issuing extra requests with the
1755    * `job_reference` from the a previous `QueryAssets` call.
1756    *
1757    * <p>Note, the query result has approximately 10 GB limitation enforced by BigQuery
1758    * https://cloud.google.com/bigquery/docs/best-practices-performance-output, queries return larger
1759    * results will result in errors.
1760    *
1761    * <p>Sample code:
1762    *
1763    * <pre>{@code
1764    * // This snippet has been automatically generated and should be regarded as a code template only.
1765    * // It will require modifications to work:
1766    * // - It may require correct/in-range values for request initialization.
1767    * // - It may require specifying regional endpoints when creating the service client as shown in
1768    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1769    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1770    *   QueryAssetsRequest request =
1771    *       QueryAssetsRequest.newBuilder()
1772    *           .setParent(FolderName.of("[FOLDER]").toString())
1773    *           .setPageSize(883849137)
1774    *           .setPageToken("pageToken873572522")
1775    *           .setTimeout(Duration.newBuilder().build())
1776    *           .setOutputConfig(QueryAssetsOutputConfig.newBuilder().build())
1777    *           .build();
1778    *   QueryAssetsResponse response = assetServiceClient.queryAssets(request);
1779    * }
1780    * }</pre>
1781    *
1782    * @param request The request object containing all of the parameters for the API call.
1783    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1784    */
queryAssets(QueryAssetsRequest request)1785   public final QueryAssetsResponse queryAssets(QueryAssetsRequest request) {
1786     return queryAssetsCallable().call(request);
1787   }
1788 
1789   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1790   /**
1791    * Issue a job that queries assets using a SQL statement compatible with [BigQuery Standard
1792    * SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
1793    *
1794    * <p>If the query execution finishes within timeout and there's no pagination, the full query
1795    * results will be returned in the `QueryAssetsResponse`.
1796    *
1797    * <p>Otherwise, full query results can be obtained by issuing extra requests with the
1798    * `job_reference` from the a previous `QueryAssets` call.
1799    *
1800    * <p>Note, the query result has approximately 10 GB limitation enforced by BigQuery
1801    * https://cloud.google.com/bigquery/docs/best-practices-performance-output, queries return larger
1802    * results will result in errors.
1803    *
1804    * <p>Sample code:
1805    *
1806    * <pre>{@code
1807    * // This snippet has been automatically generated and should be regarded as a code template only.
1808    * // It will require modifications to work:
1809    * // - It may require correct/in-range values for request initialization.
1810    * // - It may require specifying regional endpoints when creating the service client as shown in
1811    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1812    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1813    *   QueryAssetsRequest request =
1814    *       QueryAssetsRequest.newBuilder()
1815    *           .setParent(FolderName.of("[FOLDER]").toString())
1816    *           .setPageSize(883849137)
1817    *           .setPageToken("pageToken873572522")
1818    *           .setTimeout(Duration.newBuilder().build())
1819    *           .setOutputConfig(QueryAssetsOutputConfig.newBuilder().build())
1820    *           .build();
1821    *   ApiFuture<QueryAssetsResponse> future =
1822    *       assetServiceClient.queryAssetsCallable().futureCall(request);
1823    *   // Do something.
1824    *   QueryAssetsResponse response = future.get();
1825    * }
1826    * }</pre>
1827    */
queryAssetsCallable()1828   public final UnaryCallable<QueryAssetsRequest, QueryAssetsResponse> queryAssetsCallable() {
1829     return stub.queryAssetsCallable();
1830   }
1831 
1832   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1833   /**
1834    * Creates a saved query in a parent project/folder/organization.
1835    *
1836    * <p>Sample code:
1837    *
1838    * <pre>{@code
1839    * // This snippet has been automatically generated and should be regarded as a code template only.
1840    * // It will require modifications to work:
1841    * // - It may require correct/in-range values for request initialization.
1842    * // - It may require specifying regional endpoints when creating the service client as shown in
1843    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1844    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1845    *   FolderName parent = FolderName.of("[FOLDER]");
1846    *   SavedQuery savedQuery = SavedQuery.newBuilder().build();
1847    *   String savedQueryId = "savedQueryId378086268";
1848    *   SavedQuery response = assetServiceClient.createSavedQuery(parent, savedQuery, savedQueryId);
1849    * }
1850    * }</pre>
1851    *
1852    * @param parent Required. The name of the project/folder/organization where this saved_query
1853    *     should be created in. It can only be an organization number (such as "organizations/123"),
1854    *     a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"),
1855    *     or a project number (such as "projects/12345").
1856    * @param savedQuery Required. The saved_query details. The `name` field must be empty as it will
1857    *     be generated based on the parent and saved_query_id.
1858    * @param savedQueryId Required. The ID to use for the saved query, which must be unique in the
1859    *     specified parent. It will become the final component of the saved query's resource name.
1860    *     <p>This value should be 4-63 characters, and valid characters are `[a-z][0-9]-`.
1861    *     <p>Notice that this field is required in the saved query creation, and the `name` field of
1862    *     the `saved_query` will be ignored.
1863    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1864    */
createSavedQuery( FolderName parent, SavedQuery savedQuery, String savedQueryId)1865   public final SavedQuery createSavedQuery(
1866       FolderName parent, SavedQuery savedQuery, String savedQueryId) {
1867     CreateSavedQueryRequest request =
1868         CreateSavedQueryRequest.newBuilder()
1869             .setParent(parent == null ? null : parent.toString())
1870             .setSavedQuery(savedQuery)
1871             .setSavedQueryId(savedQueryId)
1872             .build();
1873     return createSavedQuery(request);
1874   }
1875 
1876   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1877   /**
1878    * Creates a saved query in a parent project/folder/organization.
1879    *
1880    * <p>Sample code:
1881    *
1882    * <pre>{@code
1883    * // This snippet has been automatically generated and should be regarded as a code template only.
1884    * // It will require modifications to work:
1885    * // - It may require correct/in-range values for request initialization.
1886    * // - It may require specifying regional endpoints when creating the service client as shown in
1887    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1888    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1889    *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
1890    *   SavedQuery savedQuery = SavedQuery.newBuilder().build();
1891    *   String savedQueryId = "savedQueryId378086268";
1892    *   SavedQuery response = assetServiceClient.createSavedQuery(parent, savedQuery, savedQueryId);
1893    * }
1894    * }</pre>
1895    *
1896    * @param parent Required. The name of the project/folder/organization where this saved_query
1897    *     should be created in. It can only be an organization number (such as "organizations/123"),
1898    *     a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"),
1899    *     or a project number (such as "projects/12345").
1900    * @param savedQuery Required. The saved_query details. The `name` field must be empty as it will
1901    *     be generated based on the parent and saved_query_id.
1902    * @param savedQueryId Required. The ID to use for the saved query, which must be unique in the
1903    *     specified parent. It will become the final component of the saved query's resource name.
1904    *     <p>This value should be 4-63 characters, and valid characters are `[a-z][0-9]-`.
1905    *     <p>Notice that this field is required in the saved query creation, and the `name` field of
1906    *     the `saved_query` will be ignored.
1907    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1908    */
createSavedQuery( OrganizationName parent, SavedQuery savedQuery, String savedQueryId)1909   public final SavedQuery createSavedQuery(
1910       OrganizationName parent, SavedQuery savedQuery, String savedQueryId) {
1911     CreateSavedQueryRequest request =
1912         CreateSavedQueryRequest.newBuilder()
1913             .setParent(parent == null ? null : parent.toString())
1914             .setSavedQuery(savedQuery)
1915             .setSavedQueryId(savedQueryId)
1916             .build();
1917     return createSavedQuery(request);
1918   }
1919 
1920   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1921   /**
1922    * Creates a saved query in a parent project/folder/organization.
1923    *
1924    * <p>Sample code:
1925    *
1926    * <pre>{@code
1927    * // This snippet has been automatically generated and should be regarded as a code template only.
1928    * // It will require modifications to work:
1929    * // - It may require correct/in-range values for request initialization.
1930    * // - It may require specifying regional endpoints when creating the service client as shown in
1931    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1932    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1933    *   ProjectName parent = ProjectName.of("[PROJECT]");
1934    *   SavedQuery savedQuery = SavedQuery.newBuilder().build();
1935    *   String savedQueryId = "savedQueryId378086268";
1936    *   SavedQuery response = assetServiceClient.createSavedQuery(parent, savedQuery, savedQueryId);
1937    * }
1938    * }</pre>
1939    *
1940    * @param parent Required. The name of the project/folder/organization where this saved_query
1941    *     should be created in. It can only be an organization number (such as "organizations/123"),
1942    *     a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"),
1943    *     or a project number (such as "projects/12345").
1944    * @param savedQuery Required. The saved_query details. The `name` field must be empty as it will
1945    *     be generated based on the parent and saved_query_id.
1946    * @param savedQueryId Required. The ID to use for the saved query, which must be unique in the
1947    *     specified parent. It will become the final component of the saved query's resource name.
1948    *     <p>This value should be 4-63 characters, and valid characters are `[a-z][0-9]-`.
1949    *     <p>Notice that this field is required in the saved query creation, and the `name` field of
1950    *     the `saved_query` will be ignored.
1951    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1952    */
createSavedQuery( ProjectName parent, SavedQuery savedQuery, String savedQueryId)1953   public final SavedQuery createSavedQuery(
1954       ProjectName parent, SavedQuery savedQuery, String savedQueryId) {
1955     CreateSavedQueryRequest request =
1956         CreateSavedQueryRequest.newBuilder()
1957             .setParent(parent == null ? null : parent.toString())
1958             .setSavedQuery(savedQuery)
1959             .setSavedQueryId(savedQueryId)
1960             .build();
1961     return createSavedQuery(request);
1962   }
1963 
1964   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1965   /**
1966    * Creates a saved query in a parent project/folder/organization.
1967    *
1968    * <p>Sample code:
1969    *
1970    * <pre>{@code
1971    * // This snippet has been automatically generated and should be regarded as a code template only.
1972    * // It will require modifications to work:
1973    * // - It may require correct/in-range values for request initialization.
1974    * // - It may require specifying regional endpoints when creating the service client as shown in
1975    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1976    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1977    *   String parent = ProjectName.of("[PROJECT]").toString();
1978    *   SavedQuery savedQuery = SavedQuery.newBuilder().build();
1979    *   String savedQueryId = "savedQueryId378086268";
1980    *   SavedQuery response = assetServiceClient.createSavedQuery(parent, savedQuery, savedQueryId);
1981    * }
1982    * }</pre>
1983    *
1984    * @param parent Required. The name of the project/folder/organization where this saved_query
1985    *     should be created in. It can only be an organization number (such as "organizations/123"),
1986    *     a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"),
1987    *     or a project number (such as "projects/12345").
1988    * @param savedQuery Required. The saved_query details. The `name` field must be empty as it will
1989    *     be generated based on the parent and saved_query_id.
1990    * @param savedQueryId Required. The ID to use for the saved query, which must be unique in the
1991    *     specified parent. It will become the final component of the saved query's resource name.
1992    *     <p>This value should be 4-63 characters, and valid characters are `[a-z][0-9]-`.
1993    *     <p>Notice that this field is required in the saved query creation, and the `name` field of
1994    *     the `saved_query` will be ignored.
1995    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1996    */
createSavedQuery( String parent, SavedQuery savedQuery, String savedQueryId)1997   public final SavedQuery createSavedQuery(
1998       String parent, SavedQuery savedQuery, String savedQueryId) {
1999     CreateSavedQueryRequest request =
2000         CreateSavedQueryRequest.newBuilder()
2001             .setParent(parent)
2002             .setSavedQuery(savedQuery)
2003             .setSavedQueryId(savedQueryId)
2004             .build();
2005     return createSavedQuery(request);
2006   }
2007 
2008   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2009   /**
2010    * Creates a saved query in a parent project/folder/organization.
2011    *
2012    * <p>Sample code:
2013    *
2014    * <pre>{@code
2015    * // This snippet has been automatically generated and should be regarded as a code template only.
2016    * // It will require modifications to work:
2017    * // - It may require correct/in-range values for request initialization.
2018    * // - It may require specifying regional endpoints when creating the service client as shown in
2019    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2020    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2021    *   CreateSavedQueryRequest request =
2022    *       CreateSavedQueryRequest.newBuilder()
2023    *           .setParent(ProjectName.of("[PROJECT]").toString())
2024    *           .setSavedQuery(SavedQuery.newBuilder().build())
2025    *           .setSavedQueryId("savedQueryId378086268")
2026    *           .build();
2027    *   SavedQuery response = assetServiceClient.createSavedQuery(request);
2028    * }
2029    * }</pre>
2030    *
2031    * @param request The request object containing all of the parameters for the API call.
2032    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2033    */
createSavedQuery(CreateSavedQueryRequest request)2034   public final SavedQuery createSavedQuery(CreateSavedQueryRequest request) {
2035     return createSavedQueryCallable().call(request);
2036   }
2037 
2038   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2039   /**
2040    * Creates a saved query in a parent project/folder/organization.
2041    *
2042    * <p>Sample code:
2043    *
2044    * <pre>{@code
2045    * // This snippet has been automatically generated and should be regarded as a code template only.
2046    * // It will require modifications to work:
2047    * // - It may require correct/in-range values for request initialization.
2048    * // - It may require specifying regional endpoints when creating the service client as shown in
2049    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2050    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2051    *   CreateSavedQueryRequest request =
2052    *       CreateSavedQueryRequest.newBuilder()
2053    *           .setParent(ProjectName.of("[PROJECT]").toString())
2054    *           .setSavedQuery(SavedQuery.newBuilder().build())
2055    *           .setSavedQueryId("savedQueryId378086268")
2056    *           .build();
2057    *   ApiFuture<SavedQuery> future =
2058    *       assetServiceClient.createSavedQueryCallable().futureCall(request);
2059    *   // Do something.
2060    *   SavedQuery response = future.get();
2061    * }
2062    * }</pre>
2063    */
createSavedQueryCallable()2064   public final UnaryCallable<CreateSavedQueryRequest, SavedQuery> createSavedQueryCallable() {
2065     return stub.createSavedQueryCallable();
2066   }
2067 
2068   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2069   /**
2070    * Gets details about a saved query.
2071    *
2072    * <p>Sample code:
2073    *
2074    * <pre>{@code
2075    * // This snippet has been automatically generated and should be regarded as a code template only.
2076    * // It will require modifications to work:
2077    * // - It may require correct/in-range values for request initialization.
2078    * // - It may require specifying regional endpoints when creating the service client as shown in
2079    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2080    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2081    *   SavedQueryName name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]");
2082    *   SavedQuery response = assetServiceClient.getSavedQuery(name);
2083    * }
2084    * }</pre>
2085    *
2086    * @param name Required. The name of the saved query and it must be in the format of:
2087    *     <ul>
2088    *       <li>projects/project_number/savedQueries/saved_query_id
2089    *       <li>folders/folder_number/savedQueries/saved_query_id
2090    *       <li>organizations/organization_number/savedQueries/saved_query_id
2091    *     </ul>
2092    *
2093    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2094    */
getSavedQuery(SavedQueryName name)2095   public final SavedQuery getSavedQuery(SavedQueryName name) {
2096     GetSavedQueryRequest request =
2097         GetSavedQueryRequest.newBuilder().setName(name == null ? null : name.toString()).build();
2098     return getSavedQuery(request);
2099   }
2100 
2101   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2102   /**
2103    * Gets details about a saved query.
2104    *
2105    * <p>Sample code:
2106    *
2107    * <pre>{@code
2108    * // This snippet has been automatically generated and should be regarded as a code template only.
2109    * // It will require modifications to work:
2110    * // - It may require correct/in-range values for request initialization.
2111    * // - It may require specifying regional endpoints when creating the service client as shown in
2112    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2113    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2114    *   String name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString();
2115    *   SavedQuery response = assetServiceClient.getSavedQuery(name);
2116    * }
2117    * }</pre>
2118    *
2119    * @param name Required. The name of the saved query and it must be in the format of:
2120    *     <ul>
2121    *       <li>projects/project_number/savedQueries/saved_query_id
2122    *       <li>folders/folder_number/savedQueries/saved_query_id
2123    *       <li>organizations/organization_number/savedQueries/saved_query_id
2124    *     </ul>
2125    *
2126    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2127    */
getSavedQuery(String name)2128   public final SavedQuery getSavedQuery(String name) {
2129     GetSavedQueryRequest request = GetSavedQueryRequest.newBuilder().setName(name).build();
2130     return getSavedQuery(request);
2131   }
2132 
2133   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2134   /**
2135    * Gets details about a saved query.
2136    *
2137    * <p>Sample code:
2138    *
2139    * <pre>{@code
2140    * // This snippet has been automatically generated and should be regarded as a code template only.
2141    * // It will require modifications to work:
2142    * // - It may require correct/in-range values for request initialization.
2143    * // - It may require specifying regional endpoints when creating the service client as shown in
2144    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2145    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2146    *   GetSavedQueryRequest request =
2147    *       GetSavedQueryRequest.newBuilder()
2148    *           .setName(
2149    *               SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString())
2150    *           .build();
2151    *   SavedQuery response = assetServiceClient.getSavedQuery(request);
2152    * }
2153    * }</pre>
2154    *
2155    * @param request The request object containing all of the parameters for the API call.
2156    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2157    */
getSavedQuery(GetSavedQueryRequest request)2158   public final SavedQuery getSavedQuery(GetSavedQueryRequest request) {
2159     return getSavedQueryCallable().call(request);
2160   }
2161 
2162   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2163   /**
2164    * Gets details about a saved query.
2165    *
2166    * <p>Sample code:
2167    *
2168    * <pre>{@code
2169    * // This snippet has been automatically generated and should be regarded as a code template only.
2170    * // It will require modifications to work:
2171    * // - It may require correct/in-range values for request initialization.
2172    * // - It may require specifying regional endpoints when creating the service client as shown in
2173    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2174    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2175    *   GetSavedQueryRequest request =
2176    *       GetSavedQueryRequest.newBuilder()
2177    *           .setName(
2178    *               SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString())
2179    *           .build();
2180    *   ApiFuture<SavedQuery> future = assetServiceClient.getSavedQueryCallable().futureCall(request);
2181    *   // Do something.
2182    *   SavedQuery response = future.get();
2183    * }
2184    * }</pre>
2185    */
getSavedQueryCallable()2186   public final UnaryCallable<GetSavedQueryRequest, SavedQuery> getSavedQueryCallable() {
2187     return stub.getSavedQueryCallable();
2188   }
2189 
2190   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2191   /**
2192    * Lists all saved queries in a parent project/folder/organization.
2193    *
2194    * <p>Sample code:
2195    *
2196    * <pre>{@code
2197    * // This snippet has been automatically generated and should be regarded as a code template only.
2198    * // It will require modifications to work:
2199    * // - It may require correct/in-range values for request initialization.
2200    * // - It may require specifying regional endpoints when creating the service client as shown in
2201    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2202    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2203    *   FolderName parent = FolderName.of("[FOLDER]");
2204    *   for (SavedQuery element : assetServiceClient.listSavedQueries(parent).iterateAll()) {
2205    *     // doThingsWith(element);
2206    *   }
2207    * }
2208    * }</pre>
2209    *
2210    * @param parent Required. The parent project/folder/organization whose savedQueries are to be
2211    *     listed. It can only be using project/folder/organization number (such as "folders/12345")",
2212    *     or a project ID (such as "projects/my-project-id").
2213    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2214    */
listSavedQueries(FolderName parent)2215   public final ListSavedQueriesPagedResponse listSavedQueries(FolderName parent) {
2216     ListSavedQueriesRequest request =
2217         ListSavedQueriesRequest.newBuilder()
2218             .setParent(parent == null ? null : parent.toString())
2219             .build();
2220     return listSavedQueries(request);
2221   }
2222 
2223   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2224   /**
2225    * Lists all saved queries in a parent project/folder/organization.
2226    *
2227    * <p>Sample code:
2228    *
2229    * <pre>{@code
2230    * // This snippet has been automatically generated and should be regarded as a code template only.
2231    * // It will require modifications to work:
2232    * // - It may require correct/in-range values for request initialization.
2233    * // - It may require specifying regional endpoints when creating the service client as shown in
2234    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2235    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2236    *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
2237    *   for (SavedQuery element : assetServiceClient.listSavedQueries(parent).iterateAll()) {
2238    *     // doThingsWith(element);
2239    *   }
2240    * }
2241    * }</pre>
2242    *
2243    * @param parent Required. The parent project/folder/organization whose savedQueries are to be
2244    *     listed. It can only be using project/folder/organization number (such as "folders/12345")",
2245    *     or a project ID (such as "projects/my-project-id").
2246    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2247    */
listSavedQueries(OrganizationName parent)2248   public final ListSavedQueriesPagedResponse listSavedQueries(OrganizationName parent) {
2249     ListSavedQueriesRequest request =
2250         ListSavedQueriesRequest.newBuilder()
2251             .setParent(parent == null ? null : parent.toString())
2252             .build();
2253     return listSavedQueries(request);
2254   }
2255 
2256   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2257   /**
2258    * Lists all saved queries in a parent project/folder/organization.
2259    *
2260    * <p>Sample code:
2261    *
2262    * <pre>{@code
2263    * // This snippet has been automatically generated and should be regarded as a code template only.
2264    * // It will require modifications to work:
2265    * // - It may require correct/in-range values for request initialization.
2266    * // - It may require specifying regional endpoints when creating the service client as shown in
2267    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2268    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2269    *   ProjectName parent = ProjectName.of("[PROJECT]");
2270    *   for (SavedQuery element : assetServiceClient.listSavedQueries(parent).iterateAll()) {
2271    *     // doThingsWith(element);
2272    *   }
2273    * }
2274    * }</pre>
2275    *
2276    * @param parent Required. The parent project/folder/organization whose savedQueries are to be
2277    *     listed. It can only be using project/folder/organization number (such as "folders/12345")",
2278    *     or a project ID (such as "projects/my-project-id").
2279    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2280    */
listSavedQueries(ProjectName parent)2281   public final ListSavedQueriesPagedResponse listSavedQueries(ProjectName parent) {
2282     ListSavedQueriesRequest request =
2283         ListSavedQueriesRequest.newBuilder()
2284             .setParent(parent == null ? null : parent.toString())
2285             .build();
2286     return listSavedQueries(request);
2287   }
2288 
2289   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2290   /**
2291    * Lists all saved queries in a parent project/folder/organization.
2292    *
2293    * <p>Sample code:
2294    *
2295    * <pre>{@code
2296    * // This snippet has been automatically generated and should be regarded as a code template only.
2297    * // It will require modifications to work:
2298    * // - It may require correct/in-range values for request initialization.
2299    * // - It may require specifying regional endpoints when creating the service client as shown in
2300    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2301    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2302    *   String parent = ProjectName.of("[PROJECT]").toString();
2303    *   for (SavedQuery element : assetServiceClient.listSavedQueries(parent).iterateAll()) {
2304    *     // doThingsWith(element);
2305    *   }
2306    * }
2307    * }</pre>
2308    *
2309    * @param parent Required. The parent project/folder/organization whose savedQueries are to be
2310    *     listed. It can only be using project/folder/organization number (such as "folders/12345")",
2311    *     or a project ID (such as "projects/my-project-id").
2312    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2313    */
listSavedQueries(String parent)2314   public final ListSavedQueriesPagedResponse listSavedQueries(String parent) {
2315     ListSavedQueriesRequest request =
2316         ListSavedQueriesRequest.newBuilder().setParent(parent).build();
2317     return listSavedQueries(request);
2318   }
2319 
2320   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2321   /**
2322    * Lists all saved queries in a parent project/folder/organization.
2323    *
2324    * <p>Sample code:
2325    *
2326    * <pre>{@code
2327    * // This snippet has been automatically generated and should be regarded as a code template only.
2328    * // It will require modifications to work:
2329    * // - It may require correct/in-range values for request initialization.
2330    * // - It may require specifying regional endpoints when creating the service client as shown in
2331    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2332    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2333    *   ListSavedQueriesRequest request =
2334    *       ListSavedQueriesRequest.newBuilder()
2335    *           .setParent(ProjectName.of("[PROJECT]").toString())
2336    *           .setFilter("filter-1274492040")
2337    *           .setPageSize(883849137)
2338    *           .setPageToken("pageToken873572522")
2339    *           .build();
2340    *   for (SavedQuery element : assetServiceClient.listSavedQueries(request).iterateAll()) {
2341    *     // doThingsWith(element);
2342    *   }
2343    * }
2344    * }</pre>
2345    *
2346    * @param request The request object containing all of the parameters for the API call.
2347    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2348    */
listSavedQueries(ListSavedQueriesRequest request)2349   public final ListSavedQueriesPagedResponse listSavedQueries(ListSavedQueriesRequest request) {
2350     return listSavedQueriesPagedCallable().call(request);
2351   }
2352 
2353   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2354   /**
2355    * Lists all saved queries in a parent project/folder/organization.
2356    *
2357    * <p>Sample code:
2358    *
2359    * <pre>{@code
2360    * // This snippet has been automatically generated and should be regarded as a code template only.
2361    * // It will require modifications to work:
2362    * // - It may require correct/in-range values for request initialization.
2363    * // - It may require specifying regional endpoints when creating the service client as shown in
2364    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2365    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2366    *   ListSavedQueriesRequest request =
2367    *       ListSavedQueriesRequest.newBuilder()
2368    *           .setParent(ProjectName.of("[PROJECT]").toString())
2369    *           .setFilter("filter-1274492040")
2370    *           .setPageSize(883849137)
2371    *           .setPageToken("pageToken873572522")
2372    *           .build();
2373    *   ApiFuture<SavedQuery> future =
2374    *       assetServiceClient.listSavedQueriesPagedCallable().futureCall(request);
2375    *   // Do something.
2376    *   for (SavedQuery element : future.get().iterateAll()) {
2377    *     // doThingsWith(element);
2378    *   }
2379    * }
2380    * }</pre>
2381    */
2382   public final UnaryCallable<ListSavedQueriesRequest, ListSavedQueriesPagedResponse>
listSavedQueriesPagedCallable()2383       listSavedQueriesPagedCallable() {
2384     return stub.listSavedQueriesPagedCallable();
2385   }
2386 
2387   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2388   /**
2389    * Lists all saved queries in a parent project/folder/organization.
2390    *
2391    * <p>Sample code:
2392    *
2393    * <pre>{@code
2394    * // This snippet has been automatically generated and should be regarded as a code template only.
2395    * // It will require modifications to work:
2396    * // - It may require correct/in-range values for request initialization.
2397    * // - It may require specifying regional endpoints when creating the service client as shown in
2398    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2399    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2400    *   ListSavedQueriesRequest request =
2401    *       ListSavedQueriesRequest.newBuilder()
2402    *           .setParent(ProjectName.of("[PROJECT]").toString())
2403    *           .setFilter("filter-1274492040")
2404    *           .setPageSize(883849137)
2405    *           .setPageToken("pageToken873572522")
2406    *           .build();
2407    *   while (true) {
2408    *     ListSavedQueriesResponse response =
2409    *         assetServiceClient.listSavedQueriesCallable().call(request);
2410    *     for (SavedQuery element : response.getSavedQueriesList()) {
2411    *       // doThingsWith(element);
2412    *     }
2413    *     String nextPageToken = response.getNextPageToken();
2414    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
2415    *       request = request.toBuilder().setPageToken(nextPageToken).build();
2416    *     } else {
2417    *       break;
2418    *     }
2419    *   }
2420    * }
2421    * }</pre>
2422    */
2423   public final UnaryCallable<ListSavedQueriesRequest, ListSavedQueriesResponse>
listSavedQueriesCallable()2424       listSavedQueriesCallable() {
2425     return stub.listSavedQueriesCallable();
2426   }
2427 
2428   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2429   /**
2430    * Updates a saved query.
2431    *
2432    * <p>Sample code:
2433    *
2434    * <pre>{@code
2435    * // This snippet has been automatically generated and should be regarded as a code template only.
2436    * // It will require modifications to work:
2437    * // - It may require correct/in-range values for request initialization.
2438    * // - It may require specifying regional endpoints when creating the service client as shown in
2439    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2440    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2441    *   SavedQuery savedQuery = SavedQuery.newBuilder().build();
2442    *   FieldMask updateMask = FieldMask.newBuilder().build();
2443    *   SavedQuery response = assetServiceClient.updateSavedQuery(savedQuery, updateMask);
2444    * }
2445    * }</pre>
2446    *
2447    * @param savedQuery Required. The saved query to update.
2448    *     <p>The saved query's `name` field is used to identify the one to update, which has format
2449    *     as below:
2450    *     <ul>
2451    *       <li>projects/project_number/savedQueries/saved_query_id
2452    *       <li>folders/folder_number/savedQueries/saved_query_id
2453    *       <li>organizations/organization_number/savedQueries/saved_query_id
2454    *     </ul>
2455    *
2456    * @param updateMask Required. The list of fields to update.
2457    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2458    */
updateSavedQuery(SavedQuery savedQuery, FieldMask updateMask)2459   public final SavedQuery updateSavedQuery(SavedQuery savedQuery, FieldMask updateMask) {
2460     UpdateSavedQueryRequest request =
2461         UpdateSavedQueryRequest.newBuilder()
2462             .setSavedQuery(savedQuery)
2463             .setUpdateMask(updateMask)
2464             .build();
2465     return updateSavedQuery(request);
2466   }
2467 
2468   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2469   /**
2470    * Updates a saved query.
2471    *
2472    * <p>Sample code:
2473    *
2474    * <pre>{@code
2475    * // This snippet has been automatically generated and should be regarded as a code template only.
2476    * // It will require modifications to work:
2477    * // - It may require correct/in-range values for request initialization.
2478    * // - It may require specifying regional endpoints when creating the service client as shown in
2479    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2480    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2481    *   UpdateSavedQueryRequest request =
2482    *       UpdateSavedQueryRequest.newBuilder()
2483    *           .setSavedQuery(SavedQuery.newBuilder().build())
2484    *           .setUpdateMask(FieldMask.newBuilder().build())
2485    *           .build();
2486    *   SavedQuery response = assetServiceClient.updateSavedQuery(request);
2487    * }
2488    * }</pre>
2489    *
2490    * @param request The request object containing all of the parameters for the API call.
2491    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2492    */
updateSavedQuery(UpdateSavedQueryRequest request)2493   public final SavedQuery updateSavedQuery(UpdateSavedQueryRequest request) {
2494     return updateSavedQueryCallable().call(request);
2495   }
2496 
2497   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2498   /**
2499    * Updates a saved query.
2500    *
2501    * <p>Sample code:
2502    *
2503    * <pre>{@code
2504    * // This snippet has been automatically generated and should be regarded as a code template only.
2505    * // It will require modifications to work:
2506    * // - It may require correct/in-range values for request initialization.
2507    * // - It may require specifying regional endpoints when creating the service client as shown in
2508    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2509    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2510    *   UpdateSavedQueryRequest request =
2511    *       UpdateSavedQueryRequest.newBuilder()
2512    *           .setSavedQuery(SavedQuery.newBuilder().build())
2513    *           .setUpdateMask(FieldMask.newBuilder().build())
2514    *           .build();
2515    *   ApiFuture<SavedQuery> future =
2516    *       assetServiceClient.updateSavedQueryCallable().futureCall(request);
2517    *   // Do something.
2518    *   SavedQuery response = future.get();
2519    * }
2520    * }</pre>
2521    */
updateSavedQueryCallable()2522   public final UnaryCallable<UpdateSavedQueryRequest, SavedQuery> updateSavedQueryCallable() {
2523     return stub.updateSavedQueryCallable();
2524   }
2525 
2526   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2527   /**
2528    * Deletes a saved query.
2529    *
2530    * <p>Sample code:
2531    *
2532    * <pre>{@code
2533    * // This snippet has been automatically generated and should be regarded as a code template only.
2534    * // It will require modifications to work:
2535    * // - It may require correct/in-range values for request initialization.
2536    * // - It may require specifying regional endpoints when creating the service client as shown in
2537    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2538    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2539    *   SavedQueryName name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]");
2540    *   assetServiceClient.deleteSavedQuery(name);
2541    * }
2542    * }</pre>
2543    *
2544    * @param name Required. The name of the saved query to delete. It must be in the format of:
2545    *     <ul>
2546    *       <li>projects/project_number/savedQueries/saved_query_id
2547    *       <li>folders/folder_number/savedQueries/saved_query_id
2548    *       <li>organizations/organization_number/savedQueries/saved_query_id
2549    *     </ul>
2550    *
2551    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2552    */
deleteSavedQuery(SavedQueryName name)2553   public final void deleteSavedQuery(SavedQueryName name) {
2554     DeleteSavedQueryRequest request =
2555         DeleteSavedQueryRequest.newBuilder().setName(name == null ? null : name.toString()).build();
2556     deleteSavedQuery(request);
2557   }
2558 
2559   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2560   /**
2561    * Deletes a saved query.
2562    *
2563    * <p>Sample code:
2564    *
2565    * <pre>{@code
2566    * // This snippet has been automatically generated and should be regarded as a code template only.
2567    * // It will require modifications to work:
2568    * // - It may require correct/in-range values for request initialization.
2569    * // - It may require specifying regional endpoints when creating the service client as shown in
2570    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2571    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2572    *   String name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString();
2573    *   assetServiceClient.deleteSavedQuery(name);
2574    * }
2575    * }</pre>
2576    *
2577    * @param name Required. The name of the saved query to delete. It must be in the format of:
2578    *     <ul>
2579    *       <li>projects/project_number/savedQueries/saved_query_id
2580    *       <li>folders/folder_number/savedQueries/saved_query_id
2581    *       <li>organizations/organization_number/savedQueries/saved_query_id
2582    *     </ul>
2583    *
2584    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2585    */
deleteSavedQuery(String name)2586   public final void deleteSavedQuery(String name) {
2587     DeleteSavedQueryRequest request = DeleteSavedQueryRequest.newBuilder().setName(name).build();
2588     deleteSavedQuery(request);
2589   }
2590 
2591   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2592   /**
2593    * Deletes a saved query.
2594    *
2595    * <p>Sample code:
2596    *
2597    * <pre>{@code
2598    * // This snippet has been automatically generated and should be regarded as a code template only.
2599    * // It will require modifications to work:
2600    * // - It may require correct/in-range values for request initialization.
2601    * // - It may require specifying regional endpoints when creating the service client as shown in
2602    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2603    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2604    *   DeleteSavedQueryRequest request =
2605    *       DeleteSavedQueryRequest.newBuilder()
2606    *           .setName(
2607    *               SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString())
2608    *           .build();
2609    *   assetServiceClient.deleteSavedQuery(request);
2610    * }
2611    * }</pre>
2612    *
2613    * @param request The request object containing all of the parameters for the API call.
2614    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2615    */
deleteSavedQuery(DeleteSavedQueryRequest request)2616   public final void deleteSavedQuery(DeleteSavedQueryRequest request) {
2617     deleteSavedQueryCallable().call(request);
2618   }
2619 
2620   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2621   /**
2622    * Deletes a saved query.
2623    *
2624    * <p>Sample code:
2625    *
2626    * <pre>{@code
2627    * // This snippet has been automatically generated and should be regarded as a code template only.
2628    * // It will require modifications to work:
2629    * // - It may require correct/in-range values for request initialization.
2630    * // - It may require specifying regional endpoints when creating the service client as shown in
2631    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2632    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2633    *   DeleteSavedQueryRequest request =
2634    *       DeleteSavedQueryRequest.newBuilder()
2635    *           .setName(
2636    *               SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString())
2637    *           .build();
2638    *   ApiFuture<Empty> future = assetServiceClient.deleteSavedQueryCallable().futureCall(request);
2639    *   // Do something.
2640    *   future.get();
2641    * }
2642    * }</pre>
2643    */
deleteSavedQueryCallable()2644   public final UnaryCallable<DeleteSavedQueryRequest, Empty> deleteSavedQueryCallable() {
2645     return stub.deleteSavedQueryCallable();
2646   }
2647 
2648   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2649   /**
2650    * Gets effective IAM policies for a batch of resources.
2651    *
2652    * <p>Sample code:
2653    *
2654    * <pre>{@code
2655    * // This snippet has been automatically generated and should be regarded as a code template only.
2656    * // It will require modifications to work:
2657    * // - It may require correct/in-range values for request initialization.
2658    * // - It may require specifying regional endpoints when creating the service client as shown in
2659    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2660    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2661    *   BatchGetEffectiveIamPoliciesRequest request =
2662    *       BatchGetEffectiveIamPoliciesRequest.newBuilder()
2663    *           .setScope(FolderName.of("[FOLDER]").toString())
2664    *           .addAllNames(new ArrayList<String>())
2665    *           .build();
2666    *   BatchGetEffectiveIamPoliciesResponse response =
2667    *       assetServiceClient.batchGetEffectiveIamPolicies(request);
2668    * }
2669    * }</pre>
2670    *
2671    * @param request The request object containing all of the parameters for the API call.
2672    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2673    */
batchGetEffectiveIamPolicies( BatchGetEffectiveIamPoliciesRequest request)2674   public final BatchGetEffectiveIamPoliciesResponse batchGetEffectiveIamPolicies(
2675       BatchGetEffectiveIamPoliciesRequest request) {
2676     return batchGetEffectiveIamPoliciesCallable().call(request);
2677   }
2678 
2679   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2680   /**
2681    * Gets effective IAM policies for a batch of resources.
2682    *
2683    * <p>Sample code:
2684    *
2685    * <pre>{@code
2686    * // This snippet has been automatically generated and should be regarded as a code template only.
2687    * // It will require modifications to work:
2688    * // - It may require correct/in-range values for request initialization.
2689    * // - It may require specifying regional endpoints when creating the service client as shown in
2690    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2691    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2692    *   BatchGetEffectiveIamPoliciesRequest request =
2693    *       BatchGetEffectiveIamPoliciesRequest.newBuilder()
2694    *           .setScope(FolderName.of("[FOLDER]").toString())
2695    *           .addAllNames(new ArrayList<String>())
2696    *           .build();
2697    *   ApiFuture<BatchGetEffectiveIamPoliciesResponse> future =
2698    *       assetServiceClient.batchGetEffectiveIamPoliciesCallable().futureCall(request);
2699    *   // Do something.
2700    *   BatchGetEffectiveIamPoliciesResponse response = future.get();
2701    * }
2702    * }</pre>
2703    */
2704   public final UnaryCallable<
2705           BatchGetEffectiveIamPoliciesRequest, BatchGetEffectiveIamPoliciesResponse>
batchGetEffectiveIamPoliciesCallable()2706       batchGetEffectiveIamPoliciesCallable() {
2707     return stub.batchGetEffectiveIamPoliciesCallable();
2708   }
2709 
2710   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2711   /**
2712    * Analyzes organization policies under a scope.
2713    *
2714    * <p>Sample code:
2715    *
2716    * <pre>{@code
2717    * // This snippet has been automatically generated and should be regarded as a code template only.
2718    * // It will require modifications to work:
2719    * // - It may require correct/in-range values for request initialization.
2720    * // - It may require specifying regional endpoints when creating the service client as shown in
2721    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2722    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2723    *   String scope = "scope109264468";
2724    *   String constraint = "constraint-190376483";
2725    *   String filter = "filter-1274492040";
2726    *   for (AnalyzeOrgPoliciesResponse.OrgPolicyResult element :
2727    *       assetServiceClient.analyzeOrgPolicies(scope, constraint, filter).iterateAll()) {
2728    *     // doThingsWith(element);
2729    *   }
2730    * }
2731    * }</pre>
2732    *
2733    * @param scope Required. The organization to scope the request. Only organization policies within
2734    *     the scope will be analyzed.
2735    *     <ul>
2736    *       <li>organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
2737    *     </ul>
2738    *
2739    * @param constraint Required. The name of the constraint to analyze organization policies for.
2740    *     The response only contains analyzed organization policies for the provided constraint.
2741    * @param filter The expression to filter
2742    *     [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results].
2743    *     The only supported field is `consolidated_policy.attached_resource`, and the only supported
2744    *     operator is `=`.
2745    *     <p>Example:
2746    *     consolidated_policy.attached_resource="//cloudresourcemanager.googleapis.com/folders/001"
2747    *     will return the org policy results of"folders/001".
2748    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2749    */
analyzeOrgPolicies( String scope, String constraint, String filter)2750   public final AnalyzeOrgPoliciesPagedResponse analyzeOrgPolicies(
2751       String scope, String constraint, String filter) {
2752     AnalyzeOrgPoliciesRequest request =
2753         AnalyzeOrgPoliciesRequest.newBuilder()
2754             .setScope(scope)
2755             .setConstraint(constraint)
2756             .setFilter(filter)
2757             .build();
2758     return analyzeOrgPolicies(request);
2759   }
2760 
2761   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2762   /**
2763    * Analyzes organization policies under a scope.
2764    *
2765    * <p>Sample code:
2766    *
2767    * <pre>{@code
2768    * // This snippet has been automatically generated and should be regarded as a code template only.
2769    * // It will require modifications to work:
2770    * // - It may require correct/in-range values for request initialization.
2771    * // - It may require specifying regional endpoints when creating the service client as shown in
2772    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2773    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2774    *   AnalyzeOrgPoliciesRequest request =
2775    *       AnalyzeOrgPoliciesRequest.newBuilder()
2776    *           .setScope("scope109264468")
2777    *           .setConstraint("constraint-190376483")
2778    *           .setFilter("filter-1274492040")
2779    *           .setPageSize(883849137)
2780    *           .setPageToken("pageToken873572522")
2781    *           .build();
2782    *   for (AnalyzeOrgPoliciesResponse.OrgPolicyResult element :
2783    *       assetServiceClient.analyzeOrgPolicies(request).iterateAll()) {
2784    *     // doThingsWith(element);
2785    *   }
2786    * }
2787    * }</pre>
2788    *
2789    * @param request The request object containing all of the parameters for the API call.
2790    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2791    */
analyzeOrgPolicies( AnalyzeOrgPoliciesRequest request)2792   public final AnalyzeOrgPoliciesPagedResponse analyzeOrgPolicies(
2793       AnalyzeOrgPoliciesRequest request) {
2794     return analyzeOrgPoliciesPagedCallable().call(request);
2795   }
2796 
2797   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2798   /**
2799    * Analyzes organization policies under a scope.
2800    *
2801    * <p>Sample code:
2802    *
2803    * <pre>{@code
2804    * // This snippet has been automatically generated and should be regarded as a code template only.
2805    * // It will require modifications to work:
2806    * // - It may require correct/in-range values for request initialization.
2807    * // - It may require specifying regional endpoints when creating the service client as shown in
2808    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2809    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2810    *   AnalyzeOrgPoliciesRequest request =
2811    *       AnalyzeOrgPoliciesRequest.newBuilder()
2812    *           .setScope("scope109264468")
2813    *           .setConstraint("constraint-190376483")
2814    *           .setFilter("filter-1274492040")
2815    *           .setPageSize(883849137)
2816    *           .setPageToken("pageToken873572522")
2817    *           .build();
2818    *   ApiFuture<AnalyzeOrgPoliciesResponse.OrgPolicyResult> future =
2819    *       assetServiceClient.analyzeOrgPoliciesPagedCallable().futureCall(request);
2820    *   // Do something.
2821    *   for (AnalyzeOrgPoliciesResponse.OrgPolicyResult element : future.get().iterateAll()) {
2822    *     // doThingsWith(element);
2823    *   }
2824    * }
2825    * }</pre>
2826    */
2827   public final UnaryCallable<AnalyzeOrgPoliciesRequest, AnalyzeOrgPoliciesPagedResponse>
analyzeOrgPoliciesPagedCallable()2828       analyzeOrgPoliciesPagedCallable() {
2829     return stub.analyzeOrgPoliciesPagedCallable();
2830   }
2831 
2832   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2833   /**
2834    * Analyzes organization policies under a scope.
2835    *
2836    * <p>Sample code:
2837    *
2838    * <pre>{@code
2839    * // This snippet has been automatically generated and should be regarded as a code template only.
2840    * // It will require modifications to work:
2841    * // - It may require correct/in-range values for request initialization.
2842    * // - It may require specifying regional endpoints when creating the service client as shown in
2843    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2844    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2845    *   AnalyzeOrgPoliciesRequest request =
2846    *       AnalyzeOrgPoliciesRequest.newBuilder()
2847    *           .setScope("scope109264468")
2848    *           .setConstraint("constraint-190376483")
2849    *           .setFilter("filter-1274492040")
2850    *           .setPageSize(883849137)
2851    *           .setPageToken("pageToken873572522")
2852    *           .build();
2853    *   while (true) {
2854    *     AnalyzeOrgPoliciesResponse response =
2855    *         assetServiceClient.analyzeOrgPoliciesCallable().call(request);
2856    *     for (AnalyzeOrgPoliciesResponse.OrgPolicyResult element :
2857    *         response.getOrgPolicyResultsList()) {
2858    *       // doThingsWith(element);
2859    *     }
2860    *     String nextPageToken = response.getNextPageToken();
2861    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
2862    *       request = request.toBuilder().setPageToken(nextPageToken).build();
2863    *     } else {
2864    *       break;
2865    *     }
2866    *   }
2867    * }
2868    * }</pre>
2869    */
2870   public final UnaryCallable<AnalyzeOrgPoliciesRequest, AnalyzeOrgPoliciesResponse>
analyzeOrgPoliciesCallable()2871       analyzeOrgPoliciesCallable() {
2872     return stub.analyzeOrgPoliciesCallable();
2873   }
2874 
2875   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2876   /**
2877    * Analyzes organization policies governed containers (projects, folders or organization) under a
2878    * scope.
2879    *
2880    * <p>Sample code:
2881    *
2882    * <pre>{@code
2883    * // This snippet has been automatically generated and should be regarded as a code template only.
2884    * // It will require modifications to work:
2885    * // - It may require correct/in-range values for request initialization.
2886    * // - It may require specifying regional endpoints when creating the service client as shown in
2887    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2888    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2889    *   String scope = "scope109264468";
2890    *   String constraint = "constraint-190376483";
2891    *   String filter = "filter-1274492040";
2892    *   for (AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer element :
2893    *       assetServiceClient
2894    *           .analyzeOrgPolicyGovernedContainers(scope, constraint, filter)
2895    *           .iterateAll()) {
2896    *     // doThingsWith(element);
2897    *   }
2898    * }
2899    * }</pre>
2900    *
2901    * @param scope Required. The organization to scope the request. Only organization policies within
2902    *     the scope will be analyzed. The output containers will also be limited to the ones governed
2903    *     by those in-scope organization policies.
2904    *     <ul>
2905    *       <li>organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
2906    *     </ul>
2907    *
2908    * @param constraint Required. The name of the constraint to analyze governed containers for. The
2909    *     analysis only contains organization policies for the provided constraint.
2910    * @param filter The expression to filter the governed containers in result. The only supported
2911    *     field is `parent`, and the only supported operator is `=`.
2912    *     <p>Example: parent="//cloudresourcemanager.googleapis.com/folders/001" will return all
2913    *     containers under "folders/001".
2914    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2915    */
analyzeOrgPolicyGovernedContainers( String scope, String constraint, String filter)2916   public final AnalyzeOrgPolicyGovernedContainersPagedResponse analyzeOrgPolicyGovernedContainers(
2917       String scope, String constraint, String filter) {
2918     AnalyzeOrgPolicyGovernedContainersRequest request =
2919         AnalyzeOrgPolicyGovernedContainersRequest.newBuilder()
2920             .setScope(scope)
2921             .setConstraint(constraint)
2922             .setFilter(filter)
2923             .build();
2924     return analyzeOrgPolicyGovernedContainers(request);
2925   }
2926 
2927   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2928   /**
2929    * Analyzes organization policies governed containers (projects, folders or organization) under a
2930    * scope.
2931    *
2932    * <p>Sample code:
2933    *
2934    * <pre>{@code
2935    * // This snippet has been automatically generated and should be regarded as a code template only.
2936    * // It will require modifications to work:
2937    * // - It may require correct/in-range values for request initialization.
2938    * // - It may require specifying regional endpoints when creating the service client as shown in
2939    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2940    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2941    *   AnalyzeOrgPolicyGovernedContainersRequest request =
2942    *       AnalyzeOrgPolicyGovernedContainersRequest.newBuilder()
2943    *           .setScope("scope109264468")
2944    *           .setConstraint("constraint-190376483")
2945    *           .setFilter("filter-1274492040")
2946    *           .setPageSize(883849137)
2947    *           .setPageToken("pageToken873572522")
2948    *           .build();
2949    *   for (AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer element :
2950    *       assetServiceClient.analyzeOrgPolicyGovernedContainers(request).iterateAll()) {
2951    *     // doThingsWith(element);
2952    *   }
2953    * }
2954    * }</pre>
2955    *
2956    * @param request The request object containing all of the parameters for the API call.
2957    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2958    */
analyzeOrgPolicyGovernedContainers( AnalyzeOrgPolicyGovernedContainersRequest request)2959   public final AnalyzeOrgPolicyGovernedContainersPagedResponse analyzeOrgPolicyGovernedContainers(
2960       AnalyzeOrgPolicyGovernedContainersRequest request) {
2961     return analyzeOrgPolicyGovernedContainersPagedCallable().call(request);
2962   }
2963 
2964   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2965   /**
2966    * Analyzes organization policies governed containers (projects, folders or organization) under a
2967    * scope.
2968    *
2969    * <p>Sample code:
2970    *
2971    * <pre>{@code
2972    * // This snippet has been automatically generated and should be regarded as a code template only.
2973    * // It will require modifications to work:
2974    * // - It may require correct/in-range values for request initialization.
2975    * // - It may require specifying regional endpoints when creating the service client as shown in
2976    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2977    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
2978    *   AnalyzeOrgPolicyGovernedContainersRequest request =
2979    *       AnalyzeOrgPolicyGovernedContainersRequest.newBuilder()
2980    *           .setScope("scope109264468")
2981    *           .setConstraint("constraint-190376483")
2982    *           .setFilter("filter-1274492040")
2983    *           .setPageSize(883849137)
2984    *           .setPageToken("pageToken873572522")
2985    *           .build();
2986    *   ApiFuture<AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer> future =
2987    *       assetServiceClient.analyzeOrgPolicyGovernedContainersPagedCallable().futureCall(request);
2988    *   // Do something.
2989    *   for (AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer element :
2990    *       future.get().iterateAll()) {
2991    *     // doThingsWith(element);
2992    *   }
2993    * }
2994    * }</pre>
2995    */
2996   public final UnaryCallable<
2997           AnalyzeOrgPolicyGovernedContainersRequest,
2998           AnalyzeOrgPolicyGovernedContainersPagedResponse>
analyzeOrgPolicyGovernedContainersPagedCallable()2999       analyzeOrgPolicyGovernedContainersPagedCallable() {
3000     return stub.analyzeOrgPolicyGovernedContainersPagedCallable();
3001   }
3002 
3003   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3004   /**
3005    * Analyzes organization policies governed containers (projects, folders or organization) under a
3006    * scope.
3007    *
3008    * <p>Sample code:
3009    *
3010    * <pre>{@code
3011    * // This snippet has been automatically generated and should be regarded as a code template only.
3012    * // It will require modifications to work:
3013    * // - It may require correct/in-range values for request initialization.
3014    * // - It may require specifying regional endpoints when creating the service client as shown in
3015    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3016    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
3017    *   AnalyzeOrgPolicyGovernedContainersRequest request =
3018    *       AnalyzeOrgPolicyGovernedContainersRequest.newBuilder()
3019    *           .setScope("scope109264468")
3020    *           .setConstraint("constraint-190376483")
3021    *           .setFilter("filter-1274492040")
3022    *           .setPageSize(883849137)
3023    *           .setPageToken("pageToken873572522")
3024    *           .build();
3025    *   while (true) {
3026    *     AnalyzeOrgPolicyGovernedContainersResponse response =
3027    *         assetServiceClient.analyzeOrgPolicyGovernedContainersCallable().call(request);
3028    *     for (AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer element :
3029    *         response.getGovernedContainersList()) {
3030    *       // doThingsWith(element);
3031    *     }
3032    *     String nextPageToken = response.getNextPageToken();
3033    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
3034    *       request = request.toBuilder().setPageToken(nextPageToken).build();
3035    *     } else {
3036    *       break;
3037    *     }
3038    *   }
3039    * }
3040    * }</pre>
3041    */
3042   public final UnaryCallable<
3043           AnalyzeOrgPolicyGovernedContainersRequest, AnalyzeOrgPolicyGovernedContainersResponse>
analyzeOrgPolicyGovernedContainersCallable()3044       analyzeOrgPolicyGovernedContainersCallable() {
3045     return stub.analyzeOrgPolicyGovernedContainersCallable();
3046   }
3047 
3048   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3049   /**
3050    * Analyzes organization policies governed assets (Google Cloud resources or policies) under a
3051    * scope. This RPC supports custom constraints and the following 10 canned constraints:
3052    *
3053    * <ul>
3054    *   <li>storage.uniformBucketLevelAccess
3055    *   <li>iam.disableServiceAccountKeyCreation
3056    *   <li>iam.allowedPolicyMemberDomains
3057    *   <li>compute.vmExternalIpAccess
3058    *   <li>appengine.enforceServiceAccountActAsCheck
3059    *   <li>gcp.resourceLocations
3060    *   <li>compute.trustedImageProjects
3061    *   <li>compute.skipDefaultNetworkCreation
3062    *   <li>compute.requireOsLogin
3063    *   <li>compute.disableNestedVirtualization
3064    * </ul>
3065    *
3066    * <p>This RPC only returns either resources of types supported by [searchable asset
3067    * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types),
3068    * or IAM policies.
3069    *
3070    * <p>Sample code:
3071    *
3072    * <pre>{@code
3073    * // This snippet has been automatically generated and should be regarded as a code template only.
3074    * // It will require modifications to work:
3075    * // - It may require correct/in-range values for request initialization.
3076    * // - It may require specifying regional endpoints when creating the service client as shown in
3077    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3078    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
3079    *   String scope = "scope109264468";
3080    *   String constraint = "constraint-190376483";
3081    *   String filter = "filter-1274492040";
3082    *   for (AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset element :
3083    *       assetServiceClient
3084    *           .analyzeOrgPolicyGovernedAssets(scope, constraint, filter)
3085    *           .iterateAll()) {
3086    *     // doThingsWith(element);
3087    *   }
3088    * }
3089    * }</pre>
3090    *
3091    * @param scope Required. The organization to scope the request. Only organization policies within
3092    *     the scope will be analyzed. The output assets will also be limited to the ones governed by
3093    *     those in-scope organization policies.
3094    *     <ul>
3095    *       <li>organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
3096    *     </ul>
3097    *
3098    * @param constraint Required. The name of the constraint to analyze governed assets for. The
3099    *     analysis only contains analyzed organization policies for the provided constraint.
3100    * @param filter The expression to filter the governed assets in result. The only supported fields
3101    *     for governed resources are `governed_resource.project` and `governed_resource.folders`. The
3102    *     only supported fields for governed iam policies are `governed_iam_policy.project` and
3103    *     `governed_iam_policy.folders`. The only supported operator is `=`.
3104    *     <p>Example 1: governed_resource.project="projects/12345678" filter will return all governed
3105    *     resources under projects/12345678 including the project ifself, if applicable.
3106    *     <p>Example 2: governed_iam_policy.folders="folders/12345678" filter will return all
3107    *     governed iam policies under folders/12345678, if applicable.
3108    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3109    */
analyzeOrgPolicyGovernedAssets( String scope, String constraint, String filter)3110   public final AnalyzeOrgPolicyGovernedAssetsPagedResponse analyzeOrgPolicyGovernedAssets(
3111       String scope, String constraint, String filter) {
3112     AnalyzeOrgPolicyGovernedAssetsRequest request =
3113         AnalyzeOrgPolicyGovernedAssetsRequest.newBuilder()
3114             .setScope(scope)
3115             .setConstraint(constraint)
3116             .setFilter(filter)
3117             .build();
3118     return analyzeOrgPolicyGovernedAssets(request);
3119   }
3120 
3121   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3122   /**
3123    * Analyzes organization policies governed assets (Google Cloud resources or policies) under a
3124    * scope. This RPC supports custom constraints and the following 10 canned constraints:
3125    *
3126    * <ul>
3127    *   <li>storage.uniformBucketLevelAccess
3128    *   <li>iam.disableServiceAccountKeyCreation
3129    *   <li>iam.allowedPolicyMemberDomains
3130    *   <li>compute.vmExternalIpAccess
3131    *   <li>appengine.enforceServiceAccountActAsCheck
3132    *   <li>gcp.resourceLocations
3133    *   <li>compute.trustedImageProjects
3134    *   <li>compute.skipDefaultNetworkCreation
3135    *   <li>compute.requireOsLogin
3136    *   <li>compute.disableNestedVirtualization
3137    * </ul>
3138    *
3139    * <p>This RPC only returns either resources of types supported by [searchable asset
3140    * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types),
3141    * or IAM policies.
3142    *
3143    * <p>Sample code:
3144    *
3145    * <pre>{@code
3146    * // This snippet has been automatically generated and should be regarded as a code template only.
3147    * // It will require modifications to work:
3148    * // - It may require correct/in-range values for request initialization.
3149    * // - It may require specifying regional endpoints when creating the service client as shown in
3150    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3151    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
3152    *   AnalyzeOrgPolicyGovernedAssetsRequest request =
3153    *       AnalyzeOrgPolicyGovernedAssetsRequest.newBuilder()
3154    *           .setScope("scope109264468")
3155    *           .setConstraint("constraint-190376483")
3156    *           .setFilter("filter-1274492040")
3157    *           .setPageSize(883849137)
3158    *           .setPageToken("pageToken873572522")
3159    *           .build();
3160    *   for (AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset element :
3161    *       assetServiceClient.analyzeOrgPolicyGovernedAssets(request).iterateAll()) {
3162    *     // doThingsWith(element);
3163    *   }
3164    * }
3165    * }</pre>
3166    *
3167    * @param request The request object containing all of the parameters for the API call.
3168    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3169    */
analyzeOrgPolicyGovernedAssets( AnalyzeOrgPolicyGovernedAssetsRequest request)3170   public final AnalyzeOrgPolicyGovernedAssetsPagedResponse analyzeOrgPolicyGovernedAssets(
3171       AnalyzeOrgPolicyGovernedAssetsRequest request) {
3172     return analyzeOrgPolicyGovernedAssetsPagedCallable().call(request);
3173   }
3174 
3175   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3176   /**
3177    * Analyzes organization policies governed assets (Google Cloud resources or policies) under a
3178    * scope. This RPC supports custom constraints and the following 10 canned constraints:
3179    *
3180    * <ul>
3181    *   <li>storage.uniformBucketLevelAccess
3182    *   <li>iam.disableServiceAccountKeyCreation
3183    *   <li>iam.allowedPolicyMemberDomains
3184    *   <li>compute.vmExternalIpAccess
3185    *   <li>appengine.enforceServiceAccountActAsCheck
3186    *   <li>gcp.resourceLocations
3187    *   <li>compute.trustedImageProjects
3188    *   <li>compute.skipDefaultNetworkCreation
3189    *   <li>compute.requireOsLogin
3190    *   <li>compute.disableNestedVirtualization
3191    * </ul>
3192    *
3193    * <p>This RPC only returns either resources of types supported by [searchable asset
3194    * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types),
3195    * or IAM policies.
3196    *
3197    * <p>Sample code:
3198    *
3199    * <pre>{@code
3200    * // This snippet has been automatically generated and should be regarded as a code template only.
3201    * // It will require modifications to work:
3202    * // - It may require correct/in-range values for request initialization.
3203    * // - It may require specifying regional endpoints when creating the service client as shown in
3204    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3205    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
3206    *   AnalyzeOrgPolicyGovernedAssetsRequest request =
3207    *       AnalyzeOrgPolicyGovernedAssetsRequest.newBuilder()
3208    *           .setScope("scope109264468")
3209    *           .setConstraint("constraint-190376483")
3210    *           .setFilter("filter-1274492040")
3211    *           .setPageSize(883849137)
3212    *           .setPageToken("pageToken873572522")
3213    *           .build();
3214    *   ApiFuture<AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset> future =
3215    *       assetServiceClient.analyzeOrgPolicyGovernedAssetsPagedCallable().futureCall(request);
3216    *   // Do something.
3217    *   for (AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset element :
3218    *       future.get().iterateAll()) {
3219    *     // doThingsWith(element);
3220    *   }
3221    * }
3222    * }</pre>
3223    */
3224   public final UnaryCallable<
3225           AnalyzeOrgPolicyGovernedAssetsRequest, AnalyzeOrgPolicyGovernedAssetsPagedResponse>
analyzeOrgPolicyGovernedAssetsPagedCallable()3226       analyzeOrgPolicyGovernedAssetsPagedCallable() {
3227     return stub.analyzeOrgPolicyGovernedAssetsPagedCallable();
3228   }
3229 
3230   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3231   /**
3232    * Analyzes organization policies governed assets (Google Cloud resources or policies) under a
3233    * scope. This RPC supports custom constraints and the following 10 canned constraints:
3234    *
3235    * <ul>
3236    *   <li>storage.uniformBucketLevelAccess
3237    *   <li>iam.disableServiceAccountKeyCreation
3238    *   <li>iam.allowedPolicyMemberDomains
3239    *   <li>compute.vmExternalIpAccess
3240    *   <li>appengine.enforceServiceAccountActAsCheck
3241    *   <li>gcp.resourceLocations
3242    *   <li>compute.trustedImageProjects
3243    *   <li>compute.skipDefaultNetworkCreation
3244    *   <li>compute.requireOsLogin
3245    *   <li>compute.disableNestedVirtualization
3246    * </ul>
3247    *
3248    * <p>This RPC only returns either resources of types supported by [searchable asset
3249    * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types),
3250    * or IAM policies.
3251    *
3252    * <p>Sample code:
3253    *
3254    * <pre>{@code
3255    * // This snippet has been automatically generated and should be regarded as a code template only.
3256    * // It will require modifications to work:
3257    * // - It may require correct/in-range values for request initialization.
3258    * // - It may require specifying regional endpoints when creating the service client as shown in
3259    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3260    * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
3261    *   AnalyzeOrgPolicyGovernedAssetsRequest request =
3262    *       AnalyzeOrgPolicyGovernedAssetsRequest.newBuilder()
3263    *           .setScope("scope109264468")
3264    *           .setConstraint("constraint-190376483")
3265    *           .setFilter("filter-1274492040")
3266    *           .setPageSize(883849137)
3267    *           .setPageToken("pageToken873572522")
3268    *           .build();
3269    *   while (true) {
3270    *     AnalyzeOrgPolicyGovernedAssetsResponse response =
3271    *         assetServiceClient.analyzeOrgPolicyGovernedAssetsCallable().call(request);
3272    *     for (AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset element :
3273    *         response.getGovernedAssetsList()) {
3274    *       // doThingsWith(element);
3275    *     }
3276    *     String nextPageToken = response.getNextPageToken();
3277    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
3278    *       request = request.toBuilder().setPageToken(nextPageToken).build();
3279    *     } else {
3280    *       break;
3281    *     }
3282    *   }
3283    * }
3284    * }</pre>
3285    */
3286   public final UnaryCallable<
3287           AnalyzeOrgPolicyGovernedAssetsRequest, AnalyzeOrgPolicyGovernedAssetsResponse>
analyzeOrgPolicyGovernedAssetsCallable()3288       analyzeOrgPolicyGovernedAssetsCallable() {
3289     return stub.analyzeOrgPolicyGovernedAssetsCallable();
3290   }
3291 
3292   @Override
close()3293   public final void close() {
3294     stub.close();
3295   }
3296 
3297   @Override
shutdown()3298   public void shutdown() {
3299     stub.shutdown();
3300   }
3301 
3302   @Override
isShutdown()3303   public boolean isShutdown() {
3304     return stub.isShutdown();
3305   }
3306 
3307   @Override
isTerminated()3308   public boolean isTerminated() {
3309     return stub.isTerminated();
3310   }
3311 
3312   @Override
shutdownNow()3313   public void shutdownNow() {
3314     stub.shutdownNow();
3315   }
3316 
3317   @Override
awaitTermination(long duration, TimeUnit unit)3318   public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
3319     return stub.awaitTermination(duration, unit);
3320   }
3321 
3322   public static class ListAssetsPagedResponse
3323       extends AbstractPagedListResponse<
3324           ListAssetsRequest,
3325           ListAssetsResponse,
3326           Asset,
3327           ListAssetsPage,
3328           ListAssetsFixedSizeCollection> {
3329 
createAsync( PageContext<ListAssetsRequest, ListAssetsResponse, Asset> context, ApiFuture<ListAssetsResponse> futureResponse)3330     public static ApiFuture<ListAssetsPagedResponse> createAsync(
3331         PageContext<ListAssetsRequest, ListAssetsResponse, Asset> context,
3332         ApiFuture<ListAssetsResponse> futureResponse) {
3333       ApiFuture<ListAssetsPage> futurePage =
3334           ListAssetsPage.createEmptyPage().createPageAsync(context, futureResponse);
3335       return ApiFutures.transform(
3336           futurePage, input -> new ListAssetsPagedResponse(input), MoreExecutors.directExecutor());
3337     }
3338 
ListAssetsPagedResponse(ListAssetsPage page)3339     private ListAssetsPagedResponse(ListAssetsPage page) {
3340       super(page, ListAssetsFixedSizeCollection.createEmptyCollection());
3341     }
3342   }
3343 
3344   public static class ListAssetsPage
3345       extends AbstractPage<ListAssetsRequest, ListAssetsResponse, Asset, ListAssetsPage> {
3346 
ListAssetsPage( PageContext<ListAssetsRequest, ListAssetsResponse, Asset> context, ListAssetsResponse response)3347     private ListAssetsPage(
3348         PageContext<ListAssetsRequest, ListAssetsResponse, Asset> context,
3349         ListAssetsResponse response) {
3350       super(context, response);
3351     }
3352 
createEmptyPage()3353     private static ListAssetsPage createEmptyPage() {
3354       return new ListAssetsPage(null, null);
3355     }
3356 
3357     @Override
createPage( PageContext<ListAssetsRequest, ListAssetsResponse, Asset> context, ListAssetsResponse response)3358     protected ListAssetsPage createPage(
3359         PageContext<ListAssetsRequest, ListAssetsResponse, Asset> context,
3360         ListAssetsResponse response) {
3361       return new ListAssetsPage(context, response);
3362     }
3363 
3364     @Override
createPageAsync( PageContext<ListAssetsRequest, ListAssetsResponse, Asset> context, ApiFuture<ListAssetsResponse> futureResponse)3365     public ApiFuture<ListAssetsPage> createPageAsync(
3366         PageContext<ListAssetsRequest, ListAssetsResponse, Asset> context,
3367         ApiFuture<ListAssetsResponse> futureResponse) {
3368       return super.createPageAsync(context, futureResponse);
3369     }
3370   }
3371 
3372   public static class ListAssetsFixedSizeCollection
3373       extends AbstractFixedSizeCollection<
3374           ListAssetsRequest,
3375           ListAssetsResponse,
3376           Asset,
3377           ListAssetsPage,
3378           ListAssetsFixedSizeCollection> {
3379 
ListAssetsFixedSizeCollection(List<ListAssetsPage> pages, int collectionSize)3380     private ListAssetsFixedSizeCollection(List<ListAssetsPage> pages, int collectionSize) {
3381       super(pages, collectionSize);
3382     }
3383 
createEmptyCollection()3384     private static ListAssetsFixedSizeCollection createEmptyCollection() {
3385       return new ListAssetsFixedSizeCollection(null, 0);
3386     }
3387 
3388     @Override
createCollection( List<ListAssetsPage> pages, int collectionSize)3389     protected ListAssetsFixedSizeCollection createCollection(
3390         List<ListAssetsPage> pages, int collectionSize) {
3391       return new ListAssetsFixedSizeCollection(pages, collectionSize);
3392     }
3393   }
3394 
3395   public static class SearchAllResourcesPagedResponse
3396       extends AbstractPagedListResponse<
3397           SearchAllResourcesRequest,
3398           SearchAllResourcesResponse,
3399           ResourceSearchResult,
3400           SearchAllResourcesPage,
3401           SearchAllResourcesFixedSizeCollection> {
3402 
createAsync( PageContext<SearchAllResourcesRequest, SearchAllResourcesResponse, ResourceSearchResult> context, ApiFuture<SearchAllResourcesResponse> futureResponse)3403     public static ApiFuture<SearchAllResourcesPagedResponse> createAsync(
3404         PageContext<SearchAllResourcesRequest, SearchAllResourcesResponse, ResourceSearchResult>
3405             context,
3406         ApiFuture<SearchAllResourcesResponse> futureResponse) {
3407       ApiFuture<SearchAllResourcesPage> futurePage =
3408           SearchAllResourcesPage.createEmptyPage().createPageAsync(context, futureResponse);
3409       return ApiFutures.transform(
3410           futurePage,
3411           input -> new SearchAllResourcesPagedResponse(input),
3412           MoreExecutors.directExecutor());
3413     }
3414 
SearchAllResourcesPagedResponse(SearchAllResourcesPage page)3415     private SearchAllResourcesPagedResponse(SearchAllResourcesPage page) {
3416       super(page, SearchAllResourcesFixedSizeCollection.createEmptyCollection());
3417     }
3418   }
3419 
3420   public static class SearchAllResourcesPage
3421       extends AbstractPage<
3422           SearchAllResourcesRequest,
3423           SearchAllResourcesResponse,
3424           ResourceSearchResult,
3425           SearchAllResourcesPage> {
3426 
SearchAllResourcesPage( PageContext<SearchAllResourcesRequest, SearchAllResourcesResponse, ResourceSearchResult> context, SearchAllResourcesResponse response)3427     private SearchAllResourcesPage(
3428         PageContext<SearchAllResourcesRequest, SearchAllResourcesResponse, ResourceSearchResult>
3429             context,
3430         SearchAllResourcesResponse response) {
3431       super(context, response);
3432     }
3433 
createEmptyPage()3434     private static SearchAllResourcesPage createEmptyPage() {
3435       return new SearchAllResourcesPage(null, null);
3436     }
3437 
3438     @Override
createPage( PageContext<SearchAllResourcesRequest, SearchAllResourcesResponse, ResourceSearchResult> context, SearchAllResourcesResponse response)3439     protected SearchAllResourcesPage createPage(
3440         PageContext<SearchAllResourcesRequest, SearchAllResourcesResponse, ResourceSearchResult>
3441             context,
3442         SearchAllResourcesResponse response) {
3443       return new SearchAllResourcesPage(context, response);
3444     }
3445 
3446     @Override
createPageAsync( PageContext<SearchAllResourcesRequest, SearchAllResourcesResponse, ResourceSearchResult> context, ApiFuture<SearchAllResourcesResponse> futureResponse)3447     public ApiFuture<SearchAllResourcesPage> createPageAsync(
3448         PageContext<SearchAllResourcesRequest, SearchAllResourcesResponse, ResourceSearchResult>
3449             context,
3450         ApiFuture<SearchAllResourcesResponse> futureResponse) {
3451       return super.createPageAsync(context, futureResponse);
3452     }
3453   }
3454 
3455   public static class SearchAllResourcesFixedSizeCollection
3456       extends AbstractFixedSizeCollection<
3457           SearchAllResourcesRequest,
3458           SearchAllResourcesResponse,
3459           ResourceSearchResult,
3460           SearchAllResourcesPage,
3461           SearchAllResourcesFixedSizeCollection> {
3462 
SearchAllResourcesFixedSizeCollection( List<SearchAllResourcesPage> pages, int collectionSize)3463     private SearchAllResourcesFixedSizeCollection(
3464         List<SearchAllResourcesPage> pages, int collectionSize) {
3465       super(pages, collectionSize);
3466     }
3467 
createEmptyCollection()3468     private static SearchAllResourcesFixedSizeCollection createEmptyCollection() {
3469       return new SearchAllResourcesFixedSizeCollection(null, 0);
3470     }
3471 
3472     @Override
createCollection( List<SearchAllResourcesPage> pages, int collectionSize)3473     protected SearchAllResourcesFixedSizeCollection createCollection(
3474         List<SearchAllResourcesPage> pages, int collectionSize) {
3475       return new SearchAllResourcesFixedSizeCollection(pages, collectionSize);
3476     }
3477   }
3478 
3479   public static class SearchAllIamPoliciesPagedResponse
3480       extends AbstractPagedListResponse<
3481           SearchAllIamPoliciesRequest,
3482           SearchAllIamPoliciesResponse,
3483           IamPolicySearchResult,
3484           SearchAllIamPoliciesPage,
3485           SearchAllIamPoliciesFixedSizeCollection> {
3486 
createAsync( PageContext< SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse, IamPolicySearchResult> context, ApiFuture<SearchAllIamPoliciesResponse> futureResponse)3487     public static ApiFuture<SearchAllIamPoliciesPagedResponse> createAsync(
3488         PageContext<
3489                 SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse, IamPolicySearchResult>
3490             context,
3491         ApiFuture<SearchAllIamPoliciesResponse> futureResponse) {
3492       ApiFuture<SearchAllIamPoliciesPage> futurePage =
3493           SearchAllIamPoliciesPage.createEmptyPage().createPageAsync(context, futureResponse);
3494       return ApiFutures.transform(
3495           futurePage,
3496           input -> new SearchAllIamPoliciesPagedResponse(input),
3497           MoreExecutors.directExecutor());
3498     }
3499 
SearchAllIamPoliciesPagedResponse(SearchAllIamPoliciesPage page)3500     private SearchAllIamPoliciesPagedResponse(SearchAllIamPoliciesPage page) {
3501       super(page, SearchAllIamPoliciesFixedSizeCollection.createEmptyCollection());
3502     }
3503   }
3504 
3505   public static class SearchAllIamPoliciesPage
3506       extends AbstractPage<
3507           SearchAllIamPoliciesRequest,
3508           SearchAllIamPoliciesResponse,
3509           IamPolicySearchResult,
3510           SearchAllIamPoliciesPage> {
3511 
SearchAllIamPoliciesPage( PageContext< SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse, IamPolicySearchResult> context, SearchAllIamPoliciesResponse response)3512     private SearchAllIamPoliciesPage(
3513         PageContext<
3514                 SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse, IamPolicySearchResult>
3515             context,
3516         SearchAllIamPoliciesResponse response) {
3517       super(context, response);
3518     }
3519 
createEmptyPage()3520     private static SearchAllIamPoliciesPage createEmptyPage() {
3521       return new SearchAllIamPoliciesPage(null, null);
3522     }
3523 
3524     @Override
createPage( PageContext< SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse, IamPolicySearchResult> context, SearchAllIamPoliciesResponse response)3525     protected SearchAllIamPoliciesPage createPage(
3526         PageContext<
3527                 SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse, IamPolicySearchResult>
3528             context,
3529         SearchAllIamPoliciesResponse response) {
3530       return new SearchAllIamPoliciesPage(context, response);
3531     }
3532 
3533     @Override
createPageAsync( PageContext< SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse, IamPolicySearchResult> context, ApiFuture<SearchAllIamPoliciesResponse> futureResponse)3534     public ApiFuture<SearchAllIamPoliciesPage> createPageAsync(
3535         PageContext<
3536                 SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse, IamPolicySearchResult>
3537             context,
3538         ApiFuture<SearchAllIamPoliciesResponse> futureResponse) {
3539       return super.createPageAsync(context, futureResponse);
3540     }
3541   }
3542 
3543   public static class SearchAllIamPoliciesFixedSizeCollection
3544       extends AbstractFixedSizeCollection<
3545           SearchAllIamPoliciesRequest,
3546           SearchAllIamPoliciesResponse,
3547           IamPolicySearchResult,
3548           SearchAllIamPoliciesPage,
3549           SearchAllIamPoliciesFixedSizeCollection> {
3550 
SearchAllIamPoliciesFixedSizeCollection( List<SearchAllIamPoliciesPage> pages, int collectionSize)3551     private SearchAllIamPoliciesFixedSizeCollection(
3552         List<SearchAllIamPoliciesPage> pages, int collectionSize) {
3553       super(pages, collectionSize);
3554     }
3555 
createEmptyCollection()3556     private static SearchAllIamPoliciesFixedSizeCollection createEmptyCollection() {
3557       return new SearchAllIamPoliciesFixedSizeCollection(null, 0);
3558     }
3559 
3560     @Override
createCollection( List<SearchAllIamPoliciesPage> pages, int collectionSize)3561     protected SearchAllIamPoliciesFixedSizeCollection createCollection(
3562         List<SearchAllIamPoliciesPage> pages, int collectionSize) {
3563       return new SearchAllIamPoliciesFixedSizeCollection(pages, collectionSize);
3564     }
3565   }
3566 
3567   public static class ListSavedQueriesPagedResponse
3568       extends AbstractPagedListResponse<
3569           ListSavedQueriesRequest,
3570           ListSavedQueriesResponse,
3571           SavedQuery,
3572           ListSavedQueriesPage,
3573           ListSavedQueriesFixedSizeCollection> {
3574 
createAsync( PageContext<ListSavedQueriesRequest, ListSavedQueriesResponse, SavedQuery> context, ApiFuture<ListSavedQueriesResponse> futureResponse)3575     public static ApiFuture<ListSavedQueriesPagedResponse> createAsync(
3576         PageContext<ListSavedQueriesRequest, ListSavedQueriesResponse, SavedQuery> context,
3577         ApiFuture<ListSavedQueriesResponse> futureResponse) {
3578       ApiFuture<ListSavedQueriesPage> futurePage =
3579           ListSavedQueriesPage.createEmptyPage().createPageAsync(context, futureResponse);
3580       return ApiFutures.transform(
3581           futurePage,
3582           input -> new ListSavedQueriesPagedResponse(input),
3583           MoreExecutors.directExecutor());
3584     }
3585 
ListSavedQueriesPagedResponse(ListSavedQueriesPage page)3586     private ListSavedQueriesPagedResponse(ListSavedQueriesPage page) {
3587       super(page, ListSavedQueriesFixedSizeCollection.createEmptyCollection());
3588     }
3589   }
3590 
3591   public static class ListSavedQueriesPage
3592       extends AbstractPage<
3593           ListSavedQueriesRequest, ListSavedQueriesResponse, SavedQuery, ListSavedQueriesPage> {
3594 
ListSavedQueriesPage( PageContext<ListSavedQueriesRequest, ListSavedQueriesResponse, SavedQuery> context, ListSavedQueriesResponse response)3595     private ListSavedQueriesPage(
3596         PageContext<ListSavedQueriesRequest, ListSavedQueriesResponse, SavedQuery> context,
3597         ListSavedQueriesResponse response) {
3598       super(context, response);
3599     }
3600 
createEmptyPage()3601     private static ListSavedQueriesPage createEmptyPage() {
3602       return new ListSavedQueriesPage(null, null);
3603     }
3604 
3605     @Override
createPage( PageContext<ListSavedQueriesRequest, ListSavedQueriesResponse, SavedQuery> context, ListSavedQueriesResponse response)3606     protected ListSavedQueriesPage createPage(
3607         PageContext<ListSavedQueriesRequest, ListSavedQueriesResponse, SavedQuery> context,
3608         ListSavedQueriesResponse response) {
3609       return new ListSavedQueriesPage(context, response);
3610     }
3611 
3612     @Override
createPageAsync( PageContext<ListSavedQueriesRequest, ListSavedQueriesResponse, SavedQuery> context, ApiFuture<ListSavedQueriesResponse> futureResponse)3613     public ApiFuture<ListSavedQueriesPage> createPageAsync(
3614         PageContext<ListSavedQueriesRequest, ListSavedQueriesResponse, SavedQuery> context,
3615         ApiFuture<ListSavedQueriesResponse> futureResponse) {
3616       return super.createPageAsync(context, futureResponse);
3617     }
3618   }
3619 
3620   public static class ListSavedQueriesFixedSizeCollection
3621       extends AbstractFixedSizeCollection<
3622           ListSavedQueriesRequest,
3623           ListSavedQueriesResponse,
3624           SavedQuery,
3625           ListSavedQueriesPage,
3626           ListSavedQueriesFixedSizeCollection> {
3627 
ListSavedQueriesFixedSizeCollection( List<ListSavedQueriesPage> pages, int collectionSize)3628     private ListSavedQueriesFixedSizeCollection(
3629         List<ListSavedQueriesPage> pages, int collectionSize) {
3630       super(pages, collectionSize);
3631     }
3632 
createEmptyCollection()3633     private static ListSavedQueriesFixedSizeCollection createEmptyCollection() {
3634       return new ListSavedQueriesFixedSizeCollection(null, 0);
3635     }
3636 
3637     @Override
createCollection( List<ListSavedQueriesPage> pages, int collectionSize)3638     protected ListSavedQueriesFixedSizeCollection createCollection(
3639         List<ListSavedQueriesPage> pages, int collectionSize) {
3640       return new ListSavedQueriesFixedSizeCollection(pages, collectionSize);
3641     }
3642   }
3643 
3644   public static class AnalyzeOrgPoliciesPagedResponse
3645       extends AbstractPagedListResponse<
3646           AnalyzeOrgPoliciesRequest,
3647           AnalyzeOrgPoliciesResponse,
3648           AnalyzeOrgPoliciesResponse.OrgPolicyResult,
3649           AnalyzeOrgPoliciesPage,
3650           AnalyzeOrgPoliciesFixedSizeCollection> {
3651 
createAsync( PageContext< AnalyzeOrgPoliciesRequest, AnalyzeOrgPoliciesResponse, AnalyzeOrgPoliciesResponse.OrgPolicyResult> context, ApiFuture<AnalyzeOrgPoliciesResponse> futureResponse)3652     public static ApiFuture<AnalyzeOrgPoliciesPagedResponse> createAsync(
3653         PageContext<
3654                 AnalyzeOrgPoliciesRequest,
3655                 AnalyzeOrgPoliciesResponse,
3656                 AnalyzeOrgPoliciesResponse.OrgPolicyResult>
3657             context,
3658         ApiFuture<AnalyzeOrgPoliciesResponse> futureResponse) {
3659       ApiFuture<AnalyzeOrgPoliciesPage> futurePage =
3660           AnalyzeOrgPoliciesPage.createEmptyPage().createPageAsync(context, futureResponse);
3661       return ApiFutures.transform(
3662           futurePage,
3663           input -> new AnalyzeOrgPoliciesPagedResponse(input),
3664           MoreExecutors.directExecutor());
3665     }
3666 
AnalyzeOrgPoliciesPagedResponse(AnalyzeOrgPoliciesPage page)3667     private AnalyzeOrgPoliciesPagedResponse(AnalyzeOrgPoliciesPage page) {
3668       super(page, AnalyzeOrgPoliciesFixedSizeCollection.createEmptyCollection());
3669     }
3670   }
3671 
3672   public static class AnalyzeOrgPoliciesPage
3673       extends AbstractPage<
3674           AnalyzeOrgPoliciesRequest,
3675           AnalyzeOrgPoliciesResponse,
3676           AnalyzeOrgPoliciesResponse.OrgPolicyResult,
3677           AnalyzeOrgPoliciesPage> {
3678 
AnalyzeOrgPoliciesPage( PageContext< AnalyzeOrgPoliciesRequest, AnalyzeOrgPoliciesResponse, AnalyzeOrgPoliciesResponse.OrgPolicyResult> context, AnalyzeOrgPoliciesResponse response)3679     private AnalyzeOrgPoliciesPage(
3680         PageContext<
3681                 AnalyzeOrgPoliciesRequest,
3682                 AnalyzeOrgPoliciesResponse,
3683                 AnalyzeOrgPoliciesResponse.OrgPolicyResult>
3684             context,
3685         AnalyzeOrgPoliciesResponse response) {
3686       super(context, response);
3687     }
3688 
createEmptyPage()3689     private static AnalyzeOrgPoliciesPage createEmptyPage() {
3690       return new AnalyzeOrgPoliciesPage(null, null);
3691     }
3692 
3693     @Override
createPage( PageContext< AnalyzeOrgPoliciesRequest, AnalyzeOrgPoliciesResponse, AnalyzeOrgPoliciesResponse.OrgPolicyResult> context, AnalyzeOrgPoliciesResponse response)3694     protected AnalyzeOrgPoliciesPage createPage(
3695         PageContext<
3696                 AnalyzeOrgPoliciesRequest,
3697                 AnalyzeOrgPoliciesResponse,
3698                 AnalyzeOrgPoliciesResponse.OrgPolicyResult>
3699             context,
3700         AnalyzeOrgPoliciesResponse response) {
3701       return new AnalyzeOrgPoliciesPage(context, response);
3702     }
3703 
3704     @Override
createPageAsync( PageContext< AnalyzeOrgPoliciesRequest, AnalyzeOrgPoliciesResponse, AnalyzeOrgPoliciesResponse.OrgPolicyResult> context, ApiFuture<AnalyzeOrgPoliciesResponse> futureResponse)3705     public ApiFuture<AnalyzeOrgPoliciesPage> createPageAsync(
3706         PageContext<
3707                 AnalyzeOrgPoliciesRequest,
3708                 AnalyzeOrgPoliciesResponse,
3709                 AnalyzeOrgPoliciesResponse.OrgPolicyResult>
3710             context,
3711         ApiFuture<AnalyzeOrgPoliciesResponse> futureResponse) {
3712       return super.createPageAsync(context, futureResponse);
3713     }
3714   }
3715 
3716   public static class AnalyzeOrgPoliciesFixedSizeCollection
3717       extends AbstractFixedSizeCollection<
3718           AnalyzeOrgPoliciesRequest,
3719           AnalyzeOrgPoliciesResponse,
3720           AnalyzeOrgPoliciesResponse.OrgPolicyResult,
3721           AnalyzeOrgPoliciesPage,
3722           AnalyzeOrgPoliciesFixedSizeCollection> {
3723 
AnalyzeOrgPoliciesFixedSizeCollection( List<AnalyzeOrgPoliciesPage> pages, int collectionSize)3724     private AnalyzeOrgPoliciesFixedSizeCollection(
3725         List<AnalyzeOrgPoliciesPage> pages, int collectionSize) {
3726       super(pages, collectionSize);
3727     }
3728 
createEmptyCollection()3729     private static AnalyzeOrgPoliciesFixedSizeCollection createEmptyCollection() {
3730       return new AnalyzeOrgPoliciesFixedSizeCollection(null, 0);
3731     }
3732 
3733     @Override
createCollection( List<AnalyzeOrgPoliciesPage> pages, int collectionSize)3734     protected AnalyzeOrgPoliciesFixedSizeCollection createCollection(
3735         List<AnalyzeOrgPoliciesPage> pages, int collectionSize) {
3736       return new AnalyzeOrgPoliciesFixedSizeCollection(pages, collectionSize);
3737     }
3738   }
3739 
3740   public static class AnalyzeOrgPolicyGovernedContainersPagedResponse
3741       extends AbstractPagedListResponse<
3742           AnalyzeOrgPolicyGovernedContainersRequest,
3743           AnalyzeOrgPolicyGovernedContainersResponse,
3744           AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer,
3745           AnalyzeOrgPolicyGovernedContainersPage,
3746           AnalyzeOrgPolicyGovernedContainersFixedSizeCollection> {
3747 
createAsync( PageContext< AnalyzeOrgPolicyGovernedContainersRequest, AnalyzeOrgPolicyGovernedContainersResponse, AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer> context, ApiFuture<AnalyzeOrgPolicyGovernedContainersResponse> futureResponse)3748     public static ApiFuture<AnalyzeOrgPolicyGovernedContainersPagedResponse> createAsync(
3749         PageContext<
3750                 AnalyzeOrgPolicyGovernedContainersRequest,
3751                 AnalyzeOrgPolicyGovernedContainersResponse,
3752                 AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer>
3753             context,
3754         ApiFuture<AnalyzeOrgPolicyGovernedContainersResponse> futureResponse) {
3755       ApiFuture<AnalyzeOrgPolicyGovernedContainersPage> futurePage =
3756           AnalyzeOrgPolicyGovernedContainersPage.createEmptyPage()
3757               .createPageAsync(context, futureResponse);
3758       return ApiFutures.transform(
3759           futurePage,
3760           input -> new AnalyzeOrgPolicyGovernedContainersPagedResponse(input),
3761           MoreExecutors.directExecutor());
3762     }
3763 
AnalyzeOrgPolicyGovernedContainersPagedResponse( AnalyzeOrgPolicyGovernedContainersPage page)3764     private AnalyzeOrgPolicyGovernedContainersPagedResponse(
3765         AnalyzeOrgPolicyGovernedContainersPage page) {
3766       super(page, AnalyzeOrgPolicyGovernedContainersFixedSizeCollection.createEmptyCollection());
3767     }
3768   }
3769 
3770   public static class AnalyzeOrgPolicyGovernedContainersPage
3771       extends AbstractPage<
3772           AnalyzeOrgPolicyGovernedContainersRequest,
3773           AnalyzeOrgPolicyGovernedContainersResponse,
3774           AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer,
3775           AnalyzeOrgPolicyGovernedContainersPage> {
3776 
AnalyzeOrgPolicyGovernedContainersPage( PageContext< AnalyzeOrgPolicyGovernedContainersRequest, AnalyzeOrgPolicyGovernedContainersResponse, AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer> context, AnalyzeOrgPolicyGovernedContainersResponse response)3777     private AnalyzeOrgPolicyGovernedContainersPage(
3778         PageContext<
3779                 AnalyzeOrgPolicyGovernedContainersRequest,
3780                 AnalyzeOrgPolicyGovernedContainersResponse,
3781                 AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer>
3782             context,
3783         AnalyzeOrgPolicyGovernedContainersResponse response) {
3784       super(context, response);
3785     }
3786 
createEmptyPage()3787     private static AnalyzeOrgPolicyGovernedContainersPage createEmptyPage() {
3788       return new AnalyzeOrgPolicyGovernedContainersPage(null, null);
3789     }
3790 
3791     @Override
createPage( PageContext< AnalyzeOrgPolicyGovernedContainersRequest, AnalyzeOrgPolicyGovernedContainersResponse, AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer> context, AnalyzeOrgPolicyGovernedContainersResponse response)3792     protected AnalyzeOrgPolicyGovernedContainersPage createPage(
3793         PageContext<
3794                 AnalyzeOrgPolicyGovernedContainersRequest,
3795                 AnalyzeOrgPolicyGovernedContainersResponse,
3796                 AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer>
3797             context,
3798         AnalyzeOrgPolicyGovernedContainersResponse response) {
3799       return new AnalyzeOrgPolicyGovernedContainersPage(context, response);
3800     }
3801 
3802     @Override
createPageAsync( PageContext< AnalyzeOrgPolicyGovernedContainersRequest, AnalyzeOrgPolicyGovernedContainersResponse, AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer> context, ApiFuture<AnalyzeOrgPolicyGovernedContainersResponse> futureResponse)3803     public ApiFuture<AnalyzeOrgPolicyGovernedContainersPage> createPageAsync(
3804         PageContext<
3805                 AnalyzeOrgPolicyGovernedContainersRequest,
3806                 AnalyzeOrgPolicyGovernedContainersResponse,
3807                 AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer>
3808             context,
3809         ApiFuture<AnalyzeOrgPolicyGovernedContainersResponse> futureResponse) {
3810       return super.createPageAsync(context, futureResponse);
3811     }
3812   }
3813 
3814   public static class AnalyzeOrgPolicyGovernedContainersFixedSizeCollection
3815       extends AbstractFixedSizeCollection<
3816           AnalyzeOrgPolicyGovernedContainersRequest,
3817           AnalyzeOrgPolicyGovernedContainersResponse,
3818           AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer,
3819           AnalyzeOrgPolicyGovernedContainersPage,
3820           AnalyzeOrgPolicyGovernedContainersFixedSizeCollection> {
3821 
AnalyzeOrgPolicyGovernedContainersFixedSizeCollection( List<AnalyzeOrgPolicyGovernedContainersPage> pages, int collectionSize)3822     private AnalyzeOrgPolicyGovernedContainersFixedSizeCollection(
3823         List<AnalyzeOrgPolicyGovernedContainersPage> pages, int collectionSize) {
3824       super(pages, collectionSize);
3825     }
3826 
createEmptyCollection()3827     private static AnalyzeOrgPolicyGovernedContainersFixedSizeCollection createEmptyCollection() {
3828       return new AnalyzeOrgPolicyGovernedContainersFixedSizeCollection(null, 0);
3829     }
3830 
3831     @Override
createCollection( List<AnalyzeOrgPolicyGovernedContainersPage> pages, int collectionSize)3832     protected AnalyzeOrgPolicyGovernedContainersFixedSizeCollection createCollection(
3833         List<AnalyzeOrgPolicyGovernedContainersPage> pages, int collectionSize) {
3834       return new AnalyzeOrgPolicyGovernedContainersFixedSizeCollection(pages, collectionSize);
3835     }
3836   }
3837 
3838   public static class AnalyzeOrgPolicyGovernedAssetsPagedResponse
3839       extends AbstractPagedListResponse<
3840           AnalyzeOrgPolicyGovernedAssetsRequest,
3841           AnalyzeOrgPolicyGovernedAssetsResponse,
3842           AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset,
3843           AnalyzeOrgPolicyGovernedAssetsPage,
3844           AnalyzeOrgPolicyGovernedAssetsFixedSizeCollection> {
3845 
createAsync( PageContext< AnalyzeOrgPolicyGovernedAssetsRequest, AnalyzeOrgPolicyGovernedAssetsResponse, AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset> context, ApiFuture<AnalyzeOrgPolicyGovernedAssetsResponse> futureResponse)3846     public static ApiFuture<AnalyzeOrgPolicyGovernedAssetsPagedResponse> createAsync(
3847         PageContext<
3848                 AnalyzeOrgPolicyGovernedAssetsRequest,
3849                 AnalyzeOrgPolicyGovernedAssetsResponse,
3850                 AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset>
3851             context,
3852         ApiFuture<AnalyzeOrgPolicyGovernedAssetsResponse> futureResponse) {
3853       ApiFuture<AnalyzeOrgPolicyGovernedAssetsPage> futurePage =
3854           AnalyzeOrgPolicyGovernedAssetsPage.createEmptyPage()
3855               .createPageAsync(context, futureResponse);
3856       return ApiFutures.transform(
3857           futurePage,
3858           input -> new AnalyzeOrgPolicyGovernedAssetsPagedResponse(input),
3859           MoreExecutors.directExecutor());
3860     }
3861 
AnalyzeOrgPolicyGovernedAssetsPagedResponse(AnalyzeOrgPolicyGovernedAssetsPage page)3862     private AnalyzeOrgPolicyGovernedAssetsPagedResponse(AnalyzeOrgPolicyGovernedAssetsPage page) {
3863       super(page, AnalyzeOrgPolicyGovernedAssetsFixedSizeCollection.createEmptyCollection());
3864     }
3865   }
3866 
3867   public static class AnalyzeOrgPolicyGovernedAssetsPage
3868       extends AbstractPage<
3869           AnalyzeOrgPolicyGovernedAssetsRequest,
3870           AnalyzeOrgPolicyGovernedAssetsResponse,
3871           AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset,
3872           AnalyzeOrgPolicyGovernedAssetsPage> {
3873 
AnalyzeOrgPolicyGovernedAssetsPage( PageContext< AnalyzeOrgPolicyGovernedAssetsRequest, AnalyzeOrgPolicyGovernedAssetsResponse, AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset> context, AnalyzeOrgPolicyGovernedAssetsResponse response)3874     private AnalyzeOrgPolicyGovernedAssetsPage(
3875         PageContext<
3876                 AnalyzeOrgPolicyGovernedAssetsRequest,
3877                 AnalyzeOrgPolicyGovernedAssetsResponse,
3878                 AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset>
3879             context,
3880         AnalyzeOrgPolicyGovernedAssetsResponse response) {
3881       super(context, response);
3882     }
3883 
createEmptyPage()3884     private static AnalyzeOrgPolicyGovernedAssetsPage createEmptyPage() {
3885       return new AnalyzeOrgPolicyGovernedAssetsPage(null, null);
3886     }
3887 
3888     @Override
createPage( PageContext< AnalyzeOrgPolicyGovernedAssetsRequest, AnalyzeOrgPolicyGovernedAssetsResponse, AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset> context, AnalyzeOrgPolicyGovernedAssetsResponse response)3889     protected AnalyzeOrgPolicyGovernedAssetsPage createPage(
3890         PageContext<
3891                 AnalyzeOrgPolicyGovernedAssetsRequest,
3892                 AnalyzeOrgPolicyGovernedAssetsResponse,
3893                 AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset>
3894             context,
3895         AnalyzeOrgPolicyGovernedAssetsResponse response) {
3896       return new AnalyzeOrgPolicyGovernedAssetsPage(context, response);
3897     }
3898 
3899     @Override
createPageAsync( PageContext< AnalyzeOrgPolicyGovernedAssetsRequest, AnalyzeOrgPolicyGovernedAssetsResponse, AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset> context, ApiFuture<AnalyzeOrgPolicyGovernedAssetsResponse> futureResponse)3900     public ApiFuture<AnalyzeOrgPolicyGovernedAssetsPage> createPageAsync(
3901         PageContext<
3902                 AnalyzeOrgPolicyGovernedAssetsRequest,
3903                 AnalyzeOrgPolicyGovernedAssetsResponse,
3904                 AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset>
3905             context,
3906         ApiFuture<AnalyzeOrgPolicyGovernedAssetsResponse> futureResponse) {
3907       return super.createPageAsync(context, futureResponse);
3908     }
3909   }
3910 
3911   public static class AnalyzeOrgPolicyGovernedAssetsFixedSizeCollection
3912       extends AbstractFixedSizeCollection<
3913           AnalyzeOrgPolicyGovernedAssetsRequest,
3914           AnalyzeOrgPolicyGovernedAssetsResponse,
3915           AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset,
3916           AnalyzeOrgPolicyGovernedAssetsPage,
3917           AnalyzeOrgPolicyGovernedAssetsFixedSizeCollection> {
3918 
AnalyzeOrgPolicyGovernedAssetsFixedSizeCollection( List<AnalyzeOrgPolicyGovernedAssetsPage> pages, int collectionSize)3919     private AnalyzeOrgPolicyGovernedAssetsFixedSizeCollection(
3920         List<AnalyzeOrgPolicyGovernedAssetsPage> pages, int collectionSize) {
3921       super(pages, collectionSize);
3922     }
3923 
createEmptyCollection()3924     private static AnalyzeOrgPolicyGovernedAssetsFixedSizeCollection createEmptyCollection() {
3925       return new AnalyzeOrgPolicyGovernedAssetsFixedSizeCollection(null, 0);
3926     }
3927 
3928     @Override
createCollection( List<AnalyzeOrgPolicyGovernedAssetsPage> pages, int collectionSize)3929     protected AnalyzeOrgPolicyGovernedAssetsFixedSizeCollection createCollection(
3930         List<AnalyzeOrgPolicyGovernedAssetsPage> pages, int collectionSize) {
3931       return new AnalyzeOrgPolicyGovernedAssetsFixedSizeCollection(pages, collectionSize);
3932     }
3933   }
3934 }
3935