Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Commit 28859a7

Browse files
feat!(v1): add support for per type and partition export, remove AnalyzeIamPolicy/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>
1 parent 01f9cc8 commit 28859a7

35 files changed

+1859
-32982
lines changed
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!-- see http://www.mojohaus.org/clirr-maven-plugin/examples/ignored-differences.html -->
33
<differences>
4+
<!-- TODO: remove after 2.0.0 is released -->
45
<difference>
56
<differenceType>7002</differenceType>
6-
<className>com/google/cloud/asset/v1p2beta1/AssetServiceClient</className>
7-
<method>java.lang.String *FeedName(*)</method>
7+
<className>com/google/cloud/asset/v1/AssetServiceClient</className>
8+
<method>* *IamPolicy*(*)</method>
9+
</difference>
10+
<difference>
11+
<differenceType>7002</differenceType>
12+
<className>com/google/cloud/asset/v1/AssetServiceSettings*</className>
13+
<method>* *IamPolicy*(*)</method>
14+
</difference>
15+
<difference>
16+
<differenceType>7002</differenceType>
17+
<className>com/google/cloud/asset/v1/stub/*AssetServiceStub*</className>
18+
<method>* *IamPolicy*(*)</method>
819
</difference>
920
</differences>

google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceClient.java

Lines changed: 0 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,155 +1021,6 @@ public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies(
10211021
return stub.searchAllIamPoliciesCallable();
10221022
}
10231023

1024-
// AUTO-GENERATED DOCUMENTATION AND METHOD
1025-
/**
1026-
* Analyzes IAM policies to answer which identities have what accesses on which resources.
1027-
*
1028-
* <p>Sample code:
1029-
*
1030-
* <pre><code>
1031-
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1032-
* IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
1033-
* AnalyzeIamPolicyRequest request = AnalyzeIamPolicyRequest.newBuilder()
1034-
* .setAnalysisQuery(analysisQuery)
1035-
* .build();
1036-
* AnalyzeIamPolicyResponse response = assetServiceClient.analyzeIamPolicy(request);
1037-
* }
1038-
* </code></pre>
1039-
*
1040-
* @param request The request object containing all of the parameters for the API call.
1041-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1042-
*/
1043-
public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest request) {
1044-
return analyzeIamPolicyCallable().call(request);
1045-
}
1046-
1047-
// AUTO-GENERATED DOCUMENTATION AND METHOD
1048-
/**
1049-
* Analyzes IAM policies to answer which identities have what accesses on which resources.
1050-
*
1051-
* <p>Sample code:
1052-
*
1053-
* <pre><code>
1054-
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1055-
* IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
1056-
* AnalyzeIamPolicyRequest request = AnalyzeIamPolicyRequest.newBuilder()
1057-
* .setAnalysisQuery(analysisQuery)
1058-
* .build();
1059-
* ApiFuture&lt;AnalyzeIamPolicyResponse&gt; future = assetServiceClient.analyzeIamPolicyCallable().futureCall(request);
1060-
* // Do something
1061-
* AnalyzeIamPolicyResponse response = future.get();
1062-
* }
1063-
* </code></pre>
1064-
*/
1065-
public final UnaryCallable<AnalyzeIamPolicyRequest, AnalyzeIamPolicyResponse>
1066-
analyzeIamPolicyCallable() {
1067-
return stub.analyzeIamPolicyCallable();
1068-
}
1069-
1070-
// AUTO-GENERATED DOCUMENTATION AND METHOD
1071-
/**
1072-
* Exports the answers of which identities have what accesses on which resources to a Google Cloud
1073-
* Storage or a BigQuery destination. For Cloud Storage destination, the output format is the JSON
1074-
* format that represents a
1075-
* [google.cloud.asset.v1.AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse].
1076-
* This method implements the [google.longrunning.Operation][google.longrunning.Operation], which
1077-
* allows you to track the export status. We recommend intervals of at least 2 seconds with
1078-
* exponential retry to poll the export operation result. The metadata contains the request to
1079-
* help callers to map responses to requests.
1080-
*
1081-
* <p>Sample code:
1082-
*
1083-
* <pre><code>
1084-
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1085-
* IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
1086-
* IamPolicyAnalysisOutputConfig outputConfig = IamPolicyAnalysisOutputConfig.newBuilder().build();
1087-
* ExportIamPolicyAnalysisRequest request = ExportIamPolicyAnalysisRequest.newBuilder()
1088-
* .setAnalysisQuery(analysisQuery)
1089-
* .setOutputConfig(outputConfig)
1090-
* .build();
1091-
* ExportIamPolicyAnalysisResponse response = assetServiceClient.exportIamPolicyAnalysisAsync(request).get();
1092-
* }
1093-
* </code></pre>
1094-
*
1095-
* @param request The request object containing all of the parameters for the API call.
1096-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1097-
*/
1098-
@BetaApi(
1099-
"The surface for long-running operations is not stable yet and may change in the future.")
1100-
public final OperationFuture<ExportIamPolicyAnalysisResponse, ExportIamPolicyAnalysisRequest>
1101-
exportIamPolicyAnalysisAsync(ExportIamPolicyAnalysisRequest request) {
1102-
return exportIamPolicyAnalysisOperationCallable().futureCall(request);
1103-
}
1104-
1105-
// AUTO-GENERATED DOCUMENTATION AND METHOD
1106-
/**
1107-
* Exports the answers of which identities have what accesses on which resources to a Google Cloud
1108-
* Storage or a BigQuery destination. For Cloud Storage destination, the output format is the JSON
1109-
* format that represents a
1110-
* [google.cloud.asset.v1.AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse].
1111-
* This method implements the [google.longrunning.Operation][google.longrunning.Operation], which
1112-
* allows you to track the export status. We recommend intervals of at least 2 seconds with
1113-
* exponential retry to poll the export operation result. The metadata contains the request to
1114-
* help callers to map responses to requests.
1115-
*
1116-
* <p>Sample code:
1117-
*
1118-
* <pre><code>
1119-
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1120-
* IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
1121-
* IamPolicyAnalysisOutputConfig outputConfig = IamPolicyAnalysisOutputConfig.newBuilder().build();
1122-
* ExportIamPolicyAnalysisRequest request = ExportIamPolicyAnalysisRequest.newBuilder()
1123-
* .setAnalysisQuery(analysisQuery)
1124-
* .setOutputConfig(outputConfig)
1125-
* .build();
1126-
* OperationFuture&lt;ExportIamPolicyAnalysisResponse, ExportIamPolicyAnalysisRequest&gt; future = assetServiceClient.exportIamPolicyAnalysisOperationCallable().futureCall(request);
1127-
* // Do something
1128-
* ExportIamPolicyAnalysisResponse response = future.get();
1129-
* }
1130-
* </code></pre>
1131-
*/
1132-
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
1133-
public final OperationCallable<
1134-
ExportIamPolicyAnalysisRequest,
1135-
ExportIamPolicyAnalysisResponse,
1136-
ExportIamPolicyAnalysisRequest>
1137-
exportIamPolicyAnalysisOperationCallable() {
1138-
return stub.exportIamPolicyAnalysisOperationCallable();
1139-
}
1140-
1141-
// AUTO-GENERATED DOCUMENTATION AND METHOD
1142-
/**
1143-
* Exports the answers of which identities have what accesses on which resources to a Google Cloud
1144-
* Storage or a BigQuery destination. For Cloud Storage destination, the output format is the JSON
1145-
* format that represents a
1146-
* [google.cloud.asset.v1.AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse].
1147-
* This method implements the [google.longrunning.Operation][google.longrunning.Operation], which
1148-
* allows you to track the export status. We recommend intervals of at least 2 seconds with
1149-
* exponential retry to poll the export operation result. The metadata contains the request to
1150-
* help callers to map responses to requests.
1151-
*
1152-
* <p>Sample code:
1153-
*
1154-
* <pre><code>
1155-
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
1156-
* IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
1157-
* IamPolicyAnalysisOutputConfig outputConfig = IamPolicyAnalysisOutputConfig.newBuilder().build();
1158-
* ExportIamPolicyAnalysisRequest request = ExportIamPolicyAnalysisRequest.newBuilder()
1159-
* .setAnalysisQuery(analysisQuery)
1160-
* .setOutputConfig(outputConfig)
1161-
* .build();
1162-
* ApiFuture&lt;Operation&gt; future = assetServiceClient.exportIamPolicyAnalysisCallable().futureCall(request);
1163-
* // Do something
1164-
* Operation response = future.get();
1165-
* }
1166-
* </code></pre>
1167-
*/
1168-
public final UnaryCallable<ExportIamPolicyAnalysisRequest, Operation>
1169-
exportIamPolicyAnalysisCallable() {
1170-
return stub.exportIamPolicyAnalysisCallable();
1171-
}
1172-
11731024
@Override
11741025
public final void close() {
11751026
stub.close();

google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceSettings.java

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -131,30 +131,6 @@ public UnaryCallSettings<DeleteFeedRequest, Empty> deleteFeedSettings() {
131131
return ((AssetServiceStubSettings) getStubSettings()).searchAllIamPoliciesSettings();
132132
}
133133

134-
/** Returns the object with the settings used for calls to analyzeIamPolicy. */
135-
public UnaryCallSettings<AnalyzeIamPolicyRequest, AnalyzeIamPolicyResponse>
136-
analyzeIamPolicySettings() {
137-
return ((AssetServiceStubSettings) getStubSettings()).analyzeIamPolicySettings();
138-
}
139-
140-
/** Returns the object with the settings used for calls to exportIamPolicyAnalysis. */
141-
public UnaryCallSettings<ExportIamPolicyAnalysisRequest, Operation>
142-
exportIamPolicyAnalysisSettings() {
143-
return ((AssetServiceStubSettings) getStubSettings()).exportIamPolicyAnalysisSettings();
144-
}
145-
146-
/** Returns the object with the settings used for calls to exportIamPolicyAnalysis. */
147-
@BetaApi(
148-
"The surface for long-running operations is not stable yet and may change in the future.")
149-
public OperationCallSettings<
150-
ExportIamPolicyAnalysisRequest,
151-
ExportIamPolicyAnalysisResponse,
152-
ExportIamPolicyAnalysisRequest>
153-
exportIamPolicyAnalysisOperationSettings() {
154-
return ((AssetServiceStubSettings) getStubSettings())
155-
.exportIamPolicyAnalysisOperationSettings();
156-
}
157-
158134
public static final AssetServiceSettings create(AssetServiceStubSettings stub)
159135
throws IOException {
160136
return new AssetServiceSettings.Builder(stub.toBuilder()).build();
@@ -313,29 +289,6 @@ public UnaryCallSettings.Builder<DeleteFeedRequest, Empty> deleteFeedSettings()
313289
return getStubSettingsBuilder().searchAllIamPoliciesSettings();
314290
}
315291

316-
/** Returns the builder for the settings used for calls to analyzeIamPolicy. */
317-
public UnaryCallSettings.Builder<AnalyzeIamPolicyRequest, AnalyzeIamPolicyResponse>
318-
analyzeIamPolicySettings() {
319-
return getStubSettingsBuilder().analyzeIamPolicySettings();
320-
}
321-
322-
/** Returns the builder for the settings used for calls to exportIamPolicyAnalysis. */
323-
public UnaryCallSettings.Builder<ExportIamPolicyAnalysisRequest, Operation>
324-
exportIamPolicyAnalysisSettings() {
325-
return getStubSettingsBuilder().exportIamPolicyAnalysisSettings();
326-
}
327-
328-
/** Returns the builder for the settings used for calls to exportIamPolicyAnalysis. */
329-
@BetaApi(
330-
"The surface for long-running operations is not stable yet and may change in the future.")
331-
public OperationCallSettings.Builder<
332-
ExportIamPolicyAnalysisRequest,
333-
ExportIamPolicyAnalysisResponse,
334-
ExportIamPolicyAnalysisRequest>
335-
exportIamPolicyAnalysisOperationSettings() {
336-
return getStubSettingsBuilder().exportIamPolicyAnalysisOperationSettings();
337-
}
338-
339292
@Override
340293
public AssetServiceSettings build() throws IOException {
341294
return new AssetServiceSettings(this);

google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStub.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,12 @@
2222
import com.google.api.gax.core.BackgroundResource;
2323
import com.google.api.gax.rpc.OperationCallable;
2424
import com.google.api.gax.rpc.UnaryCallable;
25-
import com.google.cloud.asset.v1.AnalyzeIamPolicyRequest;
26-
import com.google.cloud.asset.v1.AnalyzeIamPolicyResponse;
2725
import com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest;
2826
import com.google.cloud.asset.v1.BatchGetAssetsHistoryResponse;
2927
import com.google.cloud.asset.v1.CreateFeedRequest;
3028
import com.google.cloud.asset.v1.DeleteFeedRequest;
3129
import com.google.cloud.asset.v1.ExportAssetsRequest;
3230
import com.google.cloud.asset.v1.ExportAssetsResponse;
33-
import com.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest;
34-
import com.google.cloud.asset.v1.ExportIamPolicyAnalysisResponse;
3531
import com.google.cloud.asset.v1.Feed;
3632
import com.google.cloud.asset.v1.GetFeedRequest;
3733
import com.google.cloud.asset.v1.ListFeedsRequest;
@@ -116,26 +112,6 @@ public UnaryCallable<DeleteFeedRequest, Empty> deleteFeedCallable() {
116112
throw new UnsupportedOperationException("Not implemented: searchAllIamPoliciesCallable()");
117113
}
118114

119-
public UnaryCallable<AnalyzeIamPolicyRequest, AnalyzeIamPolicyResponse>
120-
analyzeIamPolicyCallable() {
121-
throw new UnsupportedOperationException("Not implemented: analyzeIamPolicyCallable()");
122-
}
123-
124-
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
125-
public OperationCallable<
126-
ExportIamPolicyAnalysisRequest,
127-
ExportIamPolicyAnalysisResponse,
128-
ExportIamPolicyAnalysisRequest>
129-
exportIamPolicyAnalysisOperationCallable() {
130-
throw new UnsupportedOperationException(
131-
"Not implemented: exportIamPolicyAnalysisOperationCallable()");
132-
}
133-
134-
public UnaryCallable<ExportIamPolicyAnalysisRequest, Operation>
135-
exportIamPolicyAnalysisCallable() {
136-
throw new UnsupportedOperationException("Not implemented: exportIamPolicyAnalysisCallable()");
137-
}
138-
139115
@Override
140116
public abstract void close();
141117
}

0 commit comments

Comments
 (0)