Class ProtoMessageRequestFormatter<RequestT> (2.37.0)

public class ProtoMessageRequestFormatter<RequestT> implements HttpRequestFormatter<RequestT>

Creates parts of a HTTP request from a protobuf message.

Inheritance

java.lang.Object > ProtoMessageRequestFormatter<RequestT>

Implements

com.google.api.gax.httpjson.HttpRequestFormatter<RequestT>

Type Parameter

NameDescription
RequestT

Static Methods

<RequestT>newBuilder()

public static ProtoMessageRequestFormatter.Builder<RequestT> <RequestT>newBuilder()
Returns
TypeDescription
Builder<RequestT>

Methods

getAdditionalPathTemplates()

public List<PathTemplate> getAdditionalPathTemplates()

Additional (alternative) path templates for endpoint URL path.

Returns
TypeDescription
List<com.google.api.pathtemplate.PathTemplate>

getPath(RequestT apiMessage)

public String getPath(RequestT apiMessage)

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.

Parameter
NameDescription
apiMessageRequestT

Request object to extract fields from

Returns
TypeDescription
String

Path of a matching valid URL or the default Path URL

getPathTemplate()

public PathTemplate getPathTemplate()

Path template for endpoint URL path.

Returns
TypeDescription
com.google.api.pathtemplate.PathTemplate

getQueryParamNames(RequestT apiMessage)

public Map<String,List<String>> getQueryParamNames(RequestT apiMessage)
Parameter
NameDescription
apiMessageRequestT
Returns
TypeDescription
Map<String,List<String>>

getRequestBody(RequestT apiMessage)

public String getRequestBody(RequestT apiMessage)
Parameter
NameDescription
apiMessageRequestT
Returns
TypeDescription
String

toBuilder()

public ProtoMessageRequestFormatter.Builder<RequestT> toBuilder()
Returns
TypeDescription
Builder<RequestT>