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/apiv4" 23 "google.golang.org/api/iterator" 24 talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4" 25) 26 27func ExampleNewJobClient() { 28 ctx := context.Background() 29 c, err := talent.NewJobClient(ctx) 30 if err != nil { 31 // TODO: Handle error. 32 } 33 defer c.Close() 34 35 // TODO: Use client. 36 _ = c 37} 38 39func ExampleJobClient_CreateJob() { 40 ctx := context.Background() 41 c, err := talent.NewJobClient(ctx) 42 if err != nil { 43 // TODO: Handle error. 44 } 45 defer c.Close() 46 47 req := &talentpb.CreateJobRequest{ 48 // TODO: Fill request struct fields. 49 } 50 resp, err := c.CreateJob(ctx, req) 51 if err != nil { 52 // TODO: Handle error. 53 } 54 // TODO: Use resp. 55 _ = resp 56} 57 58func ExampleJobClient_BatchCreateJobs() { 59 ctx := context.Background() 60 c, err := talent.NewJobClient(ctx) 61 if err != nil { 62 // TODO: Handle error. 63 } 64 defer c.Close() 65 66 req := &talentpb.BatchCreateJobsRequest{ 67 // TODO: Fill request struct fields. 68 } 69 op, err := c.BatchCreateJobs(ctx, req) 70 if err != nil { 71 // TODO: Handle error. 72 } 73 74 resp, err := op.Wait(ctx) 75 if err != nil { 76 // TODO: Handle error. 77 } 78 // TODO: Use resp. 79 _ = resp 80} 81 82func ExampleJobClient_GetJob() { 83 ctx := context.Background() 84 c, err := talent.NewJobClient(ctx) 85 if err != nil { 86 // TODO: Handle error. 87 } 88 defer c.Close() 89 90 req := &talentpb.GetJobRequest{ 91 // TODO: Fill request struct fields. 92 } 93 resp, err := c.GetJob(ctx, req) 94 if err != nil { 95 // TODO: Handle error. 96 } 97 // TODO: Use resp. 98 _ = resp 99} 100 101func ExampleJobClient_UpdateJob() { 102 ctx := context.Background() 103 c, err := talent.NewJobClient(ctx) 104 if err != nil { 105 // TODO: Handle error. 106 } 107 defer c.Close() 108 109 req := &talentpb.UpdateJobRequest{ 110 // TODO: Fill request struct fields. 111 } 112 resp, err := c.UpdateJob(ctx, req) 113 if err != nil { 114 // TODO: Handle error. 115 } 116 // TODO: Use resp. 117 _ = resp 118} 119 120func ExampleJobClient_BatchUpdateJobs() { 121 ctx := context.Background() 122 c, err := talent.NewJobClient(ctx) 123 if err != nil { 124 // TODO: Handle error. 125 } 126 defer c.Close() 127 128 req := &talentpb.BatchUpdateJobsRequest{ 129 // TODO: Fill request struct fields. 130 } 131 op, err := c.BatchUpdateJobs(ctx, req) 132 if err != nil { 133 // TODO: Handle error. 134 } 135 136 resp, err := op.Wait(ctx) 137 if err != nil { 138 // TODO: Handle error. 139 } 140 // TODO: Use resp. 141 _ = resp 142} 143 144func ExampleJobClient_DeleteJob() { 145 ctx := context.Background() 146 c, err := talent.NewJobClient(ctx) 147 if err != nil { 148 // TODO: Handle error. 149 } 150 defer c.Close() 151 152 req := &talentpb.DeleteJobRequest{ 153 // TODO: Fill request struct fields. 154 } 155 err = c.DeleteJob(ctx, req) 156 if err != nil { 157 // TODO: Handle error. 158 } 159} 160 161func ExampleJobClient_BatchDeleteJobs() { 162 ctx := context.Background() 163 c, err := talent.NewJobClient(ctx) 164 if err != nil { 165 // TODO: Handle error. 166 } 167 defer c.Close() 168 169 req := &talentpb.BatchDeleteJobsRequest{ 170 // TODO: Fill request struct fields. 171 } 172 op, err := c.BatchDeleteJobs(ctx, req) 173 if err != nil { 174 // TODO: Handle error. 175 } 176 177 resp, err := op.Wait(ctx) 178 if err != nil { 179 // TODO: Handle error. 180 } 181 // TODO: Use resp. 182 _ = resp 183} 184 185func ExampleJobClient_ListJobs() { 186 ctx := context.Background() 187 c, err := talent.NewJobClient(ctx) 188 if err != nil { 189 // TODO: Handle error. 190 } 191 defer c.Close() 192 193 req := &talentpb.ListJobsRequest{ 194 // TODO: Fill request struct fields. 195 } 196 it := c.ListJobs(ctx, req) 197 for { 198 resp, err := it.Next() 199 if err == iterator.Done { 200 break 201 } 202 if err != nil { 203 // TODO: Handle error. 204 } 205 // TODO: Use resp. 206 _ = resp 207 } 208} 209 210func ExampleJobClient_SearchJobs() { 211 ctx := context.Background() 212 c, err := talent.NewJobClient(ctx) 213 if err != nil { 214 // TODO: Handle error. 215 } 216 defer c.Close() 217 218 req := &talentpb.SearchJobsRequest{ 219 // TODO: Fill request struct fields. 220 } 221 resp, err := c.SearchJobs(ctx, req) 222 if err != nil { 223 // TODO: Handle error. 224 } 225 // TODO: Use resp. 226 _ = resp 227} 228 229func ExampleJobClient_SearchJobsForAlert() { 230 ctx := context.Background() 231 c, err := talent.NewJobClient(ctx) 232 if err != nil { 233 // TODO: Handle error. 234 } 235 defer c.Close() 236 237 req := &talentpb.SearchJobsRequest{ 238 // TODO: Fill request struct fields. 239 } 240 resp, err := c.SearchJobsForAlert(ctx, req) 241 if err != nil { 242 // TODO: Handle error. 243 } 244 // TODO: Use resp. 245 _ = resp 246} 247