| 1 | // Copyright 2025 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 | |
| 17 | //go:build go1.23 |
| 18 | |
| 19 | package recaptchaenterprise_test |
| 20 | |
| 21 | import ( |
| 22 | "context" |
| 23 | |
| 24 | recaptchaenterprise "cloud.google.com/go/recaptchaenterprise/v2/apiv1" |
| 25 | recaptchaenterprisepb "cloud.google.com/go/recaptchaenterprise/v2/apiv1/recaptchaenterprisepb" |
| 26 | ) |
| 27 | |
| 28 | func ExampleClient_ListFirewallPolicies_all() { |
| 29 | ctx := context.Background() |
| 30 | // This snippet has been automatically generated and should be regarded as a code template only. |
| 31 | // It will require modifications to work: |
| 32 | // - It may require correct/in-range values for request initialization. |
| 33 | // - It may require specifying regional endpoints when creating the service client as shown in: |
| 34 | // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 35 | c, err := recaptchaenterprise.NewClient(ctx) |
| 36 | if err != nil { |
| 37 | // TODO: Handle error. |
| 38 | } |
| 39 | defer c.Close() |
| 40 | |
| 41 | req := &recaptchaenterprisepb.ListFirewallPoliciesRequest{ |
| 42 | // TODO: Fill request struct fields. |
| 43 | // See https://pkg.go.dev/cloud.google.com/go/recaptchaenterprise/v2/apiv1/recaptchaenterprisepb#ListFirewallPoliciesRequest. |
| 44 | } |
| 45 | for resp, err := range c.ListFirewallPolicies(ctx, req).All() { |
| 46 | if err != nil { |
| 47 | // TODO: Handle error and break/return/continue. Iteration will stop after any error. |
| 48 | } |
| 49 | // TODO: Use resp. |
| 50 | _ = resp |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | func ExampleClient_ListIpOverrides_all() { |
| 55 | ctx := context.Background() |
| 56 | // This snippet has been automatically generated and should be regarded as a code template only. |
| 57 | // It will require modifications to work: |
| 58 | // - It may require correct/in-range values for request initialization. |
| 59 | // - It may require specifying regional endpoints when creating the service client as shown in: |
| 60 | // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 61 | c, err := recaptchaenterprise.NewClient(ctx) |
| 62 | if err != nil { |
| 63 | // TODO: Handle error. |
| 64 | } |
| 65 | defer c.Close() |
| 66 | |
| 67 | req := &recaptchaenterprisepb.ListIpOverridesRequest{ |
| 68 | // TODO: Fill request struct fields. |
| 69 | // See https://pkg.go.dev/cloud.google.com/go/recaptchaenterprise/v2/apiv1/recaptchaenterprisepb#ListIpOverridesRequest. |
| 70 | } |
| 71 | for resp, err := range c.ListIpOverrides(ctx, req).All() { |
| 72 | if err != nil { |
| 73 | // TODO: Handle error and break/return/continue. Iteration will stop after any error. |
| 74 | } |
| 75 | // TODO: Use resp. |
| 76 | _ = resp |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | func ExampleClient_ListKeys_all() { |
| 81 | ctx := context.Background() |
| 82 | // This snippet has been automatically generated and should be regarded as a code template only. |
| 83 | // It will require modifications to work: |
| 84 | // - It may require correct/in-range values for request initialization. |
| 85 | // - It may require specifying regional endpoints when creating the service client as shown in: |
| 86 | // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 87 | c, err := recaptchaenterprise.NewClient(ctx) |
| 88 | if err != nil { |
| 89 | // TODO: Handle error. |
| 90 | } |
| 91 | defer c.Close() |
| 92 | |
| 93 | req := &recaptchaenterprisepb.ListKeysRequest{ |
| 94 | // TODO: Fill request struct fields. |
| 95 | // See https://pkg.go.dev/cloud.google.com/go/recaptchaenterprise/v2/apiv1/recaptchaenterprisepb#ListKeysRequest. |
| 96 | } |
| 97 | for resp, err := range c.ListKeys(ctx, req).All() { |
| 98 | if err != nil { |
| 99 | // TODO: Handle error and break/return/continue. Iteration will stop after any error. |
| 100 | } |
| 101 | // TODO: Use resp. |
| 102 | _ = resp |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | func ExampleClient_ListRelatedAccountGroupMemberships_all() { |
| 107 | ctx := context.Background() |
| 108 | // This snippet has been automatically generated and should be regarded as a code template only. |
| 109 | // It will require modifications to work: |
| 110 | // - It may require correct/in-range values for request initialization. |
| 111 | // - It may require specifying regional endpoints when creating the service client as shown in: |
| 112 | // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 113 | c, err := recaptchaenterprise.NewClient(ctx) |
| 114 | if err != nil { |
| 115 | // TODO: Handle error. |
| 116 | } |
| 117 | defer c.Close() |
| 118 | |
| 119 | req := &recaptchaenterprisepb.ListRelatedAccountGroupMembershipsRequest{ |
| 120 | // TODO: Fill request struct fields. |
| 121 | // See https://pkg.go.dev/cloud.google.com/go/recaptchaenterprise/v2/apiv1/recaptchaenterprisepb#ListRelatedAccountGroupMembershipsRequest. |
| 122 | } |
| 123 | for resp, err := range c.ListRelatedAccountGroupMemberships(ctx, req).All() { |
| 124 | if err != nil { |
| 125 | // TODO: Handle error and break/return/continue. Iteration will stop after any error. |
| 126 | } |
| 127 | // TODO: Use resp. |
| 128 | _ = resp |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | func ExampleClient_ListRelatedAccountGroups_all() { |
| 133 | ctx := context.Background() |
| 134 | // This snippet has been automatically generated and should be regarded as a code template only. |
| 135 | // It will require modifications to work: |
| 136 | // - It may require correct/in-range values for request initialization. |
| 137 | // - It may require specifying regional endpoints when creating the service client as shown in: |
| 138 | // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 139 | c, err := recaptchaenterprise.NewClient(ctx) |
| 140 | if err != nil { |
| 141 | // TODO: Handle error. |
| 142 | } |
| 143 | defer c.Close() |
| 144 | |
| 145 | req := &recaptchaenterprisepb.ListRelatedAccountGroupsRequest{ |
| 146 | // TODO: Fill request struct fields. |
| 147 | // See https://pkg.go.dev/cloud.google.com/go/recaptchaenterprise/v2/apiv1/recaptchaenterprisepb#ListRelatedAccountGroupsRequest. |
| 148 | } |
| 149 | for resp, err := range c.ListRelatedAccountGroups(ctx, req).All() { |
| 150 | if err != nil { |
| 151 | // TODO: Handle error and break/return/continue. Iteration will stop after any error. |
| 152 | } |
| 153 | // TODO: Use resp. |
| 154 | _ = resp |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | func ExampleClient_SearchRelatedAccountGroupMemberships_all() { |
| 159 | ctx := context.Background() |
| 160 | // This snippet has been automatically generated and should be regarded as a code template only. |
| 161 | // It will require modifications to work: |
| 162 | // - It may require correct/in-range values for request initialization. |
| 163 | // - It may require specifying regional endpoints when creating the service client as shown in: |
| 164 | // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 165 | c, err := recaptchaenterprise.NewClient(ctx) |
| 166 | if err != nil { |
| 167 | // TODO: Handle error. |
| 168 | } |
| 169 | defer c.Close() |
| 170 | |
| 171 | req := &recaptchaenterprisepb.SearchRelatedAccountGroupMembershipsRequest{ |
| 172 | // TODO: Fill request struct fields. |
| 173 | // See https://pkg.go.dev/cloud.google.com/go/recaptchaenterprise/v2/apiv1/recaptchaenterprisepb#SearchRelatedAccountGroupMembershipsRequest. |
| 174 | } |
| 175 | for resp, err := range c.SearchRelatedAccountGroupMemberships(ctx, req).All() { |
| 176 | if err != nil { |
| 177 | // TODO: Handle error and break/return/continue. Iteration will stop after any error. |
| 178 | } |
| 179 | // TODO: Use resp. |
| 180 | _ = resp |
| 181 | } |
| 182 | } |