Cloud Life Sciences API v2beta - Package cloud.google.com/go/lifesciences/apiv2beta (v0.10.7)

Beta

This library is covered by thePre-GA Offerings Terms of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see thelaunch stage descriptions.

Note: To get more information about this package, such as access to older versions, viewthis package on pkg.go.dev.

Package lifesciences is an auto-generated package for theCloud Life Sciences API.

Cloud Life Sciences is a suite of services and tools for managing,processing, and transforming life sciences data.

NOTE:Thispackageisinbeta.Itisnotstable,andmaybesubjecttochanges.

General documentation

For information that is relevant for all client libraries please referencehttps://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on thispage includes:

Example usage

To get started with this package, create a client.

// go get cloud.google.com/go/lifesciences/apiv2beta@latestctx:=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_Optionsc,err:=lifesciences.NewWorkflowsServiceV2BetaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()

The client will use your default application credentials. Clients should be reused instead of created as needed.The methods of Client are safe for concurrent use by multiple goroutines.The returned client must be Closed when it is done being used.

Using the Client

The following is an example of making an API call with the newly created client, mentioned above.

req:=&lifesciencespb.RunPipelineRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/lifesciences/apiv2beta/lifesciencespb#RunPipelineRequest.}op,err:=c.RunPipeline(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp

Use of Context

The ctx passed to NewWorkflowsServiceV2BetaClient is used for authentication requests andfor creating the underlying connection, but is not used for subsequent calls.Individual methods on the client use the ctx given to them.

To close the open connection, use the Close() method.

Functions

func DefaultAuthScopes

funcDefaultAuthScopes()[]string

DefaultAuthScopes reports the default set of authentication scopes to use with this package.

LocationIterator

typeLocationIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// InternalFetch is for use by the Google Cloud Libraries only.// It is not part of the stable interface of this package.//// InternalFetch returns results from a single call to the underlying RPC.// The number of results is no greater than pageSize.// If there are no more results, nextPageToken is empty and err is nil.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*locationpb.Location,nextPageTokenstring,errerror)// contains filtered or unexported fields}

LocationIterator manages a stream of *locationpb.Location.

func (*LocationIterator) All

func(it*LocationIterator)All()iter.Seq2[*locationpb.Location,error]

All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.

func (*LocationIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*LocationIterator) PageInfo

func(it*LocationIterator)PageInfo()*iterator.PageInfo

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

OperationIterator

typeOperationIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// InternalFetch is for use by the Google Cloud Libraries only.// It is not part of the stable interface of this package.//// InternalFetch returns results from a single call to the underlying RPC.// The number of results is no greater than pageSize.// If there are no more results, nextPageToken is empty and err is nil.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*longrunningpb.Operation,nextPageTokenstring,errerror)// contains filtered or unexported fields}

OperationIterator manages a stream of *longrunningpb.Operation.

func (*OperationIterator) All

func(it*OperationIterator)All()iter.Seq2[*longrunningpb.Operation,error]

All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.

func (*OperationIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*OperationIterator) PageInfo

func(it*OperationIterator)PageInfo()*iterator.PageInfo

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

RunPipelineOperation

