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 recaptchaenterprise_test
18
19import (
20	"context"
21
22	recaptchaenterprise "cloud.google.com/go/recaptchaenterprise/apiv1beta1"
23	"google.golang.org/api/iterator"
24	recaptchaenterprisepb "google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1beta1"
25)
26
27func ExampleNewRecaptchaEnterpriseServiceV1Beta1Client() {
28	ctx := context.Background()
29	c, err := recaptchaenterprise.NewRecaptchaEnterpriseServiceV1Beta1Client(ctx)
30	if err != nil {
31		// TODO: Handle error.
32	}
33	defer c.Close()
34
35	// TODO: Use client.
36	_ = c
37}
38
39func ExampleRecaptchaEnterpriseServiceV1Beta1Client_CreateAssessment() {
40	ctx := context.Background()
41	c, err := recaptchaenterprise.NewRecaptchaEnterpriseServiceV1Beta1Client(ctx)
42	if err != nil {
43		// TODO: Handle error.
44	}
45	defer c.Close()
46
47	req := &recaptchaenterprisepb.CreateAssessmentRequest{
48		// TODO: Fill request struct fields.
49	}
50	resp, err := c.CreateAssessment(ctx, req)
51	if err != nil {
52		// TODO: Handle error.
53	}
54	// TODO: Use resp.
55	_ = resp
56}
57
58func ExampleRecaptchaEnterpriseServiceV1Beta1Client_AnnotateAssessment() {
59	ctx := context.Background()
60	c, err := recaptchaenterprise.NewRecaptchaEnterpriseServiceV1Beta1Client(ctx)
61	if err != nil {
62		// TODO: Handle error.
63	}
64	defer c.Close()
65
66	req := &recaptchaenterprisepb.AnnotateAssessmentRequest{
67		// TODO: Fill request struct fields.
68	}
69	resp, err := c.AnnotateAssessment(ctx, req)
70	if err != nil {
71		// TODO: Handle error.
72	}
73	// TODO: Use resp.
74	_ = resp
75}
76
77func ExampleRecaptchaEnterpriseServiceV1Beta1Client_CreateKey() {
78	ctx := context.Background()
79	c, err := recaptchaenterprise.NewRecaptchaEnterpriseServiceV1Beta1Client(ctx)
80	if err != nil {
81		// TODO: Handle error.
82	}
83	defer c.Close()
84
85	req := &recaptchaenterprisepb.CreateKeyRequest{
86		// TODO: Fill request struct fields.
87	}
88	resp, err := c.CreateKey(ctx, req)
89	if err != nil {
90		// TODO: Handle error.
91	}
92	// TODO: Use resp.
93	_ = resp
94}
95
96func ExampleRecaptchaEnterpriseServiceV1Beta1Client_ListKeys() {
97	ctx := context.Background()
98	c, err := recaptchaenterprise.NewRecaptchaEnterpriseServiceV1Beta1Client(ctx)
99	if err != nil {
100		// TODO: Handle error.
101	}
102	defer c.Close()
103
104	req := &recaptchaenterprisepb.ListKeysRequest{
105		// TODO: Fill request struct fields.
106	}
107	it := c.ListKeys(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 ExampleRecaptchaEnterpriseServiceV1Beta1Client_GetKey() {
122	ctx := context.Background()
123	c, err := recaptchaenterprise.NewRecaptchaEnterpriseServiceV1Beta1Client(ctx)
124	if err != nil {
125		// TODO: Handle error.
126	}
127	defer c.Close()
128
129	req := &recaptchaenterprisepb.GetKeyRequest{
130		// TODO: Fill request struct fields.
131	}
132	resp, err := c.GetKey(ctx, req)
133	if err != nil {
134		// TODO: Handle error.
135	}
136	// TODO: Use resp.
137	_ = resp
138}
139
140func ExampleRecaptchaEnterpriseServiceV1Beta1Client_UpdateKey() {
141	ctx := context.Background()
142	c, err := recaptchaenterprise.NewRecaptchaEnterpriseServiceV1Beta1Client(ctx)
143	if err != nil {
144		// TODO: Handle error.
145	}
146	defer c.Close()
147
148	req := &recaptchaenterprisepb.UpdateKeyRequest{
149		// TODO: Fill request struct fields.
150	}
151	resp, err := c.UpdateKey(ctx, req)
152	if err != nil {
153		// TODO: Handle error.
154	}
155	// TODO: Use resp.
156	_ = resp
157}
158
159func ExampleRecaptchaEnterpriseServiceV1Beta1Client_DeleteKey() {
160	ctx := context.Background()
161	c, err := recaptchaenterprise.NewRecaptchaEnterpriseServiceV1Beta1Client(ctx)
162	if err != nil {
163		// TODO: Handle error.
164	}
165	defer c.Close()
166
167	req := &recaptchaenterprisepb.DeleteKeyRequest{
168		// TODO: Fill request struct fields.
169	}
170	err = c.DeleteKey(ctx, req)
171	if err != nil {
172		// TODO: Handle error.
173	}
174}
175