CSS API v1 - Package cloud.google.com/go/shopping/css/apiv1 (v1.2.1) Stay organized with collections Save and categorize content based on your preferences.
Beta
This library is covered by thePre-GA Offerings Terms of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see thelaunch stage descriptions.
Note: To get more information about this package, such as access to older versions, viewthis package on pkg.go.dev.Package css is an auto-generated package for theCSS API.
Programmatically manage your Comparison Shopping Service (CSS) accountdata at scale.
NOTE:Thispackageisinbeta.Itisnotstable,andmaybesubjecttochanges.
General documentation
For information that is relevant for all client libraries please referencehttps://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on thispage includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
// go get cloud.google.com/go/shopping/css/apiv1@latestctx:=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_Optionsc,err:=css.NewAccountsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed.The methods of Client are safe for concurrent use by multiple goroutines.The returned client must be Closed when it is done being used.
Using the Client
The following is an example of making an API call with the newly created client, mentioned above.
req:=&csspb.GetAccountRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/shopping/css/apiv1/csspb#GetAccountRequest.}resp,err:=c.GetAccount(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp
Use of Context
The ctx passed to NewAccountsClient is used for authentication requests andfor creating the underlying connection, but is not used for subsequent calls.Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Functions
func DefaultAuthScopes
funcDefaultAuthScopes()[]stringDefaultAuthScopes reports the default set of authentication scopes to use with this package.
AccountIterator
typeAccountIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*csspb.Account,nextPageTokenstring,errerror)// contains filtered or unexported fields}AccountIterator manages a stream of *csspb.Account.
func (*AccountIterator) All
func(it*AccountIterator)All()iter.Seq2[*csspb.Account,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*AccountIterator) Next
func(it*AccountIterator)Next()(*csspb.Account,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*AccountIterator) PageInfo
func(it*AccountIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
AccountLabelIterator
typeAccountLabelIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*csspb.AccountLabel,nextPageTokenstring,errerror)// contains filtered or unexported fields}AccountLabelIterator manages a stream of *csspb.AccountLabel.
func (*AccountLabelIterator) All
func(it*AccountLabelIterator)All()iter.Seq2[*csspb.AccountLabel,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*AccountLabelIterator) Next
func(it*AccountLabelIterator)Next()(*csspb.AccountLabel,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*AccountLabelIterator) PageInfo
func(it*AccountLabelIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
AccountLabelsCallOptions
typeAccountLabelsCallOptionsstruct{ListAccountLabels[]gax.CallOptionCreateAccountLabel[]gax.CallOptionUpdateAccountLabel[]gax.CallOptionDeleteAccountLabel[]gax.CallOption}AccountLabelsCallOptions contains the retry settings for each method of AccountLabelsClient.
AccountLabelsClient
typeAccountLabelsClientstruct{// The call options for this service.CallOptions*AccountLabelsCallOptions// contains filtered or unexported fields}AccountLabelsClient is a client for interacting with CSS API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Manages Merchant Center and CSS accounts labels.
func NewAccountLabelsClient
funcNewAccountLabelsClient(ctxcontext.Context,opts...option.ClientOption)(*AccountLabelsClient,error)NewAccountLabelsClient creates a new account labels service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Manages Merchant Center and CSS accounts labels.
Example
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1")funcmain(){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_Optionsc,err:=css.NewAccountLabelsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewAccountLabelsRESTClient
funcNewAccountLabelsRESTClient(ctxcontext.Context,opts...option.ClientOption)(*AccountLabelsClient,error)NewAccountLabelsRESTClient creates a new account labels service rest client.
Manages Merchant Center and CSS accounts labels.
Example
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1")funcmain(){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_Optionsc,err:=css.NewAccountLabelsRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*AccountLabelsClient) Close
func(c*AccountLabelsClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*AccountLabelsClient) Connection (deprecated)
func(c*AccountLabelsClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*AccountLabelsClient) CreateAccountLabel
func(c*AccountLabelsClient)CreateAccountLabel(ctxcontext.Context,req*csspb.CreateAccountLabelRequest,opts...gax.CallOption)(*csspb.AccountLabel,error)CreateAccountLabel creates a new label, not assigned to any account.
Example
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1"csspb"cloud.google.com/go/shopping/css/apiv1/csspb")funcmain(){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_Optionsc,err:=css.NewAccountLabelsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&csspb.CreateAccountLabelRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/shopping/css/apiv1/csspb#CreateAccountLabelRequest.}resp,err:=c.CreateAccountLabel(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*AccountLabelsClient) DeleteAccountLabel
func(c*AccountLabelsClient)DeleteAccountLabel(ctxcontext.Context,req*csspb.DeleteAccountLabelRequest,opts...gax.CallOption)errorDeleteAccountLabel deletes a label and removes it from all accounts to which it was assigned.
Example
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1"csspb"cloud.google.com/go/shopping/css/apiv1/csspb")funcmain(){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_Optionsc,err:=css.NewAccountLabelsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&csspb.DeleteAccountLabelRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/shopping/css/apiv1/csspb#DeleteAccountLabelRequest.}err=c.DeleteAccountLabel(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*AccountLabelsClient) ListAccountLabels
func(c*AccountLabelsClient)ListAccountLabels(ctxcontext.Context,req*csspb.ListAccountLabelsRequest,opts...gax.CallOption)*AccountLabelIteratorListAccountLabels lists the labels owned by an account.
Examples
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1"csspb"cloud.google.com/go/shopping/css/apiv1/csspb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=css.NewAccountLabelsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&csspb.ListAccountLabelsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/shopping/css/apiv1/csspb#ListAccountLabelsRequest.}it:=c.ListAccountLabels(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*csspb.ListAccountLabelsResponse)}}all
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1"csspb"cloud.google.com/go/shopping/css/apiv1/csspb")funcmain(){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_Optionsc,err:=css.NewAccountLabelsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&csspb.ListAccountLabelsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/shopping/css/apiv1/csspb#ListAccountLabelsRequest.}forresp,err:=rangec.ListAccountLabels(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*AccountLabelsClient) UpdateAccountLabel
func(c*AccountLabelsClient)UpdateAccountLabel(ctxcontext.Context,req*csspb.UpdateAccountLabelRequest,opts...gax.CallOption)(*csspb.AccountLabel,error)UpdateAccountLabel updates a label.
Example
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1"csspb"cloud.google.com/go/shopping/css/apiv1/csspb")funcmain(){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_Optionsc,err:=css.NewAccountLabelsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&csspb.UpdateAccountLabelRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/shopping/css/apiv1/csspb#UpdateAccountLabelRequest.}resp,err:=c.UpdateAccountLabel(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}AccountsCallOptions
typeAccountsCallOptionsstruct{ListChildAccounts[]gax.CallOptionGetAccount[]gax.CallOptionUpdateLabels[]gax.CallOption}AccountsCallOptions contains the retry settings for each method of AccountsClient.
AccountsClient
typeAccountsClientstruct{// The call options for this service.CallOptions*AccountsCallOptions// contains filtered or unexported fields}AccountsClient is a client for interacting with CSS API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing CSS/MC account information.
func NewAccountsClient
funcNewAccountsClient(ctxcontext.Context,opts...option.ClientOption)(*AccountsClient,error)NewAccountsClient 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 for managing CSS/MC account information.
Example
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1")funcmain(){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_Optionsc,err:=css.NewAccountsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewAccountsRESTClient
funcNewAccountsRESTClient(ctxcontext.Context,opts...option.ClientOption)(*AccountsClient,error)NewAccountsRESTClient creates a new accounts service rest client.
Service for managing CSS/MC account information.
Example
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1")funcmain(){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_Optionsc,err:=css.NewAccountsRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*AccountsClient) Close
func(c*AccountsClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*AccountsClient) Connection (deprecated)
func(c*AccountsClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*AccountsClient) GetAccount
func(c*AccountsClient)GetAccount(ctxcontext.Context,req*csspb.GetAccountRequest,opts...gax.CallOption)(*csspb.Account,error)GetAccount retrieves a single CSS/MC account by ID.
Example
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1"csspb"cloud.google.com/go/shopping/css/apiv1/csspb")funcmain(){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_Optionsc,err:=css.NewAccountsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&csspb.GetAccountRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/shopping/css/apiv1/csspb#GetAccountRequest.}resp,err:=c.GetAccount(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*AccountsClient) ListChildAccounts
func(c*AccountsClient)ListChildAccounts(ctxcontext.Context,req*csspb.ListChildAccountsRequest,opts...gax.CallOption)*AccountIteratorListChildAccounts lists all the accounts under the specified CSS account ID, andoptionally filters by label ID and account name.
Examples
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1"csspb"cloud.google.com/go/shopping/css/apiv1/csspb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=css.NewAccountsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&csspb.ListChildAccountsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/shopping/css/apiv1/csspb#ListChildAccountsRequest.}it:=c.ListChildAccounts(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*csspb.ListChildAccountsResponse)}}all
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1"csspb"cloud.google.com/go/shopping/css/apiv1/csspb")funcmain(){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_Optionsc,err:=css.NewAccountsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&csspb.ListChildAccountsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/shopping/css/apiv1/csspb#ListChildAccountsRequest.}forresp,err:=rangec.ListChildAccounts(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*AccountsClient) UpdateLabels
func(c*AccountsClient)UpdateLabels(ctxcontext.Context,req*csspb.UpdateAccountLabelsRequest,opts...gax.CallOption)(*csspb.Account,error)UpdateLabels updates labels assigned to CSS/MC accounts by a CSS domain.
Example
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1"csspb"cloud.google.com/go/shopping/css/apiv1/csspb")funcmain(){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_Optionsc,err:=css.NewAccountsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&csspb.UpdateAccountLabelsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/shopping/css/apiv1/csspb#UpdateAccountLabelsRequest.}resp,err:=c.UpdateLabels(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}CssProductInputsCallOptions
typeCssProductInputsCallOptionsstruct{InsertCssProductInput[]gax.CallOptionUpdateCssProductInput[]gax.CallOptionDeleteCssProductInput[]gax.CallOption}CssProductInputsCallOptions contains the retry settings for each method of CssProductInputsClient.
CssProductInputsClient
typeCssProductInputsClientstruct{// The call options for this service.CallOptions*CssProductInputsCallOptions// contains filtered or unexported fields}CssProductInputsClient is a client for interacting with CSS API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service to use CssProductInput resource.This service helps to insert/update/delete CSS Products.
func NewCssProductInputsClient
funcNewCssProductInputsClient(ctxcontext.Context,opts...option.ClientOption)(*CssProductInputsClient,error)NewCssProductInputsClient creates a new css product inputs 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 use CssProductInput resource.This service helps to insert/update/delete CSS Products.
Example
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1")funcmain(){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_Optionsc,err:=css.NewCssProductInputsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewCssProductInputsRESTClient
funcNewCssProductInputsRESTClient(ctxcontext.Context,opts...option.ClientOption)(*CssProductInputsClient,error)NewCssProductInputsRESTClient creates a new css product inputs service rest client.
Service to use CssProductInput resource.This service helps to insert/update/delete CSS Products.
Example
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1")funcmain(){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_Optionsc,err:=css.NewCssProductInputsRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*CssProductInputsClient) Close
func(c*CssProductInputsClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*CssProductInputsClient) Connection (deprecated)
func(c*CssProductInputsClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*CssProductInputsClient) DeleteCssProductInput
func(c*CssProductInputsClient)DeleteCssProductInput(ctxcontext.Context,req*csspb.DeleteCssProductInputRequest,opts...gax.CallOption)errorDeleteCssProductInput deletes a CSS Product input from your CSS Center account.
After a delete it may take several minutes until the input is no longeravailable.
Example
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1"csspb"cloud.google.com/go/shopping/css/apiv1/csspb")funcmain(){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_Optionsc,err:=css.NewCssProductInputsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&csspb.DeleteCssProductInputRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/shopping/css/apiv1/csspb#DeleteCssProductInputRequest.}err=c.DeleteCssProductInput(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*CssProductInputsClient) InsertCssProductInput
func(c*CssProductInputsClient)InsertCssProductInput(ctxcontext.Context,req*csspb.InsertCssProductInputRequest,opts...gax.CallOption)(*csspb.CssProductInput,error)InsertCssProductInput uploads a CssProductInput to your CSS Center account. If aninput with the same contentLanguage, identity, feedLabel and feedId alreadyexists, this method replaces that entry.
After inserting, updating, or deleting a CSS Product input, it maytake several minutes before the processed CSS Product can be retrieved.
Example
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1"csspb"cloud.google.com/go/shopping/css/apiv1/csspb")funcmain(){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_Optionsc,err:=css.NewCssProductInputsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&csspb.InsertCssProductInputRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/shopping/css/apiv1/csspb#InsertCssProductInputRequest.}resp,err:=c.InsertCssProductInput(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CssProductInputsClient) UpdateCssProductInput
func(c*CssProductInputsClient)UpdateCssProductInput(ctxcontext.Context,req*csspb.UpdateCssProductInputRequest,opts...gax.CallOption)(*csspb.CssProductInput,error)UpdateCssProductInput updates the existing Css Product input in your CSS Center account.
After inserting, updating, or deleting a CSS Product input, it may takeseveral minutes before the processed Css Product can be retrieved.
Example
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1"csspb"cloud.google.com/go/shopping/css/apiv1/csspb")funcmain(){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_Optionsc,err:=css.NewCssProductInputsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&csspb.UpdateCssProductInputRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/shopping/css/apiv1/csspb#UpdateCssProductInputRequest.}resp,err:=c.UpdateCssProductInput(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}CssProductIterator
typeCssProductIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*csspb.CssProduct,nextPageTokenstring,errerror)// contains filtered or unexported fields}CssProductIterator manages a stream of *csspb.CssProduct.
func (*CssProductIterator) All
func(it*CssProductIterator)All()iter.Seq2[*csspb.CssProduct,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*CssProductIterator) Next
func(it*CssProductIterator)Next()(*csspb.CssProduct,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*CssProductIterator) PageInfo
func(it*CssProductIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
CssProductsCallOptions
typeCssProductsCallOptionsstruct{GetCssProduct[]gax.CallOptionListCssProducts[]gax.CallOption}CssProductsCallOptions contains the retry settings for each method of CssProductsClient.
CssProductsClient
typeCssProductsClientstruct{// The call options for this service.CallOptions*CssProductsCallOptions// contains filtered or unexported fields}CssProductsClient is a client for interacting with CSS API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for doing get and list on Css Products(a.k.a Aggregate Offersinternally).
func NewCssProductsClient
funcNewCssProductsClient(ctxcontext.Context,opts...option.ClientOption)(*CssProductsClient,error)NewCssProductsClient creates a new css products 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 doing get and list on Css Products(a.k.a Aggregate Offersinternally).
Example
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1")funcmain(){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_Optionsc,err:=css.NewCssProductsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewCssProductsRESTClient
funcNewCssProductsRESTClient(ctxcontext.Context,opts...option.ClientOption)(*CssProductsClient,error)NewCssProductsRESTClient creates a new css products service rest client.
Service for doing get and list on Css Products(a.k.a Aggregate Offersinternally).
Example
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1")funcmain(){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_Optionsc,err:=css.NewCssProductsRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*CssProductsClient) Close
func(c*CssProductsClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*CssProductsClient) Connection (deprecated)
func(c*CssProductsClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*CssProductsClient) GetCssProduct
func(c*CssProductsClient)GetCssProduct(ctxcontext.Context,req*csspb.GetCssProductRequest,opts...gax.CallOption)(*csspb.CssProduct,error)GetCssProduct retrieves the processed CSS Product from your CSS Center account. Afterinserting, updating, or deleting a product input, it may take severalminutes before the updated final product can be retrieved.
Example
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1"csspb"cloud.google.com/go/shopping/css/apiv1/csspb")funcmain(){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_Optionsc,err:=css.NewCssProductsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&csspb.GetCssProductRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/shopping/css/apiv1/csspb#GetCssProductRequest.}resp,err:=c.GetCssProduct(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CssProductsClient) ListCssProducts
func(c*CssProductsClient)ListCssProducts(ctxcontext.Context,req*csspb.ListCssProductsRequest,opts...gax.CallOption)*CssProductIteratorListCssProducts lists the processed CSS Products in your CSS Center account. The responsemight contain fewer items than specified by pageSize. Rely on pageToken todetermine if there are more items to be requested.
After inserting, updating, or deleting a CSS product input, it maytake several minutes before the updated processed CSS product can beretrieved.
Examples
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1"csspb"cloud.google.com/go/shopping/css/apiv1/csspb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=css.NewCssProductsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&csspb.ListCssProductsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/shopping/css/apiv1/csspb#ListCssProductsRequest.}it:=c.ListCssProducts(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*csspb.ListCssProductsResponse)}}all
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1"csspb"cloud.google.com/go/shopping/css/apiv1/csspb")funcmain(){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_Optionsc,err:=css.NewCssProductsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&csspb.ListCssProductsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/shopping/css/apiv1/csspb#ListCssProductsRequest.}forresp,err:=rangec.ListCssProducts(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}QuotaCallOptions
typeQuotaCallOptionsstruct{ListQuotaGroups[]gax.CallOption}QuotaCallOptions contains the retry settings for each method of QuotaClient.
QuotaClient
typeQuotaClientstruct{// The call options for this service.CallOptions*QuotaCallOptions// contains filtered or unexported fields}QuotaClient is a client for interacting with CSS API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service to get method call quota information per CSS API method.
func NewQuotaClient
funcNewQuotaClient(ctxcontext.Context,opts...option.ClientOption)(*QuotaClient,error)NewQuotaClient creates a new quota 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 quota information per CSS API method.
Example
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1")funcmain(){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_Optionsc,err:=css.NewQuotaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewQuotaRESTClient
funcNewQuotaRESTClient(ctxcontext.Context,opts...option.ClientOption)(*QuotaClient,error)NewQuotaRESTClient creates a new quota service rest client.
Service to get method call quota information per CSS API method.
Example
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1")funcmain(){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_Optionsc,err:=css.NewQuotaRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*QuotaClient) Close
func(c*QuotaClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*QuotaClient) Connection (deprecated)
func(c*QuotaClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*QuotaClient) ListQuotaGroups
func(c*QuotaClient)ListQuotaGroups(ctxcontext.Context,req*csspb.ListQuotaGroupsRequest,opts...gax.CallOption)*QuotaGroupIteratorListQuotaGroups lists the daily call quota and usage per group for your CSS Center account.
Examples
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1"csspb"cloud.google.com/go/shopping/css/apiv1/csspb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=css.NewQuotaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&csspb.ListQuotaGroupsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/shopping/css/apiv1/csspb#ListQuotaGroupsRequest.}it:=c.ListQuotaGroups(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*csspb.ListQuotaGroupsResponse)}}all
packagemainimport("context"css"cloud.google.com/go/shopping/css/apiv1"csspb"cloud.google.com/go/shopping/css/apiv1/csspb")funcmain(){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_Optionsc,err:=css.NewQuotaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&csspb.ListQuotaGroupsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/shopping/css/apiv1/csspb#ListQuotaGroupsRequest.}forresp,err:=rangec.ListQuotaGroups(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}QuotaGroupIterator
typeQuotaGroupIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*csspb.QuotaGroup,nextPageTokenstring,errerror)// contains filtered or unexported fields}QuotaGroupIterator manages a stream of *csspb.QuotaGroup.
func (*QuotaGroupIterator) All
func(it*QuotaGroupIterator)All()iter.Seq2[*csspb.QuotaGroup,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*QuotaGroupIterator) Next
func(it*QuotaGroupIterator)Next()(*csspb.QuotaGroup,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*QuotaGroupIterator) PageInfo
func(it*QuotaGroupIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-30 UTC.