Skip to content
This repository was archived by the owner on May 14, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 8 commits
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 @@ -29,11 +29,9 @@
*/
package com.google.api.gax.httpjson;

import com.google.api.core.BetaApi;
import com.google.auto.value.AutoValue;
import javax.annotation.Nullable;

@BetaApi
@AutoValue
/* Method descriptor for messages to be transmitted over HTTP. */
public abstract class ApiMethodDescriptor<RequestT, ResponseT> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@
*/
package com.google.api.gax.httpjson;

import com.google.api.core.BetaApi;
import javax.annotation.Nullable;

/**
* A {@link HttpJsonClientCall} which forwards all of its methods to another {@link
* HttpJsonClientCall}.
*/
@BetaApi
public abstract class ForwardingHttpJsonClientCall<RequestT, ResponseT>
extends HttpJsonClientCall<RequestT, ResponseT> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@

package com.google.api.gax.httpjson;

import com.google.api.core.BetaApi;

/**
* A {@link HttpJsonClientCall.Listener} which forwards all of its methods to another {@link
* HttpJsonClientCall.Listener}.
*/
@BetaApi
public abstract class ForwardingHttpJsonClientCallListener<ResponseT>
extends HttpJsonClientCall.Listener<ResponseT> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ public Duration getStreamIdleTimeout() {
return streamIdleTimeout;
}

@BetaApi("The surface for extra headers is not stable yet and may change in the future.")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Issue to better support extraHeaders: https://github.com/googleapis/sdk-platform-java/issues/1752

Will be done in the future.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If this BetaApi annotation is removed in gax-httpjson, should it also be removed in gax and gax-grpc?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If the base class/interface is still BetaApi, we don't have to remove them, I would only remove BetaApi for httpjson specific classes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If the base class/interface is still BetaApi, we don't have to remove them, I would only remove BetaApi for httpjson specific classes.

Just to clarify what you mean by httpjson specific classes. Do you mean:

  1. Remove annotation for classes/ methods that exist ONLY in the httpjson module and no other gax module (withExtraHeaders would keep the BetaApi annotation)
  2. Remove annotation only from the httpjson module (i.e. Remove in httpjson but keep in gax and gax-grpc)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 yes, 2 no. In addition, if a class does not extend from classes in other modules, we should remove BetaApi from it unless there is a reason not to(e.g. maybe the feature in grpc is also still in Beta).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Gotcha. I'll check the files again and update.

@Override
public ApiCallContext withExtraHeaders(Map<String, List<String>> extraHeaders) {
Preconditions.checkNotNull(extraHeaders);
Expand All @@ -345,7 +344,6 @@ public ApiCallContext withExtraHeaders(Map<String, List<String>> extraHeaders) {
this.retryableCodes);
}

