...

Source file src/google.golang.org/api/manufacturers/v1/manufacturers-gen.go

Documentation: google.golang.org/api/manufacturers/v1

     1  // Copyright 2024 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package manufacturers provides access to the Manufacturer Center API.
     8  //
     9  // For product documentation, see: https://developers.google.com/manufacturers/
    10  //
    11  // # Library status
    12  //
    13  // These client libraries are officially supported by Google. However, this
    14  // library is considered complete and is in maintenance mode. This means
    15  // that we will address critical bugs and security issues but will not add
    16  // any new features.
    17  //
    18  // When possible, we recommend using our newer
    19  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    20  // that are still actively being worked and iterated on.
    21  //
    22  // # Creating a client
    23  //
    24  // Usage example:
    25  //
    26  //	import "google.golang.org/api/manufacturers/v1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	manufacturersService, err := manufacturers.NewService(ctx)
    30  //
    31  // In this example, Google Application Default Credentials are used for
    32  // authentication. For information on how to create and obtain Application
    33  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    34  //
    35  // # Other authentication options
    36  //
    37  // To use an API key for authentication (note: some APIs do not support API
    38  // keys), use [google.golang.org/api/option.WithAPIKey]:
    39  //
    40  //	manufacturersService, err := manufacturers.NewService(ctx, option.WithAPIKey("AIza..."))
    41  //
    42  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    43  // flow, use [google.golang.org/api/option.WithTokenSource]:
    44  //
    45  //	config := &oauth2.Config{...}
    46  //	// ...
    47  //	token, err := config.Exchange(ctx, ...)
    48  //	manufacturersService, err := manufacturers.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package manufacturers // import "google.golang.org/api/manufacturers/v1"
    52  
    53  import (
    54  	"bytes"
    55  	"context"
    56  	"encoding/json"
    57  	"errors"
    58  	"fmt"
    59  	"io"
    60  	"net/http"
    61  	"net/url"
    62  	"strconv"
    63  	"strings"
    64  
    65  	googleapi "google.golang.org/api/googleapi"
    66  	internal "google.golang.org/api/internal"
    67  	gensupport "google.golang.org/api/internal/gensupport"
    68  	option "google.golang.org/api/option"
    69  	internaloption "google.golang.org/api/option/internaloption"
    70  	htransport "google.golang.org/api/transport/http"
    71  )
    72  
    73  // Always reference these packages, just in case the auto-generated code
    74  // below doesn't.
    75  var _ = bytes.NewBuffer
    76  var _ = strconv.Itoa
    77  var _ = fmt.Sprintf
    78  var _ = json.NewDecoder
    79  var _ = io.Copy
    80  var _ = url.Parse
    81  var _ = gensupport.MarshalJSON
    82  var _ = googleapi.Version
    83  var _ = errors.New
    84  var _ = strings.Replace
    85  var _ = context.Canceled
    86  var _ = internaloption.WithDefaultEndpoint
    87  var _ = internal.Version
    88  
    89  const apiId = "manufacturers:v1"
    90  const apiName = "manufacturers"
    91  const apiVersion = "v1"
    92  const basePath = "https://manufacturers.googleapis.com/"
    93  const basePathTemplate = "https://manufacturers.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://manufacturers.mtls.googleapis.com/"
    95  
    96  // OAuth2 scopes used by this API.
    97  const (
    98  	// Manage your product listings for Google Manufacturer Center
    99  	ManufacturercenterScope = "https://www.googleapis.com/auth/manufacturercenter"
   100  )
   101  
   102  // NewService creates a new Service.
   103  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   104  	scopesOption := internaloption.WithDefaultScopes(
   105  		"https://www.googleapis.com/auth/manufacturercenter",
   106  	)
   107  	// NOTE: prepend, so we don't override user-specified scopes.
   108  	opts = append([]option.ClientOption{scopesOption}, opts...)
   109  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   110  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   111  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   112  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   113  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   114  	if err != nil {
   115  		return nil, err
   116  	}
   117  	s, err := New(client)
   118  	if err != nil {
   119  		return nil, err
   120  	}
   121  	if endpoint != "" {
   122  		s.BasePath = endpoint
   123  	}
   124  	return s, nil
   125  }
   126  
   127  // New creates a new Service. It uses the provided http.Client for requests.
   128  //
   129  // Deprecated: please use NewService instead.
   130  // To provide a custom HTTP client, use option.WithHTTPClient.
   131  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   132  func New(client *http.Client) (*Service, error) {
   133  	if client == nil {
   134  		return nil, errors.New("client is nil")
   135  	}
   136  	s := &Service{client: client, BasePath: basePath}
   137  	s.Accounts = NewAccountsService(s)
   138  	return s, nil
   139  }
   140  
   141  type Service struct {
   142  	client    *http.Client
   143  	BasePath  string // API endpoint base URL
   144  	UserAgent string // optional additional User-Agent fragment
   145  
   146  	Accounts *AccountsService
   147  }
   148  
   149  func (s *Service) userAgent() string {
   150  	if s.UserAgent == "" {
   151  		return googleapi.UserAgent
   152  	}
   153  	return googleapi.UserAgent + " " + s.UserAgent
   154  }
   155  
   156  func NewAccountsService(s *Service) *AccountsService {
   157  	rs := &AccountsService{s: s}
   158  	rs.Languages = NewAccountsLanguagesService(s)
   159  	rs.Products = NewAccountsProductsService(s)
   160  	return rs
   161  }
   162  
   163  type AccountsService struct {
   164  	s *Service
   165  
   166  	Languages *AccountsLanguagesService
   167  
   168  	Products *AccountsProductsService
   169  }
   170  
   171  func NewAccountsLanguagesService(s *Service) *AccountsLanguagesService {
   172  	rs := &AccountsLanguagesService{s: s}
   173  	rs.ProductCertifications = NewAccountsLanguagesProductCertificationsService(s)
   174  	return rs
   175  }
   176  
   177  type AccountsLanguagesService struct {
   178  	s *Service
   179  
   180  	ProductCertifications *AccountsLanguagesProductCertificationsService
   181  }
   182  
   183  func NewAccountsLanguagesProductCertificationsService(s *Service) *AccountsLanguagesProductCertificationsService {
   184  	rs := &AccountsLanguagesProductCertificationsService{s: s}
   185  	return rs
   186  }
   187  
   188  type AccountsLanguagesProductCertificationsService struct {
   189  	s *Service
   190  }
   191  
   192  func NewAccountsProductsService(s *Service) *AccountsProductsService {
   193  	rs := &AccountsProductsService{s: s}
   194  	return rs
   195  }
   196  
   197  type AccountsProductsService struct {
   198  	s *Service
   199  }
   200  
   201  // Attributes: Attributes of the product. For more information, see
   202  // https://support.google.com/manufacturers/answer/6124116.
   203  type Attributes struct {
   204  	// AdditionalImageLink: The additional images of the product. For more
   205  	// information, see
   206  	// https://support.google.com/manufacturers/answer/6124116#addlimage.
   207  	AdditionalImageLink []*Image `json:"additionalImageLink,omitempty"`
   208  	// AgeGroup: The target age group of the product. For more information, see
   209  	// https://support.google.com/manufacturers/answer/6124116#agegroup.
   210  	AgeGroup string `json:"ageGroup,omitempty"`
   211  	// Brand: The brand name of the product. For more information, see
   212  	// https://support.google.com/manufacturers/answer/6124116#brand.
   213  	Brand string `json:"brand,omitempty"`
   214  	// Capacity: The capacity of the product. For more information, see
   215  	// https://support.google.com/manufacturers/answer/6124116#capacity.
   216  	Capacity *Capacity `json:"capacity,omitempty"`
   217  	// Certification: Optional. List of certifications claimed by this product.
   218  	Certification []*GoogleShoppingManufacturersV1ProductCertification `json:"certification,omitempty"`
   219  	// Color: The color of the product. For more information, see
   220  	// https://support.google.com/manufacturers/answer/6124116#color.
   221  	Color string `json:"color,omitempty"`
   222  	// Count: The count of the product. For more information, see
   223  	// https://support.google.com/manufacturers/answer/6124116#count.
   224  	Count *Count `json:"count,omitempty"`
   225  	// Description: The description of the product. For more information, see
   226  	// https://support.google.com/manufacturers/answer/6124116#description.
   227  	Description string `json:"description,omitempty"`
   228  	// DisclosureDate: The disclosure date of the product. For more information,
   229  	// see https://support.google.com/manufacturers/answer/6124116#disclosure.
   230  	DisclosureDate string `json:"disclosureDate,omitempty"`
   231  	// ExcludedDestination: A list of excluded destinations such as "ClientExport",
   232  	// "ClientShoppingCatalog" or "PartnerShoppingCatalog". For more information,
   233  	// see https://support.google.com/manufacturers/answer/7443550
   234  	ExcludedDestination []string `json:"excludedDestination,omitempty"`
   235  	// FeatureDescription: The rich format description of the product. For more
   236  	// information, see
   237  	// https://support.google.com/manufacturers/answer/6124116#featuredesc.
   238  	FeatureDescription []*FeatureDescription `json:"featureDescription,omitempty"`
   239  	// Flavor: The flavor of the product. For more information, see
   240  	// https://support.google.com/manufacturers/answer/6124116#flavor.
   241  	Flavor string `json:"flavor,omitempty"`
   242  	// Format: The format of the product. For more information, see
   243  	// https://support.google.com/manufacturers/answer/6124116#format.
   244  	Format string `json:"format,omitempty"`
   245  	// Gender: The target gender of the product. For more information, see
   246  	// https://support.google.com/manufacturers/answer/6124116#gender.
   247  	Gender string `json:"gender,omitempty"`
   248  	// Grocery: Grocery Attributes. See more at
   249  	// https://support.google.com/manufacturers/answer/12098458#grocery.
   250  	Grocery *Grocery `json:"grocery,omitempty"`
   251  	// Gtin: The Global Trade Item Number (GTIN) of the product. For more
   252  	// information, see
   253  	// https://support.google.com/manufacturers/answer/6124116#gtin.
   254  	Gtin []string `json:"gtin,omitempty"`
   255  	// ImageLink: The image of the product. For more information, see
   256  	// https://support.google.com/manufacturers/answer/6124116#image.
   257  	ImageLink *Image `json:"imageLink,omitempty"`
   258  	// IncludedDestination: A list of included destinations such as "ClientExport",
   259  	// "ClientShoppingCatalog" or "PartnerShoppingCatalog". For more information,
   260  	// see https://support.google.com/manufacturers/answer/7443550
   261  	IncludedDestination []string `json:"includedDestination,omitempty"`
   262  	// ItemGroupId: The item group id of the product. For more information, see
   263  	// https://support.google.com/manufacturers/answer/6124116#itemgroupid.
   264  	ItemGroupId string `json:"itemGroupId,omitempty"`
   265  	// Material: The material of the product. For more information, see
   266  	// https://support.google.com/manufacturers/answer/6124116#material.
   267  	Material string `json:"material,omitempty"`
   268  	// Mpn: The Manufacturer Part Number (MPN) of the product. For more
   269  	// information, see
   270  	// https://support.google.com/manufacturers/answer/6124116#mpn.
   271  	Mpn string `json:"mpn,omitempty"`
   272  	// Nutrition: Nutrition Attributes. See more at
   273  	// https://support.google.com/manufacturers/answer/12098458#food-servings.
   274  	Nutrition *Nutrition `json:"nutrition,omitempty"`
   275  	// Pattern: The pattern of the product. For more information, see
   276  	// https://support.google.com/manufacturers/answer/6124116#pattern.
   277  	Pattern string `json:"pattern,omitempty"`
   278  	// ProductDetail: The details of the product. For more information, see
   279  	// https://support.google.com/manufacturers/answer/6124116#productdetail.
   280  	ProductDetail []*ProductDetail `json:"productDetail,omitempty"`
   281  	// ProductHighlight: The product highlights. For more information, see
   282  	// https://support.google.com/manufacturers/answer/10066942
   283  	ProductHighlight []string `json:"productHighlight,omitempty"`
   284  	// ProductLine: The name of the group of products related to the product. For
   285  	// more information, see
   286  	// https://support.google.com/manufacturers/answer/6124116#productline.
   287  	ProductLine string `json:"productLine,omitempty"`
   288  	// ProductName: The canonical name of the product. For more information, see
   289  	// https://support.google.com/manufacturers/answer/6124116#productname.
   290  	ProductName string `json:"productName,omitempty"`
   291  	// ProductPageUrl: The URL of the detail page of the product. For more
   292  	// information, see
   293  	// https://support.google.com/manufacturers/answer/6124116#productpage.
   294  	ProductPageUrl string `json:"productPageUrl,omitempty"`
   295  	// ProductType: The type or category of the product. For more information, see
   296  	// https://support.google.com/manufacturers/answer/6124116#producttype.
   297  	ProductType []string `json:"productType,omitempty"`
   298  	// ReleaseDate: The release date of the product. For more information, see
   299  	// https://support.google.com/manufacturers/answer/6124116#release.
   300  	ReleaseDate string `json:"releaseDate,omitempty"`
   301  	// RichProductContent: Rich product content. For more information, see
   302  	// https://support.google.com/manufacturers/answer/9389865
   303  	RichProductContent []string `json:"richProductContent,omitempty"`
   304  	// Scent: The scent of the product. For more information, see
   305  	// https://support.google.com/manufacturers/answer/6124116#scent.
   306  	Scent string `json:"scent,omitempty"`
   307  	// Size: The size of the product. For more information, see
   308  	// https://support.google.com/manufacturers/answer/6124116#size.
   309  	Size string `json:"size,omitempty"`
   310  	// SizeSystem: The size system of the product. For more information, see
   311  	// https://support.google.com/manufacturers/answer/6124116#sizesystem.
   312  	SizeSystem string `json:"sizeSystem,omitempty"`
   313  	// SizeType: The size type of the product. For more information, see
   314  	// https://support.google.com/manufacturers/answer/6124116#sizetype.
   315  	SizeType []string `json:"sizeType,omitempty"`
   316  	// SuggestedRetailPrice: The suggested retail price (MSRP) of the product. For
   317  	// more information, see
   318  	// https://support.google.com/manufacturers/answer/6124116#price.
   319  	SuggestedRetailPrice *Price `json:"suggestedRetailPrice,omitempty"`
   320  	// TargetClientId: The target client id. Should only be used in the accounts of
   321  	// the data partners. For more information, see
   322  	// https://support.google.com/manufacturers/answer/10857344
   323  	TargetClientId string `json:"targetClientId,omitempty"`
   324  	// Theme: The theme of the product. For more information, see
   325  	// https://support.google.com/manufacturers/answer/6124116#theme.
   326  	Theme string `json:"theme,omitempty"`
   327  	// Title: The title of the product. For more information, see
   328  	// https://support.google.com/manufacturers/answer/6124116#title.
   329  	Title string `json:"title,omitempty"`
   330  	// VideoLink: The videos of the product. For more information, see
   331  	// https://support.google.com/manufacturers/answer/6124116#video.
   332  	VideoLink []string `json:"videoLink,omitempty"`
   333  	// VirtualModelLink: Virtual Model (3d) asset link.
   334  	VirtualModelLink string `json:"virtualModelLink,omitempty"`
   335  	// ForceSendFields is a list of field names (e.g. "AdditionalImageLink") to
   336  	// unconditionally include in API requests. By default, fields with empty or
   337  	// default values are omitted from API requests. See
   338  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   339  	// details.
   340  	ForceSendFields []string `json:"-"`
   341  	// NullFields is a list of field names (e.g. "AdditionalImageLink") to include
   342  	// in API requests with the JSON null value. By default, fields with empty
   343  	// values are omitted from API requests. See
   344  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   345  	NullFields []string `json:"-"`
   346  }
   347  
   348  func (s *Attributes) MarshalJSON() ([]byte, error) {
   349  	type NoMethod Attributes
   350  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   351  }
   352  
   353  // Capacity: The capacity of a product. For more information, see
   354  // https://support.google.com/manufacturers/answer/6124116#capacity.
   355  type Capacity struct {
   356  	// Unit: The unit of the capacity, i.e., MB, GB, or TB.
   357  	Unit string `json:"unit,omitempty"`
   358  	// Value: The numeric value of the capacity.
   359  	Value int64 `json:"value,omitempty,string"`
   360  	// ForceSendFields is a list of field names (e.g. "Unit") to unconditionally
   361  	// include in API requests. By default, fields with empty or default values are
   362  	// omitted from API requests. See
   363  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   364  	// details.
   365  	ForceSendFields []string `json:"-"`
   366  	// NullFields is a list of field names (e.g. "Unit") to include in API requests
   367  	// with the JSON null value. By default, fields with empty values are omitted
   368  	// from API requests. See
   369  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   370  	NullFields []string `json:"-"`
   371  }
   372  
   373  func (s *Capacity) MarshalJSON() ([]byte, error) {
   374  	type NoMethod Capacity
   375  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   376  }
   377  
   378  // Certification: Description of a certification.
   379  type Certification struct {
   380  	// Authority: Required. Name of the certification body.
   381  	Authority string `json:"authority,omitempty"`
   382  	// Code: Required. A unique code to identify the certification.
   383  	Code string `json:"code,omitempty"`
   384  	// Link: Optional. A URL link to the certification.
   385  	Link string `json:"link,omitempty"`
   386  	// Logo: Optional. A URL link to the certification logo.
   387  	Logo string `json:"logo,omitempty"`
   388  	// Name: Required. Name of the certification.
   389  	Name string `json:"name,omitempty"`
   390  	// ValidUntil: Optional. The expiration date (UTC).
   391  	ValidUntil string `json:"validUntil,omitempty"`
   392  	// Value: Optional. A custom value of the certification.
   393  	Value string `json:"value,omitempty"`
   394  	// ForceSendFields is a list of field names (e.g. "Authority") to
   395  	// unconditionally include in API requests. By default, fields with empty or
   396  	// default values are omitted from API requests. See
   397  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   398  	// details.
   399  	ForceSendFields []string `json:"-"`
   400  	// NullFields is a list of field names (e.g. "Authority") to include in API
   401  	// requests with the JSON null value. By default, fields with empty values are
   402  	// omitted from API requests. See
   403  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   404  	NullFields []string `json:"-"`
   405  }
   406  
   407  func (s *Certification) MarshalJSON() ([]byte, error) {
   408  	type NoMethod Certification
   409  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   410  }
   411  
   412  // Count: The number of products in a single package. For more information, see
   413  // https://support.google.com/manufacturers/answer/6124116#count.
   414  type Count struct {
   415  	// Unit: The unit in which these products are counted.
   416  	Unit string `json:"unit,omitempty"`
   417  	// Value: The numeric value of the number of products in a package.
   418  	Value int64 `json:"value,omitempty,string"`
   419  	// ForceSendFields is a list of field names (e.g. "Unit") to unconditionally
   420  	// include in API requests. By default, fields with empty or default values are
   421  	// omitted from API requests. See
   422  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   423  	// details.
   424  	ForceSendFields []string `json:"-"`
   425  	// NullFields is a list of field names (e.g. "Unit") to include in API requests
   426  	// with the JSON null value. By default, fields with empty values are omitted
   427  	// from API requests. See
   428  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   429  	NullFields []string `json:"-"`
   430  }
   431  
   432  func (s *Count) MarshalJSON() ([]byte, error) {
   433  	type NoMethod Count
   434  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   435  }
   436  
   437  // DestinationStatus: The destination status.
   438  type DestinationStatus struct {
   439  	// Destination: The name of the destination.
   440  	Destination string `json:"destination,omitempty"`
   441  	// Status: The status of the destination.
   442  	//
   443  	// Possible values:
   444  	//   "UNKNOWN" - Unspecified status, never used.
   445  	//   "ACTIVE" - The product is used for this destination.
   446  	//   "PENDING" - The decision is still pending.
   447  	//   "DISAPPROVED" - The product is disapproved. Please look at the issues.
   448  	Status string `json:"status,omitempty"`
   449  	// ForceSendFields is a list of field names (e.g. "Destination") to
   450  	// unconditionally include in API requests. By default, fields with empty or
   451  	// default values are omitted from API requests. See
   452  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   453  	// details.
   454  	ForceSendFields []string `json:"-"`
   455  	// NullFields is a list of field names (e.g. "Destination") to include in API
   456  	// requests with the JSON null value. By default, fields with empty values are
   457  	// omitted from API requests. See
   458  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   459  	NullFields []string `json:"-"`
   460  }
   461  
   462  func (s *DestinationStatus) MarshalJSON() ([]byte, error) {
   463  	type NoMethod DestinationStatus
   464  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   465  }
   466  
   467  // Empty: A generic empty message that you can re-use to avoid defining
   468  // duplicated empty messages in your APIs. A typical example is to use it as
   469  // the request or the response type of an API method. For instance: service Foo
   470  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   471  type Empty struct {
   472  	// ServerResponse contains the HTTP response code and headers from the server.
   473  	googleapi.ServerResponse `json:"-"`
   474  }
   475  
   476  // FeatureDescription: A feature description of the product. For more
   477  // information, see
   478  // https://support.google.com/manufacturers/answer/6124116#featuredesc.
   479  type FeatureDescription struct {
   480  	// Headline: A short description of the feature.
   481  	Headline string `json:"headline,omitempty"`
   482  	// Image: An optional image describing the feature.
   483  	Image *Image `json:"image,omitempty"`
   484  	// Text: A detailed description of the feature.
   485  	Text string `json:"text,omitempty"`
   486  	// ForceSendFields is a list of field names (e.g. "Headline") to
   487  	// unconditionally include in API requests. By default, fields with empty or
   488  	// default values are omitted from API requests. See
   489  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   490  	// details.
   491  	ForceSendFields []string `json:"-"`
   492  	// NullFields is a list of field names (e.g. "Headline") to include in API
   493  	// requests with the JSON null value. By default, fields with empty values are
   494  	// omitted from API requests. See
   495  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   496  	NullFields []string `json:"-"`
   497  }
   498  
   499  func (s *FeatureDescription) MarshalJSON() ([]byte, error) {
   500  	type NoMethod FeatureDescription
   501  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   502  }
   503  
   504  // FloatUnit: Combination of float amount and unit.
   505  type FloatUnit struct {
   506  	// Amount: amount.
   507  	Amount float64 `json:"amount,omitempty"`
   508  	// Unit: unit.
   509  	Unit string `json:"unit,omitempty"`
   510  	// ForceSendFields is a list of field names (e.g. "Amount") to unconditionally
   511  	// include in API requests. By default, fields with empty or default values are
   512  	// omitted from API requests. See
   513  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   514  	// details.
   515  	ForceSendFields []string `json:"-"`
   516  	// NullFields is a list of field names (e.g. "Amount") to include in API
   517  	// requests with the JSON null value. By default, fields with empty values are
   518  	// omitted from API requests. See
   519  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   520  	NullFields []string `json:"-"`
   521  }
   522  
   523  func (s *FloatUnit) MarshalJSON() ([]byte, error) {
   524  	type NoMethod FloatUnit
   525  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   526  }
   527  
   528  func (s *FloatUnit) UnmarshalJSON(data []byte) error {
   529  	type NoMethod FloatUnit
   530  	var s1 struct {
   531  		Amount gensupport.JSONFloat64 `json:"amount"`
   532  		*NoMethod
   533  	}
   534  	s1.NoMethod = (*NoMethod)(s)
   535  	if err := json.Unmarshal(data, &s1); err != nil {
   536  		return err
   537  	}
   538  	s.Amount = float64(s1.Amount)
   539  	return nil
   540  }
   541  
   542  // GoogleShoppingManufacturersV1ProductCertification: Description of a
   543  // certification.
   544  type GoogleShoppingManufacturersV1ProductCertification struct {
   545  	// Authority: Required. Name of the certification body.
   546  	Authority string `json:"authority,omitempty"`
   547  	// Code: Required. A unique code to identify the certification.
   548  	Code string `json:"code,omitempty"`
   549  	// Name: Required. Name of the certification.
   550  	Name string `json:"name,omitempty"`
   551  	// ForceSendFields is a list of field names (e.g. "Authority") to
   552  	// unconditionally include in API requests. By default, fields with empty or
   553  	// default values are omitted from API requests. See
   554  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   555  	// details.
   556  	ForceSendFields []string `json:"-"`
   557  	// NullFields is a list of field names (e.g. "Authority") to include in API
   558  	// requests with the JSON null value. By default, fields with empty values are
   559  	// omitted from API requests. See
   560  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   561  	NullFields []string `json:"-"`
   562  }
   563  
   564  func (s *GoogleShoppingManufacturersV1ProductCertification) MarshalJSON() ([]byte, error) {
   565  	type NoMethod GoogleShoppingManufacturersV1ProductCertification
   566  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   567  }
   568  
   569  type Grocery struct {
   570  	// ActiveIngredients: Active ingredients.
   571  	ActiveIngredients string `json:"activeIngredients,omitempty"`
   572  	// AlcoholByVolume: Alcohol by volume.
   573  	AlcoholByVolume float64 `json:"alcoholByVolume,omitempty"`
   574  	// Allergens: Allergens.
   575  	Allergens string `json:"allergens,omitempty"`
   576  	// DerivedNutritionClaim: Derived nutrition claim.
   577  	DerivedNutritionClaim []string `json:"derivedNutritionClaim,omitempty"`
   578  	// Directions: Directions.
   579  	Directions string `json:"directions,omitempty"`
   580  	// Indications: Indications.
   581  	Indications string `json:"indications,omitempty"`
   582  	// Ingredients: Ingredients.
   583  	Ingredients string `json:"ingredients,omitempty"`
   584  	// NutritionClaim: Nutrition claim.
   585  	NutritionClaim []string `json:"nutritionClaim,omitempty"`
   586  	// StorageInstructions: Storage instructions.
   587  	StorageInstructions string `json:"storageInstructions,omitempty"`
   588  	// ForceSendFields is a list of field names (e.g. "ActiveIngredients") to
   589  	// unconditionally include in API requests. By default, fields with empty or
   590  	// default values are omitted from API requests. See
   591  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   592  	// details.
   593  	ForceSendFields []string `json:"-"`
   594  	// NullFields is a list of field names (e.g. "ActiveIngredients") to include in
   595  	// API requests with the JSON null value. By default, fields with empty values
   596  	// are omitted from API requests. See
   597  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   598  	NullFields []string `json:"-"`
   599  }
   600  
   601  func (s *Grocery) MarshalJSON() ([]byte, error) {
   602  	type NoMethod Grocery
   603  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   604  }
   605  
   606  func (s *Grocery) UnmarshalJSON(data []byte) error {
   607  	type NoMethod Grocery
   608  	var s1 struct {
   609  		AlcoholByVolume gensupport.JSONFloat64 `json:"alcoholByVolume"`
   610  		*NoMethod
   611  	}
   612  	s1.NoMethod = (*NoMethod)(s)
   613  	if err := json.Unmarshal(data, &s1); err != nil {
   614  		return err
   615  	}
   616  	s.AlcoholByVolume = float64(s1.AlcoholByVolume)
   617  	return nil
   618  }
   619  
   620  // Image: An image.
   621  type Image struct {
   622  	// ImageUrl: The URL of the image. For crawled images, this is the provided
   623  	// URL. For uploaded images, this is a serving URL from Google if the image has
   624  	// been processed successfully.
   625  	ImageUrl string `json:"imageUrl,omitempty"`
   626  	// Status: The status of the image. @OutputOnly
   627  	//
   628  	// Possible values:
   629  	//   "STATUS_UNSPECIFIED" - The image status is unspecified. Should not be
   630  	// used.
   631  	//   "PENDING_PROCESSING" - The image was uploaded and is being processed.
   632  	//   "PENDING_CRAWL" - The image crawl is still pending.
   633  	//   "OK" - The image was processed and it meets the requirements.
   634  	//   "ROBOTED" - The image URL is protected by robots.txt file and cannot be
   635  	// crawled.
   636  	//   "XROBOTED" - The image URL is protected by X-Robots-Tag and cannot be
   637  	// crawled.
   638  	//   "CRAWL_ERROR" - There was an error while crawling the image.
   639  	//   "PROCESSING_ERROR" - The image cannot be processed.
   640  	//   "DECODING_ERROR" - The image cannot be decoded.
   641  	//   "TOO_BIG" - The image is too big.
   642  	//   "CRAWL_SKIPPED" - The image was manually overridden and will not be
   643  	// crawled.
   644  	//   "HOSTLOADED" - The image crawl was postponed to avoid overloading the
   645  	// host.
   646  	//   "HTTP_404" - The image URL returned a "404 Not Found" error.
   647  	Status string `json:"status,omitempty"`
   648  	// Type: The type of the image, i.e., crawled or uploaded. @OutputOnly
   649  	//
   650  	// Possible values:
   651  	//   "TYPE_UNSPECIFIED" - Type is unspecified. Should not be used.
   652  	//   "CRAWLED" - The image was crawled from a provided URL.
   653  	//   "UPLOADED" - The image was uploaded.
   654  	Type string `json:"type,omitempty"`
   655  	// ForceSendFields is a list of field names (e.g. "ImageUrl") to
   656  	// unconditionally include in API requests. By default, fields with empty or
   657  	// default values are omitted from API requests. See
   658  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   659  	// details.
   660  	ForceSendFields []string `json:"-"`
   661  	// NullFields is a list of field names (e.g. "ImageUrl") to include in API
   662  	// requests with the JSON null value. By default, fields with empty values are
   663  	// omitted from API requests. See
   664  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   665  	NullFields []string `json:"-"`
   666  }
   667  
   668  func (s *Image) MarshalJSON() ([]byte, error) {
   669  	type NoMethod Image
   670  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   671  }
   672  
   673  // Issue: Product issue.
   674  type Issue struct {
   675  	// Attribute: If present, the attribute that triggered the issue. For more
   676  	// information about attributes, see
   677  	// https://support.google.com/manufacturers/answer/6124116.
   678  	Attribute string `json:"attribute,omitempty"`
   679  	// Description: Longer description of the issue focused on how to resolve it.
   680  	Description string `json:"description,omitempty"`
   681  	// Destination: The destination this issue applies to.
   682  	Destination string `json:"destination,omitempty"`
   683  	// Resolution: What needs to happen to resolve the issue.
   684  	//
   685  	// Possible values:
   686  	//   "RESOLUTION_UNSPECIFIED" - Unspecified resolution, never used.
   687  	//   "USER_ACTION" - The user who provided the data must act in order to
   688  	// resolve the issue (for example by correcting some data).
   689  	//   "PENDING_PROCESSING" - The issue will be resolved automatically (for
   690  	// example image crawl or Google review). No action is required now. Resolution
   691  	// might lead to another issue (for example if crawl fails).
   692  	Resolution string `json:"resolution,omitempty"`
   693  	// Severity: The severity of the issue.
   694  	//
   695  	// Possible values:
   696  	//   "SEVERITY_UNSPECIFIED" - Unspecified severity, never used.
   697  	//   "ERROR" - Error severity. The issue prevents the usage of the whole item.
   698  	//   "WARNING" - Warning severity. The issue is either one that prevents the
   699  	// usage of the attribute that triggered it or one that will soon prevent the
   700  	// usage of the whole item.
   701  	//   "INFO" - Info severity. The issue is one that doesn't require immediate
   702  	// attention. It is, for example, used to communicate which attributes are
   703  	// still pending review.
   704  	Severity string `json:"severity,omitempty"`
   705  	// Timestamp: The timestamp when this issue appeared.
   706  	Timestamp string `json:"timestamp,omitempty"`
   707  	// Title: Short title describing the nature of the issue.
   708  	Title string `json:"title,omitempty"`
   709  	// Type: The server-generated type of the issue, for example,
   710  	// “INCORRECT_TEXT_FORMATTING”, “IMAGE_NOT_SERVEABLE”, etc.
   711  	Type string `json:"type,omitempty"`
   712  	// ForceSendFields is a list of field names (e.g. "Attribute") to
   713  	// unconditionally include in API requests. By default, fields with empty or
   714  	// default values are omitted from API requests. See
   715  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   716  	// details.
   717  	ForceSendFields []string `json:"-"`
   718  	// NullFields is a list of field names (e.g. "Attribute") to include in API
   719  	// requests with the JSON null value. By default, fields with empty values are
   720  	// omitted from API requests. See
   721  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   722  	NullFields []string `json:"-"`
   723  }
   724  
   725  func (s *Issue) MarshalJSON() ([]byte, error) {
   726  	type NoMethod Issue
   727  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   728  }
   729  
   730  // ListProductCertificationsResponse: Response for ListProductCertifications
   731  // method.
   732  type ListProductCertificationsResponse struct {
   733  	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
   734  	// next page. If this field is omitted, there are no subsequent pages.
   735  	NextPageToken string `json:"nextPageToken,omitempty"`
   736  	// ProductCertifications: The product certifications from the specified
   737  	// certification body.
   738  	ProductCertifications []*ProductCertification `json:"productCertifications,omitempty"`
   739  
   740  	// ServerResponse contains the HTTP response code and headers from the server.
   741  	googleapi.ServerResponse `json:"-"`
   742  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   743  	// unconditionally include in API requests. By default, fields with empty or
   744  	// default values are omitted from API requests. See
   745  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   746  	// details.
   747  	ForceSendFields []string `json:"-"`
   748  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   749  	// requests with the JSON null value. By default, fields with empty values are
   750  	// omitted from API requests. See
   751  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   752  	NullFields []string `json:"-"`
   753  }
   754  
   755  func (s *ListProductCertificationsResponse) MarshalJSON() ([]byte, error) {
   756  	type NoMethod ListProductCertificationsResponse
   757  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   758  }
   759  
   760  type ListProductsResponse struct {
   761  	// NextPageToken: The token for the retrieval of the next page of product
   762  	// statuses.
   763  	NextPageToken string `json:"nextPageToken,omitempty"`
   764  	// Products: List of the products.
   765  	Products []*Product `json:"products,omitempty"`
   766  
   767  	// ServerResponse contains the HTTP response code and headers from the server.
   768  	googleapi.ServerResponse `json:"-"`
   769  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   770  	// unconditionally include in API requests. By default, fields with empty or
   771  	// default values are omitted from API requests. See
   772  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   773  	// details.
   774  	ForceSendFields []string `json:"-"`
   775  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   776  	// requests with the JSON null value. By default, fields with empty values are
   777  	// omitted from API requests. See
   778  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   779  	NullFields []string `json:"-"`
   780  }
   781  
   782  func (s *ListProductsResponse) MarshalJSON() ([]byte, error) {
   783  	type NoMethod ListProductsResponse
   784  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   785  }
   786  
   787  type Nutrition struct {
   788  	// AddedSugars: Added sugars.
   789  	AddedSugars *FloatUnit `json:"addedSugars,omitempty"`
   790  	// AddedSugarsDailyPercentage: Added sugars daily percentage.
   791  	AddedSugarsDailyPercentage float64 `json:"addedSugarsDailyPercentage,omitempty"`
   792  	// Calcium: Calcium.
   793  	Calcium *FloatUnit `json:"calcium,omitempty"`
   794  	// CalciumDailyPercentage: Calcium daily percentage.
   795  	CalciumDailyPercentage float64 `json:"calciumDailyPercentage,omitempty"`
   796  	// Cholesterol: Cholesterol.
   797  	Cholesterol *FloatUnit `json:"cholesterol,omitempty"`
   798  	// CholesterolDailyPercentage: Cholesterol daily percentage.
   799  	CholesterolDailyPercentage float64 `json:"cholesterolDailyPercentage,omitempty"`
   800  	// DietaryFiber: Dietary fiber.
   801  	DietaryFiber *FloatUnit `json:"dietaryFiber,omitempty"`
   802  	// DietaryFiberDailyPercentage: Dietary fiber daily percentage.
   803  	DietaryFiberDailyPercentage float64 `json:"dietaryFiberDailyPercentage,omitempty"`
   804  	// Energy: Mandatory Nutrition Facts. Energy.
   805  	Energy *FloatUnit `json:"energy,omitempty"`
   806  	// EnergyFromFat: Energy from fat.
   807  	EnergyFromFat *FloatUnit `json:"energyFromFat,omitempty"`
   808  	// FolateDailyPercentage: Folate daily percentage.
   809  	FolateDailyPercentage float64 `json:"folateDailyPercentage,omitempty"`
   810  	// FolateFolicAcid: Folate folic acid.
   811  	FolateFolicAcid *FloatUnit `json:"folateFolicAcid,omitempty"`
   812  	// FolateMcgDfe: Folate mcg DFE.
   813  	FolateMcgDfe float64 `json:"folateMcgDfe,omitempty"`
   814  	// Iron: Iron.
   815  	Iron *FloatUnit `json:"iron,omitempty"`
   816  	// IronDailyPercentage: Iron daily percentage.
   817  	IronDailyPercentage float64 `json:"ironDailyPercentage,omitempty"`
   818  	// MonounsaturatedFat: Monounsaturated fat.
   819  	MonounsaturatedFat *FloatUnit `json:"monounsaturatedFat,omitempty"`
   820  	// NutritionFactMeasure: Nutrition fact measure.
   821  	NutritionFactMeasure string `json:"nutritionFactMeasure,omitempty"`
   822  	// Polyols: Polyols.
   823  	Polyols *FloatUnit `json:"polyols,omitempty"`
   824  	// PolyunsaturatedFat: Polyunsaturated fat.
   825  	PolyunsaturatedFat *FloatUnit `json:"polyunsaturatedFat,omitempty"`
   826  	// Potassium: Potassium.
   827  	Potassium *FloatUnit `json:"potassium,omitempty"`
   828  	// PotassiumDailyPercentage: Potassium daily percentage.
   829  	PotassiumDailyPercentage float64 `json:"potassiumDailyPercentage,omitempty"`
   830  	// PreparedSizeDescription: Prepared size description.
   831  	PreparedSizeDescription string `json:"preparedSizeDescription,omitempty"`
   832  	// Protein: Protein.
   833  	Protein *FloatUnit `json:"protein,omitempty"`
   834  	// ProteinDailyPercentage: Protein daily percentage.
   835  	ProteinDailyPercentage float64 `json:"proteinDailyPercentage,omitempty"`
   836  	// SaturatedFat: Saturated fat.
   837  	SaturatedFat *FloatUnit `json:"saturatedFat,omitempty"`
   838  	// SaturatedFatDailyPercentage: Saturated fat daily percentage.
   839  	SaturatedFatDailyPercentage float64 `json:"saturatedFatDailyPercentage,omitempty"`
   840  	// ServingSizeDescription: Food Serving Size. Serving size description.
   841  	ServingSizeDescription string `json:"servingSizeDescription,omitempty"`
   842  	// ServingSizeMeasure: Serving size measure.
   843  	ServingSizeMeasure *FloatUnit `json:"servingSizeMeasure,omitempty"`
   844  	// ServingsPerContainer: Servings per container.
   845  	ServingsPerContainer string `json:"servingsPerContainer,omitempty"`
   846  	// Sodium: Sodium.
   847  	Sodium *FloatUnit `json:"sodium,omitempty"`
   848  	// SodiumDailyPercentage: Sodium daily percentage.
   849  	SodiumDailyPercentage float64 `json:"sodiumDailyPercentage,omitempty"`
   850  	// Starch: Starch.
   851  	Starch *FloatUnit `json:"starch,omitempty"`
   852  	// TotalCarbohydrate: Total carbohydrate.
   853  	TotalCarbohydrate *FloatUnit `json:"totalCarbohydrate,omitempty"`
   854  	// TotalCarbohydrateDailyPercentage: Total carbohydrate daily percentage.
   855  	TotalCarbohydrateDailyPercentage float64 `json:"totalCarbohydrateDailyPercentage,omitempty"`
   856  	// TotalFat: Total fat.
   857  	TotalFat *FloatUnit `json:"totalFat,omitempty"`
   858  	// TotalFatDailyPercentage: Total fat daily percentage.
   859  	TotalFatDailyPercentage float64 `json:"totalFatDailyPercentage,omitempty"`
   860  	// TotalSugars: Total sugars.
   861  	TotalSugars *FloatUnit `json:"totalSugars,omitempty"`
   862  	// TotalSugarsDailyPercentage: Total sugars daily percentage.
   863  	TotalSugarsDailyPercentage float64 `json:"totalSugarsDailyPercentage,omitempty"`
   864  	// TransFat: Trans fat.
   865  	TransFat *FloatUnit `json:"transFat,omitempty"`
   866  	// TransFatDailyPercentage: Trans fat daily percentage.
   867  	TransFatDailyPercentage float64 `json:"transFatDailyPercentage,omitempty"`
   868  	// VitaminD: Vitamin D.
   869  	VitaminD *FloatUnit `json:"vitaminD,omitempty"`
   870  	// VitaminDDailyPercentage: Vitamin D daily percentage.
   871  	VitaminDDailyPercentage float64 `json:"vitaminDDailyPercentage,omitempty"`
   872  	// VoluntaryNutritionFact: Voluntary nutrition fact.
   873  	VoluntaryNutritionFact []*VoluntaryNutritionFact `json:"voluntaryNutritionFact,omitempty"`
   874  	// ForceSendFields is a list of field names (e.g. "AddedSugars") to
   875  	// unconditionally include in API requests. By default, fields with empty or
   876  	// default values are omitted from API requests. See
   877  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   878  	// details.
   879  	ForceSendFields []string `json:"-"`
   880  	// NullFields is a list of field names (e.g. "AddedSugars") to include in API
   881  	// requests with the JSON null value. By default, fields with empty values are
   882  	// omitted from API requests. See
   883  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   884  	NullFields []string `json:"-"`
   885  }
   886  
   887  func (s *Nutrition) MarshalJSON() ([]byte, error) {
   888  	type NoMethod Nutrition
   889  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   890  }
   891  
   892  func (s *Nutrition) UnmarshalJSON(data []byte) error {
   893  	type NoMethod Nutrition
   894  	var s1 struct {
   895  		AddedSugarsDailyPercentage       gensupport.JSONFloat64 `json:"addedSugarsDailyPercentage"`
   896  		CalciumDailyPercentage           gensupport.JSONFloat64 `json:"calciumDailyPercentage"`
   897  		CholesterolDailyPercentage       gensupport.JSONFloat64 `json:"cholesterolDailyPercentage"`
   898  		DietaryFiberDailyPercentage      gensupport.JSONFloat64 `json:"dietaryFiberDailyPercentage"`
   899  		FolateDailyPercentage            gensupport.JSONFloat64 `json:"folateDailyPercentage"`
   900  		FolateMcgDfe                     gensupport.JSONFloat64 `json:"folateMcgDfe"`
   901  		IronDailyPercentage              gensupport.JSONFloat64 `json:"ironDailyPercentage"`
   902  		PotassiumDailyPercentage         gensupport.JSONFloat64 `json:"potassiumDailyPercentage"`
   903  		ProteinDailyPercentage           gensupport.JSONFloat64 `json:"proteinDailyPercentage"`
   904  		SaturatedFatDailyPercentage      gensupport.JSONFloat64 `json:"saturatedFatDailyPercentage"`
   905  		SodiumDailyPercentage            gensupport.JSONFloat64 `json:"sodiumDailyPercentage"`
   906  		TotalCarbohydrateDailyPercentage gensupport.JSONFloat64 `json:"totalCarbohydrateDailyPercentage"`
   907  		TotalFatDailyPercentage          gensupport.JSONFloat64 `json:"totalFatDailyPercentage"`
   908  		TotalSugarsDailyPercentage       gensupport.JSONFloat64 `json:"totalSugarsDailyPercentage"`
   909  		TransFatDailyPercentage          gensupport.JSONFloat64 `json:"transFatDailyPercentage"`
   910  		VitaminDDailyPercentage          gensupport.JSONFloat64 `json:"vitaminDDailyPercentage"`
   911  		*NoMethod
   912  	}
   913  	s1.NoMethod = (*NoMethod)(s)
   914  	if err := json.Unmarshal(data, &s1); err != nil {
   915  		return err
   916  	}
   917  	s.AddedSugarsDailyPercentage = float64(s1.AddedSugarsDailyPercentage)
   918  	s.CalciumDailyPercentage = float64(s1.CalciumDailyPercentage)
   919  	s.CholesterolDailyPercentage = float64(s1.CholesterolDailyPercentage)
   920  	s.DietaryFiberDailyPercentage = float64(s1.DietaryFiberDailyPercentage)
   921  	s.FolateDailyPercentage = float64(s1.FolateDailyPercentage)
   922  	s.FolateMcgDfe = float64(s1.FolateMcgDfe)
   923  	s.IronDailyPercentage = float64(s1.IronDailyPercentage)
   924  	s.PotassiumDailyPercentage = float64(s1.PotassiumDailyPercentage)
   925  	s.ProteinDailyPercentage = float64(s1.ProteinDailyPercentage)
   926  	s.SaturatedFatDailyPercentage = float64(s1.SaturatedFatDailyPercentage)
   927  	s.SodiumDailyPercentage = float64(s1.SodiumDailyPercentage)
   928  	s.TotalCarbohydrateDailyPercentage = float64(s1.TotalCarbohydrateDailyPercentage)
   929  	s.TotalFatDailyPercentage = float64(s1.TotalFatDailyPercentage)
   930  	s.TotalSugarsDailyPercentage = float64(s1.TotalSugarsDailyPercentage)
   931  	s.TransFatDailyPercentage = float64(s1.TransFatDailyPercentage)
   932  	s.VitaminDDailyPercentage = float64(s1.VitaminDDailyPercentage)
   933  	return nil
   934  }
   935  
   936  // Price: A price.
   937  type Price struct {
   938  	// Amount: The numeric value of the price.
   939  	Amount string `json:"amount,omitempty"`
   940  	// Currency: The currency in which the price is denoted.
   941  	Currency string `json:"currency,omitempty"`
   942  	// ForceSendFields is a list of field names (e.g. "Amount") to unconditionally
   943  	// include in API requests. By default, fields with empty or default values are
   944  	// omitted from API requests. See
   945  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   946  	// details.
   947  	ForceSendFields []string `json:"-"`
   948  	// NullFields is a list of field names (e.g. "Amount") to include in API
   949  	// requests with the JSON null value. By default, fields with empty values are
   950  	// omitted from API requests. See
   951  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   952  	NullFields []string `json:"-"`
   953  }
   954  
   955  func (s *Price) MarshalJSON() ([]byte, error) {
   956  	type NoMethod Price
   957  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   958  }
   959  
   960  // Product: Product data.
   961  type Product struct {
   962  	// Attributes: Attributes of the product uploaded to the Manufacturer Center.
   963  	// Manually edited attributes are taken into account.
   964  	Attributes *Attributes `json:"attributes,omitempty"`
   965  	// ContentLanguage: The content language of the product as a two-letter ISO
   966  	// 639-1 language code (for example, en).
   967  	ContentLanguage string `json:"contentLanguage,omitempty"`
   968  	// DestinationStatuses: The status of the destinations.
   969  	DestinationStatuses []*DestinationStatus `json:"destinationStatuses,omitempty"`
   970  	// Issues: A server-generated list of issues associated with the product.
   971  	Issues []*Issue `json:"issues,omitempty"`
   972  	// Name: Name in the format `{target_country}:{content_language}:{product_id}`.
   973  	// `target_country` - The target country of the product as a CLDR territory
   974  	// code (for example, US). `content_language` - The content language of the
   975  	// product as a two-letter ISO 639-1 language code (for example, en).
   976  	// `product_id` - The ID of the product. For more information, see
   977  	// https://support.google.com/manufacturers/answer/6124116#id.
   978  	Name string `json:"name,omitempty"`
   979  	// Parent: Parent ID in the format `accounts/{account_id}`. `account_id` - The
   980  	// ID of the Manufacturer Center account.
   981  	Parent string `json:"parent,omitempty"`
   982  	// ProductId: The ID of the product. For more information, see
   983  	// https://support.google.com/manufacturers/answer/6124116#id.
   984  	ProductId string `json:"productId,omitempty"`
   985  	// TargetCountry: The target country of the product as a CLDR territory code
   986  	// (for example, US).
   987  	TargetCountry string `json:"targetCountry,omitempty"`
   988  
   989  	// ServerResponse contains the HTTP response code and headers from the server.
   990  	googleapi.ServerResponse `json:"-"`
   991  	// ForceSendFields is a list of field names (e.g. "Attributes") to
   992  	// unconditionally include in API requests. By default, fields with empty or
   993  	// default values are omitted from API requests. See
   994  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   995  	// details.
   996  	ForceSendFields []string `json:"-"`
   997  	// NullFields is a list of field names (e.g. "Attributes") to include in API
   998  	// requests with the JSON null value. By default, fields with empty values are
   999  	// omitted from API requests. See
  1000  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1001  	NullFields []string `json:"-"`
  1002  }
  1003  
  1004  func (s *Product) MarshalJSON() ([]byte, error) {
  1005  	type NoMethod Product
  1006  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1007  }
  1008  
  1009  // ProductCertification: Product certification data.
  1010  type ProductCertification struct {
  1011  	// Brand: Required. This is the product's brand name. The brand is used to help
  1012  	// identify your product.
  1013  	Brand string `json:"brand,omitempty"`
  1014  	// Certification: Required. A list of certifications to link to the described
  1015  	// product.
  1016  	Certification []*Certification `json:"certification,omitempty"`
  1017  	// CountryCode: Optional. A 2-letter country code (ISO 3166-1 Alpha 2).
  1018  	CountryCode []string `json:"countryCode,omitempty"`
  1019  	// DestinationStatuses: Output only. The statuses of the destinations.
  1020  	DestinationStatuses []*DestinationStatus `json:"destinationStatuses,omitempty"`
  1021  	// Issues: Output only. A server-generated list of issues associated with the
  1022  	// product.
  1023  	Issues []*Issue `json:"issues,omitempty"`
  1024  	// Mpn: Optional. These are the Manufacturer Part Numbers (MPN). MPNs are used
  1025  	// to uniquely identify a specific product among all products from the same
  1026  	// manufacturer
  1027  	Mpn []string `json:"mpn,omitempty"`
  1028  	// Name: Required. The unique name identifier of a product certification
  1029  	// Format:
  1030  	// accounts/{account}/languages/{language_code}/productCertifications/{id}
  1031  	// Where `id` is a some unique identifier and `language_code` is a 2-letter ISO
  1032  	// 639-1 code of a Shopping supported language according to
  1033  	// https://support.google.com/merchants/answer/160637.
  1034  	Name string `json:"name,omitempty"`
  1035  	// ProductCode: Optional. Another name for GTIN.
  1036  	ProductCode []string `json:"productCode,omitempty"`
  1037  	// ProductType: Optional. These are your own product categorization system in
  1038  	// your product data.
  1039  	ProductType []string `json:"productType,omitempty"`
  1040  	// Title: Required. This is to clearly identify the product you are certifying.
  1041  	Title string `json:"title,omitempty"`
  1042  
  1043  	// ServerResponse contains the HTTP response code and headers from the server.
  1044  	googleapi.ServerResponse `json:"-"`
  1045  	// ForceSendFields is a list of field names (e.g. "Brand") to unconditionally
  1046  	// include in API requests. By default, fields with empty or default values are
  1047  	// omitted from API requests. See
  1048  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1049  	// details.
  1050  	ForceSendFields []string `json:"-"`
  1051  	// NullFields is a list of field names (e.g. "Brand") to include in API
  1052  	// requests with the JSON null value. By default, fields with empty values are
  1053  	// omitted from API requests. See
  1054  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1055  	NullFields []string `json:"-"`
  1056  }
  1057  
  1058  func (s *ProductCertification) MarshalJSON() ([]byte, error) {
  1059  	type NoMethod ProductCertification
  1060  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1061  }
  1062  
  1063  // ProductDetail: A product detail of the product. For more information, see
  1064  // https://support.google.com/manufacturers/answer/6124116#productdetail.
  1065  type ProductDetail struct {
  1066  	// AttributeName: The name of the attribute.
  1067  	AttributeName string `json:"attributeName,omitempty"`
  1068  	// AttributeValue: The value of the attribute.
  1069  	AttributeValue string `json:"attributeValue,omitempty"`
  1070  	// SectionName: A short section name that can be reused between multiple
  1071  	// product details.
  1072  	SectionName string `json:"sectionName,omitempty"`
  1073  	// ForceSendFields is a list of field names (e.g. "AttributeName") to
  1074  	// unconditionally include in API requests. By default, fields with empty or
  1075  	// default values are omitted from API requests. See
  1076  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1077  	// details.
  1078  	ForceSendFields []string `json:"-"`
  1079  	// NullFields is a list of field names (e.g. "AttributeName") to include in API
  1080  	// requests with the JSON null value. By default, fields with empty values are
  1081  	// omitted from API requests. See
  1082  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1083  	NullFields []string `json:"-"`
  1084  }
  1085  
  1086  func (s *ProductDetail) MarshalJSON() ([]byte, error) {
  1087  	type NoMethod ProductDetail
  1088  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1089  }
  1090  
  1091  // VoluntaryNutritionFact: Voluntary Nutrition Facts.
  1092  type VoluntaryNutritionFact struct {
  1093  	// DailyPercentage: Daily percentage.
  1094  	DailyPercentage float64 `json:"dailyPercentage,omitempty"`
  1095  	// Name: Name.
  1096  	Name string `json:"name,omitempty"`
  1097  	// Value: Value.
  1098  	Value *FloatUnit `json:"value,omitempty"`
  1099  	// ForceSendFields is a list of field names (e.g. "DailyPercentage") to
  1100  	// unconditionally include in API requests. By default, fields with empty or
  1101  	// default values are omitted from API requests. See
  1102  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1103  	// details.
  1104  	ForceSendFields []string `json:"-"`
  1105  	// NullFields is a list of field names (e.g. "DailyPercentage") to include in
  1106  	// API requests with the JSON null value. By default, fields with empty values
  1107  	// are omitted from API requests. See
  1108  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1109  	NullFields []string `json:"-"`
  1110  }
  1111  
  1112  func (s *VoluntaryNutritionFact) MarshalJSON() ([]byte, error) {
  1113  	type NoMethod VoluntaryNutritionFact
  1114  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1115  }
  1116  
  1117  func (s *VoluntaryNutritionFact) UnmarshalJSON(data []byte) error {
  1118  	type NoMethod VoluntaryNutritionFact
  1119  	var s1 struct {
  1120  		DailyPercentage gensupport.JSONFloat64 `json:"dailyPercentage"`
  1121  		*NoMethod
  1122  	}
  1123  	s1.NoMethod = (*NoMethod)(s)
  1124  	if err := json.Unmarshal(data, &s1); err != nil {
  1125  		return err
  1126  	}
  1127  	s.DailyPercentage = float64(s1.DailyPercentage)
  1128  	return nil
  1129  }
  1130  
  1131  type AccountsLanguagesProductCertificationsDeleteCall struct {
  1132  	s          *Service
  1133  	name       string
  1134  	urlParams_ gensupport.URLParams
  1135  	ctx_       context.Context
  1136  	header_    http.Header
  1137  }
  1138  
  1139  // Delete: Deletes a product certification by its name. This method can only be
  1140  // called by certification bodies.
  1141  //
  1142  //   - name: The name of the product certification to delete. Format:
  1143  //     accounts/{account}/languages/{language_code}/productCertifications/{id}.
  1144  func (r *AccountsLanguagesProductCertificationsService) Delete(name string) *AccountsLanguagesProductCertificationsDeleteCall {
  1145  	c := &AccountsLanguagesProductCertificationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1146  	c.name = name
  1147  	return c
  1148  }
  1149  
  1150  // Fields allows partial responses to be retrieved. See
  1151  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1152  // details.
  1153  func (c *AccountsLanguagesProductCertificationsDeleteCall) Fields(s ...googleapi.Field) *AccountsLanguagesProductCertificationsDeleteCall {
  1154  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1155  	return c
  1156  }
  1157  
  1158  // Context sets the context to be used in this call's Do method.
  1159  func (c *AccountsLanguagesProductCertificationsDeleteCall) Context(ctx context.Context) *AccountsLanguagesProductCertificationsDeleteCall {
  1160  	c.ctx_ = ctx
  1161  	return c
  1162  }
  1163  
  1164  // Header returns a http.Header that can be modified by the caller to add
  1165  // headers to the request.
  1166  func (c *AccountsLanguagesProductCertificationsDeleteCall) Header() http.Header {
  1167  	if c.header_ == nil {
  1168  		c.header_ = make(http.Header)
  1169  	}
  1170  	return c.header_
  1171  }
  1172  
  1173  func (c *AccountsLanguagesProductCertificationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1174  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1175  	var body io.Reader = nil
  1176  	c.urlParams_.Set("alt", alt)
  1177  	c.urlParams_.Set("prettyPrint", "false")
  1178  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1179  	urls += "?" + c.urlParams_.Encode()
  1180  	req, err := http.NewRequest("DELETE", urls, body)
  1181  	if err != nil {
  1182  		return nil, err
  1183  	}
  1184  	req.Header = reqHeaders
  1185  	googleapi.Expand(req.URL, map[string]string{
  1186  		"name": c.name,
  1187  	})
  1188  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1189  }
  1190  
  1191  // Do executes the "manufacturers.accounts.languages.productCertifications.delete" call.
  1192  // Any non-2xx status code is an error. Response headers are in either
  1193  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1194  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1195  // whether the returned error was because http.StatusNotModified was returned.
  1196  func (c *AccountsLanguagesProductCertificationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1197  	gensupport.SetOptions(c.urlParams_, opts...)
  1198  	res, err := c.doRequest("json")
  1199  	if res != nil && res.StatusCode == http.StatusNotModified {
  1200  		if res.Body != nil {
  1201  			res.Body.Close()
  1202  		}
  1203  		return nil, gensupport.WrapError(&googleapi.Error{
  1204  			Code:   res.StatusCode,
  1205  			Header: res.Header,
  1206  		})
  1207  	}
  1208  	if err != nil {
  1209  		return nil, err
  1210  	}
  1211  	defer googleapi.CloseBody(res)
  1212  	if err := googleapi.CheckResponse(res); err != nil {
  1213  		return nil, gensupport.WrapError(err)
  1214  	}
  1215  	ret := &Empty{
  1216  		ServerResponse: googleapi.ServerResponse{
  1217  			Header:         res.Header,
  1218  			HTTPStatusCode: res.StatusCode,
  1219  		},
  1220  	}
  1221  	target := &ret
  1222  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1223  		return nil, err
  1224  	}
  1225  	return ret, nil
  1226  }
  1227  
  1228  type AccountsLanguagesProductCertificationsGetCall struct {
  1229  	s            *Service
  1230  	name         string
  1231  	urlParams_   gensupport.URLParams
  1232  	ifNoneMatch_ string
  1233  	ctx_         context.Context
  1234  	header_      http.Header
  1235  }
  1236  
  1237  // Get: Gets a product certification by its name. This method can only be
  1238  // called by certification bodies.
  1239  //
  1240  //   - name: The name of the product certification to get. Format:
  1241  //     accounts/{account}/languages/{language_code}/productCertifications/{id}.
  1242  func (r *AccountsLanguagesProductCertificationsService) Get(name string) *AccountsLanguagesProductCertificationsGetCall {
  1243  	c := &AccountsLanguagesProductCertificationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1244  	c.name = name
  1245  	return c
  1246  }
  1247  
  1248  // Fields allows partial responses to be retrieved. See
  1249  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1250  // details.
  1251  func (c *AccountsLanguagesProductCertificationsGetCall) Fields(s ...googleapi.Field) *AccountsLanguagesProductCertificationsGetCall {
  1252  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1253  	return c
  1254  }
  1255  
  1256  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1257  // object's ETag matches the given value. This is useful for getting updates
  1258  // only after the object has changed since the last request.
  1259  func (c *AccountsLanguagesProductCertificationsGetCall) IfNoneMatch(entityTag string) *AccountsLanguagesProductCertificationsGetCall {
  1260  	c.ifNoneMatch_ = entityTag
  1261  	return c
  1262  }
  1263  
  1264  // Context sets the context to be used in this call's Do method.
  1265  func (c *AccountsLanguagesProductCertificationsGetCall) Context(ctx context.Context) *AccountsLanguagesProductCertificationsGetCall {
  1266  	c.ctx_ = ctx
  1267  	return c
  1268  }
  1269  
  1270  // Header returns a http.Header that can be modified by the caller to add
  1271  // headers to the request.
  1272  func (c *AccountsLanguagesProductCertificationsGetCall) Header() http.Header {
  1273  	if c.header_ == nil {
  1274  		c.header_ = make(http.Header)
  1275  	}
  1276  	return c.header_
  1277  }
  1278  
  1279  func (c *AccountsLanguagesProductCertificationsGetCall) doRequest(alt string) (*http.Response, error) {
  1280  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1281  	if c.ifNoneMatch_ != "" {
  1282  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1283  	}
  1284  	var body io.Reader = nil
  1285  	c.urlParams_.Set("alt", alt)
  1286  	c.urlParams_.Set("prettyPrint", "false")
  1287  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1288  	urls += "?" + c.urlParams_.Encode()
  1289  	req, err := http.NewRequest("GET", urls, body)
  1290  	if err != nil {
  1291  		return nil, err
  1292  	}
  1293  	req.Header = reqHeaders
  1294  	googleapi.Expand(req.URL, map[string]string{
  1295  		"name": c.name,
  1296  	})
  1297  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1298  }
  1299  
  1300  // Do executes the "manufacturers.accounts.languages.productCertifications.get" call.
  1301  // Any non-2xx status code is an error. Response headers are in either
  1302  // *ProductCertification.ServerResponse.Header or (if a response was returned
  1303  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1304  // check whether the returned error was because http.StatusNotModified was
  1305  // returned.
  1306  func (c *AccountsLanguagesProductCertificationsGetCall) Do(opts ...googleapi.CallOption) (*ProductCertification, error) {
  1307  	gensupport.SetOptions(c.urlParams_, opts...)
  1308  	res, err := c.doRequest("json")
  1309  	if res != nil && res.StatusCode == http.StatusNotModified {
  1310  		if res.Body != nil {
  1311  			res.Body.Close()
  1312  		}
  1313  		return nil, gensupport.WrapError(&googleapi.Error{
  1314  			Code:   res.StatusCode,
  1315  			Header: res.Header,
  1316  		})
  1317  	}
  1318  	if err != nil {
  1319  		return nil, err
  1320  	}
  1321  	defer googleapi.CloseBody(res)
  1322  	if err := googleapi.CheckResponse(res); err != nil {
  1323  		return nil, gensupport.WrapError(err)
  1324  	}
  1325  	ret := &ProductCertification{
  1326  		ServerResponse: googleapi.ServerResponse{
  1327  			Header:         res.Header,
  1328  			HTTPStatusCode: res.StatusCode,
  1329  		},
  1330  	}
  1331  	target := &ret
  1332  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1333  		return nil, err
  1334  	}
  1335  	return ret, nil
  1336  }
  1337  
  1338  type AccountsLanguagesProductCertificationsListCall struct {
  1339  	s            *Service
  1340  	parent       string
  1341  	urlParams_   gensupport.URLParams
  1342  	ifNoneMatch_ string
  1343  	ctx_         context.Context
  1344  	header_      http.Header
  1345  }
  1346  
  1347  // List: Lists product certifications from a specified certification body. This
  1348  // method can only be called by certification bodies.
  1349  //
  1350  //   - parent: The parent, which owns this collection of product certifications.
  1351  //     Format: accounts/{account}/languages/{language_code}.
  1352  func (r *AccountsLanguagesProductCertificationsService) List(parent string) *AccountsLanguagesProductCertificationsListCall {
  1353  	c := &AccountsLanguagesProductCertificationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1354  	c.parent = parent
  1355  	return c
  1356  }
  1357  
  1358  // PageSize sets the optional parameter "pageSize": The maximum number of
  1359  // product certifications to return. The service may return fewer than this
  1360  // value. If unspecified, at most 50 product certifications will be returned.
  1361  // The maximum value is 1000; values above 1000 will be coerced to 1000.
  1362  func (c *AccountsLanguagesProductCertificationsListCall) PageSize(pageSize int64) *AccountsLanguagesProductCertificationsListCall {
  1363  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1364  	return c
  1365  }
  1366  
  1367  // PageToken sets the optional parameter "pageToken": A page token, received
  1368  // from a previous `ListProductCertifications` call. Provide this to retrieve
  1369  // the subsequent page. When paginating, all other parameters provided to
  1370  // `ListProductCertifications` must match the call that provided the page
  1371  // token. Required if requesting the second or higher page.
  1372  func (c *AccountsLanguagesProductCertificationsListCall) PageToken(pageToken string) *AccountsLanguagesProductCertificationsListCall {
  1373  	c.urlParams_.Set("pageToken", pageToken)
  1374  	return c
  1375  }
  1376  
  1377  // Fields allows partial responses to be retrieved. See
  1378  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1379  // details.
  1380  func (c *AccountsLanguagesProductCertificationsListCall) Fields(s ...googleapi.Field) *AccountsLanguagesProductCertificationsListCall {
  1381  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1382  	return c
  1383  }
  1384  
  1385  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1386  // object's ETag matches the given value. This is useful for getting updates
  1387  // only after the object has changed since the last request.
  1388  func (c *AccountsLanguagesProductCertificationsListCall) IfNoneMatch(entityTag string) *AccountsLanguagesProductCertificationsListCall {
  1389  	c.ifNoneMatch_ = entityTag
  1390  	return c
  1391  }
  1392  
  1393  // Context sets the context to be used in this call's Do method.
  1394  func (c *AccountsLanguagesProductCertificationsListCall) Context(ctx context.Context) *AccountsLanguagesProductCertificationsListCall {
  1395  	c.ctx_ = ctx
  1396  	return c
  1397  }
  1398  
  1399  // Header returns a http.Header that can be modified by the caller to add
  1400  // headers to the request.
  1401  func (c *AccountsLanguagesProductCertificationsListCall) Header() http.Header {
  1402  	if c.header_ == nil {
  1403  		c.header_ = make(http.Header)
  1404  	}
  1405  	return c.header_
  1406  }
  1407  
  1408  func (c *AccountsLanguagesProductCertificationsListCall) doRequest(alt string) (*http.Response, error) {
  1409  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1410  	if c.ifNoneMatch_ != "" {
  1411  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1412  	}
  1413  	var body io.Reader = nil
  1414  	c.urlParams_.Set("alt", alt)
  1415  	c.urlParams_.Set("prettyPrint", "false")
  1416  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/productCertifications")
  1417  	urls += "?" + c.urlParams_.Encode()
  1418  	req, err := http.NewRequest("GET", urls, body)
  1419  	if err != nil {
  1420  		return nil, err
  1421  	}
  1422  	req.Header = reqHeaders
  1423  	googleapi.Expand(req.URL, map[string]string{
  1424  		"parent": c.parent,
  1425  	})
  1426  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1427  }
  1428  
  1429  // Do executes the "manufacturers.accounts.languages.productCertifications.list" call.
  1430  // Any non-2xx status code is an error. Response headers are in either
  1431  // *ListProductCertificationsResponse.ServerResponse.Header or (if a response
  1432  // was returned at all) in error.(*googleapi.Error).Header. Use
  1433  // googleapi.IsNotModified to check whether the returned error was because
  1434  // http.StatusNotModified was returned.
  1435  func (c *AccountsLanguagesProductCertificationsListCall) Do(opts ...googleapi.CallOption) (*ListProductCertificationsResponse, error) {
  1436  	gensupport.SetOptions(c.urlParams_, opts...)
  1437  	res, err := c.doRequest("json")
  1438  	if res != nil && res.StatusCode == http.StatusNotModified {
  1439  		if res.Body != nil {
  1440  			res.Body.Close()
  1441  		}
  1442  		return nil, gensupport.WrapError(&googleapi.Error{
  1443  			Code:   res.StatusCode,
  1444  			Header: res.Header,
  1445  		})
  1446  	}
  1447  	if err != nil {
  1448  		return nil, err
  1449  	}
  1450  	defer googleapi.CloseBody(res)
  1451  	if err := googleapi.CheckResponse(res); err != nil {
  1452  		return nil, gensupport.WrapError(err)
  1453  	}
  1454  	ret := &ListProductCertificationsResponse{
  1455  		ServerResponse: googleapi.ServerResponse{
  1456  			Header:         res.Header,
  1457  			HTTPStatusCode: res.StatusCode,
  1458  		},
  1459  	}
  1460  	target := &ret
  1461  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1462  		return nil, err
  1463  	}
  1464  	return ret, nil
  1465  }
  1466  
  1467  // Pages invokes f for each page of results.
  1468  // A non-nil error returned from f will halt the iteration.
  1469  // The provided context supersedes any context provided to the Context method.
  1470  func (c *AccountsLanguagesProductCertificationsListCall) Pages(ctx context.Context, f func(*ListProductCertificationsResponse) error) error {
  1471  	c.ctx_ = ctx
  1472  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1473  	for {
  1474  		x, err := c.Do()
  1475  		if err != nil {
  1476  			return err
  1477  		}
  1478  		if err := f(x); err != nil {
  1479  			return err
  1480  		}
  1481  		if x.NextPageToken == "" {
  1482  			return nil
  1483  		}
  1484  		c.PageToken(x.NextPageToken)
  1485  	}
  1486  }
  1487  
  1488  type AccountsLanguagesProductCertificationsPatchCall struct {
  1489  	s                    *Service
  1490  	nameid               string
  1491  	productcertification *ProductCertification
  1492  	urlParams_           gensupport.URLParams
  1493  	ctx_                 context.Context
  1494  	header_              http.Header
  1495  }
  1496  
  1497  // Patch: Updates (or creates if allow_missing = true) a product certification
  1498  // which links certifications with products. This method can only be called by
  1499  // certification bodies.
  1500  //
  1501  //   - name: The unique name identifier of a product certification Format:
  1502  //     accounts/{account}/languages/{language_code}/productCertifications/{id}
  1503  //     Where `id` is a some unique identifier and `language_code` is a 2-letter
  1504  //     ISO 639-1 code of a Shopping supported language according to
  1505  //     https://support.google.com/merchants/answer/160637.
  1506  func (r *AccountsLanguagesProductCertificationsService) Patch(nameid string, productcertification *ProductCertification) *AccountsLanguagesProductCertificationsPatchCall {
  1507  	c := &AccountsLanguagesProductCertificationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1508  	c.nameid = nameid
  1509  	c.productcertification = productcertification
  1510  	return c
  1511  }
  1512  
  1513  // UpdateMask sets the optional parameter "updateMask": The list of fields to
  1514  // update according to aip.dev/134. However, only full update is supported as
  1515  // of right now. Therefore, it can be either ignored or set to "*". Setting any
  1516  // other values will returns UNIMPLEMENTED error.
  1517  func (c *AccountsLanguagesProductCertificationsPatchCall) UpdateMask(updateMask string) *AccountsLanguagesProductCertificationsPatchCall {
  1518  	c.urlParams_.Set("updateMask", updateMask)
  1519  	return c
  1520  }
  1521  
  1522  // Fields allows partial responses to be retrieved. See
  1523  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1524  // details.
  1525  func (c *AccountsLanguagesProductCertificationsPatchCall) Fields(s ...googleapi.Field) *AccountsLanguagesProductCertificationsPatchCall {
  1526  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1527  	return c
  1528  }
  1529  
  1530  // Context sets the context to be used in this call's Do method.
  1531  func (c *AccountsLanguagesProductCertificationsPatchCall) Context(ctx context.Context) *AccountsLanguagesProductCertificationsPatchCall {
  1532  	c.ctx_ = ctx
  1533  	return c
  1534  }
  1535  
  1536  // Header returns a http.Header that can be modified by the caller to add
  1537  // headers to the request.
  1538  func (c *AccountsLanguagesProductCertificationsPatchCall) Header() http.Header {
  1539  	if c.header_ == nil {
  1540  		c.header_ = make(http.Header)
  1541  	}
  1542  	return c.header_
  1543  }
  1544  
  1545  func (c *AccountsLanguagesProductCertificationsPatchCall) doRequest(alt string) (*http.Response, error) {
  1546  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1547  	var body io.Reader = nil
  1548  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.productcertification)
  1549  	if err != nil {
  1550  		return nil, err
  1551  	}
  1552  	c.urlParams_.Set("alt", alt)
  1553  	c.urlParams_.Set("prettyPrint", "false")
  1554  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1555  	urls += "?" + c.urlParams_.Encode()
  1556  	req, err := http.NewRequest("PATCH", urls, body)
  1557  	if err != nil {
  1558  		return nil, err
  1559  	}
  1560  	req.Header = reqHeaders
  1561  	googleapi.Expand(req.URL, map[string]string{
  1562  		"name": c.nameid,
  1563  	})
  1564  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1565  }
  1566  
  1567  // Do executes the "manufacturers.accounts.languages.productCertifications.patch" call.
  1568  // Any non-2xx status code is an error. Response headers are in either
  1569  // *ProductCertification.ServerResponse.Header or (if a response was returned
  1570  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1571  // check whether the returned error was because http.StatusNotModified was
  1572  // returned.
  1573  func (c *AccountsLanguagesProductCertificationsPatchCall) Do(opts ...googleapi.CallOption) (*ProductCertification, error) {
  1574  	gensupport.SetOptions(c.urlParams_, opts...)
  1575  	res, err := c.doRequest("json")
  1576  	if res != nil && res.StatusCode == http.StatusNotModified {
  1577  		if res.Body != nil {
  1578  			res.Body.Close()
  1579  		}
  1580  		return nil, gensupport.WrapError(&googleapi.Error{
  1581  			Code:   res.StatusCode,
  1582  			Header: res.Header,
  1583  		})
  1584  	}
  1585  	if err != nil {
  1586  		return nil, err
  1587  	}
  1588  	defer googleapi.CloseBody(res)
  1589  	if err := googleapi.CheckResponse(res); err != nil {
  1590  		return nil, gensupport.WrapError(err)
  1591  	}
  1592  	ret := &ProductCertification{
  1593  		ServerResponse: googleapi.ServerResponse{
  1594  			Header:         res.Header,
  1595  			HTTPStatusCode: res.StatusCode,
  1596  		},
  1597  	}
  1598  	target := &ret
  1599  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1600  		return nil, err
  1601  	}
  1602  	return ret, nil
  1603  }
  1604  
  1605  type AccountsProductsDeleteCall struct {
  1606  	s          *Service
  1607  	parent     string
  1608  	name       string
  1609  	urlParams_ gensupport.URLParams
  1610  	ctx_       context.Context
  1611  	header_    http.Header
  1612  }
  1613  
  1614  // Delete: Deletes the product from a Manufacturer Center account.
  1615  //
  1616  //   - name: Name in the format
  1617  //     `{target_country}:{content_language}:{product_id}`. `target_country` - The
  1618  //     target country of the product as a CLDR territory code (for example, US).
  1619  //     `content_language` - The content language of the product as a two-letter
  1620  //     ISO 639-1 language code (for example, en). `product_id` - The ID of the
  1621  //     product. For more information, see
  1622  //     https://support.google.com/manufacturers/answer/6124116#id.
  1623  //   - parent: Parent ID in the format `accounts/{account_id}`. `account_id` -
  1624  //     The ID of the Manufacturer Center account.
  1625  func (r *AccountsProductsService) Delete(parent string, name string) *AccountsProductsDeleteCall {
  1626  	c := &AccountsProductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1627  	c.parent = parent
  1628  	c.name = name
  1629  	return c
  1630  }
  1631  
  1632  // Fields allows partial responses to be retrieved. See
  1633  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1634  // details.
  1635  func (c *AccountsProductsDeleteCall) Fields(s ...googleapi.Field) *AccountsProductsDeleteCall {
  1636  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1637  	return c
  1638  }
  1639  
  1640  // Context sets the context to be used in this call's Do method.
  1641  func (c *AccountsProductsDeleteCall) Context(ctx context.Context) *AccountsProductsDeleteCall {
  1642  	c.ctx_ = ctx
  1643  	return c
  1644  }
  1645  
  1646  // Header returns a http.Header that can be modified by the caller to add
  1647  // headers to the request.
  1648  func (c *AccountsProductsDeleteCall) Header() http.Header {
  1649  	if c.header_ == nil {
  1650  		c.header_ = make(http.Header)
  1651  	}
  1652  	return c.header_
  1653  }
  1654  
  1655  func (c *AccountsProductsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1656  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1657  	var body io.Reader = nil
  1658  	c.urlParams_.Set("alt", alt)
  1659  	c.urlParams_.Set("prettyPrint", "false")
  1660  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products/{+name}")
  1661  	urls += "?" + c.urlParams_.Encode()
  1662  	req, err := http.NewRequest("DELETE", urls, body)
  1663  	if err != nil {
  1664  		return nil, err
  1665  	}
  1666  	req.Header = reqHeaders
  1667  	googleapi.Expand(req.URL, map[string]string{
  1668  		"parent": c.parent,
  1669  		"name":   c.name,
  1670  	})
  1671  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1672  }
  1673  
  1674  // Do executes the "manufacturers.accounts.products.delete" call.
  1675  // Any non-2xx status code is an error. Response headers are in either
  1676  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1677  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1678  // whether the returned error was because http.StatusNotModified was returned.
  1679  func (c *AccountsProductsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1680  	gensupport.SetOptions(c.urlParams_, opts...)
  1681  	res, err := c.doRequest("json")
  1682  	if res != nil && res.StatusCode == http.StatusNotModified {
  1683  		if res.Body != nil {
  1684  			res.Body.Close()
  1685  		}
  1686  		return nil, gensupport.WrapError(&googleapi.Error{
  1687  			Code:   res.StatusCode,
  1688  			Header: res.Header,
  1689  		})
  1690  	}
  1691  	if err != nil {
  1692  		return nil, err
  1693  	}
  1694  	defer googleapi.CloseBody(res)
  1695  	if err := googleapi.CheckResponse(res); err != nil {
  1696  		return nil, gensupport.WrapError(err)
  1697  	}
  1698  	ret := &Empty{
  1699  		ServerResponse: googleapi.ServerResponse{
  1700  			Header:         res.Header,
  1701  			HTTPStatusCode: res.StatusCode,
  1702  		},
  1703  	}
  1704  	target := &ret
  1705  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1706  		return nil, err
  1707  	}
  1708  	return ret, nil
  1709  }
  1710  
  1711  type AccountsProductsGetCall struct {
  1712  	s            *Service
  1713  	parent       string
  1714  	name         string
  1715  	urlParams_   gensupport.URLParams
  1716  	ifNoneMatch_ string
  1717  	ctx_         context.Context
  1718  	header_      http.Header
  1719  }
  1720  
  1721  // Get: Gets the product from a Manufacturer Center account, including product
  1722  // issues. A recently updated product takes around 15 minutes to process.
  1723  // Changes are only visible after it has been processed. While some issues may
  1724  // be available once the product has been processed, other issues may take days
  1725  // to appear.
  1726  //
  1727  //   - name: Name in the format
  1728  //     `{target_country}:{content_language}:{product_id}`. `target_country` - The
  1729  //     target country of the product as a CLDR territory code (for example, US).
  1730  //     `content_language` - The content language of the product as a two-letter
  1731  //     ISO 639-1 language code (for example, en). `product_id` - The ID of the
  1732  //     product. For more information, see
  1733  //     https://support.google.com/manufacturers/answer/6124116#id.
  1734  //   - parent: Parent ID in the format `accounts/{account_id}`. `account_id` -
  1735  //     The ID of the Manufacturer Center account.
  1736  func (r *AccountsProductsService) Get(parent string, name string) *AccountsProductsGetCall {
  1737  	c := &AccountsProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1738  	c.parent = parent
  1739  	c.name = name
  1740  	return c
  1741  }
  1742  
  1743  // Include sets the optional parameter "include": The information to be
  1744  // included in the response. Only sections listed here will be returned.
  1745  //
  1746  // Possible values:
  1747  //
  1748  //	"UNKNOWN" - Unknown, never used.
  1749  //	"ATTRIBUTES" - Include the attributes of the product.
  1750  //	"ISSUES" - Include the issues of the product.
  1751  //	"DESTINATION_STATUSES" - Include the destination statuses of the product.
  1752  func (c *AccountsProductsGetCall) Include(include ...string) *AccountsProductsGetCall {
  1753  	c.urlParams_.SetMulti("include", append([]string{}, include...))
  1754  	return c
  1755  }
  1756  
  1757  // Fields allows partial responses to be retrieved. See
  1758  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1759  // details.
  1760  func (c *AccountsProductsGetCall) Fields(s ...googleapi.Field) *AccountsProductsGetCall {
  1761  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1762  	return c
  1763  }
  1764  
  1765  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1766  // object's ETag matches the given value. This is useful for getting updates
  1767  // only after the object has changed since the last request.
  1768  func (c *AccountsProductsGetCall) IfNoneMatch(entityTag string) *AccountsProductsGetCall {
  1769  	c.ifNoneMatch_ = entityTag
  1770  	return c
  1771  }
  1772  
  1773  // Context sets the context to be used in this call's Do method.
  1774  func (c *AccountsProductsGetCall) Context(ctx context.Context) *AccountsProductsGetCall {
  1775  	c.ctx_ = ctx
  1776  	return c
  1777  }
  1778  
  1779  // Header returns a http.Header that can be modified by the caller to add
  1780  // headers to the request.
  1781  func (c *AccountsProductsGetCall) Header() http.Header {
  1782  	if c.header_ == nil {
  1783  		c.header_ = make(http.Header)
  1784  	}
  1785  	return c.header_
  1786  }
  1787  
  1788  func (c *AccountsProductsGetCall) doRequest(alt string) (*http.Response, error) {
  1789  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1790  	if c.ifNoneMatch_ != "" {
  1791  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1792  	}
  1793  	var body io.Reader = nil
  1794  	c.urlParams_.Set("alt", alt)
  1795  	c.urlParams_.Set("prettyPrint", "false")
  1796  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products/{+name}")
  1797  	urls += "?" + c.urlParams_.Encode()
  1798  	req, err := http.NewRequest("GET", urls, body)
  1799  	if err != nil {
  1800  		return nil, err
  1801  	}
  1802  	req.Header = reqHeaders
  1803  	googleapi.Expand(req.URL, map[string]string{
  1804  		"parent": c.parent,
  1805  		"name":   c.name,
  1806  	})
  1807  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1808  }
  1809  
  1810  // Do executes the "manufacturers.accounts.products.get" call.
  1811  // Any non-2xx status code is an error. Response headers are in either
  1812  // *Product.ServerResponse.Header or (if a response was returned at all) in
  1813  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1814  // whether the returned error was because http.StatusNotModified was returned.
  1815  func (c *AccountsProductsGetCall) Do(opts ...googleapi.CallOption) (*Product, error) {
  1816  	gensupport.SetOptions(c.urlParams_, opts...)
  1817  	res, err := c.doRequest("json")
  1818  	if res != nil && res.StatusCode == http.StatusNotModified {
  1819  		if res.Body != nil {
  1820  			res.Body.Close()
  1821  		}
  1822  		return nil, gensupport.WrapError(&googleapi.Error{
  1823  			Code:   res.StatusCode,
  1824  			Header: res.Header,
  1825  		})
  1826  	}
  1827  	if err != nil {
  1828  		return nil, err
  1829  	}
  1830  	defer googleapi.CloseBody(res)
  1831  	if err := googleapi.CheckResponse(res); err != nil {
  1832  		return nil, gensupport.WrapError(err)
  1833  	}
  1834  	ret := &Product{
  1835  		ServerResponse: googleapi.ServerResponse{
  1836  			Header:         res.Header,
  1837  			HTTPStatusCode: res.StatusCode,
  1838  		},
  1839  	}
  1840  	target := &ret
  1841  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1842  		return nil, err
  1843  	}
  1844  	return ret, nil
  1845  }
  1846  
  1847  type AccountsProductsListCall struct {
  1848  	s            *Service
  1849  	parent       string
  1850  	urlParams_   gensupport.URLParams
  1851  	ifNoneMatch_ string
  1852  	ctx_         context.Context
  1853  	header_      http.Header
  1854  }
  1855  
  1856  // List: Lists all the products in a Manufacturer Center account.
  1857  //
  1858  //   - parent: Parent ID in the format `accounts/{account_id}`. `account_id` -
  1859  //     The ID of the Manufacturer Center account.
  1860  func (r *AccountsProductsService) List(parent string) *AccountsProductsListCall {
  1861  	c := &AccountsProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1862  	c.parent = parent
  1863  	return c
  1864  }
  1865  
  1866  // Include sets the optional parameter "include": The information to be
  1867  // included in the response. Only sections listed here will be returned.
  1868  //
  1869  // Possible values:
  1870  //
  1871  //	"UNKNOWN" - Unknown, never used.
  1872  //	"ATTRIBUTES" - Include the attributes of the product.
  1873  //	"ISSUES" - Include the issues of the product.
  1874  //	"DESTINATION_STATUSES" - Include the destination statuses of the product.
  1875  func (c *AccountsProductsListCall) Include(include ...string) *AccountsProductsListCall {
  1876  	c.urlParams_.SetMulti("include", append([]string{}, include...))
  1877  	return c
  1878  }
  1879  
  1880  // PageSize sets the optional parameter "pageSize": Maximum number of product
  1881  // statuses to return in the response, used for paging.
  1882  func (c *AccountsProductsListCall) PageSize(pageSize int64) *AccountsProductsListCall {
  1883  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1884  	return c
  1885  }
  1886  
  1887  // PageToken sets the optional parameter "pageToken": The token returned by the
  1888  // previous request.
  1889  func (c *AccountsProductsListCall) PageToken(pageToken string) *AccountsProductsListCall {
  1890  	c.urlParams_.Set("pageToken", pageToken)
  1891  	return c
  1892  }
  1893  
  1894  // Fields allows partial responses to be retrieved. See
  1895  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1896  // details.
  1897  func (c *AccountsProductsListCall) Fields(s ...googleapi.Field) *AccountsProductsListCall {
  1898  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1899  	return c
  1900  }
  1901  
  1902  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1903  // object's ETag matches the given value. This is useful for getting updates
  1904  // only after the object has changed since the last request.
  1905  func (c *AccountsProductsListCall) IfNoneMatch(entityTag string) *AccountsProductsListCall {
  1906  	c.ifNoneMatch_ = entityTag
  1907  	return c
  1908  }
  1909  
  1910  // Context sets the context to be used in this call's Do method.
  1911  func (c *AccountsProductsListCall) Context(ctx context.Context) *AccountsProductsListCall {
  1912  	c.ctx_ = ctx
  1913  	return c
  1914  }
  1915  
  1916  // Header returns a http.Header that can be modified by the caller to add
  1917  // headers to the request.
  1918  func (c *AccountsProductsListCall) Header() http.Header {
  1919  	if c.header_ == nil {
  1920  		c.header_ = make(http.Header)
  1921  	}
  1922  	return c.header_
  1923  }
  1924  
  1925  func (c *AccountsProductsListCall) doRequest(alt string) (*http.Response, error) {
  1926  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1927  	if c.ifNoneMatch_ != "" {
  1928  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1929  	}
  1930  	var body io.Reader = nil
  1931  	c.urlParams_.Set("alt", alt)
  1932  	c.urlParams_.Set("prettyPrint", "false")
  1933  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products")
  1934  	urls += "?" + c.urlParams_.Encode()
  1935  	req, err := http.NewRequest("GET", urls, body)
  1936  	if err != nil {
  1937  		return nil, err
  1938  	}
  1939  	req.Header = reqHeaders
  1940  	googleapi.Expand(req.URL, map[string]string{
  1941  		"parent": c.parent,
  1942  	})
  1943  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1944  }
  1945  
  1946  // Do executes the "manufacturers.accounts.products.list" call.
  1947  // Any non-2xx status code is an error. Response headers are in either
  1948  // *ListProductsResponse.ServerResponse.Header or (if a response was returned
  1949  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1950  // check whether the returned error was because http.StatusNotModified was
  1951  // returned.
  1952  func (c *AccountsProductsListCall) Do(opts ...googleapi.CallOption) (*ListProductsResponse, error) {
  1953  	gensupport.SetOptions(c.urlParams_, opts...)
  1954  	res, err := c.doRequest("json")
  1955  	if res != nil && res.StatusCode == http.StatusNotModified {
  1956  		if res.Body != nil {
  1957  			res.Body.Close()
  1958  		}
  1959  		return nil, gensupport.WrapError(&googleapi.Error{
  1960  			Code:   res.StatusCode,
  1961  			Header: res.Header,
  1962  		})
  1963  	}
  1964  	if err != nil {
  1965  		return nil, err
  1966  	}
  1967  	defer googleapi.CloseBody(res)
  1968  	if err := googleapi.CheckResponse(res); err != nil {
  1969  		return nil, gensupport.WrapError(err)
  1970  	}
  1971  	ret := &ListProductsResponse{
  1972  		ServerResponse: googleapi.ServerResponse{
  1973  			Header:         res.Header,
  1974  			HTTPStatusCode: res.StatusCode,
  1975  		},
  1976  	}
  1977  	target := &ret
  1978  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1979  		return nil, err
  1980  	}
  1981  	return ret, nil
  1982  }
  1983  
  1984  // Pages invokes f for each page of results.
  1985  // A non-nil error returned from f will halt the iteration.
  1986  // The provided context supersedes any context provided to the Context method.
  1987  func (c *AccountsProductsListCall) Pages(ctx context.Context, f func(*ListProductsResponse) error) error {
  1988  	c.ctx_ = ctx
  1989  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1990  	for {
  1991  		x, err := c.Do()
  1992  		if err != nil {
  1993  			return err
  1994  		}
  1995  		if err := f(x); err != nil {
  1996  			return err
  1997  		}
  1998  		if x.NextPageToken == "" {
  1999  			return nil
  2000  		}
  2001  		c.PageToken(x.NextPageToken)
  2002  	}
  2003  }
  2004  
  2005  type AccountsProductsUpdateCall struct {
  2006  	s          *Service
  2007  	parent     string
  2008  	name       string
  2009  	attributes *Attributes
  2010  	urlParams_ gensupport.URLParams
  2011  	ctx_       context.Context
  2012  	header_    http.Header
  2013  }
  2014  
  2015  // Update: Inserts or updates the attributes of the product in a Manufacturer
  2016  // Center account. Creates a product with the provided attributes. If the
  2017  // product already exists, then all attributes are replaced with the new ones.
  2018  // The checks at upload time are minimal. All required attributes need to be
  2019  // present for a product to be valid. Issues may show up later after the API
  2020  // has accepted a new upload for a product and it is possible to overwrite an
  2021  // existing valid product with an invalid product. To detect this, you should
  2022  // retrieve the product and check it for issues once the new version is
  2023  // available. Uploaded attributes first need to be processed before they can be
  2024  // retrieved. Until then, new products will be unavailable, and retrieval of
  2025  // previously uploaded products will return the original state of the product.
  2026  //
  2027  //   - name: Name in the format
  2028  //     `{target_country}:{content_language}:{product_id}`. `target_country` - The
  2029  //     target country of the product as a CLDR territory code (for example, US).
  2030  //     `content_language` - The content language of the product as a two-letter
  2031  //     ISO 639-1 language code (for example, en). `product_id` - The ID of the
  2032  //     product. For more information, see
  2033  //     https://support.google.com/manufacturers/answer/6124116#id.
  2034  //   - parent: Parent ID in the format `accounts/{account_id}`. `account_id` -
  2035  //     The ID of the Manufacturer Center account.
  2036  func (r *AccountsProductsService) Update(parent string, name string, attributes *Attributes) *AccountsProductsUpdateCall {
  2037  	c := &AccountsProductsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2038  	c.parent = parent
  2039  	c.name = name
  2040  	c.attributes = attributes
  2041  	return c
  2042  }
  2043  
  2044  // Fields allows partial responses to be retrieved. See
  2045  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2046  // details.
  2047  func (c *AccountsProductsUpdateCall) Fields(s ...googleapi.Field) *AccountsProductsUpdateCall {
  2048  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2049  	return c
  2050  }
  2051  
  2052  // Context sets the context to be used in this call's Do method.
  2053  func (c *AccountsProductsUpdateCall) Context(ctx context.Context) *AccountsProductsUpdateCall {
  2054  	c.ctx_ = ctx
  2055  	return c
  2056  }
  2057  
  2058  // Header returns a http.Header that can be modified by the caller to add
  2059  // headers to the request.
  2060  func (c *AccountsProductsUpdateCall) Header() http.Header {
  2061  	if c.header_ == nil {
  2062  		c.header_ = make(http.Header)
  2063  	}
  2064  	return c.header_
  2065  }
  2066  
  2067  func (c *AccountsProductsUpdateCall) doRequest(alt string) (*http.Response, error) {
  2068  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2069  	var body io.Reader = nil
  2070  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.attributes)
  2071  	if err != nil {
  2072  		return nil, err
  2073  	}
  2074  	c.urlParams_.Set("alt", alt)
  2075  	c.urlParams_.Set("prettyPrint", "false")
  2076  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products/{+name}")
  2077  	urls += "?" + c.urlParams_.Encode()
  2078  	req, err := http.NewRequest("PUT", urls, body)
  2079  	if err != nil {
  2080  		return nil, err
  2081  	}
  2082  	req.Header = reqHeaders
  2083  	googleapi.Expand(req.URL, map[string]string{
  2084  		"parent": c.parent,
  2085  		"name":   c.name,
  2086  	})
  2087  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2088  }
  2089  
  2090  // Do executes the "manufacturers.accounts.products.update" call.
  2091  // Any non-2xx status code is an error. Response headers are in either
  2092  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  2093  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2094  // whether the returned error was because http.StatusNotModified was returned.
  2095  func (c *AccountsProductsUpdateCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2096  	gensupport.SetOptions(c.urlParams_, opts...)
  2097  	res, err := c.doRequest("json")
  2098  	if res != nil && res.StatusCode == http.StatusNotModified {
  2099  		if res.Body != nil {
  2100  			res.Body.Close()
  2101  		}
  2102  		return nil, gensupport.WrapError(&googleapi.Error{
  2103  			Code:   res.StatusCode,
  2104  			Header: res.Header,
  2105  		})
  2106  	}
  2107  	if err != nil {
  2108  		return nil, err
  2109  	}
  2110  	defer googleapi.CloseBody(res)
  2111  	if err := googleapi.CheckResponse(res); err != nil {
  2112  		return nil, gensupport.WrapError(err)
  2113  	}
  2114  	ret := &Empty{
  2115  		ServerResponse: googleapi.ServerResponse{
  2116  			Header:         res.Header,
  2117  			HTTPStatusCode: res.StatusCode,
  2118  		},
  2119  	}
  2120  	target := &ret
  2121  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2122  		return nil, err
  2123  	}
  2124  	return ret, nil
  2125  }
  2126  

View as plain text