AppIdentityCredential credential = new AppIdentityCredential.Builder(scopes).build();
GoogleClientRequestInitializer initializer = new CommonGoogleJsonClientRequestInitializer() {
@SuppressWarnings("unused")
public void initialize(
@SuppressWarnings("rawtypes") AbstractGoogleJsonClientRequest request) {
@SuppressWarnings("rawtypes")
BigqueryRequest bigqueryRequest = (BigqueryRequest) request;
bigqueryRequest.setPrettyPrint(true);
}
};
return new Bigquery.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential)
.setHttpRequestInitializer(credential).setGoogleClientRequestInitializer(initializer)
.build();