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 cx_test 18 19import ( 20 "context" 21 22 cx "cloud.google.com/go/dialogflow/cx/apiv3" 23 "google.golang.org/api/iterator" 24 cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3" 25) 26 27func ExampleNewSecuritySettingsClient() { 28 ctx := context.Background() 29 c, err := cx.NewSecuritySettingsClient(ctx) 30 if err != nil { 31 // TODO: Handle error. 32 } 33 defer c.Close() 34 35 // TODO: Use client. 36 _ = c 37} 38 39func ExampleSecuritySettingsClient_CreateSecuritySettings() { 40 ctx := context.Background() 41 c, err := cx.NewSecuritySettingsClient(ctx) 42 if err != nil { 43 // TODO: Handle error. 44 } 45 defer c.Close() 46 47 req := &cxpb.CreateSecuritySettingsRequest{ 48 // TODO: Fill request struct fields. 49 } 50 resp, err := c.CreateSecuritySettings(ctx, req) 51 if err != nil { 52 // TODO: Handle error. 53 } 54 // TODO: Use resp. 55 _ = resp 56} 57 58func ExampleSecuritySettingsClient_GetSecuritySettings() { 59 ctx := context.Background() 60 c, err := cx.NewSecuritySettingsClient(ctx) 61 if err != nil { 62 // TODO: Handle error. 63 } 64 defer c.Close() 65 66 req := &cxpb.GetSecuritySettingsRequest{ 67 // TODO: Fill request struct fields. 68 } 69 resp, err := c.GetSecuritySettings(ctx, req) 70 if err != nil { 71 // TODO: Handle error. 72 } 73 // TODO: Use resp. 74 _ = resp 75} 76 77func ExampleSecuritySettingsClient_UpdateSecuritySettings() { 78 ctx := context.Background() 79 c, err := cx.NewSecuritySettingsClient(ctx) 80 if err != nil { 81 // TODO: Handle error. 82 } 83 defer c.Close() 84 85 req := &cxpb.UpdateSecuritySettingsRequest{ 86 // TODO: Fill request struct fields. 87 } 88 resp, err := c.UpdateSecuritySettings(ctx, req) 89 if err != nil { 90 // TODO: Handle error. 91 } 92 // TODO: Use resp. 93 _ = resp 94} 95 96func ExampleSecuritySettingsClient_ListSecuritySettings() { 97 ctx := context.Background() 98 c, err := cx.NewSecuritySettingsClient(ctx) 99 if err != nil { 100 // TODO: Handle error. 101 } 102 defer c.Close() 103 104 req := &cxpb.ListSecuritySettingsRequest{ 105 // TODO: Fill request struct fields. 106 } 107 it := c.ListSecuritySettings(ctx, req) 108 for { 109 resp, err := it.Next() 110 if err == iterator.Done { 111 break 112 } 113 if err != nil { 114 // TODO: Handle error. 115 } 116 // TODO: Use resp. 117 _ = resp 118 } 119} 120 121func ExampleSecuritySettingsClient_DeleteSecuritySettings() { 122 ctx := context.Background() 123 c, err := cx.NewSecuritySettingsClient(ctx) 124 if err != nil { 125 // TODO: Handle error. 126 } 127 defer c.Close() 128 129 req := &cxpb.DeleteSecuritySettingsRequest{ 130 // TODO: Fill request struct fields. 131 } 132 err = c.DeleteSecuritySettings(ctx, req) 133 if err != nil { 134 // TODO: Handle error. 135 } 136} 137