Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Mark getDefaultEndpoint() with @ObsoleteApi #2347

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.BetaApi;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.batching.BatchingSettings;
import com.google.api.gax.batching.FlowControlSettings;
import com.google.api.gax.batching.FlowController.LimitExceededBehavior;
Expand Down Expand Up @@ -1190,6 +1191,13 @@ private List<MethodDefinition> createDefaultHelperAndGetterMethods(
.setReturnType(returnType)
.setName("getDefaultEndpoint")
.setReturnExpr(ValueExpr.withValue(StringObjectValue.withValue(service.defaultHost())))
.setAnnotations(
ImmutableList.of(
AnnotationNode.builder()
.setType(FIXED_TYPESTORE.get(ObsoleteApi.class.getSimpleName()))
.setDescription(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we provide a brief information in the description first? So that customers don't have to click through the link when they hover over on the method? Something like "There is no concept of a default endpoint anymore with the introduction of universeDomain, please use ... instead".

In addition, maybe we can add the annotation only until the alternative getResolvedEndpoint() is introduced later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll can add a description and hold off on adding the annotation until a future date.

until the alternative getResolvedEndpoint() is introduced

I don't think getResolvedEndpoint() is going to be a 100% true alternative to getDefaultEndpoint(). Based on the previous configurations (prior to EndpointContext), the default endpoint may not be the resolved endpoint used by the client. We're no longer supporting a concept of a default endpoint so there really should not be an alternative to getDefaultEndpoint().

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of having github links in comments, I think they should be used only if we have no other way. They could become invalid for a lot of reasons, repo access changes, Github URL format change etc., or maybe the source of truth is moved elsewhere. Can we add more info in the annotation description itself?

.build()))
.build());

// Create the getDefaultMtlsEndpoint method.
Expand Down Expand Up @@ -2068,6 +2076,7 @@ private static TypeStore createStaticTypes() {
List.class,
Lists.class,
MonitoredResourceDescriptor.class,
ObsoleteApi.class,
Operation.class,
OperationCallSettings.class,
OperationSnapshot.class,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.google.api.version.test.stub;

import com.google.api.core.ApiFunction;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
Expand Down Expand Up @@ -91,6 +92,8 @@ public class EchoWithVersionStubSettings extends StubSettings<EchoWithVersionStu
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "localhost:7469";
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.google.testdata.v1.stub;

import com.google.api.core.ApiFunction;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
Expand Down Expand Up @@ -107,6 +108,8 @@ public class DeprecatedServiceStubSettings extends StubSettings<DeprecatedServic
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "localhost:7469";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import static com.google.showcase.v1beta1.EchoClient.SimplePagedExpandPagedRespo
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.BetaApi;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
Expand Down Expand Up @@ -291,6 +292,8 @@ public class EchoStubSettings extends StubSettings<EchoStubSettings> {
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "localhost:7469";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import static com.google.logging.v2.LoggingServiceV2Client.ListMonitoredResource
import com.google.api.MonitoredResourceDescriptor;
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.batching.BatchingSettings;
import com.google.api.gax.batching.FlowControlSettings;
import com.google.api.gax.batching.FlowController;
Expand Down Expand Up @@ -433,6 +434,8 @@ public class LoggingServiceV2StubSettings extends StubSettings<LoggingServiceV2S
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "logging.googleapis.com:443";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import static com.google.pubsub.v1.PublisherClient.ListTopicsPagedResponse;

import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.batching.BatchingSettings;
import com.google.api.gax.batching.FlowControlSettings;
import com.google.api.gax.batching.FlowController;
Expand Down Expand Up @@ -442,6 +443,8 @@ public class PublisherStubSettings extends StubSettings<PublisherStubSettings> {
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "pubsub.googleapis.com:443";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import static com.google.showcase.grpcrest.v1beta1.EchoClient.SimplePagedExpandP
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.BetaApi;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
Expand Down Expand Up @@ -307,6 +308,8 @@ public class EchoStubSettings extends StubSettings<EchoStubSettings> {
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "localhost:7469";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.google.showcase.v1beta1.stub;

import com.google.api.core.ApiFunction;
import com.google.api.core.BetaApi;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
Expand Down Expand Up @@ -105,6 +106,8 @@ public class WickedStubSettings extends StubSettings<WickedStubSettings> {
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "localhost:7469";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.google.showcase.v1beta1.stub;

import com.google.api.core.ApiFunction;
import com.google.api.core.BetaApi;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
Expand Down Expand Up @@ -137,6 +138,8 @@ public class ComplianceStubSettings extends StubSettings<ComplianceStubSettings>
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "localhost:7469";
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.google.api.version.test.stub;

import com.google.api.core.ApiFunction;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
Expand Down Expand Up @@ -91,6 +92,8 @@ public class EchoWithVersionStubSettings extends StubSettings<EchoWithVersionStu
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "localhost:7469";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.BetaApi;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
Expand Down Expand Up @@ -279,6 +280,8 @@ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuild
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "localhost:7469";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.BetaApi;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
Expand Down Expand Up @@ -438,6 +439,8 @@ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuild
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "localhost:7469";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.BetaApi;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
Expand Down Expand Up @@ -309,6 +310,8 @@ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuild
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "localhost:7469";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.BetaApi;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
Expand Down Expand Up @@ -451,6 +452,8 @@ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuild
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "localhost:7469";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.BetaApi;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
Expand Down Expand Up @@ -274,6 +275,8 @@ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuild
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "localhost:7469";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.BetaApi;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
Expand Down Expand Up @@ -391,6 +392,8 @@ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuild
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "localhost:7469";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.BetaApi;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
Expand Down Expand Up @@ -194,6 +195,8 @@ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuild
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "apigeeconnect.googleapis.com:443";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.google.cloud.apigeeconnect.v1.stub;

import com.google.api.core.ApiFunction;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
Expand Down Expand Up @@ -113,6 +114,8 @@ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuild
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "apigeeconnect.googleapis.com:443";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.BetaApi;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
Expand Down Expand Up @@ -583,6 +584,8 @@ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuild
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "cloudasset.googleapis.com:443";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.google.cloud.bigtable.data.v2.stub;

import com.google.api.core.ApiFunction;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
Expand Down Expand Up @@ -177,6 +178,8 @@ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuild
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "bigtable.googleapis.com:443";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
Expand Down Expand Up @@ -300,6 +301,8 @@ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuild
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "compute.googleapis.com:443";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.google.cloud.compute.v1small.stub;

import com.google.api.core.ApiFunction;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
Expand Down Expand Up @@ -125,6 +126,8 @@ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuild
}

/** Returns the default service endpoint. */
@ObsoleteApi(
"See https://github.com/googleapis/sdk-platform-java/issues/2346 for more information")
public static String getDefaultEndpoint() {
return "compute.googleapis.com:443";
}
Expand Down
Loading
Loading