typeRunPipelineOperationstruct{// contains filtered or unexported fields}

RunPipelineOperation manages a long-running operation from RunPipeline.

func (*RunPipelineOperation) Done

Done reports whether the long-running operation has completed.

func (*RunPipelineOperation) Metadata

Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.

func (*RunPipelineOperation) Name

Name returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.

func (*RunPipelineOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*RunPipelineOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

WorkflowsServiceV2BetaCallOptions

typeWorkflowsServiceV2BetaCallOptionsstruct{RunPipeline[]gax.CallOptionGetLocation[]gax.CallOptionListLocations[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}

WorkflowsServiceV2BetaCallOptions contains the retry settings for each method of WorkflowsServiceV2BetaClient.

WorkflowsServiceV2BetaClient

typeWorkflowsServiceV2BetaClientstruct{// The call options for this service.CallOptions*WorkflowsServiceV2BetaCallOptions// LROClient is used internally to handle long-running operations.// It is exposed so that its CallOptions can be modified if required.// Users should not Close this client.LROClient*lroauto.OperationsClient// contains filtered or unexported fields}

WorkflowsServiceV2BetaClient is a client for interacting with Cloud Life Sciences API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

A service for running workflows, such as pipelines consisting of Dockercontainers.

func NewWorkflowsServiceV2BetaClient

funcNewWorkflowsServiceV2BetaClient(ctxcontext.Context,opts...option.ClientOption)(*WorkflowsServiceV2BetaClient,error)

NewWorkflowsServiceV2BetaClient creates a new workflows service v2 beta client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.

A service for running workflows, such as pipelines consisting of Dockercontainers.

Example

packagemainimport("context"lifesciences"cloud.google.com/go/lifesciences/apiv2beta")funcmain(){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_Optionsc,err:=lifesciences.NewWorkflowsServiceV2BetaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func NewWorkflowsServiceV2BetaRESTClient

funcNewWorkflowsServiceV2BetaRESTClient(ctxcontext.Context,opts...option.ClientOption)(*WorkflowsServiceV2BetaClient,error)

NewWorkflowsServiceV2BetaRESTClient creates a new workflows service v2 beta rest client.

A service for running workflows, such as pipelines consisting of Dockercontainers.

Example

packagemainimport("context"lifesciences"cloud.google.com/go/lifesciences/apiv2beta")funcmain(){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_Optionsc,err:=lifesciences.NewWorkflowsServiceV2BetaRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func (*WorkflowsServiceV2BetaClient) CancelOperation

CancelOperation starts asynchronous cancellation on a long-running operation. Theserver makes a best effort to cancel the operation, but success isnot guaranteed. Clients may useOperations.GetOperation orOperations.ListOperations tocheck whether the cancellation succeeded or the operation completeddespite cancellation.Authorization requires the following GoogleIAM (athttps://cloud.google.com/iam) permission:

lifesciences.operations.cancel

Example

packagemainimport("context"lifesciences"cloud.google.com/go/lifesciences/apiv2beta"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){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_Optionsc,err:=lifesciences.NewWorkflowsServiceV2BetaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}

func (*WorkflowsServiceV2BetaClient) Close

Close closes the connection to the API service. The user should invoke this whenthe client is no longer required.

func (*WorkflowsServiceV2BetaClient) Connection (deprecated)

func(c*WorkflowsServiceV2BetaClient)Connection()*grpc.ClientConn

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.

func (*WorkflowsServiceV2BetaClient) GetLocation

GetLocation gets information about a location.

Example

packagemainimport("context"lifesciences"cloud.google.com/go/lifesciences/apiv2beta"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=lifesciences.NewWorkflowsServiceV2BetaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*WorkflowsServiceV2BetaClient) GetOperation

GetOperation gets the latest state of a long-running operation. Clients can use thismethod to poll the operation result at intervals as recommended by theAPI service.Authorization requires the following GoogleIAM (athttps://cloud.google.com/iam) permission:

lifesciences.operations.get

Example

packagemainimport("context"lifesciences"cloud.google.com/go/lifesciences/apiv2beta"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){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_Optionsc,err:=lifesciences.NewWorkflowsServiceV2BetaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*WorkflowsServiceV2BetaClient) ListLocations

ListLocations lists information about the supported locations for this service.

Examples

packagemainimport("context"lifesciences"cloud.google.com/go/lifesciences/apiv2beta""google.golang.org/api/iterator"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=lifesciences.NewWorkflowsServiceV2BetaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=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.(*locationpb.ListLocationsResponse)}}
all
packagemainimport("context"lifesciences"cloud.google.com/go/lifesciences/apiv2beta"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=lifesciences.NewWorkflowsServiceV2BetaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.ListLocationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.}forresp,err:=rangec.ListLocations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}

func (*WorkflowsServiceV2BetaClient) ListOperations

ListOperations lists operations that match the specified filter in therequest. Authorization requires the following GoogleIAM (athttps://cloud.google.com/iam) permission:

lifesciences.operations.list

Examples

packagemainimport("context"lifesciences"cloud.google.com/go/lifesciences/apiv2beta"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=lifesciences.NewWorkflowsServiceV2BetaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=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)}}
all
packagemainimport("context"lifesciences"cloud.google.com/go/lifesciences/apiv2beta"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){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_Optionsc,err:=lifesciences.NewWorkflowsServiceV2BetaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}

func (*WorkflowsServiceV2BetaClient) RunPipeline

RunPipeline runs a pipeline. The returned Operation’s [metadata][google.longrunning.Operation.metadata] field will contain agoogle.cloud.lifesciences.v2beta.Metadataobject describing the status of the pipeline execution. Theresponse field will contain agoogle.cloud.lifesciences.v2beta.RunPipelineResponseobject if the pipeline completes successfully.

Note: Before you can use this method, the Life Sciences Service Agentmust have access to your project. This is done automatically when theCloud Life Sciences API is first enabled, but if you delete this permissionyou must disable and re-enable the API to grant the Life SciencesService Agent the required permissions.Authorization requires the following GoogleIAM (athttps://cloud.google.com/iam/) permission:

lifesciences.workflows.run

Example

packagemainimport("context"lifesciences"cloud.google.com/go/lifesciences/apiv2beta"lifesciencespb"cloud.google.com/go/lifesciences/apiv2beta/lifesciencespb")funcmain(){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_Optionsc,err:=lifesciences.NewWorkflowsServiceV2BetaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&lifesciencespb.RunPipelineRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/lifesciences/apiv2beta/lifesciencespb#RunPipelineRequest.}op,err:=c.RunPipeline(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*WorkflowsServiceV2BetaClient) RunPipelineOperation

RunPipelineOperation returns a new RunPipelineOperation from a given name.The name must be that of a previously created RunPipelineOperation, possibly from a different process.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-30 UTC.