merchantapi

package
v0.194.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2024 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Overview

Package merchantapi provides access to the Merchant API.

For product documentation, see: https://developers.devsite.corp.google.com/merchant/api

Library status

These client libraries are officially supported by Google. However, this library is considered complete and is in maintenance mode. This means that we will address critical bugs and security issues but will not add any new features.

When possible, we recommend using our newer [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) that are still actively being worked and iterated on.

Creating a client

Usage example:

import "google.golang.org/api/merchantapi/lfp_v1beta"
...
ctx := context.Background()
merchantapiService, err := merchantapi.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 google.golang.org/api/option.WithAPIKey:

merchantapiService, err := merchantapi.NewService(ctx, option.WithAPIKey("AIza..."))

To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow, use google.golang.org/api/option.WithTokenSource:

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

See google.golang.org/api/option.ClientOption 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 AccountsLfpInventoriesInsertCall

type AccountsLfpInventoriesInsertCall struct {
	// contains filtered or unexported fields
}

func (*AccountsLfpInventoriesInsertCall) Context

Context sets the context to be used in this call's Do method.

func (*AccountsLfpInventoriesInsertCall) Do

Do executes the "merchantapi.accounts.lfpInventories.insert" call. Any non-2xx status code is an error. Response headers are in either *LfpInventory.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*AccountsLfpInventoriesInsertCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*AccountsLfpInventoriesInsertCall) Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

type AccountsLfpInventoriesService

type AccountsLfpInventoriesService struct {
	// contains filtered or unexported fields
}

func NewAccountsLfpInventoriesService

func NewAccountsLfpInventoriesService(s *Service) *AccountsLfpInventoriesService

func (*AccountsLfpInventoriesService) Insert

Insert: Inserts a `LfpInventory` resource for the given target merchant account. If the resource already exists, it will be replaced. The inventory automatically expires after 30 days.

- parent: The LFP provider account. Format: `accounts/{account}`.

type AccountsLfpSalesInsertCall

type AccountsLfpSalesInsertCall struct {
	// contains filtered or unexported fields
}

func (*AccountsLfpSalesInsertCall) Context

Context sets the context to be used in this call's Do method.

func (*AccountsLfpSalesInsertCall) Do

Do executes the "merchantapi.accounts.lfpSales.insert" call. Any non-2xx status code is an error. Response headers are in either *LfpSale.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*AccountsLfpSalesInsertCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*AccountsLfpSalesInsertCall) Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

type AccountsLfpSalesService

type AccountsLfpSalesService struct {
	// contains filtered or unexported fields
}

func NewAccountsLfpSalesService

func NewAccountsLfpSalesService(s *Service) *AccountsLfpSalesService

func (*AccountsLfpSalesService) Insert

Insert: Inserts a `LfpSale` for the given merchant.

- parent: The LFP provider account. Format: `accounts/{lfp_partner}`.

type AccountsLfpStoresDeleteCall

type AccountsLfpStoresDeleteCall struct {
	// contains filtered or unexported fields
}

func (*AccountsLfpStoresDeleteCall) Context

Context sets the context to be used in this call's Do method.

func (*AccountsLfpStoresDeleteCall) Do

Do executes the "merchantapi.accounts.lfpStores.delete" call. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*AccountsLfpStoresDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*AccountsLfpStoresDeleteCall) Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

type AccountsLfpStoresGetCall

type AccountsLfpStoresGetCall struct {
	// contains filtered or unexported fields
}

func (*AccountsLfpStoresGetCall) Context

Context sets the context to be used in this call's Do method.

func (*AccountsLfpStoresGetCall) Do

Do executes the "merchantapi.accounts.lfpStores.get" call. Any non-2xx status code is an error. Response headers are in either *LfpStore.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*AccountsLfpStoresGetCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*AccountsLfpStoresGetCall) Header

func (c *AccountsLfpStoresGetCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*AccountsLfpStoresGetCall) IfNoneMatch

func (c *AccountsLfpStoresGetCall) IfNoneMatch(entityTag string) *AccountsLfpStoresGetCall

IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.

type AccountsLfpStoresInsertCall

type AccountsLfpStoresInsertCall struct {
	// contains filtered or unexported fields
}

func (*AccountsLfpStoresInsertCall) Context

Context sets the context to be used in this call's Do method.

func (*AccountsLfpStoresInsertCall) Do

