Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
docs: generate sample code in the Java microgenerator (#356)
Browse files Browse the repository at this point in the history
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/128acacc-8b90-47cc-a3cd-e13068edfb12/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 356341083
Source-Link: googleapis/googleapis@8d8c008
  • Loading branch information
yoshi-automation committed Feb 16, 2021
1 parent ed3bdb6 commit c711b82
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 2 deletions.
Expand Up @@ -35,6 +35,16 @@
* <p>This class provides the ability to make remote calls to the backing service through method
* calls that map to API methods. Sample code to get started:
*
* <pre>{@code
* try (PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client =
* PhishingProtectionServiceV1Beta1Client.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* String uri = "uri116076";
* ReportPhishingResponse response =
* phishingProtectionServiceV1Beta1Client.reportPhishing(parent, uri);
* }
* }</pre>
*
* <p>Note: close() needs to be called on the PhishingProtectionServiceV1Beta1Client object to clean
* up resources such as threads. In the example above, try-with-resources is used, which
* automatically calls close().
Expand Down Expand Up @@ -152,6 +162,18 @@ public PhishingProtectionServiceV1Beta1Stub getStub() {
* lists](https://support.google.com/webmasters/answer/6350487/) in order to protect users that
* could get exposed to this threat in the future.
*
* <p>Sample code:
*
* <pre>{@code
* try (PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client =
* PhishingProtectionServiceV1Beta1Client.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* String uri = "uri116076";
* ReportPhishingResponse response =
* phishingProtectionServiceV1Beta1Client.reportPhishing(parent, uri);
* }
* }</pre>
*
* @param parent Required. The name of the project for which the report will be created, in the
* format "projects/{project_number}".
* @param uri Required. The URI that is being reported for phishing content to be analyzed.
Expand All @@ -175,6 +197,18 @@ public final ReportPhishingResponse reportPhishing(ProjectName parent, String ur
* lists](https://support.google.com/webmasters/answer/6350487/) in order to protect users that
* could get exposed to this threat in the future.
*
* <p>Sample code:
*
* <pre>{@code
* try (PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client =
* PhishingProtectionServiceV1Beta1Client.create()) {
* String parent = ProjectName.of("[PROJECT]").toString();
* String uri = "uri116076";
* ReportPhishingResponse response =
* phishingProtectionServiceV1Beta1Client.reportPhishing(parent, uri);
* }
* }</pre>
*
* @param parent Required. The name of the project for which the report will be created, in the
* format "projects/{project_number}".
* @param uri Required. The URI that is being reported for phishing content to be analyzed.
Expand All @@ -195,6 +229,21 @@ public final ReportPhishingResponse reportPhishing(String parent, String uri) {
* lists](https://support.google.com/webmasters/answer/6350487/) in order to protect users that
* could get exposed to this threat in the future.
*
* <p>Sample code:
*
* <pre>{@code
* try (PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client =
* PhishingProtectionServiceV1Beta1Client.create()) {
* ReportPhishingRequest request =
* ReportPhishingRequest.newBuilder()
* .setParent(ProjectName.of("[PROJECT]").toString())
* .setUri("uri116076")
* .build();
* ReportPhishingResponse response =
* phishingProtectionServiceV1Beta1Client.reportPhishing(request);
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand All @@ -212,6 +261,21 @@ public final ReportPhishingResponse reportPhishing(ReportPhishingRequest request
* could get exposed to this threat in the future.
*
* <p>Sample code:
*
* <pre>{@code
* try (PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client =
* PhishingProtectionServiceV1Beta1Client.create()) {
* ReportPhishingRequest request =
* ReportPhishingRequest.newBuilder()
* .setParent(ProjectName.of("[PROJECT]").toString())
* .setUri("uri116076")
* .build();
* ApiFuture<ReportPhishingResponse> future =
* phishingProtectionServiceV1Beta1Client.reportPhishingCallable().futureCall(request);
* // Do something.
* ReportPhishingResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<ReportPhishingRequest, ReportPhishingResponse>
reportPhishingCallable() {
Expand Down
Expand Up @@ -22,6 +22,16 @@
* <p>Service Description: Service to report phishing URIs.
*
* <p>Sample for PhishingProtectionServiceV1Beta1Client:
*
* <pre>{@code
* try (PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client =
* PhishingProtectionServiceV1Beta1Client.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* String uri = "uri116076";
* ReportPhishingResponse response =
* phishingProtectionServiceV1Beta1Client.reportPhishing(parent, uri);
* }
* }</pre>
*/
@Generated("by gapic-generator-java")
package com.google.cloud.phishingprotection.v1beta1;
Expand Down
4 changes: 2 additions & 2 deletions synth.metadata
Expand Up @@ -11,8 +11,8 @@
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3",
"internalRef": "350949863"
"sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb",
"internalRef": "356341083"
}
},
{
Expand Down

0 comments on commit c711b82

Please sign in to comment.