From 0af8e03d9dbb5ccb1f8c72243bfa6934ed961cb0 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 25 May 2023 07:56:00 +0000 Subject: [PATCH] feat: Added client library support for ModerateText in the Natural Language API (V1) PiperOrigin-RevId: 534992604 Source-Link: https://github.com/googleapis/googleapis/commit/2400facb5e4d93de884e58d38656b707df43fffa Source-Link: https://github.com/googleapis/googleapis-gen/commit/32caa580131b05b880fa3b802ca0c21179881733 Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuTGFuZ3VhZ2UuVjEvLk93bEJvdC55YW1sIiwiaCI6IjMyY2FhNTgwMTMxYjA1Yjg4MGZhM2I4MDJjYTBjMjExNzk4ODE3MzMifQ== --- ...erviceClient.ModerateTextAsyncSnippet.g.cs | 44 ++ ...ModerateTextRequestObjectAsyncSnippet.g.cs | 47 ++ ...ient.ModerateTextRequestObjectSnippet.g.cs | 46 ++ ...uageServiceClient.ModerateTextSnippet.g.cs | 43 ++ ...pet_metadata_google.cloud.language.v1.json | 192 ++++++ .../LanguageServiceClientSnippets.g.cs | 60 ++ .../LanguageService.g.cs | 586 ++++++++++++++++-- .../LanguageServiceClient.g.cs | 112 ++++ .../LanguageServiceGrpc.g.cs | 74 +++ .../gapic_metadata.json | 6 + 10 files changed, 1151 insertions(+), 59 deletions(-) create mode 100644 apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextAsyncSnippet.g.cs create mode 100644 apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextRequestObjectAsyncSnippet.g.cs create mode 100644 apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextRequestObjectSnippet.g.cs create mode 100644 apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextSnippet.g.cs diff --git a/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextAsyncSnippet.g.cs b/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextAsyncSnippet.g.cs new file mode 100644 index 000000000000..cbab4dff8698 --- /dev/null +++ b/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextAsyncSnippet.g.cs @@ -0,0 +1,44 @@ +// Copyright 2023 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. + +// Generated code. DO NOT EDIT! + +namespace GoogleCSharpSnippets +{ + // [START language_v1_generated_LanguageService_ModerateText_async_flattened] + using Google.Cloud.Language.V1; + using System.Threading.Tasks; + + public sealed partial class GeneratedLanguageServiceClientSnippets + { + /// Snippet for ModerateTextAsync + /// + /// 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/dotnet/docs/reference/help/client-configuration#endpoint. + /// + public async Task ModerateTextAsync() + { + // Create client + LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync(); + // Initialize request argument(s) + Document document = new Document(); + // Make the request + ModerateTextResponse response = await languageServiceClient.ModerateTextAsync(document); + } + } + // [END language_v1_generated_LanguageService_ModerateText_async_flattened] +} diff --git a/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextRequestObjectAsyncSnippet.g.cs b/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextRequestObjectAsyncSnippet.g.cs new file mode 100644 index 000000000000..7f975e86ff5a --- /dev/null +++ b/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextRequestObjectAsyncSnippet.g.cs @@ -0,0 +1,47 @@ +// Copyright 2023 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. + +// Generated code. DO NOT EDIT! + +namespace GoogleCSharpSnippets +{ + // [START language_v1_generated_LanguageService_ModerateText_async] + using Google.Cloud.Language.V1; + using System.Threading.Tasks; + + public sealed partial class GeneratedLanguageServiceClientSnippets + { + /// Snippet for ModerateTextAsync + /// + /// 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/dotnet/docs/reference/help/client-configuration#endpoint. + /// + public async Task ModerateTextRequestObjectAsync() + { + // Create client + LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync(); + // Initialize request argument(s) + ModerateTextRequest request = new ModerateTextRequest + { + Document = new Document(), + }; + // Make the request + ModerateTextResponse response = await languageServiceClient.ModerateTextAsync(request); + } + } + // [END language_v1_generated_LanguageService_ModerateText_async] +} diff --git a/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextRequestObjectSnippet.g.cs b/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextRequestObjectSnippet.g.cs new file mode 100644 index 000000000000..7267ebe40e93 --- /dev/null +++ b/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextRequestObjectSnippet.g.cs @@ -0,0 +1,46 @@ +// Copyright 2023 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. + +// Generated code. DO NOT EDIT! + +namespace GoogleCSharpSnippets +{ + // [START language_v1_generated_LanguageService_ModerateText_sync] + using Google.Cloud.Language.V1; + + public sealed partial class GeneratedLanguageServiceClientSnippets + { + /// Snippet for ModerateText + /// + /// 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/dotnet/docs/reference/help/client-configuration#endpoint. + /// + public void ModerateTextRequestObject() + { + // Create client + LanguageServiceClient languageServiceClient = LanguageServiceClient.Create(); + // Initialize request argument(s) + ModerateTextRequest request = new ModerateTextRequest + { + Document = new Document(), + }; + // Make the request + ModerateTextResponse response = languageServiceClient.ModerateText(request); + } + } + // [END language_v1_generated_LanguageService_ModerateText_sync] +} diff --git a/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextSnippet.g.cs b/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextSnippet.g.cs new file mode 100644 index 000000000000..8e17754534a1 --- /dev/null +++ b/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextSnippet.g.cs @@ -0,0 +1,43 @@ +// Copyright 2023 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. + +// Generated code. DO NOT EDIT! + +namespace GoogleCSharpSnippets +{ + // [START language_v1_generated_LanguageService_ModerateText_sync_flattened] + using Google.Cloud.Language.V1; + + public sealed partial class GeneratedLanguageServiceClientSnippets + { + /// Snippet for ModerateText + /// + /// 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/dotnet/docs/reference/help/client-configuration#endpoint. + /// + public void ModerateText() + { + // Create client + LanguageServiceClient languageServiceClient = LanguageServiceClient.Create(); + // Initialize request argument(s) + Document document = new Document(); + // Make the request + ModerateTextResponse response = languageServiceClient.ModerateText(document); + } + } + // [END language_v1_generated_LanguageService_ModerateText_sync_flattened] +} diff --git a/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/snippet_metadata_google.cloud.language.v1.json b/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/snippet_metadata_google.cloud.language.v1.json index 42572815cb12..1f69f855c8ca 100644 --- a/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/snippet_metadata_google.cloud.language.v1.json +++ b/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.GeneratedSnippets/snippet_metadata_google.cloud.language.v1.json @@ -1382,6 +1382,198 @@ } ] }, + { + "regionTag": "language_v1_generated_LanguageService_ModerateText_sync", + "title": "ModerateTextRequestObject", + "description": "Snippet for ModerateText", + "file": "LanguageServiceClient.ModerateTextRequestObjectSnippet.g.cs", + "language": "C_SHARP", + "clientMethod": { + "shortName": "ModerateText", + "fullName": "Google.Cloud.Language.V1.LanguageServiceClient.ModerateText", + "parameters": [ + { + "type": "Google.Cloud.Language.V1.ModerateTextRequest", + "name": "request" + }, + { + "type": "Google.Api.Gax.Grpc.CallSettings", + "name": "callSettings" + } + ], + "resultType": "Google.Cloud.Language.V1.ModerateTextResponse", + "client": { + "shortName": "LanguageServiceClient", + "fullName": "Google.Cloud.Language.V1.LanguageServiceClient" + }, + "method": { + "shortName": "ModerateText", + "fullName": "google.cloud.language.v1.LanguageService.ModerateText", + "service": { + "shortName": "LanguageService", + "fullName": "google.cloud.language.v1.LanguageService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 44, + "type": "FULL" + }, + { + "start": 34, + "end": 42, + "type": "SHORT" + } + ] + }, + { + "regionTag": "language_v1_generated_LanguageService_ModerateText_async", + "title": "ModerateTextRequestObjectAsync", + "description": "Snippet for ModerateTextAsync", + "file": "LanguageServiceClient.ModerateTextRequestObjectAsyncSnippet.g.cs", + "language": "C_SHARP", + "clientMethod": { + "shortName": "ModerateTextAsync", + "fullName": "Google.Cloud.Language.V1.LanguageServiceClient.ModerateTextAsync", + "async": true, + "parameters": [ + { + "type": "Google.Cloud.Language.V1.ModerateTextRequest", + "name": "request" + }, + { + "type": "Google.Api.Gax.Grpc.CallSettings", + "name": "callSettings" + } + ], + "resultType": "System.Threading.Tasks.Task", + "client": { + "shortName": "LanguageServiceClient", + "fullName": "Google.Cloud.Language.V1.LanguageServiceClient" + }, + "method": { + "shortName": "ModerateText", + "fullName": "google.cloud.language.v1.LanguageService.ModerateText", + "service": { + "shortName": "LanguageService", + "fullName": "google.cloud.language.v1.LanguageService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + }, + { + "start": 35, + "end": 43, + "type": "SHORT" + } + ] + }, + { + "regionTag": "language_v1_generated_LanguageService_ModerateText_sync_flattened", + "title": "ModerateText", + "description": "Snippet for ModerateText", + "file": "LanguageServiceClient.ModerateTextSnippet.g.cs", + "language": "C_SHARP", + "clientMethod": { + "shortName": "ModerateText", + "fullName": "Google.Cloud.Language.V1.LanguageServiceClient.ModerateText", + "parameters": [ + { + "type": "Google.Cloud.Language.V1.Document", + "name": "document" + }, + { + "type": "Google.Api.Gax.Grpc.CallSettings", + "name": "callSettings" + } + ], + "resultType": "Google.Cloud.Language.V1.ModerateTextResponse", + "client": { + "shortName": "LanguageServiceClient", + "fullName": "Google.Cloud.Language.V1.LanguageServiceClient" + }, + "method": { + "shortName": "ModerateText", + "fullName": "google.cloud.language.v1.LanguageService.ModerateText", + "service": { + "shortName": "LanguageService", + "fullName": "google.cloud.language.v1.LanguageService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 41, + "type": "FULL" + }, + { + "start": 34, + "end": 39, + "type": "SHORT" + } + ] + }, + { + "regionTag": "language_v1_generated_LanguageService_ModerateText_async_flattened", + "title": "ModerateTextAsync", + "description": "Snippet for ModerateTextAsync", + "file": "LanguageServiceClient.ModerateTextAsyncSnippet.g.cs", + "language": "C_SHARP", + "clientMethod": { + "shortName": "ModerateTextAsync", + "fullName": "Google.Cloud.Language.V1.LanguageServiceClient.ModerateTextAsync", + "async": true, + "parameters": [ + { + "type": "Google.Cloud.Language.V1.Document", + "name": "document" + }, + { + "type": "Google.Api.Gax.Grpc.CallSettings", + "name": "callSettings" + } + ], + "resultType": "System.Threading.Tasks.Task", + "client": { + "shortName": "LanguageServiceClient", + "fullName": "Google.Cloud.Language.V1.LanguageServiceClient" + }, + "method": { + "shortName": "ModerateText", + "fullName": "google.cloud.language.v1.LanguageService.ModerateText", + "service": { + "shortName": "LanguageService", + "fullName": "google.cloud.language.v1.LanguageService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 42, + "type": "FULL" + }, + { + "start": 35, + "end": 40, + "type": "SHORT" + } + ] + }, { "regionTag": "language_v1_generated_LanguageService_AnnotateText_sync", "title": "AnnotateTextRequestObject", diff --git a/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.Snippets/LanguageServiceClientSnippets.g.cs b/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.Snippets/LanguageServiceClientSnippets.g.cs index 00eb5dad7f09..91bc6d324222 100644 --- a/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.Snippets/LanguageServiceClientSnippets.g.cs +++ b/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1.Snippets/LanguageServiceClientSnippets.g.cs @@ -448,6 +448,66 @@ public async Task ClassifyTextAsync() // End snippet } + /// Snippet for ModerateText + public void ModerateTextRequestObject() + { + // Snippet: ModerateText(ModerateTextRequest, CallSettings) + // Create client + LanguageServiceClient languageServiceClient = LanguageServiceClient.Create(); + // Initialize request argument(s) + ModerateTextRequest request = new ModerateTextRequest + { + Document = new Document(), + }; + // Make the request + ModerateTextResponse response = languageServiceClient.ModerateText(request); + // End snippet + } + + /// Snippet for ModerateTextAsync + public async Task ModerateTextRequestObjectAsync() + { + // Snippet: ModerateTextAsync(ModerateTextRequest, CallSettings) + // Additional: ModerateTextAsync(ModerateTextRequest, CancellationToken) + // Create client + LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync(); + // Initialize request argument(s) + ModerateTextRequest request = new ModerateTextRequest + { + Document = new Document(), + }; + // Make the request + ModerateTextResponse response = await languageServiceClient.ModerateTextAsync(request); + // End snippet + } + + /// Snippet for ModerateText + public void ModerateText() + { + // Snippet: ModerateText(Document, CallSettings) + // Create client + LanguageServiceClient languageServiceClient = LanguageServiceClient.Create(); + // Initialize request argument(s) + Document document = new Document(); + // Make the request + ModerateTextResponse response = languageServiceClient.ModerateText(document); + // End snippet + } + + /// Snippet for ModerateTextAsync + public async Task ModerateTextAsync() + { + // Snippet: ModerateTextAsync(Document, CallSettings) + // Additional: ModerateTextAsync(Document, CancellationToken) + // Create client + LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync(); + // Initialize request argument(s) + Document document = new Document(); + // Make the request + ModerateTextResponse response = await languageServiceClient.ModerateTextAsync(document); + // End snippet + } + /// Snippet for AnnotateText public void AnnotateTextRequestObject() { diff --git a/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1/LanguageService.g.cs b/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1/LanguageService.g.cs index e1d742b0a44e..8c906e45ec1b 100644 --- a/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1/LanguageService.g.cs +++ b/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1/LanguageService.g.cs @@ -169,59 +169,69 @@ public static partial class LanguageServiceReflection { "ZGVsX29wdGlvbnMYAyABKAsyNC5nb29nbGUuY2xvdWQubGFuZ3VhZ2UudjEu", "Q2xhc3NpZmljYXRpb25Nb2RlbE9wdGlvbnMiXAoUQ2xhc3NpZnlUZXh0UmVz", "cG9uc2USRAoKY2F0ZWdvcmllcxgBIAMoCzIwLmdvb2dsZS5jbG91ZC5sYW5n", - "dWFnZS52MS5DbGFzc2lmaWNhdGlvbkNhdGVnb3J5ItYDChNBbm5vdGF0ZVRl", - "eHRSZXF1ZXN0EjkKCGRvY3VtZW50GAEgASgLMiIuZ29vZ2xlLmNsb3VkLmxh", - "bmd1YWdlLnYxLkRvY3VtZW50QgPgQQISTQoIZmVhdHVyZXMYAiABKAsyNi5n", - "b29nbGUuY2xvdWQubGFuZ3VhZ2UudjEuQW5ub3RhdGVUZXh0UmVxdWVzdC5G", - "ZWF0dXJlc0ID4EECEj0KDWVuY29kaW5nX3R5cGUYAyABKA4yJi5nb29nbGUu", - "Y2xvdWQubGFuZ3VhZ2UudjEuRW5jb2RpbmdUeXBlGvUBCghGZWF0dXJlcxIW", - "Cg5leHRyYWN0X3N5bnRheBgBIAEoCBIYChBleHRyYWN0X2VudGl0aWVzGAIg", - "ASgIEiIKGmV4dHJhY3RfZG9jdW1lbnRfc2VudGltZW50GAMgASgIEiAKGGV4", - "dHJhY3RfZW50aXR5X3NlbnRpbWVudBgEIAEoCBIVCg1jbGFzc2lmeV90ZXh0", - "GAYgASg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dvb2dsZWFwaXMuY29t0kFdaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5j", + "b20vYXV0aC9jbG91ZC1sYW5ndWFnZSxodHRwczovL3d3dy5nb29nbGVhcGlz", + "LmNvbS9hdXRoL2Nsb3VkLXBsYXRmb3JtQnAKHGNvbS5nb29nbGUuY2xvdWQu", + "bGFuZ3VhZ2UudjFCFExhbmd1YWdlU2VydmljZVByb3RvUAFaOGNsb3VkLmdv", + "b2dsZS5jb20vZ28vbGFuZ3VhZ2UvYXBpdjEvbGFuZ3VhZ2VwYjtsYW5ndWFn", + "ZXBiYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Api.AnnotationsReflection.Descriptor, global::Google.Api.ClientReflection.Descriptor, global::Google.Api.FieldBehaviorReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Cloud.Language.V1.EncodingType), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -247,8 +257,10 @@ public static partial class LanguageServiceReflection { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Language.V1.AnalyzeSyntaxResponse), global::Google.Cloud.Language.V1.AnalyzeSyntaxResponse.Parser, new[]{ "Sentences", "Tokens", "Language" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Language.V1.ClassifyTextRequest), global::Google.Cloud.Language.V1.ClassifyTextRequest.Parser, new[]{ "Document", "ClassificationModelOptions" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Language.V1.ClassifyTextResponse), global::Google.Cloud.Language.V1.ClassifyTextResponse.Parser, new[]{ "Categories" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Language.V1.AnnotateTextRequest), global::Google.Cloud.Language.V1.AnnotateTextRequest.Parser, new[]{ "Document", "Features", "EncodingType" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Language.V1.AnnotateTextRequest.Types.Features), global::Google.Cloud.Language.V1.AnnotateTextRequest.Types.Features.Parser, new[]{ "ExtractSyntax", "ExtractEntities", "ExtractDocumentSentiment", "ExtractEntitySentiment", "ClassifyText", "ClassificationModelOptions" }, null, null, null, null)}), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Language.V1.AnnotateTextResponse), global::Google.Cloud.Language.V1.AnnotateTextResponse.Parser, new[]{ "Sentences", "Tokens", "Entities", "DocumentSentiment", "Language", "Categories" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Language.V1.ModerateTextRequest), global::Google.Cloud.Language.V1.ModerateTextRequest.Parser, new[]{ "Document" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Language.V1.ModerateTextResponse), global::Google.Cloud.Language.V1.ModerateTextResponse.Parser, new[]{ "ModerationCategories" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Language.V1.AnnotateTextRequest), global::Google.Cloud.Language.V1.AnnotateTextRequest.Parser, new[]{ "Document", "Features", "EncodingType" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Language.V1.AnnotateTextRequest.Types.Features), global::Google.Cloud.Language.V1.AnnotateTextRequest.Types.Features.Parser, new[]{ "ExtractSyntax", "ExtractEntities", "ExtractDocumentSentiment", "ExtractEntitySentiment", "ClassifyText", "ModerateText", "ClassificationModelOptions" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Language.V1.AnnotateTextResponse), global::Google.Cloud.Language.V1.AnnotateTextResponse.Parser, new[]{ "Sentences", "Tokens", "Entities", "DocumentSentiment", "Language", "Categories", "ModerationCategories" }, null, null, null, null) })); } #endregion @@ -4293,8 +4305,7 @@ public sealed partial class ClassificationCategory : pb::IMessage - /// The name of the category representing the document, from the [predefined - /// taxonomy](https://cloud.google.com/natural-language/docs/categories). + /// The name of the category representing the document. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -7560,6 +7571,394 @@ public sealed partial class ClassifyTextResponse : pb::IMessage + /// The document moderation request message. + /// + public sealed partial class ModerateTextRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ModerateTextRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Google.Cloud.Language.V1.LanguageServiceReflection.Descriptor.MessageTypes[21]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ModerateTextRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ModerateTextRequest(ModerateTextRequest other) : this() { + document_ = other.document_ != null ? other.document_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ModerateTextRequest Clone() { + return new ModerateTextRequest(this); + } + + /// Field number for the "document" field. + public const int DocumentFieldNumber = 1; + private global::Google.Cloud.Language.V1.Document document_; + /// + /// Required. Input document. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Google.Cloud.Language.V1.Document Document { + get { return document_; } + set { + document_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ModerateTextRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ModerateTextRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Document, other.Document)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (document_ != null) hash ^= Document.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (document_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Document); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (document_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Document); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (document_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Document); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ModerateTextRequest other) { + if (other == null) { + return; + } + if (other.document_ != null) { + if (document_ == null) { + Document = new global::Google.Cloud.Language.V1.Document(); + } + Document.MergeFrom(other.Document); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (document_ == null) { + Document = new global::Google.Cloud.Language.V1.Document(); + } + input.ReadMessage(Document); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (document_ == null) { + Document = new global::Google.Cloud.Language.V1.Document(); + } + input.ReadMessage(Document); + break; + } + } + } + } + #endif + + } + + /// + /// The document moderation response message. + /// + public sealed partial class ModerateTextResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ModerateTextResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Google.Cloud.Language.V1.LanguageServiceReflection.Descriptor.MessageTypes[22]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ModerateTextResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ModerateTextResponse(ModerateTextResponse other) : this() { + moderationCategories_ = other.moderationCategories_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ModerateTextResponse Clone() { + return new ModerateTextResponse(this); + } + + /// Field number for the "moderation_categories" field. + public const int ModerationCategoriesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_moderationCategories_codec + = pb::FieldCodec.ForMessage(10, global::Google.Cloud.Language.V1.ClassificationCategory.Parser); + private readonly pbc::RepeatedField moderationCategories_ = new pbc::RepeatedField(); + /// + /// Harmful and sensitive categories representing the input document. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ModerationCategories { + get { return moderationCategories_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ModerateTextResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ModerateTextResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!moderationCategories_.Equals(other.moderationCategories_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= moderationCategories_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + moderationCategories_.WriteTo(output, _repeated_moderationCategories_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + moderationCategories_.WriteTo(ref output, _repeated_moderationCategories_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += moderationCategories_.CalculateSize(_repeated_moderationCategories_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ModerateTextResponse other) { + if (other == null) { + return; + } + moderationCategories_.Add(other.moderationCategories_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + moderationCategories_.AddEntriesFrom(input, _repeated_moderationCategories_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + moderationCategories_.AddEntriesFrom(ref input, _repeated_moderationCategories_codec); + break; + } + } + } + } + #endif + + } + /// /// The request message for the text annotation API, which can perform multiple /// analysis types (sentiment, entities, and syntax) in one call. @@ -7578,7 +7977,7 @@ public sealed partial class AnnotateTextRequest : pb::IMessage extractDocumentSentiment_ = other.extractDocumentSentiment_; extractEntitySentiment_ = other.extractEntitySentiment_; classifyText_ = other.classifyText_; + moderateText_ = other.moderateText_; classificationModelOptions_ = other.classificationModelOptions_ != null ? other.classificationModelOptions_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } @@ -7985,6 +8385,21 @@ public sealed partial class Features : pb::IMessage } } + /// Field number for the "moderate_text" field. + public const int ModerateTextFieldNumber = 11; + private bool moderateText_; + /// + /// Moderate the document for harmful and sensitive categories. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ModerateText { + get { return moderateText_; } + set { + moderateText_ = value; + } + } + /// Field number for the "classification_model_options" field. public const int ClassificationModelOptionsFieldNumber = 10; private global::Google.Cloud.Language.V1.ClassificationModelOptions classificationModelOptions_; @@ -8021,6 +8436,7 @@ public sealed partial class Features : pb::IMessage if (ExtractDocumentSentiment != other.ExtractDocumentSentiment) return false; if (ExtractEntitySentiment != other.ExtractEntitySentiment) return false; if (ClassifyText != other.ClassifyText) return false; + if (ModerateText != other.ModerateText) return false; if (!object.Equals(ClassificationModelOptions, other.ClassificationModelOptions)) return false; return Equals(_unknownFields, other._unknownFields); } @@ -8034,6 +8450,7 @@ public sealed partial class Features : pb::IMessage if (ExtractDocumentSentiment != false) hash ^= ExtractDocumentSentiment.GetHashCode(); if (ExtractEntitySentiment != false) hash ^= ExtractEntitySentiment.GetHashCode(); if (ClassifyText != false) hash ^= ClassifyText.GetHashCode(); + if (ModerateText != false) hash ^= ModerateText.GetHashCode(); if (classificationModelOptions_ != null) hash ^= ClassificationModelOptions.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); @@ -8077,6 +8494,10 @@ public sealed partial class Features : pb::IMessage output.WriteRawTag(82); output.WriteMessage(ClassificationModelOptions); } + if (ModerateText != false) { + output.WriteRawTag(88); + output.WriteBool(ModerateText); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -8111,6 +8532,10 @@ public sealed partial class Features : pb::IMessage output.WriteRawTag(82); output.WriteMessage(ClassificationModelOptions); } + if (ModerateText != false) { + output.WriteRawTag(88); + output.WriteBool(ModerateText); + } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -8136,6 +8561,9 @@ public sealed partial class Features : pb::IMessage if (ClassifyText != false) { size += 1 + 1; } + if (ModerateText != false) { + size += 1 + 1; + } if (classificationModelOptions_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(ClassificationModelOptions); } @@ -8166,6 +8594,9 @@ public sealed partial class Features : pb::IMessage if (other.ClassifyText != false) { ClassifyText = other.ClassifyText; } + if (other.ModerateText != false) { + ModerateText = other.ModerateText; + } if (other.classificationModelOptions_ != null) { if (classificationModelOptions_ == null) { ClassificationModelOptions = new global::Google.Cloud.Language.V1.ClassificationModelOptions(); @@ -8214,6 +8645,10 @@ public sealed partial class Features : pb::IMessage input.ReadMessage(ClassificationModelOptions); break; } + case 88: { + ModerateText = input.ReadBool(); + break; + } } } #endif @@ -8256,6 +8691,10 @@ public sealed partial class Features : pb::IMessage input.ReadMessage(ClassificationModelOptions); break; } + case 88: { + ModerateText = input.ReadBool(); + break; + } } } } @@ -8285,7 +8724,7 @@ public sealed partial class AnnotateTextResponse : pb::IMessageField number for the "moderation_categories" field. + public const int ModerationCategoriesFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_moderationCategories_codec + = pb::FieldCodec.ForMessage(58, global::Google.Cloud.Language.V1.ClassificationCategory.Parser); + private readonly pbc::RepeatedField moderationCategories_ = new pbc::RepeatedField(); + /// + /// Harmful and sensitive categories identified in the input document. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ModerationCategories { + get { return moderationCategories_; } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { @@ -8436,6 +8890,7 @@ public sealed partial class AnnotateTextResponse : pb::IMessage public gaxgrpc::CallSettings ClassifyTextSettings { get; set; } = gaxgrpc::CallSettingsExtensions.WithRetry(gaxgrpc::CallSettings.FromExpiration(gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(600000))), gaxgrpc::RetrySettings.FromExponentialBackoff(maxAttempts: 2147483647, initialBackoff: sys::TimeSpan.FromMilliseconds(100), maxBackoff: sys::TimeSpan.FromMilliseconds(60000), backoffMultiplier: 1.3, retryFilter: gaxgrpc::RetrySettings.FilterForStatusCodes(grpccore::StatusCode.DeadlineExceeded, grpccore::StatusCode.Unavailable))); + /// + /// for synchronous and asynchronous calls to + /// LanguageServiceClient.ModerateText and LanguageServiceClient.ModerateTextAsync. + /// + /// + /// + /// This call will not be retried. + /// No timeout is applied. + /// + /// + public gaxgrpc::CallSettings ModerateTextSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// /// for synchronous and asynchronous calls to /// LanguageServiceClient.AnnotateText and LanguageServiceClient.AnnotateTextAsync. @@ -781,6 +794,72 @@ internal static LanguageServiceClient Create(grpccore::CallInvoker callInvoker, public virtual stt::Task ClassifyTextAsync(Document document, st::CancellationToken cancellationToken) => ClassifyTextAsync(document, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// + /// Moderates a document for harmful and sensitive categories. + /// + /// The request object containing all of the parameters for the API call. + /// If not null, applies overrides to this RPC call. + /// The RPC response. + public virtual ModerateTextResponse ModerateText(ModerateTextRequest request, gaxgrpc::CallSettings callSettings = null) => + throw new sys::NotImplementedException(); + + /// + /// Moderates a document for harmful and sensitive categories. + /// + /// The request object containing all of the parameters for the API call. + /// If not null, applies overrides to this RPC call. + /// A Task containing the RPC response. + public virtual stt::Task ModerateTextAsync(ModerateTextRequest request, gaxgrpc::CallSettings callSettings = null) => + throw new sys::NotImplementedException(); + + /// + /// Moderates a document for harmful and sensitive categories. + /// + /// The request object containing all of the parameters for the API call. + /// A to use for this RPC. + /// A Task containing the RPC response. + public virtual stt::Task ModerateTextAsync(ModerateTextRequest request, st::CancellationToken cancellationToken) => + ModerateTextAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Moderates a document for harmful and sensitive categories. + /// + /// + /// Required. Input document. + /// + /// If not null, applies overrides to this RPC call. + /// The RPC response. + public virtual ModerateTextResponse ModerateText(Document document, gaxgrpc::CallSettings callSettings = null) => + ModerateText(new ModerateTextRequest + { + Document = gax::GaxPreconditions.CheckNotNull(document, nameof(document)), + }, callSettings); + + /// + /// Moderates a document for harmful and sensitive categories. + /// + /// + /// Required. Input document. + /// + /// If not null, applies overrides to this RPC call. + /// A Task containing the RPC response. + public virtual stt::Task ModerateTextAsync(Document document, gaxgrpc::CallSettings callSettings = null) => + ModerateTextAsync(new ModerateTextRequest + { + Document = gax::GaxPreconditions.CheckNotNull(document, nameof(document)), + }, callSettings); + + /// + /// Moderates a document for harmful and sensitive categories. + /// + /// + /// Required. Input document. + /// + /// A to use for this RPC. + /// A Task containing the RPC response. + public virtual stt::Task ModerateTextAsync(Document document, st::CancellationToken cancellationToken) => + ModerateTextAsync(document, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// /// A convenience method that provides all the features that analyzeSentiment, /// analyzeEntities, and analyzeSyntax provide in one call. @@ -893,6 +972,8 @@ public sealed partial class LanguageServiceClientImpl : LanguageServiceClient private readonly gaxgrpc::ApiCall _callClassifyText; + private readonly gaxgrpc::ApiCall _callModerateText; + private readonly gaxgrpc::ApiCall _callAnnotateText; /// @@ -921,6 +1002,9 @@ public LanguageServiceClientImpl(LanguageService.LanguageServiceClient grpcClien _callClassifyText = clientHelper.BuildApiCall("ClassifyText", grpcClient.ClassifyTextAsync, grpcClient.ClassifyText, effectiveSettings.ClassifyTextSettings); Modify_ApiCall(ref _callClassifyText); Modify_ClassifyTextApiCall(ref _callClassifyText); + _callModerateText = clientHelper.BuildApiCall("ModerateText", grpcClient.ModerateTextAsync, grpcClient.ModerateText, effectiveSettings.ModerateTextSettings); + Modify_ApiCall(ref _callModerateText); + Modify_ModerateTextApiCall(ref _callModerateText); _callAnnotateText = clientHelper.BuildApiCall("AnnotateText", grpcClient.AnnotateTextAsync, grpcClient.AnnotateText, effectiveSettings.AnnotateTextSettings); Modify_ApiCall(ref _callAnnotateText); Modify_AnnotateTextApiCall(ref _callAnnotateText); @@ -939,6 +1023,8 @@ public LanguageServiceClientImpl(LanguageService.LanguageServiceClient grpcClien partial void Modify_ClassifyTextApiCall(ref gaxgrpc::ApiCall call); + partial void Modify_ModerateTextApiCall(ref gaxgrpc::ApiCall call); + partial void Modify_AnnotateTextApiCall(ref gaxgrpc::ApiCall call); partial void OnConstruction(LanguageService.LanguageServiceClient grpcClient, LanguageServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper); @@ -956,6 +1042,8 @@ public LanguageServiceClientImpl(LanguageService.LanguageServiceClient grpcClien partial void Modify_ClassifyTextRequest(ref ClassifyTextRequest request, ref gaxgrpc::CallSettings settings); + partial void Modify_ModerateTextRequest(ref ModerateTextRequest request, ref gaxgrpc::CallSettings settings); + partial void Modify_AnnotateTextRequest(ref AnnotateTextRequest request, ref gaxgrpc::CallSettings settings); /// @@ -1092,6 +1180,30 @@ public override ClassifyTextResponse ClassifyText(ClassifyTextRequest request, g return _callClassifyText.Async(request, callSettings); } + /// + /// Moderates a document for harmful and sensitive categories. + /// + /// The request object containing all of the parameters for the API call. + /// If not null, applies overrides to this RPC call. + /// The RPC response. + public override ModerateTextResponse ModerateText(ModerateTextRequest request, gaxgrpc::CallSettings callSettings = null) + { + Modify_ModerateTextRequest(ref request, ref callSettings); + return _callModerateText.Sync(request, callSettings); + } + + /// + /// Moderates a document for harmful and sensitive categories. + /// + /// The request object containing all of the parameters for the API call. + /// If not null, applies overrides to this RPC call. + /// A Task containing the RPC response. + public override stt::Task ModerateTextAsync(ModerateTextRequest request, gaxgrpc::CallSettings callSettings = null) + { + Modify_ModerateTextRequest(ref request, ref callSettings); + return _callModerateText.Async(request, callSettings); + } + /// /// A convenience method that provides all the features that analyzeSentiment, /// analyzeEntities, and analyzeSyntax provide in one call. diff --git a/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1/LanguageServiceGrpc.g.cs b/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1/LanguageServiceGrpc.g.cs index ab3704353214..0d46c54fbc48 100644 --- a/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1/LanguageServiceGrpc.g.cs +++ b/apis/Google.Cloud.Language.V1/Google.Cloud.Language.V1/LanguageServiceGrpc.g.cs @@ -85,6 +85,10 @@ static class __Helper_MessageCache [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] static readonly grpc::Marshaller __Marshaller_google_cloud_language_v1_ClassifyTextResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.Language.V1.ClassifyTextResponse.Parser)); [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_google_cloud_language_v1_ModerateTextRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.Language.V1.ModerateTextRequest.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_google_cloud_language_v1_ModerateTextResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.Language.V1.ModerateTextResponse.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] static readonly grpc::Marshaller __Marshaller_google_cloud_language_v1_AnnotateTextRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.Language.V1.AnnotateTextRequest.Parser)); [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] static readonly grpc::Marshaller __Marshaller_google_cloud_language_v1_AnnotateTextResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.Language.V1.AnnotateTextResponse.Parser)); @@ -129,6 +133,14 @@ static class __Helper_MessageCache __Marshaller_google_cloud_language_v1_ClassifyTextRequest, __Marshaller_google_cloud_language_v1_ClassifyTextResponse); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Method __Method_ModerateText = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "ModerateText", + __Marshaller_google_cloud_language_v1_ModerateTextRequest, + __Marshaller_google_cloud_language_v1_ModerateTextResponse); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] static readonly grpc::Method __Method_AnnotateText = new grpc::Method( grpc::MethodType.Unary, @@ -214,6 +226,18 @@ public abstract partial class LanguageServiceBase throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } + /// + /// Moderates a document for harmful and sensitive categories. + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::System.Threading.Tasks.Task ModerateText(global::Google.Cloud.Language.V1.ModerateTextRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + /// /// A convenience method that provides all the features that analyzeSentiment, /// analyzeEntities, and analyzeSyntax provide in one call. @@ -525,6 +549,54 @@ protected LanguageServiceClient(ClientBaseConfiguration configuration) : base(co return CallInvoker.AsyncUnaryCall(__Method_ClassifyText, null, options, request); } /// + /// Moderates a document for harmful and sensitive categories. + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::Google.Cloud.Language.V1.ModerateTextResponse ModerateText(global::Google.Cloud.Language.V1.ModerateTextRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ModerateText(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Moderates a document for harmful and sensitive categories. + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::Google.Cloud.Language.V1.ModerateTextResponse ModerateText(global::Google.Cloud.Language.V1.ModerateTextRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_ModerateText, null, options, request); + } + /// + /// Moderates a document for harmful and sensitive categories. + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall ModerateTextAsync(global::Google.Cloud.Language.V1.ModerateTextRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ModerateTextAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Moderates a document for harmful and sensitive categories. + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall ModerateTextAsync(global::Google.Cloud.Language.V1.ModerateTextRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_ModerateText, null, options, request); + } + /// /// A convenience method that provides all the features that analyzeSentiment, /// analyzeEntities, and analyzeSyntax provide in one call. /// @@ -595,6 +667,7 @@ protected override LanguageServiceClient NewInstance(ClientBaseConfiguration con .AddMethod(__Method_AnalyzeEntitySentiment, serviceImpl.AnalyzeEntitySentiment) .AddMethod(__Method_AnalyzeSyntax, serviceImpl.AnalyzeSyntax) .AddMethod(__Method_ClassifyText, serviceImpl.ClassifyText) + .AddMethod(__Method_ModerateText, serviceImpl.ModerateText) .AddMethod(__Method_AnnotateText, serviceImpl.AnnotateText).Build(); } @@ -610,6 +683,7 @@ public static void BindService(grpc::ServiceBinderBase serviceBinder, LanguageSe serviceBinder.AddMethod(__Method_AnalyzeEntitySentiment, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.AnalyzeEntitySentiment)); serviceBinder.AddMethod(__Method_AnalyzeSyntax, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.AnalyzeSyntax)); serviceBinder.AddMethod(__Method_ClassifyText, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.ClassifyText)); + serviceBinder.AddMethod(__Method_ModerateText, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.ModerateText)); serviceBinder.AddMethod(__Method_AnnotateText, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.AnnotateText)); } diff --git a/apis/Google.Cloud.Language.V1/gapic_metadata.json b/apis/Google.Cloud.Language.V1/gapic_metadata.json index ae6372d87e9e..c30d0484b912 100644 --- a/apis/Google.Cloud.Language.V1/gapic_metadata.json +++ b/apis/Google.Cloud.Language.V1/gapic_metadata.json @@ -45,6 +45,12 @@ "ClassifyText", "ClassifyTextAsync" ] + }, + "ModerateText": { + "methods": [ + "ModerateText", + "ModerateTextAsync" + ] } } }