Do executes the "merchantapi.accounts.lfpStores.insert" call. Any non-2xx status code is an error. Response headers are in either *LfpStore.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*AccountsLfpStoresInsertCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*AccountsLfpStoresInsertCall) Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

type AccountsLfpStoresListCall

type AccountsLfpStoresListCall struct {
	// contains filtered or unexported fields
}

func (*AccountsLfpStoresListCall) Context

Context sets the context to be used in this call's Do method.

func (*AccountsLfpStoresListCall) Do

Do executes the "merchantapi.accounts.lfpStores.list" call. Any non-2xx status code is an error. Response headers are in either *ListLfpStoresResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*AccountsLfpStoresListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*AccountsLfpStoresListCall) Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*AccountsLfpStoresListCall) IfNoneMatch

func (c *AccountsLfpStoresListCall) IfNoneMatch(entityTag string) *AccountsLfpStoresListCall

IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.

func (*AccountsLfpStoresListCall) PageSize

PageSize sets the optional parameter "pageSize": The maximum number of `LfpStore` resources for the given account to return. The service returns fewer than this value if the number of stores for the given account is less than the `pageSize`. The default value is 250. The maximum value is 1000; If a value higher than the maximum is specified, then the `pageSize` will default to the maximum.

func (*AccountsLfpStoresListCall) PageToken

PageToken sets the optional parameter "pageToken": A page token, received from a previous `ListLfpStoresRequest` call. Provide the page token to retrieve the subsequent page. When paginating, all other parameters provided to `ListLfpStoresRequest` must match the call that provided the page token. The token returned as nextPageToken in the response to the previous request.

func (*AccountsLfpStoresListCall) Pages

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

func (*AccountsLfpStoresListCall) TargetAccount

func (c *AccountsLfpStoresListCall) TargetAccount(targetAccount int64) *AccountsLfpStoresListCall

TargetAccount sets the optional parameter "targetAccount": Required. The Merchant Center id of the merchant to list stores for.

type AccountsLfpStoresService

type AccountsLfpStoresService struct {
	// contains filtered or unexported fields
}

func NewAccountsLfpStoresService

func NewAccountsLfpStoresService(s *Service) *AccountsLfpStoresService

func (*AccountsLfpStoresService) Delete

Delete: Deletes a store for a target merchant.

  • name: The name of the store to delete for the target merchant account. Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}`.

func (*AccountsLfpStoresService) Get

Get: Retrieves information about a store.

  • name: The name of the store to retrieve. Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}`.

func (*AccountsLfpStoresService) Insert

Insert: Inserts a store for the target merchant. If the store with the same store code already exists, it will be replaced.

- parent: The LFP provider account Format: `accounts/{account}`.

func (*AccountsLfpStoresService) List

List: Lists the stores of the target merchant, specified by the filter in `ListLfpStoresRequest`.

- parent: The LFP partner. Format: `accounts/{account}`.

type AccountsService

type AccountsService struct {
	LfpInventories *AccountsLfpInventoriesService

	LfpSales *AccountsLfpSalesService

	LfpStores *AccountsLfpStoresService
	// contains filtered or unexported fields
}

func NewAccountsService

func NewAccountsService(s *Service) *AccountsService

type Empty

type Empty struct {
	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
}

Empty: A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

type LfpInventory

