Cloud Channel API v1 - Package cloud.google.com/go/channel/apiv1 (v1.20.0)

Package channel is an auto-generated package for the Cloud Channel API.

The Cloud Channel API enables Google Cloud partners to have a single unified resale platform and APIs across all of Google Cloud including GCP, Workspace, Maps and Chrome.

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:

Example usage

To get started with this package, create a client.

// go get cloud.google.com/go/channel/apiv1@latest
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := channel.NewCloudChannelReportsClient(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 := &channelpb.FetchReportResultsRequest{
    // TODO: Fill request struct fields.
    // See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#FetchReportResultsRequest.
}
it := c.FetchReportResults(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.(*channelpb.FetchReportResultsResponse)
}

Use of Context

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

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

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

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

ActivateEntitlementOperation

type ActivateEntitlementOperation struct {
	// contains filtered or unexported fields
}

ActivateEntitlementOperation manages a long-running operation from ActivateEntitlement.

func (*ActivateEntitlementOperation) Done

Done reports whether the long-running operation has completed.

func (*ActivateEntitlementOperation) Metadata

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

func (*ActivateEntitlementOperation) Name

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

func (*ActivateEntitlementOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*ActivateEntitlementOperation) Wait

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

See documentation of Poll for error-handling information.

BillableSkuIterator

type BillableSkuIterator 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 []*channelpb.BillableSku, nextPageToken string, err error)
	// contains filtered or unexported fields
}

BillableSkuIterator manages a stream of *channelpb.BillableSku.

func (*BillableSkuIterator) All

func (it *BillableSkuIterator) All() iter.Seq2[*channelpb.BillableSku, error]

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

func (*BillableSkuIterator) Next

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 (*BillableSkuIterator) PageInfo

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

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

CancelEntitlementOperation

type CancelEntitlementOperation struct {
	// contains filtered or unexported fields
}

CancelEntitlementOperation manages a long-running operation from CancelEntitlement.

func (*CancelEntitlementOperation) Done

func (op *CancelEntitlementOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*CancelEntitlementOperation) Metadata

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

func (*CancelEntitlementOperation) Name

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

func (*CancelEntitlementOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*CancelEntitlementOperation) Wait

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

See documentation of Poll for error-handling information.

ChangeOfferOperation

type ChangeOfferOperation struct {
	// contains filtered or unexported fields
}

ChangeOfferOperation manages a long-running operation from ChangeOffer.

func (*ChangeOfferOperation) Done

func (op *ChangeOfferOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*ChangeOfferOperation) Metadata

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

func (*ChangeOfferOperation) Name

func (op *ChangeOfferOperation) 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 (*ChangeOfferOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*ChangeOfferOperation) Wait

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

See documentation of Poll for error-handling information.

ChangeParametersOperation

type ChangeParametersOperation struct {
	// contains filtered or unexported fields
}

ChangeParametersOperation manages a long-running operation from ChangeParameters.

func (*ChangeParametersOperation) Done

func (op *ChangeParametersOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*ChangeParametersOperation) Metadata

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

func (*ChangeParametersOperation) Name

func (op *ChangeParametersOperation) 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 (*ChangeParametersOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*ChangeParametersOperation) Wait

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

See documentation of Poll for error-handling information.

ChangeRenewalSettingsOperation

type ChangeRenewalSettingsOperation struct {
	// contains filtered or unexported fields
}

ChangeRenewalSettingsOperation manages a long-running operation from ChangeRenewalSettings.

func (*ChangeRenewalSettingsOperation) Done

Done reports whether the long-running operation has completed.

func (*ChangeRenewalSettingsOperation) Metadata

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

func (*ChangeRenewalSettingsOperation) Name

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

func (*ChangeRenewalSettingsOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*ChangeRenewalSettingsOperation) Wait

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

See documentation of Poll for error-handling information.

ChannelPartnerLinkIterator

type ChannelPartnerLinkIterator 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 []*channelpb.ChannelPartnerLink, nextPageToken string, err error)
	// contains filtered or unexported fields
}

ChannelPartnerLinkIterator manages a stream of *channelpb.ChannelPartnerLink.

func (*ChannelPartnerLinkIterator) All

func (it *ChannelPartnerLinkIterator) All() iter.Seq2[*channelpb.ChannelPartnerLink, error]

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

func (*ChannelPartnerLinkIterator) Next

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 (*ChannelPartnerLinkIterator) PageInfo

func (it *