@BetaApi("The surface for extra headers is not stable yet and may change in the future.")
@Override
public Map<String, List<String>> getExtraHeaders() {
return extraHeaders;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/
package com.google.api.gax.httpjson;

import com.google.api.core.BetaApi;
import com.google.auth.Credentials;
import com.google.auto.value.AutoValue;
import com.google.protobuf.TypeRegistry;
Expand All @@ -38,7 +37,6 @@
import org.threeten.bp.Instant;

/** Options for an http-json call, including deadline and credentials. */
@BetaApi
@AutoValue
public abstract class HttpJsonCallOptions {
public static final HttpJsonCallOptions DEFAULT = newBuilder().build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@
*/
package com.google.api.gax.httpjson;

import com.google.api.core.BetaApi;

/** HttpJsonChannel contains the functionality to issue http-json calls. */
@BetaApi
public interface HttpJsonChannel {
<RequestT, ResponseT> HttpJsonClientCall<RequestT, ResponseT> newCall(
ApiMethodDescriptor<RequestT, ResponseT> methodDescriptor, HttpJsonCallOptions callOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/
package com.google.api.gax.httpjson;

import com.google.api.core.BetaApi;
import javax.annotation.Nullable;

// This class mimics the structure and behavior of the corresponding ClientCall from gRPC package as
Expand Down Expand Up @@ -58,7 +57,6 @@
* @param <RequestT> type of message sent to the server
* @param <ResponseT> type of message received one or more times from the server
*/
@BetaApi
public abstract class HttpJsonClientCall<RequestT, ResponseT> {
/**
* Callbacks for receiving metadata, response messages and completion status from the server.
Expand All @@ -67,7 +65,6 @@ public abstract class HttpJsonClientCall<RequestT, ResponseT> {
* not required to be thread-safe, but they must not be thread-hostile. The caller is free to call
* an instance from multiple threads, but only one call simultaneously.
*/
@BetaApi
public abstract static class Listener<T> {
/**
* The response headers have been received. Headers always precede messages.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,13 @@
*/
package com.google.api.gax.httpjson;

import com.google.api.core.BetaApi;

/**
* Interface for intercepting outgoing calls before they are dispatched by a {@link
* HttpJsonChannel}.
*
* <p>The interceptor may be called for multiple {@link HttpJsonClientCall calls} by one or more
* threads without completing the previous ones first. The implementations must be thread-safe.
*/
@BetaApi
public interface HttpJsonClientInterceptor {
/**
* Intercept {@link HttpJsonClientCall} creation by the {@code next} {@link HttpJsonChannel}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@
package com.google.api.gax.httpjson;

import com.google.api.client.http.HttpHeaders;
import com.google.api.core.BetaApi;

/** Interface for functionality to enhance headers for an http-json call. */
@BetaApi
public interface HttpJsonHeaderEnhancer {
void enhance(HttpHeaders headers);
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@
package com.google.api.gax.httpjson;

import com.google.api.client.http.HttpHeaders;
import com.google.api.core.BetaApi;

/** Utility class that creates instances of {@link HttpJsonHeaderEnhancer}. */
@BetaApi
public class HttpJsonHeaderEnhancers {

private HttpJsonHeaderEnhancers() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/
package com.google.api.gax.httpjson;

import com.google.api.core.BetaApi;
import com.google.api.core.InternalExtensionOnly;
import com.google.auto.value.AutoValue;
import java.util.Collections;
Expand All @@ -39,7 +38,6 @@
import javax.annotation.Nullable;

@AutoValue
@BetaApi
@InternalExtensionOnly
public abstract class HttpJsonMetadata {
public abstract Map<String, Object> getHeaders();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/
package com.google.api.gax.httpjson;

import com.google.api.core.BetaApi;
import com.google.api.core.InternalApi;
import com.google.api.gax.longrunning.OperationSnapshot;
import com.google.api.gax.rpc.StatusCode;
Expand All @@ -41,7 +40,6 @@
*
* <p>Public for technical reasons. For internal use only.
*/
@BetaApi
@InternalApi
public class HttpJsonOperationSnapshot implements OperationSnapshot {
private final String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.core.InternalApi;
import com.google.api.gax.longrunning.OperationSnapshot;
import com.google.api.gax.rpc.ApiCallContext;
Expand All @@ -46,7 +45,6 @@
*
* <p>Public for technical reasons. For internal use only.
*/
@BetaApi
@InternalApi
public class HttpJsonOperationSnapshotCallable<RequestT, OperationT>
extends UnaryCallable<RequestT, OperationSnapshot> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@
*/
package com.google.api.gax.httpjson;

import com.google.api.core.BetaApi;
import com.google.api.core.InternalExtensionOnly;
import com.google.api.gax.rpc.StatusCode;
import java.util.Objects;

/** A failure code specific to an HTTP call. */
@BetaApi
@InternalExtensionOnly
public class HttpJsonStatusCode implements StatusCode {
private final int httpStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/
package com.google.api.gax.httpjson;

import com.google.api.core.BetaApi;
import com.google.api.pathtemplate.PathTemplate;
import java.util.Collections;
import java.util.List;
Expand All @@ -52,7 +51,6 @@ public interface HttpRequestFormatter<MessageFormatT> {
PathTemplate getPathTemplate();

/** Additional (alternative) path templates for endpoint URL path. */
@BetaApi
default List<PathTemplate> getAdditionalPathTemplates() {
return Collections.emptyList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.core.BetaApi;
import com.google.api.core.InternalExtensionOnly;
import com.google.api.gax.core.ExecutorProvider;
import com.google.api.gax.rpc.FixedHeaderProvider;
Expand Down Expand Up @@ -59,7 +58,6 @@
* <p>The client lib header and generator header values are used to form a value that goes into the
* http header of requests to the service.
*/
@BetaApi
@InternalExtensionOnly
public final class InstantiatingHttpJsonChannelProvider implements TransportChannelProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.common.annotations.VisibleForTesting;
Expand All @@ -45,7 +44,6 @@
import javax.annotation.Nullable;

/** Implementation of HttpJsonChannel which can issue http-json calls. */
@BetaApi
public class ManagedHttpJsonChannel implements HttpJsonChannel, BackgroundResource {

private final Executor executor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@
*/
package com.google.api.gax.httpjson;

import com.google.api.core.BetaApi;
import com.google.common.annotations.VisibleForTesting;
import java.util.concurrent.TimeUnit;

@BetaApi
class ManagedHttpJsonInterceptorChannel extends ManagedHttpJsonChannel {

private final ManagedHttpJsonChannel channel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/
package com.google.api.gax.httpjson;

import com.google.api.core.BetaApi;
import com.google.api.core.InternalApi;
import com.google.api.pathtemplate.PathTemplate;
import com.google.protobuf.Message;
Expand Down Expand Up @@ -121,7 +120,6 @@ public String getPath(RequestT apiMessage) {
return path;
}

@BetaApi
@Override
public List<PathTemplate> getAdditionalPathTemplates() {
return additionalPathTemplates;
Expand Down Expand Up @@ -161,7 +159,6 @@ public Builder<RequestT> setPath(
return this;
}

@BetaApi
public Builder<RequestT> setAdditionalPaths(String... rawAdditionalPaths) {
this.rawAdditionalPaths = Arrays.asList(rawAdditionalPaths);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/
package com.google.api.gax.httpjson;

import com.google.api.core.BetaApi;
import com.google.common.collect.ImmutableList;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
Expand All @@ -50,7 +49,6 @@
* URL path parameters, and query parameters. It deserializes JSON responses into response protobuf
* message.
*/
@BetaApi
public class ProtoRestSerializer<RequestT extends Message> {

private final TypeRegistry registry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,10 @@
*/
package com.google.api.gax.httpjson;

import com.google.api.core.BetaApi;

/**
* An exception thrown when a protobuf message cannot be serialized/deserialized for REST
* interactions.
*/
@BetaApi
public class RestSerializationException extends RuntimeException {

private static final long serialVersionUID = -6485633460933364916L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
*
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@BetaApi
public class OperationsClient implements BackgroundResource {
private final OperationsSettings settings;
private final OperationsStub stub;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import static com.google.api.gax.httpjson.longrunning.OperationsClient.ListOperationsPagedResponse;

import com.google.api.core.ApiFunction;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
Expand Down Expand Up @@ -84,7 +83,6 @@
* OperationsSettings operationsSettings = operationsSettingsBuilder.build();
* }</pre>
*/
@BetaApi
public class OperationsSettings extends ClientSettings<OperationsSettings> {

/** Returns the object with the settings used for calls to listOperations. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/
package com.google.api.gax.httpjson.longrunning.stub;

import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.httpjson.HttpJsonCallSettings;
import com.google.api.gax.httpjson.HttpJsonCallableFactory;
Expand All @@ -49,7 +48,6 @@
*
* <p>This class is for advanced usage.
*/
@BetaApi
public class HttpJsonOperationsCallableFactory
implements HttpJsonStubCallableFactory<Operation, BackgroundResource> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ public interface ApiCallContext extends RetryingContext {
ApiCallContext merge(ApiCallContext inputCallContext);

/** Return a new ApiCallContext with the extraHeaders merged into the present instance. */
@BetaApi("The surface for extra headers is not stable yet and may change in the future.")
ApiCallContext withExtraHeaders(Map<String, List<String>> extraHeaders);

/** Return the extra headers set for this context. */
Expand Down