Skip to content

Commit

Permalink
Regenerate firestore client (#4767)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and Praful Makani committed Mar 28, 2019
1 parent a954d42 commit 7c23d2b
Show file tree
Hide file tree
Showing 4 changed files with 293 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -186,38 +189,119 @@ protected GrpcFirestoreAdminStub(
GrpcCallSettings<CreateIndexRequest, Operation> createIndexTransportSettings =
GrpcCallSettings.<CreateIndexRequest, Operation>newBuilder()
.setMethodDescriptor(createIndexMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CreateIndexRequest>() {
@Override
public Map<String, String> extract(CreateIndexRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
})
.build();
GrpcCallSettings<ListIndexesRequest, ListIndexesResponse> listIndexesTransportSettings =
GrpcCallSettings.<ListIndexesRequest, ListIndexesResponse>newBuilder()
.setMethodDescriptor(listIndexesMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListIndexesRequest>() {
@Override
public Map<String, String> extract(ListIndexesRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
})
.build();
GrpcCallSettings<GetIndexRequest, Index> getIndexTransportSettings =
GrpcCallSettings.<GetIndexRequest, Index>newBuilder()
.setMethodDescriptor(getIndexMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetIndexRequest>() {
@Override
public Map<String, String> extract(GetIndexRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings<DeleteIndexRequest, Empty> deleteIndexTransportSettings =
GrpcCallSettings.<DeleteIndexRequest, Empty>newBuilder()
.setMethodDescriptor(deleteIndexMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<DeleteIndexRequest>() {
@Override
public Map<String, String> extract(DeleteIndexRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings<ImportDocumentsRequest, Operation> importDocumentsTransportSettings =
GrpcCallSettings.<ImportDocumentsRequest, Operation>newBuilder()
.setMethodDescriptor(importDocumentsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ImportDocumentsRequest>() {
@Override
public Map<String, String> extract(ImportDocumentsRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings<ExportDocumentsRequest, Operation> exportDocumentsTransportSettings =
GrpcCallSettings.<ExportDocumentsRequest, Operation>newBuilder()
.setMethodDescriptor(exportDocumentsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ExportDocumentsRequest>() {
@Override
public Map<String, String> extract(ExportDocumentsRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings<GetFieldRequest, Field> getFieldTransportSettings =
GrpcCallSettings.<GetFieldRequest, Field>newBuilder()
.setMethodDescriptor(getFieldMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetFieldRequest>() {
@Override
public Map<String, String> extract(GetFieldRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings<ListFieldsRequest, ListFieldsResponse> listFieldsTransportSettings =
GrpcCallSettings.<ListFieldsRequest, ListFieldsResponse>newBuilder()
.setMethodDescriptor(listFieldsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListFieldsRequest>() {
@Override
public Map<String, String> extract(ListFieldsRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
})
.build();
GrpcCallSettings<UpdateFieldRequest, Operation> updateFieldTransportSettings =
GrpcCallSettings.<UpdateFieldRequest, Operation>newBuilder()
.setMethodDescriptor(updateFieldMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<UpdateFieldRequest>() {
@Override
public Map<String, String> extract(UpdateFieldRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("field.name", String.valueOf(request.getField().getName()));
return params.build();
}
})
.build();

this.createIndexCallable =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -241,6 +244,15 @@ protected GrpcFirestoreStub(
GrpcCallSettings<GetDocumentRequest, Document> getDocumentTransportSettings =
GrpcCallSettings.<GetDocumentRequest, Document>newBuilder()
.setMethodDescriptor(getDocumentMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetDocumentRequest>() {
@Override
public Map<String, String> extract(GetDocumentRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings<ListDocumentsRequest, ListDocumentsResponse> listDocumentsTransportSettings =
GrpcCallSettings.<ListDocumentsRequest, ListDocumentsResponse>newBuilder()
Expand All @@ -253,45 +265,135 @@ protected GrpcFirestoreStub(
GrpcCallSettings<UpdateDocumentRequest, Document> updateDocumentTransportSettings =
GrpcCallSettings.<UpdateDocumentRequest, Document>newBuilder()
.setMethodDescriptor(updateDocumentMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<UpdateDocumentRequest>() {
@Override
public Map<String, String> extract(UpdateDocumentRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("document.name", String.valueOf(request.getDocument().getName()));
return params.build();
}
})
.build();
GrpcCallSettings<DeleteDocumentRequest, Empty> deleteDocumentTransportSettings =
GrpcCallSettings.<DeleteDocumentRequest, Empty>newBuilder()
.setMethodDescriptor(deleteDocumentMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<DeleteDocumentRequest>() {
@Override
public Map<String, String> extract(DeleteDocumentRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings<BatchGetDocumentsRequest, BatchGetDocumentsResponse>
batchGetDocumentsTransportSettings =
GrpcCallSettings.<BatchGetDocumentsRequest, BatchGetDocumentsResponse>newBuilder()
.setMethodDescriptor(batchGetDocumentsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<BatchGetDocumentsRequest>() {
@Override
public Map<String, String> extract(BatchGetDocumentsRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("database", String.valueOf(request.getDatabase()));
return params.build();
}
})
.build();
GrpcCallSettings<BeginTransactionRequest, BeginTransactionResponse>
beginTransactionTransportSettings =
GrpcCallSettings.<BeginTransactionRequest, BeginTransactionResponse>newBuilder()
.setMethodDescriptor(beginTransactionMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<BeginTransactionRequest>() {
@Override
public Map<String, String> extract(BeginTransactionRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("database", String.valueOf(request.getDatabase()));
return params.build();
}
})
.build();
GrpcCallSettings<CommitRequest, CommitResponse> commitTransportSettings =
GrpcCallSettings.<CommitRequest, CommitResponse>newBuilder()
.setMethodDescriptor(commitMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CommitRequest>() {
@Override
public Map<String, String> extract(CommitRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("database", String.valueOf(request.getDatabase()));
return params.build();
}
})
.build();
GrpcCallSettings<RollbackRequest, Empty> rollbackTransportSettings =
GrpcCallSettings.<RollbackRequest, Empty>newBuilder()
.setMethodDescriptor(rollbackMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<RollbackRequest>() {
@Override
public Map<String, String> extract(RollbackRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("database", String.valueOf(request.getDatabase()));
return params.build();
}
})
.build();
GrpcCallSettings<RunQueryRequest, RunQueryResponse> runQueryTransportSettings =
GrpcCallSettings.<RunQueryRequest, RunQueryResponse>newBuilder()
.setMethodDescriptor(runQueryMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<RunQueryRequest>() {
@Override
public Map<String, String> extract(RunQueryRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
})
.build();
GrpcCallSettings<WriteRequest, WriteResponse> writeTransportSettings =
GrpcCallSettings.<WriteRequest, WriteResponse>newBuilder()
.setMethodDescriptor(writeMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<WriteRequest>() {
@Override
public Map<String, String> extract(WriteRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("database", String.valueOf(request.getDatabase()));
return params.build();
}
})
.build();
GrpcCallSettings<ListenRequest, ListenResponse> listenTransportSettings =
GrpcCallSettings.<ListenRequest, ListenResponse>newBuilder()
.setMethodDescriptor(listenMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListenRequest>() {
@Override
public Map<String, String> extract(ListenRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("database", String.valueOf(request.getDatabase()));
return params.build();
}
})
.build();
GrpcCallSettings<ListCollectionIdsRequest, ListCollectionIdsResponse>
listCollectionIdsTransportSettings =
GrpcCallSettings.<ListCollectionIdsRequest, ListCollectionIdsResponse>newBuilder()
.setMethodDescriptor(listCollectionIdsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListCollectionIdsRequest>() {
@Override
public Map<String, String> extract(ListCollectionIdsRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
})
.build();

this.getDocumentCallable =
Expand Down
Loading

0 comments on commit 7c23d2b

Please sign in to comment.