Documentation

Overview

Package content provides access to the Content API for Shopping.

For product documentation, see: https://developers.google.com/shopping-content/v2/

Creating a client

Usage example:

import "google.golang.org/api/content/v2.1"
...
ctx := context.Background()
contentService, err := content.NewService(ctx)

In this example, Google Application Default Credentials are used for authentication.

For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.

Other authentication options

To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:

contentService, err := content.NewService(ctx, option.WithAPIKey("AIza..."))

To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:

config := &oauth2.Config{...}
// ...
token, err := config.Exchange(ctx, ...)
contentService, err := content.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))

See https://godoc.org/google.golang.org/api/option/ for details on options.

Index

Constants

View Source
const (
	// Manage your product listings and accounts for Google Shopping
	ContentScope = "https://www.googleapis.com/auth/content"
)

OAuth2 scopes used by this API.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIService

type APIService struct {
	BasePath  string // API endpoint base URL
	UserAgent string // optional additional User-Agent fragment

	Accounts *AccountsService

	Accountstatuses *AccountstatusesService

	Accounttax *AccounttaxService

	Csses *CssesService

	Datafeeds *DatafeedsService

	Datafeedstatuses *DatafeedstatusesService

	Liasettings *LiasettingsService

	Localinventory *LocalinventoryService

	Orderinvoices *OrderinvoicesService

	Orderreports *OrderreportsService

	Orderreturns *OrderreturnsService

	Orders *OrdersService

	Ordertrackingsignals *OrdertrackingsignalsService

	Pos *PosService

	Products *ProductsService

	Productstatuses *ProductstatusesService

	Pubsubnotificationsettings *PubsubnotificationsettingsService

	Regionalinventory *RegionalinventoryService

	Regions *RegionsService

	Repricingrules *RepricingrulesService

	Returnaddress *ReturnaddressService

	Returnpolicy *ReturnpolicyService

	Settlementreports *SettlementreportsService

	Settlementtransactions *SettlementtransactionsService

	Shippingsettings *ShippingsettingsService // contains filtered or unexported fields

}

func New

func New(client *http.Client) (*APIService, error)

New creates a new APIService. It uses the provided http.Client for requests.

Deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.

func NewService

func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, error)

NewService creates a new APIService.

type Account

type Account struct {
	// AdsLinks: List of linked Ads accounts that are active or pending
	// approval. T