-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PiperOrigin-RevId: 533110799 Source-Link: googleapis/googleapis@3f5d0c9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/530de5758e4e2cdb6af6d0cab7ad829171142a1f Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuV2ViUmlzay5WMS8uT3dsQm90LnlhbWwiLCJoIjoiNTMwZGU1NzU4ZTRlMmNkYjZhZjZkMGNhYjdhZDgyOTE3MTE0MmExZiJ9
- Loading branch information
1 parent
fcf9391
commit bb16fb8
Showing
13 changed files
with
2,726 additions
and
179 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
...WebRisk.V1.GeneratedSnippets/WebRiskServiceClient.SubmitUriRequestObjectAsyncSnippet.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,68 @@ | ||
// 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 webrisk_v1_generated_WebRiskService_SubmitUri_async] | ||
using Google.Api.Gax.ResourceNames; | ||
using Google.Cloud.WebRisk.V1; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedWebRiskServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for SubmitUriAsync</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 SubmitUriRequestObjectAsync() | ||
{ | ||
// Create client | ||
WebRiskServiceClient webRiskServiceClient = await WebRiskServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
SubmitUriRequest request = new SubmitUriRequest | ||
{ | ||
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"), | ||
Submission = new Submission(), | ||
ThreatInfo = new ThreatInfo(), | ||
ThreatDiscovery = new ThreatDiscovery(), | ||
}; | ||
// Make the request | ||
Operation<Submission, SubmitUriMetadata> response = await webRiskServiceClient.SubmitUriAsync(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Submission, SubmitUriMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Submission result = completedResponse.Result; | ||
|
||
// Or get the name of the operation | ||
string operationName = response.Name; | ||
// This name can be stored, then the long-running operation retrieved later by name | ||
Operation<Submission, SubmitUriMetadata> retrievedResponse = await webRiskServiceClient.PollOnceSubmitUriAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Submission retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END webrisk_v1_generated_WebRiskService_SubmitUri_async] | ||
} |
67 changes: 67 additions & 0 deletions
67
...loud.WebRisk.V1.GeneratedSnippets/WebRiskServiceClient.SubmitUriRequestObjectSnippet.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,67 @@ | ||
// 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 webrisk_v1_generated_WebRiskService_SubmitUri_sync] | ||
using Google.Api.Gax.ResourceNames; | ||
using Google.Cloud.WebRisk.V1; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedWebRiskServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for SubmitUri</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 SubmitUriRequestObject() | ||
{ | ||
// Create client | ||
WebRiskServiceClient webRiskServiceClient = WebRiskServiceClient.Create(); | ||
// Initialize request argument(s) | ||
SubmitUriRequest request = new SubmitUriRequest | ||
{ | ||
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"), | ||
Submission = new Submission(), | ||
ThreatInfo = new ThreatInfo(), | ||
ThreatDiscovery = new ThreatDiscovery(), | ||
}; | ||
// Make the request | ||
Operation<Submission, SubmitUriMetadata> response = webRiskServiceClient.SubmitUri(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Submission, SubmitUriMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
Submission result = completedResponse.Result; | ||
|
||
// Or get the name of the operation | ||
string operationName = response.Name; | ||
// This name can be stored, then the long-running operation retrieved later by name | ||
Operation<Submission, SubmitUriMetadata> retrievedResponse = webRiskServiceClient.PollOnceSubmitUri(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Submission retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END webrisk_v1_generated_WebRiskService_SubmitUri_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
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
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
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
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.