Documentation
¶
Overview ¶
Package agentregistry is an auto-generated package for the Agent Registry API.
Agent Registry is a centralized, unified catalog that lets you store, discover, and govern Model Context Protocol (MCP) servers, tools, and AI agents within Google Cloud.
NOTE: This package is in beta. It is not stable, and may be subject to changes.
General documentation ¶
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage ¶
To get started with this package, create a client.
// go get cloud.google.com/go/agentregistry/apiv1@latest
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.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 := &agentregistrypb.CreateBindingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#CreateBindingRequest.
}
op, err := c.CreateBinding(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
Use of Context ¶
The ctx passed to NewClient is used for authentication requests and for 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.
Index ¶
- func DefaultAuthScopes() []string
- type AgentIterator
- type BindingIterator
- type CallOptions
- type Client
- func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *Client) Close() error
- func (c *Client) Connection() *grpc.ClientConndeprecated
- func (c *Client) CreateBinding(ctx context.Context, req *agentregistrypb.CreateBindingRequest, ...) (*CreateBindingOperation, error)
- func (c *Client) CreateBindingOperation(name string) *CreateBindingOperation
- func (c *Client) CreateService(ctx context.Context, req *agentregistrypb.CreateServiceRequest, ...) (*CreateServiceOperation, error)
- func (c *Client) CreateServiceOperation(name string) *CreateServiceOperation
- func (c *Client) DeleteBinding(ctx context.Context, req *agentregistrypb.DeleteBindingRequest, ...) (*DeleteBindingOperation, error)
- func (c *Client) DeleteBindingOperation(name string) *DeleteBindingOperation
- func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *Client) DeleteService(ctx context.Context, req *agentregistrypb.DeleteServiceRequest, ...) (*DeleteServiceOperation, error)
- func (c *Client) DeleteServiceOperation(name string) *DeleteServiceOperation
- func (c *Client) FetchAvailableBindings(ctx context.Context, req *agentregistrypb.FetchAvailableBindingsRequest, ...) *BindingIterator
- func (c *Client) GetAgent(ctx context.Context, req *agentregistrypb.GetAgentRequest, ...) (*agentregistrypb.Agent, error)
- func (c *Client) GetBinding(ctx context.Context, req *agentregistrypb.GetBindingRequest, ...) (*agentregistrypb.Binding, error)
- func (c *Client) GetEndpoint(ctx context.Context, req *agentregistrypb.GetEndpointRequest, ...) (*agentregistrypb.Endpoint, error)
- func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *Client) GetMcpServer(ctx context.Context, req *agentregistrypb.GetMcpServerRequest, ...) (*agentregistrypb.McpServer, error)
- func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *Client) GetService(ctx context.Context, req *agentregistrypb.GetServiceRequest, ...) (*agentregistrypb.Service, error)
- func (c *Client) ListAgents(ctx context.Context, req *agentregistrypb.ListAgentsRequest, ...) *AgentIterator
- func (c *Client) ListBindings(ctx context.Context, req *agentregistrypb.ListBindingsRequest, ...) *BindingIterator
- func (c *Client) ListEndpoints(ctx context.Context, req *agentregistrypb.ListEndpointsRequest, ...) *EndpointIterator
- func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *Client) ListMcpServers(ctx context.Context, req *agentregistrypb.ListMcpServersRequest, ...) *McpServerIterator
- func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *Client) ListServices(ctx context.Context, req *agentregistrypb.ListServicesRequest, ...) *ServiceIterator
- func (c *Client) SearchAgents(ctx context.Context, req *agentregistrypb.SearchAgentsRequest, ...) *AgentIterator
- func (c *Client) SearchMcpServers(ctx context.Context, req *agentregistrypb.SearchMcpServersRequest, ...) *McpServerIterator
- func (c *Client) UpdateBinding(ctx context.Context, req *agentregistrypb.UpdateBindingRequest, ...) (*UpdateBindingOperation, error)
- func (c *Client) UpdateBindingOperation(name string) *UpdateBindingOperation
- func (c *Client) UpdateService(ctx context.Context, req *agentregistrypb.UpdateServiceRequest, ...) (*UpdateServiceOperation, error)
- func (c *Client) UpdateServiceOperation(name string) *UpdateServiceOperation
- type CreateBindingOperation
- func (op *CreateBindingOperation) Done() bool
- func (op *CreateBindingOperation) Metadata() (*agentregistrypb.OperationMetadata, error)
- func (op *CreateBindingOperation) Name() string
- func (op *CreateBindingOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*agentregistrypb.Binding, error)
- func (op *CreateBindingOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*agentregistrypb.Binding, error)
- type CreateServiceOperation
- func (op *CreateServiceOperation) Done() bool
- func (op *CreateServiceOperation) Metadata() (*agentregistrypb.OperationMetadata, error)
- func (op *CreateServiceOperation) Name() string
- func (op *CreateServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*agentregistrypb.Service, error)
- func (op *CreateServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*agentregistrypb.Service, error)
- type DeleteBindingOperation
- func (op *DeleteBindingOperation) Done() bool
- func (op *DeleteBindingOperation) Metadata() (*agentregistrypb.OperationMetadata, error)
- func (op *DeleteBindingOperation) Name() string
- func (op *DeleteBindingOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteBindingOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DeleteServiceOperation
- func (op *DeleteServiceOperation) Done() bool
- func (op *DeleteServiceOperation) Metadata() (*agentregistrypb.OperationMetadata, error)
- func (op *DeleteServiceOperation) Name() string
- func (op *DeleteServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type EndpointIterator
- type LocationIterator
- type McpServerIterator
- type OperationIterator
- type ServiceIterator
- type UpdateBindingOperation
- func (op *UpdateBindingOperation) Done() bool
- func (op *UpdateBindingOperation) Metadata() (*agentregistrypb.OperationMetadata, error)
- func (op *UpdateBindingOperation) Name() string
- func (op *UpdateBindingOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*agentregistrypb.Binding, error)
- func (op *UpdateBindingOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*agentregistrypb.Binding, error)
- type UpdateServiceOperation
- func (op *UpdateServiceOperation) Done() bool
- func (op *UpdateServiceOperation) Metadata() (*agentregistrypb.OperationMetadata, error)
- func (op *UpdateServiceOperation) Name() string
- func (op *UpdateServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*agentregistrypb.Service, error)
- func (op *UpdateServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*agentregistrypb.Service, error)
Examples ¶
- Client.CancelOperation
- Client.CreateBinding
- Client.CreateService
- Client.DeleteBinding
- Client.DeleteOperation
- Client.DeleteService
- Client.FetchAvailableBindings
- Client.FetchAvailableBindings (All)
- Client.GetAgent
- Client.GetBinding
- Client.GetEndpoint
- Client.GetLocation
- Client.GetMcpServer
- Client.GetOperation
- Client.GetService
- Client.ListAgents
- Client.ListAgents (All)
- Client.ListBindings
- Client.ListBindings (All)
- Client.ListEndpoints
- Client.ListEndpoints (All)
- Client.ListLocations
- Client.ListLocations (All)
- Client.ListMcpServers
- Client.ListMcpServers (All)
- Client.ListOperations
- Client.ListOperations (All)
- Client.ListServices
- Client.ListServices (All)
- Client.SearchAgents
- Client.SearchAgents (All)
- Client.SearchMcpServers
- Client.SearchMcpServers (All)
- Client.UpdateBinding
- Client.UpdateService
- NewClient
- NewRESTClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type AgentIterator ¶
type AgentIterator struct {
// 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.
Response interface{}
// 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.
InternalFetch func(pageSize int, pageToken string) (results []*agentregistrypb.Agent, nextPageToken string, err error)
// contains filtered or unexported fields
}
AgentIterator manages a stream of *agentregistrypb.Agent.
func (*AgentIterator) All ¶
func (it *AgentIterator) All() iter.Seq2[*agentregistrypb.Agent, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*AgentIterator) Next ¶
func (it *AgentIterator) Next() (*agentregistrypb.Agent, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*AgentIterator) PageInfo ¶
func (it *AgentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type BindingIterator ¶
type BindingIterator struct {
// 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.
Response interface{}
// 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.
InternalFetch func(pageSize int, pageToken string) (results []*agentregistrypb.Binding, nextPageToken string, err error)
// contains filtered or unexported fields
}
BindingIterator manages a stream of *agentregistrypb.Binding.
func (*BindingIterator) All ¶
func (it *BindingIterator) All() iter.Seq2[*agentregistrypb.Binding, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*BindingIterator) Next ¶
func (it *BindingIterator) Next() (*agentregistrypb.Binding, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*BindingIterator) PageInfo ¶
func (it *BindingIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type CallOptions ¶
type CallOptions struct {
ListAgents []gax.CallOption
SearchAgents []gax.CallOption
GetAgent []gax.CallOption
ListEndpoints []gax.CallOption
GetEndpoint []gax.CallOption
ListMcpServers []gax.CallOption
SearchMcpServers []gax.CallOption
GetMcpServer []gax.CallOption
ListServices []gax.CallOption
GetService []gax.CallOption
CreateService []gax.CallOption
UpdateService []gax.CallOption
DeleteService []gax.CallOption
ListBindings []gax.CallOption
GetBinding []gax.CallOption
CreateBinding []gax.CallOption
UpdateBinding []gax.CallOption
DeleteBinding []gax.CallOption
FetchAvailableBindings []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
CallOptions contains the retry settings for each method of Client.
type Client ¶
type Client struct {
// The call options for this service.
CallOptions *CallOptions
// 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
}
Client is a client for interacting with Agent Registry API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing Agents, Endpoints, McpServers, Services, and Bindings.
func NewClient ¶
NewClient creates a new agent registry client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing Agents, Endpoints, McpServers, Services, and Bindings.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
Output:
func NewRESTClient ¶
NewRESTClient creates a new agent registry rest client.
Service for managing Agents, Endpoints, McpServers, Services, and Bindings.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
)
func main() {
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 := agentregistry.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
Output:
func (*Client) CancelOperation ¶
func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
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 := agentregistry.NewClient(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.
}
}
Output:
func (*Client) Close ¶
Close closes the connection to the API service. **Always** call Close() when the client is no longer required.
func (*Client) Connection
deprecated
func (c *Client) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*Client) CreateBinding ¶
func (c *Client) CreateBinding(ctx context.Context, req *agentregistrypb.CreateBindingRequest, opts ...gax.CallOption) (*CreateBindingOperation, error)
CreateBinding creates a new Binding in a given project and location.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.CreateBindingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#CreateBindingRequest.
}
op, err := c.CreateBinding(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
func (*Client) CreateBindingOperation ¶
func (c *Client) CreateBindingOperation(name string) *CreateBindingOperation
CreateBindingOperation returns a new CreateBindingOperation from a given name. The name must be that of a previously created CreateBindingOperation, possibly from a different process.
func (*Client) CreateService ¶
func (c *Client) CreateService(ctx context.Context, req *agentregistrypb.CreateServiceRequest, opts ...gax.CallOption) (*CreateServiceOperation, error)
CreateService creates a new Service in a given project and location.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.CreateServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#CreateServiceRequest.
}
op, err := c.CreateService(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
func (*Client) CreateServiceOperation ¶
func (c *Client) CreateServiceOperation(name string) *CreateServiceOperation
CreateServiceOperation returns a new CreateServiceOperation from a given name. The name must be that of a previously created CreateServiceOperation, possibly from a different process.
func (*Client) DeleteBinding ¶
func (c *Client) DeleteBinding(ctx context.Context, req *agentregistrypb.DeleteBindingRequest, opts ...gax.CallOption) (*DeleteBindingOperation, error)
DeleteBinding deletes a single Binding.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.DeleteBindingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#DeleteBindingRequest.
}
op, err := c.DeleteBinding(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
Output:
func (*Client) DeleteBindingOperation ¶
func (c *Client) DeleteBindingOperation(name string) *DeleteBindingOperation
DeleteBindingOperation returns a new DeleteBindingOperation from a given name. The name must be that of a previously created DeleteBindingOperation, possibly from a different process.
func (*Client) DeleteOperation ¶
func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
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 := agentregistry.NewClient(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.
}
}
Output:
func (*Client) DeleteService ¶
func (c *Client) DeleteService(ctx context.Context, req *agentregistrypb.DeleteServiceRequest, opts ...gax.CallOption) (*DeleteServiceOperation, error)
DeleteService deletes a single Service.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.DeleteServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#DeleteServiceRequest.
}
op, err := c.DeleteService(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
Output:
func (*Client) DeleteServiceOperation ¶
func (c *Client) DeleteServiceOperation(name string) *DeleteServiceOperation
DeleteServiceOperation returns a new DeleteServiceOperation from a given name. The name must be that of a previously created DeleteServiceOperation, possibly from a different process.
func (*Client) FetchAvailableBindings ¶
func (c *Client) FetchAvailableBindings(ctx context.Context, req *agentregistrypb.FetchAvailableBindingsRequest, opts ...gax.CallOption) *BindingIterator
FetchAvailableBindings fetches available Bindings.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
"google.golang.org/api/iterator"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.FetchAvailableBindingsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#FetchAvailableBindingsRequest.
}
it := c.FetchAvailableBindings(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.(*agentregistrypb.FetchAvailableBindingsResponse)
}
}
Output:
Example (All) ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.FetchAvailableBindingsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#FetchAvailableBindingsRequest.
}
for resp, err := range c.FetchAvailableBindings(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
func (*Client) GetAgent ¶
func (c *Client) GetAgent(ctx context.Context, req *agentregistrypb.GetAgentRequest, opts ...gax.CallOption) (*agentregistrypb.Agent, error)
GetAgent gets details of a single Agent.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.GetAgentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#GetAgentRequest.
}
resp, err := c.GetAgent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
func (*Client) GetBinding ¶
func (c *Client) GetBinding(ctx context.Context, req *agentregistrypb.GetBindingRequest, opts ...gax.CallOption) (*agentregistrypb.Binding, error)
GetBinding gets details of a single Binding.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.GetBindingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#GetBindingRequest.
}
resp, err := c.GetBinding(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
func (*Client) GetEndpoint ¶
func (c *Client) GetEndpoint(ctx context.Context, req *agentregistrypb.GetEndpointRequest, opts ...gax.CallOption) (*agentregistrypb.Endpoint, error)
GetEndpoint gets details of a single Endpoint.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.GetEndpointRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#GetEndpointRequest.
}
resp, err := c.GetEndpoint(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
func (*Client) GetLocation ¶
func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
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 := agentregistry.NewClient(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
}
Output:
func (*Client) GetMcpServer ¶
func (c *Client) GetMcpServer(ctx context.Context, req *agentregistrypb.GetMcpServerRequest, opts ...gax.CallOption) (*agentregistrypb.McpServer, error)
GetMcpServer gets details of a single McpServer.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.GetMcpServerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#GetMcpServerRequest.
}
resp, err := c.GetMcpServer(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
func (*Client) GetOperation ¶
func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
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 := agentregistry.NewClient(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
}
Output:
func (*Client) GetService ¶
func (c *Client) GetService(ctx context.Context, req *agentregistrypb.GetServiceRequest, opts ...gax.CallOption) (*agentregistrypb.Service, error)
GetService gets details of a single Service.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.GetServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#GetServiceRequest.
}
resp, err := c.GetService(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
func (*Client) ListAgents ¶
func (c *Client) ListAgents(ctx context.Context, req *agentregistrypb.ListAgentsRequest, opts ...gax.CallOption) *AgentIterator
ListAgents lists Agents in a given project and location.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
"google.golang.org/api/iterator"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.ListAgentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#ListAgentsRequest.
}
it := c.ListAgents(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.(*agentregistrypb.ListAgentsResponse)
}
}
Output:
Example (All) ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.ListAgentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#ListAgentsRequest.
}
for resp, err := range c.ListAgents(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
func (*Client) ListBindings ¶
func (c *Client) ListBindings(ctx context.Context, req *agentregistrypb.ListBindingsRequest, opts ...gax.CallOption) *BindingIterator
ListBindings lists Bindings in a given project and location.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
"google.golang.org/api/iterator"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.ListBindingsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#ListBindingsRequest.
}
it := c.ListBindings(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.(*agentregistrypb.ListBindingsResponse)
}
}
Output:
Example (All) ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.ListBindingsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#ListBindingsRequest.
}
for resp, err := range c.ListBindings(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
func (*Client) ListEndpoints ¶
func (c *Client) ListEndpoints(ctx context.Context, req *agentregistrypb.ListEndpointsRequest, opts ...gax.CallOption) *EndpointIterator
ListEndpoints lists Endpoints in a given project and location.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
"google.golang.org/api/iterator"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.ListEndpointsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#ListEndpointsRequest.
}
it := c.ListEndpoints(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.(*agentregistrypb.ListEndpointsResponse)
}
}
Output:
Example (All) ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.ListEndpointsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#ListEndpointsRequest.
}
for resp, err := range c.ListEndpoints(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
func (*Client) ListLocations ¶
func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
This method lists locations based on the resource scope provided in the [ListLocationsRequest.name (at http://ListLocationsRequest.name)][google.cloud.location.ListLocationsRequest.name (at http://google.cloud.location.ListLocationsRequest.name)] field: * Global locations: If name is empty, the method lists the public locations available to all projects. * Project-specific locations: If name follows the format projects/{project}, the method lists locations visible to that specific project. This includes public, private, or other project-specific locations enabled for the project.
For gRPC and client library implementations, the resource name is passed as the name field. For direct service calls, the resource name is incorporated into the request path based on the specific service implementation and version.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
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 := agentregistry.NewClient(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
// 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)
}
}
Output:
Example (All) ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
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 := agentregistry.NewClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
func (*Client) ListMcpServers ¶
func (c *Client) ListMcpServers(ctx context.Context, req *agentregistrypb.ListMcpServersRequest, opts ...gax.CallOption) *McpServerIterator
ListMcpServers lists McpServers in a given project and location.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
"google.golang.org/api/iterator"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.ListMcpServersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#ListMcpServersRequest.
}
it := c.ListMcpServers(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.(*agentregistrypb.ListMcpServersResponse)
}
}
Output:
Example (All) ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.ListMcpServersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#ListMcpServersRequest.
}
for resp, err := range c.ListMcpServers(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
func (*Client) ListOperations ¶
func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
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 := agentregistry.NewClient(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)
}
}
Output:
Example (All) ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
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 := agentregistry.NewClient(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.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
func (*Client) ListServices ¶
func (c *Client) ListServices(ctx context.Context, req *agentregistrypb.ListServicesRequest, opts ...gax.CallOption) *ServiceIterator
ListServices lists Services in a given project and location.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
"google.golang.org/api/iterator"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.ListServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#ListServicesRequest.
}
it := c.ListServices(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.(*agentregistrypb.ListServicesResponse)
}
}
Output:
Example (All) ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.ListServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#ListServicesRequest.
}
for resp, err := range c.ListServices(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
func (*Client) SearchAgents ¶
func (c *Client) SearchAgents(ctx context.Context, req *agentregistrypb.SearchAgentsRequest, opts ...gax.CallOption) *AgentIterator
SearchAgents searches Agents in a given project and location.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
"google.golang.org/api/iterator"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.SearchAgentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#SearchAgentsRequest.
}
it := c.SearchAgents(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.(*agentregistrypb.SearchAgentsResponse)
}
}
Output:
Example (All) ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.SearchAgentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#SearchAgentsRequest.
}
for resp, err := range c.SearchAgents(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
func (*Client) SearchMcpServers ¶
func (c *Client) SearchMcpServers(ctx context.Context, req *agentregistrypb.SearchMcpServersRequest, opts ...gax.CallOption) *McpServerIterator
SearchMcpServers searches McpServers in a given project and location.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
"google.golang.org/api/iterator"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.SearchMcpServersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#SearchMcpServersRequest.
}
it := c.SearchMcpServers(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.(*agentregistrypb.SearchMcpServersResponse)
}
}
Output:
Example (All) ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.SearchMcpServersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#SearchMcpServersRequest.
}
for resp, err := range c.SearchMcpServers(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
func (*Client) UpdateBinding ¶
func (c *Client) UpdateBinding(ctx context.Context, req *agentregistrypb.UpdateBindingRequest, opts ...gax.CallOption) (*UpdateBindingOperation, error)
UpdateBinding updates the parameters of a single Binding.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.UpdateBindingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#UpdateBindingRequest.
}
op, err := c.UpdateBinding(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
func (*Client) UpdateBindingOperation ¶
func (c *Client) UpdateBindingOperation(name string) *UpdateBindingOperation
UpdateBindingOperation returns a new UpdateBindingOperation from a given name. The name must be that of a previously created UpdateBindingOperation, possibly from a different process.
func (*Client) UpdateService ¶
func (c *Client) UpdateService(ctx context.Context, req *agentregistrypb.UpdateServiceRequest, opts ...gax.CallOption) (*UpdateServiceOperation, error)
UpdateService updates the parameters of a single Service.
Example ¶
package main
import (
"context"
agentregistry "cloud.google.com/go/agentregistry/apiv1"
agentregistrypb "cloud.google.com/go/agentregistry/apiv1/agentregistrypb"
)
func main() {
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 := agentregistry.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &agentregistrypb.UpdateServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/agentregistry/apiv1/agentregistrypb#UpdateServiceRequest.
}
op, err := c.UpdateService(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
func (*Client) UpdateServiceOperation ¶
func (c *Client) UpdateServiceOperation(name string) *UpdateServiceOperation
UpdateServiceOperation returns a new UpdateServiceOperation from a given name. The name must be that of a previously created UpdateServiceOperation, possibly from a different process.
type CreateBindingOperation ¶
type CreateBindingOperation struct {
// contains filtered or unexported fields
}
CreateBindingOperation manages a long-running operation from CreateBinding.
func (*CreateBindingOperation) Done ¶
func (op *CreateBindingOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateBindingOperation) Metadata ¶
func (op *CreateBindingOperation) Metadata() (*agentregistrypb.OperationMetadata, error)
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 (*CreateBindingOperation) Name ¶
func (op *CreateBindingOperation) Name() string
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 (*CreateBindingOperation) Poll ¶
func (op *CreateBindingOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*agentregistrypb.Binding, error)
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 and the 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 (*CreateBindingOperation) Wait ¶
func (op *CreateBindingOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*agentregistrypb.Binding, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type CreateServiceOperation ¶
type CreateServiceOperation struct {
// contains filtered or unexported fields
}
CreateServiceOperation manages a long-running operation from CreateService.
func (*CreateServiceOperation) Done ¶
func (op *CreateServiceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateServiceOperation) Metadata ¶
func (op *CreateServiceOperation) Metadata() (*agentregistrypb.OperationMetadata, error)
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 (*CreateServiceOperation) Name ¶
func (op *CreateServiceOperation) Name() string
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 (*CreateServiceOperation) Poll ¶
func (op *CreateServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*agentregistrypb.Service, error)
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 and the 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 (*CreateServiceOperation) Wait ¶
func (op *CreateServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*agentregistrypb.Service, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeleteBindingOperation ¶
type DeleteBindingOperation struct {
// contains filtered or unexported fields
}
DeleteBindingOperation manages a long-running operation from DeleteBinding.
func (*DeleteBindingOperation) Done ¶
func (op *DeleteBindingOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteBindingOperation) Metadata ¶
func (op *DeleteBindingOperation) Metadata() (*agentregistrypb.OperationMetadata, error)
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 (*DeleteBindingOperation) Name ¶
func (op *DeleteBindingOperation) Name() string
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 (*DeleteBindingOperation) Poll ¶
func (op *DeleteBindingOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
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 and the 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 (*DeleteBindingOperation) Wait ¶
func (op *DeleteBindingOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeleteServiceOperation ¶
type DeleteServiceOperation struct {
// contains filtered or unexported fields
}
DeleteServiceOperation manages a long-running operation from DeleteService.
func (*DeleteServiceOperation) Done ¶
func (op *DeleteServiceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteServiceOperation) Metadata ¶
func (op *DeleteServiceOperation) Metadata() (*agentregistrypb.OperationMetadata, error)
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 (*DeleteServiceOperation) Name ¶
func (op *DeleteServiceOperation) Name() string
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 (*DeleteServiceOperation) Poll ¶
func (op *DeleteServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
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 and the 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 (*DeleteServiceOperation) Wait ¶
func (op *DeleteServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type EndpointIterator ¶
type EndpointIterator struct {
// 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.
Response interface{}
// 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.
InternalFetch func(pageSize int, pageToken string) (results []*agentregistrypb.Endpoint, nextPageToken string, err error)
// contains filtered or unexported fields
}
EndpointIterator manages a stream of *agentregistrypb.Endpoint.
func (*EndpointIterator) All ¶
func (it *EndpointIterator) All() iter.Seq2[*agentregistrypb.Endpoint, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*EndpointIterator) Next ¶
func (it *EndpointIterator) Next() (*agentregistrypb.Endpoint, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*EndpointIterator) PageInfo ¶
func (it *EndpointIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type LocationIterator ¶
type LocationIterator struct {
// 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.
Response interface{}
// 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.
InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error)
// 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, the iterator will stop after that iteration.
func (*LocationIterator) Next ¶
func (it *LocationIterator) Next() (*locationpb.Location, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. 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.
type McpServerIterator ¶
type McpServerIterator struct {
// 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.
Response interface{}
// 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.
InternalFetch func(pageSize int, pageToken string) (results []*agentregistrypb.McpServer, nextPageToken string, err error)
// contains filtered or unexported fields
}
McpServerIterator manages a stream of *agentregistrypb.McpServer.
func (*McpServerIterator) All ¶
func (it *McpServerIterator) All() iter.Seq2[*agentregistrypb.McpServer, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*McpServerIterator) Next ¶
func (it *McpServerIterator) Next() (*agentregistrypb.McpServer, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*McpServerIterator) PageInfo ¶
func (it *McpServerIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type OperationIterator ¶
type OperationIterator struct {
// 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.
Response interface{}
// 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.
InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error)
// 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, the iterator will stop after that iteration.
func (*OperationIterator) Next ¶
func (it *OperationIterator) Next() (*longrunningpb.Operation, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. 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.
type ServiceIterator ¶
type ServiceIterator struct {
// 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.
Response interface{}
// 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.
InternalFetch func(pageSize int, pageToken string) (results []*agentregistrypb.Service, nextPageToken string, err error)
// contains filtered or unexported fields
}
ServiceIterator manages a stream of *agentregistrypb.Service.
func (*ServiceIterator) All ¶
func (it *ServiceIterator) All() iter.Seq2[*agentregistrypb.Service, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ServiceIterator) Next ¶
func (it *ServiceIterator) Next() (*agentregistrypb.Service, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ServiceIterator) PageInfo ¶
func (it *ServiceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type UpdateBindingOperation ¶
type UpdateBindingOperation struct {
// contains filtered or unexported fields
}
UpdateBindingOperation manages a long-running operation from UpdateBinding.
func (*UpdateBindingOperation) Done ¶
func (op *UpdateBindingOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateBindingOperation) Metadata ¶
func (op *UpdateBindingOperation) Metadata() (*agentregistrypb.OperationMetadata, error)
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 (*UpdateBindingOperation) Name ¶
func (op *UpdateBindingOperation) Name() string
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 (*UpdateBindingOperation) Poll ¶
func (op *UpdateBindingOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*agentregistrypb.Binding, error)
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 and the 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 (*UpdateBindingOperation) Wait ¶
func (op *UpdateBindingOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*agentregistrypb.Binding, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type UpdateServiceOperation ¶
type UpdateServiceOperation struct {
// contains filtered or unexported fields
}
UpdateServiceOperation manages a long-running operation from UpdateService.
func (*UpdateServiceOperation) Done ¶
func (op *UpdateServiceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateServiceOperation) Metadata ¶
func (op *UpdateServiceOperation) Metadata() (*agentregistrypb.OperationMetadata, error)
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 (*UpdateServiceOperation) Name ¶
func (op *UpdateServiceOperation) Name() string
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 (*UpdateServiceOperation) Poll ¶
func (op *UpdateServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*agentregistrypb.Service, error)
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 and the 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 (*UpdateServiceOperation) Wait ¶
func (op *UpdateServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*agentregistrypb.Service, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.