From 2df163fe79d9600d37a082d5e6e30cb3286342e1 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Fri, 3 Nov 2023 18:09:03 -0400 Subject: [PATCH] feat: Add default endpoint and default mtls endpoint --- ...tractServiceStubSettingsClassComposer.java | 4 +- .../DeprecatedServiceStubSettings.golden | 4 +- .../grpc/goldens/EchoStubSettings.golden | 4 +- .../LoggingServiceV2StubSettings.golden | 4 +- .../grpc/goldens/PublisherStubSettings.golden | 4 +- .../grpcrest/goldens/EchoStubSettings.golden | 8 +- .../goldens/WickedStubSettings.golden | 4 +- .../goldens/ComplianceStubSettings.golden | 4 +- .../google/api/gax/rpc/EndpointContext.java | 76 +++++++++++-------- .../com/google/api/gax/rpc/StubSettings.java | 58 +++++++------- .../google/api/gax/rpc/ClientContextTest.java | 24 +++--- .../v1beta1/stub/ComplianceStubSettings.java | 8 +- .../v1beta1/stub/EchoStubSettings.java | 8 +- .../v1beta1/stub/IdentityStubSettings.java | 8 +- .../v1beta1/stub/MessagingStubSettings.java | 8 +- .../stub/SequenceServiceStubSettings.java | 8 +- .../v1beta1/stub/TestingStubSettings.java | 8 +- .../stub/ConnectionServiceStubSettings.java | 8 +- .../v1/stub/TetherStubSettings.java | 4 +- .../v1/stub/AssetServiceStubSettings.java | 8 +- .../data/v2/stub/BigtableStubSettings.java | 4 +- .../v1small/stub/AddressesStubSettings.java | 4 +- .../stub/RegionOperationsStubSettings.java | 4 +- .../v1/stub/IamCredentialsStubSettings.java | 8 +- .../iam/v1/stub/IAMPolicyStubSettings.java | 4 +- .../KeyManagementServiceStubSettings.java | 4 +- .../v1/stub/LibraryServiceStubSettings.java | 8 +- .../v2/stub/ConfigServiceV2StubSettings.java | 4 +- .../v2/stub/LoggingServiceV2StubSettings.java | 4 +- .../v2/stub/MetricsServiceV2StubSettings.java | 4 +- .../pubsub/v1/stub/PublisherStubSettings.java | 4 +- .../v1/stub/SchemaServiceStubSettings.java | 4 +- .../v1/stub/SubscriberStubSettings.java | 4 +- .../v1beta1/stub/CloudRedisStubSettings.java | 8 +- .../storage/v2/stub/StorageStubSettings.java | 4 +- 35 files changed, 174 insertions(+), 160 deletions(-) diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java index 50e9c12e71..d08e3004d4 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java @@ -1880,14 +1880,14 @@ protected MethodDefinition createNestedClassCreateDefaultMethod( bodyExprs.add( MethodInvocationExpr.builder() .setExprReferenceExpr(builderVarExpr) - .setMethodName("setEndpoint") + .setMethodName("setDefaultEndpoint") .setArguments( MethodInvocationExpr.builder().setMethodName("getDefaultEndpoint").build()) .build()); bodyExprs.add( MethodInvocationExpr.builder() .setExprReferenceExpr(builderVarExpr) - .setMethodName("setMtlsEndpoint") + .setMethodName("setDefaultMtlsEndpoint") .setArguments( MethodInvocationExpr.builder().setMethodName("getDefaultMtlsEndpoint").build()) .build()); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceStubSettings.golden index 62dbbadfda..a5c4ffb1d5 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceStubSettings.golden @@ -235,8 +235,8 @@ public class DeprecatedServiceStubSettings extends StubSettings { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden index 54f6b34b93..aa41b2c09b 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden @@ -620,8 +620,8 @@ public class LoggingServiceV2StubSettings extends StubSettings { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden index 05781309f0..747b1eaaa6 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden @@ -512,8 +512,8 @@ public class EchoStubSettings extends StubSettings { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); @@ -525,8 +525,8 @@ public class EchoStubSettings extends StubSettings { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedStubSettings.golden index 702d9a6dcd..aaea063453 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedStubSettings.golden @@ -231,8 +231,8 @@ public class WickedStubSettings extends StubSettings { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden index acd321473f..a2c1803e35 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden @@ -302,8 +302,8 @@ public class ComplianceStubSettings extends StubSettings builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java index 96d3bd3302..c107fa01d1 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java @@ -42,13 +42,19 @@ @InternalApi @AutoValue public abstract class EndpointContext { - private static final String DEFAULT_UNIVERSE_DOMAIN = "googleapis.com"; + private static final String GOOGLE_DEFAULT_UNIVERSE = "googleapis.com"; private static final String DEFAULT_PORT = "443"; private static final String UNIVERSE_DOMAIN_TEMPLATE = "https://SERVICE_NAME.UNIVERSE_DOMAIN:PORT"; private static final Pattern ENDPOINT_REGEX = Pattern.compile("^(https\\:\\/\\/)?(www.)?[a-zA-Z]+\\.[\\S]+(\\:\\d)?$"); + @Nullable + public abstract String defaultEndpoint(); + + @Nullable + public abstract String defaultMtlsEndpoint(); + @Nullable public abstract String clientSettingsEndpoint(); @@ -79,48 +85,40 @@ public static Builder newBuilder() { // By default, the clientSettingsEndpoint value is the default_host endpoint // value configured in the service. Users can override this value by the Setter // exposed in the Client/Stub Settings or in the TransportChannelProvider. - private void determineEndpoint() throws IOException { + @VisibleForTesting + void determineEndpoint() throws IOException { if (resolvedEndpoint != null && resolvedUniverseDomain != null) { return; } + MtlsProvider mtlsProvider = mtlsProvider() == null ? new MtlsProvider() : mtlsProvider(); String customEndpoint = transportChannelEndpoint() != null ? transportChannelEndpoint() : clientSettingsEndpoint(); - // If both endpoint values are null, the client is unable to parse the serviceName + // This means that there are no user configured endpoints, use the default endpoint if (customEndpoint == null) { - // throw new Exception("No endpoint was set for the client"); + if (switchToMtlsEndpointAllowed() && mtlsProvider != null) { + resolvedEndpoint = + mtlsEndpointResolver(mtlsProvider, defaultEndpoint(), defaultMtlsEndpoint()); + } else { + resolvedEndpoint = defaultEndpoint(); + } + resolvedUniverseDomain = GOOGLE_DEFAULT_UNIVERSE; return; } Matcher matcher = ENDPOINT_REGEX.matcher(customEndpoint); - // Check if it matches the format in the template + // Check if it matches the ENDPOINT_TEMPLATE format if (!matcher.matches()) { - // Throw an exception if user's endpoint is not valid - // throw new Exception("Invalid endpoint: " + customEndpoint); + resolvedEndpoint = customEndpoint; + resolvedUniverseDomain = GOOGLE_DEFAULT_UNIVERSE; return; } - MtlsProvider mtlsProvider = mtlsProvider() == null ? new MtlsProvider() : mtlsProvider(); - boolean isUsingMtlsEndpoint = false; if (switchToMtlsEndpointAllowed() && mtlsProvider != null) { - switch (mtlsProvider.getMtlsEndpointUsagePolicy()) { - case ALWAYS: - customEndpoint = mtlsEndpoint(); - isUsingMtlsEndpoint = true; - break; - case NEVER: - // CustomEndpoint is already set - break; - default: - if (mtlsProvider.useMtlsClientCertificate() && mtlsProvider.getKeyStore() != null) { - customEndpoint = mtlsEndpoint(); - isUsingMtlsEndpoint = true; - break; - } - } + customEndpoint = mtlsEndpointResolver(mtlsProvider, customEndpoint, defaultMtlsEndpoint()); } - // mTLS is not supported yet. If mTLS is enabled, use that endpoint. - if (isUsingMtlsEndpoint) { - resolvedEndpoint = mtlsEndpoint(); - resolvedUniverseDomain = DEFAULT_UNIVERSE_DOMAIN; + // mTLS will always be in the GDU, for now + if (customEndpoint.contains("mtls")) { + resolvedEndpoint = customEndpoint; + resolvedUniverseDomain = GOOGLE_DEFAULT_UNIVERSE; return; } @@ -130,7 +128,7 @@ private void determineEndpoint() throws IOException { int periodIndex = customEndpoint.indexOf('.'); int colonIndex = customEndpoint.indexOf(':'); - String serviceName; + String serviceName = customEndpoint.substring(0, periodIndex); String universeDomain; String port = "443"; if (colonIndex != -1) { @@ -139,15 +137,25 @@ private void determineEndpoint() throws IOException { } else { universeDomain = customEndpoint.substring(periodIndex + 1); } - serviceName = customEndpoint.substring(0, periodIndex); // TODO: Build out logic for resolving endpoint resolvedEndpoint = buildEndpoint(serviceName, universeDomain, port); resolvedUniverseDomain = universeDomain; } - private String buildEndpoint(String serviceName) { - return buildEndpoint(serviceName, DEFAULT_UNIVERSE_DOMAIN, DEFAULT_PORT); + private String mtlsEndpointResolver( + MtlsProvider mtlsProvider, String endpoint, String mtlsEndpoint) throws IOException { + switch (mtlsProvider.getMtlsEndpointUsagePolicy()) { + case ALWAYS: + return mtlsEndpoint; + case NEVER: + return endpoint; + default: + if (mtlsProvider.useMtlsClientCertificate() && mtlsProvider.getKeyStore() != null) { + return mtlsEndpoint; + } + return endpoint; + } } private String buildEndpoint(String serviceName, String universeDomain, String port) { @@ -173,6 +181,10 @@ public String resolveUniverseDomain(Credentials credentials) throws IOException @AutoValue.Builder public abstract static class Builder { + protected abstract Builder setDefaultEndpoint(String defaultEndpoint); + + protected abstract Builder setDefaultMtlsEndpoint(String defaultMtlsEndpiont); + public abstract Builder setClientSettingsEndpoint(String clientSettingsEndpoint); public abstract Builder setTransportChannelEndpoint(String transportChannelEndpoint); diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/StubSettings.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/StubSettings.java index 6fa92f05a8..7d23cb713d 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/StubSettings.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/StubSettings.java @@ -103,7 +103,7 @@ protected StubSettings(Builder builder) { this.universeDomain = builder.universeDomain; this.mtlsEndpoint = builder.mtlsEndpoint; this.switchToMtlsEndpointAllowed = builder.switchToMtlsEndpointAllowed; - this.endpointContext = builder.endpointContext; + this.endpointContext = builder.endpointContextBuilder.build(); this.quotaProjectId = builder.quotaProjectId; this.streamWatchdogProvider = builder.streamWatchdogProvider; this.streamWatchdogCheckInterval = builder.streamWatchdogCheckInterval; @@ -259,7 +259,7 @@ public abstract static class Builder< @Nonnull private Duration streamWatchdogCheckInterval; @Nonnull private ApiTracerFactory tracerFactory; private boolean deprecatedExecutorProviderSet; - @Nonnull private EndpointContext endpointContext; + @Nonnull private EndpointContext.Builder endpointContextBuilder; /** * Indicate when creating transport whether it is allowed to use mTLS endpoint instead of the @@ -281,7 +281,7 @@ protected Builder(StubSettings settings) { this.universeDomain = settings.universeDomain; this.mtlsEndpoint = settings.mtlsEndpoint; this.switchToMtlsEndpointAllowed = settings.switchToMtlsEndpointAllowed; - this.endpointContext = settings.endpointContext; + this.endpointContextBuilder = settings.endpointContext.toBuilder(); this.quotaProjectId = settings.quotaProjectId; this.streamWatchdogProvider = settings.streamWatchdogProvider; this.streamWatchdogCheckInterval = settings.streamWatchdogCheckInterval; @@ -318,7 +318,7 @@ protected Builder(ClientContext clientContext) { this.endpoint = null; this.universeDomain = null; this.mtlsEndpoint = null; - this.endpointContext = EndpointContext.newBuilder().build(); + this.endpointContextBuilder = EndpointContext.newBuilder(); this.quotaProjectId = null; this.streamWatchdogProvider = InstantiatingWatchdogProvider.create(); this.streamWatchdogCheckInterval = Duration.ofSeconds(10); @@ -342,14 +342,13 @@ protected Builder(ClientContext clientContext) { if (this.endpoint != null) { this.mtlsEndpoint = this.endpoint.replace("googleapis.com", "mtls.googleapis.com"); } - this.endpointContext = + this.endpointContextBuilder = EndpointContext.newBuilder() - .setClientSettingsEndpoint(clientContext.getEndpoint()) + .setDefaultEndpoint(clientContext.getEndpoint()) .setTransportChannelEndpoint(transportChannelProvider.getEndpoint()) - .setMtlsEndpoint(mtlsEndpoint) + .setDefaultMtlsEndpoint(mtlsEndpoint) .setSwitchToMtlsEndpointAllowed(switchToMtlsEndpointAllowed) - .setUniverseDomain(clientContext.getUniverseDomain()) - .build(); + .setUniverseDomain(clientContext.getUniverseDomain()); this.streamWatchdogProvider = FixedWatchdogProvider.create(clientContext.getStreamWatchdog()); this.streamWatchdogCheckInterval = clientContext.getStreamWatchdogCheckInterval(); @@ -445,11 +444,9 @@ protected B setInternalHeaderProvider(HeaderProvider internalHeaderProvider) { */ public B setTransportChannelProvider(TransportChannelProvider transportChannelProvider) { this.transportChannelProvider = transportChannelProvider; - this.endpointContext = - this.endpointContext - .toBuilder() - .setTransportChannelEndpoint(transportChannelProvider.getEndpoint()) - .build(); + this.endpointContextBuilder = + this.endpointContextBuilder.setTransportChannelEndpoint( + transportChannelProvider.getEndpoint()); return self(); } @@ -473,42 +470,47 @@ public B setClock(ApiClock clock) { return self(); } + protected B setDefaultEndpoint(String defaultEndpoint) { + this.endpointContextBuilder = this.endpointContextBuilder.setDefaultEndpoint(defaultEndpoint); + return self(); + } + + protected B setDefaultMtlsEndpoint(String defaultMtlsEndpoint) { + this.endpointContextBuilder = + this.endpointContextBuilder.setDefaultMtlsEndpoint(defaultMtlsEndpoint); + return self(); + } + public B setEndpoint(String endpoint) { this.endpoint = endpoint; this.switchToMtlsEndpointAllowed = false; if (this.endpoint != null && this.mtlsEndpoint == null) { this.mtlsEndpoint = this.endpoint.replace("googleapis.com", "mtls.googleapis.com"); } - this.endpointContext = - this.endpointContext - .toBuilder() + this.endpointContextBuilder = + this.endpointContextBuilder .setClientSettingsEndpoint(endpoint) .setMtlsEndpoint(mtlsEndpoint) - .setSwitchToMtlsEndpointAllowed(switchToMtlsEndpointAllowed) - .build(); + .setSwitchToMtlsEndpointAllowed(false); return self(); } public B setUniverseDomain(String universeDomain) { this.universeDomain = universeDomain; - this.endpointContext = - this.endpointContext.toBuilder().setUniverseDomain(universeDomain).build(); + this.endpointContextBuilder = this.endpointContextBuilder.setUniverseDomain(universeDomain); return self(); } protected B setSwitchToMtlsEndpointAllowed(boolean switchToMtlsEndpointAllowed) { this.switchToMtlsEndpointAllowed = switchToMtlsEndpointAllowed; - this.endpointContext = - this.endpointContext - .toBuilder() - .setSwitchToMtlsEndpointAllowed(switchToMtlsEndpointAllowed) - .build(); + this.endpointContextBuilder = + this.endpointContextBuilder.setSwitchToMtlsEndpointAllowed(switchToMtlsEndpointAllowed); return self(); } public B setMtlsEndpoint(String mtlsEndpoint) { this.mtlsEndpoint = mtlsEndpoint; - this.endpointContext = this.endpointContext.toBuilder().setMtlsEndpoint(mtlsEndpoint).build(); + this.endpointContextBuilder = this.endpointContextBuilder.setMtlsEndpoint(mtlsEndpoint); return self(); } @@ -648,7 +650,7 @@ public String toString() { .add("clock", clock) .add("endpoint", endpoint) .add("universeDomain", universeDomain) - .add("endpointContext", endpointContext) + .add("endpointContextBuilder", endpointContextBuilder) .add("mtlsEndpoint", mtlsEndpoint) .add("switchToMtlsEndpointAllowed", switchToMtlsEndpointAllowed) .add("quotaProjectId", quotaProjectId) diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientContextTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientContextTest.java index a610b01b41..6891ef6a20 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientContextTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientContextTest.java @@ -649,8 +649,8 @@ public void testAutoUseMtlsEndpoint() throws IOException { false); EndpointContext endpointContext = EndpointContext.newBuilder() - .setClientSettingsEndpoint(endpoint) - .setMtlsEndpoint(mtlsEndpoint) + .setDefaultEndpoint(endpoint) + .setDefaultMtlsEndpoint(mtlsEndpoint) .setSwitchToMtlsEndpointAllowed(switchToMtlsEndpointAllowed) .setMtlsProvider(provider) .build(); @@ -672,8 +672,8 @@ public void testEndpointNotOverridable() throws IOException { false); EndpointContext endpointContext = EndpointContext.newBuilder() - .setClientSettingsEndpoint(endpoint) - .setMtlsEndpoint(mtlsEndpoint) + .setDefaultEndpoint(endpoint) + .setDefaultMtlsEndpoint(mtlsEndpoint) .setSwitchToMtlsEndpointAllowed(switchToMtlsEndpointAllowed) .setMtlsProvider(provider) .build(); @@ -689,8 +689,8 @@ public void testNoClientCertificate() throws IOException { new FakeMtlsProvider(true, MtlsEndpointUsagePolicy.AUTO, null, "", false); EndpointContext endpointContext = EndpointContext.newBuilder() - .setClientSettingsEndpoint(endpoint) - .setMtlsEndpoint(mtlsEndpoint) + .setDefaultEndpoint(endpoint) + .setDefaultMtlsEndpoint(mtlsEndpoint) .setSwitchToMtlsEndpointAllowed(switchToMtlsEndpointAllowed) .setMtlsProvider(provider) .build(); @@ -706,8 +706,8 @@ public void testAlwaysUseMtlsEndpoint() throws IOException { new FakeMtlsProvider(false, MtlsEndpointUsagePolicy.ALWAYS, null, "", false); EndpointContext endpointContext = EndpointContext.newBuilder() - .setClientSettingsEndpoint(endpoint) - .setMtlsEndpoint(mtlsEndpoint) + .setDefaultEndpoint(endpoint) + .setDefaultMtlsEndpoint(mtlsEndpoint) .setSwitchToMtlsEndpointAllowed(switchToMtlsEndpointAllowed) .setMtlsProvider(provider) .build(); @@ -728,8 +728,8 @@ public void testNeverUseMtlsEndpoint() throws IOException { false); EndpointContext endpointContext = EndpointContext.newBuilder() - .setClientSettingsEndpoint(endpoint) - .setMtlsEndpoint(mtlsEndpoint) + .setDefaultEndpoint(endpoint) + .setDefaultMtlsEndpoint(mtlsEndpoint) .setSwitchToMtlsEndpointAllowed(switchToMtlsEndpointAllowed) .setMtlsProvider(provider) .build(); @@ -746,8 +746,8 @@ public void testGetKeyStoreThrows() throws IOException { new FakeMtlsProvider(true, MtlsEndpointUsagePolicy.AUTO, null, "", true); EndpointContext endpointContext = EndpointContext.newBuilder() - .setClientSettingsEndpoint(endpoint) - .setMtlsEndpoint(mtlsEndpoint) + .setDefaultEndpoint(endpoint) + .setDefaultMtlsEndpoint(mtlsEndpoint) .setSwitchToMtlsEndpointAllowed(switchToMtlsEndpointAllowed) .setMtlsProvider(provider) .build(); diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java index 2fb7b2745c..c88de38d67 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java @@ -516,8 +516,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); @@ -529,8 +529,8 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java index 8e1d7bb5e2..1bf8dcc218 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java @@ -679,8 +679,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); @@ -692,8 +692,8 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java index 90aa163708..4fdff8e085 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java @@ -524,8 +524,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); @@ -537,8 +537,8 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java index ca632dbf10..0ba6e16f64 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java @@ -732,8 +732,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); @@ -745,8 +745,8 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java index f4e0d2f82a..90c72d0131 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java @@ -507,8 +507,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); @@ -520,8 +520,8 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java index 37bba7d806..7f1a2bbdea 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java @@ -612,8 +612,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); @@ -625,8 +625,8 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStubSettings.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStubSettings.java index a037feaf5f..5dfdf814aa 100644 --- a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStubSettings.java +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStubSettings.java @@ -343,8 +343,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); @@ -356,8 +356,8 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStubSettings.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStubSettings.java index cde1caba7e..20c1c340de 100644 --- a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStubSettings.java +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStubSettings.java @@ -223,8 +223,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java index ffcbff4cc6..1e4578ee4c 100644 --- a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java @@ -957,8 +957,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); @@ -970,8 +970,8 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java index fcf1108e22..18fe2d0b3b 100644 --- a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java +++ b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java @@ -379,8 +379,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java index 93ea0d5361..2defa027df 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java @@ -459,8 +459,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java index f117b480f9..ab8c049f87 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java @@ -262,8 +262,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java index ce05718aa7..7eb24e0b4f 100644 --- a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java +++ b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java @@ -321,8 +321,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); @@ -334,8 +334,8 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java b/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java index 206413f290..d9f250c6b4 100644 --- a/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java +++ b/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java @@ -260,8 +260,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java index 2ff433f004..eb817875c4 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java @@ -972,8 +972,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java index a744a16190..846a2ad360 100644 --- a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java +++ b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java @@ -544,8 +544,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); @@ -557,8 +557,8 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java index 41dff790b6..1bf1468126 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java @@ -866,8 +866,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java index 94f5d4c16b..7ae6d33f08 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java @@ -636,8 +636,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java index 3d2e16f84e..deeec1b3a9 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java @@ -381,8 +381,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java index 6253d923dc..0c9d287150 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java @@ -721,8 +721,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java index 4c3b9d6b37..4fd3311026 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java @@ -536,8 +536,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java index 2982db4421..1f348e9780 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java @@ -663,8 +663,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java index 339bf18459..a2c45f9b78 100644 --- a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java @@ -594,8 +594,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); @@ -607,8 +607,8 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java b/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java index ba13a8f44a..b13bbac599 100644 --- a/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java +++ b/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java @@ -916,8 +916,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setDefaultEndpoint(getDefaultEndpoint()); + builder.setDefaultMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder);