Class ProtoMessageRequestFormatter<RequestT> (2.51.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

Name Description
RequestT

Static Methods

<RequestT>newBuilder()

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

Methods

getAdditionalPathTemplates()

public List<PathTemplate> getAdditionalPathTemplates()

Additional (alternative) path templates for endpoint URL path.

Returns
Type Description
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
Name Description
apiMessage RequestT

Request object to extract fields from

Returns
Type Description
String

Path of a matching valid URL or the default Path URL

getPathTemplate()

public PathTemplate getPathTemplate()

Path template for endpoint URL path.

Returns
Type Description
com.google.api.pathtemplate.PathTemplate

getQueryParamNames(RequestT apiMessage)

public Map<String,List<String>> getQueryParamNames(RequestT apiMessage)
Parameter
Name Description
apiMessage RequestT
Returns
Type Description
Map<String,List<String>>

getRequestBody(RequestT apiMessage)

public String getRequestBody(RequestT apiMessage)
Parameter
Name Description
apiMessage RequestT
Returns
Type Description
String

toBuilder()

public ProtoMessageRequestFormatter.Builder<RequestT> toBuilder()
Returns
Type Description
Builder<RequestT>