Skip to content

Commit e59bde6

Browse files
committed
resolve merge conflicts
2 parents 0d6e594 + ff2b1b6 commit e59bde6

61 files changed

Lines changed: 240 additions & 211 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ This client supports the following Google Cloud Platform services at a [GA](#ver
1616
- [Stackdriver Logging](#stackdriver-logging-ga) (GA)
1717
- [Cloud Datastore](#google-cloud-datastore-ga) (GA)
1818
- [Cloud Storage](#google-cloud-storage-ga) (GA)
19+
- [Cloud Translation](#google-translation-ga) (GA)
1920

2021
This client supports the following Google Cloud Platform services at a [Beta](#versioning) quality level:
2122

2223
- [BigQuery](#google-cloud-bigquery-beta) (Beta)
2324
- [Cloud Pub/Sub](#google-cloud-pubsub-beta) (Beta)
2425
- [Cloud Spanner](#cloud-spanner-beta) (Beta)
25-
- [Cloud Translation](#google-translation-beta) (Beta)
2626
- [Cloud Natural Language](#google-cloud-language-beta) (Beta)
2727
- [Cloud Vision](#google-cloud-vision-beta) (Beta)
2828

@@ -54,16 +54,16 @@ If you are using Maven, add this to your pom.xml file
5454
<dependency>
5555
<groupId>com.google.cloud</groupId>
5656
<artifactId>google-cloud</artifactId>
57-
<version>0.20.2-alpha</version>
57+
<version>0.20.3-alpha</version>
5858
</dependency>
5959
```
6060
If you are using Gradle, add this to your dependencies
6161
```Groovy
62-
compile 'com.google.cloud:google-cloud:0.20.2-alpha'
62+
compile 'com.google.cloud:google-cloud:0.20.3-alpha'
6363
```
6464
If you are using SBT, add this to your dependencies
6565
```Scala
66-
libraryDependencies += "com.google.cloud" % "google-cloud" % "0.20.2-alpha"
66+
libraryDependencies += "com.google.cloud" % "google-cloud" % "0.20.3-alpha"
6767
```
6868

6969
For running on Google App Engine, see [more instructions here](./APPENGINE.md).
@@ -368,6 +368,40 @@ if (blob != null) {
368368
}
369369
```
370370
371+
Google Translation (GA)
372+
----------------
373+
374+
- [API Documentation][translate-api]
375+
- [Official Documentation][translate-docs]
376+
377+
#### Preview
378+
379+
Here's a snippet showing a simple usage example. The example shows how to detect the language of
380+
some text and how to translate some text. The example assumes that either Application Default
381+
Credentials or a valid API key are available. An API key stored in the `GOOGLE_API_KEY` environment
382+
variable will be automatically detected. Complete source code can be found at
383+
[DetectLanguageAndTranslate.java](./google-cloud-examples/src/main/java/com/google/cloud/examples/translate/snippets/DetectLanguageAndTranslate.java).
384+
385+
```java
386+
import com.google.cloud.translate.Detection;
387+
import com.google.cloud.translate.Translate;
388+
import com.google.cloud.translate.Translate.TranslateOption;
389+
import com.google.cloud.translate.TranslateOptions;
390+
import com.google.cloud.translate.Translation;
391+
392+
Translate translate = TranslateOptions.getDefaultInstance().getService();
393+
394+
Detection detection = translate.detect("Hola");
395+
String detectedLanguage = detection.getLanguage();
396+
397+
Translation translation = translate.translate(
398+
"World",
399+
TranslateOption.sourceLanguage("en"),
400+
TranslateOption.targetLanguage(detectedLanguage));
401+
402+
System.out.printf("Hola %s%n", translation.getTranslatedText());
403+
```
404+
371405
Google Cloud BigQuery (Beta)
372406
----------------------
373407
@@ -742,40 +776,6 @@ while (projectIterator.hasNext()) {
742776
}
743777
```
744778
745-
Google Translation (Beta)
746-
----------------
747-
748-
- [API Documentation][translate-api]
749-
- [Official Documentation][translate-docs]
750-
751-
#### Preview
752-
753-
Here's a snippet showing a simple usage example. The example shows how to detect the language of
754-
some text and how to translate some text. The example assumes that either Application Default
755-
Credentials or a valid API key are available. An API key stored in the `GOOGLE_API_KEY` environment
756-
variable will be automatically detected. Complete source code can be found at
757-
[DetectLanguageAndTranslate.java](./google-cloud-examples/src/main/java/com/google/cloud/examples/translate/snippets/DetectLanguageAndTranslate.java).
758-
759-
```java
760-
import com.google.cloud.translate.Detection;
761-
import com.google.cloud.translate.Translate;
762-
import com.google.cloud.translate.Translate.TranslateOption;
763-
import com.google.cloud.translate.TranslateOptions;
764-
import com.google.cloud.translate.Translation;
765-
766-
Translate translate = TranslateOptions.getDefaultInstance().getService();
767-
768-
Detection detection = translate.detect("Hola");
769-
String detectedLanguage = detection.getLanguage();
770-
771-
Translation translation = translate.translate(
772-
"World",
773-
TranslateOption.sourceLanguage("en"),
774-
TranslateOption.targetLanguage(detectedLanguage));
775-
776-
System.out.printf("Hola %s%n", translation.getTranslatedText());
777-
```
778-
779779
Google Cloud Speech (Alpha)
780780
----------------
781781

TESTING.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,30 @@ $ gcloud beta emulators pubsub env-init
147147

148148
3. Point your client to the emulator.
149149
```java
150-
ChannelProvider channelProvider =
151-
// SubscriptionAdminSettings works too.
152-
TopicAdminSettings.defaultChannelProviderBuilder()
153-
.setEndpoint(System.getenv("PUBSUB_EMULATOR_HOST"))
154-
.setCredentialsProvider(
155-
FixedCredentialsProvider.create(NoCredentials.getInstance()))
156-
.build();
157-
TopicAdminClient topicClient = TopicAdminClient.create(
158-
TopicAdminSettings.defaultBuilder().setChannelProvider(channelProvider).build());
159-
Publisher publisher =
160-
Publisher.newBuilder(topicName).setChannelProvider(channelProvider).build();
150+
String hostport = System.getenv("PUBSUB_EMULATOR_HOST");
151+
ManagedChannel channel = ManagedChannelBuilder.forTarget(hostport).usePlaintext(true).build();
152+
try {
153+
ChannelProvider channelProvider = FixedChannelProvider.create(channel);
154+
CredentialsProvider credentialsProvider = new NoCredentialsProvider();
155+
156+
// Similarly for SubscriptionAdminSettings
157+
TopicAdminClient topicClient = TopicAdminClient.create(
158+
TopicAdminSettings
159+
.defaultBuilder()
160+
.setChannelProvider(channelProvider)
161+
.setCredentialsProvider(credentialsProvider)
162+
.build());
163+
164+
// Similarly for Subscriber
165+
Publisher publisher =
166+
Publisher
167+
.newBuilder(topicName)
168+
.setChannelProvider(channelProvider)
169+
.setCredentialsProvider(credentialsProvider)
170+
.build();
171+
} finally {
172+
channel.shutdown();
173+
}
161174
```
162175

163176
### Testing code that uses Resource Manager

google-cloud-bigquery/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ If you are using Maven, add this to your pom.xml file
2222
<dependency>
2323
<groupId>com.google.cloud</groupId>
2424
<artifactId>google-cloud-bigquery</artifactId>
25-
<version>0.20.2-beta</version>
25+
<version>0.20.3-beta</version>
2626
</dependency>
2727
```
2828
If you are using Gradle, add this to your dependencies
2929
```Groovy
30-
compile 'com.google.cloud:google-cloud-bigquery:0.20.2-beta'
30+
compile 'com.google.cloud:google-cloud-bigquery:0.20.3-beta'
3131
```
3232
If you are using SBT, add this to your dependencies
3333
```Scala
34-
libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "0.20.2-beta"
34+
libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "0.20.3-beta"
3535
```
3636

3737
Example Application

google-cloud-bigquery/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44
<artifactId>google-cloud-bigquery</artifactId>
5-
<version>0.20.3-beta-SNAPSHOT</version>
5+
<version>0.20.4-beta-SNAPSHOT</version>
66
<packaging>jar</packaging>
77
<name>Google Cloud BigQuery</name>
88
<url>https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-bigquery</url>
@@ -12,7 +12,7 @@
1212
<parent>
1313
<groupId>com.google.cloud</groupId>
1414
<artifactId>google-cloud-pom</artifactId>
15-
<version>0.20.3-alpha-SNAPSHOT</version>
15+
<version>0.20.4-alpha-SNAPSHOT</version>
1616
</parent>
1717
<properties>
1818
<site.installationModule>google-cloud-bigquery</site.installationModule>

google-cloud-compute/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ If you are using Maven, add this to your pom.xml file
2222
<dependency>
2323
<groupId>com.google.cloud</groupId>
2424
<artifactId>google-cloud-compute</artifactId>
25-
<version>0.20.2-alpha</version>
25+
<version>0.20.3-alpha</version>
2626
</dependency>
2727
```
2828
If you are using Gradle, add this to your dependencies
2929
```Groovy
30-
compile 'com.google.cloud:google-cloud-compute:0.20.2-alpha'
30+
compile 'com.google.cloud:google-cloud-compute:0.20.3-alpha'
3131
```
3232
If you are using SBT, add this to your dependencies
3333
```Scala
34-
libraryDependencies += "com.google.cloud" % "google-cloud-compute" % "0.20.2-alpha"
34+
libraryDependencies += "com.google.cloud" % "google-cloud-compute" % "0.20.3-alpha"
3535
```
3636

3737
Example Application

google-cloud-compute/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44
<artifactId>google-cloud-compute</artifactId>
5-
<version>0.20.3-alpha-SNAPSHOT</version>
5+
<version>0.20.4-alpha-SNAPSHOT</version>
66
<packaging>jar</packaging>
77
<name>Google Cloud Compute</name>
88
<url>https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-compute</url>
@@ -12,7 +12,7 @@
1212
<parent>
1313
<groupId>com.google.cloud</groupId>
1414
<artifactId>google-cloud-pom</artifactId>
15-
<version>0.20.3-alpha-SNAPSHOT</version>
15+
<version>0.20.4-alpha-SNAPSHOT</version>
1616
</parent>
1717
<properties>
1818
<site.installationModule>google-cloud-compute</site.installationModule>

google-cloud-compute/src/test/java/com/google/cloud/compute/it/ITComputeTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,6 +1565,8 @@ public void testAggregatedListSubnetworks() throws InterruptedException, Timeout
15651565
operation = compute.deleteNetwork(networkId);
15661566
operation.waitFor();
15671567
resourceCleaner.remove(networkId);
1568+
assertNull(compute.getSubnetwork(firstSubnetworkId));
1569+
assertNull(compute.getSubnetwork(secondSubnetworkId));
15681570
assertNull(compute.getNetwork(networkName));
15691571
}
15701572

google-cloud-contrib/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ If you are using Maven, add this to your pom.xml file
2525
<dependency>
2626
<groupId>com.google.cloud</groupId>
2727
<artifactId>google-cloud-contrib</artifactId>
28-
<version>0.20.2-alpha</version>
28+
<version>0.20.3-alpha</version>
2929
</dependency>
3030
```
3131
If you are using Gradle, add this to your dependencies
3232
```Groovy
33-
compile 'com.google.cloud:google-cloud-contrib:0.20.2-alpha'
33+
compile 'com.google.cloud:google-cloud-contrib:0.20.3-alpha'
3434
```
3535
If you are using SBT, add this to your dependencies
3636
```Scala
37-
libraryDependencies += "com.google.cloud" % "google-cloud-contrib" % "0.20.2-alpha"
37+
libraryDependencies += "com.google.cloud" % "google-cloud-contrib" % "0.20.3-alpha"
3838
```
3939

4040
### google-cloud-nio-examples

google-cloud-contrib/google-cloud-logging-logback/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file
1919
<dependency>
2020
<groupId>com.google.cloud</groupId>
2121
<artifactId>google-cloud-logging-logback</artifactId>
22-
<version>0.20.2-alpha</version>
22+
<version>0.20.3-alpha</version>
2323
</dependency>
2424
```
2525
If you are using Gradle, add this to your dependencies
2626
```Groovy
27-
compile 'com.google.cloud:google-cloud-logging-logback:0.20.2-alpha'
27+
compile 'com.google.cloud:google-cloud-logging-logback:0.20.3-alpha'
2828
```
2929
If you are using SBT, add this to your dependencies
3030
```Scala
31-
libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.20.2-alpha"
31+
libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.20.3-alpha"
3232
```
3333

3434
Usage

google-cloud-contrib/google-cloud-logging-logback/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<artifactId>google-cloud-logging-logback</artifactId>
8-
<version>0.20.3-alpha-SNAPSHOT</version>
8+
<version>0.20.4-alpha-SNAPSHOT</version>
99
<packaging>jar</packaging>
1010
<name>Google Cloud Logging Logback Appender</name>
1111
<url>https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback</url>
@@ -20,7 +20,7 @@
2020
<parent>
2121
<groupId>com.google.cloud</groupId>
2222
<artifactId>google-cloud-contrib</artifactId>
23-
<version>0.20.3-alpha-SNAPSHOT</version>
23+
<version>0.20.4-alpha-SNAPSHOT</version>
2424
</parent>
2525
<dependencies>
2626
<dependency>

0 commit comments

Comments
 (0)