type LfpInventory struct {
	// Availability: Required. Availability of the product at this store. For
	// accepted attribute values, see the local product inventory data
	// specification (https://support.google.com/merchants/answer/3061342)
	Availability string `json:"availability,omitempty"`
	// CollectionTime: Optional. The time when the inventory is collected. If not
	// set, it will be set to the time when the inventory is submitted.
	CollectionTime string `json:"collectionTime,omitempty"`
	// ContentLanguage: Required. The two-letter ISO 639-1 language code for the
	// item.
	ContentLanguage string `json:"contentLanguage,omitempty"`
	// FeedLabel: Optional. The feed label
	// (https://developers.google.com/shopping-content/guides/products/feed-labels)
	// for the product. If this is not set, it will default to `regionCode`.
	FeedLabel string `json:"feedLabel,omitempty"`
	// Gtin: Optional. The Global Trade Item Number of the product.
	Gtin string `json:"gtin,omitempty"`
	// Name: Output only. Identifier. The name for the `LfpInventory` resource.
	// Format:
	// `accounts/{account}/lfpInventories/{target_merchant}~{store_code}~{offer}`
	Name string `json:"name,omitempty"`
	// OfferId: Required. Immutable. A unique identifier for the product. If both
	// inventories and sales are submitted for a merchant, this id should match for
	// the same product. **Note**: if the merchant sells the same product new and
	// used, they should have different IDs.
	OfferId string `json:"offerId,omitempty"`
	// PickupMethod: Optional. Supported pickup method for this offer. Unless the
	// value is "not supported", this field must be submitted together with
	// `pickupSla`. For accepted attribute values, see the local product inventory
	// data specification (https://support.google.com/merchants/answer/3061342).
	PickupMethod string `json:"pickupMethod,omitempty"`
	// PickupSla: Optional. Expected date that an order will be ready for pickup
	// relative to the order date. Must be submitted together with `pickupMethod`.
	// For accepted attribute values, see the local product inventory data
	// specification (https://support.google.com/merchants/answer/3061342).
	PickupSla string `json:"pickupSla,omitempty"`
	// Price: Optional. The current price of the product.
	Price *Price `json:"price,omitempty"`
	// Quantity: Optional. Quantity of the product available at this store. Must be
	// greater than or equal to zero.
	Quantity int64 `json:"quantity,omitempty,string"`
	// RegionCode: Required. The CLDR territory code
	// (https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) for the
	// country where the product is sold.
	RegionCode string `json:"regionCode,omitempty"`
	// StoreCode: Required. The identifier of the merchant's store. Either the
	// store code inserted through `InsertLfpStore` or the store code in the
	// Business Profile.
	StoreCode string `json:"storeCode,omitempty"`
	// TargetAccount: Required. The Merchant Center ID of the merchant to submit
	// the inventory for.
	TargetAccount int64 `json:"targetAccount,omitempty,string"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Availability") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Availability") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

LfpInventory: Local Inventory for the merchant.

func (LfpInventory) MarshalJSON

func (s LfpInventory) MarshalJSON() ([]byte, error)

type LfpSale

type LfpSale struct {
	// ContentLanguage: Required. The two-letter ISO 639-1 language code for the
	// item.
	ContentLanguage string `json:"contentLanguage,omitempty"`
	// FeedLabel: Optional. The feed label
	// (https://developers.google.com/shopping-content/guides/products/feed-labels)
	// for the product. If this is not set, it will default to `regionCode`.
	FeedLabel string `json:"feedLabel,omitempty"`
	// Gtin: Required. The Global Trade Item Number of the sold product.
	Gtin string `json:"gtin,omitempty"`
	// Name: Output only. Identifier. The name of the `LfpSale` resource. Format:
	// `accounts/{account}/lfpSales/{sale}`
	Name string `json:"name,omitempty"`
	// OfferId: Required. A unique identifier for the product. If both inventories
	// and sales are submitted for a merchant, this id should match for the same
	// product. **Note**: if the merchant sells the same product new and used, they
	// should have different IDs.
	OfferId string `json:"offerId,omitempty"`
	// Price: Required. The unit price of the product.
	Price *Price `json:"price,omitempty"`
	// Quantity: Required. The relative change of the available quantity. Negative
	// for items returned.
	Quantity int64 `json:"quantity,omitempty,string"`
	// RegionCode: Required. The CLDR territory code
	// (https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) for the
	// country where the product is sold.
	RegionCode string `json:"regionCode,omitempty"`
	// SaleTime: Required. The timestamp for the sale.
	SaleTime string `json:"saleTime,omitempty"`
	// StoreCode: Required. The identifier of the merchant's store. Either a
	// `storeCode` inserted through the API or the code of the store in the
	// Business Profile.
	StoreCode string `json:"storeCode,omitempty"`
	// TargetAccount: Required. The Merchant Center ID of the merchant to submit
	// the sale for.
	TargetAccount int64 `json:"targetAccount,omitempty,string"`
	// Uid: Output only. System generated globally unique ID for the `LfpSale`.
	Uid string `json:"uid,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "ContentLanguage") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "ContentLanguage") to include in
	// API requests with the JSON null value. By default, fields with empty values
	// are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

LfpSale: A sale for the merchant.

func (LfpSale) MarshalJSON

func (s LfpSale) MarshalJSON() ([]byte, error)

type LfpStore

type LfpStore struct {
	// GcidCategory: Optional. Google My Business category id
	// (https://gcid-explorer.corp.google.com/static/gcid.html).
	GcidCategory []string `json:"gcidCategory,omitempty"`
	// MatchingState: Optional. Output only. The state of matching to a Google
	// Business Profile. See matchingStateHint for further details if no match is
	// found.
	//
	// Possible values:
	//   "STORE_MATCHING_STATE_UNSPECIFIED" - Store matching state unspecified.
	//   "STORE_MATCHING_STATE_MATCHED" - The `LfpStore` is successfully matched
	// with a Google Business Profile store.
	//   "STORE_MATCHING_STATE_FAILED" - The `LfpStore` is not matched with a
	// Google Business Profile store.
	MatchingState string `json:"matchingState,omitempty"`
	// MatchingStateHint: Optional. Output only. The hint of why the matching has
	// failed. This is only set when matchingState=`STORE_MATCHING_STATE_FAILED`.
	// Possible values are: - "linked-store-not-found": There aren't any Google
	// Business Profile stores available for matching. - "store-match-not-found":
	// The provided `LfpStore` couldn't be matched to any of the connected Google
	// Business Profile stores. Merchant Center account is connected correctly and
	// stores are available on Google Business Profile, but the `LfpStore` location
	// address does not match with Google Business Profile stores' addresses.
	// Update the `LfpStore` address or Google Business Profile store address to
	// match correctly. - "store-match-unverified": The provided `LfpStore`
	// couldn't be matched to any of the connected Google Business Profile stores,
	// as the matched Google Business Profile store is unverified. Go through the
	// Google Business Profile verification process to match correctly.
	MatchingStateHint string `json:"matchingStateHint,omitempty"`
	// Name: Output only. Identifier. The name of the `LfpStore` resource. Format:
	// `accounts/{account}/lfpStores/{target_merchant}~{store_code}`
	Name string `json:"name,omitempty"`
	// PhoneNumber: Optional. The store phone number in E.164
	// (https://en.wikipedia.org/wiki/E.164) format. Example: `+15556767888`
	PhoneNumber string `json:"phoneNumber,omitempty"`
	// PlaceId: Optional. The Google Place Id
	// (https://developers.google.com/maps/documentation/places/web-service/place-id#id-overview)
	// of the store location.
	PlaceId string `json:"placeId,omitempty"`
	// StoreAddress: Required. The street address of the store. Example: 1600
	// Amphitheatre Pkwy, Mountain View, CA 94043, USA.
	StoreAddress string `json:"storeAddress,omitempty"`
	// StoreCode: Required. Immutable. A store identifier that is unique for the
	// target merchant.
	StoreCode string `json:"storeCode,omitempty"`
	// StoreName: Optional. The merchant or store name.
	StoreName string `json:"storeName,omitempty"`
	// TargetAccount: Required. The Merchant Center id of the merchant to submit
	// the store for.
	TargetAccount int64 `json:"targetAccount,omitempty,string"`
	// WebsiteUri: Optional. The website URL for the store or merchant.
	WebsiteUri string `json:"websiteUri,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "GcidCategory") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "GcidCategory") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

LfpStore: A store for the merchant. This will be used to match to a store under the Google Business Profile of the target merchant. If a matching store can't be found, the inventories or sales submitted with the store code will not be used.

func (LfpStore) MarshalJSON

func (s LfpStore) MarshalJSON() ([]byte, error)

type ListLfpStoresResponse

type ListLfpStoresResponse struct {
	// LfpStores: The stores from the specified merchant.
	LfpStores []*LfpStore `json:"lfpStores,omitempty"`
	// NextPageToken: A token, which can be sent as `pageToken` to retrieve the
	// next page. If this field is omitted, there are no subsequent pages.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "LfpStores") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "LfpStores") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

ListLfpStoresResponse: Response message for the ListLfpStores method.

func (ListLfpStoresResponse) MarshalJSON

func (s ListLfpStoresResponse) MarshalJSON() ([]byte, error)

type Price

type Price struct {
	// AmountMicros: The price represented as a number in micros (1 million micros
	// is an equivalent to one's currency standard unit, for example, 1 USD =
	// 1000000 micros).
	AmountMicros int64 `json:"amountMicros,omitempty,string"`
	// CurrencyCode: The currency of the price using three-letter acronyms
	// according to ISO 4217 (http://en.wikipedia.org/wiki/ISO_4217).
	CurrencyCode string `json:"currencyCode,omitempty"`
	// ForceSendFields is a list of field names (e.g. "AmountMicros") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "AmountMicros") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Price: The price represented as a number and currency.

func (Price) MarshalJSON

func (s Price) MarshalJSON() ([]byte, error)

type ProductChange

type ProductChange struct {
	// NewValue: The new value of the changed resource or attribute.
	NewValue string `json:"newValue,omitempty"`
	// OldValue: The old value of the changed resource or attribute.
	OldValue string `json:"oldValue,omitempty"`
	// RegionCode: Countries that have the change (if applicable)
	RegionCode string `json:"regionCode,omitempty"`
	// ReportingContext: Reporting contexts that have the change (if applicable)
	//
	// Possible values:
	//   "REPORTING_CONTEXT_ENUM_UNSPECIFIED" - Not specified.
	//   "SHOPPING_ADS" - [Shopping
	// ads](https://support.google.com/merchants/answer/6149970).
	//   "DISCOVERY_ADS" - Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and
	// Demand Gen ads](https://support.google.com/merchants/answer/13389785).
	//   "DEMAND_GEN_ADS" - [Demand Gen
	// ads](https://support.google.com/merchants/answer/13389785).
	//   "DEMAND_GEN_ADS_DISCOVER_SURFACE" - [Demand Gen ads on Discover
	// surface](https://support.google.com/merchants/answer/13389785).
	//   "VIDEO_ADS" - [Video
	// ads](https://support.google.com/google-ads/answer/6340491).
	//   "DISPLAY_ADS" - [Display
	// ads](https://support.google.com/merchants/answer/6069387).
	//   "LOCAL_INVENTORY_ADS" - [Local inventory
	// ads](https://support.google.com/merchants/answer/3271956).
	//   "VEHICLE_INVENTORY_ADS" - [Vehicle inventory
	// ads](https://support.google.com/merchants/answer/11544533).
	//   "FREE_LISTINGS" - [Free product
	// listings](https://support.google.com/merchants/answer/9199328).
	//   "FREE_LOCAL_LISTINGS" - [Free local product
	// listings](https://support.google.com/merchants/answer/9825611).
	//   "FREE_LOCAL_VEHICLE_LISTINGS" - [Free local vehicle
	// listings](https://support.google.com/merchants/answer/11544533).
	//   "YOUTUBE_SHOPPING" - [YouTube
	// Shopping](https://support.google.com/merchants/answer/13478370).
	//   "CLOUD_RETAIL" - [Cloud
	// retail](https://cloud.google.com/solutions/retail).
	//   "LOCAL_CLOUD_RETAIL" - [Local cloud
	// retail](https://cloud.google.com/solutions/retail).
	ReportingContext string `json:"reportingContext,omitempty"`
	// ForceSendFields is a list of field names (e.g. "NewValue") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "NewValue") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

ProductChange: The change that happened to the product including old value, new value, country code as the region code and reporting context.

func (ProductChange) MarshalJSON

func (s ProductChange) MarshalJSON() ([]byte, error)

type ProductStatusChangeMessage

type ProductStatusChangeMessage struct {
	// Account: The target account that owns the entity that changed. Format :
	// `accounts/{merchant_id}`
	Account string `json:"account,omitempty"`
	// Attribute: The attribute in the resource that changed, in this case it will
	// be always `Status`.
	//
	// Possible values:
	//   "ATTRIBUTE_UNSPECIFIED" - Unspecified attribute
	//   "STATUS" - Status of the changed entity
	Attribute string `json:"attribute,omitempty"`
	// Changes: A message to describe the change that happened to the product
	Changes []*ProductChange `json:"changes,omitempty"`
	// ManagingAccount: The account that manages the merchant's account. can be the
	// same as merchant id if it is standalone account. Format :
	// `accounts/{service_provider_id}`
	ManagingAccount string `json:"managingAccount,omitempty"`
	// Resource: The product name. Format:
	// `{product.name=accounts/{account}/products/{product}}`
	Resource string `json:"resource,omitempty"`
	// ResourceId: The product id.
	ResourceId string `json:"resourceId,omitempty"`
	// ResourceType: The resource that changed, in this case it will always be
	// `Product`.
	//
	// Possible values:
	//   "RESOURCE_UNSPECIFIED" - Unspecified resource
	//   "PRODUCT" - Resource type : product
	ResourceType string `json:"resourceType,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Account") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Account") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

ProductStatusChangeMessage: The message that the merchant will receive to notify about product status change event

func (ProductStatusChangeMessage) MarshalJSON

func (s ProductStatusChangeMessage) MarshalJSON() ([]byte, error)

type Service

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

	Accounts *AccountsService
	// contains filtered or unexported fields
}

func New deprecated

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

New creates a new Service. 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) (*Service, error)

NewService creates a new Service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL