Documentation
¶
Overview ¶
Package subscriptions is an auto-generated package for the Google Workspace Events API.
The Google Workspace Events API lets you subscribe to events and manage change notifications across Google Workspace applications.
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://pkgo.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage ¶
To get started with this package, create a client.
// go get cloud.google.com/go/apps/events/subscriptions/apiv1@latest ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkgo.dev/cloud.google.com/go#hdr-Client_Options c, err := subscriptions.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client ¶
The following is an example of making an API call with the newly created client, mentioned above.
req := &subscriptionspb.CreateSubscriptionRequest{ // TODO: Fill request struct fields. // See https://pkgo.dev/cloud.google.com/go/apps/events/subscriptions/apiv1/subscriptionspb#CreateSubscriptionRequest. } op, err := c.CreateSubscription(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context ¶
The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Index ¶
- func DefaultAuthScopes() []string
- type CallOptions
- type Client
- func (c *Client) Close() error
- func (c *Client) Connection() *grpc.ClientConndeprecated
- func (c *Client) CreateSubscription(ctx context.Context, req *subscriptionspb.CreateSubscriptionRequest, ...) (*CreateSubscriptionOperation, error)
- func (c *Client) CreateSubscriptionOperation(name string) *CreateSubscriptionOperation
- func (c *Client) DeleteSubscription(ctx context.Context, req *subscriptionspb.DeleteSubscriptionRequest, ...) (*DeleteSubscriptionOperation, error)
- func (c *Client) DeleteSubscriptionOperation(name string) *DeleteSubscriptionOperation
- func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *Client) GetSubscription(ctx context.Context, req *subscriptionspb.GetSubscriptionRequest, ...) (*subscriptionspb.Subscription, error)
- func (c *Client) ListSubscriptions(ctx context.Context, req *subscriptionspb.ListSubscriptionsRequest, ...) *SubscriptionIterator
- func (c *Client) ReactivateSubscription(ctx context.Context, req *subscriptionspb.ReactivateSubscriptionRequest, ...) (*ReactivateSubscriptionOperation, error)
- func (c *Client) ReactivateSubscriptionOperation(name string) *ReactivateSubscriptionOperation
- func (c *Client) UpdateSubscription(ctx context.Context, req *subscriptionspb.UpdateSubscriptionRequest, ...) (*UpdateSubscriptionOperation, error)
- func (c *Client) UpdateSubscriptionOperation(name string) *UpdateSubscriptionOperation
- type CreateSubscriptionOperation
- func (op *CreateSubscriptionOperation) Done() bool
- func (op *CreateSubscriptionOperation) Metadata() (*subscriptionspb.CreateSubscriptionMetadata, error)
- func (op *CreateSubscriptionOperation) Name() string
- func (op *CreateSubscriptionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*subscriptionspb.Subscription, error)
- func (op *CreateSubscriptionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*subscriptionspb.Subscription, error)
- type DeleteSubscriptionOperation
- func (op *DeleteSubscriptionOperation) Done() bool
- func (op *DeleteSubscriptionOperation) Metadata() (*subscriptionspb.DeleteSubscriptionMetadata, error)
- func (op *DeleteSubscriptionOperation) Name() string
- func (op *DeleteSubscriptionOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteSubscriptionOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type ReactivateSubscriptionOperation
- func (op *ReactivateSubscriptionOperation) Done() bool
- func (op *ReactivateSubscriptionOperation) Metadata() (*subscriptionspb.ReactivateSubscriptionMetadata, error)
- func (op *ReactivateSubscriptionOperation) Name() string
- func (op *ReactivateSubscriptionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*subscriptionspb.Subscription, error)
- func (op *ReactivateSubscriptionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*subscriptionspb.Subscription, error)
- type SubscriptionIterator
- type UpdateSubscriptionOperation
- func (op *UpdateSubscriptionOperation) Done() bool
- func (op *UpdateSubscriptionOperation) Metadata() (*subscriptionspb.UpdateSubscriptionMetadata, error)
- func (op *UpdateSubscriptionOperation) Name() string
- func (op *UpdateSubscriptionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*subscriptionspb.Subscription, error)
- func (op *UpdateSubscriptionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*subscriptionspb.Subscription, error)
Examples ¶
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 CallOptions ¶
type CallOptions struct { CreateSubscription []gax.CallOption DeleteSubscription []gax.CallOption GetSubscription []gax.CallOption ListSubscriptions []gax.CallOption UpdateSubscription []gax.CallOption ReactivateSubscription []gax.CallOption GetOperation []gax.CallOption }
CallOptions contains the retry settings for each method of Client.
type Client ¶
type Client struct { // The call options for this service. CallOptions *CallOptions // LROClient is used internally to handle long-running operations. // It is exposed so that its CallOptions can be modified if required. // Users should not Close this client. LROClient *lroauto.OperationsClient // contains filtered or unexported fields }
Client is a client for interacting with Google Workspace Events API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
A service that manages subscriptions to Google Workspace events.
func NewClient ¶
NewClient creates a new subscriptions service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
A service that manages subscriptions to Google Workspace events.
Example ¶
package main import ( "context" subscriptions "cloud.google.com/go/apps/events/subscriptions/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://pkgo.dev/cloud.google.com/go#hdr-Client_Options c, err := subscriptions.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewRESTClient ¶
NewRESTClient creates a new subscriptions service rest client.
A service that manages subscriptions to Google Workspace events.
Example ¶
package main import ( "context" subscriptions "cloud.google.com/go/apps/events/subscriptions/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://pkgo.dev/cloud.google.com/go#hdr-Client_Options c, err := subscriptions.NewRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
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) CreateSubscription ¶
func (c *Client) CreateSubscription(ctx context.Context, req *subscriptionspb.CreateSubscriptionRequest, opts ...gax.CallOption) (*CreateSubscriptionOperation, error)
CreateSubscription creates a Google Workspace subscription. To learn how to use this method, see Create a Google Workspace subscription (at https://developers.google.com/workspace/events/guides/create-subscription).
Example ¶
package main import ( "context" subscriptions "cloud.google.com/go/apps/events/subscriptions/apiv1" subscriptionspb "cloud.google.com/go/apps/events/subscriptions/apiv1/subscriptionspb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkgo.dev/cloud.google.com/go#hdr-Client_Options c, err := subscriptions.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &subscriptionspb.CreateSubscriptionRequest{ // TODO: Fill request struct fields. // See https://pkgo.dev/cloud.google.com/go/apps/events/subscriptions/apiv1/subscriptionspb#CreateSubscriptionRequest. } op, err := c.CreateSubscription(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) CreateSubscriptionOperation ¶
func (c *Client) CreateSubscriptionOperation(name string) *CreateSubscriptionOperation
CreateSubscriptionOperation returns a new CreateSubscriptionOperation from a given name. The name must be that of a previously created CreateSubscriptionOperation, possibly from a different process.
func (*Client) DeleteSubscription ¶
func (c *Client) DeleteSubscription(ctx context.Context, req *subscriptionspb.DeleteSubscriptionRequest, opts ...gax.CallOption) (*DeleteSubscriptionOperation, error)
DeleteSubscription deletes a Google Workspace subscription. To learn how to use this method, see Delete a Google Workspace subscription (at https://developers.google.com/workspace/events/guides/delete-subscription).
Example ¶
package main import ( "context" subscriptions "cloud.google.com/go/apps/events/subscriptions/apiv1" subscriptionspb "cloud.google.com/go/apps/events/subscriptions/apiv1/subscriptionspb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkgo.dev/cloud.google.com/go#hdr-Client_Options c, err := subscriptions.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &subscriptionspb.DeleteSubscriptionRequest{ // TODO: Fill request struct fields. // See https://pkgo.dev/cloud.google.com/go/apps/events/subscriptions/apiv1/subscriptionspb#DeleteSubscriptionRequest. } op, err := c.DeleteSubscription(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) DeleteSubscriptionOperation ¶
func (c *Client) DeleteSubscriptionOperation(name string) *DeleteSubscriptionOperation
DeleteSubscriptionOperation returns a new DeleteSubscriptionOperation from a given name. The name must be that of a previously created DeleteSubscriptionOperation, possibly from a different process.
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" subscriptions "cloud.google.com/go/apps/events/subscriptions/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://pkgo.dev/cloud.google.com/go#hdr-Client_Options c, err := subscriptions.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.GetOperationRequest{ // TODO: Fill request struct fields. // See https://pkgo.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) GetSubscription ¶
func (c *Client) GetSubscription(ctx context.Context, req *subscriptionspb.GetSubscriptionRequest, opts ...gax.CallOption) (*subscriptionspb.Subscription, error)
GetSubscription gets details about a Google Workspace subscription. To learn how to use this method, see Get details about a Google Workspace subscription (at https://developers.google.com/workspace/events/guides/get-subscription).
Example ¶
package main import ( "context" subscriptions "cloud.google.com/go/apps/events/subscriptions/apiv1" subscriptionspb "cloud.google.com/go/apps/events/subscriptions/apiv1/subscriptionspb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkgo.dev/cloud.google.com/go#hdr-Client_Options c, err := subscriptions.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &subscriptionspb.GetSubscriptionRequest{ // TODO: Fill request struct fields. // See https://pkgo.dev/cloud.google.com/go/apps/events/subscriptions/apiv1/subscriptionspb#GetSubscriptionRequest. } resp, err := c.GetSubscription(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) ListSubscriptions ¶
func (c *Client) ListSubscriptions(ctx context.Context, req *subscriptionspb.ListSubscriptionsRequest, opts ...gax.CallOption) *SubscriptionIterator
ListSubscriptions lists Google Workspace subscriptions. To learn how to use this method, see List Google Workspace subscriptions (at https://developers.google.com/workspace/events/guides/list-subscriptions).
Example ¶
package main import ( "context" subscriptions "cloud.google.com/go/apps/events/subscriptions/apiv1" subscriptionspb "cloud.google.com/go/apps/events/subscriptions/apiv1/subscriptionspb" "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://pkgo.dev/cloud.google.com/go#hdr-Client_Options c, err := subscriptions.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &subscriptionspb.ListSubscriptionsRequest{ // TODO: Fill request struct fields. // See https://pkgo.dev/cloud.google.com/go/apps/events/subscriptions/apiv1/subscriptionspb#ListSubscriptionsRequest. } it := c.ListSubscriptions(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.(*subscriptionspb.ListSubscriptionsResponse) } }
Output:
Example (All) ¶
package main import ( "context" subscriptions "cloud.google.com/go/apps/events/subscriptions/apiv1" subscriptionspb "cloud.google.com/go/apps/events/subscriptions/apiv1/subscriptionspb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkgo.dev/cloud.google.com/go#hdr-Client_Options c, err := subscriptions.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &subscriptionspb.ListSubscriptionsRequest{ // TODO: Fill request struct fields. // See https://pkgo.dev/cloud.google.com/go/apps/events/subscriptions/apiv1/subscriptionspb#ListSubscriptionsRequest. } for resp, err := range c.ListSubscriptions(ctx, req).All() { if err != nil { // TODO: Handle error and break/return/continue. Iteration will stop after any error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ReactivateSubscription ¶
func (c *Client) ReactivateSubscription(ctx context.Context, req *subscriptionspb.ReactivateSubscriptionRequest, opts ...gax.CallOption) (*ReactivateSubscriptionOperation, error)
ReactivateSubscription reactivates a suspended Google Workspace subscription.
This method resets your subscription’s State field to ACTIVE. Before you use this method, you must fix the error that suspended the subscription. To learn how to use this method, see Reactivate a Google Workspace subscription (at https://developers.google.com/workspace/events/guides/reactivate-subscription).
Example ¶
package main import ( "context" subscriptions "cloud.google.com/go/apps/events/subscriptions/apiv1" subscriptionspb "cloud.google.com/go/apps/events/subscriptions/apiv1/subscriptionspb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkgo.dev/cloud.google.com/go#hdr-Client_Options c, err := subscriptions.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &subscriptionspb.ReactivateSubscriptionRequest{ // TODO: Fill request struct fields. // See https://pkgo.dev/cloud.google.com/go/apps/events/subscriptions/apiv1/subscriptionspb#ReactivateSubscriptionRequest. } op, err := c.ReactivateSubscription(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) ReactivateSubscriptionOperation ¶
func (c *Client) ReactivateSubscriptionOperation(name string) *ReactivateSubscriptionOperation
ReactivateSubscriptionOperation returns a new ReactivateSubscriptionOperation from a given name. The name must be that of a previously created ReactivateSubscriptionOperation, possibly from a different process.
func (*Client) UpdateSubscription ¶
func (c *Client) UpdateSubscription(ctx context.Context, req *subscriptionspb.UpdateSubscriptionRequest, opts ...gax.CallOption) (*UpdateSubscriptionOperation, error)
UpdateSubscription updates or renews a Google Workspace subscription. To learn how to use this method, see Update or renew a Google Workspace subscription (at https://developers.google.com/workspace/events/guides/update-subscription).
Example ¶
package main import ( "context" subscriptions "cloud.google.com/go/apps/events/subscriptions/apiv1" subscriptionspb "cloud.google.com/go/apps/events/subscriptions/apiv1/subscriptionspb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkgo.dev/cloud.google.com/go#hdr-Client_Options c, err := subscriptions.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &subscriptionspb.UpdateSubscriptionRequest{ // TODO: Fill request struct fields. // See https://pkgo.dev/cloud.google.com/go/apps/events/subscriptions/apiv1/subscriptionspb#UpdateSubscriptionRequest. } op, err := c.UpdateSubscription(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateSubscriptionOperation ¶
func (c *Client) UpdateSubscriptionOperation(name string) *UpdateSubscriptionOperation
UpdateSubscriptionOperation returns a new UpdateSubscriptionOperation from a given name. The name must be that of a previously created UpdateSubscriptionOperation, possibly from a different process.
type CreateSubscriptionOperation ¶
type CreateSubscriptionOperation struct {
// contains filtered or unexported fields
}
CreateSubscriptionOperation manages a long-running operation from CreateSubscription.
func (*CreateSubscriptionOperation) Done ¶
func (op *CreateSubscriptionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateSubscriptionOperation) Metadata ¶
func (op *CreateSubscriptionOperation) Metadata() (*subscriptionspb.CreateSubscriptionMetadata, 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 (*CreateSubscriptionOperation) Name ¶
func (op *CreateSubscriptionOperation) 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 (*CreateSubscriptionOperation) Poll ¶
func (op *CreateSubscriptionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*subscriptionspb.Subscription, 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 (*CreateSubscriptionOperation) Wait ¶
func (op *CreateSubscriptionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*subscriptionspb.Subscription, 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 DeleteSubscriptionOperation ¶
type DeleteSubscriptionOperation struct {
// contains filtered or unexported fields
}
DeleteSubscriptionOperation manages a long-running operation from DeleteSubscription.
func (*DeleteSubscriptionOperation) Done ¶
func (op *DeleteSubscriptionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteSubscriptionOperation) Metadata ¶
func (op *DeleteSubscriptionOperation) Metadata() (*subscriptionspb.DeleteSubscriptionMetadata, 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 (*DeleteSubscriptionOperation) Name ¶
func (op *DeleteSubscriptionOperation) 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 (*DeleteSubscriptionOperation) Poll ¶
func (op *DeleteSubscriptionOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteSubscriptionOperation) Wait ¶
func (op *DeleteSubscriptionOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type ReactivateSubscriptionOperation ¶
type ReactivateSubscriptionOperation struct {
// contains filtered or unexported fields
}
ReactivateSubscriptionOperation manages a long-running operation from ReactivateSubscription.
func (*ReactivateSubscriptionOperation) Done ¶
func (op *ReactivateSubscriptionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*ReactivateSubscriptionOperation) Metadata ¶
func (op *ReactivateSubscriptionOperation) Metadata() (*subscriptionspb.ReactivateSubscriptionMetadata, 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 (*ReactivateSubscriptionOperation) Name ¶
func (op *ReactivateSubscriptionOperation) 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 (*ReactivateSubscriptionOperation) Poll ¶
func (op *ReactivateSubscriptionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*subscriptionspb.Subscription, 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 (*ReactivateSubscriptionOperation) Wait ¶
func (op *ReactivateSubscriptionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*subscriptionspb.Subscription, 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 SubscriptionIterator ¶
type SubscriptionIterator 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 []*subscriptionspb.Subscription, nextPageToken string, err error) // contains filtered or unexported fields }
SubscriptionIterator manages a stream of *subscriptionspb.Subscription.
func (*SubscriptionIterator) All ¶ added in v0.5.1
func (it *SubscriptionIterator) All() iter.Seq2[*subscriptionspb.Subscription, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SubscriptionIterator) Next ¶
func (it *SubscriptionIterator) Next() (*subscriptionspb.Subscription, 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 (*SubscriptionIterator) PageInfo ¶
func (it *SubscriptionIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type UpdateSubscriptionOperation ¶
type UpdateSubscriptionOperation struct {
// contains filtered or unexported fields
}
UpdateSubscriptionOperation manages a long-running operation from UpdateSubscription.
func (*UpdateSubscriptionOperation) Done ¶
func (op *UpdateSubscriptionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateSubscriptionOperation) Metadata ¶
func (op *UpdateSubscriptionOperation) Metadata() (*subscriptionspb.UpdateSubscriptionMetadata, 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 (*UpdateSubscriptionOperation) Name ¶
func (op *UpdateSubscriptionOperation) 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 (*UpdateSubscriptionOperation) Poll ¶
func (op *UpdateSubscriptionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*subscriptionspb.Subscription, 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 (*UpdateSubscriptionOperation) Wait ¶
func (op *UpdateSubscriptionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*subscriptionspb.Subscription, 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.