Documentation ¶
Overview ¶
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.
ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - 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.
ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - 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
Use of Context ¶
The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Index ¶
- func DefaultAuthScopes() []string
- type ApiHubDependenciesCallOptions
- type ApiHubDependenciesClient
- func (c *ApiHubDependenciesClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *ApiHubDependenciesClient) Close() error
- func (c *ApiHubDependenciesClient) Connection() *grpc.ClientConndeprecated
- func (c *ApiHubDependenciesClient) CreateDependency(ctx context.Context, req *apihubpb.CreateDependencyRequest, ...) (*apihubpb.Dependency, error)
- func (c *ApiHubDependenciesClient) DeleteDependency(ctx context.Context, req *apihubpb.DeleteDependencyRequest, ...) error
- func (c *ApiHubDependenciesClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *ApiHubDependenciesClient) GetDependency(ctx context.Context, req *apihubpb.GetDependencyRequest, ...) (*apihubpb.Dependency, error)
- func (c *ApiHubDependenciesClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *ApiHubDependenciesClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *ApiHubDependenciesClient) ListDependencies(ctx context.Context, req *apihubpb.ListDependenciesRequest, ...) *DependencyIterator
- func (c *ApiHubDependenciesClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *ApiHubDependenciesClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *ApiHubDependenciesClient) UpdateDependency(ctx context.Context, req *apihubpb.UpdateDependencyRequest, ...) (*apihubpb.Dependency, error)
- type ApiHubPluginCallOptions
- type ApiHubPluginClient
- func (c *ApiHubPluginClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *ApiHubPluginClient) Close() error
- func (c *ApiHubPluginClient) Connection() *grpc.ClientConndeprecated
- func (c *ApiHubPluginClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *ApiHubPluginClient) DisablePlugin(ctx context.Context, req *apihubpb.DisablePluginRequest, ...) (*apihubpb.Plugin, error)
- func (c *ApiHubPluginClient) EnablePlugin(ctx context.Context, req *apihubpb.EnablePluginRequest, opts ...gax.CallOption) (*apihubpb.Plugin, error)
- func (c *ApiHubPluginClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *ApiHubPluginClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *ApiHubPluginClient) GetPlugin(ctx context.Context, req *apihubpb.GetPluginRequest, opts ...gax.CallOption) (*apihubpb.Plugin, error)
- func (c *ApiHubPluginClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *ApiHubPluginClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- type ApiIterator
- type ApiOperationIterator
- type AttributeIterator
- type CallOptions
- type Client
- func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *Client) Close() error
- func (c *Client) Connection() *grpc.ClientConndeprecated
- func (c *Client) CreateApi(ctx context.Context, req *apihubpb.CreateApiRequest, opts ...gax.CallOption) (*apihubpb.Api, error)
- func (c *Client) CreateAttribute(ctx context.Context, req *apihubpb.CreateAttributeRequest, ...) (*apihubpb.Attribute, error)
- func (c *Client) CreateDeployment(ctx context.Context, req *apihubpb.CreateDeploymentRequest, ...) (*apihubpb.Deployment, error)
- func (c *Client) CreateExternalApi(ctx context.Context, req *apihubpb.CreateExternalApiRequest, ...) (*apihubpb.ExternalApi, error)
- func (c *Client) CreateSpec(ctx context.Context, req *apihubpb.CreateSpecRequest, opts ...gax.CallOption) (*apihubpb.Spec, error)
- func (c *Client) CreateVersion(ctx context.Context, req *apihubpb.CreateVersionRequest, ...) (*apihubpb.Version, error)
- func (c *Client) DeleteApi(ctx context.Context, req *apihubpb.DeleteApiRequest, opts ...gax.CallOption) error
- func (c *Client) DeleteAttribute(ctx context.Context, req *apihubpb.DeleteAttributeRequest, ...) error
- func (c *Client) DeleteDeployment(ctx context.Context, req *apihubpb.DeleteDeploymentRequest, ...) error
- func (c *Client) DeleteExternalApi(ctx context.Context, req *apihubpb.DeleteExternalApiRequest, ...) error
- func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *Client) DeleteSpec(ctx context.Context, req *apihubpb.DeleteSpecRequest, opts ...gax.CallOption) error
- func (c *Client) DeleteVersion(ctx context.Context, req *apihubpb.DeleteVersionRequest, ...) error
- func (c *Client) GetApi(ctx context.Context, req *apihubpb.GetApiRequest, opts ...gax.CallOption) (*apihubpb.Api, error)
- func (c *Client) GetApiOperation(ctx context.Context, req *apihubpb.GetApiOperationRequest, ...) (*apihubpb.ApiOperation, error)
- func (c *Client) GetAttribute(ctx context.Context, req *apihubpb.GetAttributeRequest, opts ...gax.CallOption) (*apihubpb.Attribute, error)
- func (c *Client) GetDefinition(ctx context.Context, req *apihubpb.GetDefinitionRequest, ...) (*apihubpb.Definition, error)
- func (c *Client) GetDeployment(ctx context.Context, req *apihubpb.GetDeploymentRequest, ...) (*apihubpb.Deployment, error)
- func (c *Client) GetExternalApi(ctx context.Context, req *apihubpb.GetExternalApiRequest, ...) (*apihubpb.ExternalApi, error)
- func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *Client) GetSpec(ctx context.Context, req *apihubpb.GetSpecRequest, opts ...gax.CallOption) (*apihubpb.Spec, error)
- func (c *Client) GetSpecContents(ctx context.Context, req *apihubpb.GetSpecContentsRequest, ...) (*apihubpb.SpecContents, error)
- func (c *Client) GetVersion(ctx context.Context, req *apihubpb.GetVersionRequest, opts ...gax.CallOption) (*apihubpb.Version, error)
- func (c *Client) ListApiOperations(ctx context.Context, req *apihubpb.ListApiOperationsRequest, ...) *ApiOperationIterator
- func (c *Client) ListApis(ctx context.Context, req *apihubpb.ListApisRequest, opts ...gax.CallOption) *ApiIterator
- func (c *Client) ListAttributes(ctx context.Context, req *apihubpb.ListAttributesRequest, ...) *AttributeIterator
- func (c *Client) ListDeployments(ctx context.Context, req *apihubpb.ListDeploymentsRequest, ...) *DeploymentIterator
- func (c *Client) ListExternalApis(ctx context.Context, req *apihubpb.ListExternalApisRequest, ...) *ExternalApiIterator
- func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *Client) ListSpecs(ctx context.Context, req *apihubpb.ListSpecsRequest, opts ...gax.CallOption) *SpecIterator
- func (c *Client) ListVersions(ctx context.Context, req *apihubpb.ListVersionsRequest, opts ...gax.CallOption) *VersionIterator
- func (c *Client) SearchResources(ctx context.Context, req *apihubpb.SearchResourcesRequest, ...) *SearchResultIterator
- func (c *Client) UpdateApi(ctx context.Context, req *apihubpb.UpdateApiRequest, opts ...gax.CallOption) (*apihubpb.Api, error)
- func (c *Client) UpdateAttribute(ctx context.Context, req *apihubpb.UpdateAttributeRequest, ...) (*apihubpb.Attribute, error)
- func (c *Client) UpdateDeployment(ctx context.Context, req *apihubpb.UpdateDeploymentRequest, ...) (*apihubpb.Deployment, error)
- func (c *Client) UpdateExternalApi(ctx context.Context, req *apihubpb.UpdateExternalApiRequest, ...) (*apihubpb.ExternalApi, error)
- func (c *Client) UpdateSpec(ctx context.Context, req *apihubpb.UpdateSpecRequest, opts ...gax.CallOption) (*apihubpb.Spec, error)
- func (c *Client) UpdateVersion(ctx context.Context, req *apihubpb.UpdateVersionRequest, ...) (*apihubpb.Version, error)
- type CreateApiHubInstanceOperation
- func (op *CreateApiHubInstanceOperation) Done() bool
- func (op *CreateApiHubInstanceOperation) Metadata() (*apihubpb.OperationMetadata, error)
- func (op *CreateApiHubInstanceOperation) Name() string
- func (op *CreateApiHubInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apihubpb.ApiHubInstance, error)
- func (op *CreateApiHubInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apihubpb.ApiHubInstance, error)
- type DependencyIterator
- type DeploymentIterator
- type ExternalApiIterator
- type HostProjectRegistrationCallOptions
- type HostProjectRegistrationClient
- func (c *HostProjectRegistrationClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *HostProjectRegistrationClient) Close() error
- func (c *HostProjectRegistrationClient) Connection() *grpc.ClientConndeprecated
- func (c *HostProjectRegistrationClient) CreateHostProjectRegistration(ctx context.Context, req *apihubpb.CreateHostProjectRegistrationRequest, ...) (*apihubpb.HostProjectRegistration, error)
- func (c *HostProjectRegistrationClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *HostProjectRegistrationClient) GetHostProjectRegistration(ctx context.Context, req *apihubpb.GetHostProjectRegistrationRequest, ...) (*apihubpb.HostProjectRegistration, error)
- func (c *HostProjectRegistrationClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *HostProjectRegistrationClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *HostProjectRegistrationClient) ListHostProjectRegistrations(ctx context.Context, req *apihubpb.ListHostProjectRegistrationsRequest, ...) *HostProjectRegistrationIterator
- func (c *HostProjectRegistrationClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *HostProjectRegistrationClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- type HostProjectRegistrationIterator
- type LintingCallOptions
- type LintingClient
- func (c *LintingClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *LintingClient) Close() error
- func (c *LintingClient) Connection() *grpc.ClientConndeprecated
- func (c *LintingClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *LintingClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *LintingClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *LintingClient) GetStyleGuide(ctx context.Context, req *apihubpb.GetStyleGuideRequest, ...) (*apihubpb.StyleGuide, error)
- func (c *LintingClient) GetStyleGuideContents(ctx context.Context, req *apihubpb.GetStyleGuideContentsRequest, ...) (*apihubpb.StyleGuideContents, error)
- func (c *LintingClient) LintSpec(ctx context.Context, req *apihubpb.LintSpecRequest, opts ...gax.CallOption) error
- func (c *LintingClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *LintingClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *LintingClient) UpdateStyleGuide(ctx context.Context, req *apihubpb.UpdateStyleGuideRequest, ...) (*apihubpb.StyleGuide, error)
- type LocationIterator
- type OperationIterator
- type ProvisioningCallOptions
- type ProvisioningClient
- func (c *ProvisioningClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *ProvisioningClient) Close() error
- func (c *ProvisioningClient) Connection() *grpc.ClientConndeprecated
- func (c *ProvisioningClient) CreateApiHubInstance(ctx context.Context, req *apihubpb.CreateApiHubInstanceRequest, ...) (*CreateApiHubInstanceOperation, error)
- func (c *ProvisioningClient) CreateApiHubInstanceOperation(name string) *CreateApiHubInstanceOperation
- func (c *ProvisioningClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *ProvisioningClient) GetApiHubInstance(ctx context.Context, req *apihubpb.GetApiHubInstanceRequest, ...) (*apihubpb.ApiHubInstance, error)
- func (c *ProvisioningClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *ProvisioningClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *ProvisioningClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *ProvisioningClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *ProvisioningClient) LookupApiHubInstance(ctx context.Context, req *apihubpb.LookupApiHubInstanceRequest, ...) (*apihubpb.LookupApiHubInstanceResponse, error)
- type RuntimeProjectAttachmentCallOptions
- type RuntimeProjectAttachmentClient
- func (c *RuntimeProjectAttachmentClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *RuntimeProjectAttachmentClient) Close() error
- func (c *RuntimeProjectAttachmentClient) Connection() *grpc.ClientConndeprecated
- func (c *RuntimeProjectAttachmentClient) CreateRuntimeProjectAttachment(ctx context.Context, req *apihubpb.CreateRuntimeProjectAttachmentRequest, ...) (*apihubpb.RuntimeProjectAttachment, error)
- func (c *RuntimeProjectAttachmentClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *RuntimeProjectAttachmentClient) DeleteRuntimeProjectAttachment(ctx context.Context, req *apihubpb.DeleteRuntimeProjectAttachmentRequest, ...) error
- func (c *RuntimeProjectAttachmentClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *RuntimeProjectAttachmentClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *RuntimeProjectAttachmentClient) GetRuntimeProjectAttachment(ctx context.Context, req *apihubpb.GetRuntimeProjectAttachmentRequest, ...) (*apihubpb.RuntimeProjectAttachment, error)
- func (c *RuntimeProjectAttachmentClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *RuntimeProjectAttachmentClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *RuntimeProjectAttachmentClient) ListRuntimeProjectAttachments(ctx context.Context, req *apihubpb.ListRuntimeProjectAttachmentsRequest, ...) *RuntimeProjectAttachmentIterator
- func (c *RuntimeProjectAttachmentClient) LookupRuntimeProjectAttachment(ctx context.Context, req *apihubpb.LookupRuntimeProjectAttachmentRequest, ...) (*apihubpb.LookupRuntimeProjectAttachmentResponse, error)
- type RuntimeProjectAttachmentIterator
- type SearchResultIterator
- type SpecIterator
- type VersionIterator
Examples ¶
- ApiHubDependenciesClient.CancelOperation
- ApiHubDependenciesClient.CreateDependency
- ApiHubDependenciesClient.DeleteDependency
- ApiHubDependenciesClient.DeleteOperation
- ApiHubDependenciesClient.GetDependency
- ApiHubDependenciesClient.GetLocation
- ApiHubDependenciesClient.GetOperation
- ApiHubDependenciesClient.ListDependencies
- ApiHubDependenciesClient.ListDependencies (All)
- ApiHubDependenciesClient.ListLocations
- ApiHubDependenciesClient.ListLocations (All)
- ApiHubDependenciesClient.ListOperations
- ApiHubDependenciesClient.ListOperations (All)
- ApiHubDependenciesClient.UpdateDependency
- ApiHubPluginClient.CancelOperation
- ApiHubPluginClient.DeleteOperation
- ApiHubPluginClient.DisablePlugin
- ApiHubPluginClient.EnablePlugin
- ApiHubPluginClient.GetLocation
- ApiHubPluginClient.GetOperation
- ApiHubPluginClient.GetPlugin
- ApiHubPluginClient.ListLocations
- ApiHubPluginClient.ListLocations (All)
- ApiHubPluginClient.ListOperations
- ApiHubPluginClient.ListOperations (All)
- Client.CancelOperation
- Client.CreateApi
- Client.CreateAttribute
- Client.CreateDeployment
- Client.CreateExternalApi
- Client.CreateSpec
- Client.CreateVersion
- Client.DeleteApi
- Client.DeleteAttribute
- Client.DeleteDeployment
- Client.DeleteExternalApi
- Client.DeleteOperation
- Client.DeleteSpec
- Client.DeleteVersion
- Client.GetApi
- Client.GetApiOperation
- Client.GetAttribute
- Client.GetDefinition
- Client.GetDeployment
- Client.GetExternalApi
- Client.GetLocation
- Client.GetOperation
- Client.GetSpec
- Client.GetSpecContents
- Client.GetVersion
- Client.ListApiOperations
- Client.ListApiOperations (All)
- Client.ListApis
- Client.ListApis (All)
- Client.ListAttributes
- Client.ListAttributes (All)
- Client.ListDeployments
- Client.ListDeployments (All)
- Client.ListExternalApis
- Client.ListExternalApis (All)
- Client.ListLocations
- Client.ListLocations (All)
- Client.ListOperations
- Client.ListOperations (All)
- Client.ListSpecs
- Client.ListSpecs (All)
- Client.ListVersions
- Client.ListVersions (All)
- Client.SearchResources
- Client.SearchResources (All)
- Client.UpdateApi
- Client.UpdateAttribute
- Client.UpdateDeployment
- Client.UpdateExternalApi
- Client.UpdateSpec
- Client.UpdateVersion
- HostProjectRegistrationClient.CancelOperation
- HostProjectRegistrationClient.CreateHostProjectRegistration
- HostProjectRegistrationClient.DeleteOperation
- HostProjectRegistrationClient.GetHostProjectRegistration
- HostProjectRegistrationClient.GetLocation
- HostProjectRegistrationClient.GetOperation
- HostProjectRegistrationClient.ListHostProjectRegistrations
- HostProjectRegistrationClient.ListHostProjectRegistrations (All)
- HostProjectRegistrationClient.ListLocations
- HostProjectRegistrationClient.ListLocations (All)
- HostProjectRegistrationClient.ListOperations
- HostProjectRegistrationClient.ListOperations (All)
- LintingClient.CancelOperation
- LintingClient.DeleteOperation
- LintingClient.GetLocation
- LintingClient.GetOperation
- LintingClient.GetStyleGuide
- LintingClient.GetStyleGuideContents
- LintingClient.LintSpec
- LintingClient.ListLocations
- LintingClient.ListLocations (All)
- LintingClient.ListOperations
- LintingClient.ListOperations (All)
- LintingClient.UpdateStyleGuide
- NewApiHubDependenciesRESTClient
- NewApiHubPluginRESTClient
- NewHostProjectRegistrationRESTClient
- NewLintingRESTClient
- NewProvisioningRESTClient
- NewRESTClient
- NewRuntimeProjectAttachmentRESTClient
- ProvisioningClient.CancelOperation
- ProvisioningClient.CreateApiHubInstance
- ProvisioningClient.DeleteOperation
- ProvisioningClient.GetApiHubInstance
- ProvisioningClient.GetLocation
- ProvisioningClient.GetOperation
- ProvisioningClient.ListLocations
- ProvisioningClient.ListLocations (All)
- ProvisioningClient.ListOperations
- ProvisioningClient.ListOperations (All)
- ProvisioningClient.LookupApiHubInstance
- RuntimeProjectAttachmentClient.CancelOperation
- RuntimeProjectAttachmentClient.CreateRuntimeProjectAttachment
- RuntimeProjectAttachmentClient.DeleteOperation
- RuntimeProjectAttachmentClient.DeleteRuntimeProjectAttachment
- RuntimeProjectAttachmentClient.GetLocation
- RuntimeProjectAttachmentClient.GetOperation
- RuntimeProjectAttachmentClient.GetRuntimeProjectAttachment
- RuntimeProjectAttachmentClient.ListLocations
- RuntimeProjectAttachmentClient.ListLocations (All)
- RuntimeProjectAttachmentClient.ListOperations
- RuntimeProjectAttachmentClient.ListOperations (All)
- RuntimeProjectAttachmentClient.ListRuntimeProjectAttachments
- RuntimeProjectAttachmentClient.ListRuntimeProjectAttachments (All)
- RuntimeProjectAttachmentClient.LookupRuntimeProjectAttachment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type 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.
type 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 }
Output:
func (*ApiHubDependenciesClient) CancelOperation ¶
func (c *ApiHubDependenciesClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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. } }
Output:
func (*ApiHubDependenciesClient) Close ¶
func (c *ApiHubDependenciesClient) Close() error
Close 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.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*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 }
Output:
func (*ApiHubDependenciesClient) DeleteDependency ¶
func (c *ApiHubDependenciesClient) DeleteDependency(ctx context.Context, req *apihubpb.DeleteDependencyRequest, opts ...gax.CallOption) error
DeleteDependency 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. } }
Output:
func (*ApiHubDependenciesClient) DeleteOperation ¶
func (c *ApiHubDependenciesClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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. } }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
func (*ApiHubDependenciesClient) ListDependencies ¶
func (c *ApiHubDependenciesClient) ListDependencies(ctx context.Context, req *apihubpb.ListDependenciesRequest, opts ...gax.CallOption) *DependencyIterator
ListDependencies list dependencies based on the provided filter and pagination parameters.
Example ¶
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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
func (*ApiHubDependenciesClient) ListLocations ¶
func (c *ApiHubDependenciesClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Example ¶
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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
func (*ApiHubDependenciesClient) ListOperations ¶
func (c *ApiHubDependenciesClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
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 }
Output:
type ApiHubPluginCallOptions ¶
type ApiHubPluginCallOptions struct { GetPlugin []gax.CallOption EnablePlugin []gax.CallOption DisablePlugin []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.
type ApiHubPluginClient ¶
type ApiHubPluginClient struct { // The call options for this service. CallOptions *ApiHubPluginCallOptions // 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 }
Output:
func (*ApiHubPluginClient) CancelOperation ¶
func (c *ApiHubPluginClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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. } }
Output:
func (*ApiHubPluginClient) Close ¶
func (c *ApiHubPluginClient) Close() error
Close 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.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ApiHubPluginClient) DeleteOperation ¶
func (c *ApiHubPluginClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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. } }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
func (*ApiHubPluginClient) GetPlugin ¶
func (c *ApiHubPluginClient) GetPlugin(ctx context.Context, req *apihubpb.GetPluginRequest, opts ...gax.CallOption) (*apihubpb.Plugin, error)
GetPlugin get details about 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 }
Output:
func (*ApiHubPluginClient) ListLocations ¶
func (c *ApiHubPluginClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Example ¶
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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
func (*ApiHubPluginClient) ListOperations ¶
func (c *ApiHubPluginClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
type 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 ¶
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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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 ¶
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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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 GetApiOperation []gax.CallOption ListApiOperations []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.
type 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 }
Output:
func (*Client) CancelOperation ¶
func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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. } }
Output:
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.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*Client) 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 }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
func (*Client) DeleteApi ¶
func (c *Client) DeleteApi(ctx context.Context, req *apihubpb.DeleteApiRequest, opts ...gax.CallOption) error
DeleteApi 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. } }
Output:
func (*Client) DeleteAttribute ¶
func (c *Client) DeleteAttribute(ctx context.Context, req *apihubpb.DeleteAttributeRequest, opts ...gax.CallOption) error
DeleteAttribute 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. } }
Output:
func (*Client) DeleteDeployment ¶
func (c *Client) DeleteDeployment(ctx context.Context, req *apihubpb.DeleteDeploymentRequest, opts ...gax.CallOption) error
DeleteDeployment 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. } }
Output:
func (*Client) DeleteExternalApi ¶
func (c *Client) DeleteExternalApi(ctx context.Context, req *apihubpb.DeleteExternalApiRequest, opts ...gax.CallOption) error
DeleteExternalApi 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. } }
Output:
func (*Client) DeleteOperation ¶
func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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. } }
Output:
func (*Client) DeleteSpec ¶
func (c *Client) DeleteSpec(ctx context.Context, req *apihubpb.DeleteSpecRequest, opts ...gax.CallOption) error
DeleteSpec 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. } }
Output:
func (*Client) DeleteVersion ¶
func (c *Client) DeleteVersion(ctx context.Context, req *apihubpb.DeleteVersionRequest, opts ...gax.CallOption) error
DeleteVersion 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. } }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
func (*Client) GetLocation ¶
func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Example ¶
package main import ( "context" 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 }
Output:
func (*Client) GetOperation ¶
func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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 }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
func (*Client) ListApiOperations ¶
func (c *Client) ListApiOperations(ctx context.Context, req *apihubpb.ListApiOperationsRequest, opts ...gax.CallOption) *ApiOperationIterator
ListApiOperations list operations in an API version.
Example ¶
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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListApis ¶
func (c *Client) ListApis(ctx context.Context, req *apihubpb.ListApisRequest, opts ...gax.CallOption) *ApiIterator
ListApis list API resources in the API hub.
Example ¶
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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListAttributes ¶
func (c *Client) ListAttributes(ctx context.Context, req *apihubpb.ListAttributesRequest, opts ...gax.CallOption) *AttributeIterator
ListAttributes list all attributes.
Example ¶
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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListDeployments ¶
func (c *Client) ListDeployments(ctx context.Context, req *apihubpb.ListDeploymentsRequest, opts ...gax.CallOption) *DeploymentIterator
ListDeployments list deployment resources in the API hub.
Example ¶
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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListExternalApis ¶
func (c *Client) ListExternalApis(ctx context.Context, req *apihubpb.ListExternalApisRequest, opts ...gax.CallOption) *ExternalApiIterator
ListExternalApis list External API resources in the API hub.
Example ¶
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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListLocations ¶
func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Example ¶
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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListOperations ¶
func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListSpecs ¶
func (c *Client) ListSpecs(ctx context.Context, req *apihubpb.ListSpecsRequest, opts ...gax.CallOption) *SpecIterator
ListSpecs list specs corresponding to a particular API resource.
Example ¶
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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListVersions ¶
func (c *Client) ListVersions(ctx context.Context, req *apihubpb.ListVersionsRequest, opts ...gax.CallOption) *VersionIterator
ListVersions list API versions of 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" "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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) SearchResources ¶
func (c *Client) SearchResources(ctx context.Context, req *apihubpb.SearchResourcesRequest, opts ...gax.CallOption) *SearchResultIterator
SearchResources search across API-Hub resources.
Example ¶
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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
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 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 }
Output:
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 }
Output:
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
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 }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
type CreateApiHubInstanceOperation ¶
type CreateApiHubInstanceOperation struct {
// contains filtered or unexported fields
}
CreateApiHubInstanceOperation manages a long-running operation from CreateApiHubInstance.
func (*CreateApiHubInstanceOperation) Done ¶
func (op *CreateApiHubInstanceOperation) Done() bool
Done 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() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*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.
type 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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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.
type 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 }
Output:
func (*HostProjectRegistrationClient) CancelOperation ¶
func (c *HostProjectRegistrationClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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. } }
Output:
func (*HostProjectRegistrationClient) Close ¶
func (c *HostProjectRegistrationClient) Close() error
Close 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.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*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 }
Output:
func (*HostProjectRegistrationClient) DeleteOperation ¶
func (c *HostProjectRegistrationClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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. } }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
func (*HostProjectRegistrationClient) ListHostProjectRegistrations ¶
func (c *HostProjectRegistrationClient) ListHostProjectRegistrations(ctx context.Context, req *apihubpb.ListHostProjectRegistrationsRequest, opts ...gax.CallOption) *HostProjectRegistrationIterator
ListHostProjectRegistrations lists host project registrations.
Example ¶
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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
func (*HostProjectRegistrationClient) ListLocations ¶
func (c *HostProjectRegistrationClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Example ¶
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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
func (*HostProjectRegistrationClient) ListOperations ¶
func (c *HostProjectRegistrationClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
type 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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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.
type 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 }
Output:
func (*LintingClient) CancelOperation ¶
func (c *LintingClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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. } }
Output:
func (*LintingClient) Close ¶
func (c *LintingClient) Close() error
Close 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.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*LintingClient) DeleteOperation ¶
func (c *LintingClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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. } }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
func (*LintingClient) LintSpec ¶
func (c *LintingClient) LintSpec(ctx context.Context, req *apihubpb.LintSpecRequest, opts ...gax.CallOption) error
LintSpec 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. } }
Output:
func (*LintingClient) ListLocations ¶
func (c *LintingClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Example ¶
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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
func (*LintingClient) ListOperations ¶
func (c *LintingClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
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 }
Output:
type LocationIterator ¶
type LocationIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error) // contains filtered or unexported fields }
LocationIterator manages a stream of *locationpb.Location.
func (*LocationIterator) All ¶
func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*LocationIterator) Next ¶
func (it *LocationIterator) Next() (*locationpb.Location, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*LocationIterator) PageInfo ¶
func (it *LocationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type OperationIterator ¶
type OperationIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error) // contains filtered or unexported fields }
OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) All ¶
func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*OperationIterator) Next ¶
func (it *OperationIterator) Next() (*longrunningpb.Operation, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo ¶
func (it *OperationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ProvisioningCallOptions ¶
type ProvisioningCallOptions struct { CreateApiHubInstance []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.
type 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 }
Output:
func (*ProvisioningClient) CancelOperation ¶
func (c *ProvisioningClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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. } }
Output:
func (*ProvisioningClient) Close ¶
func (c *ProvisioningClient) Close() error
Close 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.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*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 }
Output:
func (*ProvisioningClient) CreateApiHubInstanceOperation ¶
func (c *ProvisioningClient) CreateApiHubInstanceOperation(name string) *CreateApiHubInstanceOperation
CreateApiHubInstanceOperation 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) DeleteOperation ¶
func (c *ProvisioningClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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. } }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
func (*ProvisioningClient) ListLocations ¶
func (c *ProvisioningClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Example ¶
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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
func (*ProvisioningClient) ListOperations ¶
func (c *ProvisioningClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
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 }
Output:
type 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.
type 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 }
Output:
func (*RuntimeProjectAttachmentClient) CancelOperation ¶
func (c *RuntimeProjectAttachmentClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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. } }
Output:
func (*RuntimeProjectAttachmentClient) Close ¶
func (c *RuntimeProjectAttachmentClient) Close() error
Close 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.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*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 }
Output:
func (*RuntimeProjectAttachmentClient) DeleteOperation ¶
func (c *RuntimeProjectAttachmentClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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. } }
Output:
func (*RuntimeProjectAttachmentClient) DeleteRuntimeProjectAttachment ¶
func (c *RuntimeProjectAttachmentClient) DeleteRuntimeProjectAttachment(ctx context.Context, req *apihubpb.DeleteRuntimeProjectAttachmentRequest, opts ...gax.CallOption) error
DeleteRuntimeProjectAttachment 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. } }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
func (*RuntimeProjectAttachmentClient) ListLocations ¶
func (c *RuntimeProjectAttachmentClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Example ¶
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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
func (*RuntimeProjectAttachmentClient) ListOperations ¶
func (c *RuntimeProjectAttachmentClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" 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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
func (*RuntimeProjectAttachmentClient) ListRuntimeProjectAttachments ¶
func (c *RuntimeProjectAttachmentClient) ListRuntimeProjectAttachments(ctx context.Context, req *apihubpb.ListRuntimeProjectAttachmentsRequest, opts ...gax.CallOption) *RuntimeProjectAttachmentIterator
ListRuntimeProjectAttachments list runtime projects attached to the host project.
Example ¶
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) } }
Output:
Example (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. } // TODO: Use resp. _ = resp } }
Output:
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 }
Output:
type 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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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 ¶
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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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 ¶
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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.