merchantapi

package
v0.200.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 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/inventories_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 AccountsProductsLocalInventoriesDeleteCall

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

func (*AccountsProductsLocalInventoriesDeleteCall) Context

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

func (*AccountsProductsLocalInventoriesDeleteCall) Do

Do executes the "merchantapi.accounts.products.localInventories.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 (*AccountsProductsLocalInventoriesDeleteCall) Fields

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

func (*AccountsProductsLocalInventoriesDeleteCall) Header

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

type AccountsProductsLocalInventoriesInsertCall

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

func (*AccountsProductsLocalInventoriesInsertCall) Context

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

func (*AccountsProductsLocalInventoriesInsertCall) Do

Do executes the "merchantapi.accounts.products.localInventories.insert" call. Any non-2xx status code is an error. Response headers are in either *LocalInventory.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 (*AccountsProductsLocalInventoriesInsertCall) Fields

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

func (*AccountsProductsLocalInventoriesInsertCall) Header

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

type AccountsProductsLocalInventoriesListCall

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

func (*AccountsProductsLocalInventoriesListCall) Context

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

func (*AccountsProductsLocalInventoriesListCall) Do

Do executes the "merchantapi.accounts.products.localInventories.list" call. Any non-2xx status code is an error. Response headers are in either *ListLocalInventoriesResponse.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 (*AccountsProductsLocalInventoriesListCall) Fields

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

func (*AccountsProductsLocalInventoriesListCall) Header

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

func (*AccountsProductsLocalInventoriesListCall) IfNoneMatch

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 (*AccountsProductsLocalInventoriesListCall) PageSize

PageSize sets the optional parameter "pageSize": The maximum number of `LocalInventory` resources for the given product to return. The service returns fewer than this value if the number of inventories for the given product is less that than the `pageSize`. The default value is 25000. The maximum value is 25000; If a value higher than the maximum is specified, then the `pageSize` will default to the maximum

func (*AccountsProductsLocalInventoriesListCall) PageToken

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

func (*AccountsProductsLocalInventoriesListCall) 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.

type AccountsProductsLocalInventoriesService

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

func NewAccountsProductsLocalInventoriesService

func NewAccountsProductsLocalInventoriesService(s *Service) *AccountsProductsLocalInventoriesService

func (*AccountsProductsLocalInventoriesService) Delete

Delete: Deletes the specified `LocalInventory` from the given product in your merchant account. It might take a up to an hour for the `LocalInventory` to be deleted from the specific product. Once you have received a successful delete response, wait for that period before attempting a delete again.

  • name: The name of the local inventory for the given product to delete. Format: `accounts/{account}/products/{product}/localInventories/{store_code}`.

func (*AccountsProductsLocalInventoriesService) Insert

Insert: Inserts a `LocalInventory` resource to a product in your merchant account. Replaces the full `LocalInventory` resource if an entry with the same `storeCode` already exists for the product. It might take up to 30 minutes for the new or updated `LocalInventory` resource to appear in products.

  • parent: The account and product where this inventory will be inserted. Format: `accounts/{account}/products/{product}`.

func (*AccountsProductsLocalInventoriesService) List

List: Lists the `LocalInventory` resources for the given product in 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. `LocalInventory` resources are listed per product for a given account.

  • parent: The `name` of the parent product to list local inventories for. Format: `accounts/{account}/products/{product}`.

type AccountsProductsRegionalInventoriesDeleteCall

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

func (*AccountsProductsRegionalInventoriesDeleteCall) Context

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

func (*AccountsProductsRegionalInventoriesDeleteCall) Do

Do executes the "merchantapi.accounts.products.regionalInventories.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 (*AccountsProductsRegionalInventoriesDeleteCall) Fields

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

func (*AccountsProductsRegionalInventoriesDeleteCall) Header

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

type AccountsProductsRegionalInventoriesInsertCall

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

func (*AccountsProductsRegionalInventoriesInsertCall) Context

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

func (*AccountsProductsRegionalInventoriesInsertCall) Do

Do executes the "merchantapi.accounts.products.regionalInventories.insert" call. Any non-2xx status code is an error. Response headers are in either *RegionalInventory.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 (*AccountsProductsRegionalInventoriesInsertCall) Fields

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

func (*AccountsProductsRegionalInventoriesInsertCall) Header

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

type AccountsProductsRegionalInventoriesListCall

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

func (*AccountsProductsRegionalInventoriesListCall) Context

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

func (*AccountsProductsRegionalInventoriesListCall) Do

