diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index a86dc465..3f7432a5 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/repo-automation-bots/owlbot-java:latest - digest: sha256:a9b83a276c82987d284b733713fe86a3c8a2cc457933767eeb2688b882e54c6a + digest: sha256:12cbdc4f137152a1a8b83f50ebc1a4098be0d3baff78b46efaec306f7cfafd13 diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index b841d43d..33fd0b7f 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-functions.git", - "sha": "0d5a65119f95e65ec308eaed769b29a4dbcc75c5" + "sha": "fb36e02e08eef4f11ca50205b20836df6af2e063" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "740366bbb9a7e0f4b77fc75dc26be1d3a376c3e0" + "sha": "3d32990b6f4b57be77455e3ca89e6e21cd0c06b3" } } ] diff --git a/.github/release-please.yml b/.github/release-please.yml index 8ca7f9ca..7bf58076 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1,3 +1,8 @@ bumpMinorPreMajor: true handleGHRelease: true releaseType: java-yoshi +branches: + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-yoshi + branch: java7 diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 6bddd18e..ffd39f6f 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -1,49 +1,44 @@ - -# Whether or not rebase-merging is enabled on this repository. -# Defaults to `true` rebaseMergeAllowed: false - -# Whether or not squash-merging is enabled on this repository. -# Defaults to `true` squashMergeAllowed: true - -# Whether or not PRs are merged with a merge commit on this repository. -# Defaults to `false` mergeCommitAllowed: false - -# Rules for master branch protection branchProtectionRules: -# Identifies the protection rule pattern. Name of the branch to be protected. -# Defaults to `master` -- pattern: master - # Can admins overwrite branch protection. - # Defaults to `true` - isAdminEnforced: true - # Number of approving reviews required to update matching branches. - # Defaults to `1` - requiredApprovingReviewCount: 1 - # Are reviews from code owners required to update matching branches. - # Defaults to `false` - requiresCodeOwnerReviews: true - # Require up to date branches - requiresStrictStatusChecks: false - # List of required status check contexts that must pass for commits to be accepted to matching branches. - requiredStatusCheckContexts: - - "dependencies (8)" - - "dependencies (11)" - - "linkage-monitor" - - "lint" - - "clirr" - - "units (7)" - - "units (8)" - - "units (11)" - - "Kokoro - Test: Integration" - - "cla/google" -# List of explicit permissions to add (additive only) + - pattern: master + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (8) + - dependencies (11) + - linkage-monitor + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - OwlBot Post Processor + - pattern: java7 + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (8) + - dependencies (11) + - linkage-monitor + - lint + - clirr + - units (7) + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - OwlBot Post Processor permissionRules: -- team: yoshi-admins - permission: admin -- team: yoshi-java-admins - permission: admin -- team: yoshi-java - permission: push \ No newline at end of file + - team: yoshi-admins + permission: admin + - team: yoshi-java-admins + permission: admin + - team: yoshi-java + permission: push diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0195b32f..65ae6ecd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [7, 8, 11] + java: [8, 11] steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index c4704b0f..4d84e781 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [2.0.0](https://www.github.com/googleapis/java-functions/compare/v1.2.2...v2.0.0) (2021-08-10) + + +### ⚠ BREAKING CHANGES + +* release gapic-generator-java v2.0.0 (#260) + +### Features + +* release gapic-generator-java v2.0.0 ([#260](https://www.github.com/googleapis/java-functions/issues/260)) ([f38a61d](https://www.github.com/googleapis/java-functions/commit/f38a61db3c3b3781c687b57be90ddafcd1e4abdf)) + + +### Bug Fixes + +* owlbot post-processor should generate README ([#1154](https://www.github.com/googleapis/java-functions/issues/1154)) ([#245](https://www.github.com/googleapis/java-functions/issues/245)) ([0d67a94](https://www.github.com/googleapis/java-functions/commit/0d67a94b8eb78900028e0e5568917654c4c6d4fa)), closes [#1146](https://www.github.com/googleapis/java-functions/issues/1146) [#1147](https://www.github.com/googleapis/java-functions/issues/1147) +* Updating behavior of source_upload_url during Get/List function calls ([#265](https://www.github.com/googleapis/java-functions/issues/265)) ([dce91f4](https://www.github.com/googleapis/java-functions/commit/dce91f4f65360cfc35d03364aa32eab03f49401f)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2 ([#261](https://www.github.com/googleapis/java-functions/issues/261)) ([0908628](https://www.github.com/googleapis/java-functions/commit/0908628a8927731d0edae4a3b07e9ddc28a4cc3d)) + ### [1.2.2](https://www.github.com/googleapis/java-functions/compare/v1.2.1...v1.2.2) (2021-07-01) diff --git a/README.md b/README.md index ffe8d96d..1726978f 100644 --- a/README.md +++ b/README.md @@ -8,34 +8,42 @@ Java idiomatic client for [Cloud Functions][product-docs]. - [Product Documentation][product-docs] - [Client Library Documentation][javadocs] + ## Quickstart If you are using Maven, add this to your pom.xml file: + ```xml com.google.cloud google-cloud-functions - 1.2.1 + 1.2.2 ``` If you are using Gradle without BOM, add this to your dependencies + ```Groovy -compile 'com.google.cloud:google-cloud-functions:1.2.1' +compile 'com.google.cloud:google-cloud-functions:1.2.2' ``` If you are using SBT, add this to your dependencies + ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-functions" % "1.2.1" +libraryDependencies += "com.google.cloud" % "google-cloud-functions" % "1.2.2" ``` ## Authentication See the [Authentication][authentication] section in the base directory's README. +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired Cloud Functions APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Cloud Functions API calls. + ## Getting Started ### Prerequisites @@ -72,16 +80,57 @@ To get help, follow the instructions in the [shared Troubleshooting document][tr Cloud Functions uses gRPC for the transport layer. -## Java Versions +## Supported Java Versions Java 7 or above is required for using this client. +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + ## Versioning This library follows [Semantic Versioning](http://semver.org/). + ## Contributing @@ -93,6 +142,7 @@ Please note that this project is released with a Contributor Code of Conduct. By this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information. + ## License Apache 2.0 - See [LICENSE][license] for more information. @@ -125,6 +175,9 @@ Java is a registered trademark of Oracle and/or its affiliates. [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-functions.svg [maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-functions&core=gav [authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy [developer-console]: https://console.developers.google.com/ [create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects [cloud-sdk]: https://cloud.google.com/sdk/ @@ -136,3 +189,9 @@ Java is a registered trademark of Oracle and/or its affiliates. [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=cloudfunctions.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/google-cloud-functions-bom/pom.xml b/google-cloud-functions-bom/pom.xml index 3160a32d..60059f28 100644 --- a/google-cloud-functions-bom/pom.xml +++ b/google-cloud-functions-bom/pom.xml @@ -3,12 +3,12 @@ 4.0.0 com.google.cloud google-cloud-functions-bom - 1.2.2 + 2.0.0 pom com.google.cloud google-cloud-shared-config - 0.12.0 + 1.0.0 Google Cloud Functions BOM @@ -43,17 +43,6 @@ true - - - sonatype-nexus-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - - sonatype-nexus-staging - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - The Apache Software License, Version 2.0 @@ -67,17 +56,17 @@ com.google.cloud google-cloud-functions - 1.2.2 + 2.0.0 com.google.api.grpc grpc-google-cloud-functions-v1 - 1.2.2 + 2.0.0 com.google.api.grpc proto-google-cloud-functions-v1 - 1.2.2 + 2.0.0 diff --git a/google-cloud-functions/pom.xml b/google-cloud-functions/pom.xml index e0390877..c1633afb 100644 --- a/google-cloud-functions/pom.xml +++ b/google-cloud-functions/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-functions - 1.2.2 + 2.0.0 jar Google Cloud Functions https://github.com/googleapis/java-functions @@ -11,7 +11,7 @@ com.google.cloud google-cloud-functions-parent - 1.2.2 + 2.0.0 google-cloud-functions diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java index 1c1e3a15..63ab3254 100644 --- a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java @@ -16,7 +16,6 @@ package com.google.cloud.functions.v1; -import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; import com.google.api.core.BetaApi; @@ -1191,12 +1190,7 @@ public static ApiFuture createAsync( ListFunctionsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { - @Override - public ListFunctionsPagedResponse apply(ListFunctionsPage input) { - return new ListFunctionsPagedResponse(input); - } - }, + input -> new ListFunctionsPagedResponse(input), MoreExecutors.directExecutor()); } diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceSettings.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceSettings.java index 27471aff..9b61b1ac 100644 --- a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceSettings.java +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceSettings.java @@ -245,14 +245,13 @@ public CloudFunctionsServiceStubSettings.Builder getStubSettingsBuilder() { return ((CloudFunctionsServiceStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * *

Note: This method does not support applying settings to streaming methods. */ public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { + ApiFunction, Void> settingsUpdater) { super.applyToAllUnaryMethods( getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStubSettings.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStubSettings.java index 06e21fd6..10f032d0 100644 --- a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStubSettings.java +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStubSettings.java @@ -652,14 +652,13 @@ private static Builder initDefaults(Builder builder) { return builder; } - // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * *

Note: This method does not support applying settings to streaming methods. */ public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { + ApiFunction, Void> settingsUpdater) { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/GrpcCloudFunctionsServiceStub.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/GrpcCloudFunctionsServiceStub.java index 5db4ebfa..eced98b4 100644 --- a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/GrpcCloudFunctionsServiceStub.java +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/GrpcCloudFunctionsServiceStub.java @@ -24,7 +24,6 @@ import com.google.api.gax.grpc.GrpcStubCallableFactory; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.functions.v1.CallFunctionRequest; import com.google.cloud.functions.v1.CallFunctionResponse; @@ -52,7 +51,6 @@ 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; @@ -247,78 +245,60 @@ protected GrpcCloudFunctionsServiceStub( GrpcCallSettings.newBuilder() .setMethodDescriptor(listFunctionsMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListFunctionsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings getFunctionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getFunctionMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetFunctionRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings createFunctionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createFunctionMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CreateFunctionRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("location", String.valueOf(request.getLocation())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("location", String.valueOf(request.getLocation())); + return params.build(); }) .build(); GrpcCallSettings updateFunctionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateFunctionMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(UpdateFunctionRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("function.name", String.valueOf(request.getFunction().getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("function.name", String.valueOf(request.getFunction().getName())); + return params.build(); }) .build(); GrpcCallSettings deleteFunctionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteFunctionMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteFunctionRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings callFunctionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(callFunctionMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CallFunctionRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings @@ -326,13 +306,10 @@ public Map extract(CallFunctionRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(generateUploadUrlMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GenerateUploadUrlRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings @@ -340,39 +317,30 @@ public Map extract(GenerateUploadUrlRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(generateDownloadUrlMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GenerateDownloadUrlRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings setIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(setIamPolicyMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(SetIamPolicyRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); }) .build(); GrpcCallSettings getIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getIamPolicyMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetIamPolicyRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); }) .build(); GrpcCallSettings @@ -380,13 +348,10 @@ public Map extract(GetIamPolicyRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(testIamPermissionsMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(TestIamPermissionsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); }) .build(); @@ -543,7 +508,13 @@ public UnaryCallable getIamPolicyCallable() { @Override public final void close() { - shutdown(); + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } } @Override diff --git a/grpc-google-cloud-functions-v1/pom.xml b/grpc-google-cloud-functions-v1/pom.xml index da4f04ef..99cd2137 100644 --- a/grpc-google-cloud-functions-v1/pom.xml +++ b/grpc-google-cloud-functions-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-functions-v1 - 1.2.2 + 2.0.0 grpc-google-cloud-functions-v1 GRPC library for grpc-google-cloud-functions-v1 com.google.cloud google-cloud-functions-parent - 1.2.2 + 2.0.0 diff --git a/java.header b/java.header index 3a9b503a..d0970ba7 100644 --- a/java.header +++ b/java.header @@ -1,5 +1,5 @@ ^/\*$ -^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|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/pom.xml b/pom.xml index 21a9cc19..2ffb638e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-functions-parent pom - 1.2.2 + 2.0.0 Google Cloud Functions Parent https://github.com/googleapis/java-functions @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 0.12.0 + 1.0.0 @@ -41,16 +41,7 @@ https://github.com/googleapis/java-functions/issues GitHub Issues - - - sonatype-nexus-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - - sonatype-nexus-staging - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - + Apache-2.0 @@ -70,23 +61,23 @@ com.google.cloud google-cloud-functions - 1.2.2 + 2.0.0 com.google.api.grpc proto-google-cloud-functions-v1 - 1.2.2 + 2.0.0 com.google.api.grpc grpc-google-cloud-functions-v1 - 1.2.2 + 2.0.0 com.google.cloud google-cloud-shared-dependencies - 1.4.0 + 2.0.0 pom import diff --git a/proto-google-cloud-functions-v1/clirr-ignored-differences.xml b/proto-google-cloud-functions-v1/clirr-ignored-differences.xml index 66846256..fc2a1295 100644 --- a/proto-google-cloud-functions-v1/clirr-ignored-differences.xml +++ b/proto-google-cloud-functions-v1/clirr-ignored-differences.xml @@ -4,6 +4,16 @@ 7012 com/google/cloud/functions/v1/*OrBuilder - * has*(*) + * get*(*) - \ No newline at end of file + + 7012 + com/google/cloud/functions/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/functions/v1/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-functions-v1/pom.xml b/proto-google-cloud-functions-v1/pom.xml index 5a82a953..56ceb2cd 100644 --- a/proto-google-cloud-functions-v1/pom.xml +++ b/proto-google-cloud-functions-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-functions-v1 - 1.2.2 + 2.0.0 proto-google-cloud-functions-v1 PROTO library for proto-google-cloud-functions-v1 com.google.cloud google-cloud-functions-parent - 1.2.2 + 2.0.0 diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunction.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunction.java index 33d2374d..824f91d5 100644 --- a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunction.java +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunction.java @@ -1022,7 +1022,10 @@ public com.google.cloud.functions.v1.SourceRepositoryOrBuilder getSourceReposito * *

    * The Google Cloud Storage signed URL used for source uploading, generated
-   * by [google.cloud.functions.v1.GenerateUploadUrl][]
+   * by calling [google.cloud.functions.v1.GenerateUploadUrl].
+   * The signature is validated on write methods {Create, Update}
+   * The signature is stripped from the Function object on read methods {Get,
+   * List}
    * 
* * string source_upload_url = 16; @@ -1037,7 +1040,10 @@ public boolean hasSourceUploadUrl() { * *
    * The Google Cloud Storage signed URL used for source uploading, generated
-   * by [google.cloud.functions.v1.GenerateUploadUrl][]
+   * by calling [google.cloud.functions.v1.GenerateUploadUrl].
+   * The signature is validated on write methods {Create, Update}
+   * The signature is stripped from the Function object on read methods {Get,
+   * List}
    * 
* * string source_upload_url = 16; @@ -1065,7 +1071,10 @@ public java.lang.String getSourceUploadUrl() { * *
    * The Google Cloud Storage signed URL used for source uploading, generated
-   * by [google.cloud.functions.v1.GenerateUploadUrl][]
+   * by calling [google.cloud.functions.v1.GenerateUploadUrl].
+   * The signature is validated on write methods {Create, Update}
+   * The signature is stripped from the Function object on read methods {Get,
+   * List}
    * 
* * string source_upload_url = 16; @@ -3462,7 +3471,10 @@ public com.google.cloud.functions.v1.SourceRepositoryOrBuilder getSourceReposito * *
      * The Google Cloud Storage signed URL used for source uploading, generated
-     * by [google.cloud.functions.v1.GenerateUploadUrl][]
+     * by calling [google.cloud.functions.v1.GenerateUploadUrl].
+     * The signature is validated on write methods {Create, Update}
+     * The signature is stripped from the Function object on read methods {Get,
+     * List}
      * 
* * string source_upload_url = 16; @@ -3478,7 +3490,10 @@ public boolean hasSourceUploadUrl() { * *
      * The Google Cloud Storage signed URL used for source uploading, generated
-     * by [google.cloud.functions.v1.GenerateUploadUrl][]
+     * by calling [google.cloud.functions.v1.GenerateUploadUrl].
+     * The signature is validated on write methods {Create, Update}
+     * The signature is stripped from the Function object on read methods {Get,
+     * List}
      * 
* * string source_upload_url = 16; @@ -3507,7 +3522,10 @@ public java.lang.String getSourceUploadUrl() { * *
      * The Google Cloud Storage signed URL used for source uploading, generated
-     * by [google.cloud.functions.v1.GenerateUploadUrl][]
+     * by calling [google.cloud.functions.v1.GenerateUploadUrl].
+     * The signature is validated on write methods {Create, Update}
+     * The signature is stripped from the Function object on read methods {Get,
+     * List}
      * 
* * string source_upload_url = 16; @@ -3536,7 +3554,10 @@ public com.google.protobuf.ByteString getSourceUploadUrlBytes() { * *
      * The Google Cloud Storage signed URL used for source uploading, generated
-     * by [google.cloud.functions.v1.GenerateUploadUrl][]
+     * by calling [google.cloud.functions.v1.GenerateUploadUrl].
+     * The signature is validated on write methods {Create, Update}
+     * The signature is stripped from the Function object on read methods {Get,
+     * List}
      * 
* * string source_upload_url = 16; @@ -3558,7 +3579,10 @@ public Builder setSourceUploadUrl(java.lang.String value) { * *
      * The Google Cloud Storage signed URL used for source uploading, generated
-     * by [google.cloud.functions.v1.GenerateUploadUrl][]
+     * by calling [google.cloud.functions.v1.GenerateUploadUrl].
+     * The signature is validated on write methods {Create, Update}
+     * The signature is stripped from the Function object on read methods {Get,
+     * List}
      * 
* * string source_upload_url = 16; @@ -3578,7 +3602,10 @@ public Builder clearSourceUploadUrl() { * *
      * The Google Cloud Storage signed URL used for source uploading, generated
-     * by [google.cloud.functions.v1.GenerateUploadUrl][]
+     * by calling [google.cloud.functions.v1.GenerateUploadUrl].
+     * The signature is validated on write methods {Create, Update}
+     * The signature is stripped from the Function object on read methods {Get,
+     * List}
      * 
* * string source_upload_url = 16; diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionOrBuilder.java index 0d084ab8..58a80df7 100644 --- a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionOrBuilder.java +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionOrBuilder.java @@ -158,7 +158,10 @@ public interface CloudFunctionOrBuilder * *
    * The Google Cloud Storage signed URL used for source uploading, generated
-   * by [google.cloud.functions.v1.GenerateUploadUrl][]
+   * by calling [google.cloud.functions.v1.GenerateUploadUrl].
+   * The signature is validated on write methods {Create, Update}
+   * The signature is stripped from the Function object on read methods {Get,
+   * List}
    * 
* * string source_upload_url = 16; @@ -171,7 +174,10 @@ public interface CloudFunctionOrBuilder * *
    * The Google Cloud Storage signed URL used for source uploading, generated
-   * by [google.cloud.functions.v1.GenerateUploadUrl][]
+   * by calling [google.cloud.functions.v1.GenerateUploadUrl].
+   * The signature is validated on write methods {Create, Update}
+   * The signature is stripped from the Function object on read methods {Get,
+   * List}
    * 
* * string source_upload_url = 16; @@ -184,7 +190,10 @@ public interface CloudFunctionOrBuilder * *
    * The Google Cloud Storage signed URL used for source uploading, generated
-   * by [google.cloud.functions.v1.GenerateUploadUrl][]
+   * by calling [google.cloud.functions.v1.GenerateUploadUrl].
+   * The signature is validated on write methods {Create, Update}
+   * The signature is stripped from the Function object on read methods {Get,
+   * List}
    * 
* * string source_upload_url = 16; diff --git a/proto-google-cloud-functions-v1/src/main/proto/google/cloud/functions/v1/functions.proto b/proto-google-cloud-functions-v1/src/main/proto/google/cloud/functions/v1/functions.proto index aa3dd5de..6523c7db 100644 --- a/proto-google-cloud-functions-v1/src/main/proto/google/cloud/functions/v1/functions.proto +++ b/proto-google-cloud-functions-v1/src/main/proto/google/cloud/functions/v1/functions.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -243,7 +243,11 @@ message CloudFunction { SourceRepository source_repository = 4; // The Google Cloud Storage signed URL used for source uploading, generated - // by [google.cloud.functions.v1.GenerateUploadUrl][] + // by calling [google.cloud.functions.v1.GenerateUploadUrl]. + // + // The signature is validated on write methods {Create, Update} + // The signature is stripped from the Function object on read methods {Get, + // List} string source_upload_url = 16; } diff --git a/renovate.json b/renovate.json index 25e4ea9f..9d4944b4 100644 --- a/renovate.json +++ b/renovate.json @@ -69,5 +69,8 @@ } ], "semanticCommits": true, - "masterIssue": true + "dependencyDashboard": true, + "dependencyDashboardLabels": [ + "type: process" + ] } diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 277897bc..dd8f22e5 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-functions - 1.2.1 + 1.2.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e526e77e..3ef14a34 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-functions - 1.2.1 + 1.2.2 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 44e276ba..df4d2bb0 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-functions - 1.2.1 + 1.2.2 diff --git a/versions.txt b/versions.txt index 4e7ba7cc..b036f5f7 100644 --- a/versions.txt +++ b/versions.txt @@ -1,6 +1,6 @@ # Format: # module:released-version:current-version -google-cloud-functions:1.2.2:1.2.2 -grpc-google-cloud-functions-v1:1.2.2:1.2.2 -proto-google-cloud-functions-v1:1.2.2:1.2.2 +google-cloud-functions:2.0.0:2.0.0 +grpc-google-cloud-functions-v1:2.0.0:2.0.0 +proto-google-cloud-functions-v1:2.0.0:2.0.0