From 0518608cc2717d3f736fc3ec1349fdbb4ebd13e4 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt <mrschmidt@google.com> Date: Thu, 20 Feb 2020 15:34:14 -0800 Subject: [PATCH 1/6] Run Synthtool --- synth.metadata | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/synth.metadata b/synth.metadata index 79ac86777..897de9179 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2020-02-08T09:53:03.190760Z", + "updateTime": "2020-02-20T23:33:55.461382Z", "sources": [ { "generator": { @@ -8,13 +8,20 @@ "dockerImage": "googleapis/artman@sha256:6aec9c34db0e4be221cdaf6faba27bdc07cfea846808b3d3b964dfce3a9a0f9b" } }, + { + "git": { + "name": ".", + "remote": "git@github.com:googleapis/java-firestore.git", + "sha": "280707526f8a5fddbbe4c84b19c207e2f21b66b5" + } + }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e7d8a694f4559201e6913f6610069cb08b39274e", - "internalRef": "293903652", - "log": "e7d8a694f4559201e6913f6610069cb08b39274e\nDepend on the latest gapic-generator and resource names plugin.\n\nThis fixes the very old an very annoying bug: https://github.com/googleapis/gapic-generator/pull/3087\n\nPiperOrigin-RevId: 293903652\n\n806b2854a966d55374ee26bb0cef4e30eda17b58\nfix: correct capitalization of Ruby namespaces in SecurityCenter V1p1beta1\n\nPiperOrigin-RevId: 293903613\n\n1b83c92462b14d67a7644e2980f723112472e03a\nPublish annotations and grpc service config for Logging API.\n\nPiperOrigin-RevId: 293893514\n\ne46f761cd6ec15a9e3d5ed4ff321a4bcba8e8585\nGenerate the Bazel build file for recommendengine public api\n\nPiperOrigin-RevId: 293710856\n\n68477017c4173c98addac0373950c6aa9d7b375f\nMake `language_code` optional for UpdateIntentRequest and BatchUpdateIntentsRequest.\n\nThe comments and proto annotations describe this parameter as optional.\n\nPiperOrigin-RevId: 293703548\n\n16f823f578bca4e845a19b88bb9bc5870ea71ab2\nAdd BUILD.bazel files for managedidentities API\n\nPiperOrigin-RevId: 293698246\n\n2f53fd8178c9a9de4ad10fae8dd17a7ba36133f2\nAdd v1p1beta1 config file\n\nPiperOrigin-RevId: 293696729\n\n052b274138fce2be80f97b6dcb83ab343c7c8812\nAdd source field for user event and add field behavior annotations\n\nPiperOrigin-RevId: 293693115\n\n1e89732b2d69151b1b3418fff3d4cc0434f0dded\ndatacatalog: v1beta1 add three new RPCs to gapic v1beta1 config\n\nPiperOrigin-RevId: 293692823\n\n9c8bd09bbdc7c4160a44f1fbab279b73cd7a2337\nchange the name of AccessApproval service to AccessApprovalAdmin\n\nPiperOrigin-RevId: 293690934\n\n2e23b8fbc45f5d9e200572ca662fe1271bcd6760\nAdd ListEntryGroups method, add http bindings to support entry group tagging, and update some comments.\n\nPiperOrigin-RevId: 293666452\n\n0275e38a4ca03a13d3f47a9613aac8c8b0d3f1f2\nAdd proto_package field to managedidentities API. It is needed for APIs that still depend on artman generation.\n\nPiperOrigin-RevId: 293643323\n\n4cdfe8278cb6f308106580d70648001c9146e759\nRegenerating public protos for Data Catalog to add new Custom Type Entry feature.\n\nPiperOrigin-RevId: 293614782\n\n45d2a569ab526a1fad3720f95eefb1c7330eaada\nEnable client generation for v1 ManagedIdentities API.\n\nPiperOrigin-RevId: 293515675\n\n2c17086b77e6f3bcf04a1f65758dfb0c3da1568f\nAdd the Actions on Google common types (//google/actions/type/*).\n\nPiperOrigin-RevId: 293478245\n\n781aadb932e64a12fb6ead7cd842698d99588433\nDialogflow weekly v2/v2beta1 library update:\n- Documentation updates\nImportant updates are also posted at\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 293443396\n\ne2602608c9138c2fca24162720e67f9307c30b95\nDialogflow weekly v2/v2beta1 library update:\n- Documentation updates\nImportant updates are also posted at\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 293442964\n\nc8aef82028d06b7992278fa9294c18570dc86c3d\nAdd cc_proto_library and cc_grpc_library targets for Bigtable protos.\n\nAlso fix indentation of cc_grpc_library targets in Spanner and IAM protos.\n\nPiperOrigin-RevId: 293440538\n\ne2faab04f4cb7f9755072330866689b1943a16e9\ncloudtasks: v2 replace non-standard retry params in gapic config v2\n\nPiperOrigin-RevId: 293424055\n\ndfb4097ea628a8470292c6590a4313aee0c675bd\nerrorreporting: v1beta1 add legacy artman config for php\n\nPiperOrigin-RevId: 293423790\n\nb18aed55b45bfe5b62476292c72759e6c3e573c6\nasset: v1p1beta1 updated comment for `page_size` limit.\n\nPiperOrigin-RevId: 293421386\n\nc9ef36b7956d9859a2fc86ad35fcaa16958ab44f\nbazel: Refactor CI build scripts\n\nPiperOrigin-RevId: 293387911\n\na8ed9d921fdddc61d8467bfd7c1668f0ad90435c\nfix: set Ruby module name for OrgPolicy\n\nPiperOrigin-RevId: 293257997\n\n6c7d28509bd8315de8af0889688ee20099594269\nredis: v1beta1 add UpgradeInstance and connect_mode field to Instance\n\nPiperOrigin-RevId: 293242878\n\nae0abed4fcb4c21f5cb67a82349a049524c4ef68\nredis: v1 add connect_mode field to Instance\n\nPiperOrigin-RevId: 293241914\n\n3f7a0d29b28ee9365771da2b66edf7fa2b4e9c56\nAdds service config definition for bigqueryreservation v1beta1\n\nPiperOrigin-RevId: 293234418\n\n0c88168d5ed6fe353a8cf8cbdc6bf084f6bb66a5\naddition of BUILD & configuration for accessapproval v1\n\nPiperOrigin-RevId: 293219198\n\n39bedc2e30f4778ce81193f6ba1fec56107bcfc4\naccessapproval: v1 publish protos\n\nPiperOrigin-RevId: 293167048\n\n69d9945330a5721cd679f17331a78850e2618226\nAdd file-level `Session` resource definition\n\nPiperOrigin-RevId: 293080182\n\nf6a1a6b417f39694275ca286110bc3c1ca4db0dc\nAdd file-level `Session` resource definition\n\nPiperOrigin-RevId: 293080178\n\n29d40b78e3dc1579b0b209463fbcb76e5767f72a\nExpose managedidentities/v1beta1/ API for client library usage.\n\nPiperOrigin-RevId: 292979741\n\na22129a1fb6e18056d576dfb7717aef74b63734a\nExpose managedidentities/v1/ API for client library usage.\n\nPiperOrigin-RevId: 292968186\n\n" + "sha": "3eaaaf8626ce5b0c0bc7eee05e143beffa373b01", + "internalRef": "296274723", + "log": "3eaaaf8626ce5b0c0bc7eee05e143beffa373b01\nAdd BUILD.bazel for v1 secretmanager.googleapis.com\n\nPiperOrigin-RevId: 296274723\n\ne76149c3d992337f85eeb45643106aacae7ede82\nMove securitycenter v1 to use generate from annotations.\n\nPiperOrigin-RevId: 296266862\n\n203740c78ac69ee07c3bf6be7408048751f618f8\nAdd StackdriverLoggingConfig field to Cloud Tasks v2 API.\n\nPiperOrigin-RevId: 296256388\n\ne4117d5e9ed8bbca28da4a60a94947ca51cb2083\nCreate a Bazel BUILD file for the google.actions.type export.\n\nPiperOrigin-RevId: 296212567\n\na9639a0a9854fd6e1be08bba1ac3897f4f16cb2f\nAdd secretmanager.googleapis.com v1 protos\n\nPiperOrigin-RevId: 295983266\n\nce4f4c21d9dd2bfab18873a80449b9d9851efde8\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295861722\n\ncb61d6c2d070b589980c779b68ffca617f789116\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295855449\n\nab2685d8d3a0e191dc8aef83df36773c07cb3d06\nfix: Dataproc v1 - AutoscalingPolicy annotation\n\nThis adds the second resource name pattern to the\nAutoscalingPolicy resource.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 295738415\n\n8a1020bf6828f6e3c84c3014f2c51cb62b739140\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295286165\n\n5cfa105206e77670369e4b2225597386aba32985\nAdd service control related proto build rule.\n\nPiperOrigin-RevId: 295262088\n\nee4dddf805072004ab19ac94df2ce669046eec26\nmonitoring v3: Add prefix \"https://cloud.google.com/\" into the link for global access\ncl 295167522, get ride of synth.py hacks\n\nPiperOrigin-RevId: 295238095\n\nd9835e922ea79eed8497db270d2f9f85099a519c\nUpdate some minor docs changes about user event proto\n\nPiperOrigin-RevId: 295185610\n\n5f311e416e69c170243de722023b22f3df89ec1c\nfix: use correct PHP package name in gapic configuration\n\nPiperOrigin-RevId: 295161330\n\n6cdd74dcdb071694da6a6b5a206e3a320b62dd11\npubsub: v1 add client config annotations and retry config\n\nPiperOrigin-RevId: 295158776\n\n5169f46d9f792e2934d9fa25c36d0515b4fd0024\nAdded cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295026522\n\n56b55aa8818cd0a532a7d779f6ef337ba809ccbd\nFix: Resource annotations for CreateTimeSeriesRequest and ListTimeSeriesRequest should refer to valid resources. TimeSeries is not a named resource.\n\nPiperOrigin-RevId: 294931650\n\n0646bc775203077226c2c34d3e4d50cc4ec53660\nRemove unnecessary languages from bigquery-related artman configuration files.\n\nPiperOrigin-RevId: 294809380\n\n8b78aa04382e3d4147112ad6d344666771bb1909\nUpdate backend.proto for schemes and protocol\n\nPiperOrigin-RevId: 294788800\n\n80b8f8b3de2359831295e24e5238641a38d8488f\nAdds artman config files for bigquerystorage endpoints v1beta2, v1alpha2, v1\n\nPiperOrigin-RevId: 294763931\n\n2c17ac33b226194041155bb5340c3f34733f1b3a\nAdd parameter to sample generated for UpdateInstance. Related to https://github.com/googleapis/python-redis/issues/4\n\nPiperOrigin-RevId: 294734008\n\nd5e8a8953f2acdfe96fb15e85eb2f33739623957\nMove bigquery datatransfer to gapic v2.\n\nPiperOrigin-RevId: 294703703\n\nefd36705972cfcd7d00ab4c6dfa1135bafacd4ae\nfix: Add two annotations that we missed.\n\nPiperOrigin-RevId: 294664231\n\n8a36b928873ff9c05b43859b9d4ea14cd205df57\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1beta2).\n\nPiperOrigin-RevId: 294459768\n\nc7a3caa2c40c49f034a3c11079dd90eb24987047\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1).\n\nPiperOrigin-RevId: 294456889\n\n5006247aa157e59118833658084345ee59af7c09\nFix: Make deprecated fields optional\nFix: Deprecate SetLoggingServiceRequest.zone in line with the comments\nFeature: Add resource name method signatures where appropriate\n\nPiperOrigin-RevId: 294383128\n\neabba40dac05c5cbe0fca3a35761b17e372036c4\nFix: C# and PHP package/namespace capitalization for BigQuery Storage v1.\n\nPiperOrigin-RevId: 294382444\n\nf8d9a858a7a55eba8009a23aa3f5cc5fe5e88dde\nfix: artman configuration file for bigtable-admin\n\nPiperOrigin-RevId: 294322616\n\n0f29555d1cfcf96add5c0b16b089235afbe9b1a9\nAPI definition for (not-yet-launched) GCS gRPC.\n\nPiperOrigin-RevId: 294321472\n\nfcc86bee0e84dc11e9abbff8d7c3529c0626f390\nfix: Bigtable Admin v2\n\nChange LRO metadata from PartialUpdateInstanceMetadata\nto UpdateInstanceMetadata. (Otherwise, it will not build.)\n\nPiperOrigin-RevId: 294264582\n\n6d9361eae2ebb3f42d8c7ce5baf4bab966fee7c0\nrefactor: Add annotations to Bigtable Admin v2.\n\nPiperOrigin-RevId: 294243406\n\nad7616f3fc8e123451c8b3a7987bc91cea9e6913\nFix: Resource type in CreateLogMetricRequest should use logging.googleapis.com.\nFix: ListLogEntries should have a method signature for convenience of calling it.\n\nPiperOrigin-RevId: 294222165\n\n63796fcbb08712676069e20a3e455c9f7aa21026\nFix: Remove extraneous resource definition for cloudkms.googleapis.com/CryptoKey.\n\nPiperOrigin-RevId: 294176658\n\n" } }, { From aee6f6cc32c554a33ef6f7b428869c69177c70a5 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt <mrschmidt@google.com> Date: Thu, 20 Feb 2020 15:34:37 -0800 Subject: [PATCH 2/6] Enable GAPIC generation for v1beta1 --- synth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synth.py b/synth.py index f1504f800..78036b133 100644 --- a/synth.py +++ b/synth.py @@ -114,7 +114,7 @@ def generate_client(service, version, config_path, package, include_gapic=True): version='v1beta1', config_path='/google/firestore/artman_firestore.yaml', package='com.google.firestore.v1beta1', - include_gapic=False + include_gapic=True ) common_templates = gcp.CommonTemplates() From b791692e6417a4d0c043ac46e54f290235b7498d Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt <mrschmidt@google.com> Date: Thu, 20 Feb 2020 15:36:15 -0800 Subject: [PATCH 3/6] Re-run synthtool --- .../firestore/v1beta1/FirestoreClient.java | 25 +-- .../firestore/v1beta1/FirestoreSettings.java | 10 +- .../cloud/firestore/v1beta1/package-info.java | 2 +- .../firestore/v1beta1/stub/FirestoreStub.java | 2 +- .../v1beta1/stub/FirestoreStubSettings.java | 10 +- .../stub/GrpcFirestoreCallableFactory.java | 2 +- .../v1beta1/stub/GrpcFirestoreStub.java | 2 +- .../v1beta1/FirestoreClientTest.java | 175 +++++++++++++++++- .../firestore/v1beta1/MockFirestore.java | 2 +- .../firestore/v1beta1/MockFirestoreImpl.java | 2 +- synth.metadata | 7 +- 11 files changed, 207 insertions(+), 32 deletions(-) diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreClient.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreClient.java index 3fe59e27e..2b15d2f5d 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreClient.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -395,7 +395,8 @@ public final UnaryCallable<CreateDocumentRequest, Document> createDocumentCallab * } * </code></pre> * - * @param document The updated document. Creates the document if it does not already exist. + * @param document Required. The updated document. Creates the document if it does not already + * exist. * @param updateMask The fields to update. None of the field paths in the mask may contain a * reserved name. * <p>If the document exists on the server and has fields not referenced in the mask, they are @@ -404,7 +405,6 @@ public final UnaryCallable<CreateDocumentRequest, Document> createDocumentCallab * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Document updateDocument(Document document, DocumentMask updateMask) { - UpdateDocumentRequest request = UpdateDocumentRequest.newBuilder().setDocument(document).setUpdateMask(updateMask).build(); return updateDocument(request); @@ -472,12 +472,11 @@ public final UnaryCallable<UpdateDocumentRequest, Document> updateDocumentCallab * } * </code></pre> * - * @param name The resource name of the Document to delete. In the format: + * @param name Required. The resource name of the Document to delete. In the format: * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteDocument(AnyPathName name) { - DeleteDocumentRequest request = DeleteDocumentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); deleteDocument(request); @@ -496,12 +495,11 @@ public final void deleteDocument(AnyPathName name) { * } * </code></pre> * - * @param name The resource name of the Document to delete. In the format: + * @param name Required. The resource name of the Document to delete. In the format: * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteDocument(String name) { - DeleteDocumentRequest request = DeleteDocumentRequest.newBuilder().setName(name).build(); deleteDocument(request); } @@ -594,12 +592,11 @@ public final UnaryCallable<DeleteDocumentRequest, Empty> deleteDocumentCallable( * } * </code></pre> * - * @param database The database name. In the format: + * @param database Required. The database name. In the format: * `projects/{project_id}/databases/{database_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final BeginTransactionResponse beginTransaction(String database) { - BeginTransactionRequest request = BeginTransactionRequest.newBuilder().setDatabase(database).build(); return beginTransaction(request); @@ -665,14 +662,13 @@ public final BeginTransactionResponse beginTransaction(BeginTransactionRequest r * } * </code></pre> * - * @param database The database name. In the format: + * @param database Required. The database name. In the format: * `projects/{project_id}/databases/{database_id}`. * @param writes The writes to apply. * <p>Always executed atomically and in order. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final CommitResponse commit(String database, List<Write> writes) { - CommitRequest request = CommitRequest.newBuilder().setDatabase(database).addAllWrites(writes).build(); return commit(request); @@ -741,13 +737,12 @@ public final UnaryCallable<CommitRequest, CommitResponse> commitCallable() { * } * </code></pre> * - * @param database The database name. In the format: + * @param database Required. The database name. In the format: * `projects/{project_id}/databases/{database_id}`. - * @param transaction The transaction to roll back. + * @param transaction Required. The transaction to roll back. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void rollback(String database, ByteString transaction) { - RollbackRequest request = RollbackRequest.newBuilder().setDatabase(database).setTransaction(transaction).build(); rollback(request); @@ -893,7 +888,7 @@ public final BidiStreamingCallable<ListenRequest, ListenResponse> listenCallable * } * </code></pre> * - * @param parent The parent document. In the format: + * @param parent Required. The parent document. In the format: * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` * @throws com.google.api.gax.rpc.ApiException if the remote call fails diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreSettings.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreSettings.java index e43728d8b..49a6cc12a 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreSettings.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,8 +80,12 @@ * <code> * FirestoreSettings.Builder firestoreSettingsBuilder = * FirestoreSettings.newBuilder(); - * firestoreSettingsBuilder.updateDocumentSettings().getRetrySettings().toBuilder() - * .setTotalTimeout(Duration.ofSeconds(30)); + * firestoreSettingsBuilder + * .updateDocumentSettings() + * .setRetrySettings( + * firestoreSettingsBuilder.updateDocumentSettings().getRetrySettings().toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); * FirestoreSettings firestoreSettings = firestoreSettingsBuilder.build(); * </code> * </pre> diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/package-info.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/package-info.java index 310891f29..c9ce16acf 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/package-info.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStub.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStub.java index 18fb6c735..5906ff98d 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStub.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStubSettings.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStubSettings.java index 12caf88b8..edbe88a66 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStubSettings.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -95,8 +95,12 @@ * <code> * FirestoreStubSettings.Builder firestoreSettingsBuilder = * FirestoreStubSettings.newBuilder(); - * firestoreSettingsBuilder.updateDocumentSettings().getRetrySettings().toBuilder() - * .setTotalTimeout(Duration.ofSeconds(30)); + * firestoreSettingsBuilder + * .updateDocumentSettings() + * .setRetrySettings( + * firestoreSettingsBuilder.updateDocumentSettings().getRetrySettings().toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); * FirestoreStubSettings firestoreSettings = firestoreSettingsBuilder.build(); * </code> * </pre> diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreCallableFactory.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreCallableFactory.java index 9dcce3a5c..8a321d336 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreCallableFactory.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreStub.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreStub.java index 3c3b1d900..789d7806e 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreStub.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/FirestoreClientTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/FirestoreClientTest.java index f2635c0a4..09a3cf899 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/FirestoreClientTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/FirestoreClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package com.google.cloud.firestore.v1beta1; import static com.google.cloud.firestore.v1beta1.FirestoreClient.ListCollectionIdsPagedResponse; +import static com.google.cloud.firestore.v1beta1.FirestoreClient.ListDocumentsPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.grpc.GaxGrpcProperties; @@ -37,12 +38,16 @@ import com.google.firestore.v1beta1.BeginTransactionResponse; import com.google.firestore.v1beta1.CommitRequest; import com.google.firestore.v1beta1.CommitResponse; +import com.google.firestore.v1beta1.CreateDocumentRequest; import com.google.firestore.v1beta1.DatabaseRootName; import com.google.firestore.v1beta1.DeleteDocumentRequest; import com.google.firestore.v1beta1.Document; import com.google.firestore.v1beta1.DocumentMask; +import com.google.firestore.v1beta1.GetDocumentRequest; import com.google.firestore.v1beta1.ListCollectionIdsRequest; import com.google.firestore.v1beta1.ListCollectionIdsResponse; +import com.google.firestore.v1beta1.ListDocumentsRequest; +import com.google.firestore.v1beta1.ListDocumentsResponse; import com.google.firestore.v1beta1.ListenRequest; import com.google.firestore.v1beta1.ListenResponse; import com.google.firestore.v1beta1.RollbackRequest; @@ -108,6 +113,174 @@ public void tearDown() throws Exception { client.close(); } + @Test + @SuppressWarnings("all") + public void getDocumentTest() { + String name2 = "name2-1052831874"; + Document expectedResponse = Document.newBuilder().setName(name2).build(); + mockFirestore.addResponse(expectedResponse); + + AnyPathName name = AnyPathName.of("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]"); + GetDocumentRequest request = GetDocumentRequest.newBuilder().setName(name.toString()).build(); + + Document actualResponse = client.getDocument(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List<AbstractMessage> actualRequests = mockFirestore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDocumentRequest actualRequest = (GetDocumentRequest) actualRequests.get(0); + + Assert.assertEquals(name, AnyPathName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getDocumentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestore.addException(exception); + + try { + AnyPathName name = AnyPathName.of("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]"); + GetDocumentRequest request = GetDocumentRequest.newBuilder().setName(name.toString()).build(); + + client.getDocument(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listDocumentsTest() { + String nextPageToken = ""; + Document documentsElement = Document.newBuilder().build(); + List<Document> documents = Arrays.asList(documentsElement); + ListDocumentsResponse expectedResponse = + ListDocumentsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllDocuments(documents) + .build(); + mockFirestore.addResponse(expectedResponse); + + String formattedParent = + AnyPathName.format("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]"); + String collectionId = "collectionId-821242276"; + ListDocumentsRequest request = + ListDocumentsRequest.newBuilder() + .setParent(formattedParent) + .setCollectionId(collectionId) + .build(); + + ListDocumentsPagedResponse pagedListResponse = client.listDocuments(request); + + List<Document> resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDocumentsList().get(0), resources.get(0)); + + List<AbstractMessage> actualRequests = mockFirestore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDocumentsRequest actualRequest = (ListDocumentsRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(collectionId, actualRequest.getCollectionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listDocumentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestore.addException(exception); + + try { + String formattedParent = + AnyPathName.format("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]"); + String collectionId = "collectionId-821242276"; + ListDocumentsRequest request = + ListDocumentsRequest.newBuilder() + .setParent(formattedParent) + .setCollectionId(collectionId) + .build(); + + client.listDocuments(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createDocumentTest() { + String name = "name3373707"; + Document expectedResponse = Document.newBuilder().setName(name).build(); + mockFirestore.addResponse(expectedResponse); + + String formattedParent = + AnyPathName.format("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]"); + String collectionId = "collectionId-821242276"; + String documentId = "documentId506676927"; + Document document = Document.newBuilder().build(); + CreateDocumentRequest request = + CreateDocumentRequest.newBuilder() + .setParent(formattedParent) + .setCollectionId(collectionId) + .setDocumentId(documentId) + .setDocument(document) + .build(); + + Document actualResponse = client.createDocument(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List<AbstractMessage> actualRequests = mockFirestore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDocumentRequest actualRequest = (CreateDocumentRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(collectionId, actualRequest.getCollectionId()); + Assert.assertEquals(documentId, actualRequest.getDocumentId()); + Assert.assertEquals(document, actualRequest.getDocument()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createDocumentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestore.addException(exception); + + try { + String formattedParent = + AnyPathName.format("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]"); + String collectionId = "collectionId-821242276"; + String documentId = "documentId506676927"; + Document document = Document.newBuilder().build(); + CreateDocumentRequest request = + CreateDocumentRequest.newBuilder() + .setParent(formattedParent) + .setCollectionId(collectionId) + .setDocumentId(documentId) + .setDocument(document) + .build(); + + client.createDocument(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void updateDocumentTest() { diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/MockFirestore.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/MockFirestore.java index 1e478f8c4..2343b988e 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/MockFirestore.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/MockFirestore.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/MockFirestoreImpl.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/MockFirestoreImpl.java index 8edf1fc8b..c4e8e65a3 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/MockFirestoreImpl.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/MockFirestoreImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/synth.metadata b/synth.metadata index 897de9179..46799933e 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2020-02-20T23:33:55.461382Z", + "updateTime": "2020-02-20T23:35:57.062926Z", "sources": [ { "generator": { @@ -12,7 +12,7 @@ "git": { "name": ".", "remote": "git@github.com:googleapis/java-firestore.git", - "sha": "280707526f8a5fddbbe4c84b19c207e2f21b66b5" + "sha": "aee6f6cc32c554a33ef6f7b428869c69177c70a5" } }, { @@ -20,8 +20,7 @@ "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", "sha": "3eaaaf8626ce5b0c0bc7eee05e143beffa373b01", - "internalRef": "296274723", - "log": "3eaaaf8626ce5b0c0bc7eee05e143beffa373b01\nAdd BUILD.bazel for v1 secretmanager.googleapis.com\n\nPiperOrigin-RevId: 296274723\n\ne76149c3d992337f85eeb45643106aacae7ede82\nMove securitycenter v1 to use generate from annotations.\n\nPiperOrigin-RevId: 296266862\n\n203740c78ac69ee07c3bf6be7408048751f618f8\nAdd StackdriverLoggingConfig field to Cloud Tasks v2 API.\n\nPiperOrigin-RevId: 296256388\n\ne4117d5e9ed8bbca28da4a60a94947ca51cb2083\nCreate a Bazel BUILD file for the google.actions.type export.\n\nPiperOrigin-RevId: 296212567\n\na9639a0a9854fd6e1be08bba1ac3897f4f16cb2f\nAdd secretmanager.googleapis.com v1 protos\n\nPiperOrigin-RevId: 295983266\n\nce4f4c21d9dd2bfab18873a80449b9d9851efde8\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295861722\n\ncb61d6c2d070b589980c779b68ffca617f789116\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295855449\n\nab2685d8d3a0e191dc8aef83df36773c07cb3d06\nfix: Dataproc v1 - AutoscalingPolicy annotation\n\nThis adds the second resource name pattern to the\nAutoscalingPolicy resource.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 295738415\n\n8a1020bf6828f6e3c84c3014f2c51cb62b739140\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295286165\n\n5cfa105206e77670369e4b2225597386aba32985\nAdd service control related proto build rule.\n\nPiperOrigin-RevId: 295262088\n\nee4dddf805072004ab19ac94df2ce669046eec26\nmonitoring v3: Add prefix \"https://cloud.google.com/\" into the link for global access\ncl 295167522, get ride of synth.py hacks\n\nPiperOrigin-RevId: 295238095\n\nd9835e922ea79eed8497db270d2f9f85099a519c\nUpdate some minor docs changes about user event proto\n\nPiperOrigin-RevId: 295185610\n\n5f311e416e69c170243de722023b22f3df89ec1c\nfix: use correct PHP package name in gapic configuration\n\nPiperOrigin-RevId: 295161330\n\n6cdd74dcdb071694da6a6b5a206e3a320b62dd11\npubsub: v1 add client config annotations and retry config\n\nPiperOrigin-RevId: 295158776\n\n5169f46d9f792e2934d9fa25c36d0515b4fd0024\nAdded cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295026522\n\n56b55aa8818cd0a532a7d779f6ef337ba809ccbd\nFix: Resource annotations for CreateTimeSeriesRequest and ListTimeSeriesRequest should refer to valid resources. TimeSeries is not a named resource.\n\nPiperOrigin-RevId: 294931650\n\n0646bc775203077226c2c34d3e4d50cc4ec53660\nRemove unnecessary languages from bigquery-related artman configuration files.\n\nPiperOrigin-RevId: 294809380\n\n8b78aa04382e3d4147112ad6d344666771bb1909\nUpdate backend.proto for schemes and protocol\n\nPiperOrigin-RevId: 294788800\n\n80b8f8b3de2359831295e24e5238641a38d8488f\nAdds artman config files for bigquerystorage endpoints v1beta2, v1alpha2, v1\n\nPiperOrigin-RevId: 294763931\n\n2c17ac33b226194041155bb5340c3f34733f1b3a\nAdd parameter to sample generated for UpdateInstance. Related to https://github.com/googleapis/python-redis/issues/4\n\nPiperOrigin-RevId: 294734008\n\nd5e8a8953f2acdfe96fb15e85eb2f33739623957\nMove bigquery datatransfer to gapic v2.\n\nPiperOrigin-RevId: 294703703\n\nefd36705972cfcd7d00ab4c6dfa1135bafacd4ae\nfix: Add two annotations that we missed.\n\nPiperOrigin-RevId: 294664231\n\n8a36b928873ff9c05b43859b9d4ea14cd205df57\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1beta2).\n\nPiperOrigin-RevId: 294459768\n\nc7a3caa2c40c49f034a3c11079dd90eb24987047\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1).\n\nPiperOrigin-RevId: 294456889\n\n5006247aa157e59118833658084345ee59af7c09\nFix: Make deprecated fields optional\nFix: Deprecate SetLoggingServiceRequest.zone in line with the comments\nFeature: Add resource name method signatures where appropriate\n\nPiperOrigin-RevId: 294383128\n\neabba40dac05c5cbe0fca3a35761b17e372036c4\nFix: C# and PHP package/namespace capitalization for BigQuery Storage v1.\n\nPiperOrigin-RevId: 294382444\n\nf8d9a858a7a55eba8009a23aa3f5cc5fe5e88dde\nfix: artman configuration file for bigtable-admin\n\nPiperOrigin-RevId: 294322616\n\n0f29555d1cfcf96add5c0b16b089235afbe9b1a9\nAPI definition for (not-yet-launched) GCS gRPC.\n\nPiperOrigin-RevId: 294321472\n\nfcc86bee0e84dc11e9abbff8d7c3529c0626f390\nfix: Bigtable Admin v2\n\nChange LRO metadata from PartialUpdateInstanceMetadata\nto UpdateInstanceMetadata. (Otherwise, it will not build.)\n\nPiperOrigin-RevId: 294264582\n\n6d9361eae2ebb3f42d8c7ce5baf4bab966fee7c0\nrefactor: Add annotations to Bigtable Admin v2.\n\nPiperOrigin-RevId: 294243406\n\nad7616f3fc8e123451c8b3a7987bc91cea9e6913\nFix: Resource type in CreateLogMetricRequest should use logging.googleapis.com.\nFix: ListLogEntries should have a method signature for convenience of calling it.\n\nPiperOrigin-RevId: 294222165\n\n63796fcbb08712676069e20a3e455c9f7aa21026\nFix: Remove extraneous resource definition for cloudkms.googleapis.com/CryptoKey.\n\nPiperOrigin-RevId: 294176658\n\n" + "internalRef": "296274723" } }, { From 780aca3341bf91563821de2b6a431190bbd25ea5 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt <mrschmidt@google.com> Date: Thu, 20 Feb 2020 15:42:51 -0800 Subject: [PATCH 4/6] Add replacement configuration --- synth.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/synth.py b/synth.py index 78036b133..672b2dd04 100644 --- a/synth.py +++ b/synth.py @@ -126,3 +126,25 @@ def generate_client(service, version, config_path, package, include_gapic=True): # due to the default project running datastore '.kokoro/presubmit/integration.cfg' ]) + +# Mark v1beta1 as deprecated +s.replace( + "google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreClient.java", + "public class FirestoreClient", + "@Deprecated\npublic class FirestoreClient" +) +s.replace( + "google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreClient.java", + "\\*\\/\\n@Generated\\(\"by gapic-generator\"\\)", + "* @deprecated Use com.google.cloud.firestore.v1.FirestoreClient instead\n */\n@Generated(\"by gapic-generator\")" +) +s.replace( + "google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreSettings.java", + "public class FirestoreSettings", + "@Deprecated\npublic class FirestoreSettings" +) +s.replace( + "google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreSettings.java", + " \\*\\/\\n@Generated\\(\"by gapic-generator\"\\)", + "* @deprecated Use com.google.cloud.firestore.v1.FirestoreSettings instead\n */\n@Generated(\"by gapic-generator\")" +) From 27cc94712935811385e2661086e9917aedc26859 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt <mrschmidt@google.com> Date: Thu, 20 Feb 2020 15:45:13 -0800 Subject: [PATCH 5/6] Re-run synthtool --- .../com/google/cloud/firestore/v1beta1/FirestoreClient.java | 2 ++ .../google/cloud/firestore/v1beta1/FirestoreSettings.java | 2 ++ synth.metadata | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreClient.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreClient.java index 2b15d2f5d..a766ef773 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreClient.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreClient.java @@ -139,9 +139,11 @@ * FirestoreClient.create(firestoreSettings); * </code> * </pre> + * @deprecated Use com.google.cloud.firestore.v1.FirestoreClient instead */ @Generated("by gapic-generator") @BetaApi +@Deprecated public class FirestoreClient implements BackgroundResource { private final FirestoreSettings settings; private final FirestoreStub stub; diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreSettings.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreSettings.java index 49a6cc12a..a5c3553c1 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreSettings.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreSettings.java @@ -89,9 +89,11 @@ * FirestoreSettings firestoreSettings = firestoreSettingsBuilder.build(); * </code> * </pre> +* @deprecated Use com.google.cloud.firestore.v1.FirestoreSettings instead */ @Generated("by gapic-generator") @BetaApi +@Deprecated public class FirestoreSettings extends ClientSettings<FirestoreSettings> { /** Returns the object with the settings used for calls to getDocument. */ public UnaryCallSettings<GetDocumentRequest, Document> getDocumentSettings() { diff --git a/synth.metadata b/synth.metadata index 46799933e..cb5455da8 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2020-02-20T23:35:57.062926Z", + "updateTime": "2020-02-20T23:44:11.323234Z", "sources": [ { "generator": { @@ -11,8 +11,8 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/java-firestore.git", - "sha": "aee6f6cc32c554a33ef6f7b428869c69177c70a5" + "remote": "git@github.com:schmidt-sebastian/java-firestore.git", + "sha": "780aca3341bf91563821de2b6a431190bbd25ea5" } }, { From 209473f30af53203aeba6b2017966ee51ef09a6e Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt <mrschmidt@google.com> Date: Wed, 25 Mar 2020 20:27:45 -0700 Subject: [PATCH 6/6] Fix diff --- synth.metadata | 18 +++++++++++++++++- synth.py | 6 +++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/synth.metadata b/synth.metadata index 0165c9b00..14ed5f1b2 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2020-03-26T03:22:20.679680Z", + "updateTime": "2020-03-26T03:27:35.869486Z", "sources": [ { "git": { @@ -8,6 +8,13 @@ "sha": "d4aa417ed2bba89c2d216900282bddfdafef6128", "internalRef": "303010132" } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "e36822bfa0acb355502dab391b8ef9c4f30208d8" + } } ], "destinations": [ @@ -28,6 +35,15 @@ "language": "java", "generator": "bazel" } + }, + { + "client": { + "source": "googleapis", + "apiName": "firestore", + "apiVersion": "v1beta1", + "language": "java", + "generator": "bazel" + } } ] } \ No newline at end of file diff --git a/synth.py b/synth.py index 2cb78158d..2f2a98d88 100644 --- a/synth.py +++ b/synth.py @@ -137,7 +137,7 @@ def generate_client(service, version, proto_path=None, bazel_target=None, packag s.replace( "google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreClient.java", "\\*\\/\\n@Generated\\(\"by gapic-generator\"\\)", - "* @deprecated Use com.google.cloud.firestore.v1.FirestoreClient instead\n */\n@Generated(\"by gapic-generator\")" + "*\n * @deprecated Use com.google.cloud.firestore.v1.FirestoreClient instead\n */\n@Generated(\"by gapic-generator\")" ) s.replace( "google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreSettings.java", @@ -146,6 +146,6 @@ def generate_client(service, version, proto_path=None, bazel_target=None, packag ) s.replace( "google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreSettings.java", - " \\*\\/\\n@Generated\\(\"by gapic-generator\"\\)", - "* @deprecated Use com.google.cloud.firestore.v1.FirestoreSettings instead\n */\n@Generated(\"by gapic-generator\")" + "\\*\\/\\n@Generated\\(\"by gapic-generator\"\\)", + "*\n * @deprecated Use com.google.cloud.firestore.v1.FirestoreSettings instead\n */\n@Generated(\"by gapic-generator\")" )