Documentation ¶
Overview ¶
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:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage ¶
To get started with this package, create a client.
ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewAccountTaxClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client ¶
The following is an example of making an API call with the newly created client.
ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewAccountTaxClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &accountspb.GetAccountTaxRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb#GetAccountTaxRequest. } resp, err := c.GetAccountTax(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context ¶
The ctx passed to NewAccountTaxClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Index ¶
- func DefaultAuthScopes() []string
- type AccountIssueCallOptions
- type AccountIssueClient
- type AccountIssueIterator
- type AccountIterator
- type AccountTaxCallOptions
- type AccountTaxClient
- func (c *AccountTaxClient) Close() error
- func (c *AccountTaxClient) Connection() *grpc.ClientConndeprecated
- func (c *AccountTaxClient) GetAccountTax(ctx context.Context, req *accountspb.GetAccountTaxRequest, ...) (*accountspb.AccountTax, error)
- func (c *AccountTaxClient) ListAccountTax(ctx context.Context, req *accountspb.ListAccountTaxRequest, ...) *AccountTaxIterator
- func (c *AccountTaxClient) UpdateAccountTax(ctx context.Context, req *accountspb.UpdateAccountTaxRequest, ...) (*accountspb.AccountTax, error)
- type AccountTaxIterator
- type BusinessIdentityCallOptions
- type BusinessIdentityClient
- func (c *BusinessIdentityClient) Close() error
- func (c *BusinessIdentityClient) Connection() *grpc.ClientConndeprecated
- func (c *BusinessIdentityClient) GetBusinessIdentity(ctx context.Context, req *accountspb.GetBusinessIdentityRequest, ...) (*accountspb.BusinessIdentity, error)
- func (c *BusinessIdentityClient) UpdateBusinessIdentity(ctx context.Context, req *accountspb.UpdateBusinessIdentityRequest, ...) (*accountspb.BusinessIdentity, error)
- type BusinessInfoCallOptions
- type BusinessInfoClient
- func (c *BusinessInfoClient) Close() error
- func (c *BusinessInfoClient) Connection() *grpc.ClientConndeprecated
- func (c *BusinessInfoClient) GetBusinessInfo(ctx context.Context, req *accountspb.GetBusinessInfoRequest, ...) (*accountspb.BusinessInfo, error)
- func (c *BusinessInfoClient) UpdateBusinessInfo(ctx context.Context, req *accountspb.UpdateBusinessInfoRequest, ...) (*accountspb.BusinessInfo, error)
- type CallOptions
- type Client
- func (c *Client) Close() error
- func (c *Client) Connection() *grpc.ClientConndeprecated
- func (c *Client) CreateAndConfigureAccount(ctx context.Context, req *accountspb.CreateAndConfigureAccountRequest, ...) (*accountspb.Account, error)
- func (c *Client) DeleteAccount(ctx context.Context, req *accountspb.DeleteAccountRequest, ...) error
- func (c *Client) GetAccount(ctx context.Context, req *accountspb.GetAccountRequest, opts ...gax.CallOption) (*accountspb.Account, error)
- func (c *Client) ListAccounts(ctx context.Context, req *accountspb.ListAccountsRequest, ...) *AccountIterator
- func (c *Client) ListSubAccounts(ctx context.Context, req *accountspb.ListSubAccountsRequest, ...) *AccountIterator
- func (c *Client) UpdateAccount(ctx context.Context, req *accountspb.UpdateAccountRequest, ...) (*accountspb.Account, error)
- type EmailPreferencesCallOptions
- type EmailPreferencesClient
- func (c *EmailPreferencesClient) Close() error
- func (c *EmailPreferencesClient) Connection() *grpc.ClientConndeprecated
- func (c *EmailPreferencesClient) GetEmailPreferences(ctx context.Context, req *accountspb.GetEmailPreferencesRequest, ...) (*accountspb.EmailPreferences, error)
- func (c *EmailPreferencesClient) UpdateEmailPreferences(ctx context.Context, req *accountspb.UpdateEmailPreferencesRequest, ...) (*accountspb.EmailPreferences, error)
- type HomepageCallOptions
- type HomepageClient
- func (c *HomepageClient) ClaimHomepage(ctx context.Context, req *accountspb.ClaimHomepageRequest, ...) (*accountspb.Homepage, error)
- func (c *HomepageClient) Close() error
- func (c *HomepageClient) Connection() *grpc.ClientConndeprecated
- func (c *HomepageClient) GetHomepage(ctx context.Context, req *accountspb.GetHomepageRequest, ...) (*accountspb.Homepage, error)
- func (c *HomepageClient) UnclaimHomepage(ctx context.Context, req *accountspb.UnclaimHomepageRequest, ...) (*accountspb.Homepage, error)
- func (c *HomepageClient) UpdateHomepage(ctx context.Context, req *accountspb.UpdateHomepageRequest, ...) (*accountspb.Homepage, error)
- type OnlineReturnPolicyCallOptions
- type OnlineReturnPolicyClient
- func (c *OnlineReturnPolicyClient) Close() error
- func (c *OnlineReturnPolicyClient) Connection() *grpc.ClientConndeprecated
- func (c *OnlineReturnPolicyClient) GetOnlineReturnPolicy(ctx context.Context, req *accountspb.GetOnlineReturnPolicyRequest, ...) (*accountspb.OnlineReturnPolicy, error)
- func (c *OnlineReturnPolicyClient) ListOnlineReturnPolicies(ctx context.Context, req *accountspb.ListOnlineReturnPoliciesRequest, ...) *OnlineReturnPolicyIterator
- type OnlineReturnPolicyIterator
- type ProgramIterator
- type ProgramsCallOptions
- type ProgramsClient
- func (c *ProgramsClient) Close() error
- func (c *ProgramsClient) Connection() *grpc.ClientConndeprecated
- func (c *ProgramsClient) DisableProgram(ctx context.Context, req *accountspb.DisableProgramRequest, ...) (*accountspb.Program, error)
- func (c *ProgramsClient) EnableProgram(ctx context.Context, req *accountspb.EnableProgramRequest, ...) (*accountspb.Program, error)
- func (c *ProgramsClient) GetProgram(ctx context.Context, req *accountspb.GetProgramRequest, opts ...gax.CallOption) (*accountspb.Program, error)
- func (c *ProgramsClient) ListPrograms(ctx context.Context, req *accountspb.ListProgramsRequest, ...) *ProgramIterator
- type RegionIterator
- type RegionsCallOptions
- type RegionsClient
- func (c *RegionsClient) Close() error
- func (c *RegionsClient) Connection() *grpc.ClientConndeprecated
- func (c *RegionsClient) CreateRegion(ctx context.Context, req *accountspb.CreateRegionRequest, ...) (*accountspb.Region, error)
- func (c *RegionsClient) DeleteRegion(ctx context.Context, req *accountspb.DeleteRegionRequest, ...) error
- func (c *RegionsClient) GetRegion(ctx context.Context, req *accountspb.GetRegionRequest, opts ...gax.CallOption) (*accountspb.Region, error)
- func (c *RegionsClient) ListRegions(ctx context.Context, req *accountspb.ListRegionsRequest, ...) *RegionIterator
- func (c *RegionsClient) UpdateRegion(ctx context.Context, req *accountspb.UpdateRegionRequest, ...) (*accountspb.Region, error)
- type ShippingSettingsCallOptions
- type ShippingSettingsClient
- func (c *ShippingSettingsClient) Close() error
- func (c *ShippingSettingsClient) Connection() *grpc.ClientConndeprecated
- func (c *ShippingSettingsClient) GetShippingSettings(ctx context.Context, req *accountspb.GetShippingSettingsRequest, ...) (*accountspb.ShippingSettings, error)
- func (c *ShippingSettingsClient) InsertShippingSettings(ctx context.Context, req *accountspb.InsertShippingSettingsRequest, ...) (*accountspb.ShippingSettings, error)
- type TermsOfServiceAgreementStateCallOptions
- type TermsOfServiceAgreementStateClient
- func (c *TermsOfServiceAgreementStateClient) Close() error
- func (c *TermsOfServiceAgreementStateClient) Connection() *grpc.ClientConndeprecated
- func (c *TermsOfServiceAgreementStateClient) GetTermsOfServiceAgreementState(ctx context.Context, req *accountspb.GetTermsOfServiceAgreementStateRequest, ...) (*accountspb.TermsOfServiceAgreementState, error)
- func (c *TermsOfServiceAgreementStateClient) RetrieveForApplicationTermsOfServiceAgreementState(ctx context.Context, ...) (*accountspb.TermsOfServiceAgreementState, error)
- type TermsOfServiceCallOptions
- type TermsOfServiceClient
- func (c *TermsOfServiceClient) AcceptTermsOfService(ctx context.Context, req *accountspb.AcceptTermsOfServiceRequest, ...) error
- func (c *TermsOfServiceClient) Close() error
- func (c *TermsOfServiceClient) Connection() *grpc.ClientConndeprecated
- func (c *TermsOfServiceClient) GetTermsOfService(ctx context.Context, req *accountspb.GetTermsOfServiceRequest, ...) (*accountspb.TermsOfService, error)
- func (c *TermsOfServiceClient) RetrieveLatestTermsOfService(ctx context.Context, req *accountspb.RetrieveLatestTermsOfServiceRequest, ...) (*accountspb.TermsOfService, error)
- type UserCallOptions
- type UserClient
- func (c *UserClient) Close() error
- func (c *UserClient) Connection() *grpc.ClientConndeprecated
- func (c *UserClient) CreateUser(ctx context.Context, req *accountspb.CreateUserRequest, opts ...gax.CallOption) (*accountspb.User, error)
- func (c *UserClient) DeleteUser(ctx context.Context, req *accountspb.DeleteUserRequest, opts ...gax.CallOption) error
- func (c *UserClient) GetUser(ctx context.Context, req *accountspb.GetUserRequest, opts ...gax.CallOption) (*accountspb.User, error)
- func (c *UserClient) ListUsers(ctx context.Context, req *accountspb.ListUsersRequest, opts ...gax.CallOption) *UserIterator
- func (c *UserClient) UpdateUser(ctx context.Context, req *accountspb.UpdateUserRequest, opts ...gax.CallOption) (*accountspb.User, error)
- type UserIterator
Examples ¶
- AccountIssueClient.ListAccountIssues
- AccountTaxClient.GetAccountTax
- AccountTaxClient.ListAccountTax
- AccountTaxClient.UpdateAccountTax
- BusinessIdentityClient.GetBusinessIdentity
- BusinessIdentityClient.UpdateBusinessIdentity
- BusinessInfoClient.GetBusinessInfo
- BusinessInfoClient.UpdateBusinessInfo
- Client.CreateAndConfigureAccount
- Client.DeleteAccount
- Client.GetAccount
- Client.ListAccounts
- Client.ListSubAccounts
- Client.UpdateAccount
- EmailPreferencesClient.GetEmailPreferences
- EmailPreferencesClient.UpdateEmailPreferences
- HomepageClient.ClaimHomepage
- HomepageClient.GetHomepage
- HomepageClient.UnclaimHomepage
- HomepageClient.UpdateHomepage
- NewAccountIssueClient
- NewAccountIssueRESTClient
- NewAccountTaxClient
- NewAccountTaxRESTClient
- NewBusinessIdentityClient
- NewBusinessIdentityRESTClient
- NewBusinessInfoClient
- NewBusinessInfoRESTClient
- NewClient
- NewEmailPreferencesClient
- NewEmailPreferencesRESTClient
- NewHomepageClient
- NewHomepageRESTClient
- NewOnlineReturnPolicyClient
- NewOnlineReturnPolicyRESTClient
- NewProgramsClient
- NewProgramsRESTClient
- NewRESTClient
- NewRegionsClient
- NewRegionsRESTClient
- NewShippingSettingsClient
- NewShippingSettingsRESTClient
- NewTermsOfServiceAgreementStateClient
- NewTermsOfServiceAgreementStateRESTClient
- NewTermsOfServiceClient
- NewTermsOfServiceRESTClient
- NewUserClient
- NewUserRESTClient
- OnlineReturnPolicyClient.GetOnlineReturnPolicy
- OnlineReturnPolicyClient.ListOnlineReturnPolicies
- ProgramsClient.DisableProgram
- ProgramsClient.EnableProgram
- ProgramsClient.GetProgram
- ProgramsClient.ListPrograms
- RegionsClient.CreateRegion
- RegionsClient.DeleteRegion
- RegionsClient.GetRegion
- RegionsClient.ListRegions
- RegionsClient.UpdateRegion
- ShippingSettingsClient.GetShippingSettings
- ShippingSettingsClient.InsertShippingSettings
- TermsOfServiceAgreementStateClient.GetTermsOfServiceAgreementState
- TermsOfServiceAgreementStateClient.RetrieveForApplicationTermsOfServiceAgreementState
- TermsOfServiceClient.AcceptTermsOfService
- TermsOfServiceClient.GetTermsOfService
- TermsOfServiceClient.RetrieveLatestTermsOfService
- UserClient.CreateUser
- UserClient.DeleteUser
- UserClient.GetUser
- UserClient.ListUsers
- UserClient.UpdateUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type AccountIssueCallOptions ¶
type AccountIssueCallOptions struct {
ListAccountIssues []gax.CallOption
}
AccountIssueCallOptions contains the retry settings for each method of AccountIssueClient.
type 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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewAccountIssueClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewAccountIssueRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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 ¶
func (c *AccountIssueClient) ListAccountIssues(ctx context.Context, req *accountspb.ListAccountIssuesRequest, opts ...gax.CallOption) *AccountIssueIterator
ListAccountIssues lists all account issues of a Merchant Center account.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/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) } }
Output:
type 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) Next ¶
func (it *AccountIssueIterator) Next() (*accountspb.AccountIssue, 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 (*AccountIssueIterator) PageInfo ¶
func (it *AccountIssueIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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) 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.
type AccountTaxCallOptions ¶
type AccountTaxCallOptions struct { GetAccountTax []gax.CallOption ListAccountTax []gax.CallOption UpdateAccountTax []gax.CallOption }
AccountTaxCallOptions contains the retry settings for each method of AccountTaxClient.
type AccountTaxClient ¶
type AccountTaxClient struct { // The call options for this service. CallOptions *AccountTaxCallOptions // contains filtered or unexported fields }
AccountTaxClient 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 account level tax setting data.
This API defines the following resource model:
AccountTax
func NewAccountTaxClient ¶
func NewAccountTaxClient(ctx context.Context, opts ...option.ClientOption) (*AccountTaxClient, error)
NewAccountTaxClient creates a new account tax service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Manages account level tax setting data.
This API defines the following resource model:
AccountTax
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewAccountTaxClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewAccountTaxRESTClient ¶
func NewAccountTaxRESTClient(ctx context.Context, opts ...option.ClientOption) (*AccountTaxClient, error)
NewAccountTaxRESTClient creates a new account tax service rest client.
Manages account level tax setting data.
This API defines the following resource model:
AccountTax
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewAccountTaxRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*AccountTaxClient) Close ¶
func (c *AccountTaxClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*AccountTaxClient) Connection
deprecated
func (c *AccountTaxClient) 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 (*AccountTaxClient) GetAccountTax ¶
func (c *AccountTaxClient) GetAccountTax(ctx context.Context, req *accountspb.GetAccountTaxRequest, opts ...gax.CallOption) (*accountspb.AccountTax, error)
GetAccountTax returns the tax rules that match the conditions of GetAccountTaxRequest
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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.NewAccountTaxClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &accountspb.GetAccountTaxRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb#GetAccountTaxRequest. } resp, err := c.GetAccountTax(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*AccountTaxClient) ListAccountTax ¶
func (c *AccountTaxClient) ListAccountTax(ctx context.Context, req *accountspb.ListAccountTaxRequest, opts ...gax.CallOption) *AccountTaxIterator
ListAccountTax lists the tax settings of the sub-accounts only in your Merchant Center account. This method can only be called on a multi-client account, otherwise it’ll return an error.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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.NewAccountTaxClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &accountspb.ListAccountTaxRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb#ListAccountTaxRequest. } it := c.ListAccountTax(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.ListAccountTaxResponse) } }
Output:
func (*AccountTaxClient) UpdateAccountTax ¶
func (c *AccountTaxClient) UpdateAccountTax(ctx context.Context, req *accountspb.UpdateAccountTaxRequest, opts ...gax.CallOption) (*accountspb.AccountTax, error)
UpdateAccountTax updates the tax settings of the account.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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.NewAccountTaxClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &accountspb.UpdateAccountTaxRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb#UpdateAccountTaxRequest. } resp, err := c.UpdateAccountTax(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type AccountTaxIterator ¶
type AccountTaxIterator 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.AccountTax, nextPageToken string, err error) // contains filtered or unexported fields }
AccountTaxIterator manages a stream of *accountspb.AccountTax.
func (*AccountTaxIterator) Next ¶
func (it *AccountTaxIterator) Next() (*accountspb.AccountTax, 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 (*AccountTaxIterator) PageInfo ¶
func (it *AccountTaxIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type BusinessIdentityCallOptions ¶
type BusinessIdentityCallOptions struct { GetBusinessIdentity []gax.CallOption UpdateBusinessIdentity []gax.CallOption }
BusinessIdentityCallOptions contains the retry settings for each method of BusinessIdentityClient.
type 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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewBusinessIdentityClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewBusinessIdentityRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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 ¶
func (c *BusinessIdentityClient) GetBusinessIdentity(ctx context.Context, req *accountspb.GetBusinessIdentityRequest, opts ...gax.CallOption) (*accountspb.BusinessIdentity, error)
GetBusinessIdentity retrieves the business identity of an account.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#GetBusinessIdentityRequest. } resp, err := c.GetBusinessIdentity(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*BusinessIdentityClient) UpdateBusinessIdentity ¶
func (c *BusinessIdentityClient) UpdateBusinessIdentity(ctx context.Context, req *accountspb.UpdateBusinessIdentityRequest, opts ...gax.CallOption) (*accountspb.BusinessIdentity, error)
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/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#UpdateBusinessIdentityRequest. } resp, err := c.UpdateBusinessIdentity(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type BusinessInfoCallOptions ¶
type BusinessInfoCallOptions struct { GetBusinessInfo []gax.CallOption UpdateBusinessInfo []gax.CallOption }
BusinessInfoCallOptions contains the retry settings for each method of BusinessInfoClient.
type 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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewBusinessInfoClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewBusinessInfoRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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 ¶
func (c *BusinessInfoClient) GetBusinessInfo(ctx context.Context, req *accountspb.GetBusinessInfoRequest, opts ...gax.CallOption) (*accountspb.BusinessInfo, error)
GetBusinessInfo retrieves the business info of an account.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#GetBusinessInfoRequest. } resp, err := c.GetBusinessInfo(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*BusinessInfoClient) UpdateBusinessInfo ¶
func (c *BusinessInfoClient) UpdateBusinessInfo(ctx context.Context, req *accountspb.UpdateBusinessInfoRequest, opts ...gax.CallOption) (*accountspb.BusinessInfo, error)
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/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#UpdateBusinessInfoRequest. } resp, err := c.UpdateBusinessInfo(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type 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.
type Client ¶
type Client struct { // The call options for this service. CallOptions *CallOptions // contains filtered or unexported fields }
Client is a client for interacting with 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 ¶
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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewRESTClient ¶
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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*Client) Close ¶
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) Connection
deprecated
func (c *Client) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*Client) CreateAndConfigureAccount ¶
func (c *Client) CreateAndConfigureAccount(ctx context.Context, req *accountspb.CreateAndConfigureAccountRequest, opts ...gax.CallOption) (*accountspb.Account, error)
CreateAndConfigureAccount creates a standalone 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/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#CreateAndConfigureAccountRequest. } resp, err := c.CreateAndConfigureAccount(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
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, MCA or sub-account. Deleting an MCA leads to the deletion of all of its sub-accounts. Executing this method requires admin access.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#DeleteAccountRequest. } err = c.DeleteAccount(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
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/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#GetAccountRequest. } resp, err := c.GetAccount(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) ListAccounts ¶
func (c *Client) ListAccounts(ctx context.Context, req *accountspb.ListAccountsRequest, opts ...gax.CallOption) *AccountIterator
ListAccounts lists accounts accessible to the calling user and matching the constraints of the request such as page size or filters. This is not just listing the sub-accounts of an MCA, but all accounts the calling user has access to including other MCAs, linked accounts, standalone accounts and so on.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/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) } }
Output:
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 multi client account. This is a convenience wrapper for the more powerful ListAccounts method. This method will produce the same results as calling ListsAccounts with the following filter: relationship(providerId={parent} AND service(type="ACCOUNT_AGGREGATION"))
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/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) } }
Output:
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, MCA or sub-account. Executing this method requires admin access.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#UpdateAccountRequest. } resp, err := c.UpdateAccount(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type EmailPreferencesCallOptions ¶
type EmailPreferencesCallOptions struct { GetEmailPreferences []gax.CallOption UpdateEmailPreferences []gax.CallOption }
EmailPreferencesCallOptions contains the retry settings for each method of EmailPreferencesClient.
type 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.
This service only permits retrieving and updating email preferences for the authenticated user.
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.
This service only permits retrieving and updating email preferences for the authenticated user.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewEmailPreferencesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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.
This service only permits retrieving and updating email preferences for the authenticated user.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewEmailPreferencesRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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 ¶
func (c *EmailPreferencesClient) GetEmailPreferences(ctx context.Context, req *accountspb.GetEmailPreferencesRequest, opts ...gax.CallOption) (*accountspb.EmailPreferences, error)
GetEmailPreferences returns the email preferences for a Merchant Center account 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/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#GetEmailPreferencesRequest. } resp, err := c.GetEmailPreferences(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*EmailPreferencesClient) UpdateEmailPreferences ¶
func (c *EmailPreferencesClient) UpdateEmailPreferences(ctx context.Context, req *accountspb.UpdateEmailPreferencesRequest, opts ...gax.CallOption) (*accountspb.EmailPreferences, error)
UpdateEmailPreferences updates the email preferences for a Merchant Center account user. MCA users should specify the MCA account rather than a sub-account of the MCA.
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/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#UpdateEmailPreferencesRequest. } resp, err := c.UpdateEmailPreferences(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type 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.
type 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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewHomepageClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewHomepageRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*HomepageClient) ClaimHomepage ¶
func (c *HomepageClient) ClaimHomepage(ctx context.Context, req *accountspb.ClaimHomepageRequest, opts ...gax.CallOption) (*accountspb.Homepage, error)
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 merchant 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 will be returned: * PERMISSION_DENIED: user doesn’t have the necessary permissions on this MC account; * FAILED_PRECONDITION: - The account is not a Merchant Center account; - MC account doesn’t have a homepage; - claiming failed (in this case the error message will contain more details).
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#ClaimHomepageRequest. } resp, err := c.ClaimHomepage(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
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 ¶
func (c *HomepageClient) GetHomepage(ctx context.Context, req *accountspb.GetHomepageRequest, opts ...gax.CallOption) (*accountspb.Homepage, error)
GetHomepage retrieves a store’s homepage.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#GetHomepageRequest. } resp, err := c.GetHomepage(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*HomepageClient) UnclaimHomepage ¶
func (c *HomepageClient) UnclaimHomepage(ctx context.Context, req *accountspb.UnclaimHomepageRequest, opts ...gax.CallOption) (*accountspb.Homepage, error)
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/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#UnclaimHomepageRequest. } resp, err := c.UnclaimHomepage(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*HomepageClient) UpdateHomepage ¶
func (c *HomepageClient) UpdateHomepage(ctx context.Context, req *accountspb.UpdateHomepageRequest, opts ...gax.CallOption) (*accountspb.Homepage, error)
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/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#UpdateHomepageRequest. } resp, err := c.UpdateHomepage(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type OnlineReturnPolicyCallOptions ¶
type OnlineReturnPolicyCallOptions struct { GetOnlineReturnPolicy []gax.CallOption ListOnlineReturnPolicies []gax.CallOption }
OnlineReturnPolicyCallOptions contains the retry settings for each method of OnlineReturnPolicyClient.
type 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 merchant’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 merchant’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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewOnlineReturnPolicyClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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 merchant’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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewOnlineReturnPolicyRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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) GetOnlineReturnPolicy ¶
func (c *OnlineReturnPolicyClient) GetOnlineReturnPolicy(ctx context.Context, req *accountspb.GetOnlineReturnPolicyRequest, opts ...gax.CallOption) (*accountspb.OnlineReturnPolicy, error)
GetOnlineReturnPolicy gets an existing return policy.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#GetOnlineReturnPolicyRequest. } resp, err := c.GetOnlineReturnPolicy(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*OnlineReturnPolicyClient) ListOnlineReturnPolicies ¶
func (c *OnlineReturnPolicyClient) ListOnlineReturnPolicies(ctx context.Context, req *accountspb.ListOnlineReturnPoliciesRequest, opts ...gax.CallOption) *OnlineReturnPolicyIterator
ListOnlineReturnPolicies lists all existing return policies.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/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) } }
Output:
type 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) Next ¶
func (it *OnlineReturnPolicyIterator) Next() (*accountspb.OnlineReturnPolicy, 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 (*OnlineReturnPolicyIterator) PageInfo ¶
func (it *OnlineReturnPolicyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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) 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.
type 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.
type 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/topic/9240261?ref_topic=7257954,7259405,&sjid=796648681813264022-EU) program, which enables products from a merchant’s store to be shown across Google for free.
This service exposes methods to retrieve a merchant’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/topic/9240261?ref_topic=7257954,7259405,&sjid=796648681813264022-EU) program, which enables products from a merchant’s store to be shown across Google for free.
This service exposes methods to retrieve a merchant’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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewProgramsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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/topic/9240261?ref_topic=7257954,7259405,&sjid=796648681813264022-EU) program, which enables products from a merchant’s store to be shown across Google for free.
This service exposes methods to retrieve a merchant’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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewProgramsRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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 ¶
func (c *ProgramsClient) DisableProgram(ctx context.Context, req *accountspb.DisableProgramRequest, opts ...gax.CallOption) (*accountspb.Program, error)
DisableProgram disable participation in the specified program for the account. Executing this method requires admin access.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#DisableProgramRequest. } resp, err := c.DisableProgram(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ProgramsClient) EnableProgram ¶
func (c *ProgramsClient) EnableProgram(ctx context.Context, req *accountspb.EnableProgramRequest, opts ...gax.CallOption) (*accountspb.Program, error)
EnableProgram enable participation in the specified program for the account. Executing this method requires admin access.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#EnableProgramRequest. } resp, err := c.EnableProgram(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ProgramsClient) GetProgram ¶
func (c *ProgramsClient) GetProgram(ctx context.Context, req *accountspb.GetProgramRequest, opts ...gax.CallOption) (*accountspb.Program, error)
GetProgram retrieves the specified program for the account.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#GetProgramRequest. } resp, err := c.GetProgram(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ProgramsClient) ListPrograms ¶
func (c *ProgramsClient) ListPrograms(ctx context.Context, req *accountspb.ListProgramsRequest, opts ...gax.CallOption) *ProgramIterator
ListPrograms retrieves all programs for the account.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/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) } }
Output:
type 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) 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.
type RegionsCallOptions ¶
type RegionsCallOptions struct { GetRegion []gax.CallOption CreateRegion []gax.CallOption UpdateRegion []gax.CallOption DeleteRegion []gax.CallOption ListRegions []gax.CallOption }
RegionsCallOptions contains the retry settings for each method of RegionsClient.
type 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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewRegionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewRegionsRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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 ¶
func (c *RegionsClient) CreateRegion(ctx context.Context, req *accountspb.CreateRegionRequest, opts ...gax.CallOption) (*accountspb.Region, error)
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/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#CreateRegionRequest. } resp, err := c.CreateRegion(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
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/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#DeleteRegionRequest. } err = c.DeleteRegion(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*RegionsClient) GetRegion ¶
func (c *RegionsClient) GetRegion(ctx context.Context, req *accountspb.GetRegionRequest, opts ...gax.CallOption) (*accountspb.Region, error)
GetRegion retrieves a region defined in your Merchant Center account.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#GetRegionRequest. } resp, err := c.GetRegion(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegionsClient) ListRegions ¶
func (c *RegionsClient) ListRegions(ctx context.Context, req *accountspb.ListRegionsRequest, opts ...gax.CallOption) *RegionIterator
ListRegions lists the regions in your Merchant Center account.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/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) } }
Output:
func (*RegionsClient) UpdateRegion ¶
func (c *RegionsClient) UpdateRegion(ctx context.Context, req *accountspb.UpdateRegionRequest, opts ...gax.CallOption) (*accountspb.Region, error)
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/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#UpdateRegionRequest. } resp, err := c.UpdateRegion(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type ShippingSettingsCallOptions ¶
type ShippingSettingsCallOptions struct { GetShippingSettings []gax.CallOption InsertShippingSettings []gax.CallOption }
ShippingSettingsCallOptions contains the retry settings for each method of ShippingSettingsClient.
type 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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewShippingSettingsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewShippingSettingsRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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 ¶
func (c *ShippingSettingsClient) GetShippingSettings(ctx context.Context, req *accountspb.GetShippingSettingsRequest, opts ...gax.CallOption) (*accountspb.ShippingSettings, error)
GetShippingSettings retrieve shipping setting information.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#GetShippingSettingsRequest. } resp, err := c.GetShippingSettings(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ShippingSettingsClient) InsertShippingSettings ¶
func (c *ShippingSettingsClient) InsertShippingSettings(ctx context.Context, req *accountspb.InsertShippingSettingsRequest, opts ...gax.CallOption) (*accountspb.ShippingSettings, error)
InsertShippingSettings replace the shipping setting of a merchant with the request shipping setting. Executing this method requires admin access.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#InsertShippingSettingsRequest. } resp, err := c.InsertShippingSettings(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type TermsOfServiceAgreementStateCallOptions ¶
type TermsOfServiceAgreementStateCallOptions struct { GetTermsOfServiceAgreementState []gax.CallOption RetrieveForApplicationTermsOfServiceAgreementState []gax.CallOption }
TermsOfServiceAgreementStateCallOptions contains the retry settings for each method of TermsOfServiceAgreementStateClient.
type 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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewTermsOfServiceAgreementStateClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewTermsOfServiceAgreementStateRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*TermsOfServiceAgreementStateClient) Close ¶
func (c *TermsOfServiceAgreementStateClient) Close() error
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 ¶
func (c *TermsOfServiceAgreementStateClient) GetTermsOfServiceAgreementState(ctx context.Context, req *accountspb.GetTermsOfServiceAgreementStateRequest, opts ...gax.CallOption) (*accountspb.TermsOfServiceAgreementState, error)
GetTermsOfServiceAgreementState returns the state of a terms of service agreement.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#GetTermsOfServiceAgreementStateRequest. } resp, err := c.GetTermsOfServiceAgreementState(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*TermsOfServiceAgreementStateClient) RetrieveForApplicationTermsOfServiceAgreementState ¶
func (c *TermsOfServiceAgreementStateClient) RetrieveForApplicationTermsOfServiceAgreementState(ctx context.Context, req *accountspb.RetrieveForApplicationTermsOfServiceAgreementStateRequest, opts ...gax.CallOption) (*accountspb.TermsOfServiceAgreementState, error)
RetrieveForApplicationTermsOfServiceAgreementState retrieves the state of the agreement for the application terms of service.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#RetrieveForApplicationTermsOfServiceAgreementStateRequest. } resp, err := c.RetrieveForApplicationTermsOfServiceAgreementState(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type TermsOfServiceCallOptions ¶
type TermsOfServiceCallOptions struct { GetTermsOfService []gax.CallOption RetrieveLatestTermsOfService []gax.CallOption AcceptTermsOfService []gax.CallOption }
TermsOfServiceCallOptions contains the retry settings for each method of TermsOfServiceClient.
type 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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewTermsOfServiceClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewTermsOfServiceRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*TermsOfServiceClient) AcceptTermsOfService ¶
func (c *TermsOfServiceClient) AcceptTermsOfService(ctx context.Context, req *accountspb.AcceptTermsOfServiceRequest, opts ...gax.CallOption) error
AcceptTermsOfService accepts a TermsOfService. Executing this method requires admin access.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#AcceptTermsOfServiceRequest. } err = c.AcceptTermsOfService(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
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 ¶
func (c *TermsOfServiceClient) GetTermsOfService(ctx context.Context, req *accountspb.GetTermsOfServiceRequest, opts ...gax.CallOption) (*accountspb.TermsOfService, error)
GetTermsOfService retrieves the TermsOfService associated with the provided version.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#GetTermsOfServiceRequest. } resp, err := c.GetTermsOfService(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*TermsOfServiceClient) RetrieveLatestTermsOfService ¶
func (c *TermsOfServiceClient) RetrieveLatestTermsOfService(ctx context.Context, req *accountspb.RetrieveLatestTermsOfServiceRequest, opts ...gax.CallOption) (*accountspb.TermsOfService, error)
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/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#RetrieveLatestTermsOfServiceRequest. } resp, err := c.RetrieveLatestTermsOfService(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type 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.
type 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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewUserClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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/apiv1beta" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := accounts.NewUserRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
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/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#CreateUserRequest. } resp, err := c.CreateUser(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
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.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#DeleteUserRequest. } err = c.DeleteUser(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*UserClient) GetUser ¶
func (c *UserClient) GetUser(ctx context.Context, req *accountspb.GetUserRequest, opts ...gax.CallOption) (*accountspb.User, error)
GetUser retrieves a Merchant Center account user.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#GetUserRequest. } resp, err := c.GetUser(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
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.
Example ¶
package main import ( "context" accounts "cloud.google.com/go/shopping/merchant/accounts/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/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) } }
Output:
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/apiv1beta" accountspb "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/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/apiv1beta/accountspb#UpdateUserRequest. } resp, err := c.UpdateUser(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type 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) 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.
Source Files ¶
- account_issue_client.go
- account_tax_client.go
- accounts_client.go
- auxiliary.go
- business_identity_client.go
- business_info_client.go
- doc.go
- email_preferences_client.go
- homepage_client.go
- online_return_policy_client.go
- programs_client.go
- regions_client.go
- shipping_settings_client.go
- terms_of_service_agreement_state_client.go
- terms_of_service_client.go
- user_client.go
- version.go