From 7c23d2bf21bfd96eb4bca0bc8e52dd439281c0e1 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Thu, 28 Mar 2019 03:39:54 -0700 Subject: [PATCH] Regenerate firestore client (#4767) --- .../v1/stub/GrpcFirestoreAdminStub.java | 84 +++++++++++++++ .../firestore/v1/stub/GrpcFirestoreStub.java | 102 ++++++++++++++++++ .../v1beta1/stub/GrpcFirestoreStub.java | 102 ++++++++++++++++++ .../google-cloud-firestore/synth.metadata | 10 +- 4 files changed, 293 insertions(+), 5 deletions(-) diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java index 216ea01dcca6..a153107ab206 100644 --- a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java @@ -24,7 +24,9 @@ import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcStubCallableFactory; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; import com.google.firestore.admin.v1.CreateIndexRequest; import com.google.firestore.admin.v1.DeleteIndexRequest; import com.google.firestore.admin.v1.ExportDocumentsRequest; @@ -43,6 +45,7 @@ import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; +import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -186,38 +189,119 @@ protected GrpcFirestoreAdminStub( GrpcCallSettings createIndexTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createIndexMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateIndexRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) .build(); GrpcCallSettings listIndexesTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listIndexesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListIndexesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) .build(); GrpcCallSettings getIndexTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getIndexMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetIndexRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) .build(); GrpcCallSettings deleteIndexTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteIndexMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteIndexRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) .build(); GrpcCallSettings importDocumentsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(importDocumentsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ImportDocumentsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) .build(); GrpcCallSettings exportDocumentsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(exportDocumentsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ExportDocumentsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) .build(); GrpcCallSettings getFieldTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getFieldMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetFieldRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) .build(); GrpcCallSettings listFieldsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listFieldsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListFieldsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) .build(); GrpcCallSettings updateFieldTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateFieldMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateFieldRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("field.name", String.valueOf(request.getField().getName())); + return params.build(); + } + }) .build(); this.createIndexCallable = diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreStub.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreStub.java index db590d114028..fdf7098a94f6 100644 --- a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreStub.java +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreStub.java @@ -25,8 +25,10 @@ import com.google.api.gax.grpc.GrpcStubCallableFactory; import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; import com.google.firestore.v1.BatchGetDocumentsRequest; import com.google.firestore.v1.BatchGetDocumentsResponse; import com.google.firestore.v1.BeginTransactionRequest; @@ -53,6 +55,7 @@ import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; +import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -241,6 +244,15 @@ protected GrpcFirestoreStub( GrpcCallSettings getDocumentTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getDocumentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetDocumentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) .build(); GrpcCallSettings listDocumentsTransportSettings = GrpcCallSettings.newBuilder() @@ -253,45 +265,135 @@ protected GrpcFirestoreStub( GrpcCallSettings updateDocumentTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateDocumentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateDocumentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("document.name", String.valueOf(request.getDocument().getName())); + return params.build(); + } + }) .build(); GrpcCallSettings deleteDocumentTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteDocumentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteDocumentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) .build(); GrpcCallSettings batchGetDocumentsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(batchGetDocumentsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(BatchGetDocumentsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("database", String.valueOf(request.getDatabase())); + return params.build(); + } + }) .build(); GrpcCallSettings beginTransactionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(beginTransactionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(BeginTransactionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("database", String.valueOf(request.getDatabase())); + return params.build(); + } + }) .build(); GrpcCallSettings commitTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(commitMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CommitRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("database", String.valueOf(request.getDatabase())); + return params.build(); + } + }) .build(); GrpcCallSettings rollbackTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(rollbackMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(RollbackRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("database", String.valueOf(request.getDatabase())); + return params.build(); + } + }) .build(); GrpcCallSettings runQueryTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(runQueryMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(RunQueryRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) .build(); GrpcCallSettings writeTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(writeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(WriteRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("database", String.valueOf(request.getDatabase())); + return params.build(); + } + }) .build(); GrpcCallSettings listenTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listenMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListenRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("database", String.valueOf(request.getDatabase())); + return params.build(); + } + }) .build(); GrpcCallSettings listCollectionIdsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listCollectionIdsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListCollectionIdsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) .build(); this.getDocumentCallable = diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreStub.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreStub.java index 9df708eae781..8fabcd4b35b3 100644 --- a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreStub.java +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreStub.java @@ -25,8 +25,10 @@ import com.google.api.gax.grpc.GrpcStubCallableFactory; import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; import com.google.firestore.v1beta1.BatchGetDocumentsRequest; import com.google.firestore.v1beta1.BatchGetDocumentsResponse; import com.google.firestore.v1beta1.BeginTransactionRequest; @@ -53,6 +55,7 @@ import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; +import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -241,6 +244,15 @@ protected GrpcFirestoreStub( GrpcCallSettings getDocumentTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getDocumentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetDocumentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) .build(); GrpcCallSettings listDocumentsTransportSettings = GrpcCallSettings.newBuilder() @@ -253,45 +265,135 @@ protected GrpcFirestoreStub( GrpcCallSettings updateDocumentTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateDocumentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateDocumentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("document.name", String.valueOf(request.getDocument().getName())); + return params.build(); + } + }) .build(); GrpcCallSettings deleteDocumentTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteDocumentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteDocumentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) .build(); GrpcCallSettings batchGetDocumentsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(batchGetDocumentsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(BatchGetDocumentsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("database", String.valueOf(request.getDatabase())); + return params.build(); + } + }) .build(); GrpcCallSettings beginTransactionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(beginTransactionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(BeginTransactionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("database", String.valueOf(request.getDatabase())); + return params.build(); + } + }) .build(); GrpcCallSettings commitTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(commitMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CommitRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("database", String.valueOf(request.getDatabase())); + return params.build(); + } + }) .build(); GrpcCallSettings rollbackTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(rollbackMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(RollbackRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("database", String.valueOf(request.getDatabase())); + return params.build(); + } + }) .build(); GrpcCallSettings runQueryTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(runQueryMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(RunQueryRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) .build(); GrpcCallSettings writeTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(writeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(WriteRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("database", String.valueOf(request.getDatabase())); + return params.build(); + } + }) .build(); GrpcCallSettings listenTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listenMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListenRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("database", String.valueOf(request.getDatabase())); + return params.build(); + } + }) .build(); GrpcCallSettings listCollectionIdsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listCollectionIdsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListCollectionIdsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) .build(); this.getDocumentCallable = diff --git a/google-cloud-clients/google-cloud-firestore/synth.metadata b/google-cloud-clients/google-cloud-firestore/synth.metadata index 895ea00dabab..de90cf5870bd 100644 --- a/google-cloud-clients/google-cloud-firestore/synth.metadata +++ b/google-cloud-clients/google-cloud-firestore/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-03-22T15:57:43.978857Z", + "updateTime": "2019-03-28T07:45:57.748956Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.18", - "dockerImage": "googleapis/artman@sha256:e8ac9200640e76d54643f370db71a1556bf254f565ce46b45a467bbcbacbdb37" + "version": "0.16.20", + "dockerImage": "googleapis/artman@sha256:e3c054a2fb85a12481c722af616c7fb6f1d02d862248385eecbec3e4240ebd1e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e2a116ac081210002ec2e634f1f840a453ebd182", - "internalRef": "239695990" + "sha": "6a84b3267b0a95e922608b9891219075047eee29", + "internalRef": "240640999" } } ],