2018-01-23 19:40:42 +01:00
|
|
|
// Copyright 2018 Google LLC
|
2017-08-05 20:17:15 +02:00
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
2018-01-23 19:40:42 +01:00
|
|
|
// https://www.apache.org/licenses/LICENSE-2.0
|
2017-08-05 20:17:15 +02:00
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
// AUTO-GENERATED CODE. DO NOT EDIT.
|
|
|
|
|
|
|
|
package dlp_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"cloud.google.com/go/dlp/apiv2beta1"
|
|
|
|
"golang.org/x/net/context"
|
|
|
|
dlppb "google.golang.org/genproto/googleapis/privacy/dlp/v2beta1"
|
|
|
|
)
|
|
|
|
|
|
|
|
func ExampleNewClient() {
|
|
|
|
ctx := context.Background()
|
|
|
|
c, err := dlp.NewClient(ctx)
|
|
|
|
if err != nil {
|
|
|
|
// TODO: Handle error.
|
|
|
|
}
|
|
|
|
// TODO: Use client.
|
|
|
|
_ = c
|
|
|
|
}
|
|
|
|
|
2018-01-23 19:40:42 +01:00
|
|
|
func ExampleClient_InspectContent() {
|
2017-12-03 21:01:25 +01:00
|
|
|
ctx := context.Background()
|
|
|
|
c, err := dlp.NewClient(ctx)
|
|
|
|
if err != nil {
|
|
|
|
// TODO: Handle error.
|
|
|
|
}
|
|
|
|
|
2018-01-23 19:40:42 +01:00
|
|
|
req := &dlppb.InspectContentRequest{
|
|
|
|
// TODO: Fill request struct fields.
|
2017-12-03 21:01:25 +01:00
|
|
|
}
|
2018-01-23 19:40:42 +01:00
|
|
|
resp, err := c.InspectContent(ctx, req)
|
2017-12-03 21:01:25 +01:00
|
|
|
if err != nil {
|
|
|
|
// TODO: Handle error.
|
|
|
|
}
|
|
|
|
// TODO: Use resp.
|
|
|
|
_ = resp
|
|
|
|
}
|
|
|
|
|
2018-01-23 19:40:42 +01:00
|
|
|
func ExampleClient_RedactContent() {
|
2017-12-03 21:01:25 +01:00
|
|
|
ctx := context.Background()
|
|
|
|
c, err := dlp.NewClient(ctx)
|
|
|
|
if err != nil {
|
|
|
|
// TODO: Handle error.
|
|
|
|
}
|
|
|
|
|
2018-01-23 19:40:42 +01:00
|
|
|
req := &dlppb.RedactContentRequest{
|
|
|
|
// TODO: Fill request struct fields.
|
2017-12-03 21:01:25 +01:00
|
|
|
}
|
2018-01-23 19:40:42 +01:00
|
|
|
resp, err := c.RedactContent(ctx, req)
|
2017-12-03 21:01:25 +01:00
|
|
|
if err != nil {
|
|
|
|
// TODO: Handle error.
|
|
|
|
}
|
|
|
|
// TODO: Use resp.
|
|
|
|
_ = resp
|
|
|
|
}
|
|
|
|
|
2018-01-23 19:40:42 +01:00
|
|
|
func ExampleClient_DeidentifyContent() {
|
2017-08-05 20:17:15 +02:00
|
|
|
ctx := context.Background()
|
|
|
|
c, err := dlp.NewClient(ctx)
|
|
|
|
if err != nil {
|
|
|
|
// TODO: Handle error.
|
|
|
|
}
|
|
|
|
|
2018-01-23 19:40:42 +01:00
|
|
|
req := &dlppb.DeidentifyContentRequest{
|
|
|
|
// TODO: Fill request struct fields.
|
2017-08-05 20:17:15 +02:00
|
|
|
}
|
2018-01-23 19:40:42 +01:00
|
|
|
resp, err := c.DeidentifyContent(ctx, req)
|
2017-08-05 20:17:15 +02:00
|
|
|
if err != nil {
|
|
|
|
// TODO: Handle error.
|
|
|
|
}
|
|
|
|
// TODO: Use resp.
|
|
|
|
_ = resp
|
|
|
|
}
|
|
|
|
|
2018-01-23 19:40:42 +01:00
|
|
|
func ExampleClient_AnalyzeDataSourceRisk() {
|
2017-08-05 20:17:15 +02:00
|
|
|
ctx := context.Background()
|
|
|
|
c, err := dlp.NewClient(ctx)
|
|
|
|
if err != nil {
|
|
|
|
// TODO: Handle error.
|
|
|
|
}
|
|
|
|
|
2018-01-23 19:40:42 +01:00
|
|
|
req := &dlppb.AnalyzeDataSourceRiskRequest{
|
|
|
|
// TODO: Fill request struct fields.
|
2017-08-05 20:17:15 +02:00
|
|
|
}
|
2018-01-23 19:40:42 +01:00
|
|
|
op, err := c.AnalyzeDataSourceRisk(ctx, req)
|
|
|
|
if err != nil {
|
|
|
|
// TODO: Handle error.
|
|
|
|
}
|
|
|
|
|
|
|
|
resp, err := op.Wait(ctx)
|
2017-08-05 20:17:15 +02:00
|
|
|
if err != nil {
|
|
|
|
// TODO: Handle error.
|
|
|
|
}
|
|
|
|
// TODO: Use resp.
|
|
|
|
_ = resp
|
|
|
|
}
|
|
|
|
|
|
|
|
func ExampleClient_CreateInspectOperation() {
|
|
|
|
ctx := context.Background()
|
|
|
|
c, err := dlp.NewClient(ctx)
|
|
|
|
if err != nil {
|
|
|
|
// TODO: Handle error.
|
|
|
|
}
|
|
|
|
|
|
|
|
req := &dlppb.CreateInspectOperationRequest{
|
2018-01-23 19:40:42 +01:00
|
|
|
// TODO: Fill request struct fields.
|
2017-08-05 20:17:15 +02:00
|
|
|
}
|
|
|
|
op, err := c.CreateInspectOperation(ctx, req)
|
|
|
|
if err != nil {
|
|
|
|
// TODO: Handle error.
|
|
|
|
}
|
|
|
|
|
|
|
|
resp, err := op.Wait(ctx)
|
|
|
|
if err != nil {
|
|
|
|
// TODO: Handle error.
|
|
|
|
}
|
|
|
|
// TODO: Use resp.
|
|
|
|
_ = resp
|
|
|
|
}
|
|
|
|
|
|
|
|
func ExampleClient_ListInspectFindings() {
|
|
|
|
ctx := context.Background()
|
|
|
|
c, err := dlp.NewClient(ctx)
|
|
|
|
if err != nil {
|
|
|
|
// TODO: Handle error.
|
|
|
|
}
|
|
|
|
|
|
|
|
req := &dlppb.ListInspectFindingsRequest{
|
2018-01-23 19:40:42 +01:00
|
|
|
// TODO: Fill request struct fields.
|
2017-08-05 20:17:15 +02:00
|
|
|
}
|
|
|
|
resp, err := c.ListInspectFindings(ctx, req)
|
|
|
|
if err != nil {
|
|
|
|
// TODO: Handle error.
|
|
|
|
}
|
|
|
|
// TODO: Use resp.
|
|
|
|
_ = resp
|
|
|
|
}
|
|
|
|
|
|
|
|
func ExampleClient_ListInfoTypes() {
|
|
|
|
ctx := context.Background()
|
|
|
|
c, err := dlp.NewClient(ctx)
|
|
|
|
if err != nil {
|
|
|
|
// TODO: Handle error.
|
|
|
|
}
|
|
|
|
|
|
|
|
req := &dlppb.ListInfoTypesRequest{
|
2018-01-23 19:40:42 +01:00
|
|
|
// TODO: Fill request struct fields.
|
2017-08-05 20:17:15 +02:00
|
|
|
}
|
|
|
|
resp, err := c.ListInfoTypes(ctx, req)
|
|
|
|
if err != nil {
|
|
|
|
// TODO: Handle error.
|
|
|
|
}
|
|
|
|
// TODO: Use resp.
|
|
|
|
_ = resp
|
|
|
|
}
|
|
|
|
|
|
|
|
func ExampleClient_ListRootCategories() {
|
|
|
|
ctx := context.Background()
|
|
|
|
c, err := dlp.NewClient(ctx)
|
|
|
|
if err != nil {
|
|
|
|
// TODO: Handle error.
|
|
|
|
}
|
|
|
|
|
|
|
|
req := &dlppb.ListRootCategoriesRequest{
|
2018-01-23 19:40:42 +01:00
|
|
|
// TODO: Fill request struct fields.
|
2017-08-05 20:17:15 +02:00
|
|
|
}
|
|
|
|
resp, err := c.ListRootCategories(ctx, req)
|
|
|
|
if err != nil {
|
|
|
|
// TODO: Handle error.
|
|
|
|
}
|
|
|
|
// TODO: Use resp.
|
|
|
|
_ = resp
|
|
|
|
}
|