| // Copyright 2021 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 datacatalog_test |
| |
| import ( |
| "context" |
| |
| datacatalog "cloud.google.com/go/datacatalog/apiv1beta1" |
| "google.golang.org/api/iterator" |
| datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1" |
| iampb "google.golang.org/genproto/googleapis/iam/v1" |
| ) |
| |
| func ExampleNewClient() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| // TODO: Use client. |
| _ = c |
| } |
| |
| func ExampleClient_SearchCatalog() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.SearchCatalogRequest{ |
| // TODO: Fill request struct fields. |
| } |
| it := c.SearchCatalog(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleClient_CreateEntryGroup() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.CreateEntryGroupRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.CreateEntryGroup(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_UpdateEntryGroup() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.UpdateEntryGroupRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.UpdateEntryGroup(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_GetEntryGroup() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.GetEntryGroupRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.GetEntryGroup(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_DeleteEntryGroup() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.DeleteEntryGroupRequest{ |
| // TODO: Fill request struct fields. |
| } |
| err = c.DeleteEntryGroup(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_ListEntryGroups() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.ListEntryGroupsRequest{ |
| // TODO: Fill request struct fields. |
| } |
| it := c.ListEntryGroups(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleClient_CreateEntry() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.CreateEntryRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.CreateEntry(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_UpdateEntry() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.UpdateEntryRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.UpdateEntry(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_DeleteEntry() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.DeleteEntryRequest{ |
| // TODO: Fill request struct fields. |
| } |
| err = c.DeleteEntry(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_GetEntry() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.GetEntryRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.GetEntry(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_LookupEntry() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.LookupEntryRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.LookupEntry(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_ListEntries() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.ListEntriesRequest{ |
| // TODO: Fill request struct fields. |
| } |
| it := c.ListEntries(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleClient_CreateTagTemplate() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.CreateTagTemplateRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.CreateTagTemplate(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_GetTagTemplate() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.GetTagTemplateRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.GetTagTemplate(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_UpdateTagTemplate() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.UpdateTagTemplateRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.UpdateTagTemplate(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_DeleteTagTemplate() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.DeleteTagTemplateRequest{ |
| // TODO: Fill request struct fields. |
| } |
| err = c.DeleteTagTemplate(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_CreateTagTemplateField() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.CreateTagTemplateFieldRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.CreateTagTemplateField(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_UpdateTagTemplateField() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.UpdateTagTemplateFieldRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.UpdateTagTemplateField(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_RenameTagTemplateField() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.RenameTagTemplateFieldRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.RenameTagTemplateField(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_DeleteTagTemplateField() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.DeleteTagTemplateFieldRequest{ |
| // TODO: Fill request struct fields. |
| } |
| err = c.DeleteTagTemplateField(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_CreateTag() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.CreateTagRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.CreateTag(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_UpdateTag() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.UpdateTagRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.UpdateTag(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_DeleteTag() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.DeleteTagRequest{ |
| // TODO: Fill request struct fields. |
| } |
| err = c.DeleteTag(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_ListTags() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &datacatalogpb.ListTagsRequest{ |
| // TODO: Fill request struct fields. |
| } |
| it := c.ListTags(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleClient_SetIamPolicy() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &iampb.SetIamPolicyRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.SetIamPolicy(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_GetIamPolicy() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &iampb.GetIamPolicyRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.GetIamPolicy(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_TestIamPermissions() { |
| ctx := context.Background() |
| c, err := datacatalog.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &iampb.TestIamPermissionsRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.TestIamPermissions(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |