Merchant API v1 - Package cloud.google.com/go/shopping/merchant/accounts/apiv1 (v1.1.0)

Package accounts is an auto-generated package for the Merchant API.

Programmatically manage your Merchant Center Accounts.

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:

Example usage

To get started with this package, create a client.

// go get cloud.google.com/go/shopping/merchant/accounts/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 := accounts.NewAccountIssueClient(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 := &accountspb.ListAccountIssuesRequest{
    // TODO: Fill request struct fields.
    // See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListAccountIssuesRequest.
}
it := c.ListAccountIssues(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.(*accountspb.ListAccountIssuesResponse)
}

Use of Context

The ctx passed to NewAccountIssueClient 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.

AccountIssueCallOptions

type AccountIssueCallOptions struct {
	ListAccountIssues []gax.CallOption
}

AccountIssueCallOptions contains the retry settings for each method of AccountIssueClient.

AccountIssueClient

type AccountIssueClient struct {

	// The call options for this service.
	CallOptions *AccountIssueCallOptions
	// contains filtered or unexported fields
}

AccountIssueClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service to support AccountIssueService API.

func NewAccountIssueClient

func NewAccountIssueClient(ctx context.Context, opts ...option.ClientOption) (*AccountIssueClient, error)

NewAccountIssueClient creates a new account issue service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service to support AccountIssueService API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAccountIssueClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewAccountIssueRESTClient

func NewAccountIssueRESTClient(ctx context.Context, opts ...option.ClientOption) (*AccountIssueClient, error)

NewAccountIssueRESTClient creates a new account issue service rest client.

Service to support AccountIssueService API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAccountIssueRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*AccountIssueClient) Close

func (c *AccountIssueClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*AccountIssueClient) Connection (deprecated)

func (c *AccountIssueClient) 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 (*AccountIssueClient) ListAccountIssues

ListAccountIssues lists all account issues of a Merchant Center account.

When called on a multi-client account, this method only returns issues belonging to that account, not its sub-accounts. To retrieve issues for sub-accounts, you must first call the accounts.listSubaccounts method to obtain a list of sub-accounts, and then call accounts.issues.list for each sub-account individually.

Examples

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
	"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 := accounts.NewAccountIssueClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListAccountIssuesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListAccountIssuesRequest.
	}
	it := c.ListAccountIssues(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.(*accountspb.ListAccountIssuesResponse)
	}
}
all
package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAccountIssueClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListAccountIssuesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListAccountIssuesRequest.
	}
	for resp, err := range c.ListAccountIssues(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

AccountIssueIterator

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

AccountIssueIterator manages a stream of *accountspb.AccountIssue.

func (*AccountIssueIterator) All

func (it *AccountIssueIterator) All() iter.Seq2[*accountspb.AccountIssue, error]

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

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

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

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

AccountIterator

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

AccountIterator manages a stream of *accountspb.Account.

func (*AccountIterator) All

func (it *AccountIterator) All() iter.Seq2[*accountspb.Account, error]

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

func (*AccountIterator) Next

func (it *AccountIterator) Next() (*accountspb.Account, 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 (*AccountIterator) PageInfo

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

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

AccountRelationshipIterator

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

AccountRelationshipIterator manages a stream of *accountspb.AccountRelationship.

func (*AccountRelationshipIterator) All

func (it *AccountRelationshipIterator) All() iter.Seq2[*accountspb.AccountRelationship, error]

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

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

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

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

AccountRelationshipsCallOptions

type AccountRelationshipsCallOptions struct {
	GetAccountRelationship    []gax.CallOption
	UpdateAccountRelationship []gax.CallOption
	ListAccountRelationships  []gax.CallOption
}

AccountRelationshipsCallOptions contains the retry settings for each method of AccountRelationshipsClient.

AccountRelationshipsClient

type AccountRelationshipsClient struct {

	// The call options for this service.
	CallOptions *AccountRelationshipsCallOptions
	// contains filtered or unexported fields
}

AccountRelationshipsClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service to support AccountRelationship API.

func NewAccountRelationshipsClient

func NewAccountRelationshipsClient(ctx context.Context, opts ...option.ClientOption) (*AccountRelationshipsClient, error)

NewAccountRelationshipsClient creates a new account relationships service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service to support AccountRelationship API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAccountRelationshipsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewAccountRelationshipsRESTClient

func NewAccountRelationshipsRESTClient(ctx context.Context, opts ...option.ClientOption) (*AccountRelationshipsClient, error)

NewAccountRelationshipsRESTClient creates a new account relationships service rest client.

Service to support AccountRelationship API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAccountRelationshipsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*AccountRelationshipsClient) Close

func (c *AccountRelationshipsClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*AccountRelationshipsClient) Connection (deprecated)

func (c *AccountRelationshipsClient) 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 (*AccountRelationshipsClient) GetAccountRelationship

GetAccountRelationship retrieve an account relationship.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAccountRelationshipsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.GetAccountRelationshipRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#GetAccountRelationshipRequest.
	}
	resp, err := c.GetAccountRelationship(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AccountRelationshipsClient) ListAccountRelationships

ListAccountRelationships list account relationships for the specified account.

Examples

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
	"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 := accounts.NewAccountRelationshipsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListAccountRelationshipsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListAccountRelationshipsRequest.
	}
	it := c.ListAccountRelationships(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.(*accountspb.ListAccountRelationshipsResponse)
	}
}
all
package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAccountRelationshipsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListAccountRelationshipsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListAccountRelationshipsRequest.
	}
	for resp, err := range c.ListAccountRelationships(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*AccountRelationshipsClient) UpdateAccountRelationship

UpdateAccountRelationship updates the account relationship. Executing this method requires admin access.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAccountRelationshipsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.UpdateAccountRelationshipRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#UpdateAccountRelationshipRequest.
	}
	resp, err := c.UpdateAccountRelationship(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

AccountServiceIterator

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

AccountServiceIterator manages a stream of *accountspb.AccountService.

func (*AccountServiceIterator) All

func (it *AccountServiceIterator) All() iter.Seq2[*accountspb.AccountService, error]

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

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

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

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

AccountServicesCallOptions

type AccountServicesCallOptions struct {
	GetAccountService     []gax.CallOption
	ListAccountServices   []gax.CallOption
	ProposeAccountService []gax.CallOption
	ApproveAccountService []gax.CallOption
	RejectAccountService  []gax.CallOption
}

AccountServicesCallOptions contains the retry settings for each method of AccountServicesClient.

AccountServicesClient

type AccountServicesClient struct {

	// The call options for this service.
	CallOptions *AccountServicesCallOptions
	// contains filtered or unexported fields
}

AccountServicesClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service to support AccountService API.

func NewAccountServicesClient

func NewAccountServicesClient(ctx context.Context, opts ...option.ClientOption) (*AccountServicesClient, error)

NewAccountServicesClient creates a new account services service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service to support AccountService API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAccountServicesClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewAccountServicesRESTClient

func NewAccountServicesRESTClient(ctx context.Context, opts ...option.ClientOption) (*AccountServicesClient, error)

NewAccountServicesRESTClient creates a new account services service rest client.

Service to support AccountService API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAccountServicesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*AccountServicesClient) ApproveAccountService

ApproveAccountService approve an account service proposal.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAccountServicesClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ApproveAccountServiceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ApproveAccountServiceRequest.
	}
	resp, err := c.ApproveAccountService(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AccountServicesClient) Close

func (c *AccountServicesClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*AccountServicesClient) Connection (deprecated)

func (c *AccountServicesClient) 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 (*AccountServicesClient) GetAccountService

GetAccountService retrieve an account service.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAccountServicesClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.GetAccountServiceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#GetAccountServiceRequest.
	}
	resp, err := c.GetAccountService(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AccountServicesClient) ListAccountServices

