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

feat!: release gapic-generator-java v2.0.0 #815

Merged
merged 3 commits into from Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -46,7 +46,7 @@ If you are using Maven without BOM, add this to your dependencies:

If you are using Gradle 5.x or later, add this to your dependencies
```Groovy
implementation platform('com.google.cloud:libraries-bom:20.8.0')
implementation platform('com.google.cloud:libraries-bom:20.9.0')

compile 'com.google.cloud:google-cloud-asset'
```
Expand Down
Expand Up @@ -16,7 +16,6 @@

package com.google.cloud.asset.v1;

import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
Expand Down Expand Up @@ -925,8 +924,8 @@ public final UnaryCallable<DeleteFeedRequest, Empty> deleteFeedCallable() {
* <li>`kmsKey:key` to find Cloud resources encrypted with a customer-managed encryption key
* whose name contains the word "key".
* <li>`state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a word.
* <li>`NOT state:ACTIVE` to find {{gcp_name}} resources whose state doesn't contain
* "ACTIVE" as a word.
* <li>`NOT state:ACTIVE` to find Cloud resources whose state doesn't contain "ACTIVE" as a
* word.
* <li>`createTime&lt;1609459200` to find Cloud resources that were created before
* "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of "2021-01-01 00:00:00
* UTC" in seconds.
Expand Down Expand Up @@ -986,6 +985,7 @@ public final SearchAllResourcesPagedResponse searchAllResources(
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setOrderBy("orderBy-1207110587")
* .setReadMask(FieldMask.newBuilder().build())
* .build();
* for (ResourceSearchResult element :
* assetServiceClient.searchAllResources(request).iterateAll()) {
Expand Down Expand Up @@ -1020,6 +1020,7 @@ public final SearchAllResourcesPagedResponse searchAllResources(
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setOrderBy("orderBy-1207110587")
* .setReadMask(FieldMask.newBuilder().build())
* .build();
* ApiFuture<ResourceSearchResult> future =
* assetServiceClient.searchAllResourcesPagedCallable().futureCall(request);
Expand Down Expand Up @@ -1053,6 +1054,7 @@ public final SearchAllResourcesPagedResponse searchAllResources(
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setOrderBy("orderBy-1207110587")
* .setReadMask(FieldMask.newBuilder().build())
* .build();
* while (true) {
* SearchAllResourcesResponse response =
Expand Down Expand Up @@ -1315,8 +1317,8 @@ public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest r
* [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.
* backoff retry to poll the operation result. The metadata contains the metadata for the
* long-running operation.
*
* <p>Sample code:
*
Expand All @@ -1336,7 +1338,7 @@ public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest r
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<
AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningRequest>
AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningMetadata>
analyzeIamPolicyLongrunningAsync(AnalyzeIamPolicyLongrunningRequest request) {
return analyzeIamPolicyLongrunningOperationCallable().futureCall(request);
}
Expand All @@ -1349,8 +1351,8 @@ public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest r
* [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.
* backoff retry to poll the operation result. The metadata contains the metadata for the
* long-running operation.
*
* <p>Sample code:
*
Expand All @@ -1361,7 +1363,7 @@ public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest r
* .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build())
* .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build())
* .build();
* OperationFuture<AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningRequest>
* OperationFuture<AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningMetadata>
* future =
* assetServiceClient.analyzeIamPolicyLongrunningOperationCallable().futureCall(request);
* // Do something.
Expand All @@ -1372,7 +1374,7 @@ public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest r
public final OperationCallable<
AnalyzeIamPolicyLongrunningRequest,
AnalyzeIamPolicyLongrunningResponse,
AnalyzeIamPolicyLongrunningRequest>
AnalyzeIamPolicyLongrunningMetadata>
analyzeIamPolicyLongrunningOperationCallable() {
return stub.analyzeIamPolicyLongrunningOperationCallable();
}
Expand All @@ -1385,8 +1387,8 @@ public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest r
* [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.
* backoff retry to poll the operation result. The metadata contains the metadata for the
* long-running operation.
*
* <p>Sample code:
*
Expand All @@ -1409,6 +1411,60 @@ public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest r
return stub.analyzeIamPolicyLongrunningCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Analyze moving a resource to a specified destination without kicking off the actual move. The
* analysis is best effort depending on the user's permissions of viewing different hierarchical
* policies and configurations. The policies and configuration are subject to change before the
* actual resource migration takes place.
*
* <p>Sample code:
*
* <pre>{@code
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* AnalyzeMoveRequest request =
* AnalyzeMoveRequest.newBuilder()
* .setResource("resource-341064690")
* .setDestinationParent("destinationParent-1733659048")
* .build();
* AnalyzeMoveResponse response = assetServiceClient.analyzeMove(request);
* }
* }</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 AnalyzeMoveResponse analyzeMove(AnalyzeMoveRequest request) {
return analyzeMoveCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Analyze moving a resource to a specified destination without kicking off the actual move. The
* analysis is best effort depending on the user's permissions of viewing different hierarchical
* policies and configurations. The policies and configuration are subject to change before the
* actual resource migration takes place.
*
* <p>Sample code:
*
* <pre>{@code
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* AnalyzeMoveRequest request =
* AnalyzeMoveRequest.newBuilder()
* .setResource("resource-341064690")
* .setDestinationParent("destinationParent-1733659048")
* .build();
* ApiFuture<AnalyzeMoveResponse> future =
* assetServiceClient.analyzeMoveCallable().futureCall(request);
* // Do something.
* AnalyzeMoveResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<AnalyzeMoveRequest, AnalyzeMoveResponse> analyzeMoveCallable() {
return stub.analyzeMoveCallable();
}

@Override
public final void close() {
stub.close();
Expand Down Expand Up @@ -1453,14 +1509,7 @@ public static ApiFuture<ListAssetsPagedResponse> createAsync(
ApiFuture<ListAssetsPage> futurePage =
ListAssetsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListAssetsPage, ListAssetsPagedResponse>() {
@Override
public ListAssetsPagedResponse apply(ListAssetsPage input) {
return new ListAssetsPagedResponse(input);
}
},
MoreExecutors.directExecutor());
futurePage, input -> new ListAssetsPagedResponse(input), MoreExecutors.directExecutor());
}

private ListAssetsPagedResponse(ListAssetsPage page) {
Expand Down Expand Up @@ -1535,12 +1584,7 @@ public static ApiFuture<SearchAllResourcesPagedResponse> createAsync(
SearchAllResourcesPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<SearchAllResourcesPage, SearchAllResourcesPagedResponse>() {
@Override
public SearchAllResourcesPagedResponse apply(SearchAllResourcesPage input) {
return new SearchAllResourcesPagedResponse(input);
}
},
input -> new SearchAllResourcesPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down Expand Up @@ -1625,12 +1669,7 @@ public static ApiFuture<SearchAllIamPoliciesPagedResponse> createAsync(
SearchAllIamPoliciesPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<SearchAllIamPoliciesPage, SearchAllIamPoliciesPagedResponse>() {
@Override
public SearchAllIamPoliciesPagedResponse apply(SearchAllIamPoliciesPage input) {
return new SearchAllIamPoliciesPagedResponse(input);
}
},
input -> new SearchAllIamPoliciesPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down
Expand Up @@ -153,12 +153,17 @@ public UnaryCallSettings<DeleteFeedRequest, Empty> deleteFeedSettings() {
public OperationCallSettings<
AnalyzeIamPolicyLongrunningRequest,
AnalyzeIamPolicyLongrunningResponse,
AnalyzeIamPolicyLongrunningRequest>
AnalyzeIamPolicyLongrunningMetadata>
analyzeIamPolicyLongrunningOperationSettings() {
return ((AssetServiceStubSettings) getStubSettings())
.analyzeIamPolicyLongrunningOperationSettings();
}

/** Returns the object with the settings used for calls to analyzeMove. */
public UnaryCallSettings<AnalyzeMoveRequest, AnalyzeMoveResponse> analyzeMoveSettings() {
return ((AssetServiceStubSettings) getStubSettings()).analyzeMoveSettings();
}

public static final AssetServiceSettings create(AssetServiceStubSettings stub)
throws IOException {
return new AssetServiceSettings.Builder(stub.toBuilder()).build();
Expand Down Expand Up @@ -244,14 +249,13 @@ public AssetServiceStubSettings.Builder getStubSettingsBuilder() {
return ((AssetServiceStubSettings.Builder) getStubSettings());
}

// NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
return this;
Expand Down Expand Up @@ -338,11 +342,17 @@ public UnaryCallSettings.Builder<DeleteFeedRequest, Empty> deleteFeedSettings()
public OperationCallSettings.Builder<
AnalyzeIamPolicyLongrunningRequest,
AnalyzeIamPolicyLongrunningResponse,
AnalyzeIamPolicyLongrunningRequest>
AnalyzeIamPolicyLongrunningMetadata>
analyzeIamPolicyLongrunningOperationSettings() {
return getStubSettingsBuilder().analyzeIamPolicyLongrunningOperationSettings();
}

/** Returns the builder for the settings used for calls to analyzeMove. */
public UnaryCallSettings.Builder<AnalyzeMoveRequest, AnalyzeMoveResponse>
analyzeMoveSettings() {
return getStubSettingsBuilder().analyzeMoveSettings();
}

@Override
public AssetServiceSettings build() throws IOException {
return new AssetServiceSettings(this);
Expand Down
Expand Up @@ -16,6 +16,9 @@
"AnalyzeIamPolicyLongrunning": {
"methods": ["analyzeIamPolicyLongrunningAsync", "analyzeIamPolicyLongrunningOperationCallable", "analyzeIamPolicyLongrunningCallable"]
},
"AnalyzeMove": {
"methods": ["analyzeMove", "analyzeMoveCallable"]
},
"BatchGetAssetsHistory": {
"methods": ["batchGetAssetsHistory", "batchGetAssetsHistoryCallable"]
},
Expand Down
Expand Up @@ -23,10 +23,13 @@
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.AnalyzeIamPolicyLongrunningMetadata;
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.AnalyzeMoveRequest;
import com.google.cloud.asset.v1.AnalyzeMoveResponse;
import com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest;
import com.google.cloud.asset.v1.BatchGetAssetsHistoryResponse;
import com.google.cloud.asset.v1.CreateFeedRequest;
Expand Down Expand Up @@ -132,7 +135,7 @@ public UnaryCallable<DeleteFeedRequest, Empty> deleteFeedCallable() {
public OperationCallable<
AnalyzeIamPolicyLongrunningRequest,
AnalyzeIamPolicyLongrunningResponse,
AnalyzeIamPolicyLongrunningRequest>
AnalyzeIamPolicyLongrunningMetadata>
analyzeIamPolicyLongrunningOperationCallable() {
throw new UnsupportedOperationException(
"Not implemented: analyzeIamPolicyLongrunningOperationCallable()");
Expand All @@ -144,6 +147,10 @@ public UnaryCallable<DeleteFeedRequest, Empty> deleteFeedCallable() {
"Not implemented: analyzeIamPolicyLongrunningCallable()");
}

public UnaryCallable<AnalyzeMoveRequest, AnalyzeMoveResponse> analyzeMoveCallable() {
throw new UnsupportedOperationException("Not implemented: analyzeMoveCallable()");
}

@Override
public abstract void close();
}