Skip to content
Permalink
Browse files
feat: add AnalyzeIamPolicy and AnalyzeIamPolicyLongrunning RPCs (#421)
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/816ff12b-c3e5-41e6-bb67-a4a76d38d18d/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 339708980
Source-Link: googleapis/googleapis@00bbad4
  • Loading branch information
yoshi-automation committed Oct 30, 2020
1 parent 7631fa1 commit ff91bef1cb1b89052dbab3f812d7fb5d0a0a236f
Showing with 29,676 additions and 66 deletions.
  1. +150 −0 google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceClient.java
  2. +47 −0 google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceSettings.java
  3. +25 −0 google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStub.java
  4. +125 −2 google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java
  5. +98 −0 google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java
  6. +107 −0 google-cloud-asset/src/test/java/com/google/cloud/asset/v1/AssetServiceClientTest.java
  7. +30 −0 google-cloud-asset/src/test/java/com/google/cloud/asset/v1/MockAssetServiceImpl.java
  8. +277 −0 grpc-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetServiceGrpc.java
  9. +1,070 −0 ...le-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyLongrunningRequest.java
  10. +107 −0 ...asset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyLongrunningRequestOrBuilder.java
  11. +463 −0 ...e-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyLongrunningResponse.java
  12. +24 −0 ...sset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyLongrunningResponseOrBuilder.java
  13. +1,142 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyRequest.java
  14. +128 −0 ...ogle-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyRequestOrBuilder.java
  15. +3,537 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyResponse.java
  16. +155 −0 ...gle-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyResponseOrBuilder.java
  17. +147 −5 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetProto.java
  18. +288 −46 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetServiceProto.java
  19. +3,564 −0 ...-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisOutputConfig.java
  20. +110 −0 ...loud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisOutputConfigOrBuilder.java
  21. +5,818 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisQuery.java
  22. +233 −0 ...oogle-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisQueryOrBuilder.java
  23. +10,424 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisResult.java
  24. +213 −0 ...ogle-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisResultOrBuilder.java
  25. +820 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisState.java
  26. +85 −0 ...oogle-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisStateOrBuilder.java
  27. +315 −0 proto-google-cloud-asset-v1/src/main/proto/google/cloud/asset/v1/asset_service.proto
  28. +145 −0 proto-google-cloud-asset-v1/src/main/proto/google/cloud/asset/v1/assets.proto
  29. +29 −13 synth.metadata
@@ -1021,6 +1021,156 @@ public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies(
return stub.searchAllIamPoliciesCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Analyzes IAM policies to answer which identities have what accesses on which resources.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
* AnalyzeIamPolicyRequest request = AnalyzeIamPolicyRequest.newBuilder()
* .setAnalysisQuery(analysisQuery)
* .build();
* AnalyzeIamPolicyResponse response = assetServiceClient.analyzeIamPolicy(request);
* }
* </code></pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest request) {
return analyzeIamPolicyCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Analyzes IAM policies to answer which identities have what accesses on which resources.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
* AnalyzeIamPolicyRequest request = AnalyzeIamPolicyRequest.newBuilder()
* .setAnalysisQuery(analysisQuery)
* .build();
* ApiFuture&lt;AnalyzeIamPolicyResponse&gt; future = assetServiceClient.analyzeIamPolicyCallable().futureCall(request);
* // Do something
* AnalyzeIamPolicyResponse response = future.get();
* }
* </code></pre>
*/
public final UnaryCallable<AnalyzeIamPolicyRequest, AnalyzeIamPolicyResponse>
analyzeIamPolicyCallable() {
return stub.analyzeIamPolicyCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Analyzes IAM policies asynchronously to answer which identities have what accesses on which
* resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination.
* For Cloud Storage destination, the output format is the JSON format that represents a
* [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method
* implements the [google.longrunning.Operation][google.longrunning.Operation], which allows you
* to track the operation status. We recommend intervals of at least 2 seconds with exponential
* backoff retry to poll the operation result. The metadata contains the request to help callers
* to map responses to requests.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
* IamPolicyAnalysisOutputConfig outputConfig = IamPolicyAnalysisOutputConfig.newBuilder().build();
* AnalyzeIamPolicyLongrunningRequest request = AnalyzeIamPolicyLongrunningRequest.newBuilder()
* .setAnalysisQuery(analysisQuery)
* .setOutputConfig(outputConfig)
* .build();
* AnalyzeIamPolicyLongrunningResponse response = assetServiceClient.analyzeIamPolicyLongrunningAsync(request).get();
* }
* </code></pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<
AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningRequest>
analyzeIamPolicyLongrunningAsync(AnalyzeIamPolicyLongrunningRequest request) {
return analyzeIamPolicyLongrunningOperationCallable().futureCall(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Analyzes IAM policies asynchronously to answer which identities have what accesses on which
* resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination.
* For Cloud Storage destination, the output format is the JSON format that represents a
* [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method
* implements the [google.longrunning.Operation][google.longrunning.Operation], which allows you
* to track the operation status. We recommend intervals of at least 2 seconds with exponential
* backoff retry to poll the operation result. The metadata contains the request to help callers
* to map responses to requests.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
* IamPolicyAnalysisOutputConfig outputConfig = IamPolicyAnalysisOutputConfig.newBuilder().build();
* AnalyzeIamPolicyLongrunningRequest request = AnalyzeIamPolicyLongrunningRequest.newBuilder()
* .setAnalysisQuery(analysisQuery)
* .setOutputConfig(outputConfig)
* .build();
* OperationFuture&lt;AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningRequest&gt; future = assetServiceClient.analyzeIamPolicyLongrunningOperationCallable().futureCall(request);
* // Do something
* AnalyzeIamPolicyLongrunningResponse response = future.get();
* }
* </code></pre>
*/
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallable<
AnalyzeIamPolicyLongrunningRequest,
AnalyzeIamPolicyLongrunningResponse,
AnalyzeIamPolicyLongrunningRequest>
analyzeIamPolicyLongrunningOperationCallable() {
return stub.analyzeIamPolicyLongrunningOperationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Analyzes IAM policies asynchronously to answer which identities have what accesses on which
* resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination.
* For Cloud Storage destination, the output format is the JSON format that represents a
* [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method
* implements the [google.longrunning.Operation][google.longrunning.Operation], which allows you
* to track the operation status. We recommend intervals of at least 2 seconds with exponential
* backoff retry to poll the operation result. The metadata contains the request to help callers
* to map responses to requests.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
* IamPolicyAnalysisOutputConfig outputConfig = IamPolicyAnalysisOutputConfig.newBuilder().build();
* AnalyzeIamPolicyLongrunningRequest request = AnalyzeIamPolicyLongrunningRequest.newBuilder()
* .setAnalysisQuery(analysisQuery)
* .setOutputConfig(outputConfig)
* .build();
* ApiFuture&lt;Operation&gt; future = assetServiceClient.analyzeIamPolicyLongrunningCallable().futureCall(request);
* // Do something
* Operation response = future.get();
* }
* </code></pre>
*/
public final UnaryCallable<AnalyzeIamPolicyLongrunningRequest, Operation>
analyzeIamPolicyLongrunningCallable() {
return stub.analyzeIamPolicyLongrunningCallable();
}

@Override
public final void close() {
stub.close();
@@ -131,6 +131,30 @@ public UnaryCallSettings<DeleteFeedRequest, Empty> deleteFeedSettings() {
return ((AssetServiceStubSettings) getStubSettings()).searchAllIamPoliciesSettings();
}

/** Returns the object with the settings used for calls to analyzeIamPolicy. */
public UnaryCallSettings<AnalyzeIamPolicyRequest, AnalyzeIamPolicyResponse>
analyzeIamPolicySettings() {
return ((AssetServiceStubSettings) getStubSettings()).analyzeIamPolicySettings();
}

/** Returns the object with the settings used for calls to analyzeIamPolicyLongrunning. */
public UnaryCallSettings<AnalyzeIamPolicyLongrunningRequest, Operation>
analyzeIamPolicyLongrunningSettings() {
return ((AssetServiceStubSettings) getStubSettings()).analyzeIamPolicyLongrunningSettings();
}

/** Returns the object with the settings used for calls to analyzeIamPolicyLongrunning. */
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public OperationCallSettings<
AnalyzeIamPolicyLongrunningRequest,
AnalyzeIamPolicyLongrunningResponse,
AnalyzeIamPolicyLongrunningRequest>
analyzeIamPolicyLongrunningOperationSettings() {
return ((AssetServiceStubSettings) getStubSettings())
.analyzeIamPolicyLongrunningOperationSettings();
}

public static final AssetServiceSettings create(AssetServiceStubSettings stub)
throws IOException {
return new AssetServiceSettings.Builder(stub.toBuilder()).build();
@@ -289,6 +313,29 @@ public UnaryCallSettings.Builder<DeleteFeedRequest, Empty> deleteFeedSettings()
return getStubSettingsBuilder().searchAllIamPoliciesSettings();
}

/** Returns the builder for the settings used for calls to analyzeIamPolicy. */
public UnaryCallSettings.Builder<AnalyzeIamPolicyRequest, AnalyzeIamPolicyResponse>
analyzeIamPolicySettings() {
return getStubSettingsBuilder().analyzeIamPolicySettings();
}

/** Returns the builder for the settings used for calls to analyzeIamPolicyLongrunning. */
public UnaryCallSettings.Builder<AnalyzeIamPolicyLongrunningRequest, Operation>
analyzeIamPolicyLongrunningSettings() {
return getStubSettingsBuilder().analyzeIamPolicyLongrunningSettings();
}

/** Returns the builder for the settings used for calls to analyzeIamPolicyLongrunning. */
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public OperationCallSettings.Builder<
AnalyzeIamPolicyLongrunningRequest,
AnalyzeIamPolicyLongrunningResponse,
AnalyzeIamPolicyLongrunningRequest>
analyzeIamPolicyLongrunningOperationSettings() {
return getStubSettingsBuilder().analyzeIamPolicyLongrunningOperationSettings();
}

@Override
public AssetServiceSettings build() throws IOException {
return new AssetServiceSettings(this);
@@ -22,6 +22,10 @@
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest;
import com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse;
import com.google.cloud.asset.v1.AnalyzeIamPolicyRequest;
import com.google.cloud.asset.v1.AnalyzeIamPolicyResponse;
import com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest;
import com.google.cloud.asset.v1.BatchGetAssetsHistoryResponse;
import com.google.cloud.asset.v1.CreateFeedRequest;
@@ -112,6 +116,27 @@ public UnaryCallable<DeleteFeedRequest, Empty> deleteFeedCallable() {
throw new UnsupportedOperationException("Not implemented: searchAllIamPoliciesCallable()");
}

public UnaryCallable<AnalyzeIamPolicyRequest, AnalyzeIamPolicyResponse>
analyzeIamPolicyCallable() {
throw new UnsupportedOperationException("Not implemented: analyzeIamPolicyCallable()");
}

@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public OperationCallable<
AnalyzeIamPolicyLongrunningRequest,
AnalyzeIamPolicyLongrunningResponse,
AnalyzeIamPolicyLongrunningRequest>
analyzeIamPolicyLongrunningOperationCallable() {
throw new UnsupportedOperationException(
"Not implemented: analyzeIamPolicyLongrunningOperationCallable()");
}

public UnaryCallable<AnalyzeIamPolicyLongrunningRequest, Operation>
analyzeIamPolicyLongrunningCallable() {
throw new UnsupportedOperationException(
"Not implemented: analyzeIamPolicyLongrunningCallable()");
}

@Override
public abstract void close();
}

0 comments on commit ff91bef

Please sign in to comment.