blob: e89a579ba35bd2b336fde6b02b57c39a839a8c31 [file] [log] [blame]
// Copyright 2024 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 visionai_test
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
visionai "cloud.google.com/go/visionai/apiv1"
visionaipb "cloud.google.com/go/visionai/apiv1/visionaipb"
"google.golang.org/api/iterator"
)
func ExampleNewLiveVideoAnalyticsClient() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func ExampleNewLiveVideoAnalyticsRESTClient() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func ExampleLiveVideoAnalyticsClient_BatchRunProcess() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &visionaipb.BatchRunProcessRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#BatchRunProcessRequest.
}
op, err := c.BatchRunProcess(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleLiveVideoAnalyticsClient_CreateAnalysis() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &visionaipb.CreateAnalysisRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#CreateAnalysisRequest.
}
op, err := c.CreateAnalysis(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleLiveVideoAnalyticsClient_CreateOperator() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &visionaipb.CreateOperatorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#CreateOperatorRequest.
}
op, err := c.CreateOperator(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleLiveVideoAnalyticsClient_CreateProcess() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &visionaipb.CreateProcessRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#CreateProcessRequest.
}
op, err := c.CreateProcess(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleLiveVideoAnalyticsClient_DeleteAnalysis() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &visionaipb.DeleteAnalysisRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#DeleteAnalysisRequest.
}
op, err := c.DeleteAnalysis(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func ExampleLiveVideoAnalyticsClient_DeleteOperator() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &visionaipb.DeleteOperatorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#DeleteOperatorRequest.
}
op, err := c.DeleteOperator(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func ExampleLiveVideoAnalyticsClient_DeleteProcess() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &visionaipb.DeleteProcessRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#DeleteProcessRequest.
}
op, err := c.DeleteProcess(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func ExampleLiveVideoAnalyticsClient_GetAnalysis() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &visionaipb.GetAnalysisRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#GetAnalysisRequest.
}
resp, err := c.GetAnalysis(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleLiveVideoAnalyticsClient_GetOperator() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &visionaipb.GetOperatorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#GetOperatorRequest.
}
resp, err := c.GetOperator(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleLiveVideoAnalyticsClient_GetProcess() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &visionaipb.GetProcessRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#GetProcessRequest.
}
resp, err := c.GetProcess(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleLiveVideoAnalyticsClient_ListAnalyses() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &visionaipb.ListAnalysesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#ListAnalysesRequest.
}
it := c.ListAnalyses(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*visionaipb.ListAnalysesResponse)
}
}
func ExampleLiveVideoAnalyticsClient_ListOperators() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &visionaipb.ListOperatorsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#ListOperatorsRequest.
}
it := c.ListOperators(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*visionaipb.ListOperatorsResponse)
}
}
func ExampleLiveVideoAnalyticsClient_ListProcesses() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &visionaipb.ListProcessesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#ListProcessesRequest.
}
it := c.ListProcesses(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*visionaipb.ListProcessesResponse)
}
}
func ExampleLiveVideoAnalyticsClient_ListPublicOperators() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &visionaipb.ListPublicOperatorsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#ListPublicOperatorsRequest.
}
it := c.ListPublicOperators(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*visionaipb.ListPublicOperatorsResponse)
}
}
func ExampleLiveVideoAnalyticsClient_ResolveOperatorInfo() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &visionaipb.ResolveOperatorInfoRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#ResolveOperatorInfoRequest.
}
resp, err := c.ResolveOperatorInfo(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleLiveVideoAnalyticsClient_UpdateAnalysis() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &visionaipb.UpdateAnalysisRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#UpdateAnalysisRequest.
}
op, err := c.UpdateAnalysis(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleLiveVideoAnalyticsClient_UpdateOperator() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &visionaipb.UpdateOperatorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#UpdateOperatorRequest.
}
op, err := c.UpdateOperator(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleLiveVideoAnalyticsClient_UpdateProcess() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &visionaipb.UpdateProcessRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#UpdateProcessRequest.
}
op, err := c.UpdateProcess(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleLiveVideoAnalyticsClient_CancelOperation() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func ExampleLiveVideoAnalyticsClient_DeleteOperation() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func ExampleLiveVideoAnalyticsClient_GetOperation() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleLiveVideoAnalyticsClient_ListOperations() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := visionai.NewLiveVideoAnalyticsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#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
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}