Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [cloudfunctions] ListFunctions now include metadata which indicates whether a function is a GEN_1 or GEN_2 function #9462

Merged
merged 4 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions java-functions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.14.0</version>
<version>26.15.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-functions.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-functions/2.18.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-functions/2.19.0
[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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,9 @@ public final UnaryCallable<DeleteFunctionRequest, Operation> deleteFunctionCalla
* GenerateUploadUrlRequest request =
* GenerateUploadUrlRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setKmsKeyName(
* CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
* .toString())
* .build();
* GenerateUploadUrlResponse response = functionServiceClient.generateUploadUrl(request);
* }
Expand Down Expand Up @@ -1041,6 +1044,9 @@ public final GenerateUploadUrlResponse generateUploadUrl(GenerateUploadUrlReques
* GenerateUploadUrlRequest request =
* GenerateUploadUrlRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setKmsKeyName(
* CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
* .toString())
* .build();
* ApiFuture<GenerateUploadUrlResponse> future =
* functionServiceClient.generateUploadUrlCallable().futureCall(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,18 @@ public void getFunctionTest() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
mockService.addResponse(expectedResponse);

Expand Down Expand Up @@ -157,18 +157,18 @@ public void getFunctionTest2() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
mockService.addResponse(expectedResponse);

Expand Down Expand Up @@ -313,18 +313,18 @@ public void createFunctionTest() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -378,18 +378,18 @@ public void createFunctionTest2() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -443,18 +443,18 @@ public void updateFunctionTest() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand All @@ -467,18 +467,18 @@ public void updateFunctionTest() throws Exception {
Function function =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
FieldMask updateMask = FieldMask.newBuilder().build();

Expand Down Expand Up @@ -511,18 +511,18 @@ public void updateFunctionExceptionTest() throws Exception {
Function function =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
FieldMask updateMask = FieldMask.newBuilder().build();
client.updateFunctionAsync(function, updateMask).get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,18 @@ public void getFunctionTest() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
mockFunctionService.addResponse(expectedResponse);

Expand Down Expand Up @@ -160,18 +160,18 @@ public void getFunctionTest2() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
mockFunctionService.addResponse(expectedResponse);

Expand Down Expand Up @@ -298,18 +298,18 @@ public void createFunctionTest() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -362,18 +362,18 @@ public void createFunctionTest2() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -426,18 +426,18 @@ public void updateFunctionTest() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down
Loading