Class GoogleAdsResponseMetadata

  • All Implemented Interfaces:
    com.google.api.gax.grpc.ResponseMetadataHandler

    public class GoogleAdsResponseMetadata
    extends com.google.api.gax.grpc.GrpcResponseMetadata
    GoogleAdsResponseMetadata 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());
     
     
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getRequestId()
      Get the request id returned in the RPC headers.
      void onHeaders​(io.grpc.Metadata metadata)  
      • Methods inherited from class com.google.api.gax.grpc.GrpcResponseMetadata

        addHandlers, createContextWithHandlers, getMetadata, getTrailingMetadata, onTrailers
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • REQUEST_ID_HEADER_KEY

        public static final java.lang.String REQUEST_ID_HEADER_KEY
        See Also:
        Constant Field Values
    • Constructor Detail

      • GoogleAdsResponseMetadata

        public GoogleAdsResponseMetadata()
    • Method Detail

      • onHeaders

        public void onHeaders​(io.grpc.Metadata metadata)
        Specified by:
        onHeaders in interface com.google.api.gax.grpc.ResponseMetadataHandler
        Overrides:
        onHeaders in class com.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.