Package apihub is an auto-generated package for the API hub API.
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/apihub/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 := apihub.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 := &apihubpb.CreateApiRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#CreateApiRequest. } resp, err := c.CreateApi(ctx, req) 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.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []stringDefaultAuthScopes reports the default set of authentication scopes to use with this package.
ApiHubCollectCallOptions
type ApiHubCollectCallOptions struct {
CollectApiData []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}ApiHubCollectCallOptions contains the retry settings for each method of ApiHubCollectClient.
ApiHubCollectClient
type ApiHubCollectClient struct {
// The call options for this service.
CallOptions *ApiHubCollectCallOptions
// 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
}ApiHubCollectClient is a client for interacting with API hub API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
This service exposes methods used for collecting various types of data from different first party and third party sources and push it to Hub’s collect layer.
func NewApiHubCollectRESTClient
func NewApiHubCollectRESTClient(ctx context.Context, opts ...option.ClientOption) (*ApiHubCollectClient, error)NewApiHubCollectRESTClient creates a new api hub collect rest client.
This service exposes methods used for collecting various types of data from different first party and third party sources and push it to Hub’s collect layer.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubCollectRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ApiHubCollectClient) CancelOperation
func (c *ApiHubCollectClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubCollectRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ApiHubCollectClient) Close
func (c *ApiHubCollectClient) Close() errorClose closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ApiHubCollectClient) CollectApiData
func (c *ApiHubCollectClient) CollectApiData(ctx context.Context, req *apihubpb.CollectApiDataRequest, opts ...gax.CallOption) (*CollectApiDataOperation, error)CollectApiData collect API data from a source and push it to Hub’s collect layer.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubCollectRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.CollectApiDataRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#CollectApiDataRequest.
}
op, err := c.CollectApiData(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubCollectClient) CollectApiDataOperation
func (c *ApiHubCollectClient) CollectApiDataOperation(name string) *CollectApiDataOperationCollectApiDataOperation returns a new CollectApiDataOperation from a given name. The name must be that of a previously created CollectApiDataOperation, possibly from a different process.
func (*ApiHubCollectClient) Connection (deprecated)
func (c *ApiHubCollectClient) Connection() *grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ApiHubCollectClient) DeleteOperation
func (c *ApiHubCollectClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubCollectRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ApiHubCollectClient) GetLocation
func (c *ApiHubCollectClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubCollectRESTClient(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
}
func (*ApiHubCollectClient) GetOperation
func (c *ApiHubCollectClient) 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"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubCollectRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubCollectClient) ListLocations
func (c *ApiHubCollectClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubCollectRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubCollectRESTClient(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
}
}
func (*ApiHubCollectClient) ListOperations
func (c *ApiHubCollectClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubCollectRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubCollectRESTClient(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
}
}
ApiHubCurateCallOptions
type ApiHubCurateCallOptions struct {
CreateCuration []gax.CallOption
GetCuration []gax.CallOption
ListCurations []gax.CallOption
UpdateCuration []gax.CallOption
DeleteCuration []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}ApiHubCurateCallOptions contains the retry settings for each method of ApiHubCurateClient.
ApiHubCurateClient
type ApiHubCurateClient struct {
// The call options for this service.
CallOptions *ApiHubCurateCallOptions
// contains filtered or unexported fields
}ApiHubCurateClient is a client for interacting with API hub API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
This service is used for managing curations for processing API data consumed from collect layer.
func NewApiHubCurateRESTClient
func NewApiHubCurateRESTClient(ctx context.Context, opts ...option.ClientOption) (*ApiHubCurateClient, error)NewApiHubCurateRESTClient creates a new api hub curate rest client.
This service is used for managing curations for processing API data consumed from collect layer.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubCurateRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ApiHubCurateClient) CancelOperation
func (c *ApiHubCurateClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubCurateRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ApiHubCurateClient) Close
func (c *ApiHubCurateClient) Close() errorClose closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ApiHubCurateClient) Connection (deprecated)
func (c *ApiHubCurateClient) Connection() *grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ApiHubCurateClient) CreateCuration
func (c *ApiHubCurateClient) CreateCuration(ctx context.Context, req *apihubpb.CreateCurationRequest, opts ...gax.CallOption) (*apihubpb.Curation, error)CreateCuration create a curation resource in the API hub. Once a curation resource is created, plugin instances can start using it.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubCurateRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.CreateCurationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#CreateCurationRequest.
}
resp, err := c.CreateCuration(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubCurateClient) DeleteCuration
func (c *ApiHubCurateClient) DeleteCuration(ctx context.Context, req *apihubpb.DeleteCurationRequest, opts ...gax.CallOption) errorDeleteCuration delete a curation resource in the API hub. A curation can only be deleted if it’s not being used by any plugin instance.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubCurateRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.DeleteCurationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#DeleteCurationRequest.
}
err = c.DeleteCuration(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ApiHubCurateClient) DeleteOperation
func (c *ApiHubCurateClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubCurateRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ApiHubCurateClient) GetCuration
func (c *ApiHubCurateClient) GetCuration(ctx context.Context, req *apihubpb.GetCurationRequest, opts ...gax.CallOption) (*apihubpb.Curation, error)GetCuration get curation resource details.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubCurateRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetCurationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetCurationRequest.
}
resp, err := c.GetCuration(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubCurateClient) GetLocation
func (c *ApiHubCurateClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubCurateRESTClient(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
}
func (*ApiHubCurateClient) GetOperation
func (c *ApiHubCurateClient) 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"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubCurateRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubCurateClient) ListCurations
func (c *ApiHubCurateClient) ListCurations(ctx context.Context, req *apihubpb.ListCurationsRequest, opts ...gax.CallOption) *CurationIteratorListCurations list curation resources in the API hub.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
"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 := apihub.NewApiHubCurateRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListCurationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListCurationsRequest.
}
it := c.ListCurations(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.(*apihubpb.ListCurationsResponse)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubCurateRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListCurationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListCurationsRequest.
}
for resp, err := range c.ListCurations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ApiHubCurateClient) ListLocations
func (c *ApiHubCurateClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubCurateRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubCurateRESTClient(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
}
}
func (*ApiHubCurateClient) ListOperations
func (c *ApiHubCurateClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubCurateRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubCurateRESTClient(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
}
}
func (*ApiHubCurateClient) UpdateCuration
func (c *ApiHubCurateClient) UpdateCuration(ctx context.Context, req *apihubpb.UpdateCurationRequest, opts ...gax.CallOption) (*apihubpb.Curation, error)UpdateCuration update a curation resource in the API hub. The following fields in the curation can be updated:
display_name
description
The update_mask should be used to specify the fields being updated.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubCurateRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.UpdateCurationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#UpdateCurationRequest.
}
resp, err := c.UpdateCuration(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
ApiHubDependenciesCallOptions
type ApiHubDependenciesCallOptions struct {
CreateDependency []gax.CallOption
GetDependency []gax.CallOption
UpdateDependency []gax.CallOption
DeleteDependency []gax.CallOption
ListDependencies []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}ApiHubDependenciesCallOptions contains the retry settings for each method of ApiHubDependenciesClient.
ApiHubDependenciesClient
type ApiHubDependenciesClient struct {
// The call options for this service.
CallOptions *ApiHubDependenciesCallOptions
// contains filtered or unexported fields
}ApiHubDependenciesClient is a client for interacting with API hub API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
This service provides methods for various operations related to a Dependency in the API hub.
func NewApiHubDependenciesRESTClient
func NewApiHubDependenciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*ApiHubDependenciesClient, error)NewApiHubDependenciesRESTClient creates a new api hub dependencies rest client.
This service provides methods for various operations related to a Dependency in the API hub.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubDependenciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ApiHubDependenciesClient) CancelOperation
func (c *ApiHubDependenciesClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubDependenciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ApiHubDependenciesClient) Close
func (c *ApiHubDependenciesClient) Close() errorClose closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ApiHubDependenciesClient) Connection (deprecated)
func (c *ApiHubDependenciesClient) Connection() *grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ApiHubDependenciesClient) CreateDependency
func (c *ApiHubDependenciesClient) CreateDependency(ctx context.Context, req *apihubpb.CreateDependencyRequest, opts ...gax.CallOption) (*apihubpb.Dependency, error)CreateDependency create a dependency between two entities in the API hub.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubDependenciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.CreateDependencyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#CreateDependencyRequest.
}
resp, err := c.CreateDependency(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubDependenciesClient) DeleteDependency
func (c *ApiHubDependenciesClient) DeleteDependency(ctx context.Context, req *apihubpb.DeleteDependencyRequest, opts ...gax.CallOption) errorDeleteDependency delete the dependency resource.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubDependenciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.DeleteDependencyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#DeleteDependencyRequest.
}
err = c.DeleteDependency(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ApiHubDependenciesClient) DeleteOperation
func (c *ApiHubDependenciesClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubDependenciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ApiHubDependenciesClient) GetDependency
func (c *ApiHubDependenciesClient) GetDependency(ctx context.Context, req *apihubpb.GetDependencyRequest, opts ...gax.CallOption) (*apihubpb.Dependency, error)GetDependency get details about a dependency resource in the API hub.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubDependenciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetDependencyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetDependencyRequest.
}
resp, err := c.GetDependency(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubDependenciesClient) GetLocation
func (c *ApiHubDependenciesClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubDependenciesRESTClient(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
}
func (*ApiHubDependenciesClient) GetOperation
func (c *ApiHubDependenciesClient) 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"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubDependenciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubDependenciesClient) ListDependencies
func (c *ApiHubDependenciesClient) ListDependencies(ctx context.Context, req *apihubpb.ListDependenciesRequest, opts ...gax.CallOption) *DependencyIteratorListDependencies list dependencies based on the provided filter and pagination parameters.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
"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 := apihub.NewApiHubDependenciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListDependenciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListDependenciesRequest.
}
it := c.ListDependencies(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.(*apihubpb.ListDependenciesResponse)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubDependenciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListDependenciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListDependenciesRequest.
}
for resp, err := range c.ListDependencies(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ApiHubDependenciesClient) ListLocations
func (c *ApiHubDependenciesClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubDependenciesRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubDependenciesRESTClient(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
}
}
func (*ApiHubDependenciesClient) ListOperations
func (c *ApiHubDependenciesClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubDependenciesRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubDependenciesRESTClient(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
}
}
func (*ApiHubDependenciesClient) UpdateDependency
func (c *ApiHubDependenciesClient) UpdateDependency(ctx context.Context, req *apihubpb.UpdateDependencyRequest, opts ...gax.CallOption) (*apihubpb.Dependency, error)UpdateDependency update a dependency based on the update_mask provided in the request.
The following fields in the dependency can be updated:
description
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubDependenciesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.UpdateDependencyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#UpdateDependencyRequest.
}
resp, err := c.UpdateDependency(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
ApiHubDiscoveryCallOptions
type ApiHubDiscoveryCallOptions struct {
ListDiscoveredApiObservations []gax.CallOption
GetDiscoveredApiObservation []gax.CallOption
ListDiscoveredApiOperations []gax.CallOption
GetDiscoveredApiOperation []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}ApiHubDiscoveryCallOptions contains the retry settings for each method of ApiHubDiscoveryClient.
ApiHubDiscoveryClient
type ApiHubDiscoveryClient struct {
// The call options for this service.
CallOptions *ApiHubDiscoveryCallOptions
// contains filtered or unexported fields
}ApiHubDiscoveryClient is a client for interacting with API hub API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
This service exposes methods used to manage DiscoveredApiObservations and DiscoveredApiOperations.
func NewApiHubDiscoveryRESTClient
func NewApiHubDiscoveryRESTClient(ctx context.Context, opts ...option.ClientOption) (*ApiHubDiscoveryClient, error)NewApiHubDiscoveryRESTClient creates a new api hub discovery rest client.
This service exposes methods used to manage DiscoveredApiObservations and DiscoveredApiOperations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubDiscoveryRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ApiHubDiscoveryClient) CancelOperation
func (c *ApiHubDiscoveryClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubDiscoveryRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ApiHubDiscoveryClient) Close
func (c *ApiHubDiscoveryClient) Close() errorClose closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ApiHubDiscoveryClient) Connection (deprecated)
func (c *ApiHubDiscoveryClient) Connection() *grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ApiHubDiscoveryClient) DeleteOperation
func (c *ApiHubDiscoveryClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubDiscoveryRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ApiHubDiscoveryClient) GetDiscoveredApiObservation
func (c *ApiHubDiscoveryClient) GetDiscoveredApiObservation(ctx context.Context, req *apihubpb.GetDiscoveredApiObservationRequest, opts ...gax.CallOption) (*apihubpb.DiscoveredApiObservation, error)GetDiscoveredApiObservation gets a DiscoveredAPIObservation in a given project, location and ApiObservation.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubDiscoveryRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetDiscoveredApiObservationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetDiscoveredApiObservationRequest.
}
resp, err := c.GetDiscoveredApiObservation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubDiscoveryClient) GetDiscoveredApiOperation
func (c *ApiHubDiscoveryClient) GetDiscoveredApiOperation(ctx context.Context, req *apihubpb.GetDiscoveredApiOperationRequest, opts ...gax.CallOption) (*apihubpb.DiscoveredApiOperation, error)GetDiscoveredApiOperation gets a DiscoveredAPIOperation in a given project, location, ApiObservation and ApiOperation.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubDiscoveryRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetDiscoveredApiOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetDiscoveredApiOperationRequest.
}
resp, err := c.GetDiscoveredApiOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubDiscoveryClient) GetLocation
func (c *ApiHubDiscoveryClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubDiscoveryRESTClient(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
}
func (*ApiHubDiscoveryClient) GetOperation
func (c *ApiHubDiscoveryClient) 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"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubDiscoveryRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubDiscoveryClient) ListDiscoveredApiObservations
func (c *ApiHubDiscoveryClient) ListDiscoveredApiObservations(ctx context.Context, req *apihubpb.ListDiscoveredApiObservationsRequest, opts ...gax.CallOption) *DiscoveredApiObservationIteratorListDiscoveredApiObservations lists all the DiscoveredAPIObservations in a given project and location.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
"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 := apihub.NewApiHubDiscoveryRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListDiscoveredApiObservationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListDiscoveredApiObservationsRequest.
}
it := c.ListDiscoveredApiObservations(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.(*apihubpb.ListDiscoveredApiObservationsResponse)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubDiscoveryRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListDiscoveredApiObservationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListDiscoveredApiObservationsRequest.
}
for resp, err := range c.ListDiscoveredApiObservations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ApiHubDiscoveryClient) ListDiscoveredApiOperations
func (c *ApiHubDiscoveryClient) ListDiscoveredApiOperations(ctx context.Context, req *apihubpb.ListDiscoveredApiOperationsRequest, opts ...gax.CallOption) *DiscoveredApiOperationIteratorListDiscoveredApiOperations lists all the DiscoveredAPIOperations in a given project, location and ApiObservation.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
"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 := apihub.NewApiHubDiscoveryRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListDiscoveredApiOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListDiscoveredApiOperationsRequest.
}
it := c.ListDiscoveredApiOperations(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.(*apihubpb.ListDiscoveredApiOperationsResponse)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubDiscoveryRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListDiscoveredApiOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListDiscoveredApiOperationsRequest.
}
for resp, err := range c.ListDiscoveredApiOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ApiHubDiscoveryClient) ListLocations
func (c *ApiHubDiscoveryClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubDiscoveryRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubDiscoveryRESTClient(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
}
}
func (*ApiHubDiscoveryClient) ListOperations
func (c *ApiHubDiscoveryClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubDiscoveryRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubDiscoveryRESTClient(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
}
}
ApiHubPluginCallOptions
type ApiHubPluginCallOptions struct {
GetPlugin []gax.CallOption
EnablePlugin []gax.CallOption
DisablePlugin []gax.CallOption
CreatePlugin []gax.CallOption
ListPlugins []gax.CallOption
DeletePlugin []gax.CallOption
CreatePluginInstance []gax.CallOption
ExecutePluginInstanceAction []gax.CallOption
GetPluginInstance []gax.CallOption
ListPluginInstances []gax.CallOption
EnablePluginInstanceAction []gax.CallOption
DisablePluginInstanceAction []gax.CallOption
UpdatePluginInstance []gax.CallOption
DeletePluginInstance []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}ApiHubPluginCallOptions contains the retry settings for each method of ApiHubPluginClient.
ApiHubPluginClient
type ApiHubPluginClient struct {
// The call options for this service.
CallOptions *ApiHubPluginCallOptions
// 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
}ApiHubPluginClient is a client for interacting with API hub API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
This service is used for managing plugins inside the API Hub.
func NewApiHubPluginRESTClient
func NewApiHubPluginRESTClient(ctx context.Context, opts ...option.ClientOption) (*ApiHubPluginClient, error)NewApiHubPluginRESTClient creates a new api hub plugin rest client.
This service is used for managing plugins inside the API Hub.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ApiHubPluginClient) CancelOperation
func (c *ApiHubPluginClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ApiHubPluginClient) Close
func (c *ApiHubPluginClient) Close() errorClose closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ApiHubPluginClient) Connection (deprecated)
func (c *ApiHubPluginClient) Connection() *grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ApiHubPluginClient) CreatePlugin
func (c *ApiHubPluginClient) CreatePlugin(ctx context.Context, req *apihubpb.CreatePluginRequest, opts ...gax.CallOption) (*apihubpb.Plugin, error)CreatePlugin create an API Hub plugin resource in the API hub. Once a plugin is created, it can be used to create plugin instances.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.CreatePluginRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#CreatePluginRequest.
}
resp, err := c.CreatePlugin(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubPluginClient) CreatePluginInstance
func (c *ApiHubPluginClient) CreatePluginInstance(ctx context.Context, req *apihubpb.CreatePluginInstanceRequest, opts ...gax.CallOption) (*CreatePluginInstanceOperation, error)CreatePluginInstance creates a Plugin instance in the API hub.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.CreatePluginInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#CreatePluginInstanceRequest.
}
op, err := c.CreatePluginInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubPluginClient) CreatePluginInstanceOperation
func (c *ApiHubPluginClient) CreatePluginInstanceOperation(name string) *CreatePluginInstanceOperationCreatePluginInstanceOperation returns a new CreatePluginInstanceOperation from a given name. The name must be that of a previously created CreatePluginInstanceOperation, possibly from a different process.
func (*ApiHubPluginClient) DeleteOperation
func (c *ApiHubPluginClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ApiHubPluginClient) DeletePlugin
func (c *ApiHubPluginClient) DeletePlugin(ctx context.Context, req *apihubpb.DeletePluginRequest, opts ...gax.CallOption) (*DeletePluginOperation, error)DeletePlugin delete a Plugin in API hub. Note, only user owned plugins can be deleted via this method.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.DeletePluginRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#DeletePluginRequest.
}
op, err := c.DeletePlugin(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ApiHubPluginClient) DeletePluginInstance
func (c *ApiHubPluginClient) DeletePluginInstance(ctx context.Context, req *apihubpb.DeletePluginInstanceRequest, opts ...gax.CallOption) (*DeletePluginInstanceOperation, error)DeletePluginInstance deletes a plugin instance in the API hub.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.DeletePluginInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#DeletePluginInstanceRequest.
}
op, err := c.DeletePluginInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ApiHubPluginClient) DeletePluginInstanceOperation
func (c *ApiHubPluginClient) DeletePluginInstanceOperation(name string) *DeletePluginInstanceOperationDeletePluginInstanceOperation returns a new DeletePluginInstanceOperation from a given name. The name must be that of a previously created DeletePluginInstanceOperation, possibly from a different process.
func (*ApiHubPluginClient) DeletePluginOperation
func (c *ApiHubPluginClient) DeletePluginOperation(name string) *DeletePluginOperationDeletePluginOperation returns a new DeletePluginOperation from a given name. The name must be that of a previously created DeletePluginOperation, possibly from a different process.
func (*ApiHubPluginClient) DisablePlugin
func (c *ApiHubPluginClient) DisablePlugin(ctx context.Context, req *apihubpb.DisablePluginRequest, opts ...gax.CallOption) (*apihubpb.Plugin, error)DisablePlugin disables a plugin. The state of the plugin after disabling is DISABLED
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.DisablePluginRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#DisablePluginRequest.
}
resp, err := c.DisablePlugin(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubPluginClient) DisablePluginInstanceAction
func (c *ApiHubPluginClient) DisablePluginInstanceAction(ctx context.Context, req *apihubpb.DisablePluginInstanceActionRequest, opts ...gax.CallOption) (*DisablePluginInstanceActionOperation, error)DisablePluginInstanceAction disables a plugin instance in the API hub.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.DisablePluginInstanceActionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#DisablePluginInstanceActionRequest.
}
op, err := c.DisablePluginInstanceAction(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubPluginClient) DisablePluginInstanceActionOperation
func (c *ApiHubPluginClient) DisablePluginInstanceActionOperation(name string) *DisablePluginInstanceActionOperationDisablePluginInstanceActionOperation returns a new DisablePluginInstanceActionOperation from a given name. The name must be that of a previously created DisablePluginInstanceActionOperation, possibly from a different process.
func (*ApiHubPluginClient) EnablePlugin
func (c *ApiHubPluginClient) EnablePlugin(ctx context.Context, req *apihubpb.EnablePluginRequest, opts ...gax.CallOption) (*apihubpb.Plugin, error)EnablePlugin enables a plugin. The state of the plugin after enabling is ENABLED
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.EnablePluginRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#EnablePluginRequest.
}
resp, err := c.EnablePlugin(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubPluginClient) EnablePluginInstanceAction
func (c *ApiHubPluginClient) EnablePluginInstanceAction(ctx context.Context, req *apihubpb.EnablePluginInstanceActionRequest, opts ...gax.CallOption) (*EnablePluginInstanceActionOperation, error)EnablePluginInstanceAction enables a plugin instance in the API hub.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.EnablePluginInstanceActionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#EnablePluginInstanceActionRequest.
}
op, err := c.EnablePluginInstanceAction(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubPluginClient) EnablePluginInstanceActionOperation
func (c *ApiHubPluginClient) EnablePluginInstanceActionOperation(name string) *EnablePluginInstanceActionOperationEnablePluginInstanceActionOperation returns a new EnablePluginInstanceActionOperation from a given name. The name must be that of a previously created EnablePluginInstanceActionOperation, possibly from a different process.
func (*ApiHubPluginClient) ExecutePluginInstanceAction
func (c *ApiHubPluginClient) ExecutePluginInstanceAction(ctx context.Context, req *apihubpb.ExecutePluginInstanceActionRequest, opts ...gax.CallOption) (*ExecutePluginInstanceActionOperation, error)ExecutePluginInstanceAction executes a plugin instance in the API hub.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ExecutePluginInstanceActionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ExecutePluginInstanceActionRequest.
}
op, err := c.ExecutePluginInstanceAction(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubPluginClient) ExecutePluginInstanceActionOperation
func (c *ApiHubPluginClient) ExecutePluginInstanceActionOperation(name string) *ExecutePluginInstanceActionOperationExecutePluginInstanceActionOperation returns a new ExecutePluginInstanceActionOperation from a given name. The name must be that of a previously created ExecutePluginInstanceActionOperation, possibly from a different process.
func (*ApiHubPluginClient) GetLocation
func (c *ApiHubPluginClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubPluginRESTClient(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
}
func (*ApiHubPluginClient) GetOperation
func (c *ApiHubPluginClient) 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"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubPluginClient) GetPlugin
func (c *ApiHubPluginClient) GetPlugin(ctx context.Context, req *apihubpb.GetPluginRequest, opts ...gax.CallOption) (*apihubpb.Plugin, error)GetPlugin get an API Hub plugin.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetPluginRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetPluginRequest.
}
resp, err := c.GetPlugin(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubPluginClient) GetPluginInstance
func (c *ApiHubPluginClient) GetPluginInstance(ctx context.Context, req *apihubpb.GetPluginInstanceRequest, opts ...gax.CallOption) (*apihubpb.PluginInstance, error)GetPluginInstance get an API Hub plugin instance.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetPluginInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetPluginInstanceRequest.
}
resp, err := c.GetPluginInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ApiHubPluginClient) ListLocations
func (c *ApiHubPluginClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubPluginRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubPluginRESTClient(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
}
}
func (*ApiHubPluginClient) ListOperations
func (c *ApiHubPluginClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubPluginRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewApiHubPluginRESTClient(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
}
}
func (*ApiHubPluginClient) ListPluginInstances
func (c *ApiHubPluginClient) ListPluginInstances(ctx context.Context, req *apihubpb.ListPluginInstancesRequest, opts ...gax.CallOption) *PluginInstanceIteratorListPluginInstances list all the plugins in a given project and location.
- can be used as wildcard value for {plugin_id}
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
"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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListPluginInstancesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListPluginInstancesRequest.
}
it := c.ListPluginInstances(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.(*apihubpb.ListPluginInstancesResponse)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListPluginInstancesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListPluginInstancesRequest.
}
for resp, err := range c.ListPluginInstances(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ApiHubPluginClient) ListPlugins
func (c *ApiHubPluginClient) ListPlugins(ctx context.Context, req *apihubpb.ListPluginsRequest, opts ...gax.CallOption) *PluginIteratorListPlugins list all the plugins in a given project and location.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
"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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListPluginsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListPluginsRequest.
}
it := c.ListPlugins(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.(*apihubpb.ListPluginsResponse)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListPluginsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListPluginsRequest.
}
for resp, err := range c.ListPlugins(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ApiHubPluginClient) UpdatePluginInstance
func (c *ApiHubPluginClient) UpdatePluginInstance(ctx context.Context, req *apihubpb.UpdatePluginInstanceRequest, opts ...gax.CallOption) (*apihubpb.PluginInstance, error)UpdatePluginInstance updates a plugin instance in the API hub. The following fields in the plugin_instance can be updated currently:
display_name
schedule_cron_expression
The update_mask should be used to specify the fields being updated.
To update the auth_config and additional_config of the plugin instance, use the ApplyPluginInstanceConfig method.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewApiHubPluginRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.UpdatePluginInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#UpdatePluginInstanceRequest.
}
resp, err := c.UpdatePluginInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
ApiIterator
type ApiIterator 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 []*apihubpb.Api, nextPageToken string, err error)
// contains filtered or unexported fields
}ApiIterator manages a stream of *apihubpb.Api.
func (*ApiIterator) All
func (it *ApiIterator) All() iter.Seq2[*apihubpb.Api, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ApiIterator) Next
func (it *ApiIterator) Next() (*apihubpb.Api, 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 (*ApiIterator) PageInfo
func (it *ApiIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ApiOperationIterator
type ApiOperationIterator 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 []*apihubpb.ApiOperation, nextPageToken string, err error)
// contains filtered or unexported fields
}ApiOperationIterator manages a stream of *apihubpb.ApiOperation.
func (*ApiOperationIterator) All
func (it *ApiOperationIterator) All() iter.Seq2[*apihubpb.ApiOperation, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ApiOperationIterator) Next
func (it *ApiOperationIterator) Next() (*apihubpb.ApiOperation, 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 (*ApiOperationIterator) PageInfo
func (it *ApiOperationIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
AttributeIterator
type AttributeIterator 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 []*apihubpb.Attribute, nextPageToken string, err error)
// contains filtered or unexported fields
}AttributeIterator manages a stream of *apihubpb.Attribute.
func (*AttributeIterator) All
func (it *AttributeIterator) All() iter.Seq2[*apihubpb.Attribute, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*AttributeIterator) Next
func (it *AttributeIterator) Next() (*apihubpb.Attribute, 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 (*AttributeIterator) PageInfo
func (it *AttributeIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
CallOptions
type CallOptions struct {
CreateApi []gax.CallOption
GetApi []gax.CallOption
ListApis []gax.CallOption
UpdateApi []gax.CallOption
DeleteApi []gax.CallOption
CreateVersion []gax.CallOption
GetVersion []gax.CallOption
ListVersions []gax.CallOption
UpdateVersion []gax.CallOption
DeleteVersion []gax.CallOption
CreateSpec []gax.CallOption
GetSpec []gax.CallOption
GetSpecContents []gax.CallOption
ListSpecs []gax.CallOption
UpdateSpec []gax.CallOption
DeleteSpec []gax.CallOption
CreateApiOperation []gax.CallOption
GetApiOperation []gax.CallOption
ListApiOperations []gax.CallOption
UpdateApiOperation []gax.CallOption
DeleteApiOperation []gax.CallOption
GetDefinition []gax.CallOption
CreateDeployment []gax.CallOption
GetDeployment []gax.CallOption
ListDeployments []gax.CallOption
UpdateDeployment []gax.CallOption
DeleteDeployment []gax.CallOption
CreateAttribute []gax.CallOption
GetAttribute []gax.CallOption
UpdateAttribute []gax.CallOption
DeleteAttribute []gax.CallOption
ListAttributes []gax.CallOption
SearchResources []gax.CallOption
CreateExternalApi []gax.CallOption
GetExternalApi []gax.CallOption
UpdateExternalApi []gax.CallOption
DeleteExternalApi []gax.CallOption
ListExternalApis []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.
Client
type Client struct {
// The call options for this service.
CallOptions *CallOptions
// contains filtered or unexported fields
}Client is a client for interacting with API hub API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
This service provides all methods related to the API hub.
func NewRESTClient
NewRESTClient creates a new api hub rest client.
This service provides all methods related to the API hub.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*Client) CancelOperation
func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) Close
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) Connection (deprecated)
func (c *Client) Connection() *grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*Client) CreateApi
func (c *Client) CreateApi(ctx context.Context, req *apihubpb.CreateApiRequest, opts ...gax.CallOption) (*apihubpb.Api, error)CreateApi create an API resource in the API hub. Once an API resource is created, versions can be added to it.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.CreateApiRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#CreateApiRequest.
}
resp, err := c.CreateApi(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateApiOperation
func (c *Client) CreateApiOperation(ctx context.Context, req *apihubpb.CreateApiOperationRequest, opts ...gax.CallOption) (*apihubpb.ApiOperation, error)CreateApiOperation create an apiOperation in an API version. An apiOperation can be created only if the version has no apiOperations which were created by parsing a spec.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.CreateApiOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#CreateApiOperationRequest.
}
resp, err := c.CreateApiOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateAttribute
func (c *Client) CreateAttribute(ctx context.Context, req *apihubpb.CreateAttributeRequest, opts ...gax.CallOption) (*apihubpb.Attribute, error)CreateAttribute create a user defined attribute.
Certain pre defined attributes are already created by the API hub. These attributes will have type as SYSTEM_DEFINED and can be listed via ListAttributes method. Allowed values for the same can be updated via UpdateAttribute method.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.CreateAttributeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#CreateAttributeRequest.
}
resp, err := c.CreateAttribute(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateDeployment
func (c *Client) CreateDeployment(ctx context.Context, req *apihubpb.CreateDeploymentRequest, opts ...gax.CallOption) (*apihubpb.Deployment, error)CreateDeployment create a deployment resource in the API hub. Once a deployment resource is created, it can be associated with API versions.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.CreateDeploymentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#CreateDeploymentRequest.
}
resp, err := c.CreateDeployment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateExternalApi
func (c *Client) CreateExternalApi(ctx context.Context, req *apihubpb.CreateExternalApiRequest, opts ...gax.CallOption) (*apihubpb.ExternalApi, error)CreateExternalApi create an External API resource in the API hub.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.CreateExternalApiRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#CreateExternalApiRequest.
}
resp, err := c.CreateExternalApi(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateSpec
func (c *Client) CreateSpec(ctx context.Context, req *apihubpb.CreateSpecRequest, opts ...gax.CallOption) (*apihubpb.Spec, error)CreateSpec add a spec to an API version in the API hub. Multiple specs can be added to an API version. Note, while adding a spec, at least one of contents or source_uri must be provided. If contents is provided, then spec_type must also be provided.
On adding a spec with contents to the version, the operations present in it will be added to the version.Note that the file contents in the spec should be of the same type as defined in the projects/{project}/locations/{location}/attributes/system-spec-type attribute associated with spec resource. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently.
In order to access the information parsed from the spec, use the GetSpec method. In order to access the raw contents for a particular spec, use the GetSpecContents method. In order to access the operations parsed from the spec, use the ListAPIOperations method.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.CreateSpecRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#CreateSpecRequest.
}
resp, err := c.CreateSpec(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateVersion
func (c *Client) CreateVersion(ctx context.Context, req *apihubpb.CreateVersionRequest, opts ...gax.CallOption) (*apihubpb.Version, error)CreateVersion create an API version for an API resource in the API hub.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.CreateVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#CreateVersionRequest.
}
resp, err := c.CreateVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) DeleteApi
func (c *Client) DeleteApi(ctx context.Context, req *apihubpb.DeleteApiRequest, opts ...gax.CallOption) errorDeleteApi delete an API resource in the API hub. API can only be deleted if all underlying versions are deleted.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.DeleteApiRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#DeleteApiRequest.
}
err = c.DeleteApi(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteApiOperation
func (c *Client) DeleteApiOperation(ctx context.Context, req *apihubpb.DeleteApiOperationRequest, opts ...gax.CallOption) errorDeleteApiOperation delete an operation in an API version and we can delete only the operations created via create API. If the operation was created by parsing the spec, then it can be deleted by editing or deleting the spec.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.DeleteApiOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#DeleteApiOperationRequest.
}
err = c.DeleteApiOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteAttribute
func (c *Client) DeleteAttribute(ctx context.Context, req *apihubpb.DeleteAttributeRequest, opts ...gax.CallOption) errorDeleteAttribute delete an attribute.
Note: System defined attributes cannot be deleted. All associations of the attribute being deleted with any API hub resource will also get deleted.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.DeleteAttributeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#DeleteAttributeRequest.
}
err = c.DeleteAttribute(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteDeployment
func (c *Client) DeleteDeployment(ctx context.Context, req *apihubpb.DeleteDeploymentRequest, opts ...gax.CallOption) errorDeleteDeployment delete a deployment resource in the API hub.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.DeleteDeploymentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#DeleteDeploymentRequest.
}
err = c.DeleteDeployment(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteExternalApi
func (c *Client) DeleteExternalApi(ctx context.Context, req *apihubpb.DeleteExternalApiRequest, opts ...gax.CallOption) errorDeleteExternalApi delete an External API resource in the API hub.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.DeleteExternalApiRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#DeleteExternalApiRequest.
}
err = c.DeleteExternalApi(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteOperation
func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteSpec
func (c *Client) DeleteSpec(ctx context.Context, req *apihubpb.DeleteSpecRequest, opts ...gax.CallOption) errorDeleteSpec delete a spec. Deleting a spec will also delete the associated operations from the version.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.DeleteSpecRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#DeleteSpecRequest.
}
err = c.DeleteSpec(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteVersion
func (c *Client) DeleteVersion(ctx context.Context, req *apihubpb.DeleteVersionRequest, opts ...gax.CallOption) errorDeleteVersion delete an API version. Version can only be deleted if all underlying specs, operations, definitions and linked deployments are deleted.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.DeleteVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#DeleteVersionRequest.
}
err = c.DeleteVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) GetApi
func (c *Client) GetApi(ctx context.Context, req *apihubpb.GetApiRequest, opts ...gax.CallOption) (*apihubpb.Api, error)GetApi get API resource details including the API versions contained in it.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetApiRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetApiRequest.
}
resp, err := c.GetApi(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetApiOperation
func (c *Client) GetApiOperation(ctx context.Context, req *apihubpb.GetApiOperationRequest, opts ...gax.CallOption) (*apihubpb.ApiOperation, error)GetApiOperation get details about a particular operation in API version.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetApiOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetApiOperationRequest.
}
resp, err := c.GetApiOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetAttribute
func (c *Client) GetAttribute(ctx context.Context, req *apihubpb.GetAttributeRequest, opts ...gax.CallOption) (*apihubpb.Attribute, error)GetAttribute get details about the attribute.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetAttributeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetAttributeRequest.
}
resp, err := c.GetAttribute(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetDefinition
func (c *Client) GetDefinition(ctx context.Context, req *apihubpb.GetDefinitionRequest, opts ...gax.CallOption) (*apihubpb.Definition, error)GetDefinition get details about a definition in an API version.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetDefinitionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetDefinitionRequest.
}
resp, err := c.GetDefinition(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetDeployment
func (c *Client) GetDeployment(ctx context.Context, req *apihubpb.GetDeploymentRequest, opts ...gax.CallOption) (*apihubpb.Deployment, error)GetDeployment get details about a deployment and the API versions linked to it.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetDeploymentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetDeploymentRequest.
}
resp, err := c.GetDeployment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetExternalApi
func (c *Client) GetExternalApi(ctx context.Context, req *apihubpb.GetExternalApiRequest, opts ...gax.CallOption) (*apihubpb.ExternalApi, error)GetExternalApi get details about an External API resource in the API hub.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetExternalApiRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetExternalApiRequest.
}
resp, err := c.GetExternalApi(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
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"
apihub "cloud.google.com/go/apihub/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 := apihub.NewRESTClient(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
}
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"
apihub "cloud.google.com/go/apihub/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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetSpec
func (c *Client) GetSpec(ctx context.Context, req *apihubpb.GetSpecRequest, opts ...gax.CallOption) (*apihubpb.Spec, error)GetSpec get details about the information parsed from a spec. Note that this method does not return the raw spec contents. Use GetSpecContents method to retrieve the same.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetSpecRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetSpecRequest.
}
resp, err := c.GetSpec(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetSpecContents
func (c *Client) GetSpecContents(ctx context.Context, req *apihubpb.GetSpecContentsRequest, opts ...gax.CallOption) (*apihubpb.SpecContents, error)GetSpecContents get spec contents.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetSpecContentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetSpecContentsRequest.
}
resp, err := c.GetSpecContents(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetVersion
func (c *Client) GetVersion(ctx context.Context, req *apihubpb.GetVersionRequest, opts ...gax.CallOption) (*apihubpb.Version, error)GetVersion get details about the API version of an API resource. This will include information about the specs and operations present in the API version as well as the deployments linked to it.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetVersionRequest.
}
resp, err := c.GetVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) ListApiOperations
func (c *Client) ListApiOperations(ctx context.Context, req *apihubpb.ListApiOperationsRequest, opts ...gax.CallOption) *ApiOperationIteratorListApiOperations list operations in an API version.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
"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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListApiOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListApiOperationsRequest.
}
it := c.ListApiOperations(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.(*apihubpb.ListApiOperationsResponse)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListApiOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListApiOperationsRequest.
}
for resp, err := range c.ListApiOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListApis
func (c *Client) ListApis(ctx context.Context, req *apihubpb.ListApisRequest, opts ...gax.CallOption) *ApiIteratorListApis list API resources in the API hub.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
"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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListApisRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListApisRequest.
}
it := c.ListApis(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.(*apihubpb.ListApisResponse)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListApisRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListApisRequest.
}
for resp, err := range c.ListApis(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListAttributes
func (c *Client) ListAttributes(ctx context.Context, req *apihubpb.ListAttributesRequest, opts ...gax.CallOption) *AttributeIteratorListAttributes list all attributes.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
"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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListAttributesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListAttributesRequest.
}
it := c.ListAttributes(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.(*apihubpb.ListAttributesResponse)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListAttributesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListAttributesRequest.
}
for resp, err := range c.ListAttributes(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListDeployments
func (c *Client) ListDeployments(ctx context.Context, req *apihubpb.ListDeploymentsRequest, opts ...gax.CallOption) *DeploymentIteratorListDeployments list deployment resources in the API hub.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
"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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListDeploymentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListDeploymentsRequest.
}
it := c.ListDeployments(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.(*apihubpb.ListDeploymentsResponse)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListDeploymentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListDeploymentsRequest.
}
for resp, err := range c.ListDeployments(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListExternalApis
func (c *Client) ListExternalApis(ctx context.Context, req *apihubpb.ListExternalApisRequest, opts ...gax.CallOption) *ExternalApiIteratorListExternalApis list External API resources in the API hub.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
"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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListExternalApisRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListExternalApisRequest.
}
it := c.ListExternalApis(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.(*apihubpb.ListExternalApisResponse)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListExternalApisRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListExternalApisRequest.
}
for resp, err := range c.ListExternalApis(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListLocations
func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewRESTClient(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
}
}
func (*Client) ListOperations
func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewRESTClient(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
}
}
func (*Client) ListSpecs
func (c *Client) ListSpecs(ctx context.Context, req *apihubpb.ListSpecsRequest, opts ...gax.CallOption) *SpecIteratorListSpecs list specs corresponding to a particular API resource.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
"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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListSpecsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListSpecsRequest.
}
it := c.ListSpecs(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.(*apihubpb.ListSpecsResponse)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListSpecsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListSpecsRequest.
}
for resp, err := range c.ListSpecs(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListVersions
func (c *Client) ListVersions(ctx context.Context, req *apihubpb.ListVersionsRequest, opts ...gax.CallOption) *VersionIteratorListVersions list API versions of an API resource in the API hub.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
"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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListVersionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListVersionsRequest.
}
it := c.ListVersions(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.(*apihubpb.ListVersionsResponse)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListVersionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListVersionsRequest.
}
for resp, err := range c.ListVersions(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) SearchResources
func (c *Client) SearchResources(ctx context.Context, req *apihubpb.SearchResourcesRequest, opts ...gax.CallOption) *SearchResultIteratorSearchResources search across API-Hub resources.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
"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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.SearchResourcesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#SearchResourcesRequest.
}
it := c.SearchResources(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.(*apihubpb.SearchResourcesResponse)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.SearchResourcesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#SearchResourcesRequest.
}
for resp, err := range c.SearchResources(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) UpdateApi
func (c *Client) UpdateApi(ctx context.Context, req *apihubpb.UpdateApiRequest, opts ...gax.CallOption) (*apihubpb.Api, error)UpdateApi update an API resource in the API hub. The following fields in the API can be updated:
display_name
description
owner
documentation
target_user
[team][google.cloud.apihub.v1.Api.team (at http://google.cloud.apihub.v1.Api.team)]
business_unit
maturity_level
api_style
attributes
The update_mask should be used to specify the fields being updated.
Updating the owner field requires complete owner message and updates both owner and email fields.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.UpdateApiRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#UpdateApiRequest.
}
resp, err := c.UpdateApi(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) UpdateApiOperation
func (c *Client) UpdateApiOperation(ctx context.Context, req *apihubpb.UpdateApiOperationRequest, opts ...gax.CallOption) (*apihubpb.ApiOperation, error)UpdateApiOperation update an operation in an API version. The following fields in the [ApiOperation resource][google.cloud.apihub.v1.ApiOperation] can be updated:
details.description
details.documentation
details.http_operation.path
details.http_operation.method
details.deprecated
attributes
The update_mask should be used to specify the fields being updated.
An operation can be updated only if the operation was created via CreateApiOperation API. If the operation was created by parsing the spec, then it can be edited by updating the spec.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.UpdateApiOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#UpdateApiOperationRequest.
}
resp, err := c.UpdateApiOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) UpdateAttribute
func (c *Client) UpdateAttribute(ctx context.Context, req *apihubpb.UpdateAttributeRequest, opts ...gax.CallOption) (*apihubpb.Attribute, error)UpdateAttribute update the attribute. The following fields in the [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated:
display_name
The display name can be updated for user defined attributes only.
description
The description can be updated for user defined attributes only.
allowed_values
To update the list of allowed values, clients need to use the fetched list
of allowed values and add or remove values to or from the same list.
The mutable allowed values can be updated for both user defined and System
defined attributes. The immutable allowed values cannot be updated or
deleted. The updated list of allowed values cannot be empty. If an allowed
value that is already used by some resource’s attribute is deleted, then
the association between the resource and the attribute value will also be
deleted.
cardinality
The cardinality can be updated for user defined attributes only.
Cardinality can only be increased during an update.
The update_mask should be used to specify the fields being updated.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.UpdateAttributeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#UpdateAttributeRequest.
}
resp, err := c.UpdateAttribute(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) UpdateDeployment
func (c *Client) UpdateDeployment(ctx context.Context, req *apihubpb.UpdateDeploymentRequest, opts ...gax.CallOption) (*apihubpb.Deployment, error)UpdateDeployment update a deployment resource in the API hub. The following fields in the [deployment resource][google.cloud.apihub.v1.Deployment] can be updated:
display_name
description
documentation
deployment_type
resource_uri
endpoints
slo
environment
attributes
[source_project] [google.cloud.apihub.v1.Deployment.source_project]
[source_environment]
[google.cloud.apihub.v1.Deployment.source_environment]
management_url
source_uri
The
update_mask
should be used to specify the fields being updated.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.UpdateDeploymentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#UpdateDeploymentRequest.
}
resp, err := c.UpdateDeployment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) UpdateExternalApi
func (c *Client) UpdateExternalApi(ctx context.Context, req *apihubpb.UpdateExternalApiRequest, opts ...gax.CallOption) (*apihubpb.ExternalApi, error)UpdateExternalApi update an External API resource in the API hub. The following fields can be updated:
display_name
description
documentation
endpoints
paths
The update_mask should be used to specify the fields being updated.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.UpdateExternalApiRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#UpdateExternalApiRequest.
}
resp, err := c.UpdateExternalApi(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) UpdateSpec
func (c *Client) UpdateSpec(ctx context.Context, req *apihubpb.UpdateSpecRequest, opts ...gax.CallOption) (*apihubpb.Spec, error)UpdateSpec update spec. The following fields in the spec can be updated:
display_name
source_uri
lint_response
attributes
contents
spec_type
In case of an OAS spec, updating spec contents can lead to:
Creation, deletion and update of operations.
Creation, deletion and update of definitions.
Update of other info parsed out from the new spec.
In case of contents or source_uri being present in update mask, spec_type must also be present. Also, spec_type can not be present in update mask if contents or source_uri is not present.
The update_mask should be used to specify the fields being updated.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.UpdateSpecRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#UpdateSpecRequest.
}
resp, err := c.UpdateSpec(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) UpdateVersion
func (c *Client) UpdateVersion(ctx context.Context, req *apihubpb.UpdateVersionRequest, opts ...gax.CallOption) (*apihubpb.Version, error)UpdateVersion update API version. The following fields in the version can be updated currently:
display_name
description
documentation
deployments
lifecycle
compliance
accreditation
attributes
The update_mask should be used to specify the fields being updated.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.UpdateVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#UpdateVersionRequest.
}
resp, err := c.UpdateVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
CollectApiDataOperation
type CollectApiDataOperation struct {
// contains filtered or unexported fields
}CollectApiDataOperation manages a long-running operation from CollectApiData.
func (*CollectApiDataOperation) Done
func (op *CollectApiDataOperation) Done() boolDone reports whether the long-running operation has completed.
func (*CollectApiDataOperation) Metadata
func (op *CollectApiDataOperation) Metadata() (*apihubpb.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 (*CollectApiDataOperation) Name
func (op *CollectApiDataOperation) Name() stringName 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 (*CollectApiDataOperation) Poll
func (op *CollectApiDataOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apihubpb.CollectApiDataResponse, 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 (*CollectApiDataOperation) Wait
func (op *CollectApiDataOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apihubpb.CollectApiDataResponse, 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.
CreateApiHubInstanceOperation
type CreateApiHubInstanceOperation struct {
// contains filtered or unexported fields
}CreateApiHubInstanceOperation manages a long-running operation from CreateApiHubInstance.
func (*CreateApiHubInstanceOperation) Done
func (op *CreateApiHubInstanceOperation) Done() boolDone reports whether the long-running operation has completed.
func (*CreateApiHubInstanceOperation) Metadata
func (op *CreateApiHubInstanceOperation) Metadata() (*apihubpb.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 (*CreateApiHubInstanceOperation) Name
func (op *CreateApiHubInstanceOperation) Name() stringName 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 (*CreateApiHubInstanceOperation) Poll
func (op *CreateApiHubInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apihubpb.ApiHubInstance, 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 (*CreateApiHubInstanceOperation) Wait
func (op *CreateApiHubInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apihubpb.ApiHubInstance, 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.
CreatePluginInstanceOperation
type CreatePluginInstanceOperation struct {
// contains filtered or unexported fields
}CreatePluginInstanceOperation manages a long-running operation from CreatePluginInstance.
func (*CreatePluginInstanceOperation) Done
func (op *CreatePluginInstanceOperation) Done() boolDone reports whether the long-running operation has completed.
func (*CreatePluginInstanceOperation) Metadata
func (op *CreatePluginInstanceOperation) Metadata() (*apihubpb.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 (*CreatePluginInstanceOperation) Name
func (op *CreatePluginInstanceOperation) Name() stringName 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 (*CreatePluginInstanceOperation) Poll
func (op *CreatePluginInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apihubpb.PluginInstance, 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 (*CreatePluginInstanceOperation) Wait
func (op *CreatePluginInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apihubpb.PluginInstance, 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.
CurationIterator
type CurationIterator 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 []*apihubpb.Curation, nextPageToken string, err error)
// contains filtered or unexported fields
}CurationIterator manages a stream of *apihubpb.Curation.
func (*CurationIterator) All
func (it *CurationIterator) All() iter.Seq2[*apihubpb.Curation, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*CurationIterator) Next
func (it *CurationIterator) Next() (*apihubpb.Curation, 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 (*CurationIterator) PageInfo
func (it *CurationIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
DeleteApiHubInstanceOperation
type DeleteApiHubInstanceOperation struct {
// contains filtered or unexported fields
}DeleteApiHubInstanceOperation manages a long-running operation from DeleteApiHubInstance.
func (*DeleteApiHubInstanceOperation) Done
func (op *DeleteApiHubInstanceOperation) Done() boolDone reports whether the long-running operation has completed.
func (*DeleteApiHubInstanceOperation) Metadata
func (op *DeleteApiHubInstanceOperation) Metadata() (*apihubpb.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 (*DeleteApiHubInstanceOperation) Name
func (op *DeleteApiHubInstanceOperation) Name() stringName 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 (*DeleteApiHubInstanceOperation) Poll
func (op *DeleteApiHubInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) errorPoll 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 (*DeleteApiHubInstanceOperation) Wait
func (op *DeleteApiHubInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeletePluginInstanceOperation
type DeletePluginInstanceOperation struct {
// contains filtered or unexported fields
}DeletePluginInstanceOperation manages a long-running operation from DeletePluginInstance.
func (*DeletePluginInstanceOperation) Done
func (op *DeletePluginInstanceOperation) Done() boolDone reports whether the long-running operation has completed.
func (*DeletePluginInstanceOperation) Metadata
func (op *DeletePluginInstanceOperation) Metadata() (*apihubpb.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 (*DeletePluginInstanceOperation) Name
func (op *DeletePluginInstanceOperation) Name() stringName 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 (*DeletePluginInstanceOperation) Poll
func (op *DeletePluginInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) errorPoll 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 (*DeletePluginInstanceOperation) Wait
func (op *DeletePluginInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeletePluginOperation
type DeletePluginOperation struct {
// contains filtered or unexported fields
}DeletePluginOperation manages a long-running operation from DeletePlugin.
func (*DeletePluginOperation) Done
func (op *DeletePluginOperation) Done() boolDone reports whether the long-running operation has completed.
func (*DeletePluginOperation) Metadata
func (op *DeletePluginOperation) Metadata() (*apihubpb.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 (*DeletePluginOperation) Name
func (op *DeletePluginOperation) Name() stringName 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 (*DeletePluginOperation) Poll
func (op *DeletePluginOperation) Poll(ctx context.Context, opts ...gax.CallOption) errorPoll 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 (*DeletePluginOperation) Wait
func (op *DeletePluginOperation) Wait(ctx context.Context, opts ...gax.CallOption) errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DependencyIterator
type DependencyIterator 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 []*apihubpb.Dependency, nextPageToken string, err error)
// contains filtered or unexported fields
}DependencyIterator manages a stream of *apihubpb.Dependency.
func (*DependencyIterator) All
func (it *DependencyIterator) All() iter.Seq2[*apihubpb.Dependency, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*DependencyIterator) Next
func (it *DependencyIterator) Next() (*apihubpb.Dependency, 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 (*DependencyIterator) PageInfo
func (it *DependencyIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
DeploymentIterator
type DeploymentIterator 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 []*apihubpb.Deployment, nextPageToken string, err error)
// contains filtered or unexported fields
}DeploymentIterator manages a stream of *apihubpb.Deployment.
func (*DeploymentIterator) All
func (it *DeploymentIterator) All() iter.Seq2[*apihubpb.Deployment, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*DeploymentIterator) Next
func (it *DeploymentIterator) Next() (*apihubpb.Deployment, 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 (*DeploymentIterator) PageInfo
func (it *DeploymentIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
DisablePluginInstanceActionOperation
type DisablePluginInstanceActionOperation struct {
// contains filtered or unexported fields
}DisablePluginInstanceActionOperation manages a long-running operation from DisablePluginInstanceAction.
func (*DisablePluginInstanceActionOperation) Done
func (op *DisablePluginInstanceActionOperation) Done() boolDone reports whether the long-running operation has completed.
func (*DisablePluginInstanceActionOperation) Metadata
func (op *DisablePluginInstanceActionOperation) Metadata() (*apihubpb.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 (*DisablePluginInstanceActionOperation) Name
func (op *DisablePluginInstanceActionOperation) Name() stringName 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 (*DisablePluginInstanceActionOperation) Poll
func (op *DisablePluginInstanceActionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apihubpb.DisablePluginInstanceActionResponse, 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 (*DisablePluginInstanceActionOperation) Wait
func (op *DisablePluginInstanceActionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apihubpb.DisablePluginInstanceActionResponse, 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.
DiscoveredApiObservationIterator
type DiscoveredApiObservationIterator 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 []*apihubpb.DiscoveredApiObservation, nextPageToken string, err error)
// contains filtered or unexported fields
}DiscoveredApiObservationIterator manages a stream of *apihubpb.DiscoveredApiObservation.
func (*DiscoveredApiObservationIterator) All
func (it *DiscoveredApiObservationIterator) All() iter.Seq2[*apihubpb.DiscoveredApiObservation, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*DiscoveredApiObservationIterator) Next
func (it *DiscoveredApiObservationIterator) Next() (*apihubpb.DiscoveredApiObservation, 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 (*DiscoveredApiObservationIterator) PageInfo
func (it *DiscoveredApiObservationIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
DiscoveredApiOperationIterator
type DiscoveredApiOperationIterator 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 []*apihubpb.DiscoveredApiOperation, nextPageToken string, err error)
// contains filtered or unexported fields
}DiscoveredApiOperationIterator manages a stream of *apihubpb.DiscoveredApiOperation.
func (*DiscoveredApiOperationIterator) All
func (it *DiscoveredApiOperationIterator) All() iter.Seq2[*apihubpb.DiscoveredApiOperation, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*DiscoveredApiOperationIterator) Next
func (it *DiscoveredApiOperationIterator) Next() (*apihubpb.DiscoveredApiOperation, 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 (*DiscoveredApiOperationIterator) PageInfo
func (it *DiscoveredApiOperationIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
EnablePluginInstanceActionOperation
type EnablePluginInstanceActionOperation struct {
// contains filtered or unexported fields
}EnablePluginInstanceActionOperation manages a long-running operation from EnablePluginInstanceAction.
func (*EnablePluginInstanceActionOperation) Done
func (op *EnablePluginInstanceActionOperation) Done() boolDone reports whether the long-running operation has completed.
func (*EnablePluginInstanceActionOperation) Metadata
func (op *EnablePluginInstanceActionOperation) Metadata() (*apihubpb.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 (*EnablePluginInstanceActionOperation) Name
func (op *EnablePluginInstanceActionOperation) Name() stringName 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 (*EnablePluginInstanceActionOperation) Poll
func (op *EnablePluginInstanceActionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apihubpb.EnablePluginInstanceActionResponse, 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 (*EnablePluginInstanceActionOperation) Wait
func (op *EnablePluginInstanceActionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apihubpb.EnablePluginInstanceActionResponse, 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.
ExecutePluginInstanceActionOperation
type ExecutePluginInstanceActionOperation struct {
// contains filtered or unexported fields
}ExecutePluginInstanceActionOperation manages a long-running operation from ExecutePluginInstanceAction.
func (*ExecutePluginInstanceActionOperation) Done
func (op *ExecutePluginInstanceActionOperation) Done() boolDone reports whether the long-running operation has completed.
func (*ExecutePluginInstanceActionOperation) Metadata
func (op *ExecutePluginInstanceActionOperation) Metadata() (*apihubpb.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 (*ExecutePluginInstanceActionOperation) Name
func (op *ExecutePluginInstanceActionOperation) Name() stringName 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 (*ExecutePluginInstanceActionOperation) Poll
func (op *ExecutePluginInstanceActionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apihubpb.ExecutePluginInstanceActionResponse, 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 (*ExecutePluginInstanceActionOperation) Wait
func (op *ExecutePluginInstanceActionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apihubpb.ExecutePluginInstanceActionResponse, 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.
ExternalApiIterator
type ExternalApiIterator 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 []*apihubpb.ExternalApi, nextPageToken string, err error)
// contains filtered or unexported fields
}ExternalApiIterator manages a stream of *apihubpb.ExternalApi.
func (*ExternalApiIterator) All
func (it *ExternalApiIterator) All() iter.Seq2[*apihubpb.ExternalApi, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ExternalApiIterator) Next
func (it *ExternalApiIterator) Next() (*apihubpb.ExternalApi, 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 (*ExternalApiIterator) PageInfo
func (it *ExternalApiIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
HostProjectRegistrationCallOptions
type HostProjectRegistrationCallOptions struct {
CreateHostProjectRegistration []gax.CallOption
GetHostProjectRegistration []gax.CallOption
ListHostProjectRegistrations []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}HostProjectRegistrationCallOptions contains the retry settings for each method of HostProjectRegistrationClient.
HostProjectRegistrationClient
type HostProjectRegistrationClient struct {
// The call options for this service.
CallOptions *HostProjectRegistrationCallOptions
// contains filtered or unexported fields
}HostProjectRegistrationClient is a client for interacting with API hub API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
This service is used for managing the host project registrations.
func NewHostProjectRegistrationRESTClient
func NewHostProjectRegistrationRESTClient(ctx context.Context, opts ...option.ClientOption) (*HostProjectRegistrationClient, error)NewHostProjectRegistrationRESTClient creates a new host project registration service rest client.
This service is used for managing the host project registrations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewHostProjectRegistrationRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*HostProjectRegistrationClient) CancelOperation
func (c *HostProjectRegistrationClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewHostProjectRegistrationRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*HostProjectRegistrationClient) Close
func (c *HostProjectRegistrationClient) Close() errorClose closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*HostProjectRegistrationClient) Connection (deprecated)
func (c *HostProjectRegistrationClient) Connection() *grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*HostProjectRegistrationClient) CreateHostProjectRegistration
func (c *HostProjectRegistrationClient) CreateHostProjectRegistration(ctx context.Context, req *apihubpb.CreateHostProjectRegistrationRequest, opts ...gax.CallOption) (*apihubpb.HostProjectRegistration, error)CreateHostProjectRegistration create a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can be registered as a host project only once. Subsequent register calls for the same project will fail.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewHostProjectRegistrationRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.CreateHostProjectRegistrationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#CreateHostProjectRegistrationRequest.
}
resp, err := c.CreateHostProjectRegistration(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HostProjectRegistrationClient) DeleteOperation
func (c *HostProjectRegistrationClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewHostProjectRegistrationRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*HostProjectRegistrationClient) GetHostProjectRegistration
func (c *HostProjectRegistrationClient) GetHostProjectRegistration(ctx context.Context, req *apihubpb.GetHostProjectRegistrationRequest, opts ...gax.CallOption) (*apihubpb.HostProjectRegistration, error)GetHostProjectRegistration get a host project registration.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewHostProjectRegistrationRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetHostProjectRegistrationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetHostProjectRegistrationRequest.
}
resp, err := c.GetHostProjectRegistration(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HostProjectRegistrationClient) GetLocation
func (c *HostProjectRegistrationClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewHostProjectRegistrationRESTClient(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
}
func (*HostProjectRegistrationClient) GetOperation
func (c *HostProjectRegistrationClient) 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"
apihub "cloud.google.com/go/apihub/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 := apihub.NewHostProjectRegistrationRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HostProjectRegistrationClient) ListHostProjectRegistrations
func (c *HostProjectRegistrationClient) ListHostProjectRegistrations(ctx context.Context, req *apihubpb.ListHostProjectRegistrationsRequest, opts ...gax.CallOption) *HostProjectRegistrationIteratorListHostProjectRegistrations lists host project registrations.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
"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 := apihub.NewHostProjectRegistrationRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListHostProjectRegistrationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListHostProjectRegistrationsRequest.
}
it := c.ListHostProjectRegistrations(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.(*apihubpb.ListHostProjectRegistrationsResponse)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewHostProjectRegistrationRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListHostProjectRegistrationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListHostProjectRegistrationsRequest.
}
for resp, err := range c.ListHostProjectRegistrations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*HostProjectRegistrationClient) ListLocations
func (c *HostProjectRegistrationClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewHostProjectRegistrationRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewHostProjectRegistrationRESTClient(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
}
}
func (*HostProjectRegistrationClient) ListOperations
func (c *HostProjectRegistrationClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewHostProjectRegistrationRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewHostProjectRegistrationRESTClient(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
}
}
HostProjectRegistrationIterator
type HostProjectRegistrationIterator 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 []*apihubpb.HostProjectRegistration, nextPageToken string, err error)
// contains filtered or unexported fields
}HostProjectRegistrationIterator manages a stream of *apihubpb.HostProjectRegistration.
func (*HostProjectRegistrationIterator) All
func (it *HostProjectRegistrationIterator) All() iter.Seq2[*apihubpb.HostProjectRegistration, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*HostProjectRegistrationIterator) Next
func (it *HostProjectRegistrationIterator) Next() (*apihubpb.HostProjectRegistration, 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 (*HostProjectRegistrationIterator) PageInfo
func (it *HostProjectRegistrationIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
LintingCallOptions
type LintingCallOptions struct {
GetStyleGuide []gax.CallOption
UpdateStyleGuide []gax.CallOption
GetStyleGuideContents []gax.CallOption
LintSpec []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}LintingCallOptions contains the retry settings for each method of LintingClient.
LintingClient
type LintingClient struct {
// The call options for this service.
CallOptions *LintingCallOptions
// contains filtered or unexported fields
}LintingClient is a client for interacting with API hub API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
This service provides all methods related to the 1p Linter.
func NewLintingRESTClient
func NewLintingRESTClient(ctx context.Context, opts ...option.ClientOption) (*LintingClient, error)NewLintingRESTClient creates a new linting service rest client.
This service provides all methods related to the 1p Linter.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewLintingRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*LintingClient) CancelOperation
func (c *LintingClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewLintingRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*LintingClient) Close
func (c *LintingClient) Close() errorClose closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*LintingClient) Connection (deprecated)
func (c *LintingClient) Connection() *grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*LintingClient) DeleteOperation
func (c *LintingClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewLintingRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*LintingClient) GetLocation
func (c *LintingClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewLintingRESTClient(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
}
func (*LintingClient) GetOperation
func (c *LintingClient) 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"
apihub "cloud.google.com/go/apihub/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 := apihub.NewLintingRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*LintingClient) GetStyleGuide
func (c *LintingClient) GetStyleGuide(ctx context.Context, req *apihubpb.GetStyleGuideRequest, opts ...gax.CallOption) (*apihubpb.StyleGuide, error)GetStyleGuide get the style guide being used for linting.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewLintingRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetStyleGuideRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetStyleGuideRequest.
}
resp, err := c.GetStyleGuide(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*LintingClient) GetStyleGuideContents
func (c *LintingClient) GetStyleGuideContents(ctx context.Context, req *apihubpb.GetStyleGuideContentsRequest, opts ...gax.CallOption) (*apihubpb.StyleGuideContents, error)GetStyleGuideContents get the contents of the style guide.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewLintingRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetStyleGuideContentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetStyleGuideContentsRequest.
}
resp, err := c.GetStyleGuideContents(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*LintingClient) LintSpec
func (c *LintingClient) LintSpec(ctx context.Context, req *apihubpb.LintSpecRequest, opts ...gax.CallOption) errorLintSpec lints the requested spec and updates the corresponding API Spec with the lint response. This lint response will be available in all subsequent Get and List Spec calls to Core service.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewLintingRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.LintSpecRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#LintSpecRequest.
}
err = c.LintSpec(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*LintingClient) ListLocations
func (c *LintingClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewLintingRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewLintingRESTClient(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
}
}
func (*LintingClient) ListOperations
func (c *LintingClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewLintingRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewLintingRESTClient(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
}
}
func (*LintingClient) UpdateStyleGuide
func (c *LintingClient) UpdateStyleGuide(ctx context.Context, req *apihubpb.UpdateStyleGuideRequest, opts ...gax.CallOption) (*apihubpb.StyleGuide, error)UpdateStyleGuide update the styleGuide to be used for liniting in by API hub.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewLintingRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.UpdateStyleGuideRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#UpdateStyleGuideRequest.
}
resp, err := c.UpdateStyleGuide(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
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.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
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.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
PluginInstanceIterator
type PluginInstanceIterator 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 []*apihubpb.PluginInstance, nextPageToken string, err error)
// contains filtered or unexported fields
}PluginInstanceIterator manages a stream of *apihubpb.PluginInstance.
func (*PluginInstanceIterator) All
func (it *PluginInstanceIterator) All() iter.Seq2[*apihubpb.PluginInstance, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*PluginInstanceIterator) Next
func (it *PluginInstanceIterator) Next() (*apihubpb.PluginInstance, 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 (*PluginInstanceIterator) PageInfo
func (it *PluginInstanceIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
PluginIterator
type PluginIterator 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 []*apihubpb.Plugin, nextPageToken string, err error)
// contains filtered or unexported fields
}PluginIterator manages a stream of *apihubpb.Plugin.
func (*PluginIterator) All
func (it *PluginIterator) All() iter.Seq2[*apihubpb.Plugin, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*PluginIterator) Next
func (it *PluginIterator) Next() (*apihubpb.Plugin, 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 (*PluginIterator) PageInfo
func (it *PluginIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ProvisioningCallOptions
type ProvisioningCallOptions struct {
CreateApiHubInstance []gax.CallOption
DeleteApiHubInstance []gax.CallOption
GetApiHubInstance []gax.CallOption
LookupApiHubInstance []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}ProvisioningCallOptions contains the retry settings for each method of ProvisioningClient.
ProvisioningClient
type ProvisioningClient struct {
// The call options for this service.
CallOptions *ProvisioningCallOptions
// 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
}ProvisioningClient is a client for interacting with API hub API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
This service is used for managing the data plane provisioning of the API hub.
func NewProvisioningRESTClient
func NewProvisioningRESTClient(ctx context.Context, opts ...option.ClientOption) (*ProvisioningClient, error)NewProvisioningRESTClient creates a new provisioning rest client.
This service is used for managing the data plane provisioning of the API hub.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewProvisioningRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ProvisioningClient) CancelOperation
func (c *ProvisioningClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewProvisioningRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ProvisioningClient) Close
func (c *ProvisioningClient) Close() errorClose closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ProvisioningClient) Connection (deprecated)
func (c *ProvisioningClient) Connection() *grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ProvisioningClient) CreateApiHubInstance
func (c *ProvisioningClient) CreateApiHubInstance(ctx context.Context, req *apihubpb.CreateApiHubInstanceRequest, opts ...gax.CallOption) (*CreateApiHubInstanceOperation, error)CreateApiHubInstance provisions instance resources for the API Hub.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewProvisioningRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.CreateApiHubInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#CreateApiHubInstanceRequest.
}
op, err := c.CreateApiHubInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ProvisioningClient) CreateApiHubInstanceOperation
func (c *ProvisioningClient) CreateApiHubInstanceOperation(name string) *CreateApiHubInstanceOperationCreateApiHubInstanceOperation returns a new CreateApiHubInstanceOperation from a given name. The name must be that of a previously created CreateApiHubInstanceOperation, possibly from a different process.
func (*ProvisioningClient) DeleteApiHubInstance
func (c *ProvisioningClient) DeleteApiHubInstance(ctx context.Context, req *apihubpb.DeleteApiHubInstanceRequest, opts ...gax.CallOption) (*DeleteApiHubInstanceOperation, error)DeleteApiHubInstance deletes the API hub instance.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewProvisioningRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.DeleteApiHubInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#DeleteApiHubInstanceRequest.
}
op, err := c.DeleteApiHubInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ProvisioningClient) DeleteApiHubInstanceOperation
func (c *ProvisioningClient) DeleteApiHubInstanceOperation(name string) *DeleteApiHubInstanceOperationDeleteApiHubInstanceOperation returns a new DeleteApiHubInstanceOperation from a given name. The name must be that of a previously created DeleteApiHubInstanceOperation, possibly from a different process.
func (*ProvisioningClient) DeleteOperation
func (c *ProvisioningClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewProvisioningRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ProvisioningClient) GetApiHubInstance
func (c *ProvisioningClient) GetApiHubInstance(ctx context.Context, req *apihubpb.GetApiHubInstanceRequest, opts ...gax.CallOption) (*apihubpb.ApiHubInstance, error)GetApiHubInstance gets details of a single API Hub instance.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewProvisioningRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetApiHubInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetApiHubInstanceRequest.
}
resp, err := c.GetApiHubInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ProvisioningClient) GetLocation
func (c *ProvisioningClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewProvisioningRESTClient(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
}
func (*ProvisioningClient) GetOperation
func (c *ProvisioningClient) 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"
apihub "cloud.google.com/go/apihub/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 := apihub.NewProvisioningRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ProvisioningClient) ListLocations
func (c *ProvisioningClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewProvisioningRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewProvisioningRESTClient(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
}
}
func (*ProvisioningClient) ListOperations
func (c *ProvisioningClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewProvisioningRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewProvisioningRESTClient(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
}
}
func (*ProvisioningClient) LookupApiHubInstance
func (c *ProvisioningClient) LookupApiHubInstance(ctx context.Context, req *apihubpb.LookupApiHubInstanceRequest, opts ...gax.CallOption) (*apihubpb.LookupApiHubInstanceResponse, error)LookupApiHubInstance looks up an Api Hub instance in a given GCP project. There will always be only one Api Hub instance for a GCP project across all locations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewProvisioningRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.LookupApiHubInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#LookupApiHubInstanceRequest.
}
resp, err := c.LookupApiHubInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
RuntimeProjectAttachmentCallOptions
type RuntimeProjectAttachmentCallOptions struct {
CreateRuntimeProjectAttachment []gax.CallOption
GetRuntimeProjectAttachment []gax.CallOption
ListRuntimeProjectAttachments []gax.CallOption
DeleteRuntimeProjectAttachment []gax.CallOption
LookupRuntimeProjectAttachment []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}RuntimeProjectAttachmentCallOptions contains the retry settings for each method of RuntimeProjectAttachmentClient.
RuntimeProjectAttachmentClient
type RuntimeProjectAttachmentClient struct {
// The call options for this service.
CallOptions *RuntimeProjectAttachmentCallOptions
// contains filtered or unexported fields
}RuntimeProjectAttachmentClient is a client for interacting with API hub API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
This service is used for managing the runtime project attachments.
func NewRuntimeProjectAttachmentRESTClient
func NewRuntimeProjectAttachmentRESTClient(ctx context.Context, opts ...option.ClientOption) (*RuntimeProjectAttachmentClient, error)NewRuntimeProjectAttachmentRESTClient creates a new runtime project attachment service rest client.
This service is used for managing the runtime project attachments.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewRuntimeProjectAttachmentRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RuntimeProjectAttachmentClient) CancelOperation
func (c *RuntimeProjectAttachmentClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewRuntimeProjectAttachmentRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*RuntimeProjectAttachmentClient) Close
func (c *RuntimeProjectAttachmentClient) Close() errorClose closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RuntimeProjectAttachmentClient) Connection (deprecated)
func (c *RuntimeProjectAttachmentClient) Connection() *grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RuntimeProjectAttachmentClient) CreateRuntimeProjectAttachment
func (c *RuntimeProjectAttachmentClient) CreateRuntimeProjectAttachment(ctx context.Context, req *apihubpb.CreateRuntimeProjectAttachmentRequest, opts ...gax.CallOption) (*apihubpb.RuntimeProjectAttachment, error)CreateRuntimeProjectAttachment attaches a runtime project to the host project.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRuntimeProjectAttachmentRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.CreateRuntimeProjectAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#CreateRuntimeProjectAttachmentRequest.
}
resp, err := c.CreateRuntimeProjectAttachment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RuntimeProjectAttachmentClient) DeleteOperation
func (c *RuntimeProjectAttachmentClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewRuntimeProjectAttachmentRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*RuntimeProjectAttachmentClient) DeleteRuntimeProjectAttachment
func (c *RuntimeProjectAttachmentClient) DeleteRuntimeProjectAttachment(ctx context.Context, req *apihubpb.DeleteRuntimeProjectAttachmentRequest, opts ...gax.CallOption) errorDeleteRuntimeProjectAttachment delete a runtime project attachment in the API Hub. This call will detach the runtime project from the host project.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRuntimeProjectAttachmentRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.DeleteRuntimeProjectAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#DeleteRuntimeProjectAttachmentRequest.
}
err = c.DeleteRuntimeProjectAttachment(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*RuntimeProjectAttachmentClient) GetLocation
func (c *RuntimeProjectAttachmentClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewRuntimeProjectAttachmentRESTClient(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
}
func (*RuntimeProjectAttachmentClient) GetOperation
func (c *RuntimeProjectAttachmentClient) 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"
apihub "cloud.google.com/go/apihub/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 := apihub.NewRuntimeProjectAttachmentRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RuntimeProjectAttachmentClient) GetRuntimeProjectAttachment
func (c *RuntimeProjectAttachmentClient) GetRuntimeProjectAttachment(ctx context.Context, req *apihubpb.GetRuntimeProjectAttachmentRequest, opts ...gax.CallOption) (*apihubpb.RuntimeProjectAttachment, error)GetRuntimeProjectAttachment gets a runtime project attachment.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRuntimeProjectAttachmentRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.GetRuntimeProjectAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#GetRuntimeProjectAttachmentRequest.
}
resp, err := c.GetRuntimeProjectAttachment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RuntimeProjectAttachmentClient) ListLocations
func (c *RuntimeProjectAttachmentClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewRuntimeProjectAttachmentRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewRuntimeProjectAttachmentRESTClient(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
}
}
func (*RuntimeProjectAttachmentClient) ListOperations
func (c *RuntimeProjectAttachmentClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewRuntimeProjectAttachmentRESTClient(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)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/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 := apihub.NewRuntimeProjectAttachmentRESTClient(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
}
}
func (*RuntimeProjectAttachmentClient) ListRuntimeProjectAttachments
func (c *RuntimeProjectAttachmentClient) ListRuntimeProjectAttachments(ctx context.Context, req *apihubpb.ListRuntimeProjectAttachmentsRequest, opts ...gax.CallOption) *RuntimeProjectAttachmentIteratorListRuntimeProjectAttachments list runtime projects attached to the host project.
Examples
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
"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 := apihub.NewRuntimeProjectAttachmentRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListRuntimeProjectAttachmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListRuntimeProjectAttachmentsRequest.
}
it := c.ListRuntimeProjectAttachments(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.(*apihubpb.ListRuntimeProjectAttachmentsResponse)
}
}
all
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRuntimeProjectAttachmentRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.ListRuntimeProjectAttachmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#ListRuntimeProjectAttachmentsRequest.
}
for resp, err := range c.ListRuntimeProjectAttachments(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RuntimeProjectAttachmentClient) LookupRuntimeProjectAttachment
func (c *RuntimeProjectAttachmentClient) LookupRuntimeProjectAttachment(ctx context.Context, req *apihubpb.LookupRuntimeProjectAttachmentRequest, opts ...gax.CallOption) (*apihubpb.LookupRuntimeProjectAttachmentResponse, error)LookupRuntimeProjectAttachment look up a runtime project attachment. This API can be called in the context of any project.
Example
package main
import (
"context"
apihub "cloud.google.com/go/apihub/apiv1"
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb"
)
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 := apihub.NewRuntimeProjectAttachmentRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &apihubpb.LookupRuntimeProjectAttachmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/apihub/apiv1/apihubpb#LookupRuntimeProjectAttachmentRequest.
}
resp, err := c.LookupRuntimeProjectAttachment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
RuntimeProjectAttachmentIterator
type RuntimeProjectAttachmentIterator 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 []*apihubpb.RuntimeProjectAttachment, nextPageToken string, err error)
// contains filtered or unexported fields
}RuntimeProjectAttachmentIterator manages a stream of *apihubpb.RuntimeProjectAttachment.
func (*RuntimeProjectAttachmentIterator) All
func (it *RuntimeProjectAttachmentIterator) All() iter.Seq2[*apihubpb.RuntimeProjectAttachment, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*RuntimeProjectAttachmentIterator) Next
func (it *RuntimeProjectAttachmentIterator) Next() (*apihubpb.RuntimeProjectAttachment, 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 (*RuntimeProjectAttachmentIterator) PageInfo
func (it *RuntimeProjectAttachmentIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
SearchResultIterator
type SearchResultIterator 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 []*apihubpb.SearchResult, nextPageToken string, err error)
// contains filtered or unexported fields
}SearchResultIterator manages a stream of *apihubpb.SearchResult.
func (*SearchResultIterator) All
func (it *SearchResultIterator) All() iter.Seq2[*apihubpb.SearchResult, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SearchResultIterator) Next
func (it *SearchResultIterator) Next() (*apihubpb.SearchResult, 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 (*SearchResultIterator) PageInfo
func (it *SearchResultIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
SpecIterator
type SpecIterator 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 []*apihubpb.Spec, nextPageToken string, err error)
// contains filtered or unexported fields
}SpecIterator manages a stream of *apihubpb.Spec.
func (*SpecIterator) All
func (it *SpecIterator) All() iter.Seq2[*apihubpb.Spec, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SpecIterator) Next
func (it *SpecIterator) Next() (*apihubpb.Spec, 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 (*SpecIterator) PageInfo
func (it *SpecIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
VersionIterator
type VersionIterator 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 []*apihubpb.Version, nextPageToken string, err error)
// contains filtered or unexported fields
}VersionIterator manages a stream of *apihubpb.Version.
func (*VersionIterator) All
func (it *VersionIterator) All() iter.Seq2[*apihubpb.Version, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*VersionIterator) Next
func (it *VersionIterator) Next() (*apihubpb.Version, 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 (*VersionIterator) PageInfo
func (it *VersionIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.