ListAccountServices list account services for the specified accounts. Supports filtering.

Examples

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
	"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 := accounts.NewAccountServicesClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListAccountServicesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListAccountServicesRequest.
	}
	it := c.ListAccountServices(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.(*accountspb.ListAccountServicesResponse)
	}
}
all
package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAccountServicesClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListAccountServicesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListAccountServicesRequest.
	}
	for resp, err := range c.ListAccountServices(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*AccountServicesClient) ProposeAccountService

ProposeAccountService propose an account service.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAccountServicesClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ProposeAccountServiceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ProposeAccountServiceRequest.
	}
	resp, err := c.ProposeAccountService(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AccountServicesClient) RejectAccountService

func (c *AccountServicesClient) RejectAccountService(ctx context.Context, req *accountspb.RejectAccountServiceRequest, opts ...gax.CallOption) error

RejectAccountService reject an account service (both proposed and approve services can be rejected).

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAccountServicesClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.RejectAccountServiceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#RejectAccountServiceRequest.
	}
	err = c.RejectAccountService(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

AutofeedSettingsCallOptions

type AutofeedSettingsCallOptions struct {
	GetAutofeedSettings    []gax.CallOption
	UpdateAutofeedSettings []gax.CallOption
}

AutofeedSettingsCallOptions contains the retry settings for each method of AutofeedSettingsClient.

AutofeedSettingsClient

type AutofeedSettingsClient struct {

	// The call options for this service.
	CallOptions *AutofeedSettingsCallOptions
	// contains filtered or unexported fields
}

AutofeedSettingsClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service to support autofeed (at https://support.google.com/merchants/answer/7538732) setting.

func NewAutofeedSettingsClient

func NewAutofeedSettingsClient(ctx context.Context, opts ...option.ClientOption) (*AutofeedSettingsClient, error)

NewAutofeedSettingsClient creates a new autofeed settings service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service to support autofeed (at https://support.google.com/merchants/answer/7538732) setting.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAutofeedSettingsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewAutofeedSettingsRESTClient

func NewAutofeedSettingsRESTClient(ctx context.Context, opts ...option.ClientOption) (*AutofeedSettingsClient, error)

NewAutofeedSettingsRESTClient creates a new autofeed settings service rest client.

Service to support autofeed (at https://support.google.com/merchants/answer/7538732) setting.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAutofeedSettingsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*AutofeedSettingsClient) Close

func (c *AutofeedSettingsClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*AutofeedSettingsClient) Connection (deprecated)

func (c *AutofeedSettingsClient) 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 (*AutofeedSettingsClient) GetAutofeedSettings

GetAutofeedSettings retrieves the autofeed settings of an account.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAutofeedSettingsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.GetAutofeedSettingsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#GetAutofeedSettingsRequest.
	}
	resp, err := c.GetAutofeedSettings(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AutofeedSettingsClient) UpdateAutofeedSettings

UpdateAutofeedSettings updates the autofeed settings of an account.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAutofeedSettingsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.UpdateAutofeedSettingsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#UpdateAutofeedSettingsRequest.
	}
	resp, err := c.UpdateAutofeedSettings(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

AutomaticImprovementsCallOptions

type AutomaticImprovementsCallOptions struct {
	GetAutomaticImprovements    []gax.CallOption
	UpdateAutomaticImprovements []gax.CallOption
}

AutomaticImprovementsCallOptions contains the retry settings for each method of AutomaticImprovementsClient.

AutomaticImprovementsClient

type AutomaticImprovementsClient struct {

	// The call options for this service.
	CallOptions *AutomaticImprovementsCallOptions
	// contains filtered or unexported fields
}

AutomaticImprovementsClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service to manage the automatic improvements of an account. The automatic improvements of the account can be used to automatically update products, improve images and shipping.

func NewAutomaticImprovementsClient

func NewAutomaticImprovementsClient(ctx context.Context, opts ...option.ClientOption) (*AutomaticImprovementsClient, error)

NewAutomaticImprovementsClient creates a new automatic improvements service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service to manage the automatic improvements of an account. The automatic improvements of the account can be used to automatically update products, improve images and shipping.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAutomaticImprovementsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewAutomaticImprovementsRESTClient

func NewAutomaticImprovementsRESTClient(ctx context.Context, opts ...option.ClientOption) (*AutomaticImprovementsClient, error)

NewAutomaticImprovementsRESTClient creates a new automatic improvements service rest client.

Service to manage the automatic improvements of an account. The automatic improvements of the account can be used to automatically update products, improve images and shipping.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAutomaticImprovementsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*AutomaticImprovementsClient) Close

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*AutomaticImprovementsClient) Connection (deprecated)

func (c *AutomaticImprovementsClient) 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 (*AutomaticImprovementsClient) GetAutomaticImprovements

GetAutomaticImprovements retrieves the automatic improvements of an account.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAutomaticImprovementsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.GetAutomaticImprovementsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#GetAutomaticImprovementsRequest.
	}
	resp, err := c.GetAutomaticImprovements(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AutomaticImprovementsClient) UpdateAutomaticImprovements

