-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added client library support for ModerateText in the Natural La…
…nguage API (V1) PiperOrigin-RevId: 534992604 Source-Link: googleapis/googleapis@2400fac Source-Link: googleapis/googleapis-gen@32caa58 Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuTGFuZ3VhZ2UuVjEvLk93bEJvdC55YW1sIiwiaCI6IjMyY2FhNTgwMTMxYjA1Yjg4MGZhM2I4MDJjYTBjMjExNzk4ODE3MzMifQ==
- Loading branch information
1 parent
03b43b5
commit 0af8e03
Showing
10 changed files
with
1,151 additions
and
59 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
...e.Cloud.Language.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextAsyncSnippet.g.cs
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 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 | ||
{ | ||
/// <summary>Snippet for ModerateTextAsync</summary> | ||
/// <remarks> | ||
/// 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. | ||
/// </remarks> | ||
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] | ||
} |
47 changes: 47 additions & 0 deletions
47
...age.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextRequestObjectAsyncSnippet.g.cs
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 @@ | ||
// 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 | ||
{ | ||
/// <summary>Snippet for ModerateTextAsync</summary> | ||
/// <remarks> | ||
/// 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. | ||
/// </remarks> | ||
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] | ||
} |
46 changes: 46 additions & 0 deletions
46
...Language.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextRequestObjectSnippet.g.cs
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,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 | ||
{ | ||
/// <summary>Snippet for ModerateText</summary> | ||
/// <remarks> | ||
/// 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. | ||
/// </remarks> | ||
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] | ||
} |
43 changes: 43 additions & 0 deletions
43
...Google.Cloud.Language.V1.GeneratedSnippets/LanguageServiceClient.ModerateTextSnippet.g.cs
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,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 | ||
{ | ||
/// <summary>Snippet for ModerateText</summary> | ||
/// <remarks> | ||
/// 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. | ||
/// </remarks> | ||
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] | ||
} |
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
Oops, something went wrong.