public void deleteSubscription ( String subscriptionId ) throws IOException { checkArgument ( ! subscriptionId . isEmpty ( ) , "Subscription ID cannot be empty." ) ; final URI uri = baseUri . resolve ( String . format ( "/subscriptions/%s" , subscriptionId ) ) ; final Request request = clientHttpRequestFactory . createRequest ( uri , "DELETE" ) ; request . getHeaders ( ) . setContentType ( ContentType . APPLICATION_JSON ) ; try ( final Response response = request . execute ( ) ) { final int status = response . getStatusCode ( ) ; if ( status == 204 ) { LOG . debug ( "Successfully deleted subscription [{}]" , subscriptionId ) ; } } }
Delete subscription based on subscription ID .