UpdateAutomaticImprovements updates the automatic improvements of an account.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewAutomaticImprovementsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.UpdateAutomaticImprovementsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#UpdateAutomaticImprovementsRequest.
	}
	resp, err := c.UpdateAutomaticImprovements(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

BusinessIdentityCallOptions

type BusinessIdentityCallOptions struct {
	GetBusinessIdentity    []gax.CallOption
	UpdateBusinessIdentity []gax.CallOption
}

BusinessIdentityCallOptions contains the retry settings for each method of BusinessIdentityClient.

BusinessIdentityClient

type BusinessIdentityClient struct {

	// The call options for this service.
	CallOptions *BusinessIdentityCallOptions
	// contains filtered or unexported fields
}

BusinessIdentityClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service to support business identity (at https://support.google.com/merchants/answer/12564247) API.

func NewBusinessIdentityClient

func NewBusinessIdentityClient(ctx context.Context, opts ...option.ClientOption) (*BusinessIdentityClient, error)

NewBusinessIdentityClient creates a new business identity service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service to support business identity (at https://support.google.com/merchants/answer/12564247) API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewBusinessIdentityClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewBusinessIdentityRESTClient

func NewBusinessIdentityRESTClient(ctx context.Context, opts ...option.ClientOption) (*BusinessIdentityClient, error)

NewBusinessIdentityRESTClient creates a new business identity service rest client.

Service to support business identity (at https://support.google.com/merchants/answer/12564247) API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewBusinessIdentityRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*BusinessIdentityClient) Close

func (c *BusinessIdentityClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*BusinessIdentityClient) Connection (deprecated)

func (c *BusinessIdentityClient) 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 (*BusinessIdentityClient) GetBusinessIdentity

GetBusinessIdentity retrieves the business identity of an account.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewBusinessIdentityClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.GetBusinessIdentityRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#GetBusinessIdentityRequest.
	}
	resp, err := c.GetBusinessIdentity(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BusinessIdentityClient) UpdateBusinessIdentity

UpdateBusinessIdentity updates the business identity of an account. Executing this method requires admin access.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewBusinessIdentityClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.UpdateBusinessIdentityRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#UpdateBusinessIdentityRequest.
	}
	resp, err := c.UpdateBusinessIdentity(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

BusinessInfoCallOptions

type BusinessInfoCallOptions struct {
	GetBusinessInfo    []gax.CallOption
	UpdateBusinessInfo []gax.CallOption
}

BusinessInfoCallOptions contains the retry settings for each method of BusinessInfoClient.

BusinessInfoClient

type BusinessInfoClient struct {

	// The call options for this service.
	CallOptions *BusinessInfoCallOptions
	// contains filtered or unexported fields
}

BusinessInfoClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service to support business info API.

func NewBusinessInfoClient

func NewBusinessInfoClient(ctx context.Context, opts ...option.ClientOption) (*BusinessInfoClient, error)

NewBusinessInfoClient creates a new business info service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service to support business info API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewBusinessInfoClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewBusinessInfoRESTClient

func NewBusinessInfoRESTClient(ctx context.Context, opts ...option.ClientOption) (*BusinessInfoClient, error)

NewBusinessInfoRESTClient creates a new business info service rest client.

Service to support business info API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewBusinessInfoRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*BusinessInfoClient) Close

func (c *BusinessInfoClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*BusinessInfoClient) Connection (deprecated)

func (c *BusinessInfoClient) 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 (*BusinessInfoClient) GetBusinessInfo

GetBusinessInfo retrieves the business info of an account.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewBusinessInfoClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.GetBusinessInfoRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#GetBusinessInfoRequest.
	}
	resp, err := c.GetBusinessInfo(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BusinessInfoClient) UpdateBusinessInfo

UpdateBusinessInfo updates the business info of an account. Executing this method requires admin access.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewBusinessInfoClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.UpdateBusinessInfoRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#UpdateBusinessInfoRequest.
	}
	resp, err := c.UpdateBusinessInfo(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

CallOptions

type CallOptions struct {
	GetAccount                []gax.CallOption
	CreateAndConfigureAccount []gax.CallOption
	DeleteAccount             []gax.CallOption
	UpdateAccount             []gax.CallOption
	ListAccounts              []gax.CallOption
	ListSubAccounts           []gax.CallOption
}

CallOptions contains the retry settings for each method of Client.

CheckoutSettingsCallOptions

type CheckoutSettingsCallOptions struct {
	GetCheckoutSettings    []gax.CallOption
	CreateCheckoutSettings []gax.CallOption
	UpdateCheckoutSettings []gax.CallOption
	DeleteCheckoutSettings []gax.CallOption
}

CheckoutSettingsCallOptions contains the retry settings for each method of CheckoutSettingsClient.

CheckoutSettingsClient

type CheckoutSettingsClient struct {

	// The call options for this service.
	CallOptions *CheckoutSettingsCallOptions
	// contains filtered or unexported fields
}

CheckoutSettingsClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service for supporting checkout settings (at https://support.google.com/merchants/answer/13945960).

func NewCheckoutSettingsClient

func NewCheckoutSettingsClient(ctx context.Context, opts ...option.ClientOption) (*CheckoutSettingsClient, error)

NewCheckoutSettingsClient creates a new checkout settings service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service for supporting checkout settings (at https://support.google.com/merchants/answer/13945960).

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewCheckoutSettingsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewCheckoutSettingsRESTClient

func NewCheckoutSettingsRESTClient(ctx context.Context, opts ...option.ClientOption) (*CheckoutSettingsClient, error)

NewCheckoutSettingsRESTClient creates a new checkout settings service rest client.

Service for supporting checkout settings (at https://support.google.com/merchants/answer/13945960).

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewCheckoutSettingsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*CheckoutSettingsClient) Close

func (c *CheckoutSettingsClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*CheckoutSettingsClient) Connection (deprecated)

func (c *CheckoutSettingsClient) 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 (*CheckoutSettingsClient) CreateCheckoutSettings

CreateCheckoutSettings creates CheckoutSettings for the given merchant.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewCheckoutSettingsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.CreateCheckoutSettingsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#CreateCheckoutSettingsRequest.
	}
	resp, err := c.CreateCheckoutSettings(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*CheckoutSettingsClient) DeleteCheckoutSettings

func (c *CheckoutSettingsClient) DeleteCheckoutSettings(ctx context.Context, req *accountspb.DeleteCheckoutSettingsRequest, opts ...gax.CallOption) error

DeleteCheckoutSettings deletes CheckoutSettings and unenrolls merchant from Checkout program.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewCheckoutSettingsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.DeleteCheckoutSettingsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#DeleteCheckoutSettingsRequest.
	}
	err = c.DeleteCheckoutSettings(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*CheckoutSettingsClient) GetCheckoutSettings

GetCheckoutSettings gets CheckoutSettings for the given merchant. This includes information about review state, enrollment state and URL settings.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewCheckoutSettingsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.GetCheckoutSettingsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#GetCheckoutSettingsRequest.
	}
	resp, err := c.GetCheckoutSettings(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*CheckoutSettingsClient) UpdateCheckoutSettings

UpdateCheckoutSettings updates CheckoutSettings for the given merchant.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewCheckoutSettingsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.UpdateCheckoutSettingsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#UpdateCheckoutSettingsRequest.
	}
	resp, err := c.UpdateCheckoutSettings(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

Client

type Client struct {

	// The call options for this service.
	CallOptions *CallOptions
	// contains filtered or unexported fields
}

Client is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service to support Accounts API.

func NewClient

func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error)

NewClient creates a new accounts service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service to support Accounts API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewRESTClient

func NewRESTClient(ctx context.Context, opts ...option.ClientOption) (*Client, error)

NewRESTClient creates a new accounts service rest client.

Service to support Accounts API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*Client) Close

func (c *Client) Close() error

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) CreateAndConfigureAccount

func (c *Client) CreateAndConfigureAccount(ctx context.Context, req *accountspb.CreateAndConfigureAccountRequest, opts ...gax.CallOption) (*accountspb.Account, error)

CreateAndConfigureAccount creates a Merchant Center account with additional configuration. Adds the user that makes the request as an admin for the new account.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.CreateAndConfigureAccountRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#CreateAndConfigureAccountRequest.
	}
	resp, err := c.CreateAndConfigureAccount(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) DeleteAccount

func (c *Client) DeleteAccount(ctx context.Context, req *accountspb.DeleteAccountRequest, opts ...gax.CallOption) error

DeleteAccount deletes the specified account regardless of its type: standalone, advanced account or sub-account. Deleting an advanced account leads to the deletion of all of its sub-accounts. Executing this method requires admin access. The deletion succeeds only if the account does not provide services to any other account and has no processed offers. You can use the force parameter to override this.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.DeleteAccountRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#DeleteAccountRequest.
	}
	err = c.DeleteAccount(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*Client) GetAccount

func (c *Client) GetAccount(ctx context.Context, req *accountspb.GetAccountRequest, opts ...gax.CallOption) (*accountspb.Account, error)

GetAccount retrieves an account from your Merchant Center account. After inserting, updating, or deleting an account, it may take several minutes before changes take effect.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.GetAccountRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#GetAccountRequest.
	}
	resp, err := c.GetAccount(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) ListAccounts

func (c *Client) ListAccounts(ctx context.Context, req *accountspb.ListAccountsRequest, opts ...gax.CallOption) *AccountIterator

ListAccounts note: For the accounts.list method, quota and limits usage are charged for each user, and not for the Merchant Center ID or the advanced account ID. To list several sub-accounts, you should use the accounts.listSubaccounts method, which is more suitable for advanced accounts use case.

Examples

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
	"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 := accounts.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListAccountsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListAccountsRequest.
	}
	it := c.ListAccounts(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.(*accountspb.ListAccountsResponse)
	}
}
all
package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListAccountsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListAccountsRequest.
	}
	for resp, err := range c.ListAccounts(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) ListSubAccounts

func (c *Client) ListSubAccounts(ctx context.Context, req *accountspb.ListSubAccountsRequest, opts ...gax.CallOption) *AccountIterator

ListSubAccounts list all sub-accounts for a given advanced account. This is a convenience wrapper for the more powerful accounts.list method. This method will produce the same results as calling ListsAccounts with the following filter: relationship(providerId={parent} AND service(type="ACCOUNT_AGGREGATION"))

Examples

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
	"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 := accounts.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListSubAccountsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListSubAccountsRequest.
	}
	it := c.ListSubAccounts(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.(*accountspb.ListSubAccountsResponse)
	}
}
all
package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListSubAccountsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListSubAccountsRequest.
	}
	for resp, err := range c.ListSubAccounts(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) UpdateAccount

func (c *Client) UpdateAccount(ctx context.Context, req *accountspb.UpdateAccountRequest, opts ...gax.CallOption) (*accountspb.Account, error)

UpdateAccount updates an account regardless of its type: standalone, advanced account or sub-account. Executing this method requires admin access.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.UpdateAccountRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#UpdateAccountRequest.
	}
	resp, err := c.UpdateAccount(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

DeveloperRegistrationCallOptions

type DeveloperRegistrationCallOptions struct {
	RegisterGcp              []gax.CallOption
	GetDeveloperRegistration []gax.CallOption
	UnregisterGcp            []gax.CallOption
}

DeveloperRegistrationCallOptions contains the retry settings for each method of DeveloperRegistrationClient.

DeveloperRegistrationClient

type DeveloperRegistrationClient struct {

	// The call options for this service.
	CallOptions *DeveloperRegistrationCallOptions
	// contains filtered or unexported fields
}

DeveloperRegistrationClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service to access Developer Registration.

func NewDeveloperRegistrationClient

func NewDeveloperRegistrationClient(ctx context.Context, opts ...option.ClientOption) (*DeveloperRegistrationClient, error)

NewDeveloperRegistrationClient creates a new developer registration service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service to access Developer Registration.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewDeveloperRegistrationClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewDeveloperRegistrationRESTClient

func NewDeveloperRegistrationRESTClient(ctx context.Context, opts ...option.ClientOption) (*DeveloperRegistrationClient, error)

NewDeveloperRegistrationRESTClient creates a new developer registration service rest client.

Service to access Developer Registration.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewDeveloperRegistrationRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*DeveloperRegistrationClient) Close

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*DeveloperRegistrationClient) Connection (deprecated)

func (c *DeveloperRegistrationClient) 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 (*DeveloperRegistrationClient) GetDeveloperRegistration

GetDeveloperRegistration retrieves a developer registration for a merchant.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewDeveloperRegistrationClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.GetDeveloperRegistrationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#GetDeveloperRegistrationRequest.
	}
	resp, err := c.GetDeveloperRegistration(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DeveloperRegistrationClient) RegisterGcp

RegisterGcp registers the GCP used for the API call to the shopping account passed in the request. Will create a user with an “API developer” and add the “developer_email” as a contact with “API notifications” email preference on.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewDeveloperRegistrationClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.RegisterGcpRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#RegisterGcpRequest.
	}
	resp, err := c.RegisterGcp(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DeveloperRegistrationClient) UnregisterGcp

UnregisterGcp unregister the calling GCP from the calling shopping account. Note that the GCP will still be able to access the API for at most 1 day from the unregister succussful call.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewDeveloperRegistrationClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.UnregisterGcpRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#UnregisterGcpRequest.
	}
	err = c.UnregisterGcp(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

EmailPreferencesCallOptions

type EmailPreferencesCallOptions struct {
	GetEmailPreferences    []gax.CallOption
	UpdateEmailPreferences []gax.CallOption
}

EmailPreferencesCallOptions contains the retry settings for each method of EmailPreferencesClient.

EmailPreferencesClient

type EmailPreferencesClient struct {

	// The call options for this service.
	CallOptions *EmailPreferencesCallOptions
	// contains filtered or unexported fields
}

EmailPreferencesClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service to support the EmailPreferences API.

func NewEmailPreferencesClient

func NewEmailPreferencesClient(ctx context.Context, opts ...option.ClientOption) (*EmailPreferencesClient, error)

NewEmailPreferencesClient creates a new email preferences service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service to support the EmailPreferences API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewEmailPreferencesClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewEmailPreferencesRESTClient

func NewEmailPreferencesRESTClient(ctx context.Context, opts ...option.ClientOption) (*EmailPreferencesClient, error)

NewEmailPreferencesRESTClient creates a new email preferences service rest client.

Service to support the EmailPreferences API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewEmailPreferencesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*EmailPreferencesClient) Close

func (c *EmailPreferencesClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*EmailPreferencesClient) Connection (deprecated)

func (c *EmailPreferencesClient) 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 (*EmailPreferencesClient) GetEmailPreferences

GetEmailPreferences returns the email preferences for a Merchant Center account user. This service only permits retrieving and updating email preferences for the authenticated user. Use the name=accounts/*/users/me/emailPreferences alias to get preferences for the authenticated user.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewEmailPreferencesClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.GetEmailPreferencesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#GetEmailPreferencesRequest.
	}
	resp, err := c.GetEmailPreferences(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*EmailPreferencesClient) UpdateEmailPreferences

UpdateEmailPreferences updates the email preferences for a Merchant Center account user. Advanced account users should specify the advanced account rather than a sub-account of the advanced account.

Preferences which are not explicitly selected in the update mask will not be updated.

It is invalid for updates to specify an UNCONFIRMED opt-in status value.

Use the name=accounts/*/users/me/emailPreferences alias to update preferences for the authenticated user.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewEmailPreferencesClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.UpdateEmailPreferencesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#UpdateEmailPreferencesRequest.
	}
	resp, err := c.UpdateEmailPreferences(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

GbpAccountIterator

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

GbpAccountIterator manages a stream of *accountspb.GbpAccount.

func (*GbpAccountIterator) All

func (it *GbpAccountIterator) All() iter.Seq2[*accountspb.GbpAccount, error]

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

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

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

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

GbpAccountsCallOptions

type GbpAccountsCallOptions struct {
	ListGbpAccounts []gax.CallOption
	LinkGbpAccount  []gax.CallOption
}

GbpAccountsCallOptions contains the retry settings for each method of GbpAccountsClient.

GbpAccountsClient

type GbpAccountsClient struct {

	// The call options for this service.
	CallOptions *GbpAccountsCallOptions
	// contains filtered or unexported fields
}

GbpAccountsClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

The service facilitates the management of a merchant’s Google Business Profile (GBP) account settings. This API defines the following resource model:

GbpAccount

func NewGbpAccountsClient

func NewGbpAccountsClient(ctx context.Context, opts ...option.ClientOption) (*GbpAccountsClient, error)

NewGbpAccountsClient creates a new gbp accounts service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

The service facilitates the management of a merchant’s Google Business Profile (GBP) account settings. This API defines the following resource model:

GbpAccount

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewGbpAccountsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewGbpAccountsRESTClient

func NewGbpAccountsRESTClient(ctx context.Context, opts ...option.ClientOption) (*GbpAccountsClient, error)

NewGbpAccountsRESTClient creates a new gbp accounts service rest client.

The service facilitates the management of a merchant’s Google Business Profile (GBP) account settings. This API defines the following resource model:

GbpAccount

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewGbpAccountsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*GbpAccountsClient) Close

func (c *GbpAccountsClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*GbpAccountsClient) Connection (deprecated)

func (c *GbpAccountsClient) 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 (*GbpAccountsClient) LinkGbpAccount

LinkGbpAccount link the specified merchant to a GBP account for all countries.

To run this method, you must have admin access to the Merchant Center account. If you don’t have admin access, the request fails with the error message User is not an administrator of account {ACCOUNT_ID}.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewGbpAccountsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.LinkGbpAccountRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#LinkGbpAccountRequest.
	}
	resp, err := c.LinkGbpAccount(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*GbpAccountsClient) ListGbpAccounts

ListGbpAccounts list the GBP accounts for a given merchant.

Examples

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
	"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 := accounts.NewGbpAccountsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListGbpAccountsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListGbpAccountsRequest.
	}
	it := c.ListGbpAccounts(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.(*accountspb.ListGbpAccountsResponse)
	}
}
all
package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewGbpAccountsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListGbpAccountsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListGbpAccountsRequest.
	}
	for resp, err := range c.ListGbpAccounts(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

HomepageCallOptions

type HomepageCallOptions struct {
	GetHomepage     []gax.CallOption
	UpdateHomepage  []gax.CallOption
	ClaimHomepage   []gax.CallOption
	UnclaimHomepage []gax.CallOption
}

HomepageCallOptions contains the retry settings for each method of HomepageClient.

HomepageClient

type HomepageClient struct {

	// The call options for this service.
	CallOptions *HomepageCallOptions
	// contains filtered or unexported fields
}

HomepageClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service to support an API for a store’s homepage.

func NewHomepageClient

func NewHomepageClient(ctx context.Context, opts ...option.ClientOption) (*HomepageClient, error)

NewHomepageClient creates a new homepage service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service to support an API for a store’s homepage.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewHomepageClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewHomepageRESTClient

func NewHomepageRESTClient(ctx context.Context, opts ...option.ClientOption) (*HomepageClient, error)

NewHomepageRESTClient creates a new homepage service rest client.

Service to support an API for a store’s homepage.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewHomepageRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*HomepageClient) ClaimHomepage

ClaimHomepage claims a store’s homepage. Executing this method requires admin access.

If the homepage is already claimed, this will recheck the verification (unless the business is exempted from claiming, which also exempts from verification) and return a successful response. If ownership can no longer be verified, it will return an error, but it won’t clear the claim.

In case of failure, a canonical error message is returned:

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewHomepageClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ClaimHomepageRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ClaimHomepageRequest.
	}
	resp, err := c.ClaimHomepage(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*HomepageClient) Close

func (c *HomepageClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*HomepageClient) Connection (deprecated)

func (c *HomepageClient) 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 (*HomepageClient) GetHomepage

GetHomepage retrieves a store’s homepage.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewHomepageClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.GetHomepageRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#GetHomepageRequest.
	}
	resp, err := c.GetHomepage(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*HomepageClient) UnclaimHomepage

UnclaimHomepage unclaims a store’s homepage. Executing this method requires admin access.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewHomepageClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.UnclaimHomepageRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#UnclaimHomepageRequest.
	}
	resp, err := c.UnclaimHomepage(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*HomepageClient) UpdateHomepage

UpdateHomepage updates a store’s homepage. Executing this method requires admin access.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewHomepageClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.UpdateHomepageRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#UpdateHomepageRequest.
	}
	resp, err := c.UpdateHomepage(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

LfpProviderIterator

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

LfpProviderIterator manages a stream of *accountspb.LfpProvider.

func (*LfpProviderIterator) All

func (it *LfpProviderIterator) All() iter.Seq2[*accountspb.LfpProvider, error]

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

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

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

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

LfpProvidersCallOptions

type LfpProvidersCallOptions struct {
	FindLfpProviders []gax.CallOption
	LinkLfpProvider  []gax.CallOption
}

LfpProvidersCallOptions contains the retry settings for each method of LfpProvidersClient.

LfpProvidersClient

type LfpProvidersClient struct {

	// The call options for this service.
	CallOptions *LfpProvidersCallOptions
	// contains filtered or unexported fields
}

LfpProvidersClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

The service facilitates the management of a merchant’s LFP provider settings. This API defines the following resource model:

LfpProvider

func NewLfpProvidersClient

func NewLfpProvidersClient(ctx context.Context, opts ...option.ClientOption) (*LfpProvidersClient, error)

NewLfpProvidersClient creates a new lfp providers service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

The service facilitates the management of a merchant’s LFP provider settings. This API defines the following resource model:

LfpProvider

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewLfpProvidersClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewLfpProvidersRESTClient

func NewLfpProvidersRESTClient(ctx context.Context, opts ...option.ClientOption) (*LfpProvidersClient, error)

NewLfpProvidersRESTClient creates a new lfp providers service rest client.

The service facilitates the management of a merchant’s LFP provider settings. This API defines the following resource model:

LfpProvider

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewLfpProvidersRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*LfpProvidersClient) Close

func (c *LfpProvidersClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*LfpProvidersClient) Connection (deprecated)

func (c *LfpProvidersClient) 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 (*LfpProvidersClient) FindLfpProviders

FindLfpProviders find the LFP provider candidates in a given country.

Examples

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
	"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 := accounts.NewLfpProvidersClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.FindLfpProvidersRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#FindLfpProvidersRequest.
	}
	it := c.FindLfpProviders(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.(*accountspb.FindLfpProvidersResponse)
	}
}
all
package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewLfpProvidersClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.FindLfpProvidersRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#FindLfpProvidersRequest.
	}
	for resp, err := range c.FindLfpProviders(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*LfpProvidersClient) LinkLfpProvider

LinkLfpProvider link the specified merchant to a LFP provider for the specified country.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewLfpProvidersClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.LinkLfpProviderRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#LinkLfpProviderRequest.
	}
	resp, err := c.LinkLfpProvider(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

OmnichannelSettingIterator

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

OmnichannelSettingIterator manages a stream of *accountspb.OmnichannelSetting.

func (*OmnichannelSettingIterator) All

func (it *OmnichannelSettingIterator) All() iter.Seq2[*accountspb.OmnichannelSetting, error]

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

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

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

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

OmnichannelSettingsCallOptions

type OmnichannelSettingsCallOptions struct {
	GetOmnichannelSetting        []gax.CallOption
	ListOmnichannelSettings      []gax.CallOption
	CreateOmnichannelSetting     []gax.CallOption
	UpdateOmnichannelSetting     []gax.CallOption
	RequestInventoryVerification []gax.CallOption
}

OmnichannelSettingsCallOptions contains the retry settings for each method of OmnichannelSettingsClient.

OmnichannelSettingsClient

type OmnichannelSettingsClient struct {

	// The call options for this service.
	CallOptions *OmnichannelSettingsCallOptions
	// contains filtered or unexported fields
}

OmnichannelSettingsClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

The service facilitates the management of a merchant’s omnichannel settings.

This API defines the following resource model:OmnichannelSetting

func NewOmnichannelSettingsClient

func NewOmnichannelSettingsClient(ctx context.Context, opts ...option.ClientOption) (*OmnichannelSettingsClient, error)

NewOmnichannelSettingsClient creates a new omnichannel settings service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

The service facilitates the management of a merchant’s omnichannel settings.

This API defines the following resource model:OmnichannelSetting

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewOmnichannelSettingsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewOmnichannelSettingsRESTClient

func NewOmnichannelSettingsRESTClient(ctx context.Context, opts ...option.ClientOption) (*OmnichannelSettingsClient, error)

NewOmnichannelSettingsRESTClient creates a new omnichannel settings service rest client.

The service facilitates the management of a merchant’s omnichannel settings.

This API defines the following resource model:OmnichannelSetting

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewOmnichannelSettingsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*OmnichannelSettingsClient) Close

func (c *OmnichannelSettingsClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*OmnichannelSettingsClient) Connection (deprecated)

func (c *OmnichannelSettingsClient) 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 (*OmnichannelSettingsClient) CreateOmnichannelSetting

CreateOmnichannelSetting create the omnichannel settings for a given merchant.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewOmnichannelSettingsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.CreateOmnichannelSettingRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#CreateOmnichannelSettingRequest.
	}
	resp, err := c.CreateOmnichannelSetting(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*OmnichannelSettingsClient) GetOmnichannelSetting

GetOmnichannelSetting get the omnichannel settings for a given merchant.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewOmnichannelSettingsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.GetOmnichannelSettingRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#GetOmnichannelSettingRequest.
	}
	resp, err := c.GetOmnichannelSetting(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*OmnichannelSettingsClient) ListOmnichannelSettings

ListOmnichannelSettings list all the omnichannel settings for a given merchant.

Examples

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
	"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 := accounts.NewOmnichannelSettingsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListOmnichannelSettingsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListOmnichannelSettingsRequest.
	}
	it := c.ListOmnichannelSettings(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.(*accountspb.ListOmnichannelSettingsResponse)
	}
}
all
package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewOmnichannelSettingsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListOmnichannelSettingsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListOmnichannelSettingsRequest.
	}
	for resp, err := range c.ListOmnichannelSettings(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*OmnichannelSettingsClient) RequestInventoryVerification

RequestInventoryVerification requests inventory verification for a given merchant in a given country.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewOmnichannelSettingsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.RequestInventoryVerificationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#RequestInventoryVerificationRequest.
	}
	resp, err := c.RequestInventoryVerification(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*OmnichannelSettingsClient) UpdateOmnichannelSetting

UpdateOmnichannelSetting update the omnichannel setting for a given merchant in a given country.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewOmnichannelSettingsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.UpdateOmnichannelSettingRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#UpdateOmnichannelSettingRequest.
	}
	resp, err := c.UpdateOmnichannelSetting(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

OnlineReturnPolicyCallOptions

type OnlineReturnPolicyCallOptions struct {
	GetOnlineReturnPolicy    []gax.CallOption
	ListOnlineReturnPolicies []gax.CallOption
	CreateOnlineReturnPolicy []gax.CallOption
	DeleteOnlineReturnPolicy []gax.CallOption
}

OnlineReturnPolicyCallOptions contains the retry settings for each method of OnlineReturnPolicyClient.

OnlineReturnPolicyClient

type OnlineReturnPolicyClient struct {

	// The call options for this service.
	CallOptions *OnlineReturnPolicyCallOptions
	// contains filtered or unexported fields
}

OnlineReturnPolicyClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

The service facilitates the management of a business’s remorse return policy configuration, encompassing return policies for both ads and free listings

programs. This API defines the following resource model:OnlineReturnPolicy

func NewOnlineReturnPolicyClient

func NewOnlineReturnPolicyClient(ctx context.Context, opts ...option.ClientOption) (*OnlineReturnPolicyClient, error)

NewOnlineReturnPolicyClient creates a new online return policy service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

The service facilitates the management of a business’s remorse return policy configuration, encompassing return policies for both ads and free listings

programs. This API defines the following resource model:OnlineReturnPolicy

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewOnlineReturnPolicyClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewOnlineReturnPolicyRESTClient

func NewOnlineReturnPolicyRESTClient(ctx context.Context, opts ...option.ClientOption) (*OnlineReturnPolicyClient, error)

NewOnlineReturnPolicyRESTClient creates a new online return policy service rest client.

The service facilitates the management of a business’s remorse return policy configuration, encompassing return policies for both ads and free listings

programs. This API defines the following resource model:OnlineReturnPolicy

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewOnlineReturnPolicyRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*OnlineReturnPolicyClient) Close

func (c *OnlineReturnPolicyClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*OnlineReturnPolicyClient) Connection (deprecated)

func (c *OnlineReturnPolicyClient) 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 (*OnlineReturnPolicyClient) CreateOnlineReturnPolicy

CreateOnlineReturnPolicy creates a new return policy for a given business.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewOnlineReturnPolicyClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.CreateOnlineReturnPolicyRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#CreateOnlineReturnPolicyRequest.
	}
	resp, err := c.CreateOnlineReturnPolicy(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*OnlineReturnPolicyClient) DeleteOnlineReturnPolicy

DeleteOnlineReturnPolicy deletes an existing return policy.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewOnlineReturnPolicyClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.DeleteOnlineReturnPolicyRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#DeleteOnlineReturnPolicyRequest.
	}
	err = c.DeleteOnlineReturnPolicy(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*OnlineReturnPolicyClient) GetOnlineReturnPolicy

GetOnlineReturnPolicy gets an existing return policy for a given business.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewOnlineReturnPolicyClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.GetOnlineReturnPolicyRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#GetOnlineReturnPolicyRequest.
	}
	resp, err := c.GetOnlineReturnPolicy(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*OnlineReturnPolicyClient) ListOnlineReturnPolicies

ListOnlineReturnPolicies lists all existing return policies for a given business.

Examples

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
	"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 := accounts.NewOnlineReturnPolicyClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListOnlineReturnPoliciesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListOnlineReturnPoliciesRequest.
	}
	it := c.ListOnlineReturnPolicies(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.(*accountspb.ListOnlineReturnPoliciesResponse)
	}
}
all
package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewOnlineReturnPolicyClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListOnlineReturnPoliciesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListOnlineReturnPoliciesRequest.
	}
	for resp, err := range c.ListOnlineReturnPolicies(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

OnlineReturnPolicyIterator

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

OnlineReturnPolicyIterator manages a stream of *accountspb.OnlineReturnPolicy.

func (*OnlineReturnPolicyIterator) All

func (it *OnlineReturnPolicyIterator) All() iter.Seq2[*accountspb.OnlineReturnPolicy, error]

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

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

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

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

ProgramIterator

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

ProgramIterator manages a stream of *accountspb.Program.

func (*ProgramIterator) All

func (it *ProgramIterator) All() iter.Seq2[*accountspb.Program, error]

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

func (*ProgramIterator) Next

func (it *ProgramIterator) Next() (*accountspb.Program, 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 (*ProgramIterator) PageInfo

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

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

ProgramsCallOptions

type ProgramsCallOptions struct {
	GetProgram     []gax.CallOption
	ListPrograms   []gax.CallOption
	EnableProgram  []gax.CallOption
	DisableProgram []gax.CallOption
}

ProgramsCallOptions contains the retry settings for each method of ProgramsClient.

ProgramsClient

type ProgramsClient struct {

	// The call options for this service.
	CallOptions *ProgramsCallOptions
	// contains filtered or unexported fields
}

ProgramsClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service for program management.

Programs provide a mechanism for adding functionality to merchant accounts. A typical example of this is the Free product listings (at https://support.google.com/merchants/answer/13889434) program, which enables products from a merchant’s store to be shown across Google for free.

This service exposes methods to retrieve a business’s participation in all available programs, in addition to methods for explicitly enabling or disabling participation in each program.

func NewProgramsClient

func NewProgramsClient(ctx context.Context, opts ...option.ClientOption) (*ProgramsClient, error)

NewProgramsClient creates a new programs service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service for program management.

Programs provide a mechanism for adding functionality to merchant accounts. A typical example of this is the Free product listings (at https://support.google.com/merchants/answer/13889434) program, which enables products from a merchant’s store to be shown across Google for free.

This service exposes methods to retrieve a business’s participation in all available programs, in addition to methods for explicitly enabling or disabling participation in each program.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewProgramsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewProgramsRESTClient

func NewProgramsRESTClient(ctx context.Context, opts ...option.ClientOption) (*ProgramsClient, error)

NewProgramsRESTClient creates a new programs service rest client.

Service for program management.

Programs provide a mechanism for adding functionality to merchant accounts. A typical example of this is the Free product listings (at https://support.google.com/merchants/answer/13889434) program, which enables products from a merchant’s store to be shown across Google for free.

This service exposes methods to retrieve a business’s participation in all available programs, in addition to methods for explicitly enabling or disabling participation in each program.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewProgramsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*ProgramsClient) Close

func (c *ProgramsClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*ProgramsClient) Connection (deprecated)

func (c *ProgramsClient) 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 (*ProgramsClient) DisableProgram

DisableProgram disable participation in the specified program for the account.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewProgramsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.DisableProgramRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#DisableProgramRequest.
	}
	resp, err := c.DisableProgram(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ProgramsClient) EnableProgram

EnableProgram enable participation in the specified program for the account.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewProgramsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.EnableProgramRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#EnableProgramRequest.
	}
	resp, err := c.EnableProgram(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ProgramsClient) GetProgram

GetProgram retrieves the specified program for the account.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewProgramsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.GetProgramRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#GetProgramRequest.
	}
	resp, err := c.GetProgram(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ProgramsClient) ListPrograms

ListPrograms retrieves all programs for the account.

Examples

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
	"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 := accounts.NewProgramsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListProgramsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListProgramsRequest.
	}
	it := c.ListPrograms(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.(*accountspb.ListProgramsResponse)
	}
}
all
package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewProgramsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListProgramsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListProgramsRequest.
	}
	for resp, err := range c.ListPrograms(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

RegionIterator

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

RegionIterator manages a stream of *accountspb.Region.

func (*RegionIterator) All

func (it *RegionIterator) All() iter.Seq2[*accountspb.Region, error]

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

func (*RegionIterator) Next

func (it *RegionIterator) Next() (*accountspb.Region, 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 (*RegionIterator) PageInfo

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

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

RegionsCallOptions

type RegionsCallOptions struct {
	GetRegion          []gax.CallOption
	CreateRegion       []gax.CallOption
	BatchCreateRegions []gax.CallOption
	UpdateRegion       []gax.CallOption
	BatchUpdateRegions []gax.CallOption
	DeleteRegion       []gax.CallOption
	BatchDeleteRegions []gax.CallOption
	ListRegions        []gax.CallOption
}

RegionsCallOptions contains the retry settings for each method of RegionsClient.

RegionsClient

type RegionsClient struct {

	// The call options for this service.
	CallOptions *RegionsCallOptions
	// contains filtered or unexported fields
}

RegionsClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Manages regions configuration.

This API defines the following resource model:

Region

func NewRegionsClient

func NewRegionsClient(ctx context.Context, opts ...option.ClientOption) (*RegionsClient, error)

NewRegionsClient creates a new regions service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Manages regions configuration.

This API defines the following resource model:

Region

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewRegionsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewRegionsRESTClient

func NewRegionsRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionsClient, error)

NewRegionsRESTClient creates a new regions service rest client.

Manages regions configuration.

This API defines the following resource model:

Region

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewRegionsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*RegionsClient) BatchCreateRegions

