-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: migrate code from googleapis/java-mediatranslation #7356
Merged
Merged
Changes from 61 commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
fb49652
feat: initial generation
chingor13 85ce08b
samples: use the released artifact directly (#11)
chingor13 5bfdb9d
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot 0d88a70
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot 8fbe9c3
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot 2b88e65
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot 61811db
media-translation-sample: translate from file (#15)
munkhuushmgl e475c14
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot b33073c
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot 640943e
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot 194ac9b
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot ed09ea8
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot be99513
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot 4eba25c
test(deps): update dependency junit:junit to v4.13.1 (#138)
renovate-bot 8fbc44d
test(deps): update dependency com.google.truth:truth to v1.1 (#147)
renovate-bot bdbc749
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot 71a3110
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot e7bcdb3
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot c8e2f47
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot e195a7d
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot b2d7ed0
test(deps): update dependency com.google.truth:truth to v1.1.2 (#204)
renovate-bot 1e545b5
test(deps): update dependency junit:junit to v4.13.2 (#220)
renovate-bot f2a776f
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot 1d1374e
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot 7568ce1
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot e7a7395
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot bd4c94f
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot b2bec30
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot 22e3fe0
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot 7ed6310
test(deps): update dependency com.google.truth:truth to v1.1.3 (#299)
renovate-bot 34b5c47
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot a4e485b
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot 68ddc03
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot ab70a03
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot d51e861
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot c11ed47
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot e51c0fc
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot 7a21a3e
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot 9bc6120
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot 4ea9649
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot ef49419
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot b15a86b
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot d5e482f
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot 080c155
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot 2ca0ad0
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot 1b04f74
docs(samples): remove unsupported field RecognitionResult (#631)
kweinmeister 08b8fcc
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot f430cbc
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot b93b0c3
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot 35f4278
feat: Enable REST transport for most of Java and Go clients (#658)
gcf-owl-bot[bot] da751d2
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot 0b7cca8
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot 480ae52
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot 6abcd33
chore(bazel): Update WORKSPACE files for rules_gapic, gax_java, gener…
gcf-owl-bot[bot] cbff39a
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot 857c865
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot 0cf8e40
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot b84955c
chore(deps): update dependency com.google.cloud:google-cloud-mediatra…
renovate-bot b285b98
Merge remote-tracking branch 'migration/main' into java-mediatranslat…
anguillanneuf a45759b
fix(mediatranslation): remove debugging field
anguillanneuf ff32010
fix region tag product name
anguillanneuf 7c81f83
remove generated samples from the migration
anguillanneuf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
[//]: # "This README.md file is auto-generated, all changes to this file will be lost." | ||
[//]: # "To regenerate it, use `python -m synthtool`." | ||
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/> | ||
|
||
# [Cloud Media Translation: Java Samples](https://github.com/googleapis/java-mediatranslation) | ||
|
||
[![Open in Cloud Shell][shell_img]][shell_link] | ||
|
||
|
||
|
||
## Table of Contents | ||
|
||
* [Build the sample](#build-the-sample) | ||
* [Samples](#samples) | ||
|
||
|
||
## Build the sample | ||
|
||
Install [Maven](http://maven.apache.org/). | ||
|
||
Build your project with: | ||
|
||
``` | ||
mvn clean package -DskipTests | ||
``` | ||
|
||
## Samples | ||
|
||
Please follow the [Set Up Your Project](https://cloud.google.com/media-translation/docs/getting-started#set_up_your_project) | ||
steps in the Quickstart doc to create a project and enable the Google Cloud | ||
Media Translation API. Following those steps, make sure that you | ||
[Set Up a Service Account](https://cloud.google.com/media-translation/docs/common/auth#set_up_a_service_account), | ||
and export the following environment variable: | ||
|
||
``` | ||
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/your-project-credentials.json | ||
``` | ||
|
||
After you have authorized, you can translate media. | ||
|
||
|
||
## Run | ||
Run all tests: | ||
``` | ||
mvn clean verify | ||
``` | ||
|
||
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png | ||
[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-mediatranslation&page=editor&open_in_editor=samples/snippets/README.md | ||
[product-docs]: https://cloud.google.com/mediatranslation/docs/ |
45 changes: 45 additions & 0 deletions
45
...ation/v1beta1/speechtranslationserviceclient/create/SyncCreateSetCredentialsProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.mediatranslation.v1beta1.samples; | ||
|
||
// [START mediatranslation_v1beta1_generated_speechtranslationserviceclient_create_setcredentialsprovider_sync] | ||
import com.google.api.gax.core.FixedCredentialsProvider; | ||
import com.google.cloud.mediatranslation.v1beta1.SpeechTranslationServiceClient; | ||
import com.google.cloud.mediatranslation.v1beta1.SpeechTranslationServiceSettings; | ||
import com.google.cloud.mediatranslation.v1beta1.myCredentials; | ||
|
||
public class SyncCreateSetCredentialsProvider { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncCreateSetCredentialsProvider(); | ||
} | ||
|
||
public static void syncCreateSetCredentialsProvider() throws Exception { | ||
// This snippet has been automatically generated and should be regarded as a code template only. | ||
// It will require modifications to work: | ||
// - It may require correct/in-range values for request initialization. | ||
// - It may require specifying regional endpoints when creating the service client as shown in | ||
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library | ||
SpeechTranslationServiceSettings speechTranslationServiceSettings = | ||
SpeechTranslationServiceSettings.newBuilder() | ||
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) | ||
.build(); | ||
SpeechTranslationServiceClient speechTranslationServiceClient = | ||
SpeechTranslationServiceClient.create(speechTranslationServiceSettings); | ||
} | ||
} | ||
// [END mediatranslation_v1beta1_generated_speechtranslationserviceclient_create_setcredentialsprovider_sync] |
44 changes: 44 additions & 0 deletions
44
...tion/v1beta1/speechtranslationserviceclient/create/SyncCreateSetCredentialsProvider1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.mediatranslation.v1beta1.samples; | ||
|
||
// [START mediatranslation_v1beta1_generated_speechtranslationserviceclient_create_setcredentialsprovider1_sync] | ||
import com.google.cloud.mediatranslation.v1beta1.SpeechTranslationServiceClient; | ||
import com.google.cloud.mediatranslation.v1beta1.SpeechTranslationServiceSettings; | ||
|
||
public class SyncCreateSetCredentialsProvider1 { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncCreateSetCredentialsProvider1(); | ||
} | ||
|
||
public static void syncCreateSetCredentialsProvider1() throws Exception { | ||
// This snippet has been automatically generated and should be regarded as a code template only. | ||
// It will require modifications to work: | ||
// - It may require correct/in-range values for request initialization. | ||
// - It may require specifying regional endpoints when creating the service client as shown in | ||
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library | ||
SpeechTranslationServiceSettings speechTranslationServiceSettings = | ||
SpeechTranslationServiceSettings.newBuilder() | ||
.setTransportChannelProvider( | ||
SpeechTranslationServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) | ||
.build(); | ||
SpeechTranslationServiceClient speechTranslationServiceClient = | ||
SpeechTranslationServiceClient.create(speechTranslationServiceSettings); | ||
} | ||
} | ||
// [END mediatranslation_v1beta1_generated_speechtranslationserviceclient_create_setcredentialsprovider1_sync] |
42 changes: 42 additions & 0 deletions
42
...mediatranslation/v1beta1/speechtranslationserviceclient/create/SyncCreateSetEndpoint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.mediatranslation.v1beta1.samples; | ||
|
||
// [START mediatranslation_v1beta1_generated_speechtranslationserviceclient_create_setendpoint_sync] | ||
import com.google.cloud.mediatranslation.v1beta1.SpeechTranslationServiceClient; | ||
import com.google.cloud.mediatranslation.v1beta1.SpeechTranslationServiceSettings; | ||
import com.google.cloud.mediatranslation.v1beta1.myEndpoint; | ||
|
||
public class SyncCreateSetEndpoint { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncCreateSetEndpoint(); | ||
} | ||
|
||
public static void syncCreateSetEndpoint() throws Exception { | ||
// This snippet has been automatically generated and should be regarded as a code template only. | ||
// It will require modifications to work: | ||
// - It may require correct/in-range values for request initialization. | ||
// - It may require specifying regional endpoints when creating the service client as shown in | ||
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library | ||
SpeechTranslationServiceSettings speechTranslationServiceSettings = | ||
SpeechTranslationServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); | ||
SpeechTranslationServiceClient speechTranslationServiceClient = | ||
SpeechTranslationServiceClient.create(speechTranslationServiceSettings); | ||
} | ||
} | ||
// [END mediatranslation_v1beta1_generated_speechtranslationserviceclient_create_setendpoint_sync] |
50 changes: 50 additions & 0 deletions
50
...peechtranslationserviceclient/streamingtranslatespeech/AsyncStreamingTranslateSpeech.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.mediatranslation.v1beta1.samples; | ||
|
||
// [START mediatranslation_v1beta1_generated_speechtranslationserviceclient_streamingtranslatespeech_async] | ||
import com.google.api.gax.rpc.BidiStream; | ||
import com.google.cloud.mediatranslation.v1beta1.SpeechTranslationServiceClient; | ||
import com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest; | ||
import com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse; | ||
|
||
public class AsyncStreamingTranslateSpeech { | ||
|
||
public static void main(String[] args) throws Exception { | ||
asyncStreamingTranslateSpeech(); | ||
} | ||
|
||
public static void asyncStreamingTranslateSpeech() throws Exception { | ||
// This snippet has been automatically generated and should be regarded as a code template only. | ||
// It will require modifications to work: | ||
// - It may require correct/in-range values for request initialization. | ||
// - It may require specifying regional endpoints when creating the service client as shown in | ||
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library | ||
try (SpeechTranslationServiceClient speechTranslationServiceClient = | ||
SpeechTranslationServiceClient.create()) { | ||
BidiStream<StreamingTranslateSpeechRequest, StreamingTranslateSpeechResponse> bidiStream = | ||
speechTranslationServiceClient.streamingTranslateSpeechCallable().call(); | ||
StreamingTranslateSpeechRequest request = | ||
StreamingTranslateSpeechRequest.newBuilder().build(); | ||
bidiStream.send(request); | ||
for (StreamingTranslateSpeechResponse response : bidiStream) { | ||
// Do something when a response is received. | ||
} | ||
} | ||
} | ||
} | ||
// [END mediatranslation_v1beta1_generated_speechtranslationserviceclient_streamingtranslatespeech_async] |
50 changes: 50 additions & 0 deletions
50
...eechtranslationservicesettings/streamingtranslatespeech/SyncStreamingTranslateSpeech.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
anguillanneuf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.mediatranslation.v1beta1.samples; | ||
|
||
// [START mediatranslation_v1beta1_generated_speechtranslationservicesettings_streamingtranslatespeech_sync] | ||
import com.google.cloud.mediatranslation.v1beta1.SpeechTranslationServiceSettings; | ||
import java.time.Duration; | ||
|
||
public class SyncStreamingTranslateSpeech { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncStreamingTranslateSpeech(); | ||
} | ||
|
||
public static void syncStreamingTranslateSpeech() throws Exception { | ||
// This snippet has been automatically generated and should be regarded as a code template only. | ||
// It will require modifications to work: | ||
// - It may require correct/in-range values for request initialization. | ||
// - It may require specifying regional endpoints when creating the service client as shown in | ||
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library | ||
SpeechTranslationServiceSettings.Builder speechTranslationServiceSettingsBuilder = | ||
SpeechTranslationServiceSettings.newBuilder(); | ||
speechTranslationServiceSettingsBuilder | ||
.streamingTranslateSpeechSettings() | ||
.setRetrySettings( | ||
speechTranslationServiceSettingsBuilder | ||
.streamingTranslateSpeechSettings() | ||
.getRetrySettings() | ||
.toBuilder() | ||
.setTotalTimeout(Duration.ofSeconds(30)) | ||
.build()); | ||
SpeechTranslationServiceSettings speechTranslationServiceSettings = | ||
speechTranslationServiceSettingsBuilder.build(); | ||
} | ||
} | ||
// [END mediatranslation_v1beta1_generated_speechtranslationservicesettings_streamingtranslatespeech_sync] |
50 changes: 50 additions & 0 deletions
50
...translationservicestubsettings/streamingtranslatespeech/SyncStreamingTranslateSpeech.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.mediatranslation.v1beta1.stub.samples; | ||
|
||
// [START mediatranslation_v1beta1_generated_speechtranslationservicestubsettings_streamingtranslatespeech_sync] | ||
import com.google.cloud.mediatranslation.v1beta1.stub.SpeechTranslationServiceStubSettings; | ||
import java.time.Duration; | ||
|
||
public class SyncStreamingTranslateSpeech { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncStreamingTranslateSpeech(); | ||
} | ||
|
||
public static void syncStreamingTranslateSpeech() throws Exception { | ||
// This snippet has been automatically generated and should be regarded as a code template only. | ||
// It will require modifications to work: | ||
// - It may require correct/in-range values for request initialization. | ||
// - It may require specifying regional endpoints when creating the service client as shown in | ||
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library | ||
SpeechTranslationServiceStubSettings.Builder speechTranslationServiceSettingsBuilder = | ||
SpeechTranslationServiceStubSettings.newBuilder(); | ||
speechTranslationServiceSettingsBuilder | ||
.streamingTranslateSpeechSettings() | ||
.setRetrySettings( | ||
speechTranslationServiceSettingsBuilder | ||
.streamingTranslateSpeechSettings() | ||
.getRetrySettings() | ||
.toBuilder() | ||
.setTotalTimeout(Duration.ofSeconds(30)) | ||
.build()); | ||
SpeechTranslationServiceStubSettings speechTranslationServiceSettings = | ||
speechTranslationServiceSettingsBuilder.build(); | ||
} | ||
} | ||
// [END mediatranslation_v1beta1_generated_speechtranslationservicestubsettings_streamingtranslatespeech_sync] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<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"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.google.cloud</groupId> | ||
<artifactId>mediatranslation-snippets</artifactId> | ||
<packaging>jar</packaging> | ||
<name>Google Media Translation API Snippets</name> | ||
<url>https://github.com/googleapis/java-mediatranslation</url> | ||
|
||
<!-- | ||
The parent pom defines common style checks and testing strategies for our samples. | ||
Removing or replacing it should not affect the execution of the samples in anyway. | ||
--> | ||
<parent> | ||
<groupId>com.google.cloud.samples</groupId> | ||
<artifactId>shared-configuration</artifactId> | ||
<version>1.2.0</version> | ||
</parent> | ||
|
||
<properties> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.google.cloud</groupId> | ||
<artifactId>google-cloud-mediatranslation</artifactId> | ||
<version>0.9.6</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.13.2</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.truth</groupId> | ||
<artifactId>truth</artifactId> | ||
<version>1.1.3</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to decide if we want to use this readme and if we want to create sub-directories within the product directory to prepare for future (separate) samples
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack.