Skip to content
Permalink
Browse files
feat!(v1): add support for per type and partition export, remove Anal…
…yzeIamPolicy/ExportIamPolicyAnalysis (#325)

* changes without context

        autosynth cannot find the source of changes triggered by earlier changes in this
        repository, or by version upgrades to tools such as linters.

* fix!: remove AnalyzeIamPolicy and ExportIamPolicyAnalysis RPCs

BREAKING CHANGE: These RPCs do not currently work on the backend, so they should not be added to the client libraries.

PiperOrigin-RevId: 330786980

Source-Author: Google APIs <noreply@google.com>
Source-Date: Wed Sep 9 13:35:02 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: ef03f63f2f2d3b2dd936e46595c0f746cb10c43c
Source-Link: googleapis/googleapis@ef03f63

* feat: added support for per type and partition export for Cloud Asset API

Clients can now specify two more args when export assets to bigquery

PiperOrigin-RevId: 331912851

Source-Author: Google APIs <noreply@google.com>
Source-Date: Tue Sep 15 20:04:02 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 5e53d6b6dde0e72fa9510ec1d796176d128afa40
Source-Link: googleapis/googleapis@5e53d6b

* chore: allow breaking changes

Co-authored-by: Jeff Ching <chingor@google.com>
  • Loading branch information
yoshi-automation and chingor13 committed Sep 22, 2020
1 parent 01f9cc8 commit 28859a7bd9ecb68a9a3ffeebd14b6a8b8254f131
Showing with 1,859 additions and 32,982 deletions.
  1. +13 −2 google-cloud-asset/clirr-ignored-differences.xml
  2. +0 −149 google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceClient.java
  3. +0 −47 google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceSettings.java
  4. +0 −24 google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStub.java
  5. +2 −122 google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java
  6. +0 −97 google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java
  7. +0 −107 google-cloud-asset/src/test/java/com/google/cloud/asset/v1/AssetServiceClientTest.java
  8. +0 −30 google-cloud-asset/src/test/java/com/google/cloud/asset/v1/MockAssetServiceImpl.java
  9. +14 −4 grpc-google-cloud-asset-v1/clirr-ignored-differences.xml
  10. +0 −273 grpc-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetServiceGrpc.java
  11. +14 −0 proto-google-cloud-asset-v1/clirr-ignored-differences.xml
  12. +0 −1,312 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyRequest.java
  13. +0 −170 ...ogle-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyRequestOrBuilder.java
  14. +0 −5,981 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyResponse.java
  15. +0 −155 ...gle-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyResponseOrBuilder.java
  16. +64 −200 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetProto.java
  17. +101 −365 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetServiceProto.java
  18. +628 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BigQueryDestination.java
  19. +113 −0 ...o-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BigQueryDestinationOrBuilder.java
  20. +0 −1,067 ...google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ExportIamPolicyAnalysisRequest.java
  21. +0 −107 ...oud-asset-v1/src/main/java/com/google/cloud/asset/v1/ExportIamPolicyAnalysisRequestOrBuilder.java
  22. +0 −458 ...oogle-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ExportIamPolicyAnalysisResponse.java
  23. +0 −3,666 ...-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisOutputConfig.java
  24. +0 −110 ...loud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisOutputConfigOrBuilder.java
  25. +0 −6,062 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisQuery.java
  26. +0 −233 ...oogle-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisQueryOrBuilder.java
  27. +0 −10,499 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisResult.java
  28. +0 −224 ...ogle-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisResultOrBuilder.java
  29. +0 −820 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisState.java
  30. +0 −85 ...oogle-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisStateOrBuilder.java
  31. +787 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/PartitionSpec.java
  32. +29 −3 ...ogle/cloud/asset/v1/{ExportIamPolicyAnalysisResponseOrBuilder.java → PartitionSpecOrBuilder.java}
  33. +77 −425 proto-google-cloud-asset-v1/src/main/proto/google/cloud/asset/v1/asset_service.proto
  34. +3 −157 proto-google-cloud-asset-v1/src/main/proto/google/cloud/asset/v1/assets.proto
  35. +14 −28 synth.metadata
@@ -1,9 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- see http://www.mojohaus.org/clirr-maven-plugin/examples/ignored-differences.html -->
<differences>
<!-- TODO: remove after 2.0.0 is released -->
<difference>
<differenceType>7002</differenceType>
<className>com/google/cloud/asset/v1p2beta1/AssetServiceClient</className>
<method>java.lang.String *FeedName(*)</method>
<className>com/google/cloud/asset/v1/AssetServiceClient</className>
<method>* *IamPolicy*(*)</method>
</difference>
<difference>
<differenceType>7002</differenceType>
<className>com/google/cloud/asset/v1/AssetServiceSettings*</className>
<method>* *IamPolicy*(*)</method>
</difference>
<difference>
<differenceType>7002</differenceType>
<className>com/google/cloud/asset/v1/stub/*AssetServiceStub*</className>
<method>* *IamPolicy*(*)</method>
</difference>
</differences>
@@ -1021,155 +1021,6 @@ 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
/**
* Exports the answers of which identities have what accesses on which resources to a Google Cloud
* Storage or a BigQuery destination. For Cloud Storage destination, the output format is the JSON
* format that represents a
* [google.cloud.asset.v1.AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse].
* This method implements the [google.longrunning.Operation][google.longrunning.Operation], which
* allows you to track the export status. We recommend intervals of at least 2 seconds with
* exponential retry to poll the export 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();
* ExportIamPolicyAnalysisRequest request = ExportIamPolicyAnalysisRequest.newBuilder()
* .setAnalysisQuery(analysisQuery)
* .setOutputConfig(outputConfig)
* .build();
* ExportIamPolicyAnalysisResponse response = assetServiceClient.exportIamPolicyAnalysisAsync(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<ExportIamPolicyAnalysisResponse, ExportIamPolicyAnalysisRequest>
exportIamPolicyAnalysisAsync(ExportIamPolicyAnalysisRequest request) {
return exportIamPolicyAnalysisOperationCallable().futureCall(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Exports the answers of which identities have what accesses on which resources to a Google Cloud
* Storage or a BigQuery destination. For Cloud Storage destination, the output format is the JSON
* format that represents a
* [google.cloud.asset.v1.AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse].
* This method implements the [google.longrunning.Operation][google.longrunning.Operation], which
* allows you to track the export status. We recommend intervals of at least 2 seconds with
* exponential retry to poll the export 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();
* ExportIamPolicyAnalysisRequest request = ExportIamPolicyAnalysisRequest.newBuilder()
* .setAnalysisQuery(analysisQuery)
* .setOutputConfig(outputConfig)
* .build();
* OperationFuture&lt;ExportIamPolicyAnalysisResponse, ExportIamPolicyAnalysisRequest&gt; future = assetServiceClient.exportIamPolicyAnalysisOperationCallable().futureCall(request);
* // Do something
* ExportIamPolicyAnalysisResponse 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<
ExportIamPolicyAnalysisRequest,
ExportIamPolicyAnalysisResponse,
ExportIamPolicyAnalysisRequest>
exportIamPolicyAnalysisOperationCallable() {
return stub.exportIamPolicyAnalysisOperationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Exports the answers of which identities have what accesses on which resources to a Google Cloud
* Storage or a BigQuery destination. For Cloud Storage destination, the output format is the JSON
* format that represents a
* [google.cloud.asset.v1.AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse].
* This method implements the [google.longrunning.Operation][google.longrunning.Operation], which
* allows you to track the export status. We recommend intervals of at least 2 seconds with
* exponential retry to poll the export 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();
* ExportIamPolicyAnalysisRequest request = ExportIamPolicyAnalysisRequest.newBuilder()
* .setAnalysisQuery(analysisQuery)
* .setOutputConfig(outputConfig)
* .build();
* ApiFuture&lt;Operation&gt; future = assetServiceClient.exportIamPolicyAnalysisCallable().futureCall(request);
* // Do something
* Operation response = future.get();
* }
* </code></pre>
*/
public final UnaryCallable<ExportIamPolicyAnalysisRequest, Operation>
exportIamPolicyAnalysisCallable() {
return stub.exportIamPolicyAnalysisCallable();
}

@Override
public final void close() {
stub.close();
@@ -131,30 +131,6 @@ 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 exportIamPolicyAnalysis. */
public UnaryCallSettings<ExportIamPolicyAnalysisRequest, Operation>
exportIamPolicyAnalysisSettings() {
return ((AssetServiceStubSettings) getStubSettings()).exportIamPolicyAnalysisSettings();
}

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

public static final AssetServiceSettings create(AssetServiceStubSettings stub)
throws IOException {
return new AssetServiceSettings.Builder(stub.toBuilder()).build();
@@ -313,29 +289,6 @@ 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 exportIamPolicyAnalysis. */
public UnaryCallSettings.Builder<ExportIamPolicyAnalysisRequest, Operation>
exportIamPolicyAnalysisSettings() {
return getStubSettingsBuilder().exportIamPolicyAnalysisSettings();
}

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

@Override
public AssetServiceSettings build() throws IOException {
return new AssetServiceSettings(this);
@@ -22,16 +22,12 @@
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.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;
import com.google.cloud.asset.v1.DeleteFeedRequest;
import com.google.cloud.asset.v1.ExportAssetsRequest;
import com.google.cloud.asset.v1.ExportAssetsResponse;
import com.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest;
import com.google.cloud.asset.v1.ExportIamPolicyAnalysisResponse;
import com.google.cloud.asset.v1.Feed;
import com.google.cloud.asset.v1.GetFeedRequest;
import com.google.cloud.asset.v1.ListFeedsRequest;
@@ -116,26 +112,6 @@ 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<
ExportIamPolicyAnalysisRequest,
ExportIamPolicyAnalysisResponse,
ExportIamPolicyAnalysisRequest>
exportIamPolicyAnalysisOperationCallable() {
throw new UnsupportedOperationException(
"Not implemented: exportIamPolicyAnalysisOperationCallable()");
}

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

@Override
public abstract void close();
}

0 comments on commit 28859a7

Please sign in to comment.