From c711b82835993f2b34498c3392bd94fdf50089b5 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 16 Feb 2021 11:08:08 -0800 Subject: [PATCH] docs: generate sample code in the Java microgenerator (#356) This PR was generated using Autosynth. :rainbow: 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: https://github.com/googleapis/googleapis/commit/8d8c008e56f1af31d57f75561e0f1848ffb29eeb --- ...hishingProtectionServiceV1Beta1Client.java | 64 +++++++++++++++++++ .../v1beta1/package-info.java | 10 +++ synth.metadata | 4 +- 3 files changed, 76 insertions(+), 2 deletions(-) diff --git a/google-cloud-phishingprotection/src/main/java/com/google/cloud/phishingprotection/v1beta1/PhishingProtectionServiceV1Beta1Client.java b/google-cloud-phishingprotection/src/main/java/com/google/cloud/phishingprotection/v1beta1/PhishingProtectionServiceV1Beta1Client.java index 28f9c89d..508310e6 100644 --- a/google-cloud-phishingprotection/src/main/java/com/google/cloud/phishingprotection/v1beta1/PhishingProtectionServiceV1Beta1Client.java +++ b/google-cloud-phishingprotection/src/main/java/com/google/cloud/phishingprotection/v1beta1/PhishingProtectionServiceV1Beta1Client.java @@ -35,6 +35,16 @@ *

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: * + *

{@code
+ * try (PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client =
+ *     PhishingProtectionServiceV1Beta1Client.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   String uri = "uri116076";
+ *   ReportPhishingResponse response =
+ *       phishingProtectionServiceV1Beta1Client.reportPhishing(parent, uri);
+ * }
+ * }
+ * *

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(). @@ -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. * + *

Sample code: + * + *

{@code
+   * try (PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client =
+   *     PhishingProtectionServiceV1Beta1Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   String uri = "uri116076";
+   *   ReportPhishingResponse response =
+   *       phishingProtectionServiceV1Beta1Client.reportPhishing(parent, uri);
+   * }
+   * }
+ * * @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. @@ -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. * + *

Sample code: + * + *

{@code
+   * try (PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client =
+   *     PhishingProtectionServiceV1Beta1Client.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   String uri = "uri116076";
+   *   ReportPhishingResponse response =
+   *       phishingProtectionServiceV1Beta1Client.reportPhishing(parent, uri);
+   * }
+   * }
+ * * @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. @@ -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. * + *

Sample code: + * + *

{@code
+   * try (PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client =
+   *     PhishingProtectionServiceV1Beta1Client.create()) {
+   *   ReportPhishingRequest request =
+   *       ReportPhishingRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setUri("uri116076")
+   *           .build();
+   *   ReportPhishingResponse response =
+   *       phishingProtectionServiceV1Beta1Client.reportPhishing(request);
+   * }
+   * }
+ * * @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 */ @@ -212,6 +261,21 @@ public final ReportPhishingResponse reportPhishing(ReportPhishingRequest request * could get exposed to this threat in the future. * *

Sample code: + * + *

{@code
+   * try (PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client =
+   *     PhishingProtectionServiceV1Beta1Client.create()) {
+   *   ReportPhishingRequest request =
+   *       ReportPhishingRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setUri("uri116076")
+   *           .build();
+   *   ApiFuture future =
+   *       phishingProtectionServiceV1Beta1Client.reportPhishingCallable().futureCall(request);
+   *   // Do something.
+   *   ReportPhishingResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable reportPhishingCallable() { diff --git a/google-cloud-phishingprotection/src/main/java/com/google/cloud/phishingprotection/v1beta1/package-info.java b/google-cloud-phishingprotection/src/main/java/com/google/cloud/phishingprotection/v1beta1/package-info.java index 0a8fb2a7..d7cd2303 100644 --- a/google-cloud-phishingprotection/src/main/java/com/google/cloud/phishingprotection/v1beta1/package-info.java +++ b/google-cloud-phishingprotection/src/main/java/com/google/cloud/phishingprotection/v1beta1/package-info.java @@ -22,6 +22,16 @@ *

Service Description: Service to report phishing URIs. * *

Sample for PhishingProtectionServiceV1Beta1Client: + * + *

{@code
+ * try (PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client =
+ *     PhishingProtectionServiceV1Beta1Client.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   String uri = "uri116076";
+ *   ReportPhishingResponse response =
+ *       phishingProtectionServiceV1Beta1Client.reportPhishing(parent, uri);
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.phishingprotection.v1beta1; diff --git a/synth.metadata b/synth.metadata index e5cb2943..46e48ff0 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,8 +11,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, {