Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
fix: update gapic-generator-java with mock service generation fixes (#…
Browse files Browse the repository at this point in the history
…424)

* feat: generating GAPIC libraries for Google Cloud Functions v2beta

PiperOrigin-RevId: 454900284

Source-Link: googleapis/googleapis@05576c8

Source-Link: googleapis/googleapis-gen@5b2f0e3
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNWIyZjBlMzZkMjdhYTU4ZmJkZTE1ZDFlN2FiNzEzOGNmNWVhODM3YSJ9

feat: generating GAPIC libraries for Google Cloud Functions v2alpha

PiperOrigin-RevId: 454899846

Source-Link: googleapis/googleapis@7088e38

Source-Link: googleapis/googleapis-gen@c3673f8
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzM2NzNmODkyYzgwM2I5YzNmMTc4NDFiY2RlZTdkYjZiMzE3OTQ0NCJ9

chore: Integrate new gapic-generator-java and rules_gapic

PiperOrigin-RevId: 454027580

Source-Link: googleapis/googleapis@1b22277

Source-Link: googleapis/googleapis-gen@e04cea2
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTA0Y2VhMjBkMGQxMmViNWMzYmRiMzYwYTllNzJiNjU0ZWRjYjYzOCJ9

feat: added support for CMEK
docs: clarified wording around quota usage

Clients can now specify the docker registry to use for storing function Docker images and KMS crypto keys for function source code objects.

PiperOrigin-RevId: 453234231

Source-Link: googleapis/googleapis@d180952

Source-Link: googleapis/googleapis-gen@836ff24
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODM2ZmYyNGI3ZTg4MWVmNDZhY2QxNzgzNmM0NmVkMWE5ODMyYjE5NSJ9

chore(deps): upgrade gapic-generator-java to 2.8.0 and update gax-java to 2.18.1

PiperOrigin-RevId: 450543911

Source-Link: googleapis/googleapis@5528344

Source-Link: googleapis/googleapis-gen@9f6775c
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOWY2Nzc1Y2FiMTk1ODk4MmI4ODk2N2E0M2U1ZTgwNmFmMGYxMzVkYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: Enable REST transport for most of Java and Go clients

PiperOrigin-RevId: 456641589

Source-Link: googleapis/googleapis@8a251f5

Source-Link: googleapis/googleapis-gen@4ca52a5
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGNhNTJhNTI5Y2YwMTMwOGQ5NzE0OTUwZWRmZmJlYTM1NjBjZmJkYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Update pom.xml

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: add grpc-google-iam-v1

* chore: remove unused dependency

* fix: update gapic-generator-java with mock service generation fixes

PiperOrigin-RevId: 457524730

Source-Link: googleapis/googleapis@917e7f2

Source-Link: googleapis/googleapis-gen@2497f9a
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjQ5N2Y5YTA2OWQzZjZiMmQ2ODEwZDVhNGUyMzljZGExZTdlNWEzOSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* remove proto-google-iam-v1 dependency

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Neenu Shaji <Neenu1995@users.noreply.github.com>
Co-authored-by: Neenu1995 <neenushaji@google.com>
Co-authored-by: Vadym Matsishevskyi <25311427+vam-google@users.noreply.github.com>
  • Loading branch information
5 people committed Jun 30, 2022
1 parent 1238022 commit 721c8dc
Show file tree
Hide file tree
Showing 224 changed files with 118,578 additions and 254 deletions.
20 changes: 20 additions & 0 deletions google-cloud-functions-bom/pom.xml
Expand Up @@ -63,11 +63,31 @@
<artifactId>grpc-google-cloud-functions-v1</artifactId>
<version>2.4.2-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-functions-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-functions-v2beta</artifactId>
<version>2.4.2-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-functions-v2beta:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-functions-v2alpha</artifactId>
<version>2.4.2-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-functions-v2alpha:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-functions-v1</artifactId>
<version>2.4.2-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-functions-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-functions-v2beta</artifactId>
<version>2.4.2-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-functions-v2beta:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-functions-v2alpha</artifactId>
<version>2.4.2-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-functions-v2alpha:current} -->
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
43 changes: 43 additions & 0 deletions google-cloud-functions/pom.xml
Expand Up @@ -41,7 +41,24 @@
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-common-protos</artifactId>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-common-protos</artifactId>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-iam-v1</artifactId>
</dependency>


<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-functions-v2alpha</artifactId>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-functions-v2beta</artifactId>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-functions-v1</artifactId>
Expand All @@ -58,6 +75,10 @@
<groupId>com.google.api</groupId>
<artifactId>gax-grpc</artifactId>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-httpjson</artifactId>
</dependency>
<dependency>
<groupId>org.threeten</groupId>
<artifactId>threetenbp</artifactId>
Expand All @@ -79,13 +100,35 @@
<artifactId>grpc-google-cloud-functions-v1</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-functions-v2alpha</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-functions-v2beta</artifactId>
<scope>test</scope>
</dependency>
<!-- Need testing utility classes for generated gRPC clients tests -->
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
<classifier>testlib</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-grpc</artifactId>
<classifier>testlib</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-httpjson</artifactId>
<classifier>testlib</classifier>
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
Expand Down
Expand Up @@ -20,6 +20,7 @@
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.httpjson.longrunning.OperationsClient;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
Expand All @@ -36,7 +37,6 @@
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.longrunning.Operation;
import com.google.longrunning.OperationsClient;
import com.google.protobuf.Empty;
import java.io.IOException;
import java.util.List;
Expand Down Expand Up @@ -111,13 +111,29 @@
* CloudFunctionsServiceClient.create(cloudFunctionsServiceSettings);
* }</pre>
*
* <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
* the wire:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* CloudFunctionsServiceSettings cloudFunctionsServiceSettings =
* CloudFunctionsServiceSettings.newBuilder()
* .setTransportChannelProvider(
* CloudFunctionsServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
* .build();
* CloudFunctionsServiceClient cloudFunctionsServiceClient =
* CloudFunctionsServiceClient.create(cloudFunctionsServiceSettings);
* }</pre>
*
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
public class CloudFunctionsServiceClient implements BackgroundResource {
private final CloudFunctionsServiceSettings settings;
private final CloudFunctionsServiceStub stub;
private final OperationsClient operationsClient;
private final OperationsClient httpJsonOperationsClient;
private final com.google.longrunning.OperationsClient operationsClient;

/** Constructs an instance of CloudFunctionsServiceClient with default settings. */
public static final CloudFunctionsServiceClient create() throws IOException {
Expand All @@ -137,7 +153,6 @@ public static final CloudFunctionsServiceClient create(CloudFunctionsServiceSett
* Constructs an instance of CloudFunctionsServiceClient, using the given stub for making calls.
* This is for advanced usage - prefer using create(CloudFunctionsServiceSettings).
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final CloudFunctionsServiceClient create(CloudFunctionsServiceStub stub) {
return new CloudFunctionsServiceClient(stub);
}
Expand All @@ -150,21 +165,23 @@ public static final CloudFunctionsServiceClient create(CloudFunctionsServiceStub
protected CloudFunctionsServiceClient(CloudFunctionsServiceSettings settings) throws IOException {
this.settings = settings;
this.stub = ((CloudFunctionsServiceStubSettings) settings.getStubSettings()).createStub();
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
this.operationsClient =
com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
protected CloudFunctionsServiceClient(CloudFunctionsServiceStub stub) {
this.settings = null;
this.stub = stub;
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
this.operationsClient =
com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}

public final CloudFunctionsServiceSettings getSettings() {
return settings;
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public CloudFunctionsServiceStub getStub() {
return stub;
}
Expand All @@ -173,10 +190,19 @@ public CloudFunctionsServiceStub getStub() {
* Returns the OperationsClient that can be used to query the status of a long-running operation
* returned by another API method call.
*/
public final OperationsClient getOperationsClient() {
public final com.google.longrunning.OperationsClient getOperationsClient() {
return operationsClient;
}

/**
* Returns the OperationsClient that can be used to query the status of a long-running operation
* returned by another API method call.
*/
@BetaApi
public final OperationsClient getHttpJsonOperationsClient() {
return httpJsonOperationsClient;
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns a list of functions that belong to the requested project.
Expand Down Expand Up @@ -259,7 +285,7 @@ public final ListFunctionsPagedResponse listFunctions(ListFunctionsRequest reque
* while (true) {
* ListFunctionsResponse response =
* cloudFunctionsServiceClient.listFunctionsCallable().call(request);
* for (CloudFunction element : response.getResponsesList()) {
* for (CloudFunction element : response.getFunctionsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -930,7 +956,12 @@ public final UnaryCallable<CallFunctionRequest, CallFunctionResponse> callFuncti
* try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
* CloudFunctionsServiceClient.create()) {
* GenerateUploadUrlRequest request =
* GenerateUploadUrlRequest.newBuilder().setParent("parent-995424086").build();
* GenerateUploadUrlRequest.newBuilder()
* .setParent("parent-995424086")
* .setKmsKeyName(
* CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
* .toString())
* .build();
* GenerateUploadUrlResponse response = cloudFunctionsServiceClient.generateUploadUrl(request);
* }
* }</pre>
Expand Down Expand Up @@ -981,7 +1012,12 @@ public final GenerateUploadUrlResponse generateUploadUrl(GenerateUploadUrlReques
* try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
* CloudFunctionsServiceClient.create()) {
* GenerateUploadUrlRequest request =
* GenerateUploadUrlRequest.newBuilder().setParent("parent-995424086").build();
* GenerateUploadUrlRequest.newBuilder()
* .setParent("parent-995424086")
* .setKmsKeyName(
* CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
* .toString())
* .build();
* ApiFuture<GenerateUploadUrlResponse> future =
* cloudFunctionsServiceClient.generateUploadUrlCallable().futureCall(request);
* // Do something.
Expand Down
Expand Up @@ -23,6 +23,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
Expand Down Expand Up @@ -186,11 +187,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return CloudFunctionsServiceStubSettings.defaultCredentialsProviderBuilder();
}

/** Returns a builder for the default ChannelProvider for this service. */
/** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return CloudFunctionsServiceStubSettings.defaultGrpcTransportProviderBuilder();
}

/** Returns a builder for the default REST ChannelProvider for this service. */
@BetaApi
public static InstantiatingHttpJsonChannelProvider.Builder
defaultHttpJsonTransportProviderBuilder() {
return CloudFunctionsServiceStubSettings.defaultHttpJsonTransportProviderBuilder();
}

public static TransportChannelProvider defaultTransportChannelProvider() {
return CloudFunctionsServiceStubSettings.defaultTransportChannelProvider();
}
Expand All @@ -200,11 +208,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return CloudFunctionsServiceStubSettings.defaultApiClientHeaderProviderBuilder();
}

/** Returns a new builder for this class. */
/** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}

/** Returns a new REST builder for this class. */
@BetaApi
public static Builder newHttpJsonBuilder() {
return Builder.createHttpJsonDefault();
}

/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
Expand Down Expand Up @@ -243,6 +257,11 @@ private static Builder createDefault() {
return new Builder(CloudFunctionsServiceStubSettings.newBuilder());
}

@BetaApi
private static Builder createHttpJsonDefault() {
return new Builder(CloudFunctionsServiceStubSettings.newHttpJsonBuilder());
}

public CloudFunctionsServiceStubSettings.Builder getStubSettingsBuilder() {
return ((CloudFunctionsServiceStubSettings.Builder) getStubSettings());
}
Expand Down
Expand Up @@ -15,7 +15,9 @@
*/

/**
* The interfaces provided are listed below, along with usage samples.
* A client to Cloud Functions API
*
* <p>The interfaces provided are listed below, along with usage samples.
*
* <p>======================= CloudFunctionsServiceClient =======================
*
Expand Down
Expand Up @@ -55,7 +55,11 @@
public abstract class CloudFunctionsServiceStub implements BackgroundResource {

public OperationsStub getOperationsStub() {
throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
return null;
}

public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
return null;
}

public UnaryCallable<ListFunctionsRequest, ListFunctionsPagedResponse>
Expand Down

0 comments on commit 721c8dc

Please sign in to comment.