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

Commit

Permalink
chore: release gapic-generator-java v1.0.17 (#813)
Browse files Browse the repository at this point in the history
Committer: @miraleung
PiperOrigin-RevId: 388499329

Source-Link: googleapis/googleapis@bb0a090

Source-Link: googleapis/googleapis-gen@d196f38
  • Loading branch information
gcf-owl-bot[bot] committed Aug 9, 2021
1 parent ae4352b commit 209e565
Show file tree
Hide file tree
Showing 40 changed files with 12,628 additions and 431 deletions.
Expand Up @@ -925,8 +925,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 +986,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 +1021,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 +1055,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 +1318,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 +1339,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 +1352,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 +1364,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 +1375,7 @@ public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest r
public final OperationCallable<
AnalyzeIamPolicyLongrunningRequest,
AnalyzeIamPolicyLongrunningResponse,
AnalyzeIamPolicyLongrunningRequest>
AnalyzeIamPolicyLongrunningMetadata>
analyzeIamPolicyLongrunningOperationCallable() {
return stub.analyzeIamPolicyLongrunningOperationCallable();
}
Expand All @@ -1385,8 +1388,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 +1412,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 @@ -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 @@ -338,11 +343,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();
}
Expand Up @@ -46,10 +46,13 @@
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
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.Asset;
import com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest;
import com.google.cloud.asset.v1.BatchGetAssetsHistoryResponse;
Expand Down Expand Up @@ -147,8 +150,9 @@ public class AssetServiceStubSettings extends StubSettings<AssetServiceStubSetti
private final OperationCallSettings<
AnalyzeIamPolicyLongrunningRequest,
AnalyzeIamPolicyLongrunningResponse,
AnalyzeIamPolicyLongrunningRequest>
AnalyzeIamPolicyLongrunningMetadata>
analyzeIamPolicyLongrunningOperationSettings;
private final UnaryCallSettings<AnalyzeMoveRequest, AnalyzeMoveResponse> analyzeMoveSettings;

private static final PagedListDescriptor<ListAssetsRequest, ListAssetsResponse, Asset>
LIST_ASSETS_PAGE_STR_DESC =
Expand Down Expand Up @@ -413,11 +417,16 @@ public UnaryCallSettings<DeleteFeedRequest, Empty> deleteFeedSettings() {
public OperationCallSettings<
AnalyzeIamPolicyLongrunningRequest,
AnalyzeIamPolicyLongrunningResponse,
AnalyzeIamPolicyLongrunningRequest>
AnalyzeIamPolicyLongrunningMetadata>
analyzeIamPolicyLongrunningOperationSettings() {
return analyzeIamPolicyLongrunningOperationSettings;
}

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

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public AssetServiceStub createStub() throws IOException {
if (getTransportChannelProvider()
Expand Down Expand Up @@ -508,6 +517,7 @@ protected AssetServiceStubSettings(Builder settingsBuilder) throws IOException {
settingsBuilder.analyzeIamPolicyLongrunningSettings().build();
analyzeIamPolicyLongrunningOperationSettings =
settingsBuilder.analyzeIamPolicyLongrunningOperationSettings().build();
analyzeMoveSettings = settingsBuilder.analyzeMoveSettings().build();
}

/** Builder for AssetServiceStubSettings. */
Expand Down Expand Up @@ -543,8 +553,10 @@ public static class Builder extends StubSettings.Builder<AssetServiceStubSetting
private final OperationCallSettings.Builder<
AnalyzeIamPolicyLongrunningRequest,
AnalyzeIamPolicyLongrunningResponse,
AnalyzeIamPolicyLongrunningRequest>
AnalyzeIamPolicyLongrunningMetadata>
analyzeIamPolicyLongrunningOperationSettings;
private final UnaryCallSettings.Builder<AnalyzeMoveRequest, AnalyzeMoveResponse>
analyzeMoveSettings;
private static final ImmutableMap<String, ImmutableSet<StatusCode.Code>>
RETRYABLE_CODE_DEFINITIONS;

Expand All @@ -564,6 +576,7 @@ public static class Builder extends StubSettings.Builder<AssetServiceStubSetting
definitions.put(
"retry_policy_3_codes",
ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList(StatusCode.Code.UNAVAILABLE)));
definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
RETRYABLE_CODE_DEFINITIONS = definitions.build();
}

Expand Down Expand Up @@ -613,6 +626,8 @@ public static class Builder extends StubSettings.Builder<AssetServiceStubSetting
.setTotalTimeout(Duration.ofMillis(300000L))
.build();
definitions.put("retry_policy_3_params", settings);
settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
definitions.put("no_retry_params", settings);
RETRY_PARAM_DEFINITIONS = definitions.build();
}

Expand All @@ -638,6 +653,7 @@ protected Builder(ClientContext clientContext) {
analyzeIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
analyzeIamPolicyLongrunningSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
analyzeIamPolicyLongrunningOperationSettings = OperationCallSettings.newBuilder();
analyzeMoveSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();

unaryMethodSettingsBuilders =
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
Expand All @@ -652,7 +668,8 @@ protected Builder(ClientContext clientContext) {
searchAllResourcesSettings,
searchAllIamPoliciesSettings,
analyzeIamPolicySettings,
analyzeIamPolicyLongrunningSettings);
analyzeIamPolicyLongrunningSettings,
analyzeMoveSettings);
initDefaults(this);
}

Expand All @@ -675,6 +692,7 @@ protected Builder(AssetServiceStubSettings settings) {
settings.analyzeIamPolicyLongrunningSettings.toBuilder();
analyzeIamPolicyLongrunningOperationSettings =
settings.analyzeIamPolicyLongrunningOperationSettings.toBuilder();
analyzeMoveSettings = settings.analyzeMoveSettings.toBuilder();

unaryMethodSettingsBuilders =
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
Expand All @@ -689,7 +707,8 @@ protected Builder(AssetServiceStubSettings settings) {
searchAllResourcesSettings,
searchAllIamPoliciesSettings,
analyzeIamPolicySettings,
analyzeIamPolicyLongrunningSettings);
analyzeIamPolicyLongrunningSettings,
analyzeMoveSettings);
}

private static Builder createDefault() {
Expand Down Expand Up @@ -766,6 +785,11 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params"));

builder
.analyzeMoveSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));

builder
.exportAssetsOperationSettings()
.setInitialCallSettings(
Expand Down Expand Up @@ -804,7 +828,7 @@ private static Builder initDefaults(Builder builder) {
AnalyzeIamPolicyLongrunningResponse.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(
AnalyzeIamPolicyLongrunningRequest.class))
AnalyzeIamPolicyLongrunningMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
Expand Down Expand Up @@ -921,11 +945,17 @@ public UnaryCallSettings.Builder<DeleteFeedRequest, Empty> deleteFeedSettings()
public OperationCallSettings.Builder<
AnalyzeIamPolicyLongrunningRequest,
AnalyzeIamPolicyLongrunningResponse,
AnalyzeIamPolicyLongrunningRequest>
AnalyzeIamPolicyLongrunningMetadata>
analyzeIamPolicyLongrunningOperationSettings() {
return analyzeIamPolicyLongrunningOperationSettings;
}

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

@Override
public AssetServiceStubSettings build() throws IOException {
return new AssetServiceStubSettings(this);
Expand Down

0 comments on commit 209e565

Please sign in to comment.