BatchCreateRegions creates one or more regions in your Merchant Center account. Executing this method requires admin access.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewRegionsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.BatchCreateRegionsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#BatchCreateRegionsRequest.
	}
	resp, err := c.BatchCreateRegions(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*RegionsClient) BatchDeleteRegions

func (c *RegionsClient) BatchDeleteRegions(ctx context.Context, req *accountspb.BatchDeleteRegionsRequest, opts ...gax.CallOption) error

BatchDeleteRegions deletes multiple regions by name from your Merchant Center account. Executing this method requires admin access.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewRegionsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.BatchDeleteRegionsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#BatchDeleteRegionsRequest.
	}
	err = c.BatchDeleteRegions(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*RegionsClient) BatchUpdateRegions

BatchUpdateRegions updates one or more regions in your Merchant Center account. Executing this method requires admin access.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewRegionsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.BatchUpdateRegionsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#BatchUpdateRegionsRequest.
	}
	resp, err := c.BatchUpdateRegions(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*RegionsClient) Close

func (c *RegionsClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*RegionsClient) Connection (deprecated)

func (c *RegionsClient) 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 (*RegionsClient) CreateRegion

CreateRegion creates a region definition in your Merchant Center account. Executing this method requires admin access.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewRegionsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.CreateRegionRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#CreateRegionRequest.
	}
	resp, err := c.CreateRegion(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*RegionsClient) DeleteRegion

func (c *RegionsClient) DeleteRegion(ctx context.Context, req *accountspb.DeleteRegionRequest, opts ...gax.CallOption) error

DeleteRegion deletes a region definition from your Merchant Center account. Executing this method requires admin access.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewRegionsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.DeleteRegionRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#DeleteRegionRequest.
	}
	err = c.DeleteRegion(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*RegionsClient) GetRegion

GetRegion retrieves a region defined in your Merchant Center account.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewRegionsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.GetRegionRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#GetRegionRequest.
	}
	resp, err := c.GetRegion(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*RegionsClient) ListRegions

ListRegions lists the regions in your Merchant Center account.

Examples

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
	"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 := accounts.NewRegionsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListRegionsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListRegionsRequest.
	}
	it := c.ListRegions(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.(*accountspb.ListRegionsResponse)
	}
}
all
package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewRegionsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListRegionsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListRegionsRequest.
	}
	for resp, err := range c.ListRegions(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*RegionsClient) UpdateRegion

UpdateRegion updates a region definition in your Merchant Center account. Executing this method requires admin access.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewRegionsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.UpdateRegionRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#UpdateRegionRequest.
	}
	resp, err := c.UpdateRegion(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

ShippingSettingsCallOptions

type ShippingSettingsCallOptions struct {
	GetShippingSettings    []gax.CallOption
	InsertShippingSettings []gax.CallOption
}

ShippingSettingsCallOptions contains the retry settings for each method of ShippingSettingsClient.

ShippingSettingsClient

type ShippingSettingsClient struct {

	// The call options for this service.
	CallOptions *ShippingSettingsCallOptions
	// contains filtered or unexported fields
}

ShippingSettingsClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service to get method call shipping setting information per Merchant API method.

func NewShippingSettingsClient

func NewShippingSettingsClient(ctx context.Context, opts ...option.ClientOption) (*ShippingSettingsClient, error)

NewShippingSettingsClient creates a new shipping settings service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service to get method call shipping setting information per Merchant API method.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewShippingSettingsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewShippingSettingsRESTClient

func NewShippingSettingsRESTClient(ctx context.Context, opts ...option.ClientOption) (*ShippingSettingsClient, error)

NewShippingSettingsRESTClient creates a new shipping settings service rest client.

Service to get method call shipping setting information per Merchant API method.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewShippingSettingsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*ShippingSettingsClient) Close

func (c *ShippingSettingsClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*ShippingSettingsClient) Connection (deprecated)

func (c *ShippingSettingsClient) 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 (*ShippingSettingsClient) GetShippingSettings

GetShippingSettings retrieve shipping setting information.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewShippingSettingsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.GetShippingSettingsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#GetShippingSettingsRequest.
	}
	resp, err := c.GetShippingSettings(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ShippingSettingsClient) InsertShippingSettings

