Documentation
¶
Overview ¶
Package issueresolution 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.
// go get cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta@latest
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := issueresolution.NewAggregateProductStatusesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client ¶
The following is an example of making an API call with the newly created client, mentioned above.
req := &issueresolutionpb.ListAggregateProductStatusesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta/issueresolutionpb#ListAggregateProductStatusesRequest.
}
it := c.ListAggregateProductStatuses(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.(*issueresolutionpb.ListAggregateProductStatusesResponse)
}
Use of Context ¶
The ctx passed to NewAggregateProductStatusesClient 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 AggregateProductStatusIterator
- type AggregateProductStatusesCallOptions
- type AggregateProductStatusesClient
- type CallOptions
- type Client
- func (c *Client) Close() error
- func (c *Client) Connection() *grpc.ClientConndeprecated
- func (c *Client) RenderAccountIssues(ctx context.Context, req *issueresolutionpb.RenderAccountIssuesRequest, ...) (*issueresolutionpb.RenderAccountIssuesResponse, error)
- func (c *Client) RenderProductIssues(ctx context.Context, req *issueresolutionpb.RenderProductIssuesRequest, ...) (*issueresolutionpb.RenderProductIssuesResponse, error)
- func (c *Client) TriggerAction(ctx context.Context, req *issueresolutionpb.TriggerActionRequest, ...) (*issueresolutionpb.TriggerActionResponse, error)
Examples ¶
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 AggregateProductStatusIterator ¶ added in v0.22.0
type AggregateProductStatusIterator 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 []*issueresolutionpb.AggregateProductStatus, nextPageToken string, err error)
// contains filtered or unexported fields
}
AggregateProductStatusIterator manages a stream of *issueresolutionpb.AggregateProductStatus.
func (*AggregateProductStatusIterator) All ¶ added in v0.22.0
func (it *AggregateProductStatusIterator) All() iter.Seq2[*issueresolutionpb.AggregateProductStatus, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*AggregateProductStatusIterator) Next ¶ added in v0.22.0
func (it *AggregateProductStatusIterator) Next() (*issueresolutionpb.AggregateProductStatus, 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 (*AggregateProductStatusIterator) PageInfo ¶ added in v0.22.0
func (it *AggregateProductStatusIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type AggregateProductStatusesCallOptions ¶ added in v0.22.0
type AggregateProductStatusesCallOptions struct {
ListAggregateProductStatuses []gax.CallOption
}
AggregateProductStatusesCallOptions contains the retry settings for each method of AggregateProductStatusesClient.
type AggregateProductStatusesClient ¶ added in v0.22.0
type AggregateProductStatusesClient struct {
// The call options for this service.
CallOptions *AggregateProductStatusesCallOptions
// contains filtered or unexported fields
}
AggregateProductStatusesClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service to manage aggregate product statuses.
func NewAggregateProductStatusesClient ¶ added in v0.22.0
func NewAggregateProductStatusesClient(ctx context.Context, opts ...option.ClientOption) (*AggregateProductStatusesClient, error)
NewAggregateProductStatusesClient creates a new aggregate product statuses service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service to manage aggregate product statuses.
Example ¶
package main
import (
"context"
issueresolution "cloud.google.com/go/shopping/merchant/issueresolution/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 := issueresolution.NewAggregateProductStatusesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
Output:
func NewAggregateProductStatusesRESTClient ¶ added in v0.22.0
func NewAggregateProductStatusesRESTClient(ctx context.Context, opts ...option.ClientOption) (*AggregateProductStatusesClient, error)
NewAggregateProductStatusesRESTClient creates a new aggregate product statuses service rest client.
Service to manage aggregate product statuses.
Example ¶
package main
import (
"context"
issueresolution "cloud.google.com/go/shopping/merchant/issueresolution/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 := issueresolution.NewAggregateProductStatusesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
Output:
func (*AggregateProductStatusesClient) Close ¶ added in v0.22.0
func (c *AggregateProductStatusesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*AggregateProductStatusesClient) Connection
deprecated
added in
v0.22.0
func (c *AggregateProductStatusesClient) 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 (*AggregateProductStatusesClient) ListAggregateProductStatuses ¶ added in v0.22.0
func (c *AggregateProductStatusesClient) ListAggregateProductStatuses(ctx context.Context, req *issueresolutionpb.ListAggregateProductStatusesRequest, opts ...gax.CallOption) *AggregateProductStatusIterator
ListAggregateProductStatuses lists the AggregateProductStatuses resources for your merchant account. The response might contain fewer items than specified by pageSize. If pageToken was returned in previous request, it can be used to obtain additional results.
Example ¶
package main
import (
"context"
issueresolution "cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta"
issueresolutionpb "cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta/issueresolutionpb"
"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 := issueresolution.NewAggregateProductStatusesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &issueresolutionpb.ListAggregateProductStatusesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta/issueresolutionpb#ListAggregateProductStatusesRequest.
}
it := c.ListAggregateProductStatuses(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.(*issueresolutionpb.ListAggregateProductStatusesResponse)
}
}
Output:
Example (All) ¶
package main
import (
"context"
issueresolution "cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta"
issueresolutionpb "cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta/issueresolutionpb"
)
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 := issueresolution.NewAggregateProductStatusesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &issueresolutionpb.ListAggregateProductStatusesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta/issueresolutionpb#ListAggregateProductStatusesRequest.
}
for resp, err := range c.ListAggregateProductStatuses(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
type CallOptions ¶
type CallOptions struct {
RenderAccountIssues []gax.CallOption
RenderProductIssues []gax.CallOption
TriggerAction []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 provide an issue resolution content for account issues and product issues.
func NewClient ¶
NewClient creates a new issue resolution 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 provide an issue resolution content for account issues and product issues.
Example ¶
package main
import (
"context"
issueresolution "cloud.google.com/go/shopping/merchant/issueresolution/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 := issueresolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
Output:
func NewRESTClient ¶
NewRESTClient creates a new issue resolution service rest client.
Service to provide an issue resolution content for account issues and product issues.
Example ¶
package main
import (
"context"
issueresolution "cloud.google.com/go/shopping/merchant/issueresolution/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 := issueresolution.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) RenderAccountIssues ¶
func (c *Client) RenderAccountIssues(ctx context.Context, req *issueresolutionpb.RenderAccountIssuesRequest, opts ...gax.CallOption) (*issueresolutionpb.RenderAccountIssuesResponse, error)
RenderAccountIssues provide a list of business’s account issues with an issue resolution content and available actions. This content and actions are meant to be rendered and shown in third-party applications.
Example ¶
package main
import (
"context"
issueresolution "cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta"
issueresolutionpb "cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta/issueresolutionpb"
)
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 := issueresolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &issueresolutionpb.RenderAccountIssuesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta/issueresolutionpb#RenderAccountIssuesRequest.
}
resp, err := c.RenderAccountIssues(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
func (*Client) RenderProductIssues ¶
func (c *Client) RenderProductIssues(ctx context.Context, req *issueresolutionpb.RenderProductIssuesRequest, opts ...gax.CallOption) (*issueresolutionpb.RenderProductIssuesResponse, error)
RenderProductIssues provide a list of issues for business’s product with an issue resolution content and available actions. This content and actions are meant to be rendered and shown in third-party applications.
Example ¶
package main
import (
"context"
issueresolution "cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta"
issueresolutionpb "cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta/issueresolutionpb"
)
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 := issueresolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &issueresolutionpb.RenderProductIssuesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta/issueresolutionpb#RenderProductIssuesRequest.
}
resp, err := c.RenderProductIssues(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
func (*Client) TriggerAction ¶
func (c *Client) TriggerAction(ctx context.Context, req *issueresolutionpb.TriggerActionRequest, opts ...gax.CallOption) (*issueresolutionpb.TriggerActionResponse, error)
TriggerAction start an action. The action can be requested by a business in third-party application. Before the business can request the action, the third-party application needs to show them action specific content and display a user input form.
The action can be successfully started only once all required inputs are provided. If any required input is missing, or invalid value was provided, the service will return 400 error. Validation errors will contain [Ids][google.shopping.merchant.issueresolution.v1beta.InputField.id (at http://google.shopping.merchant.issueresolution.v1beta.InputField.id)] for all problematic field together with translated, human readable error messages that can be shown to the user.
Example ¶
package main
import (
"context"
issueresolution "cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta"
issueresolutionpb "cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta/issueresolutionpb"
)
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 := issueresolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &issueresolutionpb.TriggerActionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta/issueresolutionpb#TriggerActionRequest.
}
resp, err := c.TriggerAction(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output: