| // 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" |
| ) |
| |
| func ExampleNewMetadataClient() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| // TODO: Use client. |
| _ = c |
| } |
| |
| func ExampleMetadataClient_CreateMetadataStore() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.CreateMetadataStoreRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#CreateMetadataStoreRequest. |
| } |
| op, err := c.CreateMetadataStore(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_GetMetadataStore() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.GetMetadataStoreRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#GetMetadataStoreRequest. |
| } |
| resp, err := c.GetMetadataStore(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_ListMetadataStores() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.ListMetadataStoresRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#ListMetadataStoresRequest. |
| } |
| it := c.ListMetadataStores(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleMetadataClient_DeleteMetadataStore() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.DeleteMetadataStoreRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#DeleteMetadataStoreRequest. |
| } |
| op, err := c.DeleteMetadataStore(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleMetadataClient_CreateArtifact() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.CreateArtifactRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#CreateArtifactRequest. |
| } |
| resp, err := c.CreateArtifact(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_GetArtifact() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.GetArtifactRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#GetArtifactRequest. |
| } |
| resp, err := c.GetArtifact(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_ListArtifacts() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.ListArtifactsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#ListArtifactsRequest. |
| } |
| it := c.ListArtifacts(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleMetadataClient_UpdateArtifact() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.UpdateArtifactRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#UpdateArtifactRequest. |
| } |
| resp, err := c.UpdateArtifact(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_DeleteArtifact() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.DeleteArtifactRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#DeleteArtifactRequest. |
| } |
| op, err := c.DeleteArtifact(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleMetadataClient_PurgeArtifacts() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.PurgeArtifactsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#PurgeArtifactsRequest. |
| } |
| op, err := c.PurgeArtifacts(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_CreateContext() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.CreateContextRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#CreateContextRequest. |
| } |
| resp, err := c.CreateContext(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_GetContext() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.GetContextRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#GetContextRequest. |
| } |
| resp, err := c.GetContext(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_ListContexts() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.ListContextsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#ListContextsRequest. |
| } |
| it := c.ListContexts(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleMetadataClient_UpdateContext() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.UpdateContextRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#UpdateContextRequest. |
| } |
| resp, err := c.UpdateContext(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_DeleteContext() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.DeleteContextRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#DeleteContextRequest. |
| } |
| op, err := c.DeleteContext(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleMetadataClient_PurgeContexts() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.PurgeContextsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#PurgeContextsRequest. |
| } |
| op, err := c.PurgeContexts(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_AddContextArtifactsAndExecutions() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.AddContextArtifactsAndExecutionsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#AddContextArtifactsAndExecutionsRequest. |
| } |
| resp, err := c.AddContextArtifactsAndExecutions(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_AddContextChildren() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.AddContextChildrenRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#AddContextChildrenRequest. |
| } |
| resp, err := c.AddContextChildren(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_QueryContextLineageSubgraph() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.QueryContextLineageSubgraphRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#QueryContextLineageSubgraphRequest. |
| } |
| resp, err := c.QueryContextLineageSubgraph(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_CreateExecution() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.CreateExecutionRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#CreateExecutionRequest. |
| } |
| resp, err := c.CreateExecution(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_GetExecution() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.GetExecutionRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#GetExecutionRequest. |
| } |
| resp, err := c.GetExecution(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_ListExecutions() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.ListExecutionsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#ListExecutionsRequest. |
| } |
| it := c.ListExecutions(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleMetadataClient_UpdateExecution() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.UpdateExecutionRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#UpdateExecutionRequest. |
| } |
| resp, err := c.UpdateExecution(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_DeleteExecution() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.DeleteExecutionRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#DeleteExecutionRequest. |
| } |
| op, err := c.DeleteExecution(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleMetadataClient_PurgeExecutions() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.PurgeExecutionsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#PurgeExecutionsRequest. |
| } |
| op, err := c.PurgeExecutions(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_AddExecutionEvents() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.AddExecutionEventsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#AddExecutionEventsRequest. |
| } |
| resp, err := c.AddExecutionEvents(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_QueryExecutionInputsAndOutputs() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.QueryExecutionInputsAndOutputsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#QueryExecutionInputsAndOutputsRequest. |
| } |
| resp, err := c.QueryExecutionInputsAndOutputs(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_CreateMetadataSchema() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.CreateMetadataSchemaRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#CreateMetadataSchemaRequest. |
| } |
| resp, err := c.CreateMetadataSchema(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_GetMetadataSchema() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.GetMetadataSchemaRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#GetMetadataSchemaRequest. |
| } |
| resp, err := c.GetMetadataSchema(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleMetadataClient_ListMetadataSchemas() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.ListMetadataSchemasRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#ListMetadataSchemasRequest. |
| } |
| it := c.ListMetadataSchemas(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleMetadataClient_QueryArtifactLineageSubgraph() { |
| ctx := context.Background() |
| c, err := aiplatform.NewMetadataClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.QueryArtifactLineageSubgraphRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1#QueryArtifactLineageSubgraphRequest. |
| } |
| resp, err := c.QueryArtifactLineageSubgraph(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |