Package commerceproducer is an auto-generated package for the Cloud Commerce Producer API.
Partner API for the Cloud Commerce Producer API Early Access.
NOTE: This package is in beta. It is not stable, and may be subject to changes.
General documentation
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
// go get cloud.google.com/go/commerceproducer/apiv1beta@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 := commerceproducer.NewCommerceTransactionClient(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 := &commerceproducerpb.CancelPrivateOfferRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#CancelPrivateOfferRequest. } resp, err := c.CancelPrivateOffer(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context
The ctx passed to NewCommerceTransactionClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []stringDefaultAuthScopes reports the default set of authentication scopes to use with this package.
CommerceTransactionCallOptions
type CommerceTransactionCallOptions struct {
ListServices []gax.CallOption
GetService []gax.CallOption
ListPrivateOffers []gax.CallOption
GetPrivateOffer []gax.CallOption
ResolveAmendmentTarget []gax.CallOption
CreatePrivateOffer []gax.CallOption
UpdatePrivateOffer []gax.CallOption
PublishPrivateOffer []gax.CallOption
CancelPrivateOffer []gax.CallOption
DeletePrivateOffer []gax.CallOption
ListPrivateOfferDocuments []gax.CallOption
GetPrivateOfferDocument []gax.CallOption
CreatePrivateOfferDocument []gax.CallOption
UpdatePrivateOfferDocument []gax.CallOption
DeletePrivateOfferDocument []gax.CallOption
ListStandardOffers []gax.CallOption
GetStandardOffer []gax.CallOption
GetSku []gax.CallOption
ListSkus []gax.CallOption
GetSkuGroup []gax.CallOption
ListSkuGroups []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}CommerceTransactionCallOptions contains the retry settings for each method of CommerceTransactionClient.
CommerceTransactionClient
type CommerceTransactionClient struct {
// The call options for this service.
CallOptions *CommerceTransactionCallOptions
// contains filtered or unexported fields
}CommerceTransactionClient is a client for interacting with Cloud Commerce Producer API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
APIs related to managing resources that model commercial transactions.
func NewCommerceTransactionClient
func NewCommerceTransactionClient(ctx context.Context, opts ...option.ClientOption) (*CommerceTransactionClient, error)NewCommerceTransactionClient creates a new commerce transaction client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
APIs related to managing resources that model commercial transactions.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewCommerceTransactionRESTClient
func NewCommerceTransactionRESTClient(ctx context.Context, opts ...option.ClientOption) (*CommerceTransactionClient, error)NewCommerceTransactionRESTClient creates a new commerce transaction rest client.
APIs related to managing resources that model commercial transactions.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*CommerceTransactionClient) CancelOperation
func (c *CommerceTransactionClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
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 := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*CommerceTransactionClient) CancelPrivateOffer
func (c *CommerceTransactionClient) CancelPrivateOffer(ctx context.Context, req *commerceproducerpb.CancelPrivateOfferRequest, opts ...gax.CallOption) (*commerceproducerpb.PrivateOffer, error)CancelPrivateOffer cancels the target PrivateOffer.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.CancelPrivateOfferRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#CancelPrivateOfferRequest.
}
resp, err := c.CancelPrivateOffer(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*CommerceTransactionClient) Close
func (c *CommerceTransactionClient) Close() errorClose closes the connection to the API service. Always call Close() when the client is no longer required.
func (*CommerceTransactionClient) Connection (deprecated)
func (c *CommerceTransactionClient) Connection() *grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*CommerceTransactionClient) CreatePrivateOffer
func (c *CommerceTransactionClient) CreatePrivateOffer(ctx context.Context, req *commerceproducerpb.CreatePrivateOfferRequest, opts ...gax.CallOption) (*commerceproducerpb.PrivateOffer, error)CreatePrivateOffer creates a new PrivateOffer in a given project and location.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.CreatePrivateOfferRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#CreatePrivateOfferRequest.
}
resp, err := c.CreatePrivateOffer(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*CommerceTransactionClient) CreatePrivateOfferDocument
func (c *CommerceTransactionClient) CreatePrivateOfferDocument(ctx context.Context, req *commerceproducerpb.CreatePrivateOfferDocumentRequest, opts ...gax.CallOption) (*commerceproducerpb.PrivateOfferDocument, error)CreatePrivateOfferDocument creates a new PrivateOfferDocument in a given project and location.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.CreatePrivateOfferDocumentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#CreatePrivateOfferDocumentRequest.
}
resp, err := c.CreatePrivateOfferDocument(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*CommerceTransactionClient) DeleteOperation
func (c *CommerceTransactionClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
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 := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*CommerceTransactionClient) DeletePrivateOffer
func (c *CommerceTransactionClient) DeletePrivateOffer(ctx context.Context, req *commerceproducerpb.DeletePrivateOfferRequest, opts ...gax.CallOption) errorDeletePrivateOffer deletes the target PrivateOffer.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.DeletePrivateOfferRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#DeletePrivateOfferRequest.
}
err = c.DeletePrivateOffer(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*CommerceTransactionClient) DeletePrivateOfferDocument
func (c *CommerceTransactionClient) DeletePrivateOfferDocument(ctx context.Context, req *commerceproducerpb.DeletePrivateOfferDocumentRequest, opts ...gax.CallOption) errorDeletePrivateOfferDocument deletes the target PrivateOfferDocument.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.DeletePrivateOfferDocumentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#DeletePrivateOfferDocumentRequest.
}
err = c.DeletePrivateOfferDocument(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*CommerceTransactionClient) GetLocation
func (c *CommerceTransactionClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
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 := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.GetLocationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
}
resp, err := c.GetLocation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*CommerceTransactionClient) GetOperation
func (c *CommerceTransactionClient) 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"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
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 := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*CommerceTransactionClient) GetPrivateOffer
func (c *CommerceTransactionClient) GetPrivateOffer(ctx context.Context, req *commerceproducerpb.GetPrivateOfferRequest, opts ...gax.CallOption) (*commerceproducerpb.PrivateOffer, error)GetPrivateOffer gets details of a single PrivateOffer.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.GetPrivateOfferRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#GetPrivateOfferRequest.
}
resp, err := c.GetPrivateOffer(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*CommerceTransactionClient) GetPrivateOfferDocument
func (c *CommerceTransactionClient) GetPrivateOfferDocument(ctx context.Context, req *commerceproducerpb.GetPrivateOfferDocumentRequest, opts ...gax.CallOption) (*commerceproducerpb.PrivateOfferDocument, error)GetPrivateOfferDocument gets details of a single PrivateOfferDocument.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.GetPrivateOfferDocumentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#GetPrivateOfferDocumentRequest.
}
resp, err := c.GetPrivateOfferDocument(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*CommerceTransactionClient) GetService
func (c *CommerceTransactionClient) GetService(ctx context.Context, req *commerceproducerpb.GetServiceRequest, opts ...gax.CallOption) (*commerceproducerpb.Service, error)GetService gets details of a single Service.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.GetServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#GetServiceRequest.
}
resp, err := c.GetService(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*CommerceTransactionClient) GetSku
func (c *CommerceTransactionClient) GetSku(ctx context.Context, req *commerceproducerpb.GetSkuRequest, opts ...gax.CallOption) (*commerceproducerpb.Sku, error)GetSku gets details of a single Sku.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.GetSkuRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#GetSkuRequest.
}
resp, err := c.GetSku(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*CommerceTransactionClient) GetSkuGroup
func (c *CommerceTransactionClient) GetSkuGroup(ctx context.Context, req *commerceproducerpb.GetSkuGroupRequest, opts ...gax.CallOption) (*commerceproducerpb.SkuGroup, error)GetSkuGroup gets details of a single SkuGroup.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.GetSkuGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#GetSkuGroupRequest.
}
resp, err := c.GetSkuGroup(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*CommerceTransactionClient) GetStandardOffer
func (c *CommerceTransactionClient) GetStandardOffer(ctx context.Context, req *commerceproducerpb.GetStandardOfferRequest, opts ...gax.CallOption) (*commerceproducerpb.StandardOffer, error)GetStandardOffer gets details of a single StandardOffer.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.GetStandardOfferRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#GetStandardOfferRequest.
}
resp, err := c.GetStandardOffer(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*CommerceTransactionClient) ListLocations
func (c *CommerceTransactionClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service.
This method lists locations based on the resource scope provided in the [ListLocationsRequest.name (at http://ListLocationsRequest.name)][google.cloud.location.ListLocationsRequest.name (at http://google.cloud.location.ListLocationsRequest.name)] field: * Global locations: If name is empty, the method lists the public locations available to all projects. * Project-specific locations: If name follows the format projects/{project}, the method lists locations visible to that specific project. This includes public, private, or other project-specific locations enabled for the project.
For gRPC and client library implementations, the resource name is passed as the name field. For direct service calls, the resource name is incorporated into the request path based on the specific service implementation and version.
Examples
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
"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 := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
all
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
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 := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*CommerceTransactionClient) ListOperations
func (c *CommerceTransactionClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
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 := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
all
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
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 := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*CommerceTransactionClient) ListPrivateOfferDocuments
func (c *CommerceTransactionClient) ListPrivateOfferDocuments(ctx context.Context, req *commerceproducerpb.ListPrivateOfferDocumentsRequest, opts ...gax.CallOption) *PrivateOfferDocumentIteratorListPrivateOfferDocuments lists PrivateOfferDocuments for the given parent.
Examples
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
"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 := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.ListPrivateOfferDocumentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#ListPrivateOfferDocumentsRequest.
}
it := c.ListPrivateOfferDocuments(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.(*commerceproducerpb.ListPrivateOfferDocumentsResponse)
}
}
all
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.ListPrivateOfferDocumentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#ListPrivateOfferDocumentsRequest.
}
for resp, err := range c.ListPrivateOfferDocuments(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*CommerceTransactionClient) ListPrivateOffers
func (c *CommerceTransactionClient) ListPrivateOffers(ctx context.Context, req *commerceproducerpb.ListPrivateOffersRequest, opts ...gax.CallOption) *PrivateOfferIteratorListPrivateOffers lists PrivateOffers for the given parent.
Examples
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
"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 := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.ListPrivateOffersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#ListPrivateOffersRequest.
}
it := c.ListPrivateOffers(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.(*commerceproducerpb.ListPrivateOffersResponse)
}
}
all
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.ListPrivateOffersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#ListPrivateOffersRequest.
}
for resp, err := range c.ListPrivateOffers(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*CommerceTransactionClient) ListServices
func (c *CommerceTransactionClient) ListServices(ctx context.Context, req *commerceproducerpb.ListServicesRequest, opts ...gax.CallOption) *ServiceIteratorListServices lists Services in a given project and location.
Examples
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
"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 := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.ListServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#ListServicesRequest.
}
it := c.ListServices(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*commerceproducerpb.ListServicesResponse)
}
}
all
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.ListServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#ListServicesRequest.
}
for resp, err := range c.ListServices(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*CommerceTransactionClient) ListSkuGroups
func (c *CommerceTransactionClient) ListSkuGroups(ctx context.Context, req *commerceproducerpb.ListSkuGroupsRequest, opts ...gax.CallOption) *SkuGroupIteratorListSkuGroups lists SkuGroups for the given parent.
Examples
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
"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 := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.ListSkuGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#ListSkuGroupsRequest.
}
it := c.ListSkuGroups(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.(*commerceproducerpb.ListSkuGroupsResponse)
}
}
all
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.ListSkuGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#ListSkuGroupsRequest.
}
for resp, err := range c.ListSkuGroups(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*CommerceTransactionClient) ListSkus
func (c *CommerceTransactionClient) ListSkus(ctx context.Context, req *commerceproducerpb.ListSkusRequest, opts ...gax.CallOption) *SkuIteratorListSkus lists Skus for the given parent.
Examples
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
"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 := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.ListSkusRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#ListSkusRequest.
}
it := c.ListSkus(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.(*commerceproducerpb.ListSkusResponse)
}
}
all
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.ListSkusRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#ListSkusRequest.
}
for resp, err := range c.ListSkus(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*CommerceTransactionClient) ListStandardOffers
func (c *CommerceTransactionClient) ListStandardOffers(ctx context.Context, req *commerceproducerpb.ListStandardOffersRequest, opts ...gax.CallOption) *StandardOfferIteratorListStandardOffers lists StandardOffers for the given parent.
Examples
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
"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 := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.ListStandardOffersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#ListStandardOffersRequest.
}
it := c.ListStandardOffers(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.(*commerceproducerpb.ListStandardOffersResponse)
}
}
all
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.ListStandardOffersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#ListStandardOffersRequest.
}
for resp, err := range c.ListStandardOffers(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*CommerceTransactionClient) PublishPrivateOffer
func (c *CommerceTransactionClient) PublishPrivateOffer(ctx context.Context, req *commerceproducerpb.PublishPrivateOfferRequest, opts ...gax.CallOption) (*commerceproducerpb.PrivateOffer, error)PublishPrivateOffer publishes the target PrivateOffer.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.PublishPrivateOfferRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#PublishPrivateOfferRequest.
}
resp, err := c.PublishPrivateOffer(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*CommerceTransactionClient) ResolveAmendmentTarget
func (c *CommerceTransactionClient) ResolveAmendmentTarget(ctx context.Context, req *commerceproducerpb.ResolveAmendmentTargetRequest, opts ...gax.CallOption) (*commerceproducerpb.ResolveAmendmentTargetResponse, error)ResolveAmendmentTarget resolves the existing offer that must be amended when creating a new PrivateOffer. Use this method to determine the correct amendment target before creating or publishing an offer.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.ResolveAmendmentTargetRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#ResolveAmendmentTargetRequest.
}
resp, err := c.ResolveAmendmentTarget(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*CommerceTransactionClient) UpdatePrivateOffer
func (c *CommerceTransactionClient) UpdatePrivateOffer(ctx context.Context, req *commerceproducerpb.UpdatePrivateOfferRequest, opts ...gax.CallOption) (*commerceproducerpb.PrivateOffer, error)UpdatePrivateOffer updates the target PrivateOffer.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.UpdatePrivateOfferRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#UpdatePrivateOfferRequest.
}
resp, err := c.UpdatePrivateOffer(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*CommerceTransactionClient) UpdatePrivateOfferDocument
func (c *CommerceTransactionClient) UpdatePrivateOfferDocument(ctx context.Context, req *commerceproducerpb.UpdatePrivateOfferDocumentRequest, opts ...gax.CallOption) (*commerceproducerpb.PrivateOfferDocument, error)UpdatePrivateOfferDocument updates the target PrivateOfferDocument.
Example
package main
import (
"context"
commerceproducer "cloud.google.com/go/commerceproducer/apiv1beta"
commerceproducerpb "cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := commerceproducer.NewCommerceTransactionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &commerceproducerpb.UpdatePrivateOfferDocumentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/commerceproducer/apiv1beta/commerceproducerpb#UpdatePrivateOfferDocumentRequest.
}
resp, err := c.UpdatePrivateOfferDocument(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
LocationIterator
type LocationIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error)
// contains filtered or unexported fields
}LocationIterator manages a stream of *locationpb.Location.
func (*LocationIterator) All
func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*LocationIterator) Next
func (it *LocationIterator) Next() (*locationpb.Location, error)Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*LocationIterator) PageInfo
func (it *LocationIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
OperationIterator
type OperationIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error)
// contains filtered or unexported fields
}OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) All
func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*OperationIterator) Next
func (it *OperationIterator) Next() (*longrunningpb.Operation, error)Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo
func (it *OperationIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
PrivateOfferDocumentIterator
type PrivateOfferDocumentIterator 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 []*commerceproducerpb.PrivateOfferDocument, nextPageToken string, err error)
// contains filtered or unexported fields
}PrivateOfferDocumentIterator manages a stream of *commerceproducerpb.PrivateOfferDocument.
func (*PrivateOfferDocumentIterator) All
func (it *PrivateOfferDocumentIterator) All() iter.Seq2[*commerceproducerpb.PrivateOfferDocument, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*PrivateOfferDocumentIterator) Next
func (it *PrivateOfferDocumentIterator) Next() (*commerceproducerpb.PrivateOfferDocument, 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 (*PrivateOfferDocumentIterator) PageInfo
func (it *PrivateOfferDocumentIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
PrivateOfferIterator
type PrivateOfferIterator 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 []*commerceproducerpb.PrivateOffer, nextPageToken string, err error)
// contains filtered or unexported fields
}PrivateOfferIterator manages a stream of *commerceproducerpb.PrivateOffer.
func (*PrivateOfferIterator) All
func (it *PrivateOfferIterator) All() iter.Seq2[*commerceproducerpb.PrivateOffer, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*PrivateOfferIterator) Next
func (it *PrivateOfferIterator) Next() (*commerceproducerpb.PrivateOffer, 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 (*PrivateOfferIterator) PageInfo
func (it *PrivateOfferIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ServiceIterator
type ServiceIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*commerceproducerpb.Service, nextPageToken string, err error)
// contains filtered or unexported fields
}ServiceIterator manages a stream of *commerceproducerpb.Service.
func (*ServiceIterator) All
func (it *ServiceIterator) All() iter.Seq2[*commerceproducerpb.Service, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ServiceIterator) Next
func (it *ServiceIterator) Next() (*commerceproducerpb.Service, error)Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ServiceIterator) PageInfo
func (it *ServiceIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
SkuGroupIterator
type SkuGroupIterator 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 []*commerceproducerpb.SkuGroup, nextPageToken string, err error)
// contains filtered or unexported fields
}SkuGroupIterator manages a stream of *commerceproducerpb.SkuGroup.
func (*SkuGroupIterator) All
func (it *SkuGroupIterator) All() iter.Seq2[*commerceproducerpb.SkuGroup, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SkuGroupIterator) Next
func (it *SkuGroupIterator) Next() (*commerceproducerpb.SkuGroup, 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 (*SkuGroupIterator) PageInfo
func (it *SkuGroupIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
SkuIterator
type SkuIterator 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 []*commerceproducerpb.Sku, nextPageToken string, err error)
// contains filtered or unexported fields
}SkuIterator manages a stream of *commerceproducerpb.Sku.
func (*SkuIterator) All
func (it *SkuIterator) All() iter.Seq2[*commerceproducerpb.Sku, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SkuIterator) Next
func (it *SkuIterator) Next() (*commerceproducerpb.Sku, 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 (*SkuIterator) PageInfo
func (it *SkuIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
StandardOfferIterator
type StandardOfferIterator 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 []*commerceproducerpb.StandardOffer, nextPageToken string, err error)
// contains filtered or unexported fields
}StandardOfferIterator manages a stream of *commerceproducerpb.StandardOffer.
func (*StandardOfferIterator) All
func (it *StandardOfferIterator) All() iter.Seq2[*commerceproducerpb.StandardOffer, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*StandardOfferIterator) Next
func (it *StandardOfferIterator) Next() (*commerceproducerpb.StandardOffer, 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 (*StandardOfferIterator) PageInfo
func (it *StandardOfferIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.