Package com.google.api.gax.httpjson
Class ProtoMessageRequestFormatter<RequestT extends com.google.protobuf.Message>
java.lang.Object
com.google.api.gax.httpjson.ProtoMessageRequestFormatter<RequestT>
- All Implemented Interfaces:
HttpRequestFormatter<RequestT>
public class ProtoMessageRequestFormatter<RequestT extends com.google.protobuf.Message>
extends Object
implements HttpRequestFormatter<RequestT>
Creates parts of a HTTP request from a protobuf message.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classProtoMessageRequestFormatter.Builder<RequestT extends com.google.protobuf.Message> -
Method Summary
Modifier and TypeMethodDescriptionAdditional (alternative) path templates for endpoint URL path.Returns the relative URL path created from the path parameters from the given message.Path template for endpoint URL path.getQueryParamNames(RequestT apiMessage) Return a map where each entry is the name of a query param mapped to the values of the param.getRequestBody(RequestT apiMessage) Return the serialized inner request body of the given message.static <RequestT extends com.google.protobuf.Message>
ProtoMessageRequestFormatter.Builder<RequestT>
-
Method Details
-
newBuilder
public static <RequestT extends com.google.protobuf.Message> ProtoMessageRequestFormatter.Builder<RequestT> newBuilder() -
toBuilder
-
getQueryParamNames
Description copied from interface:HttpRequestFormatterReturn a map where each entry is the name of a query param mapped to the values of the param.- Specified by:
getQueryParamNamesin interfaceHttpRequestFormatter<RequestT extends com.google.protobuf.Message>
-
getRequestBody
Description copied from interface:HttpRequestFormatterReturn the serialized inner request body of the given message.- Specified by:
getRequestBodyin interfaceHttpRequestFormatter<RequestT extends com.google.protobuf.Message>
-
getPath
Returns the relative URL path created from the path parameters from the given message. Attempts to match the with the default PathTemplate. If there is not match, it attempts to match with the templates in the additionalPathTemplates.- Specified by:
getPathin interfaceHttpRequestFormatter<RequestT extends com.google.protobuf.Message>- Parameters:
apiMessage- Request object to extract fields from- Returns:
- Path of a matching valid URL or the default Path URL
-
getAdditionalPathTemplates
Description copied from interface:HttpRequestFormatterAdditional (alternative) path templates for endpoint URL path.- Specified by:
getAdditionalPathTemplatesin interfaceHttpRequestFormatter<RequestT extends com.google.protobuf.Message>
-
getPathTemplate
Description copied from interface:HttpRequestFormatterPath template for endpoint URL path.- Specified by:
getPathTemplatein interfaceHttpRequestFormatter<RequestT extends com.google.protobuf.Message>
-