Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a40b760
fix!: removed fields from SafeSearchAnnotation message
gcf-owl-bot[bot] May 6, 2022
db63089
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] May 6, 2022
010edbe
fix!: Product search related messages and enums changed in an incompa…
gcf-owl-bot[bot] May 6, 2022
29ad868
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] May 6, 2022
88e23b9
fix!: BatchAnnotateImagesRequest.requests is required
gcf-owl-bot[bot] May 6, 2022
5669068
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] May 6, 2022
c90c30d
chore(deps): upgrade gapic-generator-java to 2.8.0 and update gax-jav…
gcf-owl-bot[bot] May 24, 2022
c5c77af
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] May 24, 2022
c707b17
chore: Integrate new gapic-generator-java and rules_gapic
gcf-owl-bot[bot] Jun 10, 2022
0eaa75c
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jun 10, 2022
79abf7f
feat: Enable REST transport for most of Java and Go clients
gcf-owl-bot[bot] Jun 23, 2022
d85fcde
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jun 23, 2022
2aac29d
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jun 23, 2022
50ebcb3
Merge branch 'owl-bot-copy' of https://github.com/googleapis/java-vis…
gcf-owl-bot[bot] Jun 23, 2022
6920bd8
Update pom.xml
Neenu1995 Jun 23, 2022
11d3033
Merge branch 'main' into owl-bot-copy
meltsufin Jun 27, 2022
dbc590b
fix: update gapic-generator-java with mock service generation fixes
gcf-owl-bot[bot] Jun 27, 2022
0330605
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jun 27, 2022
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ implementation 'com.google.cloud:google-cloud-vision'
If you are using Gradle without BOM, add this to your dependencies

```Groovy
implementation 'com.google.cloud:google-cloud-vision:2.1.3'
implementation 'com.google.cloud:google-cloud-vision:2.1.4'
```

If you are using SBT, add this to your dependencies

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-vision" % "2.1.3"
libraryDependencies += "com.google.cloud" % "google-cloud-vision" % "2.1.4"
```

## Authentication
Expand Down
16 changes: 16 additions & 0 deletions google-cloud-vision/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,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 @@ -128,12 +132,24 @@
</exclusions>
</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 @@ -18,13 +18,13 @@

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.rpc.OperationCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.vision.v1.stub.ImageAnnotatorStub;
import com.google.cloud.vision.v1.stub.ImageAnnotatorStubSettings;
import com.google.longrunning.Operation;
import com.google.longrunning.OperationsClient;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -96,13 +96,28 @@
* ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create(imageAnnotatorSettings);
* }</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.
* ImageAnnotatorSettings imageAnnotatorSettings =
* ImageAnnotatorSettings.newBuilder()
* .setTransportChannelProvider(
* ImageAnnotatorSettings.defaultHttpJsonTransportProviderBuilder().build())
* .build();
* ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create(imageAnnotatorSettings);
* }</pre>
*
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
public class ImageAnnotatorClient implements BackgroundResource {
private final ImageAnnotatorSettings settings;
private final ImageAnnotatorStub stub;
private final OperationsClient operationsClient;
private final OperationsClient httpJsonOperationsClient;
private final com.google.longrunning.OperationsClient operationsClient;

/** Constructs an instance of ImageAnnotatorClient with default settings. */
public static final ImageAnnotatorClient create() throws IOException {
Expand All @@ -122,7 +137,6 @@ public static final ImageAnnotatorClient create(ImageAnnotatorSettings settings)
* Constructs an instance of ImageAnnotatorClient, using the given stub for making calls. This is
* for advanced usage - prefer using create(ImageAnnotatorSettings).
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final ImageAnnotatorClient create(ImageAnnotatorStub stub) {
return new ImageAnnotatorClient(stub);
}
Expand All @@ -135,21 +149,23 @@ public static final ImageAnnotatorClient create(ImageAnnotatorStub stub) {
protected ImageAnnotatorClient(ImageAnnotatorSettings settings) throws IOException {
this.settings = settings;
this.stub = ((ImageAnnotatorStubSettings) 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 ImageAnnotatorClient(ImageAnnotatorStub 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 ImageAnnotatorSettings getSettings() {
return settings;
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public ImageAnnotatorStub getStub() {
return stub;
}
Expand All @@ -158,10 +174,19 @@ public ImageAnnotatorStub 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.
/**
* Run image detection and annotation for a batch of images.
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 @@ -135,11 +136,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return ImageAnnotatorStubSettings.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 ImageAnnotatorStubSettings.defaultGrpcTransportProviderBuilder();
}

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

public static TransportChannelProvider defaultTransportChannelProvider() {
return ImageAnnotatorStubSettings.defaultTransportChannelProvider();
}
Expand All @@ -149,11 +157,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return ImageAnnotatorStubSettings.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 @@ -191,6 +205,11 @@ private static Builder createDefault() {
return new Builder(ImageAnnotatorStubSettings.newBuilder());
}

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

public ImageAnnotatorStubSettings.Builder getStubSettingsBuilder() {
return ((ImageAnnotatorStubSettings.Builder) getStubSettings());
}
Expand Down
Loading