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
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package google.cloud.language.v1beta2;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/protobuf/timestamp.proto";

option go_package = "google.golang.org/genproto/googleapis/cloud/language/v1beta2;language";
option java_multiple_files = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* 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.language.v1.samples;

// [START language_v1_generated_languageserviceclient_analyzeentities_async]
import com.google.api.core.ApiFuture;
import com.google.cloud.language.v1.AnalyzeEntitiesRequest;
import com.google.cloud.language.v1.AnalyzeEntitiesResponse;
import com.google.cloud.language.v1.Document;
import com.google.cloud.language.v1.EncodingType;
import com.google.cloud.language.v1.LanguageServiceClient;

public class AsyncAnalyzeEntities {

public static void main(String[] args) throws Exception {
asyncAnalyzeEntities();
}

public static void asyncAnalyzeEntities() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
AnalyzeEntitiesRequest request =
AnalyzeEntitiesRequest.newBuilder()
.setDocument(Document.newBuilder().build())
.setEncodingType(EncodingType.forNumber(0))
.build();
ApiFuture<AnalyzeEntitiesResponse> future =
languageServiceClient.analyzeEntitiesCallable().futureCall(request);
// Do something.
AnalyzeEntitiesResponse response = future.get();
}
}
}
// [END language_v1_generated_languageserviceclient_analyzeentities_async]
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.language.v1.samples;

// [START language_v1_generated_languageserviceclient_analyzeentities_sync]
import com.google.cloud.language.v1.AnalyzeEntitiesRequest;
import com.google.cloud.language.v1.AnalyzeEntitiesResponse;
import com.google.cloud.language.v1.Document;
import com.google.cloud.language.v1.EncodingType;
import com.google.cloud.language.v1.LanguageServiceClient;

public class SyncAnalyzeEntities {

public static void main(String[] args) throws Exception {
syncAnalyzeEntities();
}

public static void syncAnalyzeEntities() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
AnalyzeEntitiesRequest request =
AnalyzeEntitiesRequest.newBuilder()
.setDocument(Document.newBuilder().build())
.setEncodingType(EncodingType.forNumber(0))
.build();
AnalyzeEntitiesResponse response = languageServiceClient.analyzeEntities(request);
}
}
}
// [END language_v1_generated_languageserviceclient_analyzeentities_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* 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.language.v1.samples;

// [START language_v1_generated_languageserviceclient_analyzeentities_document_sync]
import com.google.cloud.language.v1.AnalyzeEntitiesResponse;
import com.google.cloud.language.v1.Document;
import com.google.cloud.language.v1.LanguageServiceClient;

public class SyncAnalyzeEntitiesDocument {

public static void main(String[] args) throws Exception {
syncAnalyzeEntitiesDocument();
}

public static void syncAnalyzeEntitiesDocument() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
Document document = Document.newBuilder().build();
AnalyzeEntitiesResponse response = languageServiceClient.analyzeEntities(document);
}
}
}
// [END language_v1_generated_languageserviceclient_analyzeentities_document_sync]
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.language.v1.samples;

// [START language_v1_generated_languageserviceclient_analyzeentities_documentencodingtype_sync]
import com.google.cloud.language.v1.AnalyzeEntitiesResponse;
import com.google.cloud.language.v1.Document;
import com.google.cloud.language.v1.EncodingType;
import com.google.cloud.language.v1.LanguageServiceClient;

public class SyncAnalyzeEntitiesDocumentEncodingtype {

public static void main(String[] args) throws Exception {
syncAnalyzeEntitiesDocumentEncodingtype();
}

public static void syncAnalyzeEntitiesDocumentEncodingtype() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
Document document = Document.newBuilder().build();
EncodingType encodingType = EncodingType.forNumber(0);
AnalyzeEntitiesResponse response =
languageServiceClient.analyzeEntities(document, encodingType);
}
}
}
// [END language_v1_generated_languageserviceclient_analyzeentities_documentencodingtype_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* 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.language.v1.samples;

// [START language_v1_generated_languageserviceclient_analyzeentitysentiment_async]
import com.google.api.core.ApiFuture;
import com.google.cloud.language.v1.AnalyzeEntitySentimentRequest;
import com.google.cloud.language.v1.AnalyzeEntitySentimentResponse;
import com.google.cloud.language.v1.Document;
import com.google.cloud.language.v1.EncodingType;
import com.google.cloud.language.v1.LanguageServiceClient;

public class AsyncAnalyzeEntitySentiment {

public static void main(String[] args) throws Exception {
asyncAnalyzeEntitySentiment();
}

public static void asyncAnalyzeEntitySentiment() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
AnalyzeEntitySentimentRequest request =
AnalyzeEntitySentimentRequest.newBuilder()
.setDocument(Document.newBuilder().build())
.setEncodingType(EncodingType.forNumber(0))
.build();
ApiFuture<AnalyzeEntitySentimentResponse> future =
languageServiceClient.analyzeEntitySentimentCallable().futureCall(request);
// Do something.
AnalyzeEntitySentimentResponse response = future.get();
}
}
}
// [END language_v1_generated_languageserviceclient_analyzeentitysentiment_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* 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.language.v1.samples;

// [START language_v1_generated_languageserviceclient_analyzeentitysentiment_sync]
import com.google.cloud.language.v1.AnalyzeEntitySentimentRequest;
import com.google.cloud.language.v1.AnalyzeEntitySentimentResponse;
import com.google.cloud.language.v1.Document;
import com.google.cloud.language.v1.EncodingType;
import com.google.cloud.language.v1.LanguageServiceClient;

public class SyncAnalyzeEntitySentiment {

public static void main(String[] args) throws Exception {
syncAnalyzeEntitySentiment();
}

public static void syncAnalyzeEntitySentiment() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
AnalyzeEntitySentimentRequest request =
AnalyzeEntitySentimentRequest.newBuilder()
.setDocument(Document.newBuilder().build())
.setEncodingType(EncodingType.forNumber(0))
.build();
AnalyzeEntitySentimentResponse response =
languageServiceClient.analyzeEntitySentiment(request);
}
}
}
// [END language_v1_generated_languageserviceclient_analyzeentitysentiment_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* 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.language.v1.samples;

// [START language_v1_generated_languageserviceclient_analyzeentitysentiment_document_sync]
import com.google.cloud.language.v1.AnalyzeEntitySentimentResponse;
import com.google.cloud.language.v1.Document;
import com.google.cloud.language.v1.LanguageServiceClient;

public class SyncAnalyzeEntitySentimentDocument {

public static void main(String[] args) throws Exception {
syncAnalyzeEntitySentimentDocument();
}

public static void syncAnalyzeEntitySentimentDocument() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
Document document = Document.newBuilder().build();
AnalyzeEntitySentimentResponse response =
languageServiceClient.analyzeEntitySentiment(document);
}
}
}
// [END language_v1_generated_languageserviceclient_analyzeentitysentiment_document_sync]
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.language.v1.samples;

// [START language_v1_generated_languageserviceclient_analyzeentitysentiment_documentencodingtype_sync]
import com.google.cloud.language.v1.AnalyzeEntitySentimentResponse;
import com.google.cloud.language.v1.Document;
import com.google.cloud.language.v1.EncodingType;
import com.google.cloud.language.v1.LanguageServiceClient;

public class SyncAnalyzeEntitySentimentDocumentEncodingtype {

public static void main(String[] args) throws Exception {
syncAnalyzeEntitySentimentDocumentEncodingtype();
}

public static void syncAnalyzeEntitySentimentDocumentEncodingtype() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
Document document = Document.newBuilder().build();
EncodingType encodingType = EncodingType.forNumber(0);
AnalyzeEntitySentimentResponse response =
languageServiceClient.analyzeEntitySentiment(document, encodingType);
}
}
}
// [END language_v1_generated_languageserviceclient_analyzeentitysentiment_documentencodingtype_sync]
Loading