| // Copyright 2022 Google LLC |
| // |
| // 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 |
| // |
| // https://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // 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. |
| |
| // Code generated by protoc-gen-go_gapic. DO NOT EDIT. |
| |
| package certificatemanager_test |
| |
| import ( |
| "context" |
| |
| certificatemanager "cloud.google.com/go/certificatemanager/apiv1" |
| "google.golang.org/api/iterator" |
| certificatemanagerpb "google.golang.org/genproto/googleapis/cloud/certificatemanager/v1" |
| ) |
| |
| func ExampleNewClient() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| // TODO: Use client. |
| _ = c |
| } |
| |
| func ExampleClient_ListCertificates() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.ListCertificatesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#ListCertificatesRequest. |
| } |
| it := c.ListCertificates(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleClient_GetCertificate() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.GetCertificateRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#GetCertificateRequest. |
| } |
| resp, err := c.GetCertificate(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_CreateCertificate() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.CreateCertificateRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#CreateCertificateRequest. |
| } |
| op, err := c.CreateCertificate(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_UpdateCertificate() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.UpdateCertificateRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#UpdateCertificateRequest. |
| } |
| op, err := c.UpdateCertificate(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_DeleteCertificate() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.DeleteCertificateRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#DeleteCertificateRequest. |
| } |
| op, err := c.DeleteCertificate(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_ListCertificateMaps() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.ListCertificateMapsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#ListCertificateMapsRequest. |
| } |
| it := c.ListCertificateMaps(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleClient_GetCertificateMap() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.GetCertificateMapRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#GetCertificateMapRequest. |
| } |
| resp, err := c.GetCertificateMap(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_CreateCertificateMap() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.CreateCertificateMapRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#CreateCertificateMapRequest. |
| } |
| op, err := c.CreateCertificateMap(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_UpdateCertificateMap() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.UpdateCertificateMapRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#UpdateCertificateMapRequest. |
| } |
| op, err := c.UpdateCertificateMap(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_DeleteCertificateMap() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.DeleteCertificateMapRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#DeleteCertificateMapRequest. |
| } |
| op, err := c.DeleteCertificateMap(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_ListCertificateMapEntries() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.ListCertificateMapEntriesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#ListCertificateMapEntriesRequest. |
| } |
| it := c.ListCertificateMapEntries(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleClient_GetCertificateMapEntry() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.GetCertificateMapEntryRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#GetCertificateMapEntryRequest. |
| } |
| resp, err := c.GetCertificateMapEntry(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_CreateCertificateMapEntry() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.CreateCertificateMapEntryRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#CreateCertificateMapEntryRequest. |
| } |
| op, err := c.CreateCertificateMapEntry(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_UpdateCertificateMapEntry() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.UpdateCertificateMapEntryRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#UpdateCertificateMapEntryRequest. |
| } |
| op, err := c.UpdateCertificateMapEntry(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_DeleteCertificateMapEntry() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.DeleteCertificateMapEntryRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#DeleteCertificateMapEntryRequest. |
| } |
| op, err := c.DeleteCertificateMapEntry(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_ListDnsAuthorizations() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.ListDnsAuthorizationsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#ListDnsAuthorizationsRequest. |
| } |
| it := c.ListDnsAuthorizations(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleClient_GetDnsAuthorization() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.GetDnsAuthorizationRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#GetDnsAuthorizationRequest. |
| } |
| resp, err := c.GetDnsAuthorization(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_CreateDnsAuthorization() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.CreateDnsAuthorizationRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#CreateDnsAuthorizationRequest. |
| } |
| op, err := c.CreateDnsAuthorization(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_UpdateDnsAuthorization() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.UpdateDnsAuthorizationRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#UpdateDnsAuthorizationRequest. |
| } |
| op, err := c.UpdateDnsAuthorization(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_DeleteDnsAuthorization() { |
| ctx := context.Background() |
| c, err := certificatemanager.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &certificatemanagerpb.DeleteDnsAuthorizationRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/certificatemanager/v1#DeleteDnsAuthorizationRequest. |
| } |
| op, err := c.DeleteDnsAuthorization(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |