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

Commit c711b82

Browse files
docs: generate sample code in the Java microgenerator (#356)
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
1 parent ed3bdb6 commit c711b82

File tree

3 files changed

+76
-2
lines changed

3 files changed

+76
-2
lines changed

google-cloud-phishingprotection/src/main/java/com/google/cloud/phishingprotection/v1beta1/PhishingProtectionServiceV1Beta1Client.java

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@
3535
* <p>This class provides the ability to make remote calls to the backing service through method
3636
* calls that map to API methods. Sample code to get started:
3737
*
38+
* <pre>{@code
39+
* try (PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client =
40+
* PhishingProtectionServiceV1Beta1Client.create()) {
41+
* ProjectName parent = ProjectName.of("[PROJECT]");
42+
* String uri = "uri116076";
43+
* ReportPhishingResponse response =
44+
* phishingProtectionServiceV1Beta1Client.reportPhishing(parent, uri);
45+
* }
46+
* }</pre>
47+
*
3848
* <p>Note: close() needs to be called on the PhishingProtectionServiceV1Beta1Client object to clean
3949
* up resources such as threads. In the example above, try-with-resources is used, which
4050
* automatically calls close().
@@ -152,6 +162,18 @@ public PhishingProtectionServiceV1Beta1Stub getStub() {
152162
* lists](https://support.google.com/webmasters/answer/6350487/) in order to protect users that
153163
* could get exposed to this threat in the future.
154164
*
165+
* <p>Sample code:
166+
*
167+
* <pre>{@code
168+
* try (PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client =
169+
* PhishingProtectionServiceV1Beta1Client.create()) {
170+
* ProjectName parent = ProjectName.of("[PROJECT]");
171+
* String uri = "uri116076";
172+
* ReportPhishingResponse response =
173+
* phishingProtectionServiceV1Beta1Client.reportPhishing(parent, uri);
174+
* }
175+
* }</pre>
176+
*
155177
* @param parent Required. The name of the project for which the report will be created, in the
156178
* format "projects/{project_number}".
157179
* @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
175197
* lists](https://support.google.com/webmasters/answer/6350487/) in order to protect users that
176198
* could get exposed to this threat in the future.
177199
*
200+
* <p>Sample code:
201+
*
202+
* <pre>{@code
203+
* try (PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client =
204+
* PhishingProtectionServiceV1Beta1Client.create()) {
205+
* String parent = ProjectName.of("[PROJECT]").toString();
206+
* String uri = "uri116076";
207+
* ReportPhishingResponse response =
208+
* phishingProtectionServiceV1Beta1Client.reportPhishing(parent, uri);
209+
* }
210+
* }</pre>
211+
*
178212
* @param parent Required. The name of the project for which the report will be created, in the
179213
* format "projects/{project_number}".
180214
* @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) {
195229
* lists](https://support.google.com/webmasters/answer/6350487/) in order to protect users that
196230
* could get exposed to this threat in the future.
197231
*
232+
* <p>Sample code:
233+
*
234+
* <pre>{@code
235+
* try (PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client =
236+
* PhishingProtectionServiceV1Beta1Client.create()) {
237+
* ReportPhishingRequest request =
238+
* ReportPhishingRequest.newBuilder()
239+
* .setParent(ProjectName.of("[PROJECT]").toString())
240+
* .setUri("uri116076")
241+
* .build();
242+
* ReportPhishingResponse response =
243+
* phishingProtectionServiceV1Beta1Client.reportPhishing(request);
244+
* }
245+
* }</pre>
246+
*
198247
* @param request The request object containing all of the parameters for the API call.
199248
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
200249
*/
@@ -212,6 +261,21 @@ public final ReportPhishingResponse reportPhishing(ReportPhishingRequest request
212261
* could get exposed to this threat in the future.
213262
*
214263
* <p>Sample code:
264+
*
265+
* <pre>{@code
266+
* try (PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client =
267+
* PhishingProtectionServiceV1Beta1Client.create()) {
268+
* ReportPhishingRequest request =
269+
* ReportPhishingRequest.newBuilder()
270+
* .setParent(ProjectName.of("[PROJECT]").toString())
271+
* .setUri("uri116076")
272+
* .build();
273+
* ApiFuture<ReportPhishingResponse> future =
274+
* phishingProtectionServiceV1Beta1Client.reportPhishingCallable().futureCall(request);
275+
* // Do something.
276+
* ReportPhishingResponse response = future.get();
277+
* }
278+
* }</pre>
215279
*/
216280
public final UnaryCallable<ReportPhishingRequest, ReportPhishingResponse>
217281
reportPhishingCallable() {

google-cloud-phishingprotection/src/main/java/com/google/cloud/phishingprotection/v1beta1/package-info.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@
2222
* <p>Service Description: Service to report phishing URIs.
2323
*
2424
* <p>Sample for PhishingProtectionServiceV1Beta1Client:
25+
*
26+
* <pre>{@code
27+
* try (PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client =
28+
* PhishingProtectionServiceV1Beta1Client.create()) {
29+
* ProjectName parent = ProjectName.of("[PROJECT]");
30+
* String uri = "uri116076";
31+
* ReportPhishingResponse response =
32+
* phishingProtectionServiceV1Beta1Client.reportPhishing(parent, uri);
33+
* }
34+
* }</pre>
2535
*/
2636
@Generated("by gapic-generator-java")
2737
package com.google.cloud.phishingprotection.v1beta1;

synth.metadata

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"git": {
1212
"name": "googleapis",
1313
"remote": "https://github.com/googleapis/googleapis.git",
14-
"sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3",
15-
"internalRef": "350949863"
14+
"sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb",
15+
"internalRef": "356341083"
1616
}
1717
},
1818
{

0 commit comments

Comments
 (0)