// Copyright 2026 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Code generated file. DO NOT EDIT.

// Package cloudproductregistry provides access to the Cloud Product Registry API.
//
// For product documentation, see: https://docs.cloud.google.com/product-registry
//
// # Library status
//
// These client libraries are officially supported by Google. However, this
// library is considered complete and is in maintenance mode. This means
// that we will address critical bugs and security issues but will not add
// any new features.
//
// When possible, we recommend using our newer
// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
// that are still actively being worked and iterated on.
//
// # Creating a client
//
// Usage example:
//
//	import "google.golang.org/api/cloudproductregistry/v1"
//	...
//	ctx := context.Background()
//	cloudproductregistryService, err := cloudproductregistry.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for
// authentication. For information on how to create and obtain Application
// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// # Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API
// keys), use [google.golang.org/api/option.WithAPIKey]:
//
//	cloudproductregistryService, err := cloudproductregistry.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
// flow, use [google.golang.org/api/option.WithTokenSource]:
//
//	config := &oauth2.Config{...}
//	// ...
//	token, err := config.Exchange(ctx, ...)
//	cloudproductregistryService, err := cloudproductregistry.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See [google.golang.org/api/option.ClientOption] for details on options.
package cloudproductregistry // import "google.golang.org/api/cloudproductregistry/v1"

import (
	"bytes"
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"log/slog"
	"net/http"
	"net/url"
	"strconv"
	"strings"

	"github.com/googleapis/gax-go/v2/internallog"
	googleapi "google.golang.org/api/googleapi"
	internal "google.golang.org/api/internal"
	gensupport "google.golang.org/api/internal/gensupport"
	option "google.golang.org/api/option"
	internaloption "google.golang.org/api/option/internaloption"
	htransport "google.golang.org/api/transport/http"
)

// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = internaloption.WithDefaultEndpoint
var _ = internal.Version
var _ = internallog.New

const apiId = "cloudproductregistry:v1"
const apiName = "cloudproductregistry"
const apiVersion = "v1"
const basePath = "https://cloudproductregistry.googleapis.com/"
const basePathTemplate = "https://cloudproductregistry.UNIVERSE_DOMAIN/"
const mtlsBasePath = "https://cloudproductregistry.mtls.googleapis.com/"

// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
	opts = append(opts, internaloption.EnableNewAuthLibrary())
	client, endpoint, err := htransport.NewClient(ctx, opts...)
	if err != nil {
		return nil, err
	}
	s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)}
	s.LogicalProducts = NewLogicalProductsService(s)
	s.ProductSuites = NewProductSuitesService(s)
	if endpoint != "" {
		s.BasePath = endpoint
	}
	return s, nil
}

// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
	if client == nil {
		return nil, errors.New("client is nil")
	}
	return NewService(context.TODO(), option.WithHTTPClient(client))
}

type Service struct {
	client    *http.Client
	logger    *slog.Logger
	BasePath  string // API endpoint base URL
	UserAgent string // optional additional User-Agent fragment

	LogicalProducts *LogicalProductsService

	ProductSuites *ProductSuitesService
}

func (s *Service) userAgent() string {
	if s.UserAgent == "" {
		return googleapi.UserAgent
	}
	return googleapi.UserAgent + " " + s.UserAgent
}

func NewLogicalProductsService(s *Service) *LogicalProductsService {
	rs := &LogicalProductsService{s: s}
	rs.Variants = NewLogicalProductsVariantsService(s)
	return rs
}

type LogicalProductsService struct {
	s *Service

	Variants *LogicalProductsVariantsService
}

func NewLogicalProductsVariantsService(s *Service) *LogicalProductsVariantsService {
	rs := &LogicalProductsVariantsService{s: s}
	return rs
}

type LogicalProductsVariantsService struct {
	s *Service
}

func NewProductSuitesService(s *Service) *ProductSuitesService {
	rs := &ProductSuitesService{s: s}
	return rs
}

type ProductSuitesService struct {
	s *Service
}

// ListLogicalProductVariantsResponse: Response message for
// ListLogicalProductVariants.
type ListLogicalProductVariantsResponse struct {
	// LogicalProductVariants: Matched LogicalProductVariants
	LogicalProductVariants []*LogicalProductVariant `json:"logicalProductVariants,omitempty"`
	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
	// next page. If this field is omitted, there are no subsequent pages.
	NextPageToken string `json:"nextPageToken,omitempty"`

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

func (s ListLogicalProductVariantsResponse) MarshalJSON() ([]byte, error) {
	type NoMethod ListLogicalProductVariantsResponse
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// ListLogicalProductsResponse: Response message for ListLogicalProducts.
type ListLogicalProductsResponse struct {
	// LogicalProducts: Matched LogicalProducts
	LogicalProducts []*LogicalProduct `json:"logicalProducts,omitempty"`
	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
	// next page. If this field is omitted, there are no subsequent pages.
	NextPageToken string `json:"nextPageToken,omitempty"`

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

func (s ListLogicalProductsResponse) MarshalJSON() ([]byte, error) {
	type NoMethod ListLogicalProductsResponse
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// ListProductSuitesResponse: Response message for ListProductSuites.
type ListProductSuitesResponse struct {
	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
	// next page. If this field is omitted, there are no subsequent pages.
	NextPageToken string `json:"nextPageToken,omitempty"`
	// ProductSuites: Matched ProductSuites
	ProductSuites []*ProductSuite `json:"productSuites,omitempty"`

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

func (s ListProductSuitesResponse) MarshalJSON() ([]byte, error) {
	type NoMethod ListProductSuitesResponse
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// LogicalProduct: Represents an independent service offering that can be
// provisioned by a customer.
type LogicalProduct struct {
	// LifecycleState: Output only. Current Lifecycle state of the logical product.
	//
	// Possible values:
	//   "LIFECYCLE_STATE_UNSPECIFIED" - The default value. This value is used if
	// the lifecycle state is not set.
	//   "LIFECYCLE_STATE_PUBLIC_PREVIEW" - The entity is in Public Preview. It is
	// available to all customers, but may not be feature-complete or have full
	// support guarantees.
	//   "LIFECYCLE_STATE_PRIVATE_GA" - The entity is in Private General
	// Availability. It is fully supported and stable, but only available to a
	// select group of customers.
	//   "LIFECYCLE_STATE_GA" - The entity is Generally Available. It is fully
	// supported, stable, and available to all customers.
	//   "LIFECYCLE_STATE_DEPRECATED" - The entity is deprecated. It is no longer
	// recommended for use and may be removed in a future version.
	LifecycleState string `json:"lifecycleState,omitempty"`
	// Name: Identifier. The resource name of the LogicalProduct. Format:
	// logicalProducts/{logical_product}.
	Name string `json:"name,omitempty"`
	// ProductSuite: Product suite associated with the logical product. Format:
	// productSuites/{product_suite}.
	ProductSuite string `json:"productSuite,omitempty"`
	// Replaced: Output only. Indicates whether the logical product has been
	// replaced. If `false`, the product is active. If `true`, the product has been
	// replaced by another type, and the `replacement` field contains the resource
	// name of that replacement.
	Replaced bool `json:"replaced,omitempty"`
	// Replacement: Output only. The resource name of the Logical Entity that the
	// logical product is replaced by. This field is only populated when this
	// logical product is replaced by some other type. Eg:
	// logicalProducts/{logical_product}/variants/{variant},
	// productSuites/{product_suite}, etc.
	Replacement string `json:"replacement,omitempty"`
	// Title: Display name of the LogicalProduct.
	Title string `json:"title,omitempty"`
	// Variants: Output only. Child variant resource references. Format:
	// logicalProducts/{logical_product}/variants/{variant}
	Variants []string `json:"variants,omitempty"`

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

func (s LogicalProduct) MarshalJSON() ([]byte, error) {
	type NoMethod LogicalProduct
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// LogicalProductVariant: Represents a distinct offering derived from a primary
// product that retains core functionalities but offers specialized features
// for a specific market segment.
type LogicalProductVariant struct {
	// LifecycleState: Output only. Current Lifecycle state of the logical product
	// variant.
	//
	// Possible values:
	//   "LIFECYCLE_STATE_UNSPECIFIED" - The default value. This value is used if
	// the lifecycle state is not set.
	//   "LIFECYCLE_STATE_PUBLIC_PREVIEW" - The entity is in Public Preview. It is
	// available to all customers, but may not be feature-complete or have full
	// support guarantees.
	//   "LIFECYCLE_STATE_PRIVATE_GA" - The entity is in Private General
	// Availability. It is fully supported and stable, but only available to a
	// select group of customers.
	//   "LIFECYCLE_STATE_GA" - The entity is Generally Available. It is fully
	// supported, stable, and available to all customers.
	//   "LIFECYCLE_STATE_DEPRECATED" - The entity is deprecated. It is no longer
	// recommended for use and may be removed in a future version.
	LifecycleState string `json:"lifecycleState,omitempty"`
	// Name: Identifier. The resource name of the LogicalProductVariant. Format:
	// logicalProducts/{logical_product}/variants/{variant}
	Name string `json:"name,omitempty"`
	// Replaced: Output only. Indicates whether the logical product variant has
	// been replaced. If `false`, the variant is active. If `true`, the variant has
	// been replaced by another type, and the `replacement` field contains the
	// resource name of that replacement.
	Replaced bool `json:"replaced,omitempty"`
	// Replacement: Output only. The resource name of the Logical Entity that the
	// logical product variant is replaced by. This field is only populated when
	// this logical product variant is replaced by some other type. Eg:
	// logicalProducts/{logical_product}, productSuites/{product_suite}, etc.
	Replacement string `json:"replacement,omitempty"`
	// Title: Display name of the LogicalProductVariant.
	Title string `json:"title,omitempty"`

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

func (s LogicalProductVariant) MarshalJSON() ([]byte, error) {
	type NoMethod LogicalProductVariant
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// LookupEntityResponse: Response message for LookupEntity.
type LookupEntityResponse struct {
	// LogicalProduct: Matched LogicalProduct.
	LogicalProduct *LogicalProduct `json:"logicalProduct,omitempty"`
	// LogicalProductVariant: Matched LogicalProductVariant.
	LogicalProductVariant *LogicalProductVariant `json:"logicalProductVariant,omitempty"`
	// ProductSuite: Matched ProductSuite.
	ProductSuite *ProductSuite `json:"productSuite,omitempty"`

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

func (s LookupEntityResponse) MarshalJSON() ([]byte, error) {
	type NoMethod LookupEntityResponse
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// ProductSuite: Represents a unified grouping of products sharing a common
// brand and market positioning.
type ProductSuite struct {
	// LogicalProducts: Output only. LogicalProducts under this suite. Format:
	// logicalProducts/{logical_product}
	LogicalProducts []string `json:"logicalProducts,omitempty"`
	// Name: Identifier. The resource name of the ProductSuite. Format:
	// productSuites/{product_suite}
	Name string `json:"name,omitempty"`
	// Replaced: Output only. Indicates whether the product suite has been
	// replaced. If `false`, the product suite is active. If `true`, the product
	// suite has been replaced by another type, and the `replacement` field
	// contains the resource name of that replacement.
	Replaced bool `json:"replaced,omitempty"`
	// Replacement: Output only. The resource name of the Logical Entity that the
	// product suite is replaced by. This field is only populated when this product
	// suite is replaced by some other type. Eg: logicalProducts/{logical_product},
	// logicalProducts/{logical_product}/variants/{variant}, etc.
	Replacement string `json:"replacement,omitempty"`
	// Title: Title of the ProductSuite.
	Title string `json:"title,omitempty"`

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

func (s ProductSuite) MarshalJSON() ([]byte, error) {
	type NoMethod ProductSuite
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

type LogicalProductsGetCall struct {
	s            *Service
	name         string
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// Get: Gets details of a LogicalProduct.
//
//   - name: The name of the LogicalProduct to retrieve. Format:
//     logicalProducts/{logical_product}.
func (r *LogicalProductsService) Get(name string) *LogicalProductsGetCall {
	c := &LogicalProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.name = name
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *LogicalProductsGetCall) Fields(s ...googleapi.Field) *LogicalProductsGetCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *LogicalProductsGetCall) IfNoneMatch(entityTag string) *LogicalProductsGetCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *LogicalProductsGetCall) Context(ctx context.Context) *LogicalProductsGetCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *LogicalProductsGetCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *LogicalProductsGetCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"name": c.name,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudproductregistry.logicalProducts.get", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "cloudproductregistry.logicalProducts.get" call.
// Any non-2xx status code is an error. Response headers are in either
// *LogicalProduct.ServerResponse.Header or (if a response was returned at all)
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
// whether the returned error was because http.StatusNotModified was returned.
func (c *LogicalProductsGetCall) Do(opts ...googleapi.CallOption) (*LogicalProduct, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &LogicalProduct{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudproductregistry.logicalProducts.get", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type LogicalProductsListCall struct {
	s            *Service
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// List: Lists LogicalProducts matching given criteria.
func (r *LogicalProductsService) List() *LogicalProductsListCall {
	c := &LogicalProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}

// Filter sets the optional parameter "filter": The filter expression for
// listing logical products. Filter syntax: https://google.aip.dev/160
// Supported fields: suite_id
func (c *LogicalProductsListCall) Filter(filter string) *LogicalProductsListCall {
	c.urlParams_.Set("filter", filter)
	return c
}

// PageSize sets the optional parameter "pageSize": The maximum number of
// logical products to return. The service may return fewer than this value. If
// unspecified, at most 100 logical products will be returned. The maximum
// value is 500; values above 500 will be coerced to 500.
func (c *LogicalProductsListCall) PageSize(pageSize int64) *LogicalProductsListCall {
	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
	return c
}

// PageToken sets the optional parameter "pageToken": A page token, received
// from a previous `ListLogicalProducts` call. Provide this to retrieve the
// subsequent page. When paginating, all other parameters provided to
// `ListLogicalProducts` must match the call that provided the page token.
func (c *LogicalProductsListCall) PageToken(pageToken string) *LogicalProductsListCall {
	c.urlParams_.Set("pageToken", pageToken)
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *LogicalProductsListCall) Fields(s ...googleapi.Field) *LogicalProductsListCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *LogicalProductsListCall) IfNoneMatch(entityTag string) *LogicalProductsListCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *LogicalProductsListCall) Context(ctx context.Context) *LogicalProductsListCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *LogicalProductsListCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *LogicalProductsListCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/logicalProducts")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudproductregistry.logicalProducts.list", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "cloudproductregistry.logicalProducts.list" call.
// Any non-2xx status code is an error. Response headers are in either
// *ListLogicalProductsResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *LogicalProductsListCall) Do(opts ...googleapi.CallOption) (*ListLogicalProductsResponse, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &ListLogicalProductsResponse{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudproductregistry.logicalProducts.list", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *LogicalProductsListCall) Pages(ctx context.Context, f func(*ListLogicalProductsResponse) error) error {
	c.ctx_ = ctx
	defer c.PageToken(c.urlParams_.Get("pageToken"))
	for {
		x, err := c.Do()
		if err != nil {
			return err
		}
		if err := f(x); err != nil {
			return err
		}
		if x.NextPageToken == "" {
			return nil
		}
		c.PageToken(x.NextPageToken)
	}
}

type LogicalProductsLookupEntityCall struct {
	s            *Service
	lookupUri    string
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// LookupEntity: Look up entities.
//
//   - lookupUri: Entity uri to look up. Supported Formats:
//     logicalProducts/{logical_product}
//     logicalProducts/{logical_product}/variants/{variant}
//     productSuites/{product_suite}.
func (r *LogicalProductsService) LookupEntity(lookupUri string) *LogicalProductsLookupEntityCall {
	c := &LogicalProductsLookupEntityCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.lookupUri = lookupUri
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *LogicalProductsLookupEntityCall) Fields(s ...googleapi.Field) *LogicalProductsLookupEntityCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *LogicalProductsLookupEntityCall) IfNoneMatch(entityTag string) *LogicalProductsLookupEntityCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *LogicalProductsLookupEntityCall) Context(ctx context.Context) *LogicalProductsLookupEntityCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *LogicalProductsLookupEntityCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *LogicalProductsLookupEntityCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+lookupUri}:lookupEntity")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"lookupUri": c.lookupUri,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudproductregistry.logicalProducts.lookupEntity", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "cloudproductregistry.logicalProducts.lookupEntity" call.
// Any non-2xx status code is an error. Response headers are in either
// *LookupEntityResponse.ServerResponse.Header or (if a response was returned
// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified was
// returned.
func (c *LogicalProductsLookupEntityCall) Do(opts ...googleapi.CallOption) (*LookupEntityResponse, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &LookupEntityResponse{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudproductregistry.logicalProducts.lookupEntity", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type LogicalProductsVariantsGetCall struct {
	s            *Service
	name         string
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// Get: Get details of a LogicalProductVariant.
//
//   - name: The name of the LogicalProductVariant to retrieve. Format:
//     logicalProducts/{logical_product}/variants/{variant}.
func (r *LogicalProductsVariantsService) Get(name string) *LogicalProductsVariantsGetCall {
	c := &LogicalProductsVariantsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.name = name
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *LogicalProductsVariantsGetCall) Fields(s ...googleapi.Field) *LogicalProductsVariantsGetCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *LogicalProductsVariantsGetCall) IfNoneMatch(entityTag string) *LogicalProductsVariantsGetCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *LogicalProductsVariantsGetCall) Context(ctx context.Context) *LogicalProductsVariantsGetCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *LogicalProductsVariantsGetCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *LogicalProductsVariantsGetCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"name": c.name,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudproductregistry.logicalProducts.variants.get", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "cloudproductregistry.logicalProducts.variants.get" call.
// Any non-2xx status code is an error. Response headers are in either
// *LogicalProductVariant.ServerResponse.Header or (if a response was returned
// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified was
// returned.
func (c *LogicalProductsVariantsGetCall) Do(opts ...googleapi.CallOption) (*LogicalProductVariant, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &LogicalProductVariant{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudproductregistry.logicalProducts.variants.get", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type LogicalProductsVariantsListCall struct {
	s            *Service
	parent       string
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// List: Lists LogicalProductVariants matching given criteria.
//
//   - parent: Parent logical product id. Format:
//     logicalProducts/{logical_product}.
func (r *LogicalProductsVariantsService) List(parent string) *LogicalProductsVariantsListCall {
	c := &LogicalProductsVariantsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.parent = parent
	return c
}

// PageSize sets the optional parameter "pageSize": The maximum number of
// logical product variants to return. The service may return fewer than this
// value. If unspecified, at most 100 logical product variants will be
// returned. The maximum value is 500; values above 500 will be coerced to 500.
func (c *LogicalProductsVariantsListCall) PageSize(pageSize int64) *LogicalProductsVariantsListCall {
	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
	return c
}

// PageToken sets the optional parameter "pageToken": A page token, received
// from a previous `ListLogicalProductVariants` call. Provide this to retrieve
// the subsequent page. When paginating, all other parameters provided to
// `ListLogicalProductVariants` must match the call that provided the page
// token.
func (c *LogicalProductsVariantsListCall) PageToken(pageToken string) *LogicalProductsVariantsListCall {
	c.urlParams_.Set("pageToken", pageToken)
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *LogicalProductsVariantsListCall) Fields(s ...googleapi.Field) *LogicalProductsVariantsListCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *LogicalProductsVariantsListCall) IfNoneMatch(entityTag string) *LogicalProductsVariantsListCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *LogicalProductsVariantsListCall) Context(ctx context.Context) *LogicalProductsVariantsListCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *LogicalProductsVariantsListCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *LogicalProductsVariantsListCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/variants")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"parent": c.parent,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudproductregistry.logicalProducts.variants.list", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "cloudproductregistry.logicalProducts.variants.list" call.
// Any non-2xx status code is an error. Response headers are in either
// *ListLogicalProductVariantsResponse.ServerResponse.Header or (if a response
// was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *LogicalProductsVariantsListCall) Do(opts ...googleapi.CallOption) (*ListLogicalProductVariantsResponse, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &ListLogicalProductVariantsResponse{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudproductregistry.logicalProducts.variants.list", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *LogicalProductsVariantsListCall) Pages(ctx context.Context, f func(*ListLogicalProductVariantsResponse) error) error {
	c.ctx_ = ctx
	defer c.PageToken(c.urlParams_.Get("pageToken"))
	for {
		x, err := c.Do()
		if err != nil {
			return err
		}
		if err := f(x); err != nil {
			return err
		}
		if x.NextPageToken == "" {
			return nil
		}
		c.PageToken(x.NextPageToken)
	}
}

type LogicalProductsVariantsLookupEntityCall struct {
	s            *Service
	lookupUri    string
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// LookupEntity: Look up entities.
//
//   - lookupUri: Entity uri to look up. Supported Formats:
//     logicalProducts/{logical_product}
//     logicalProducts/{logical_product}/variants/{variant}
//     productSuites/{product_suite}.
func (r *LogicalProductsVariantsService) LookupEntity(lookupUri string) *LogicalProductsVariantsLookupEntityCall {
	c := &LogicalProductsVariantsLookupEntityCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.lookupUri = lookupUri
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *LogicalProductsVariantsLookupEntityCall) Fields(s ...googleapi.Field) *LogicalProductsVariantsLookupEntityCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *LogicalProductsVariantsLookupEntityCall) IfNoneMatch(entityTag string) *LogicalProductsVariantsLookupEntityCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *LogicalProductsVariantsLookupEntityCall) Context(ctx context.Context) *LogicalProductsVariantsLookupEntityCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *LogicalProductsVariantsLookupEntityCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *LogicalProductsVariantsLookupEntityCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+lookupUri}:lookupEntity")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"lookupUri": c.lookupUri,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudproductregistry.logicalProducts.variants.lookupEntity", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "cloudproductregistry.logicalProducts.variants.lookupEntity" call.
// Any non-2xx status code is an error. Response headers are in either
// *LookupEntityResponse.ServerResponse.Header or (if a response was returned
// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified was
// returned.
func (c *LogicalProductsVariantsLookupEntityCall) Do(opts ...googleapi.CallOption) (*LookupEntityResponse, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &LookupEntityResponse{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudproductregistry.logicalProducts.variants.lookupEntity", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type ProductSuitesGetCall struct {
	s            *Service
	name         string
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// Get: Get details of a ProductSuite.
//
//   - name: The name of the ProductSuite to retrieve. Format:
//     productSuites/{product_suite}.
func (r *ProductSuitesService) Get(name string) *ProductSuitesGetCall {
	c := &ProductSuitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.name = name
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProductSuitesGetCall) Fields(s ...googleapi.Field) *ProductSuitesGetCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *ProductSuitesGetCall) IfNoneMatch(entityTag string) *ProductSuitesGetCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *ProductSuitesGetCall) Context(ctx context.Context) *ProductSuitesGetCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProductSuitesGetCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *ProductSuitesGetCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"name": c.name,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudproductregistry.productSuites.get", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "cloudproductregistry.productSuites.get" call.
// Any non-2xx status code is an error. Response headers are in either
// *ProductSuite.ServerResponse.Header or (if a response was returned at all)
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
// whether the returned error was because http.StatusNotModified was returned.
func (c *ProductSuitesGetCall) Do(opts ...googleapi.CallOption) (*ProductSuite, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &ProductSuite{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudproductregistry.productSuites.get", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type ProductSuitesListCall struct {
	s            *Service
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// List: Lists ProductSuites.
func (r *ProductSuitesService) List() *ProductSuitesListCall {
	c := &ProductSuitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}

// PageSize sets the optional parameter "pageSize": The maximum number of
// suites to return. The service may return fewer than this value. If
// unspecified, at most 100 suites will be returned. The maximum value is 500;
// values above 500 will be coerced to 500.
func (c *ProductSuitesListCall) PageSize(pageSize int64) *ProductSuitesListCall {
	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
	return c
}

// PageToken sets the optional parameter "pageToken": A page token, received
// from a previous `ListProductSuites` call. Provide this to retrieve the
// subsequent page. When paginating, all other parameters provided to
// `ListProductSuites` must match the call that provided the page token.
func (c *ProductSuitesListCall) PageToken(pageToken string) *ProductSuitesListCall {
	c.urlParams_.Set("pageToken", pageToken)
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProductSuitesListCall) Fields(s ...googleapi.Field) *ProductSuitesListCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *ProductSuitesListCall) IfNoneMatch(entityTag string) *ProductSuitesListCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *ProductSuitesListCall) Context(ctx context.Context) *ProductSuitesListCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProductSuitesListCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *ProductSuitesListCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/productSuites")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudproductregistry.productSuites.list", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "cloudproductregistry.productSuites.list" call.
// Any non-2xx status code is an error. Response headers are in either
// *ListProductSuitesResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *ProductSuitesListCall) Do(opts ...googleapi.CallOption) (*ListProductSuitesResponse, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &ListProductSuitesResponse{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudproductregistry.productSuites.list", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *ProductSuitesListCall) Pages(ctx context.Context, f func(*ListProductSuitesResponse) error) error {
	c.ctx_ = ctx
	defer c.PageToken(c.urlParams_.Get("pageToken"))
	for {
		x, err := c.Do()
		if err != nil {
			return err
		}
		if err := f(x); err != nil {
			return err
		}
		if x.NextPageToken == "" {
			return nil
		}
		c.PageToken(x.NextPageToken)
	}
}

type ProductSuitesLookupEntityCall struct {
	s            *Service
	lookupUri    string
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// LookupEntity: Look up entities.
//
//   - lookupUri: Entity uri to look up. Supported Formats:
//     logicalProducts/{logical_product}
//     logicalProducts/{logical_product}/variants/{variant}
//     productSuites/{product_suite}.
func (r *ProductSuitesService) LookupEntity(lookupUri string) *ProductSuitesLookupEntityCall {
	c := &ProductSuitesLookupEntityCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.lookupUri = lookupUri
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProductSuitesLookupEntityCall) Fields(s ...googleapi.Field) *ProductSuitesLookupEntityCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *ProductSuitesLookupEntityCall) IfNoneMatch(entityTag string) *ProductSuitesLookupEntityCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *ProductSuitesLookupEntityCall) Context(ctx context.Context) *ProductSuitesLookupEntityCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProductSuitesLookupEntityCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *ProductSuitesLookupEntityCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+lookupUri}:lookupEntity")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"lookupUri": c.lookupUri,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudproductregistry.productSuites.lookupEntity", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "cloudproductregistry.productSuites.lookupEntity" call.
// Any non-2xx status code is an error. Response headers are in either
// *LookupEntityResponse.ServerResponse.Header or (if a response was returned
// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified was
// returned.
func (c *ProductSuitesLookupEntityCall) Do(opts ...googleapi.CallOption) (*LookupEntityResponse, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &LookupEntityResponse{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudproductregistry.productSuites.lookupEntity", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}
