| // 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 aiplatform_test |
| |
| import ( |
| "context" |
| |
| aiplatform "cloud.google.com/go/aiplatform/apiv1" |
| "google.golang.org/api/iterator" |
| aiplatformpb "google.golang.org/genproto/googleapis/cloud/aiplatform/v1" |
| ) |
| |
| func ExampleNewJobClient() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| // TODO: Use client. |
| _ = c |
| } |
| |
| func ExampleJobClient_CreateCustomJob() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.CreateCustomJobRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.CreateCustomJob(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleJobClient_GetCustomJob() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.GetCustomJobRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.GetCustomJob(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleJobClient_ListCustomJobs() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.ListCustomJobsRequest{ |
| // TODO: Fill request struct fields. |
| } |
| it := c.ListCustomJobs(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleJobClient_DeleteCustomJob() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.DeleteCustomJobRequest{ |
| // TODO: Fill request struct fields. |
| } |
| op, err := c.DeleteCustomJob(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleJobClient_CancelCustomJob() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.CancelCustomJobRequest{ |
| // TODO: Fill request struct fields. |
| } |
| err = c.CancelCustomJob(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleJobClient_CreateDataLabelingJob() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.CreateDataLabelingJobRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.CreateDataLabelingJob(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleJobClient_GetDataLabelingJob() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.GetDataLabelingJobRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.GetDataLabelingJob(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleJobClient_ListDataLabelingJobs() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.ListDataLabelingJobsRequest{ |
| // TODO: Fill request struct fields. |
| } |
| it := c.ListDataLabelingJobs(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleJobClient_DeleteDataLabelingJob() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.DeleteDataLabelingJobRequest{ |
| // TODO: Fill request struct fields. |
| } |
| op, err := c.DeleteDataLabelingJob(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleJobClient_CancelDataLabelingJob() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.CancelDataLabelingJobRequest{ |
| // TODO: Fill request struct fields. |
| } |
| err = c.CancelDataLabelingJob(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleJobClient_CreateHyperparameterTuningJob() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.CreateHyperparameterTuningJobRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.CreateHyperparameterTuningJob(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleJobClient_GetHyperparameterTuningJob() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.GetHyperparameterTuningJobRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.GetHyperparameterTuningJob(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleJobClient_ListHyperparameterTuningJobs() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.ListHyperparameterTuningJobsRequest{ |
| // TODO: Fill request struct fields. |
| } |
| it := c.ListHyperparameterTuningJobs(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleJobClient_DeleteHyperparameterTuningJob() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.DeleteHyperparameterTuningJobRequest{ |
| // TODO: Fill request struct fields. |
| } |
| op, err := c.DeleteHyperparameterTuningJob(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleJobClient_CancelHyperparameterTuningJob() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.CancelHyperparameterTuningJobRequest{ |
| // TODO: Fill request struct fields. |
| } |
| err = c.CancelHyperparameterTuningJob(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleJobClient_CreateBatchPredictionJob() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.CreateBatchPredictionJobRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.CreateBatchPredictionJob(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleJobClient_GetBatchPredictionJob() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.GetBatchPredictionJobRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.GetBatchPredictionJob(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleJobClient_ListBatchPredictionJobs() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.ListBatchPredictionJobsRequest{ |
| // TODO: Fill request struct fields. |
| } |
| it := c.ListBatchPredictionJobs(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleJobClient_DeleteBatchPredictionJob() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.DeleteBatchPredictionJobRequest{ |
| // TODO: Fill request struct fields. |
| } |
| op, err := c.DeleteBatchPredictionJob(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleJobClient_CancelBatchPredictionJob() { |
| ctx := context.Background() |
| c, err := aiplatform.NewJobClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.CancelBatchPredictionJobRequest{ |
| // TODO: Fill request struct fields. |
| } |
| err = c.CancelBatchPredictionJob(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |