1// Copyright 2020 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 dlp_test 18 19import ( 20 "context" 21 22 dlp "cloud.google.com/go/dlp/apiv2" 23 "google.golang.org/api/iterator" 24 dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 25) 26 27func ExampleNewClient() { 28 ctx := context.Background() 29 c, err := dlp.NewClient(ctx) 30 if err != nil { 31 // TODO: Handle error. 32 } 33 // TODO: Use client. 34 _ = c 35} 36 37func ExampleClient_InspectContent() { 38 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 39 40 ctx := context.Background() 41 c, err := dlp.NewClient(ctx) 42 if err != nil { 43 // TODO: Handle error. 44 } 45 46 req := &dlppb.InspectContentRequest{ 47 // TODO: Fill request struct fields. 48 } 49 resp, err := c.InspectContent(ctx, req) 50 if err != nil { 51 // TODO: Handle error. 52 } 53 // TODO: Use resp. 54 _ = resp 55} 56 57func ExampleClient_RedactImage() { 58 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 59 60 ctx := context.Background() 61 c, err := dlp.NewClient(ctx) 62 if err != nil { 63 // TODO: Handle error. 64 } 65 66 req := &dlppb.RedactImageRequest{ 67 // TODO: Fill request struct fields. 68 } 69 resp, err := c.RedactImage(ctx, req) 70 if err != nil { 71 // TODO: Handle error. 72 } 73 // TODO: Use resp. 74 _ = resp 75} 76 77func ExampleClient_DeidentifyContent() { 78 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 79 80 ctx := context.Background() 81 c, err := dlp.NewClient(ctx) 82 if err != nil { 83 // TODO: Handle error. 84 } 85 86 req := &dlppb.DeidentifyContentRequest{ 87 // TODO: Fill request struct fields. 88 } 89 resp, err := c.DeidentifyContent(ctx, req) 90 if err != nil { 91 // TODO: Handle error. 92 } 93 // TODO: Use resp. 94 _ = resp 95} 96 97func ExampleClient_ReidentifyContent() { 98 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 99 100 ctx := context.Background() 101 c, err := dlp.NewClient(ctx) 102 if err != nil { 103 // TODO: Handle error. 104 } 105 106 req := &dlppb.ReidentifyContentRequest{ 107 // TODO: Fill request struct fields. 108 } 109 resp, err := c.ReidentifyContent(ctx, req) 110 if err != nil { 111 // TODO: Handle error. 112 } 113 // TODO: Use resp. 114 _ = resp 115} 116 117func ExampleClient_ListInfoTypes() { 118 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 119 120 ctx := context.Background() 121 c, err := dlp.NewClient(ctx) 122 if err != nil { 123 // TODO: Handle error. 124 } 125 126 req := &dlppb.ListInfoTypesRequest{ 127 // TODO: Fill request struct fields. 128 } 129 resp, err := c.ListInfoTypes(ctx, req) 130 if err != nil { 131 // TODO: Handle error. 132 } 133 // TODO: Use resp. 134 _ = resp 135} 136 137func ExampleClient_CreateInspectTemplate() { 138 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 139 140 ctx := context.Background() 141 c, err := dlp.NewClient(ctx) 142 if err != nil { 143 // TODO: Handle error. 144 } 145 146 req := &dlppb.CreateInspectTemplateRequest{ 147 // TODO: Fill request struct fields. 148 } 149 resp, err := c.CreateInspectTemplate(ctx, req) 150 if err != nil { 151 // TODO: Handle error. 152 } 153 // TODO: Use resp. 154 _ = resp 155} 156 157func ExampleClient_UpdateInspectTemplate() { 158 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 159 160 ctx := context.Background() 161 c, err := dlp.NewClient(ctx) 162 if err != nil { 163 // TODO: Handle error. 164 } 165 166 req := &dlppb.UpdateInspectTemplateRequest{ 167 // TODO: Fill request struct fields. 168 } 169 resp, err := c.UpdateInspectTemplate(ctx, req) 170 if err != nil { 171 // TODO: Handle error. 172 } 173 // TODO: Use resp. 174 _ = resp 175} 176 177func ExampleClient_GetInspectTemplate() { 178 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 179 180 ctx := context.Background() 181 c, err := dlp.NewClient(ctx) 182 if err != nil { 183 // TODO: Handle error. 184 } 185 186 req := &dlppb.GetInspectTemplateRequest{ 187 // TODO: Fill request struct fields. 188 } 189 resp, err := c.GetInspectTemplate(ctx, req) 190 if err != nil { 191 // TODO: Handle error. 192 } 193 // TODO: Use resp. 194 _ = resp 195} 196 197func ExampleClient_ListInspectTemplates() { 198 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 199 // import "google.golang.org/api/iterator" 200 201 ctx := context.Background() 202 c, err := dlp.NewClient(ctx) 203 if err != nil { 204 // TODO: Handle error. 205 } 206 207 req := &dlppb.ListInspectTemplatesRequest{ 208 // TODO: Fill request struct fields. 209 } 210 it := c.ListInspectTemplates(ctx, req) 211 for { 212 resp, err := it.Next() 213 if err == iterator.Done { 214 break 215 } 216 if err != nil { 217 // TODO: Handle error. 218 } 219 // TODO: Use resp. 220 _ = resp 221 } 222} 223 224func ExampleClient_DeleteInspectTemplate() { 225 ctx := context.Background() 226 c, err := dlp.NewClient(ctx) 227 if err != nil { 228 // TODO: Handle error. 229 } 230 231 req := &dlppb.DeleteInspectTemplateRequest{ 232 // TODO: Fill request struct fields. 233 } 234 err = c.DeleteInspectTemplate(ctx, req) 235 if err != nil { 236 // TODO: Handle error. 237 } 238} 239 240func ExampleClient_CreateDeidentifyTemplate() { 241 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 242 243 ctx := context.Background() 244 c, err := dlp.NewClient(ctx) 245 if err != nil { 246 // TODO: Handle error. 247 } 248 249 req := &dlppb.CreateDeidentifyTemplateRequest{ 250 // TODO: Fill request struct fields. 251 } 252 resp, err := c.CreateDeidentifyTemplate(ctx, req) 253 if err != nil { 254 // TODO: Handle error. 255 } 256 // TODO: Use resp. 257 _ = resp 258} 259 260func ExampleClient_UpdateDeidentifyTemplate() { 261 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 262 263 ctx := context.Background() 264 c, err := dlp.NewClient(ctx) 265 if err != nil { 266 // TODO: Handle error. 267 } 268 269 req := &dlppb.UpdateDeidentifyTemplateRequest{ 270 // TODO: Fill request struct fields. 271 } 272 resp, err := c.UpdateDeidentifyTemplate(ctx, req) 273 if err != nil { 274 // TODO: Handle error. 275 } 276 // TODO: Use resp. 277 _ = resp 278} 279 280func ExampleClient_GetDeidentifyTemplate() { 281 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 282 283 ctx := context.Background() 284 c, err := dlp.NewClient(ctx) 285 if err != nil { 286 // TODO: Handle error. 287 } 288 289 req := &dlppb.GetDeidentifyTemplateRequest{ 290 // TODO: Fill request struct fields. 291 } 292 resp, err := c.GetDeidentifyTemplate(ctx, req) 293 if err != nil { 294 // TODO: Handle error. 295 } 296 // TODO: Use resp. 297 _ = resp 298} 299 300func ExampleClient_ListDeidentifyTemplates() { 301 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 302 // import "google.golang.org/api/iterator" 303 304 ctx := context.Background() 305 c, err := dlp.NewClient(ctx) 306 if err != nil { 307 // TODO: Handle error. 308 } 309 310 req := &dlppb.ListDeidentifyTemplatesRequest{ 311 // TODO: Fill request struct fields. 312 } 313 it := c.ListDeidentifyTemplates(ctx, req) 314 for { 315 resp, err := it.Next() 316 if err == iterator.Done { 317 break 318 } 319 if err != nil { 320 // TODO: Handle error. 321 } 322 // TODO: Use resp. 323 _ = resp 324 } 325} 326 327func ExampleClient_DeleteDeidentifyTemplate() { 328 ctx := context.Background() 329 c, err := dlp.NewClient(ctx) 330 if err != nil { 331 // TODO: Handle error. 332 } 333 334 req := &dlppb.DeleteDeidentifyTemplateRequest{ 335 // TODO: Fill request struct fields. 336 } 337 err = c.DeleteDeidentifyTemplate(ctx, req) 338 if err != nil { 339 // TODO: Handle error. 340 } 341} 342 343func ExampleClient_CreateJobTrigger() { 344 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 345 346 ctx := context.Background() 347 c, err := dlp.NewClient(ctx) 348 if err != nil { 349 // TODO: Handle error. 350 } 351 352 req := &dlppb.CreateJobTriggerRequest{ 353 // TODO: Fill request struct fields. 354 } 355 resp, err := c.CreateJobTrigger(ctx, req) 356 if err != nil { 357 // TODO: Handle error. 358 } 359 // TODO: Use resp. 360 _ = resp 361} 362 363func ExampleClient_UpdateJobTrigger() { 364 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 365 366 ctx := context.Background() 367 c, err := dlp.NewClient(ctx) 368 if err != nil { 369 // TODO: Handle error. 370 } 371 372 req := &dlppb.UpdateJobTriggerRequest{ 373 // TODO: Fill request struct fields. 374 } 375 resp, err := c.UpdateJobTrigger(ctx, req) 376 if err != nil { 377 // TODO: Handle error. 378 } 379 // TODO: Use resp. 380 _ = resp 381} 382 383func ExampleClient_HybridInspectJobTrigger() { 384 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 385 386 ctx := context.Background() 387 c, err := dlp.NewClient(ctx) 388 if err != nil { 389 // TODO: Handle error. 390 } 391 392 req := &dlppb.HybridInspectJobTriggerRequest{ 393 // TODO: Fill request struct fields. 394 } 395 resp, err := c.HybridInspectJobTrigger(ctx, req) 396 if err != nil { 397 // TODO: Handle error. 398 } 399 // TODO: Use resp. 400 _ = resp 401} 402 403func ExampleClient_GetJobTrigger() { 404 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 405 406 ctx := context.Background() 407 c, err := dlp.NewClient(ctx) 408 if err != nil { 409 // TODO: Handle error. 410 } 411 412 req := &dlppb.GetJobTriggerRequest{ 413 // TODO: Fill request struct fields. 414 } 415 resp, err := c.GetJobTrigger(ctx, req) 416 if err != nil { 417 // TODO: Handle error. 418 } 419 // TODO: Use resp. 420 _ = resp 421} 422 423func ExampleClient_ListJobTriggers() { 424 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 425 // import "google.golang.org/api/iterator" 426 427 ctx := context.Background() 428 c, err := dlp.NewClient(ctx) 429 if err != nil { 430 // TODO: Handle error. 431 } 432 433 req := &dlppb.ListJobTriggersRequest{ 434 // TODO: Fill request struct fields. 435 } 436 it := c.ListJobTriggers(ctx, req) 437 for { 438 resp, err := it.Next() 439 if err == iterator.Done { 440 break 441 } 442 if err != nil { 443 // TODO: Handle error. 444 } 445 // TODO: Use resp. 446 _ = resp 447 } 448} 449 450func ExampleClient_DeleteJobTrigger() { 451 ctx := context.Background() 452 c, err := dlp.NewClient(ctx) 453 if err != nil { 454 // TODO: Handle error. 455 } 456 457 req := &dlppb.DeleteJobTriggerRequest{ 458 // TODO: Fill request struct fields. 459 } 460 err = c.DeleteJobTrigger(ctx, req) 461 if err != nil { 462 // TODO: Handle error. 463 } 464} 465 466func ExampleClient_ActivateJobTrigger() { 467 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 468 469 ctx := context.Background() 470 c, err := dlp.NewClient(ctx) 471 if err != nil { 472 // TODO: Handle error. 473 } 474 475 req := &dlppb.ActivateJobTriggerRequest{ 476 // TODO: Fill request struct fields. 477 } 478 resp, err := c.ActivateJobTrigger(ctx, req) 479 if err != nil { 480 // TODO: Handle error. 481 } 482 // TODO: Use resp. 483 _ = resp 484} 485 486func ExampleClient_CreateDlpJob() { 487 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 488 489 ctx := context.Background() 490 c, err := dlp.NewClient(ctx) 491 if err != nil { 492 // TODO: Handle error. 493 } 494 495 req := &dlppb.CreateDlpJobRequest{ 496 // TODO: Fill request struct fields. 497 } 498 resp, err := c.CreateDlpJob(ctx, req) 499 if err != nil { 500 // TODO: Handle error. 501 } 502 // TODO: Use resp. 503 _ = resp 504} 505 506func ExampleClient_ListDlpJobs() { 507 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 508 // import "google.golang.org/api/iterator" 509 510 ctx := context.Background() 511 c, err := dlp.NewClient(ctx) 512 if err != nil { 513 // TODO: Handle error. 514 } 515 516 req := &dlppb.ListDlpJobsRequest{ 517 // TODO: Fill request struct fields. 518 } 519 it := c.ListDlpJobs(ctx, req) 520 for { 521 resp, err := it.Next() 522 if err == iterator.Done { 523 break 524 } 525 if err != nil { 526 // TODO: Handle error. 527 } 528 // TODO: Use resp. 529 _ = resp 530 } 531} 532 533func ExampleClient_GetDlpJob() { 534 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 535 536 ctx := context.Background() 537 c, err := dlp.NewClient(ctx) 538 if err != nil { 539 // TODO: Handle error. 540 } 541 542 req := &dlppb.GetDlpJobRequest{ 543 // TODO: Fill request struct fields. 544 } 545 resp, err := c.GetDlpJob(ctx, req) 546 if err != nil { 547 // TODO: Handle error. 548 } 549 // TODO: Use resp. 550 _ = resp 551} 552 553func ExampleClient_DeleteDlpJob() { 554 ctx := context.Background() 555 c, err := dlp.NewClient(ctx) 556 if err != nil { 557 // TODO: Handle error. 558 } 559 560 req := &dlppb.DeleteDlpJobRequest{ 561 // TODO: Fill request struct fields. 562 } 563 err = c.DeleteDlpJob(ctx, req) 564 if err != nil { 565 // TODO: Handle error. 566 } 567} 568 569func ExampleClient_CancelDlpJob() { 570 ctx := context.Background() 571 c, err := dlp.NewClient(ctx) 572 if err != nil { 573 // TODO: Handle error. 574 } 575 576 req := &dlppb.CancelDlpJobRequest{ 577 // TODO: Fill request struct fields. 578 } 579 err = c.CancelDlpJob(ctx, req) 580 if err != nil { 581 // TODO: Handle error. 582 } 583} 584 585func ExampleClient_CreateStoredInfoType() { 586 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 587 588 ctx := context.Background() 589 c, err := dlp.NewClient(ctx) 590 if err != nil { 591 // TODO: Handle error. 592 } 593 594 req := &dlppb.CreateStoredInfoTypeRequest{ 595 // TODO: Fill request struct fields. 596 } 597 resp, err := c.CreateStoredInfoType(ctx, req) 598 if err != nil { 599 // TODO: Handle error. 600 } 601 // TODO: Use resp. 602 _ = resp 603} 604 605func ExampleClient_UpdateStoredInfoType() { 606 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 607 608 ctx := context.Background() 609 c, err := dlp.NewClient(ctx) 610 if err != nil { 611 // TODO: Handle error. 612 } 613 614 req := &dlppb.UpdateStoredInfoTypeRequest{ 615 // TODO: Fill request struct fields. 616 } 617 resp, err := c.UpdateStoredInfoType(ctx, req) 618 if err != nil { 619 // TODO: Handle error. 620 } 621 // TODO: Use resp. 622 _ = resp 623} 624 625func ExampleClient_GetStoredInfoType() { 626 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 627 628 ctx := context.Background() 629 c, err := dlp.NewClient(ctx) 630 if err != nil { 631 // TODO: Handle error. 632 } 633 634 req := &dlppb.GetStoredInfoTypeRequest{ 635 // TODO: Fill request struct fields. 636 } 637 resp, err := c.GetStoredInfoType(ctx, req) 638 if err != nil { 639 // TODO: Handle error. 640 } 641 // TODO: Use resp. 642 _ = resp 643} 644 645func ExampleClient_ListStoredInfoTypes() { 646 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 647 // import "google.golang.org/api/iterator" 648 649 ctx := context.Background() 650 c, err := dlp.NewClient(ctx) 651 if err != nil { 652 // TODO: Handle error. 653 } 654 655 req := &dlppb.ListStoredInfoTypesRequest{ 656 // TODO: Fill request struct fields. 657 } 658 it := c.ListStoredInfoTypes(ctx, req) 659 for { 660 resp, err := it.Next() 661 if err == iterator.Done { 662 break 663 } 664 if err != nil { 665 // TODO: Handle error. 666 } 667 // TODO: Use resp. 668 _ = resp 669 } 670} 671 672func ExampleClient_DeleteStoredInfoType() { 673 ctx := context.Background() 674 c, err := dlp.NewClient(ctx) 675 if err != nil { 676 // TODO: Handle error. 677 } 678 679 req := &dlppb.DeleteStoredInfoTypeRequest{ 680 // TODO: Fill request struct fields. 681 } 682 err = c.DeleteStoredInfoType(ctx, req) 683 if err != nil { 684 // TODO: Handle error. 685 } 686} 687 688func ExampleClient_HybridInspectDlpJob() { 689 // import dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2" 690 691 ctx := context.Background() 692 c, err := dlp.NewClient(ctx) 693 if err != nil { 694 // TODO: Handle error. 695 } 696 697 req := &dlppb.HybridInspectDlpJobRequest{ 698 // TODO: Fill request struct fields. 699 } 700 resp, err := c.HybridInspectDlpJob(ctx, req) 701 if err != nil { 702 // TODO: Handle error. 703 } 704 // TODO: Use resp. 705 _ = resp 706} 707 708func ExampleClient_FinishDlpJob() { 709 ctx := context.Background() 710 c, err := dlp.NewClient(ctx) 711 if err != nil { 712 // TODO: Handle error. 713 } 714 715 req := &dlppb.FinishDlpJobRequest{ 716 // TODO: Fill request struct fields. 717 } 718 err = c.FinishDlpJob(ctx, req) 719 if err != nil { 720 // TODO: Handle error. 721 } 722} 723