Skip to content

Commit

Permalink
Merge branch 'master' into quickstarts
Browse files Browse the repository at this point in the history
  • Loading branch information
lesv authored Nov 17, 2016
2 parents 62be66b + 365ab6c commit 7472602
Show file tree
Hide file tree
Showing 20 changed files with 38 additions and 36 deletions.
2 changes: 1 addition & 1 deletion bigquery/cloud-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigquery</artifactId>
<version>0.5.1</version>
<version>0.6.0</version>
</dependency>

<!-- Test dependencies -->
Expand Down
2 changes: 1 addition & 1 deletion bigquery/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-bigquery</artifactId>
<version>v2-rev329-1.22.0</version>
<version>v2-rev330-1.22.0</version>
</dependency>
<dependency>
<groupId>com.google.oauth-client</groupId>
Expand Down
2 changes: 1 addition & 1 deletion compute/cmdline/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ limitations under the License.
</dependency>
</dependencies>
<properties>
<project.compute.version>v1-rev129-1.22.0</project.compute.version>
<project.compute.version>v1-rev130-1.22.0</project.compute.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
2 changes: 1 addition & 1 deletion datastore/cloud-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-datastore</artifactId>
<version>0.5.1</version>
<version>0.6.0</version>
</dependency>

<!-- Test dependencies -->
Expand Down
2 changes: 1 addition & 1 deletion datastore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-datastore</artifactId>
<version>0.5.1</version>
<version>0.6.0</version>
</dependency>

<!-- Test dependencies -->
Expand Down
2 changes: 1 addition & 1 deletion flexible/cloudstorage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage</artifactId>
<version>0.5.1</version>
<version>0.6.0</version>
</dependency>
<!-- [END dependencies] -->
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion flexible/datastore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-datastore</artifactId>
<version>0.5.1</version>
<version>0.6.0</version>
</dependency>
<!-- [END dependencies] -->
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions language/analysis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ limitations under the License.
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-language</artifactId>
<version>v1-rev1-1.21.0</version>
<version>v1-rev1-1.22.0</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.21.0</version>
<version>1.22.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand Down
2 changes: 1 addition & 1 deletion monitoring/v2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-cloudmonitoring</artifactId>
<version>v2beta2-rev63-1.22.0</version>
<version>v2beta2-rev64-1.22.0</version>
</dependency>
<dependency>
<groupId>com.google.oauth-client</groupId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.2.15</version>
<version>2.2.17</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion pubsub/cloud-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub</artifactId>
<version>0.5.1</version>
<version>0.6.0</version>
</dependency>

<!-- Test dependencies -->
Expand Down
2 changes: 1 addition & 1 deletion storage/cloud-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage</artifactId>
<version>0.5.1</version>
<version>0.6.0</version>
</dependency>

<!-- Test dependencies -->
Expand Down
2 changes: 1 addition & 1 deletion storage/json-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-storage</artifactId>
<version>v1-rev90-1.22.0</version>
<version>v1-rev91-1.20.0</version>
</dependency>
<dependency>
<groupId>com.google.oauth-client</groupId>
Expand Down
2 changes: 1 addition & 1 deletion storage/xml-api/cmdline-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-storage</artifactId>
<version>v1-rev90-1.22.0</version>
<version>v1-rev91-1.20.0</version>
</dependency>
<dependency>
<groupId>com.google.http-client</groupId>
Expand Down
2 changes: 1 addition & 1 deletion translate/cloud-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
-->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>come.example.translate</groupId>
<groupId>com.example.translate</groupId>
<artifactId>translate-google-cloud-samples</artifactId>
<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static void detectLanguage(String sourceText, PrintStream out) {
}

/**
* Translates the source text in any language to english.
* Translates the source text in any language to English.
*
* @param sourceText source text to be translated
* @param out print stream
Expand All @@ -56,12 +56,12 @@ public static void translateText(String sourceText, PrintStream out) {
Translate translate = createTranslateService();
Translation translation = translate.translate(sourceText);
out.printf("Source Text:\n\t%s\n", sourceText);
out.printf("Translated Text:\n\t%s\n", translation.translatedText());
out.printf("Translated Text:\n\t%s\n", translation.getTranslatedText());
}

/**
* Translate the source text from source to target language.
* Make sure that your project is whitelisted.
* Make sure that your project is whitelisted.
*
* @param sourceText source text to be translated
* @param sourceLang source language of the text
Expand All @@ -83,7 +83,8 @@ public static void translateTextWithOptionsAndModel(

Translation translation = translate.translate(sourceText, srcLang, tgtLang, model);
out.printf("Source Text:\n\tLang: %s, Text: %s\n", sourceLang, sourceText);
out.printf("TranslatedText:\n\tLang: %s, Text: %s\n", targetLang, translation.translatedText());
out.printf("TranslatedText:\n\tLang: %s, Text: %s\n", targetLang,
translation.getTranslatedText());
}


Expand All @@ -107,7 +108,8 @@ public static void translateTextWithOptions(

Translation translation = translate.translate(sourceText, srcLang, tgtLang);
out.printf("Source Text:\n\tLang: %s, Text: %s\n", sourceLang, sourceText);
out.printf("TranslatedText:\n\tLang: %s, Text: %s\n", targetLang, translation.translatedText());
out.printf("TranslatedText:\n\tLang: %s, Text: %s\n", targetLang,
translation.translatedText());
}

/**
Expand All @@ -122,7 +124,7 @@ public static void displaySupportedLanguages(PrintStream out, Optional<String> t
List<Language> languages = translate.listSupportedLanguages(target);

for (Language language : languages) {
out.printf("Name: %s, Code: %s\n", language.name(), language.code());
out.printf("Name: %s, Code: %s\n", language.getName(), language.getCode());
}
}

Expand All @@ -132,23 +134,23 @@ public static void displaySupportedLanguages(PrintStream out, Optional<String> t
* @return Google Translate Service
*/
public static Translate createTranslateService() {
TranslateOptions translateOption = TranslateOptions.builder()
.retryParams(retryParams())
.connectTimeout(60000)
.readTimeout(60000)
TranslateOptions translateOption = TranslateOptions.newBuilder()
.setRetryParams(retryParams())
.setConnectTimeout(60000)
.setReadTimeout(60000)
.build();
return translateOption.service();
return translateOption.getService();
}

/**
* Retry params for the Translate API.
*/
private static RetryParams retryParams() {
return RetryParams.builder()
.retryMaxAttempts(3)
.maxRetryDelayMillis(30000)
.totalRetryPeriodMillis(120000)
.initialRetryDelayMillis(250)
return RetryParams.newBuilder()
.setRetryMaxAttempts(3)
.setMaxRetryDelayMillis(30000)
.setTotalRetryPeriodMillis(120000)
.setInitialRetryDelayMillis(250)
.build();
}

Expand Down
2 changes: 1 addition & 1 deletion vision/face-detection/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-vision</artifactId>
<version>v1-rev29-1.22.0</version>
<version>v1-rev30-1.22.0</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
Expand Down
2 changes: 1 addition & 1 deletion vision/label/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-vision</artifactId>
<version>v1-rev29-1.22.0</version>
<version>v1-rev30-1.22.0</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
Expand Down
2 changes: 1 addition & 1 deletion vision/landmark-detection/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-vision</artifactId>
<version>v1-rev29-1.22.0</version>
<version>v1-rev30-1.22.0</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
Expand Down
2 changes: 1 addition & 1 deletion vision/text/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-vision</artifactId>
<version>v1-rev29-1.22.0</version>
<version>v1-rev30-1.22.0</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
Expand Down

0 comments on commit 7472602

Please sign in to comment.