| 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 gkemulticloud_test |
| 20 | |
| 21 | import ( |
| 22 | "context" |
| 23 | |
| 24 | gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" |
| 25 | gkemulticloudpb "cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb" |
| 26 | longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" |
| 27 | ) |
| 28 | |
| 29 | func ExampleAzureClustersClient_ListAzureClients_all() { |
| 30 | ctx := context.Background() |
| 31 | // This snippet has been automatically generated and should be regarded as a code template only. |
| 32 | // It will require modifications to work: |
| 33 | // - It may require correct/in-range values for request initialization. |
| 34 | // - It may require specifying regional endpoints when creating the service client as shown in: |
| 35 | // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 36 | c, err := gkemulticloud.NewAzureClustersClient(ctx) |
| 37 | if err != nil { |
| 38 | // TODO: Handle error. |
| 39 | } |
| 40 | defer c.Close() |
| 41 | |
| 42 | req := &gkemulticloudpb.ListAzureClientsRequest{ |
| 43 | // TODO: Fill request struct fields. |
| 44 | // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#ListAzureClientsRequest. |
| 45 | } |
| 46 | for resp, err := range c.ListAzureClients(ctx, req).All() { |
| 47 | if err != nil { |
| 48 | // TODO: Handle error and break/return/continue. Iteration will stop after any error. |
| 49 | } |
| 50 | // TODO: Use resp. |
| 51 | _ = resp |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | func ExampleAzureClustersClient_ListAzureClusters_all() { |
| 56 | ctx := context.Background() |
| 57 | // This snippet has been automatically generated and should be regarded as a code template only. |
| 58 | // It will require modifications to work: |
| 59 | // - It may require correct/in-range values for request initialization. |
| 60 | // - It may require specifying regional endpoints when creating the service client as shown in: |
| 61 | // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 62 | c, err := gkemulticloud.NewAzureClustersClient(ctx) |
| 63 | if err != nil { |
| 64 | // TODO: Handle error. |
| 65 | } |
| 66 | defer c.Close() |
| 67 | |
| 68 | req := &gkemulticloudpb.ListAzureClustersRequest{ |
| 69 | // TODO: Fill request struct fields. |
| 70 | // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#ListAzureClustersRequest. |
| 71 | } |
| 72 | for resp, err := range c.ListAzureClusters(ctx, req).All() { |
| 73 | if err != nil { |
| 74 | // TODO: Handle error and break/return/continue. Iteration will stop after any error. |
| 75 | } |
| 76 | // TODO: Use resp. |
| 77 | _ = resp |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | func ExampleAzureClustersClient_ListAzureNodePools_all() { |
| 82 | ctx := context.Background() |
| 83 | // This snippet has been automatically generated and should be regarded as a code template only. |
| 84 | // It will require modifications to work: |
| 85 | // - It may require correct/in-range values for request initialization. |
| 86 | // - It may require specifying regional endpoints when creating the service client as shown in: |
| 87 | // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 88 | c, err := gkemulticloud.NewAzureClustersClient(ctx) |
| 89 | if err != nil { |
| 90 | // TODO: Handle error. |
| 91 | } |
| 92 | defer c.Close() |
| 93 | |
| 94 | req := &gkemulticloudpb.ListAzureNodePoolsRequest{ |
| 95 | // TODO: Fill request struct fields. |
| 96 | // See https://pkg.go.dev/cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb#ListAzureNodePoolsRequest. |
| 97 | } |
| 98 | for resp, err := range c.ListAzureNodePools(ctx, req).All() { |
| 99 | if err != nil { |
| 100 | // TODO: Handle error and break/return/continue. Iteration will stop after any error. |
| 101 | } |
| 102 | // TODO: Use resp. |
| 103 | _ = resp |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | func ExampleAzureClustersClient_ListOperations_all() { |
| 108 | ctx := context.Background() |
| 109 | // This snippet has been automatically generated and should be regarded as a code template only. |
| 110 | // It will require modifications to work: |
| 111 | // - It may require correct/in-range values for request initialization. |
| 112 | // - It may require specifying regional endpoints when creating the service client as shown in: |
| 113 | // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options |
| 114 | c, err := gkemulticloud.NewAzureClustersClient(ctx) |
| 115 | if err != nil { |
| 116 | // TODO: Handle error. |
| 117 | } |
| 118 | defer c.Close() |
| 119 | |
| 120 | req := &longrunningpb.ListOperationsRequest{ |
| 121 | // TODO: Fill request struct fields. |
| 122 | // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. |
| 123 | } |
| 124 | for resp, err := range c.ListOperations(ctx, req).All() { |
| 125 | if err != nil { |
| 126 | // TODO: Handle error and break/return/continue. Iteration will stop after any error. |
| 127 | } |
| 128 | // TODO: Use resp. |
| 129 | _ = resp |
| 130 | } |
| 131 | } |