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 talent_test 18 19import ( 20 "context" 21 22 talent "cloud.google.com/go/talent/apiv4beta1" 23 "google.golang.org/api/iterator" 24 talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4beta1" 25) 26 27func ExampleNewCompanyClient() { 28 ctx := context.Background() 29 c, err := talent.NewCompanyClient(ctx) 30 if err != nil { 31 // TODO: Handle error. 32 } 33 defer c.Close() 34 35 // TODO: Use client. 36 _ = c 37} 38 39func ExampleCompanyClient_CreateCompany() { 40 ctx := context.Background() 41 c, err := talent.NewCompanyClient(ctx) 42 if err != nil { 43 // TODO: Handle error. 44 } 45 defer c.Close() 46 47 req := &talentpb.CreateCompanyRequest{ 48 // TODO: Fill request struct fields. 49 } 50 resp, err := c.CreateCompany(ctx, req) 51 if err != nil { 52 // TODO: Handle error. 53 } 54 // TODO: Use resp. 55 _ = resp 56} 57 58func ExampleCompanyClient_GetCompany() { 59 ctx := context.Background() 60 c, err := talent.NewCompanyClient(ctx) 61 if err != nil { 62 // TODO: Handle error. 63 } 64 defer c.Close() 65 66 req := &talentpb.GetCompanyRequest{ 67 // TODO: Fill request struct fields. 68 } 69 resp, err := c.GetCompany(ctx, req) 70 if err != nil { 71 // TODO: Handle error. 72 } 73 // TODO: Use resp. 74 _ = resp 75} 76 77func ExampleCompanyClient_UpdateCompany() { 78 ctx := context.Background() 79 c, err := talent.NewCompanyClient(ctx) 80 if err != nil { 81 // TODO: Handle error. 82 } 83 defer c.Close() 84 85 req := &talentpb.UpdateCompanyRequest{ 86 // TODO: Fill request struct fields. 87 } 88 resp, err := c.UpdateCompany(ctx, req) 89 if err != nil { 90 // TODO: Handle error. 91 } 92 // TODO: Use resp. 93 _ = resp 94} 95 96func ExampleCompanyClient_DeleteCompany() { 97 ctx := context.Background() 98 c, err := talent.NewCompanyClient(ctx) 99 if err != nil { 100 // TODO: Handle error. 101 } 102 defer c.Close() 103 104 req := &talentpb.DeleteCompanyRequest{ 105 // TODO: Fill request struct fields. 106 } 107 err = c.DeleteCompany(ctx, req) 108 if err != nil { 109 // TODO: Handle error. 110 } 111} 112 113func ExampleCompanyClient_ListCompanies() { 114 ctx := context.Background() 115 c, err := talent.NewCompanyClient(ctx) 116 if err != nil { 117 // TODO: Handle error. 118 } 119 defer c.Close() 120 121 req := &talentpb.ListCompaniesRequest{ 122 // TODO: Fill request struct fields. 123 } 124 it := c.ListCompanies(ctx, req) 125 for { 126 resp, err := it.Next() 127 if err == iterator.Done { 128 break 129 } 130 if err != nil { 131 // TODO: Handle error. 132 } 133 // TODO: Use resp. 134 _ = resp 135 } 136} 137