diff --git a/CHANGELOG.md b/CHANGELOG.md index 5679cf07f3..47548ec096 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.1.0](https://www.github.com/googleapis/gapic-generator-java/compare/v2.0.1...v2.1.0) (2021-08-17) + + +### Features + +* enable self signed jwt for gapic clients ([#794](https://www.github.com/googleapis/gapic-generator-java/issues/794)) ([1b7ee1e](https://www.github.com/googleapis/gapic-generator-java/commit/1b7ee1e3911e1c8ecab9a94d68d7a59b437d2449)) + ### [2.0.1](https://www.github.com/googleapis/gapic-generator-java/compare/v2.0.0...v2.0.1) (2021-08-06) diff --git a/WORKSPACE b/WORKSPACE index 1b8335256f..21e5f8ea67 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -32,7 +32,7 @@ jvm_maven_import_external( # gapic-generator-java dependencies to match the order in googleapis repository, # which in its turn, prioritizes actual generated clients runtime dependencies # over the generator dependencies. -_gax_java_version = "2.2.0" +_gax_java_version = "2.3.0" http_archive( name = "com_google_api_gax_java", diff --git a/repositories.bzl b/repositories.bzl index 67493dba45..f2074f578d 100644 --- a/repositories.bzl +++ b/repositories.bzl @@ -59,18 +59,20 @@ def gapic_generator_java_repositories(): _maybe( http_archive, name = "com_google_googleapis", - strip_prefix = "googleapis-efecdbf96311bb705d619459280ffc651b10844a", + strip_prefix = "googleapis-ba30d8097582039ac4cc4e21b4e4baa426423075", urls = [ - "https://github.com/googleapis/googleapis/archive/efecdbf96311bb705d619459280ffc651b10844a.zip", + "https://github.com/googleapis/googleapis/archive/ba30d8097582039ac4cc4e21b4e4baa426423075.zip", ], ) + # TODO: replace with upstream googleapis-discovery link once + # https://github.com/googleapis/googleapis-discovery/pull/59 is merged _maybe( http_archive, name = "com_google_googleapis_discovery", - strip_prefix = "googleapis-discovery-abf4cec1ce9e02e4d7d650bf66137c347cdd0d44", + strip_prefix = "googleapis-discovery-2872d382ff767518e63d59ececf5d6f9224b21b4", urls = [ - "https://github.com/googleapis/googleapis-discovery/archive/abf4cec1ce9e02e4d7d650bf66137c347cdd0d44.zip", + "https://github.com/vam-google/googleapis-discovery/archive/2872d382ff767518e63d59ececf5d6f9224b21b4.zip", ], ) diff --git a/src/main/java/com/google/api/generator/BUILD.bazel b/src/main/java/com/google/api/generator/BUILD.bazel index de7f95f193..4e678b5b7d 100644 --- a/src/main/java/com/google/api/generator/BUILD.bazel +++ b/src/main/java/com/google/api/generator/BUILD.bazel @@ -39,6 +39,7 @@ java_library( "//src/main/java/com/google/api/generator/gapic/model", "//src/main/java/com/google/api/generator/util", "@com_google_googleapis//google/api:api_java_proto", + "@com_google_googleapis//google/cloud:extended_operations_java_proto", "@com_google_googleapis//google/longrunning:longrunning_java_proto", "@com_google_guava_guava//jar", "@com_google_protobuf//:protobuf_java", diff --git a/src/main/java/com/google/api/generator/ProtoRegistry.java b/src/main/java/com/google/api/generator/ProtoRegistry.java index da4806bba0..d4cce56dcf 100644 --- a/src/main/java/com/google/api/generator/ProtoRegistry.java +++ b/src/main/java/com/google/api/generator/ProtoRegistry.java @@ -18,6 +18,7 @@ import com.google.api.ClientProto; import com.google.api.FieldBehaviorProto; import com.google.api.ResourceProto; +import com.google.cloud.ExtendedOperationsProto; import com.google.longrunning.OperationsProto; import com.google.protobuf.ExtensionRegistry; @@ -29,5 +30,6 @@ public static void registerAllExtensions(ExtensionRegistry extensionRegistry) { ClientProto.registerAllExtensions(extensionRegistry); ResourceProto.registerAllExtensions(extensionRegistry); FieldBehaviorProto.registerAllExtensions(extensionRegistry); + ExtendedOperationsProto.registerAllExtensions(extensionRegistry); } } diff --git a/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java b/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java index 1d89768a58..c999fccb9d 100644 --- a/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java +++ b/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java @@ -139,8 +139,6 @@ public abstract class AbstractServiceStubSettingsClassComposer implements ClassC protected static final TypeStore FIXED_TYPESTORE = createStaticTypes(); - private static final VariableExpr DEFAULT_SERVICE_SCOPES_VAR_EXPR = - createDefaultServiceScopesVarExpr(); private static final VariableExpr NESTED_UNARY_METHOD_SETTINGS_BUILDERS_VAR_EXPR = createNestedUnaryMethodSettingsBuildersVarExpr(); private static final VariableExpr NESTED_RETRYABLE_CODE_DEFINITIONS_VAR_EXPR = @@ -150,6 +148,9 @@ public abstract class AbstractServiceStubSettingsClassComposer implements ClassC private final TransportContext transportContext; + protected static final VariableExpr DEFAULT_SERVICE_SCOPES_VAR_EXPR = + createDefaultServiceScopesVarExpr(); + protected AbstractServiceStubSettingsClassComposer(TransportContext transportContext) { this.transportContext = transportContext; } @@ -197,6 +198,33 @@ public GapicClass generate(GapicContext context, Service service) { return GapicClass.create(GapicClass.Kind.STUB, classDef); } + protected MethodDefinition createDefaultCredentialsProviderBuilderMethod() { + TypeNode returnType = + TypeNode.withReference( + ConcreteReference.withClazz(GoogleCredentialsProvider.Builder.class)); + MethodInvocationExpr credsProviderBuilderExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType(FIXED_TYPESTORE.get("GoogleCredentialsProvider")) + .setMethodName("newBuilder") + .build(); + credsProviderBuilderExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(credsProviderBuilderExpr) + .setMethodName("setScopesToApply") + .setArguments(DEFAULT_SERVICE_SCOPES_VAR_EXPR) + .setReturnType(returnType) + .build(); + return MethodDefinition.builder() + .setHeaderCommentStatements( + SettingsCommentComposer.DEFAULT_CREDENTIALS_PROVIDER_BUILDER_METHOD_COMMENT) + .setScope(ScopeNode.PUBLIC) + .setIsStatic(true) + .setReturnType(returnType) + .setName("defaultCredentialsProviderBuilder") + .setReturnExpr(credsProviderBuilderExpr) + .build(); + } + protected abstract MethodDefinition createDefaultTransportTransportProviderBuilderMethod(); protected abstract MethodDefinition createDefaultApiClientHeaderProviderBuilderMethod( @@ -992,33 +1020,7 @@ private List createDefaultHelperAndGetterMethods( .setReturnExpr(DEFAULT_SERVICE_SCOPES_VAR_EXPR) .build()); - // Create the defaultCredentialsProviderBuilder method. - returnType = - TypeNode.withReference( - ConcreteReference.withClazz(GoogleCredentialsProvider.Builder.class)); - MethodInvocationExpr credsProviderBuilderExpr = - MethodInvocationExpr.builder() - .setStaticReferenceType(FIXED_TYPESTORE.get("GoogleCredentialsProvider")) - .setMethodName("newBuilder") - .build(); - credsProviderBuilderExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(credsProviderBuilderExpr) - .setMethodName("setScopesToApply") - .setArguments(DEFAULT_SERVICE_SCOPES_VAR_EXPR) - .setReturnType(returnType) - .build(); - javaMethods.add( - MethodDefinition.builder() - .setHeaderCommentStatements( - SettingsCommentComposer.DEFAULT_CREDENTIALS_PROVIDER_BUILDER_METHOD_COMMENT) - .setScope(ScopeNode.PUBLIC) - .setIsStatic(true) - .setReturnType(returnType) - .setName("defaultCredentialsProviderBuilder") - .setReturnExpr(credsProviderBuilderExpr) - .build()); - + javaMethods.add(createDefaultCredentialsProviderBuilderMethod()); javaMethods.add(createDefaultTransportTransportProviderBuilderMethod()); javaMethods.add(createDefaultTransportChannelProviderMethod()); javaMethods.add(createDefaultApiClientHeaderProviderBuilderMethod(service, typeStore)); diff --git a/src/main/java/com/google/api/generator/gapic/composer/grpc/ServiceStubSettingsClassComposer.java b/src/main/java/com/google/api/generator/gapic/composer/grpc/ServiceStubSettingsClassComposer.java index ceba11ee62..6d0b8e221d 100644 --- a/src/main/java/com/google/api/generator/gapic/composer/grpc/ServiceStubSettingsClassComposer.java +++ b/src/main/java/com/google/api/generator/gapic/composer/grpc/ServiceStubSettingsClassComposer.java @@ -14,6 +14,7 @@ package com.google.api.generator.gapic.composer.grpc; +import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.grpc.GaxGrpcProperties; import com.google.api.gax.grpc.GrpcTransportChannel; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; @@ -22,6 +23,7 @@ import com.google.api.generator.engine.ast.ConcreteReference; import com.google.api.generator.engine.ast.MethodDefinition; import com.google.api.generator.engine.ast.MethodInvocationExpr; +import com.google.api.generator.engine.ast.PrimitiveValue; import com.google.api.generator.engine.ast.ScopeNode; import com.google.api.generator.engine.ast.StringObjectValue; import com.google.api.generator.engine.ast.TypeNode; @@ -94,6 +96,47 @@ protected MethodDefinition createDefaultTransportTransportProviderBuilderMethod( .build(); } + @Override + protected MethodDefinition createDefaultCredentialsProviderBuilderMethod() { + TypeNode returnType = + TypeNode.withReference( + ConcreteReference.withClazz(GoogleCredentialsProvider.Builder.class)); + MethodInvocationExpr credsProviderBuilderExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType(FIXED_TYPESTORE.get("GoogleCredentialsProvider")) + .setMethodName("newBuilder") + .build(); + credsProviderBuilderExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(credsProviderBuilderExpr) + .setMethodName("setScopesToApply") + .setArguments(DEFAULT_SERVICE_SCOPES_VAR_EXPR) + .setReturnType(returnType) + .build(); + + // This section is specific to GAPIC clients. It sets UseJwtAccessWithScope value to true to + // enable self signed JWT feature. + credsProviderBuilderExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(credsProviderBuilderExpr) + .setMethodName("setUseJwtAccessWithScope") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.BOOLEAN).setValue("true").build())) + .setReturnType(returnType) + .build(); + + return MethodDefinition.builder() + .setHeaderCommentStatements( + SettingsCommentComposer.DEFAULT_CREDENTIALS_PROVIDER_BUILDER_METHOD_COMMENT) + .setScope(ScopeNode.PUBLIC) + .setIsStatic(true) + .setReturnType(returnType) + .setName("defaultCredentialsProviderBuilder") + .setReturnExpr(credsProviderBuilderExpr) + .build(); + } + @Override protected MethodDefinition createDefaultApiClientHeaderProviderBuilderMethod( Service service, TypeStore typeStore) { diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceStubSettings.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceStubSettings.golden index ddfdcde395..899b03bbce 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceStubSettings.golden +++ b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceStubSettings.golden @@ -120,7 +120,9 @@ public class DeprecatedServiceStubSettings extends StubSettings { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden index 1de81fd223..cc308eb5de 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden +++ b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden @@ -440,7 +440,9 @@ public class LoggingServiceV2StubSettings extends StubSettings { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/AssetServiceClient.java b/test/integration/goldens/asset/com/google/cloud/asset/v1/AssetServiceClient.java index 1860b0cca4..af1cc6dd1f 100644 --- a/test/integration/goldens/asset/com/google/cloud/asset/v1/AssetServiceClient.java +++ b/test/integration/goldens/asset/com/google/cloud/asset/v1/AssetServiceClient.java @@ -54,6 +54,7 @@ * .addAllAssetNames(new ArrayList()) * .setContentType(ContentType.forNumber(0)) * .setReadTimeWindow(TimeWindow.newBuilder().build()) + * .addAllRelationshipTypes(new ArrayList()) * .build(); * BatchGetAssetsHistoryResponse response = assetServiceClient.batchGetAssetsHistory(request); * } @@ -190,6 +191,7 @@ public final OperationsClient getOperationsClient() { * .addAllAssetTypes(new ArrayList()) * .setContentType(ContentType.forNumber(0)) * .setOutputConfig(OutputConfig.newBuilder().build()) + * .addAllRelationshipTypes(new ArrayList()) * .build(); * ExportAssetsResponse response = assetServiceClient.exportAssetsAsync(request).get(); * } @@ -225,6 +227,7 @@ public final OperationFuture exportAs * .addAllAssetTypes(new ArrayList()) * .setContentType(ContentType.forNumber(0)) * .setOutputConfig(OutputConfig.newBuilder().build()) + * .addAllRelationshipTypes(new ArrayList()) * .build(); * OperationFuture future = * assetServiceClient.exportAssetsOperationCallable().futureCall(request); @@ -260,6 +263,7 @@ public final OperationFuture exportAs * .addAllAssetTypes(new ArrayList()) * .setContentType(ContentType.forNumber(0)) * .setOutputConfig(OutputConfig.newBuilder().build()) + * .addAllRelationshipTypes(new ArrayList()) * .build(); * ApiFuture future = assetServiceClient.exportAssetsCallable().futureCall(request); * // Do something. @@ -340,6 +344,7 @@ public final ListAssetsPagedResponse listAssets(String parent) { * .setContentType(ContentType.forNumber(0)) * .setPageSize(883849137) * .setPageToken("pageToken873572522") + * .addAllRelationshipTypes(new ArrayList()) * .build(); * for (Asset element : assetServiceClient.listAssets(request).iterateAll()) { * // doThingsWith(element); @@ -370,6 +375,7 @@ public final ListAssetsPagedResponse listAssets(ListAssetsRequest request) { * .setContentType(ContentType.forNumber(0)) * .setPageSize(883849137) * .setPageToken("pageToken873572522") + * .addAllRelationshipTypes(new ArrayList()) * .build(); * ApiFuture future = assetServiceClient.listAssetsPagedCallable().futureCall(request); * // Do something. @@ -399,6 +405,7 @@ public final UnaryCallable listAsset * .setContentType(ContentType.forNumber(0)) * .setPageSize(883849137) * .setPageToken("pageToken873572522") + * .addAllRelationshipTypes(new ArrayList()) * .build(); * while (true) { * ListAssetsResponse response = assetServiceClient.listAssetsCallable().call(request); @@ -437,6 +444,7 @@ public final UnaryCallable listAssetsCall * .addAllAssetNames(new ArrayList()) * .setContentType(ContentType.forNumber(0)) * .setReadTimeWindow(TimeWindow.newBuilder().build()) + * .addAllRelationshipTypes(new ArrayList()) * .build(); * BatchGetAssetsHistoryResponse response = assetServiceClient.batchGetAssetsHistory(request); * } @@ -468,6 +476,7 @@ public final BatchGetAssetsHistoryResponse batchGetAssetsHistory( * .addAllAssetNames(new ArrayList()) * .setContentType(ContentType.forNumber(0)) * .setReadTimeWindow(TimeWindow.newBuilder().build()) + * .addAllRelationshipTypes(new ArrayList()) * .build(); * ApiFuture future = * assetServiceClient.batchGetAssetsHistoryCallable().futureCall(request); @@ -924,8 +933,8 @@ public final UnaryCallable deleteFeedCallable() { *
  • `kmsKey:key` to find Cloud resources encrypted with a customer-managed encryption key * whose name contains the word "key". *
  • `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a word. - *
  • `NOT state:ACTIVE` to find {{gcp_name}} resources whose state doesn't contain - * "ACTIVE" as a word. + *
  • `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain "ACTIVE" as a + * word. *
  • `createTime<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. @@ -985,6 +994,7 @@ public final SearchAllResourcesPagedResponse searchAllResources( * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setOrderBy("orderBy-1207110587") + * .setReadMask(FieldMask.newBuilder().build()) * .build(); * for (ResourceSearchResult element : * assetServiceClient.searchAllResources(request).iterateAll()) { @@ -1019,6 +1029,7 @@ public final SearchAllResourcesPagedResponse searchAllResources( * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setOrderBy("orderBy-1207110587") + * .setReadMask(FieldMask.newBuilder().build()) * .build(); * ApiFuture future = * assetServiceClient.searchAllResourcesPagedCallable().futureCall(request); @@ -1052,6 +1063,7 @@ public final SearchAllResourcesPagedResponse searchAllResources( * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setOrderBy("orderBy-1207110587") + * .setReadMask(FieldMask.newBuilder().build()) * .build(); * while (true) { * SearchAllResourcesResponse response = @@ -1314,8 +1326,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. * *

    Sample code: * @@ -1335,7 +1347,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); } @@ -1348,8 +1360,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. * *

    Sample code: * @@ -1360,7 +1372,7 @@ public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest r * .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) * .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()) * .build(); - * OperationFuture + * OperationFuture * future = * assetServiceClient.analyzeIamPolicyLongrunningOperationCallable().futureCall(request); * // Do something. @@ -1371,7 +1383,7 @@ public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest r public final OperationCallable< AnalyzeIamPolicyLongrunningRequest, AnalyzeIamPolicyLongrunningResponse, - AnalyzeIamPolicyLongrunningRequest> + AnalyzeIamPolicyLongrunningMetadata> analyzeIamPolicyLongrunningOperationCallable() { return stub.analyzeIamPolicyLongrunningOperationCallable(); } @@ -1384,8 +1396,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. * *

    Sample code: * @@ -1408,6 +1420,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. + * + *

    Sample code: + * + *

    {@code
    +   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
    +   *   AnalyzeMoveRequest request =
    +   *       AnalyzeMoveRequest.newBuilder()
    +   *           .setResource("resource-341064690")
    +   *           .setDestinationParent("destinationParent-1733659048")
    +   *           .build();
    +   *   AnalyzeMoveResponse response = assetServiceClient.analyzeMove(request);
    +   * }
    +   * }
    + * + * @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. + * + *

    Sample code: + * + *

    {@code
    +   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
    +   *   AnalyzeMoveRequest request =
    +   *       AnalyzeMoveRequest.newBuilder()
    +   *           .setResource("resource-341064690")
    +   *           .setDestinationParent("destinationParent-1733659048")
    +   *           .build();
    +   *   ApiFuture future =
    +   *       assetServiceClient.analyzeMoveCallable().futureCall(request);
    +   *   // Do something.
    +   *   AnalyzeMoveResponse response = future.get();
    +   * }
    +   * }
    + */ + public final UnaryCallable analyzeMoveCallable() { + return stub.analyzeMoveCallable(); + } + @Override public final void close() { stub.close(); diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/AssetServiceClientTest.java b/test/integration/goldens/asset/com/google/cloud/asset/v1/AssetServiceClientTest.java index de8ca67414..41f50cea3a 100644 --- a/test/integration/goldens/asset/com/google/cloud/asset/v1/AssetServiceClientTest.java +++ b/test/integration/goldens/asset/com/google/cloud/asset/v1/AssetServiceClientTest.java @@ -113,6 +113,7 @@ public void exportAssetsTest() throws Exception { .addAllAssetTypes(new ArrayList()) .setContentType(ContentType.forNumber(0)) .setOutputConfig(OutputConfig.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) .build(); ExportAssetsResponse actualResponse = client.exportAssetsAsync(request).get(); @@ -127,6 +128,8 @@ public void exportAssetsTest() throws Exception { Assert.assertEquals(request.getAssetTypesList(), actualRequest.getAssetTypesList()); Assert.assertEquals(request.getContentType(), actualRequest.getContentType()); Assert.assertEquals(request.getOutputConfig(), actualRequest.getOutputConfig()); + Assert.assertEquals( + request.getRelationshipTypesList(), actualRequest.getRelationshipTypesList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -146,6 +149,7 @@ public void exportAssetsExceptionTest() throws Exception { .addAllAssetTypes(new ArrayList()) .setContentType(ContentType.forNumber(0)) .setOutputConfig(OutputConfig.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) .build(); client.exportAssetsAsync(request).get(); Assert.fail("No exception raised"); @@ -258,6 +262,7 @@ public void batchGetAssetsHistoryTest() throws Exception { .addAllAssetNames(new ArrayList()) .setContentType(ContentType.forNumber(0)) .setReadTimeWindow(TimeWindow.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) .build(); BatchGetAssetsHistoryResponse actualResponse = client.batchGetAssetsHistory(request); @@ -272,6 +277,8 @@ public void batchGetAssetsHistoryTest() throws Exception { Assert.assertEquals(request.getAssetNamesList(), actualRequest.getAssetNamesList()); Assert.assertEquals(request.getContentType(), actualRequest.getContentType()); Assert.assertEquals(request.getReadTimeWindow(), actualRequest.getReadTimeWindow()); + Assert.assertEquals( + request.getRelationshipTypesList(), actualRequest.getRelationshipTypesList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -290,6 +297,7 @@ public void batchGetAssetsHistoryExceptionTest() throws Exception { .addAllAssetNames(new ArrayList()) .setContentType(ContentType.forNumber(0)) .setReadTimeWindow(TimeWindow.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) .build(); client.batchGetAssetsHistory(request); Assert.fail("No exception raised"); @@ -308,6 +316,7 @@ public void createFeedTest() throws Exception { .setContentType(ContentType.forNumber(0)) .setFeedOutputConfig(FeedOutputConfig.newBuilder().build()) .setCondition(Expr.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) .build(); mockAssetService.addResponse(expectedResponse); @@ -351,6 +360,7 @@ public void getFeedTest() throws Exception { .setContentType(ContentType.forNumber(0)) .setFeedOutputConfig(FeedOutputConfig.newBuilder().build()) .setCondition(Expr.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) .build(); mockAssetService.addResponse(expectedResponse); @@ -394,6 +404,7 @@ public void getFeedTest2() throws Exception { .setContentType(ContentType.forNumber(0)) .setFeedOutputConfig(FeedOutputConfig.newBuilder().build()) .setCondition(Expr.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) .build(); mockAssetService.addResponse(expectedResponse); @@ -473,6 +484,7 @@ public void updateFeedTest() throws Exception { .setContentType(ContentType.forNumber(0)) .setFeedOutputConfig(FeedOutputConfig.newBuilder().build()) .setCondition(Expr.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) .build(); mockAssetService.addResponse(expectedResponse); @@ -777,4 +789,50 @@ public void analyzeIamPolicyLongrunningExceptionTest() throws Exception { Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } + + @Test + public void analyzeMoveTest() throws Exception { + AnalyzeMoveResponse expectedResponse = + AnalyzeMoveResponse.newBuilder().addAllMoveAnalysis(new ArrayList()).build(); + mockAssetService.addResponse(expectedResponse); + + AnalyzeMoveRequest request = + AnalyzeMoveRequest.newBuilder() + .setResource("resource-341064690") + .setDestinationParent("destinationParent-1733659048") + .build(); + + AnalyzeMoveResponse actualResponse = client.analyzeMove(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AnalyzeMoveRequest actualRequest = ((AnalyzeMoveRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getDestinationParent(), actualRequest.getDestinationParent()); + Assert.assertEquals(request.getView(), actualRequest.getView()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void analyzeMoveExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + AnalyzeMoveRequest request = + AnalyzeMoveRequest.newBuilder() + .setResource("resource-341064690") + .setDestinationParent("destinationParent-1733659048") + .build(); + client.analyzeMove(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/AssetServiceSettings.java b/test/integration/goldens/asset/com/google/cloud/asset/v1/AssetServiceSettings.java index df338c00a9..8bca7d5631 100644 --- a/test/integration/goldens/asset/com/google/cloud/asset/v1/AssetServiceSettings.java +++ b/test/integration/goldens/asset/com/google/cloud/asset/v1/AssetServiceSettings.java @@ -154,12 +154,17 @@ public UnaryCallSettings 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 analyzeMoveSettings() { + return ((AssetServiceStubSettings) getStubSettings()).analyzeMoveSettings(); + } + public static final AssetServiceSettings create(AssetServiceStubSettings stub) throws IOException { return new AssetServiceSettings.Builder(stub.toBuilder()).build(); @@ -338,11 +343,17 @@ public UnaryCallSettings.Builder 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 + analyzeMoveSettings() { + return getStubSettingsBuilder().analyzeMoveSettings(); + } + @Override public AssetServiceSettings build() throws IOException { return new AssetServiceSettings(this); diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/MockAssetServiceImpl.java b/test/integration/goldens/asset/com/google/cloud/asset/v1/MockAssetServiceImpl.java index 643691d8d4..f72ed1eaa6 100644 --- a/test/integration/goldens/asset/com/google/cloud/asset/v1/MockAssetServiceImpl.java +++ b/test/integration/goldens/asset/com/google/cloud/asset/v1/MockAssetServiceImpl.java @@ -310,4 +310,25 @@ public void analyzeIamPolicyLongrunning( Exception.class.getName()))); } } + + @Override + public void analyzeMove( + AnalyzeMoveRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AnalyzeMoveResponse) { + requests.add(request); + responseObserver.onNext(((AnalyzeMoveResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method AnalyzeMove, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AnalyzeMoveResponse.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/gapic_metadata.json b/test/integration/goldens/asset/com/google/cloud/asset/v1/gapic_metadata.json index ea1187e7ac..05ba5ae5ea 100644 --- a/test/integration/goldens/asset/com/google/cloud/asset/v1/gapic_metadata.json +++ b/test/integration/goldens/asset/com/google/cloud/asset/v1/gapic_metadata.json @@ -16,6 +16,9 @@ "AnalyzeIamPolicyLongrunning": { "methods": ["analyzeIamPolicyLongrunningAsync", "analyzeIamPolicyLongrunningOperationCallable", "analyzeIamPolicyLongrunningCallable"] }, + "AnalyzeMove": { + "methods": ["analyzeMove", "analyzeMoveCallable"] + }, "BatchGetAssetsHistory": { "methods": ["batchGetAssetsHistory", "batchGetAssetsHistoryCallable"] }, diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/package-info.java b/test/integration/goldens/asset/com/google/cloud/asset/v1/package-info.java index 27db247ed3..d07bbc1fb7 100644 --- a/test/integration/goldens/asset/com/google/cloud/asset/v1/package-info.java +++ b/test/integration/goldens/asset/com/google/cloud/asset/v1/package-info.java @@ -31,6 +31,7 @@ * .addAllAssetNames(new ArrayList()) * .setContentType(ContentType.forNumber(0)) * .setReadTimeWindow(TimeWindow.newBuilder().build()) + * .addAllRelationshipTypes(new ArrayList()) * .build(); * BatchGetAssetsHistoryResponse response = assetServiceClient.batchGetAssetsHistory(request); * } diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/stub/AssetServiceStub.java b/test/integration/goldens/asset/com/google/cloud/asset/v1/stub/AssetServiceStub.java index 462d7e2922..f3b324ba29 100644 --- a/test/integration/goldens/asset/com/google/cloud/asset/v1/stub/AssetServiceStub.java +++ b/test/integration/goldens/asset/com/google/cloud/asset/v1/stub/AssetServiceStub.java @@ -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; @@ -132,7 +135,7 @@ public UnaryCallable deleteFeedCallable() { public OperationCallable< AnalyzeIamPolicyLongrunningRequest, AnalyzeIamPolicyLongrunningResponse, - AnalyzeIamPolicyLongrunningRequest> + AnalyzeIamPolicyLongrunningMetadata> analyzeIamPolicyLongrunningOperationCallable() { throw new UnsupportedOperationException( "Not implemented: analyzeIamPolicyLongrunningOperationCallable()"); @@ -144,6 +147,10 @@ public UnaryCallable deleteFeedCallable() { "Not implemented: analyzeIamPolicyLongrunningCallable()"); } + public UnaryCallable analyzeMoveCallable() { + throw new UnsupportedOperationException("Not implemented: analyzeMoveCallable()"); + } + @Override public abstract void close(); } diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java b/test/integration/goldens/asset/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java index d5f851bb3b..30012d98c6 100644 --- a/test/integration/goldens/asset/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java +++ b/test/integration/goldens/asset/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java @@ -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; @@ -147,8 +150,9 @@ public class AssetServiceStubSettings extends StubSettings + AnalyzeIamPolicyLongrunningMetadata> analyzeIamPolicyLongrunningOperationSettings; + private final UnaryCallSettings analyzeMoveSettings; private static final PagedListDescriptor LIST_ASSETS_PAGE_STR_DESC = @@ -413,11 +417,16 @@ public UnaryCallSettings deleteFeedSettings() { public OperationCallSettings< AnalyzeIamPolicyLongrunningRequest, AnalyzeIamPolicyLongrunningResponse, - AnalyzeIamPolicyLongrunningRequest> + AnalyzeIamPolicyLongrunningMetadata> analyzeIamPolicyLongrunningOperationSettings() { return analyzeIamPolicyLongrunningOperationSettings; } + /** Returns the object with the settings used for calls to analyzeMove. */ + public UnaryCallSettings 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() @@ -452,7 +461,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ @@ -508,6 +519,7 @@ protected AssetServiceStubSettings(Builder settingsBuilder) throws IOException { settingsBuilder.analyzeIamPolicyLongrunningSettings().build(); analyzeIamPolicyLongrunningOperationSettings = settingsBuilder.analyzeIamPolicyLongrunningOperationSettings().build(); + analyzeMoveSettings = settingsBuilder.analyzeMoveSettings().build(); } /** Builder for AssetServiceStubSettings. */ @@ -543,8 +555,10 @@ public static class Builder extends StubSettings.Builder + AnalyzeIamPolicyLongrunningMetadata> analyzeIamPolicyLongrunningOperationSettings; + private final UnaryCallSettings.Builder + analyzeMoveSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -564,6 +578,7 @@ public static class Builder extends StubSettings.BuildernewArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -613,6 +628,8 @@ public static class Builder extends StubSettings.Builder>of( @@ -652,7 +670,8 @@ protected Builder(ClientContext clientContext) { searchAllResourcesSettings, searchAllIamPoliciesSettings, analyzeIamPolicySettings, - analyzeIamPolicyLongrunningSettings); + analyzeIamPolicyLongrunningSettings, + analyzeMoveSettings); initDefaults(this); } @@ -675,6 +694,7 @@ protected Builder(AssetServiceStubSettings settings) { settings.analyzeIamPolicyLongrunningSettings.toBuilder(); analyzeIamPolicyLongrunningOperationSettings = settings.analyzeIamPolicyLongrunningOperationSettings.toBuilder(); + analyzeMoveSettings = settings.analyzeMoveSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -689,7 +709,8 @@ protected Builder(AssetServiceStubSettings settings) { searchAllResourcesSettings, searchAllIamPoliciesSettings, analyzeIamPolicySettings, - analyzeIamPolicyLongrunningSettings); + analyzeIamPolicyLongrunningSettings, + analyzeMoveSettings); } private static Builder createDefault() { @@ -766,6 +787,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( @@ -804,7 +830,7 @@ private static Builder initDefaults(Builder builder) { AnalyzeIamPolicyLongrunningResponse.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create( - AnalyzeIamPolicyLongrunningRequest.class)) + AnalyzeIamPolicyLongrunningMetadata.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() @@ -920,11 +946,17 @@ public UnaryCallSettings.Builder 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 + analyzeMoveSettings() { + return analyzeMoveSettings; + } + @Override public AssetServiceStubSettings build() throws IOException { return new AssetServiceStubSettings(this); diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java b/test/integration/goldens/asset/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java index d884f02bf9..d467435938 100644 --- a/test/integration/goldens/asset/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java +++ b/test/integration/goldens/asset/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java @@ -27,10 +27,13 @@ import com.google.api.gax.rpc.ClientContext; 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; @@ -180,6 +183,16 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + analyzeMoveMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.asset.v1.AssetService/AnalyzeMove") + .setRequestMarshaller(ProtoUtils.marshaller(AnalyzeMoveRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AnalyzeMoveResponse.getDefaultInstance())) + .build(); + private final UnaryCallable exportAssetsCallable; private final OperationCallable exportAssetsOperationCallable; @@ -207,8 +220,9 @@ public class GrpcAssetServiceStub extends AssetServiceStub { private final OperationCallable< AnalyzeIamPolicyLongrunningRequest, AnalyzeIamPolicyLongrunningResponse, - AnalyzeIamPolicyLongrunningRequest> + AnalyzeIamPolicyLongrunningMetadata> analyzeIamPolicyLongrunningOperationCallable; + private final UnaryCallable analyzeMoveCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -382,6 +396,16 @@ protected GrpcAssetServiceStub( return params.build(); }) .build(); + GrpcCallSettings analyzeMoveTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(analyzeMoveMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); this.exportAssetsCallable = callableFactory.createUnaryCallable( @@ -452,6 +476,9 @@ protected GrpcAssetServiceStub( settings.analyzeIamPolicyLongrunningOperationSettings(), clientContext, operationsStub); + this.analyzeMoveCallable = + callableFactory.createUnaryCallable( + analyzeMoveTransportSettings, settings.analyzeMoveSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -553,11 +580,16 @@ public UnaryCallable deleteFeedCallable() { public OperationCallable< AnalyzeIamPolicyLongrunningRequest, AnalyzeIamPolicyLongrunningResponse, - AnalyzeIamPolicyLongrunningRequest> + AnalyzeIamPolicyLongrunningMetadata> analyzeIamPolicyLongrunningOperationCallable() { return analyzeIamPolicyLongrunningOperationCallable; } + @Override + public UnaryCallable analyzeMoveCallable() { + return analyzeMoveCallable; + } + @Override public final void close() { try { diff --git a/test/integration/goldens/compute/com/google/cloud/compute/v1/AddressesClientTest.java b/test/integration/goldens/compute/com/google/cloud/compute/v1/AddressesClientTest.java index bc7d9c2a16..24d06c2f69 100644 --- a/test/integration/goldens/compute/com/google/cloud/compute/v1/AddressesClientTest.java +++ b/test/integration/goldens/compute/com/google/cloud/compute/v1/AddressesClientTest.java @@ -141,7 +141,7 @@ public void deleteTest() throws Exception { .setError(Error.newBuilder().build()) .setHttpErrorMessage("httpErrorMessage1577303431") .setHttpErrorStatusCode(1386087020) - .setId("id3355") + .setId(3355) .setInsertTime("insertTime966165798") .setKind("kind3292052") .setName("name3373707") @@ -151,7 +151,7 @@ public void deleteTest() throws Exception { .setSelfLink("selfLink1191800166") .setStartTime("startTime-2129294769") .setStatusMessage("statusMessage-958704715") - .setTargetId("targetId-441951604") + .setTargetId(-815576439) .setTargetLink("targetLink486368555") .setUser("user3599307") .addAllWarnings(new ArrayList()) @@ -210,7 +210,7 @@ public void insertTest() throws Exception { .setError(Error.newBuilder().build()) .setHttpErrorMessage("httpErrorMessage1577303431") .setHttpErrorStatusCode(1386087020) - .setId("id3355") + .setId(3355) .setInsertTime("insertTime966165798") .setKind("kind3292052") .setName("name3373707") @@ -220,7 +220,7 @@ public void insertTest() throws Exception { .setSelfLink("selfLink1191800166") .setStartTime("startTime-2129294769") .setStatusMessage("statusMessage-958704715") - .setTargetId("targetId-441951604") + .setTargetId(-815576439) .setTargetLink("targetLink486368555") .setUser("user3599307") .addAllWarnings(new ArrayList()) diff --git a/test/integration/goldens/compute/com/google/cloud/compute/v1/RegionOperationsClientTest.java b/test/integration/goldens/compute/com/google/cloud/compute/v1/RegionOperationsClientTest.java index 7f6b78232a..d41b1f5191 100644 --- a/test/integration/goldens/compute/com/google/cloud/compute/v1/RegionOperationsClientTest.java +++ b/test/integration/goldens/compute/com/google/cloud/compute/v1/RegionOperationsClientTest.java @@ -83,7 +83,7 @@ public void getTest() throws Exception { .setError(Error.newBuilder().build()) .setHttpErrorMessage("httpErrorMessage1577303431") .setHttpErrorStatusCode(1386087020) - .setId("id3355") + .setId(3355) .setInsertTime("insertTime966165798") .setKind("kind3292052") .setName("name3373707") @@ -93,7 +93,7 @@ public void getTest() throws Exception { .setSelfLink("selfLink1191800166") .setStartTime("startTime-2129294769") .setStatusMessage("statusMessage-958704715") - .setTargetId("targetId-441951604") + .setTargetId(-815576439) .setTargetLink("targetLink486368555") .setUser("user3599307") .addAllWarnings(new ArrayList()) diff --git a/test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java b/test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java index 45338c519e..26792da200 100644 --- a/test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java +++ b/test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java @@ -150,7 +150,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/test/integration/goldens/iam/com/google/iam/v1/stub/IAMPolicyStubSettings.java b/test/integration/goldens/iam/com/google/iam/v1/stub/IAMPolicyStubSettings.java index 0c1876afa5..03c10fcb73 100644 --- a/test/integration/goldens/iam/com/google/iam/v1/stub/IAMPolicyStubSettings.java +++ b/test/integration/goldens/iam/com/google/iam/v1/stub/IAMPolicyStubSettings.java @@ -137,7 +137,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/test/integration/goldens/kms/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java b/test/integration/goldens/kms/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java index 830ca8ca8d..e3faa10060 100644 --- a/test/integration/goldens/kms/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java +++ b/test/integration/goldens/kms/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java @@ -657,7 +657,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/test/integration/goldens/library/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java b/test/integration/goldens/library/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java index 614a5b7c98..159cd561a6 100644 --- a/test/integration/goldens/library/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java +++ b/test/integration/goldens/library/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java @@ -316,7 +316,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java b/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java index 942d01f547..faf8137eea 100644 --- a/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java +++ b/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java @@ -526,7 +526,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java b/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java index ae4a0acbb2..3f3b507702 100644 --- a/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java +++ b/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java @@ -456,7 +456,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java b/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java index 5694e24035..3cf4be8d73 100644 --- a/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java +++ b/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java @@ -224,7 +224,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java b/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java index a6adbe6945..01e6bd03a6 100644 --- a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java +++ b/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java @@ -485,6 +485,7 @@ public final Subscription createSubscription( * .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) * .setRetryPolicy(RetryPolicy.newBuilder().build()) * .setDetached(true) + * .setTopicMessageRetentionDuration(Duration.newBuilder().build()) * .build(); * Subscription response = subscriptionAdminClient.createSubscription(request); * } @@ -529,6 +530,7 @@ public final Subscription createSubscription(Subscription request) { * .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) * .setRetryPolicy(RetryPolicy.newBuilder().build()) * .setDetached(true) + * .setTopicMessageRetentionDuration(Duration.newBuilder().build()) * .build(); * ApiFuture future = * subscriptionAdminClient.createSubscriptionCallable().futureCall(request); diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java b/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java index dd1bd27dac..9d53a7554a 100644 --- a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java +++ b/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java @@ -149,6 +149,7 @@ public void createSubscriptionTest() throws Exception { .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) .setRetryPolicy(RetryPolicy.newBuilder().build()) .setDetached(true) + .setTopicMessageRetentionDuration(Duration.newBuilder().build()) .build(); mockSubscriber.addResponse(expectedResponse); @@ -209,6 +210,7 @@ public void createSubscriptionTest2() throws Exception { .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) .setRetryPolicy(RetryPolicy.newBuilder().build()) .setDetached(true) + .setTopicMessageRetentionDuration(Duration.newBuilder().build()) .build(); mockSubscriber.addResponse(expectedResponse); @@ -269,6 +271,7 @@ public void createSubscriptionTest3() throws Exception { .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) .setRetryPolicy(RetryPolicy.newBuilder().build()) .setDetached(true) + .setTopicMessageRetentionDuration(Duration.newBuilder().build()) .build(); mockSubscriber.addResponse(expectedResponse); @@ -329,6 +332,7 @@ public void createSubscriptionTest4() throws Exception { .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) .setRetryPolicy(RetryPolicy.newBuilder().build()) .setDetached(true) + .setTopicMessageRetentionDuration(Duration.newBuilder().build()) .build(); mockSubscriber.addResponse(expectedResponse); @@ -389,6 +393,7 @@ public void getSubscriptionTest() throws Exception { .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) .setRetryPolicy(RetryPolicy.newBuilder().build()) .setDetached(true) + .setTopicMessageRetentionDuration(Duration.newBuilder().build()) .build(); mockSubscriber.addResponse(expectedResponse); @@ -439,6 +444,7 @@ public void getSubscriptionTest2() throws Exception { .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) .setRetryPolicy(RetryPolicy.newBuilder().build()) .setDetached(true) + .setTopicMessageRetentionDuration(Duration.newBuilder().build()) .build(); mockSubscriber.addResponse(expectedResponse); @@ -489,6 +495,7 @@ public void updateSubscriptionTest() throws Exception { .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) .setRetryPolicy(RetryPolicy.newBuilder().build()) .setDetached(true) + .setTopicMessageRetentionDuration(Duration.newBuilder().build()) .build(); mockSubscriber.addResponse(expectedResponse); diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/TopicAdminClient.java b/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/TopicAdminClient.java index 802fe3e940..be0a3a2e42 100644 --- a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/TopicAdminClient.java +++ b/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/TopicAdminClient.java @@ -237,6 +237,7 @@ public final Topic createTopic(String name) { * .setKmsKeyName("kmsKeyName412586233") * .setSchemaSettings(SchemaSettings.newBuilder().build()) * .setSatisfiesPzs(true) + * .setMessageRetentionDuration(Duration.newBuilder().build()) * .build(); * Topic response = topicAdminClient.createTopic(request); * } @@ -266,6 +267,7 @@ public final Topic createTopic(Topic request) { * .setKmsKeyName("kmsKeyName412586233") * .setSchemaSettings(SchemaSettings.newBuilder().build()) * .setSatisfiesPzs(true) + * .setMessageRetentionDuration(Duration.newBuilder().build()) * .build(); * ApiFuture future = topicAdminClient.createTopicCallable().futureCall(request); * // Do something. diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/TopicAdminClientTest.java b/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/TopicAdminClientTest.java index 09b8de0f90..02d6a55850 100644 --- a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/TopicAdminClientTest.java +++ b/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/TopicAdminClientTest.java @@ -37,6 +37,7 @@ import com.google.iam.v1.TestIamPermissionsResponse; import com.google.protobuf.AbstractMessage; import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; import com.google.pubsub.v1.DeleteTopicRequest; @@ -125,6 +126,7 @@ public void createTopicTest() throws Exception { .setKmsKeyName("kmsKeyName412586233") .setSchemaSettings(SchemaSettings.newBuilder().build()) .setSatisfiesPzs(true) + .setMessageRetentionDuration(Duration.newBuilder().build()) .build(); mockPublisher.addResponse(expectedResponse); @@ -168,6 +170,7 @@ public void createTopicTest2() throws Exception { .setKmsKeyName("kmsKeyName412586233") .setSchemaSettings(SchemaSettings.newBuilder().build()) .setSatisfiesPzs(true) + .setMessageRetentionDuration(Duration.newBuilder().build()) .build(); mockPublisher.addResponse(expectedResponse); @@ -211,6 +214,7 @@ public void updateTopicTest() throws Exception { .setKmsKeyName("kmsKeyName412586233") .setSchemaSettings(SchemaSettings.newBuilder().build()) .setSatisfiesPzs(true) + .setMessageRetentionDuration(Duration.newBuilder().build()) .build(); mockPublisher.addResponse(expectedResponse); @@ -341,6 +345,7 @@ public void getTopicTest() throws Exception { .setKmsKeyName("kmsKeyName412586233") .setSchemaSettings(SchemaSettings.newBuilder().build()) .setSatisfiesPzs(true) + .setMessageRetentionDuration(Duration.newBuilder().build()) .build(); mockPublisher.addResponse(expectedResponse); @@ -384,6 +389,7 @@ public void getTopicTest2() throws Exception { .setKmsKeyName("kmsKeyName412586233") .setSchemaSettings(SchemaSettings.newBuilder().build()) .setSatisfiesPzs(true) + .setMessageRetentionDuration(Duration.newBuilder().build()) .build(); mockPublisher.addResponse(expectedResponse); diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java b/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java index e5ea4e34bc..166775ec3c 100644 --- a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java +++ b/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java @@ -490,7 +490,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java b/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java index 00489c3f74..fb8a87653d 100644 --- a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java +++ b/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java @@ -254,7 +254,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java b/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java index 00ad4dd1c6..567da1624b 100644 --- a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java +++ b/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java @@ -395,7 +395,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/test/integration/goldens/redis/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java b/test/integration/goldens/redis/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java index c6e6faa442..b92734fabc 100644 --- a/test/integration/goldens/redis/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java +++ b/test/integration/goldens/redis/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java @@ -306,7 +306,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/test/integration/goldens/storage/com/google/storage/v2/stub/StorageStubSettings.java b/test/integration/goldens/storage/com/google/storage/v2/stub/StorageStubSettings.java index 7a10ecf5e4..85c8639848 100644 --- a/test/integration/goldens/storage/com/google/storage/v2/stub/StorageStubSettings.java +++ b/test/integration/goldens/storage/com/google/storage/v2/stub/StorageStubSettings.java @@ -157,7 +157,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/version.txt b/version.txt index 38f77a65b3..7ec1d6db40 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2.0.1 +2.1.0