InsertShippingSettings replace the shipping setting of a business with the request shipping setting. Executing this method requires admin access.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewShippingSettingsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.InsertShippingSettingsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#InsertShippingSettingsRequest.
	}
	resp, err := c.InsertShippingSettings(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

TermsOfServiceAgreementStateCallOptions

type TermsOfServiceAgreementStateCallOptions struct {
	GetTermsOfServiceAgreementState                    []gax.CallOption
	RetrieveForApplicationTermsOfServiceAgreementState []gax.CallOption
}

TermsOfServiceAgreementStateCallOptions contains the retry settings for each method of TermsOfServiceAgreementStateClient.

TermsOfServiceAgreementStateClient

type TermsOfServiceAgreementStateClient struct {

	// The call options for this service.
	CallOptions *TermsOfServiceAgreementStateCallOptions
	// contains filtered or unexported fields
}

TermsOfServiceAgreementStateClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service to support TermsOfServiceAgreementState API.

func NewTermsOfServiceAgreementStateClient

func NewTermsOfServiceAgreementStateClient(ctx context.Context, opts ...option.ClientOption) (*TermsOfServiceAgreementStateClient, error)

NewTermsOfServiceAgreementStateClient creates a new terms of service agreement state service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service to support TermsOfServiceAgreementState API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewTermsOfServiceAgreementStateClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewTermsOfServiceAgreementStateRESTClient

func NewTermsOfServiceAgreementStateRESTClient(ctx context.Context, opts ...option.ClientOption) (*TermsOfServiceAgreementStateClient, error)

NewTermsOfServiceAgreementStateRESTClient creates a new terms of service agreement state service rest client.

Service to support TermsOfServiceAgreementState API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewTermsOfServiceAgreementStateRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*TermsOfServiceAgreementStateClient) Close

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*TermsOfServiceAgreementStateClient) Connection (deprecated)

func (c *TermsOfServiceAgreementStateClient) 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 (*TermsOfServiceAgreementStateClient) GetTermsOfServiceAgreementState

GetTermsOfServiceAgreementState returns the state of a terms of service agreement.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewTermsOfServiceAgreementStateClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.GetTermsOfServiceAgreementStateRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#GetTermsOfServiceAgreementStateRequest.
	}
	resp, err := c.GetTermsOfServiceAgreementState(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*TermsOfServiceAgreementStateClient) RetrieveForApplicationTermsOfServiceAgreementState

RetrieveForApplicationTermsOfServiceAgreementState retrieves the state of the agreement for the application terms of service.

Application terms of service covers permissions related to the usage of data provided through Merchant Center, CSS Center, Manufacturer Center, and more.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewTermsOfServiceAgreementStateClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.RetrieveForApplicationTermsOfServiceAgreementStateRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#RetrieveForApplicationTermsOfServiceAgreementStateRequest.
	}
	resp, err := c.RetrieveForApplicationTermsOfServiceAgreementState(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

TermsOfServiceCallOptions

type TermsOfServiceCallOptions struct {
	GetTermsOfService            []gax.CallOption
	RetrieveLatestTermsOfService []gax.CallOption
	AcceptTermsOfService         []gax.CallOption
}

TermsOfServiceCallOptions contains the retry settings for each method of TermsOfServiceClient.

TermsOfServiceClient

type TermsOfServiceClient struct {

	// The call options for this service.
	CallOptions *TermsOfServiceCallOptions
	// contains filtered or unexported fields
}

TermsOfServiceClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service to support TermsOfService API.

func NewTermsOfServiceClient

func NewTermsOfServiceClient(ctx context.Context, opts ...option.ClientOption) (*TermsOfServiceClient, error)

NewTermsOfServiceClient creates a new terms of service service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service to support TermsOfService API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewTermsOfServiceClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewTermsOfServiceRESTClient

func NewTermsOfServiceRESTClient(ctx context.Context, opts ...option.ClientOption) (*TermsOfServiceClient, error)

NewTermsOfServiceRESTClient creates a new terms of service service rest client.

Service to support TermsOfService API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewTermsOfServiceRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*TermsOfServiceClient) AcceptTermsOfService

AcceptTermsOfService accepts a TermsOfService. Executing this method requires admin access.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewTermsOfServiceClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.AcceptTermsOfServiceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#AcceptTermsOfServiceRequest.
	}
	resp, err := c.AcceptTermsOfService(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*TermsOfServiceClient) Close

func (c *TermsOfServiceClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*TermsOfServiceClient) Connection (deprecated)

func (c *TermsOfServiceClient) 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 (*TermsOfServiceClient) GetTermsOfService

GetTermsOfService retrieves the TermsOfService associated with the provided version.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewTermsOfServiceClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.GetTermsOfServiceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#GetTermsOfServiceRequest.
	}
	resp, err := c.GetTermsOfService(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*TermsOfServiceClient) RetrieveLatestTermsOfService

RetrieveLatestTermsOfService retrieves the latest version of the TermsOfService for a given kind and region_code.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewTermsOfServiceClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.RetrieveLatestTermsOfServiceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#RetrieveLatestTermsOfServiceRequest.
	}
	resp, err := c.RetrieveLatestTermsOfService(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

UserCallOptions

type UserCallOptions struct {
	GetUser    []gax.CallOption
	CreateUser []gax.CallOption
	DeleteUser []gax.CallOption
	UpdateUser []gax.CallOption
	ListUsers  []gax.CallOption
}

UserCallOptions contains the retry settings for each method of UserClient.

UserClient

type UserClient struct {

	// The call options for this service.
	CallOptions *UserCallOptions
	// contains filtered or unexported fields
}

UserClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service to support user API.

func NewUserClient

func NewUserClient(ctx context.Context, opts ...option.ClientOption) (*UserClient, error)

NewUserClient creates a new user service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service to support user API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewUserClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewUserRESTClient

func NewUserRESTClient(ctx context.Context, opts ...option.ClientOption) (*UserClient, error)

NewUserRESTClient creates a new user service rest client.

Service to support user API.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewUserRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*UserClient) Close

func (c *UserClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*UserClient) Connection (deprecated)

func (c *UserClient) 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 (*UserClient) CreateUser

func (c *UserClient) CreateUser(ctx context.Context, req *accountspb.CreateUserRequest, opts ...gax.CallOption) (*accountspb.User, error)

CreateUser creates a Merchant Center account user. Executing this method requires admin access.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewUserClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.CreateUserRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#CreateUserRequest.
	}
	resp, err := c.CreateUser(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*UserClient) DeleteUser

func (c *UserClient) DeleteUser(ctx context.Context, req *accountspb.DeleteUserRequest, opts ...gax.CallOption) error

DeleteUser deletes a Merchant Center account user. Executing this method requires admin access. The user to be deleted can’t be the last admin user of that account. Also a user is protected from deletion if it is managed by Business Manager"

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewUserClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.DeleteUserRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#DeleteUserRequest.
	}
	err = c.DeleteUser(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*UserClient) GetUser

GetUser retrieves a Merchant Center account user.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewUserClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.GetUserRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#GetUserRequest.
	}
	resp, err := c.GetUser(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*UserClient) ListUsers

func (c *UserClient) ListUsers(ctx context.Context, req *accountspb.ListUsersRequest, opts ...gax.CallOption) *UserIterator

ListUsers lists all users of a Merchant Center account.

Examples

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
	"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 := accounts.NewUserClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListUsersRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListUsersRequest.
	}
	it := c.ListUsers(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.(*accountspb.ListUsersResponse)
	}
}
all
package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewUserClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.ListUsersRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#ListUsersRequest.
	}
	for resp, err := range c.ListUsers(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*UserClient) UpdateUser

func (c *UserClient) UpdateUser(ctx context.Context, req *accountspb.UpdateUserRequest, opts ...gax.CallOption) (*accountspb.User, error)

UpdateUser updates a Merchant Center account user. Executing this method requires admin access.

Example

package main

import (
	"context"

	accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1"
	accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := accounts.NewUserClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &accountspb.UpdateUserRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb#UpdateUserRequest.
	}
	resp, err := c.UpdateUser(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

UserIterator

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

UserIterator manages a stream of *accountspb.User.

func (*UserIterator) All

func (it *UserIterator) All() iter.Seq2[*accountspb.User, error]

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

func (*UserIterator) Next

func (it *UserIterator) Next() (*accountspb.User, 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 (*UserIterator) PageInfo

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

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