1// Copyright 2021 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
16
17package websecurityscanner_test
18
19import (
20	"context"
21
22	websecurityscanner "cloud.google.com/go/websecurityscanner/apiv1"
23	"google.golang.org/api/iterator"
24	websecurityscannerpb "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1"
25)
26
27func ExampleNewClient() {
28	ctx := context.Background()
29	c, err := websecurityscanner.NewClient(ctx)
30	if err != nil {
31		// TODO: Handle error.
32	}
33	defer c.Close()
34
35	// TODO: Use client.
36	_ = c
37}
38
39func ExampleClient_CreateScanConfig() {
40	ctx := context.Background()
41	c, err := websecurityscanner.NewClient(ctx)
42	if err != nil {
43		// TODO: Handle error.
44	}
45	defer c.Close()
46
47	req := &websecurityscannerpb.CreateScanConfigRequest{
48		// TODO: Fill request struct fields.
49	}
50	resp, err := c.CreateScanConfig(ctx, req)
51	if err != nil {
52		// TODO: Handle error.
53	}
54	// TODO: Use resp.
55	_ = resp
56}
57
58func ExampleClient_DeleteScanConfig() {
59	ctx := context.Background()
60	c, err := websecurityscanner.NewClient(ctx)
61	if err != nil {
62		// TODO: Handle error.
63	}
64	defer c.Close()
65
66	req := &websecurityscannerpb.DeleteScanConfigRequest{
67		// TODO: Fill request struct fields.
68	}
69	err = c.DeleteScanConfig(ctx, req)
70	if err != nil {
71		// TODO: Handle error.
72	}
73}
74
75func ExampleClient_GetScanConfig() {
76	ctx := context.Background()
77	c, err := websecurityscanner.NewClient(ctx)
78	if err != nil {
79		// TODO: Handle error.
80	}
81	defer c.Close()
82
83	req := &websecurityscannerpb.GetScanConfigRequest{
84		// TODO: Fill request struct fields.
85	}
86	resp, err := c.GetScanConfig(ctx, req)
87	if err != nil {
88		// TODO: Handle error.
89	}
90	// TODO: Use resp.
91	_ = resp
92}
93
94func ExampleClient_ListScanConfigs() {
95	ctx := context.Background()
96	c, err := websecurityscanner.NewClient(ctx)
97	if err != nil {
98		// TODO: Handle error.
99	}
100	defer c.Close()
101
102	req := &websecurityscannerpb.ListScanConfigsRequest{
103		// TODO: Fill request struct fields.
104	}
105	it := c.ListScanConfigs(ctx, req)
106	for {
107		resp, err := it.Next()
108		if err == iterator.Done {
109			break
110		}
111		if err != nil {
112			// TODO: Handle error.
113		}
114		// TODO: Use resp.
115		_ = resp
116	}
117}
118
119func ExampleClient_UpdateScanConfig() {
120	ctx := context.Background()
121	c, err := websecurityscanner.NewClient(ctx)
122	if err != nil {
123		// TODO: Handle error.
124	}
125	defer c.Close()
126
127	req := &websecurityscannerpb.UpdateScanConfigRequest{
128		// TODO: Fill request struct fields.
129	}
130	resp, err := c.UpdateScanConfig(ctx, req)
131	if err != nil {
132		// TODO: Handle error.
133	}
134	// TODO: Use resp.
135	_ = resp
136}
137
138func ExampleClient_StartScanRun() {
139	ctx := context.Background()
140	c, err := websecurityscanner.NewClient(ctx)
141	if err != nil {
142		// TODO: Handle error.
143	}
144	defer c.Close()
145
146	req := &websecurityscannerpb.StartScanRunRequest{
147		// TODO: Fill request struct fields.
148	}
149	resp, err := c.StartScanRun(ctx, req)
150	if err != nil {
151		// TODO: Handle error.
152	}
153	// TODO: Use resp.
154	_ = resp
155}
156
157func ExampleClient_GetScanRun() {
158	ctx := context.Background()
159	c, err := websecurityscanner.NewClient(ctx)
160	if err != nil {
161		// TODO: Handle error.
162	}
163	defer c.Close()
164
165	req := &websecurityscannerpb.GetScanRunRequest{
166		// TODO: Fill request struct fields.
167	}
168	resp, err := c.GetScanRun(ctx, req)
169	if err != nil {
170		// TODO: Handle error.
171	}
172	// TODO: Use resp.
173	_ = resp
174}
175
176func ExampleClient_ListScanRuns() {
177	ctx := context.Background()
178	c, err := websecurityscanner.NewClient(ctx)
179	if err != nil {
180		// TODO: Handle error.
181	}
182	defer c.Close()
183
184	req := &websecurityscannerpb.ListScanRunsRequest{
185		// TODO: Fill request struct fields.
186	}
187	it := c.ListScanRuns(ctx, req)
188	for {
189		resp, err := it.Next()
190		if err == iterator.Done {
191			break
192		}
193		if err != nil {
194			// TODO: Handle error.
195		}
196		// TODO: Use resp.
197		_ = resp
198	}
199}
200
201func ExampleClient_StopScanRun() {
202	ctx := context.Background()
203	c, err := websecurityscanner.NewClient(ctx)
204	if err != nil {
205		// TODO: Handle error.
206	}
207	defer c.Close()
208
209	req := &websecurityscannerpb.StopScanRunRequest{
210		// TODO: Fill request struct fields.
211	}
212	resp, err := c.StopScanRun(ctx, req)
213	if err != nil {
214		// TODO: Handle error.
215	}
216	// TODO: Use resp.
217	_ = resp
218}
219
220func ExampleClient_ListCrawledUrls() {
221	ctx := context.Background()
222	c, err := websecurityscanner.NewClient(ctx)
223	if err != nil {
224		// TODO: Handle error.
225	}
226	defer c.Close()
227
228	req := &websecurityscannerpb.ListCrawledUrlsRequest{
229		// TODO: Fill request struct fields.
230	}
231	it := c.ListCrawledUrls(ctx, req)
232	for {
233		resp, err := it.Next()
234		if err == iterator.Done {
235			break
236		}
237		if err != nil {
238			// TODO: Handle error.
239		}
240		// TODO: Use resp.
241		_ = resp
242	}
243}
244
245func ExampleClient_GetFinding() {
246	ctx := context.Background()
247	c, err := websecurityscanner.NewClient(ctx)
248	if err != nil {
249		// TODO: Handle error.
250	}
251	defer c.Close()
252
253	req := &websecurityscannerpb.GetFindingRequest{
254		// TODO: Fill request struct fields.
255	}
256	resp, err := c.GetFinding(ctx, req)
257	if err != nil {
258		// TODO: Handle error.
259	}
260	// TODO: Use resp.
261	_ = resp
262}
263
264func ExampleClient_ListFindings() {
265	ctx := context.Background()
266	c, err := websecurityscanner.NewClient(ctx)
267	if err != nil {
268		// TODO: Handle error.
269	}
270	defer c.Close()
271
272	req := &websecurityscannerpb.ListFindingsRequest{
273		// TODO: Fill request struct fields.
274	}
275	it := c.ListFindings(ctx, req)
276	for {
277		resp, err := it.Next()
278		if err == iterator.Done {
279			break
280		}
281		if err != nil {
282			// TODO: Handle error.
283		}
284		// TODO: Use resp.
285		_ = resp
286	}
287}
288
289func ExampleClient_ListFindingTypeStats() {
290	ctx := context.Background()
291	c, err := websecurityscanner.NewClient(ctx)
292	if err != nil {
293		// TODO: Handle error.
294	}
295	defer c.Close()
296
297	req := &websecurityscannerpb.ListFindingTypeStatsRequest{
298		// TODO: Fill request struct fields.
299	}
300	resp, err := c.ListFindingTypeStats(ctx, req)
301	if err != nil {
302		// TODO: Handle error.
303	}
304	// TODO: Use resp.
305	_ = resp
306}
307