| // 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/apiv1beta1" |
| "google.golang.org/api/iterator" |
| aiplatformpb "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1" |
| ) |
| |
| func ExampleNewFeaturestoreClient() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| // TODO: Use client. |
| _ = c |
| } |
| |
| func ExampleFeaturestoreClient_CreateFeaturestore() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.CreateFeaturestoreRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#CreateFeaturestoreRequest. |
| } |
| op, err := c.CreateFeaturestore(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleFeaturestoreClient_GetFeaturestore() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.GetFeaturestoreRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#GetFeaturestoreRequest. |
| } |
| resp, err := c.GetFeaturestore(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleFeaturestoreClient_ListFeaturestores() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.ListFeaturestoresRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#ListFeaturestoresRequest. |
| } |
| it := c.ListFeaturestores(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleFeaturestoreClient_UpdateFeaturestore() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.UpdateFeaturestoreRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#UpdateFeaturestoreRequest. |
| } |
| op, err := c.UpdateFeaturestore(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleFeaturestoreClient_DeleteFeaturestore() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.DeleteFeaturestoreRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#DeleteFeaturestoreRequest. |
| } |
| op, err := c.DeleteFeaturestore(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleFeaturestoreClient_CreateEntityType() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.CreateEntityTypeRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#CreateEntityTypeRequest. |
| } |
| op, err := c.CreateEntityType(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleFeaturestoreClient_GetEntityType() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.GetEntityTypeRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#GetEntityTypeRequest. |
| } |
| resp, err := c.GetEntityType(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleFeaturestoreClient_ListEntityTypes() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.ListEntityTypesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#ListEntityTypesRequest. |
| } |
| it := c.ListEntityTypes(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleFeaturestoreClient_UpdateEntityType() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.UpdateEntityTypeRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#UpdateEntityTypeRequest. |
| } |
| resp, err := c.UpdateEntityType(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleFeaturestoreClient_DeleteEntityType() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.DeleteEntityTypeRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#DeleteEntityTypeRequest. |
| } |
| op, err := c.DeleteEntityType(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleFeaturestoreClient_CreateFeature() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.CreateFeatureRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#CreateFeatureRequest. |
| } |
| op, err := c.CreateFeature(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleFeaturestoreClient_BatchCreateFeatures() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.BatchCreateFeaturesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#BatchCreateFeaturesRequest. |
| } |
| op, err := c.BatchCreateFeatures(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleFeaturestoreClient_GetFeature() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.GetFeatureRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#GetFeatureRequest. |
| } |
| resp, err := c.GetFeature(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleFeaturestoreClient_ListFeatures() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.ListFeaturesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#ListFeaturesRequest. |
| } |
| it := c.ListFeatures(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleFeaturestoreClient_UpdateFeature() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.UpdateFeatureRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#UpdateFeatureRequest. |
| } |
| resp, err := c.UpdateFeature(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleFeaturestoreClient_DeleteFeature() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.DeleteFeatureRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#DeleteFeatureRequest. |
| } |
| op, err := c.DeleteFeature(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleFeaturestoreClient_ImportFeatureValues() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.ImportFeatureValuesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#ImportFeatureValuesRequest. |
| } |
| op, err := c.ImportFeatureValues(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleFeaturestoreClient_BatchReadFeatureValues() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.BatchReadFeatureValuesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#BatchReadFeatureValuesRequest. |
| } |
| op, err := c.BatchReadFeatureValues(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleFeaturestoreClient_ExportFeatureValues() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.ExportFeatureValuesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#ExportFeatureValuesRequest. |
| } |
| op, err := c.ExportFeatureValues(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleFeaturestoreClient_SearchFeatures() { |
| ctx := context.Background() |
| c, err := aiplatform.NewFeaturestoreClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &aiplatformpb.SearchFeaturesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1#SearchFeaturesRequest. |
| } |
| it := c.SearchFeatures(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |