blob: eea5671cdf14b4e88006ccb9e07fb32ce241b81b [file] [log] [blame]
// 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 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"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
iampb "google.golang.org/genproto/googleapis/iam/v1"
longrunningpb "google.golang.org/genproto/googleapis/longrunning"
)
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#CreateCustomJobRequest.
}
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#GetCustomJobRequest.
}
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#ListCustomJobsRequest.
}
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#DeleteCustomJobRequest.
}
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#CancelCustomJobRequest.
}
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#CreateDataLabelingJobRequest.
}
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#GetDataLabelingJobRequest.
}
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#ListDataLabelingJobsRequest.
}
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#DeleteDataLabelingJobRequest.
}
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#CancelDataLabelingJobRequest.
}
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#CreateHyperparameterTuningJobRequest.
}
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#GetHyperparameterTuningJobRequest.
}
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#ListHyperparameterTuningJobsRequest.
}
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#DeleteHyperparameterTuningJobRequest.
}
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#CancelHyperparameterTuningJobRequest.
}
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#CreateBatchPredictionJobRequest.
}
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#GetBatchPredictionJobRequest.
}
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#ListBatchPredictionJobsRequest.
}
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#DeleteBatchPredictionJobRequest.
}
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.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#CancelBatchPredictionJobRequest.
}
err = c.CancelBatchPredictionJob(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func ExampleJobClient_CreateModelDeploymentMonitoringJob() {
ctx := context.Background()
c, err := aiplatform.NewJobClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &aiplatformpb.CreateModelDeploymentMonitoringJobRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#CreateModelDeploymentMonitoringJobRequest.
}
resp, err := c.CreateModelDeploymentMonitoringJob(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleJobClient_SearchModelDeploymentMonitoringStatsAnomalies() {
ctx := context.Background()
c, err := aiplatform.NewJobClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &aiplatformpb.SearchModelDeploymentMonitoringStatsAnomaliesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#SearchModelDeploymentMonitoringStatsAnomaliesRequest.
}
it := c.SearchModelDeploymentMonitoringStatsAnomalies(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func ExampleJobClient_GetModelDeploymentMonitoringJob() {
ctx := context.Background()
c, err := aiplatform.NewJobClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &aiplatformpb.GetModelDeploymentMonitoringJobRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#GetModelDeploymentMonitoringJobRequest.
}
resp, err := c.GetModelDeploymentMonitoringJob(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleJobClient_ListModelDeploymentMonitoringJobs() {
ctx := context.Background()
c, err := aiplatform.NewJobClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &aiplatformpb.ListModelDeploymentMonitoringJobsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#ListModelDeploymentMonitoringJobsRequest.
}
it := c.ListModelDeploymentMonitoringJobs(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func ExampleJobClient_UpdateModelDeploymentMonitoringJob() {
ctx := context.Background()
c, err := aiplatform.NewJobClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &aiplatformpb.UpdateModelDeploymentMonitoringJobRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#UpdateModelDeploymentMonitoringJobRequest.
}
op, err := c.UpdateModelDeploymentMonitoringJob(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleJobClient_DeleteModelDeploymentMonitoringJob() {
ctx := context.Background()
c, err := aiplatform.NewJobClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &aiplatformpb.DeleteModelDeploymentMonitoringJobRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#DeleteModelDeploymentMonitoringJobRequest.
}
op, err := c.DeleteModelDeploymentMonitoringJob(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func ExampleJobClient_PauseModelDeploymentMonitoringJob() {
ctx := context.Background()
c, err := aiplatform.NewJobClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &aiplatformpb.PauseModelDeploymentMonitoringJobRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#PauseModelDeploymentMonitoringJobRequest.
}
err = c.PauseModelDeploymentMonitoringJob(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func ExampleJobClient_ResumeModelDeploymentMonitoringJob() {
ctx := context.Background()
c, err := aiplatform.NewJobClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &aiplatformpb.ResumeModelDeploymentMonitoringJobRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#ResumeModelDeploymentMonitoringJobRequest.
}
err = c.ResumeModelDeploymentMonitoringJob(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func ExampleJobClient_GetLocation() {
ctx := context.Background()
c, err := aiplatform.NewJobClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.GetLocationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
}
resp, err := c.GetLocation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleJobClient_ListLocations() {
ctx := context.Background()
c, err := aiplatform.NewJobClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func ExampleJobClient_GetIamPolicy() {
ctx := context.Background()
c, err := aiplatform.NewJobClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &iampb.GetIamPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#GetIamPolicyRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleJobClient_SetIamPolicy() {
ctx := context.Background()
c, err := aiplatform.NewJobClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &iampb.SetIamPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#SetIamPolicyRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleJobClient_TestIamPermissions() {
ctx := context.Background()
c, err := aiplatform.NewJobClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &iampb.TestIamPermissionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#TestIamPermissionsRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleJobClient_CancelOperation() {
ctx := context.Background()
c, err := aiplatform.NewJobClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func ExampleJobClient_DeleteOperation() {
ctx := context.Background()
c, err := aiplatform.NewJobClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func ExampleJobClient_GetOperation() {
ctx := context.Background()
c, err := aiplatform.NewJobClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleJobClient_ListOperations() {
ctx := context.Background()
c, err := aiplatform.NewJobClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func ExampleJobClient_WaitOperation() {
ctx := context.Background()
c, err := aiplatform.NewJobClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.WaitOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#WaitOperationRequest.
}
resp, err := c.WaitOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}