Package com.google.ads.googleads.lib
Class GoogleAdsResponseMetadata
- java.lang.Object
-
- com.google.api.gax.grpc.GrpcResponseMetadata
-
- com.google.ads.googleads.lib.GoogleAdsResponseMetadata
-
- All Implemented Interfaces:
com.google.api.gax.grpc.ResponseMetadataHandler
public class GoogleAdsResponseMetadata extends com.google.api.gax.grpc.GrpcResponseMetadataGoogleAdsResponseMetadata is used to access the response metadata returned by a Google Ads RPC.NOTE: the GoogleAdsResponseMetadata class is not thread-safe and should NOT be re-used for multiple calls. A new instance of GoogleAdsResponseMetadata should be constructed for each call that requires metadata to be accessed.
Example usage:
GoogleAdsResponseMetadata metadata = new GoogleAdsResponseMetadata(); Foo foo = client.getFooCallable().call(getFooRequest, metadata.createContextWithHandlers()); System.out.println("Request id: " + metadata.getRequestId());
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringREQUEST_ID_HEADER_KEY
-
Constructor Summary
Constructors Constructor Description GoogleAdsResponseMetadata()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetRequestId()Get the request id returned in the RPC headers.voidonHeaders(io.grpc.Metadata metadata)
-
-
-
Field Detail
-
REQUEST_ID_HEADER_KEY
public static final java.lang.String REQUEST_ID_HEADER_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
onHeaders
public void onHeaders(io.grpc.Metadata metadata)
- Specified by:
onHeadersin interfacecom.google.api.gax.grpc.ResponseMetadataHandler- Overrides:
onHeadersin classcom.google.api.gax.grpc.GrpcResponseMetadata
-
getRequestId
public java.lang.String getRequestId()
Get the request id returned in the RPC headers. Returns null if the RPC has not completed or no request id was received.
-
-