private static void insertNewAddressUsingRequest ( AddressClient client , String newAddressName ) throws InterruptedException , ExecutionException { // Begin samplegen code for insertAddress(). ProjectRegionName region = ProjectRegionName . of ( PROJECT_NAME , REGION ) ; Address address = Address . newBuilder ( ) . build ( ) ; InsertAddressHttpRequest request = InsertAddressHttpRequest . newBuilder ( ) . setRegion ( region . toString ( ) ) . setAddressResource ( address ) . build ( ) ; // Do something Operation response = client . insertAddress ( request ) ; // End samplegen code for insertAddress(). System . out . format ( "Result of insert: %s\n" , response . toString ( ) ) ; }
Use an InsertAddressHttpRequest object to make an addresses . insert method call .