Do executes the "merchantapi.accounts.products.regionalInventories.list" call. Any non-2xx status code is an error. Response headers are in either *ListRegionalInventoriesResponse.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 (*AccountsProductsRegionalInventoriesListCall) Fields

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

func (*AccountsProductsRegionalInventoriesListCall) Header

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

func (*AccountsProductsRegionalInventoriesListCall) IfNoneMatch

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 (*AccountsProductsRegionalInventoriesListCall) PageSize

PageSize sets the optional parameter "pageSize": The maximum number of `RegionalInventory` resources for the given product to return. The service returns fewer than this value if the number of inventories for the given product is less that than the `pageSize`. The default value is 25000. The maximum value is 100000; If a value higher than the maximum is specified, then the `pageSize` will default to the maximum.

func (*AccountsProductsRegionalInventoriesListCall) PageToken

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

func (*AccountsProductsRegionalInventoriesListCall) 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.

type AccountsProductsRegionalInventoriesService

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

func NewAccountsProductsRegionalInventoriesService

func NewAccountsProductsRegionalInventoriesService(s *Service) *AccountsProductsRegionalInventoriesService

func (*AccountsProductsRegionalInventoriesService) Delete

Delete: Deletes the specified `RegionalInventory` resource from the given product in your merchant account. It might take up to an hour for the `RegionalInventory` to be deleted from the specific product. Once you have received a successful delete response, wait for that period before attempting a delete again.

  • name: The name of the `RegionalInventory` resource to delete. Format: `accounts/{account}/products/{product}/regionalInventories/{region}`.

func (*AccountsProductsRegionalInventoriesService) Insert

Insert: Inserts a `RegionalInventory` to a given product in your merchant account. Replaces the full `RegionalInventory` resource if an entry with the same `region` already exists for the product. It might take up to 30 minutes for the new or updated `RegionalInventory` resource to appear in products.

  • parent: The account and product where this inventory will be inserted. Format: `accounts/{account}/products/{product}`.

func (*AccountsProductsRegionalInventoriesService) List

List: Lists the `RegionalInventory` resources for the given product in 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. `RegionalInventory` resources are listed per product for a given account.

  • parent: The `name` of the parent product to list `RegionalInventory` resources for. Format: `accounts/{account}/products/{product}`.

type AccountsProductsService

type AccountsProductsService struct {
	LocalInventories *AccountsProductsLocalInventoriesService

	RegionalInventories *AccountsProductsRegionalInventoriesService
	// contains filtered or unexported fields
}

func NewAccountsProductsService

func NewAccountsProductsService(s *Service) *AccountsProductsService

type AccountsService

type AccountsService struct {
	Products *AccountsProductsService
	// contains filtered or unexported fields
}

func NewAccountsService

func NewAccountsService(s *Service) *AccountsService

type CustomAttribute

type CustomAttribute struct {
	// GroupValues: Subattributes within this attribute group. If `group_values` is
	// not empty, `value` must be empty.
	GroupValues []*CustomAttribute `json:"groupValues,omitempty"`
	// Name: The name of the attribute.
	Name string `json:"name,omitempty"`
	// Value: The value of the attribute. If `value` is not empty, `group_values`
	// must be empty.
	Value string `json:"value,omitempty"`
	// ForceSendFields is a list of field names (e.g. "GroupValues") 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. "GroupValues") 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:"-"`
}

CustomAttribute: A message that represents custom attributes. Exactly one of `value` or `group_values` must not be empty.

func (CustomAttribute) MarshalJSON

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

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 Interval

type Interval struct {
	// EndTime: Optional. Exclusive end of the interval. If specified, a Timestamp
	// matching this interval will have to be before the end.
	EndTime string `json:"endTime,omitempty"`
	// StartTime: Optional. Inclusive start of the interval. If specified, a
	// Timestamp matching this interval will have to be the same or after the
	// start.
	StartTime string `json:"startTime,omitempty"`
	// ForceSendFields is a list of field names (e.g. "EndTime") 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. "EndTime") 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:"-"`
}

Interval: Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.

func (Interval) MarshalJSON

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

type ListLocalInventoriesResponse

type ListLocalInventoriesResponse struct {
	// LocalInventories: The `LocalInventory` resources for the given product from
	// the specified account.
	LocalInventories []*LocalInventory `json:"localInventories,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. "LocalInventories") 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. "LocalInventories") 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:"-"`
}

ListLocalInventoriesResponse: Response message for the `ListLocalInventories` method.

func (ListLocalInventoriesResponse) MarshalJSON

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

type ListRegionalInventoriesResponse

