Skip to content

Commit

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

* fix!: remove Application and Profile services and and related protos, enums, and messages

PiperOrigin-RevId: 453241222

Source-Link: googleapis/googleapis@7837470

Source-Link: https://github.com/googleapis/googleapis-gen/commit/ae2c052743706161ac95adc5048ad5a3de8a6585
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWUyYzA1Mjc0MzcwNjE2MWFjOTVhZGM1MDQ4YWQ1YTNkZThhNjU4NSJ9

* 🦉 Updates from OwlBot post-processor

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

* chore: Integrate new gapic-generator-java and rules_gapic

PiperOrigin-RevId: 454027580

Source-Link: googleapis/googleapis@1b22277

Source-Link: https://github.com/googleapis/googleapis-gen/commit/e04cea20d0d12eb5c3bdb360a9e72b654edcb638
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTA0Y2VhMjBkMGQxMmViNWMzYmRiMzYwYTllNzJiNjU0ZWRjYjYzOCJ9

* 🦉 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: https://github.com/googleapis/googleapis-gen/commit/4ca52a529cf01308d9714950edffbea3560cfbdb
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

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

PiperOrigin-RevId: 457524730

Source-Link: googleapis/googleapis@917e7f2

Source-Link: https://github.com/googleapis/googleapis-gen/commit/2497f9a069d3f6b2d6810d5a4e239cda1e7e5a39
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjQ5N2Y5YTA2OWQzZjZiMmQ2ODEwZDVhNGUyMzljZGExZTdlNWEzOSJ9

* 🦉 Updates from OwlBot post-processor

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

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Neenu Shaji <[email protected]>
  • Loading branch information
3 people authored Jun 27, 2022
1 parent 4db2ff4 commit d2e17f0
Show file tree
Hide file tree
Showing 237 changed files with 13,313 additions and 118,086 deletions.
16 changes: 16 additions & 0 deletions java-talent/google-cloud-talent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,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 Down Expand Up @@ -89,12 +93,24 @@
<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
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,20 @@
* CompanyServiceClient companyServiceClient = CompanyServiceClient.create(companyServiceSettings);
* }</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.
* CompanyServiceSettings companyServiceSettings =
* CompanyServiceSettings.newBuilder()
* .setTransportChannelProvider(
* CompanyServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
* .build();
* CompanyServiceClient companyServiceClient = CompanyServiceClient.create(companyServiceSettings);
* }</pre>
*
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
Expand Down Expand Up @@ -680,7 +694,7 @@ public final ListCompaniesPagedResponse listCompanies(ListCompaniesRequest reque
* .build();
* while (true) {
* ListCompaniesResponse response = companyServiceClient.listCompaniesCallable().call(request);
* for (Company element : response.getResponsesList()) {
* for (Company element : response.getCompaniesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
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 @@ -123,11 +124,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return CompanyServiceStubSettings.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 CompanyServiceStubSettings.defaultGrpcTransportProviderBuilder();
}

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

public static TransportChannelProvider defaultTransportChannelProvider() {
return CompanyServiceStubSettings.defaultTransportChannelProvider();
}
Expand All @@ -137,11 +145,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return CompanyServiceStubSettings.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 @@ -179,6 +193,11 @@ private static Builder createDefault() {
return new Builder(CompanyServiceStubSettings.newBuilder());
}

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

public CompanyServiceStubSettings.Builder getStubSettingsBuilder() {
return ((CompanyServiceStubSettings.Builder) getStubSettings());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,20 @@
* CompletionClient completionClient = CompletionClient.create(completionSettings);
* }</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.
* CompletionSettings completionSettings =
* CompletionSettings.newBuilder()
* .setTransportChannelProvider(
* CompletionSettings.defaultHttpJsonTransportProviderBuilder().build())
* .build();
* CompletionClient completionClient = CompletionClient.create(completionSettings);
* }</pre>
*
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,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 @@ -96,11 +97,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return CompletionStubSettings.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 CompletionStubSettings.defaultGrpcTransportProviderBuilder();
}

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

public static TransportChannelProvider defaultTransportChannelProvider() {
return CompletionStubSettings.defaultTransportChannelProvider();
}
Expand All @@ -110,11 +118,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return CompletionStubSettings.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 @@ -152,6 +166,11 @@ private static Builder createDefault() {
return new Builder(CompletionStubSettings.newBuilder());
}

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

public CompletionStubSettings.Builder getStubSettingsBuilder() {
return ((CompletionStubSettings.Builder) getStubSettings());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,20 @@
* EventServiceClient eventServiceClient = EventServiceClient.create(eventServiceSettings);
* }</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.
* EventServiceSettings eventServiceSettings =
* EventServiceSettings.newBuilder()
* .setTransportChannelProvider(
* EventServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
* .build();
* EventServiceClient eventServiceClient = EventServiceClient.create(eventServiceSettings);
* }</pre>
*
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,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 @@ -97,11 +98,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return EventServiceStubSettings.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 EventServiceStubSettings.defaultGrpcTransportProviderBuilder();
}

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

public static TransportChannelProvider defaultTransportChannelProvider() {
return EventServiceStubSettings.defaultTransportChannelProvider();
}
Expand All @@ -111,11 +119,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return EventServiceStubSettings.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 @@ -153,6 +167,11 @@ private static Builder createDefault() {
return new Builder(EventServiceStubSettings.newBuilder());
}

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

public EventServiceStubSettings.Builder getStubSettingsBuilder() {
return ((EventServiceStubSettings.Builder) getStubSettings());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

import com.google.api.core.ApiFuture;
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 @@ -30,7 +32,6 @@
import com.google.cloud.talent.v4.stub.JobServiceStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.longrunning.Operation;
import com.google.longrunning.OperationsClient;
import com.google.protobuf.Empty;
import com.google.protobuf.FieldMask;
import java.io.IOException;
Expand Down Expand Up @@ -104,13 +105,28 @@
* JobServiceClient jobServiceClient = JobServiceClient.create(jobServiceSettings);
* }</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.
* JobServiceSettings jobServiceSettings =
* JobServiceSettings.newBuilder()
* .setTransportChannelProvider(
* JobServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
* .build();
* JobServiceClient jobServiceClient = JobServiceClient.create(jobServiceSettings);
* }</pre>
*
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
public class JobServiceClient implements BackgroundResource {
private final JobServiceSettings settings;
private final JobServiceStub stub;
private final OperationsClient operationsClient;
private final OperationsClient httpJsonOperationsClient;
private final com.google.longrunning.OperationsClient operationsClient;

/** Constructs an instance of JobServiceClient with default settings. */
public static final JobServiceClient create() throws IOException {
Expand Down Expand Up @@ -140,13 +156,17 @@ public static final JobServiceClient create(JobServiceStub stub) {
protected JobServiceClient(JobServiceSettings settings) throws IOException {
this.settings = settings;
this.stub = ((JobServiceStubSettings) 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());
}

protected JobServiceClient(JobServiceStub 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 JobServiceSettings getSettings() {
Expand All @@ -161,10 +181,19 @@ public JobServiceStub 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.
/**
* Creates a new job.
Expand Down Expand Up @@ -1197,7 +1226,7 @@ public final UnaryCallable<ListJobsRequest, ListJobsPagedResponse> listJobsPaged
* .build();
* while (true) {
* ListJobsResponse response = jobServiceClient.listJobsCallable().call(request);
* for (Job element : response.getResponsesList()) {
* for (Job element : response.getJobsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down
Loading

0 comments on commit d2e17f0

Please sign in to comment.