type ListRegionalInventoriesResponse struct {
	// 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"`
	// RegionalInventories: The `RegionalInventory` resources for the given product
	// from the specified account.
	RegionalInventories []*RegionalInventory `json:"regionalInventories,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "NextPageToken") 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. "NextPageToken") 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:"-"`
}

ListRegionalInventoriesResponse: Response message for the `ListRegionalInventories` method.

func (ListRegionalInventoriesResponse) MarshalJSON

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

type LocalInventory

type LocalInventory struct {
	// Account: Output only. The account that owns the product. This field will be
	// ignored if set by the client.
	Account int64 `json:"account,omitempty,string"`
	// Availability: 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"`
	// CustomAttributes: A list of custom (merchant-provided) attributes. You can
	// also use `CustomAttribute` to submit any attribute of the data specification
	// in its generic form.
	CustomAttributes []*CustomAttribute `json:"customAttributes,omitempty"`
	// InstoreProductLocation: Location of the product inside the store. Maximum
	// length is 20 bytes.
	InstoreProductLocation string `json:"instoreProductLocation,omitempty"`
	// Name: Output only. The name of the `LocalInventory` resource. Format:
	// `accounts/{account}/products/{product}/localInventories/{store_code}`
	Name string `json:"name,omitempty"`
	// PickupMethod: Supported pickup method for this product. 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: Relative time period from the order date for an order for this
	// product, from this store, to be ready for pickup. Must be submitted 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: Price of the product at this store.
	Price *Price `json:"price,omitempty"`
	// Quantity: Quantity of the product available at this store. Must be greater
	// than or equal to zero.
	Quantity int64 `json:"quantity,omitempty,string"`
	// SalePrice: Sale price of the product at this store. Mandatory if
	// `salePriceEffectiveDate` is defined.
	SalePrice *Price `json:"salePrice,omitempty"`
	// SalePriceEffectiveDate: The `TimePeriod` of the sale at this store.
	SalePriceEffectiveDate *Interval `json:"salePriceEffectiveDate,omitempty"`
	// StoreCode: Required. Immutable. Store code (the store ID from your Business
	// Profile) of the physical store the product is sold in. See the Local product
	// inventory data specification
	// (https://support.google.com/merchants/answer/3061342) for more information.
	StoreCode string `json:"storeCode,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// 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:"-"`
}

LocalInventory: Local inventory information for the product. Represents in-store information for a specific product at the store specified by `storeCode`. For a list of all accepted attribute values, see the local product inventory data specification (https://support.google.com/merchants/answer/3061342).

func (LocalInventory) MarshalJSON

func (s LocalInventory) 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).
	//   "PRODUCT_REVIEWS" - [Product
	// Reviews](https://support.google.com/merchants/answer/14620732).
	//   "MERCHANT_REVIEWS" - [Merchant
	// Reviews](https://developers.google.com/merchant-review-feeds).
	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 RegionalInventory

type RegionalInventory struct {
	// Account: Output only. The account that owns the product. This field will be
	// ignored if set by the client.
	Account int64 `json:"account,omitempty,string"`
	// Availability: Availability of the product in this region. For accepted
	// attribute values, see the regional product inventory data specification
	// (https://support.google.com/merchants/answer/3061342)
	Availability string `json:"availability,omitempty"`
	// CustomAttributes: A list of custom (merchant-provided) attributes. You can
	// also use `CustomAttribute` to submit any attribute of the data specification
	// in its generic form.
	CustomAttributes []*CustomAttribute `json:"customAttributes,omitempty"`
	// Name: Output only. The name of the `RegionalInventory` resource. Format:
	// `{regional_inventory.name=accounts/{account}/products/{product}/regionalInven
	// tories/{region}`
	Name string `json:"name,omitempty"`
	// Price: Price of the product in this region.
	Price *Price `json:"price,omitempty"`
	// Region: Required. Immutable. ID of the region for this `RegionalInventory`
	// resource. See the Regional availability and pricing
	// (https://support.google.com/merchants/answer/9698880) for more details.
	Region string `json:"region,omitempty"`
	// SalePrice: Sale price of the product in this region. Mandatory if
	// `salePriceEffectiveDate` is defined.
	SalePrice *Price `json:"salePrice,omitempty"`
	// SalePriceEffectiveDate: The `TimePeriod` of the sale price in this region.
	SalePriceEffectiveDate *Interval `json:"salePriceEffectiveDate,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// 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:"-"`
}

RegionalInventory: Regional inventory information for the product. Represents specific information like price and availability for a given product in a specific `region`. For a list of all accepted attribute values, see the regional product inventory data specification (https://support.google.com/merchants/answer/9698880).

func (RegionalInventory) MarshalJSON

func (s RegionalInventory) 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