...

Source file src/google.golang.org/api/cloudprivatecatalog/v1beta1/cloudprivatecatalog-gen.go

Documentation: google.golang.org/api/cloudprivatecatalog/v1beta1

     1  // Copyright 2020 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 cloudprivatecatalog provides access to the Cloud Private Catalog API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/private-catalog/
    10  //
    11  // # Creating a client
    12  //
    13  // Usage example:
    14  //
    15  //	import "google.golang.org/api/cloudprivatecatalog/v1beta1"
    16  //	...
    17  //	ctx := context.Background()
    18  //	cloudprivatecatalogService, err := cloudprivatecatalog.NewService(ctx)
    19  //
    20  // In this example, Google Application Default Credentials are used for authentication.
    21  //
    22  // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    23  //
    24  // # Other authentication options
    25  //
    26  // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
    27  //
    28  //	cloudprivatecatalogService, err := cloudprivatecatalog.NewService(ctx, option.WithAPIKey("AIza..."))
    29  //
    30  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
    31  //
    32  //	config := &oauth2.Config{...}
    33  //	// ...
    34  //	token, err := config.Exchange(ctx, ...)
    35  //	cloudprivatecatalogService, err := cloudprivatecatalog.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    36  //
    37  // See https://godoc.org/google.golang.org/api/option/ for details on options.
    38  package cloudprivatecatalog // import "google.golang.org/api/cloudprivatecatalog/v1beta1"
    39  
    40  import (
    41  	"bytes"
    42  	"context"
    43  	"encoding/json"
    44  	"errors"
    45  	"fmt"
    46  	"io"
    47  	"net/http"
    48  	"net/url"
    49  	"strconv"
    50  	"strings"
    51  
    52  	googleapi "google.golang.org/api/googleapi"
    53  	gensupport "google.golang.org/api/internal/gensupport"
    54  	option "google.golang.org/api/option"
    55  	internaloption "google.golang.org/api/option/internaloption"
    56  	htransport "google.golang.org/api/transport/http"
    57  )
    58  
    59  // Always reference these packages, just in case the auto-generated code
    60  // below doesn't.
    61  var _ = bytes.NewBuffer
    62  var _ = strconv.Itoa
    63  var _ = fmt.Sprintf
    64  var _ = json.NewDecoder
    65  var _ = io.Copy
    66  var _ = url.Parse
    67  var _ = gensupport.MarshalJSON
    68  var _ = googleapi.Version
    69  var _ = errors.New
    70  var _ = strings.Replace
    71  var _ = context.Canceled
    72  var _ = internaloption.WithDefaultEndpoint
    73  
    74  const apiId = "cloudprivatecatalog:v1beta1"
    75  const apiName = "cloudprivatecatalog"
    76  const apiVersion = "v1beta1"
    77  const basePath = "https://cloudprivatecatalog.googleapis.com/"
    78  
    79  // OAuth2 scopes used by this API.
    80  const (
    81  	// View and manage your data across Google Cloud Platform services
    82  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
    83  )
    84  
    85  // NewService creates a new Service.
    86  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
    87  	scopesOption := option.WithScopes(
    88  		"https://www.googleapis.com/auth/cloud-platform",
    89  	)
    90  	// NOTE: prepend, so we don't override user-specified scopes.
    91  	opts = append([]option.ClientOption{scopesOption}, opts...)
    92  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
    93  	client, endpoint, err := htransport.NewClient(ctx, opts...)
    94  	if err != nil {
    95  		return nil, err
    96  	}
    97  	s, err := New(client)
    98  	if err != nil {
    99  		return nil, err
   100  	}
   101  	if endpoint != "" {
   102  		s.BasePath = endpoint
   103  	}
   104  	return s, nil
   105  }
   106  
   107  // New creates a new Service. It uses the provided http.Client for requests.
   108  //
   109  // Deprecated: please use NewService instead.
   110  // To provide a custom HTTP client, use option.WithHTTPClient.
   111  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   112  func New(client *http.Client) (*Service, error) {
   113  	if client == nil {
   114  		return nil, errors.New("client is nil")
   115  	}
   116  	s := &Service{client: client, BasePath: basePath}
   117  	s.Folders = NewFoldersService(s)
   118  	s.Organizations = NewOrganizationsService(s)
   119  	s.Projects = NewProjectsService(s)
   120  	return s, nil
   121  }
   122  
   123  type Service struct {
   124  	client    *http.Client
   125  	BasePath  string // API endpoint base URL
   126  	UserAgent string // optional additional User-Agent fragment
   127  
   128  	Folders *FoldersService
   129  
   130  	Organizations *OrganizationsService
   131  
   132  	Projects *ProjectsService
   133  }
   134  
   135  func (s *Service) userAgent() string {
   136  	if s.UserAgent == "" {
   137  		return googleapi.UserAgent
   138  	}
   139  	return googleapi.UserAgent + " " + s.UserAgent
   140  }
   141  
   142  func NewFoldersService(s *Service) *FoldersService {
   143  	rs := &FoldersService{s: s}
   144  	rs.Catalogs = NewFoldersCatalogsService(s)
   145  	rs.Products = NewFoldersProductsService(s)
   146  	rs.Versions = NewFoldersVersionsService(s)
   147  	return rs
   148  }
   149  
   150  type FoldersService struct {
   151  	s *Service
   152  
   153  	Catalogs *FoldersCatalogsService
   154  
   155  	Products *FoldersProductsService
   156  
   157  	Versions *FoldersVersionsService
   158  }
   159  
   160  func NewFoldersCatalogsService(s *Service) *FoldersCatalogsService {
   161  	rs := &FoldersCatalogsService{s: s}
   162  	return rs
   163  }
   164  
   165  type FoldersCatalogsService struct {
   166  	s *Service
   167  }
   168  
   169  func NewFoldersProductsService(s *Service) *FoldersProductsService {
   170  	rs := &FoldersProductsService{s: s}
   171  	return rs
   172  }
   173  
   174  type FoldersProductsService struct {
   175  	s *Service
   176  }
   177  
   178  func NewFoldersVersionsService(s *Service) *FoldersVersionsService {
   179  	rs := &FoldersVersionsService{s: s}
   180  	return rs
   181  }
   182  
   183  type FoldersVersionsService struct {
   184  	s *Service
   185  }
   186  
   187  func NewOrganizationsService(s *Service) *OrganizationsService {
   188  	rs := &OrganizationsService{s: s}
   189  	rs.Catalogs = NewOrganizationsCatalogsService(s)
   190  	rs.Products = NewOrganizationsProductsService(s)
   191  	rs.Versions = NewOrganizationsVersionsService(s)
   192  	return rs
   193  }
   194  
   195  type OrganizationsService struct {
   196  	s *Service
   197  
   198  	Catalogs *OrganizationsCatalogsService
   199  
   200  	Products *OrganizationsProductsService
   201  
   202  	Versions *OrganizationsVersionsService
   203  }
   204  
   205  func NewOrganizationsCatalogsService(s *Service) *OrganizationsCatalogsService {
   206  	rs := &OrganizationsCatalogsService{s: s}
   207  	return rs
   208  }
   209  
   210  type OrganizationsCatalogsService struct {
   211  	s *Service
   212  }
   213  
   214  func NewOrganizationsProductsService(s *Service) *OrganizationsProductsService {
   215  	rs := &OrganizationsProductsService{s: s}
   216  	return rs
   217  }
   218  
   219  type OrganizationsProductsService struct {
   220  	s *Service
   221  }
   222  
   223  func NewOrganizationsVersionsService(s *Service) *OrganizationsVersionsService {
   224  	rs := &OrganizationsVersionsService{s: s}
   225  	return rs
   226  }
   227  
   228  type OrganizationsVersionsService struct {
   229  	s *Service
   230  }
   231  
   232  func NewProjectsService(s *Service) *ProjectsService {
   233  	rs := &ProjectsService{s: s}
   234  	rs.Catalogs = NewProjectsCatalogsService(s)
   235  	rs.Products = NewProjectsProductsService(s)
   236  	rs.Versions = NewProjectsVersionsService(s)
   237  	return rs
   238  }
   239  
   240  type ProjectsService struct {
   241  	s *Service
   242  
   243  	Catalogs *ProjectsCatalogsService
   244  
   245  	Products *ProjectsProductsService
   246  
   247  	Versions *ProjectsVersionsService
   248  }
   249  
   250  func NewProjectsCatalogsService(s *Service) *ProjectsCatalogsService {
   251  	rs := &ProjectsCatalogsService{s: s}
   252  	return rs
   253  }
   254  
   255  type ProjectsCatalogsService struct {
   256  	s *Service
   257  }
   258  
   259  func NewProjectsProductsService(s *Service) *ProjectsProductsService {
   260  	rs := &ProjectsProductsService{s: s}
   261  	return rs
   262  }
   263  
   264  type ProjectsProductsService struct {
   265  	s *Service
   266  }
   267  
   268  func NewProjectsVersionsService(s *Service) *ProjectsVersionsService {
   269  	rs := &ProjectsVersionsService{s: s}
   270  	return rs
   271  }
   272  
   273  type ProjectsVersionsService struct {
   274  	s *Service
   275  }
   276  
   277  // GoogleCloudPrivatecatalogV1beta1Catalog: The readonly representation
   278  // of a catalog computed with a given resource
   279  // context.
   280  type GoogleCloudPrivatecatalogV1beta1Catalog struct {
   281  	// CreateTime: Output only. The time when the catalog was created.
   282  	CreateTime string `json:"createTime,omitempty"`
   283  
   284  	// Description: Output only. The description of the catalog.
   285  	Description string `json:"description,omitempty"`
   286  
   287  	// DisplayName: Output only. The descriptive name of the catalog as it
   288  	// appears in UIs.
   289  	DisplayName string `json:"displayName,omitempty"`
   290  
   291  	// Name: Output only. The resource name of the target catalog, in the
   292  	// format of
   293  	// `catalogs/{catalog_id}'.
   294  	Name string `json:"name,omitempty"`
   295  
   296  	// UpdateTime: Output only. The time when the catalog was last updated.
   297  	UpdateTime string `json:"updateTime,omitempty"`
   298  
   299  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   300  	// unconditionally include in API requests. By default, fields with
   301  	// empty values are omitted from API requests. However, any non-pointer,
   302  	// non-interface field appearing in ForceSendFields will be sent to the
   303  	// server regardless of whether the field is empty or not. This may be
   304  	// used to include empty fields in Patch requests.
   305  	ForceSendFields []string `json:"-"`
   306  
   307  	// NullFields is a list of field names (e.g. "CreateTime") to include in
   308  	// API requests with the JSON null value. By default, fields with empty
   309  	// values are omitted from API requests. However, any field with an
   310  	// empty value appearing in NullFields will be sent to the server as
   311  	// null. It is an error if a field in this list has a non-empty value.
   312  	// This may be used to include null fields in Patch requests.
   313  	NullFields []string `json:"-"`
   314  }
   315  
   316  func (s *GoogleCloudPrivatecatalogV1beta1Catalog) MarshalJSON() ([]byte, error) {
   317  	type NoMethod GoogleCloudPrivatecatalogV1beta1Catalog
   318  	raw := NoMethod(*s)
   319  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   320  }
   321  
   322  // GoogleCloudPrivatecatalogV1beta1Product: The readonly representation
   323  // of a product computed with a given resource
   324  // context.
   325  type GoogleCloudPrivatecatalogV1beta1Product struct {
   326  	// AssetType: Output only. The type of the product asset. It can be one
   327  	// of the
   328  	// following values:
   329  	//
   330  	// * `google.deploymentmanager.Template`
   331  	// * `google.cloudprivatecatalog.ListingOnly`
   332  	AssetType string `json:"assetType,omitempty"`
   333  
   334  	// CreateTime: Output only. The time when the product was created.
   335  	CreateTime string `json:"createTime,omitempty"`
   336  
   337  	// DisplayMetadata: Output only. The display metadata to describe the
   338  	// product.
   339  	// The JSON schema of the metadata differs by Product.asset_type.
   340  	// When the type is `google.deploymentmanager.Template`, the schema is
   341  	// as
   342  	// follows:
   343  	//
   344  	// ```
   345  	// "$schema": http://json-schema.org/draft-04/schema#
   346  	// type: object
   347  	// properties:
   348  	//   name:
   349  	//     type: string
   350  	//     minLength: 1
   351  	//     maxLength: 64
   352  	//   description:
   353  	//     type: string
   354  	//     minLength: 1
   355  	//     maxLength: 2048
   356  	//   tagline:
   357  	//     type: string
   358  	//     minLength: 1
   359  	//     maxLength: 100
   360  	//   support_info:
   361  	//     type: string
   362  	//     minLength: 1
   363  	//     maxLength: 2048
   364  	//   creator:
   365  	//     type: string
   366  	//     minLength: 1
   367  	//     maxLength: 100
   368  	//   documentation:
   369  	//     type: array
   370  	//     items:
   371  	//       type: object
   372  	//       properties:
   373  	//         url:
   374  	//           type: string
   375  	//           pattern:
   376  	//
   377  	// "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
   378  	//         title:
   379  	//           type: string
   380  	//           minLength: 1
   381  	//           maxLength: 64
   382  	//         description:
   383  	//           type: string
   384  	//           minLength: 1
   385  	//           maxLength: 2048
   386  	// required:
   387  	// - name
   388  	// - description
   389  	// additionalProperties: false
   390  	//
   391  	// ```
   392  	//
   393  	// When the asset type is `google.cloudprivatecatalog.ListingOnly`, the
   394  	// schema
   395  	// is as follows:
   396  	//
   397  	// ```
   398  	// "$schema": http://json-schema.org/draft-04/schema#
   399  	// type: object
   400  	// properties:
   401  	//   name:
   402  	//     type: string
   403  	//     minLength: 1
   404  	//     maxLength: 64
   405  	//   description:
   406  	//     type: string
   407  	//     minLength: 1
   408  	//     maxLength: 2048
   409  	//   tagline:
   410  	//     type: string
   411  	//     minLength: 1
   412  	//     maxLength: 100
   413  	//   support_info:
   414  	//     type: string
   415  	//     minLength: 1
   416  	//     maxLength: 2048
   417  	//   creator:
   418  	//     type: string
   419  	//     minLength: 1
   420  	//     maxLength: 100
   421  	//   documentation:
   422  	//     type: array
   423  	//     items:
   424  	//       type: object
   425  	//       properties:
   426  	//         url:
   427  	//           type: string
   428  	//           pattern:
   429  	//
   430  	// "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
   431  	//         title:
   432  	//           type: string
   433  	//           minLength: 1
   434  	//           maxLength: 64
   435  	//         description:
   436  	//           type: string
   437  	//           minLength: 1
   438  	//           maxLength: 2048
   439  	//   signup_url:
   440  	//     type: string
   441  	//     pattern:
   442  	//
   443  	// "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
   444  	// requ
   445  	// ired:
   446  	// - name
   447  	// - description
   448  	// - signup_url
   449  	// additionalProperties: false
   450  	// ```
   451  	DisplayMetadata googleapi.RawMessage `json:"displayMetadata,omitempty"`
   452  
   453  	// IconUri: Output only. The icon URI of the product.
   454  	IconUri string `json:"iconUri,omitempty"`
   455  
   456  	// Name: Output only. The resource name of the target product, in the
   457  	// format of
   458  	// `products/a-z*[a-z0-9]'.
   459  	//
   460  	// A unique identifier for the product under a catalog.
   461  	Name string `json:"name,omitempty"`
   462  
   463  	// UpdateTime: Output only. The time when the product was last updated.
   464  	UpdateTime string `json:"updateTime,omitempty"`
   465  
   466  	// ForceSendFields is a list of field names (e.g. "AssetType") to
   467  	// unconditionally include in API requests. By default, fields with
   468  	// empty values are omitted from API requests. However, any non-pointer,
   469  	// non-interface field appearing in ForceSendFields will be sent to the
   470  	// server regardless of whether the field is empty or not. This may be
   471  	// used to include empty fields in Patch requests.
   472  	ForceSendFields []string `json:"-"`
   473  
   474  	// NullFields is a list of field names (e.g. "AssetType") to include in
   475  	// API requests with the JSON null value. By default, fields with empty
   476  	// values are omitted from API requests. However, any field with an
   477  	// empty value appearing in NullFields will be sent to the server as
   478  	// null. It is an error if a field in this list has a non-empty value.
   479  	// This may be used to include null fields in Patch requests.
   480  	NullFields []string `json:"-"`
   481  }
   482  
   483  func (s *GoogleCloudPrivatecatalogV1beta1Product) MarshalJSON() ([]byte, error) {
   484  	type NoMethod GoogleCloudPrivatecatalogV1beta1Product
   485  	raw := NoMethod(*s)
   486  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   487  }
   488  
   489  // GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse: Response
   490  // message for PrivateCatalog.SearchCatalogs.
   491  type GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse struct {
   492  	// Catalogs: The `Catalog`s computed from the resource context.
   493  	Catalogs []*GoogleCloudPrivatecatalogV1beta1Catalog `json:"catalogs,omitempty"`
   494  
   495  	// NextPageToken: A pagination token returned from a previous call to
   496  	// SearchCatalogs that
   497  	// indicates from where listing should continue.
   498  	// This field is optional.
   499  	NextPageToken string `json:"nextPageToken,omitempty"`
   500  
   501  	// ServerResponse contains the HTTP response code and headers from the
   502  	// server.
   503  	googleapi.ServerResponse `json:"-"`
   504  
   505  	// ForceSendFields is a list of field names (e.g. "Catalogs") to
   506  	// unconditionally include in API requests. By default, fields with
   507  	// empty values are omitted from API requests. However, any non-pointer,
   508  	// non-interface field appearing in ForceSendFields will be sent to the
   509  	// server regardless of whether the field is empty or not. This may be
   510  	// used to include empty fields in Patch requests.
   511  	ForceSendFields []string `json:"-"`
   512  
   513  	// NullFields is a list of field names (e.g. "Catalogs") to include in
   514  	// API requests with the JSON null value. By default, fields with empty
   515  	// values are omitted from API requests. However, any field with an
   516  	// empty value appearing in NullFields will be sent to the server as
   517  	// null. It is an error if a field in this list has a non-empty value.
   518  	// This may be used to include null fields in Patch requests.
   519  	NullFields []string `json:"-"`
   520  }
   521  
   522  func (s *GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse) MarshalJSON() ([]byte, error) {
   523  	type NoMethod GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse
   524  	raw := NoMethod(*s)
   525  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   526  }
   527  
   528  // GoogleCloudPrivatecatalogV1beta1SearchProductsResponse: Response
   529  // message for PrivateCatalog.SearchProducts.
   530  type GoogleCloudPrivatecatalogV1beta1SearchProductsResponse struct {
   531  	// NextPageToken: A pagination token returned from a previous call to
   532  	// SearchProducts that
   533  	// indicates from where listing should continue.
   534  	// This field is optional.
   535  	NextPageToken string `json:"nextPageToken,omitempty"`
   536  
   537  	// Products: The `Product` resources computed from the resource context.
   538  	Products []*GoogleCloudPrivatecatalogV1beta1Product `json:"products,omitempty"`
   539  
   540  	// ServerResponse contains the HTTP response code and headers from the
   541  	// server.
   542  	googleapi.ServerResponse `json:"-"`
   543  
   544  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   545  	// unconditionally include in API requests. By default, fields with
   546  	// empty values are omitted from API requests. However, any non-pointer,
   547  	// non-interface field appearing in ForceSendFields will be sent to the
   548  	// server regardless of whether the field is empty or not. This may be
   549  	// used to include empty fields in Patch requests.
   550  	ForceSendFields []string `json:"-"`
   551  
   552  	// NullFields is a list of field names (e.g. "NextPageToken") to include
   553  	// in API requests with the JSON null value. By default, fields with
   554  	// empty values are omitted from API requests. However, any field with
   555  	// an empty value appearing in NullFields will be sent to the server as
   556  	// null. It is an error if a field in this list has a non-empty value.
   557  	// This may be used to include null fields in Patch requests.
   558  	NullFields []string `json:"-"`
   559  }
   560  
   561  func (s *GoogleCloudPrivatecatalogV1beta1SearchProductsResponse) MarshalJSON() ([]byte, error) {
   562  	type NoMethod GoogleCloudPrivatecatalogV1beta1SearchProductsResponse
   563  	raw := NoMethod(*s)
   564  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   565  }
   566  
   567  // GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse: Response
   568  // message for PrivateCatalog.SearchVersions.
   569  type GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse struct {
   570  	// NextPageToken: A pagination token returned from a previous call to
   571  	// SearchVersions that
   572  	// indicates from where the listing should continue.
   573  	// This field is optional.
   574  	NextPageToken string `json:"nextPageToken,omitempty"`
   575  
   576  	// Versions: The `Version` resources computed from the resource context.
   577  	Versions []*GoogleCloudPrivatecatalogV1beta1Version `json:"versions,omitempty"`
   578  
   579  	// ServerResponse contains the HTTP response code and headers from the
   580  	// server.
   581  	googleapi.ServerResponse `json:"-"`
   582  
   583  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   584  	// unconditionally include in API requests. By default, fields with
   585  	// empty values are omitted from API requests. However, any non-pointer,
   586  	// non-interface field appearing in ForceSendFields will be sent to the
   587  	// server regardless of whether the field is empty or not. This may be
   588  	// used to include empty fields in Patch requests.
   589  	ForceSendFields []string `json:"-"`
   590  
   591  	// NullFields is a list of field names (e.g. "NextPageToken") to include
   592  	// in API requests with the JSON null value. By default, fields with
   593  	// empty values are omitted from API requests. However, any field with
   594  	// an empty value appearing in NullFields will be sent to the server as
   595  	// null. It is an error if a field in this list has a non-empty value.
   596  	// This may be used to include null fields in Patch requests.
   597  	NullFields []string `json:"-"`
   598  }
   599  
   600  func (s *GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse) MarshalJSON() ([]byte, error) {
   601  	type NoMethod GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse
   602  	raw := NoMethod(*s)
   603  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   604  }
   605  
   606  // GoogleCloudPrivatecatalogV1beta1Version: The consumer representation
   607  // of a version which is a child resource under a
   608  // `Product` with asset data.
   609  type GoogleCloudPrivatecatalogV1beta1Version struct {
   610  	// Asset: Output only. The asset which has been validated and is ready
   611  	// to be
   612  	// provisioned.
   613  	// See
   614  	// google.cloud.privatecatalogproducer.v1beta.Version.asset for details.
   615  	Asset googleapi.RawMessage `json:"asset,omitempty"`
   616  
   617  	// CreateTime: Output only. The time when the version was created.
   618  	CreateTime string `json:"createTime,omitempty"`
   619  
   620  	// Description: Output only. The user-supplied description of the
   621  	// version. Maximum of 256
   622  	// characters.
   623  	Description string `json:"description,omitempty"`
   624  
   625  	// Name: Output only. The resource name of the version, in the
   626  	// format
   627  	// `catalogs/{catalog_id}/products/{product_id}/versions/a-z*[a-z0
   628  	// -9]'.
   629  	//
   630  	// A unique identifier for the version under a product.
   631  	Name string `json:"name,omitempty"`
   632  
   633  	// UpdateTime: Output only. The time when the version was last updated.
   634  	UpdateTime string `json:"updateTime,omitempty"`
   635  
   636  	// ForceSendFields is a list of field names (e.g. "Asset") to
   637  	// unconditionally include in API requests. By default, fields with
   638  	// empty values are omitted from API requests. However, any non-pointer,
   639  	// non-interface field appearing in ForceSendFields will be sent to the
   640  	// server regardless of whether the field is empty or not. This may be
   641  	// used to include empty fields in Patch requests.
   642  	ForceSendFields []string `json:"-"`
   643  
   644  	// NullFields is a list of field names (e.g. "Asset") to include in API
   645  	// requests with the JSON null value. By default, fields with empty
   646  	// values are omitted from API requests. However, any field with an
   647  	// empty value appearing in NullFields will be sent to the server as
   648  	// null. It is an error if a field in this list has a non-empty value.
   649  	// This may be used to include null fields in Patch requests.
   650  	NullFields []string `json:"-"`
   651  }
   652  
   653  func (s *GoogleCloudPrivatecatalogV1beta1Version) MarshalJSON() ([]byte, error) {
   654  	type NoMethod GoogleCloudPrivatecatalogV1beta1Version
   655  	raw := NoMethod(*s)
   656  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   657  }
   658  
   659  // method id "cloudprivatecatalog.folders.catalogs.search":
   660  
   661  type FoldersCatalogsSearchCall struct {
   662  	s            *Service
   663  	resource     string
   664  	urlParams_   gensupport.URLParams
   665  	ifNoneMatch_ string
   666  	ctx_         context.Context
   667  	header_      http.Header
   668  }
   669  
   670  // Search: Search Catalog resources that consumers have access to,
   671  // within the
   672  // scope of the consumer cloud resource hierarchy context.
   673  func (r *FoldersCatalogsService) Search(resource string) *FoldersCatalogsSearchCall {
   674  	c := &FoldersCatalogsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   675  	c.resource = resource
   676  	return c
   677  }
   678  
   679  // PageSize sets the optional parameter "pageSize": The maximum number
   680  // of entries that are requested.
   681  func (c *FoldersCatalogsSearchCall) PageSize(pageSize int64) *FoldersCatalogsSearchCall {
   682  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   683  	return c
   684  }
   685  
   686  // PageToken sets the optional parameter "pageToken": A pagination token
   687  // returned from a previous call to SearchCatalogs that
   688  // indicates where this listing should continue from.
   689  // This field is optional.
   690  func (c *FoldersCatalogsSearchCall) PageToken(pageToken string) *FoldersCatalogsSearchCall {
   691  	c.urlParams_.Set("pageToken", pageToken)
   692  	return c
   693  }
   694  
   695  // Query sets the optional parameter "query": The query to filter the
   696  // catalogs. The supported queries are:
   697  //
   698  // * Get a single catalog: `name=catalogs/{catalog_id}`
   699  func (c *FoldersCatalogsSearchCall) Query(query string) *FoldersCatalogsSearchCall {
   700  	c.urlParams_.Set("query", query)
   701  	return c
   702  }
   703  
   704  // Fields allows partial responses to be retrieved. See
   705  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
   706  // for more information.
   707  func (c *FoldersCatalogsSearchCall) Fields(s ...googleapi.Field) *FoldersCatalogsSearchCall {
   708  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   709  	return c
   710  }
   711  
   712  // IfNoneMatch sets the optional parameter which makes the operation
   713  // fail if the object's ETag matches the given value. This is useful for
   714  // getting updates only after the object has changed since the last
   715  // request. Use googleapi.IsNotModified to check whether the response
   716  // error from Do is the result of In-None-Match.
   717  func (c *FoldersCatalogsSearchCall) IfNoneMatch(entityTag string) *FoldersCatalogsSearchCall {
   718  	c.ifNoneMatch_ = entityTag
   719  	return c
   720  }
   721  
   722  // Context sets the context to be used in this call's Do method. Any
   723  // pending HTTP request will be aborted if the provided context is
   724  // canceled.
   725  func (c *FoldersCatalogsSearchCall) Context(ctx context.Context) *FoldersCatalogsSearchCall {
   726  	c.ctx_ = ctx
   727  	return c
   728  }
   729  
   730  // Header returns an http.Header that can be modified by the caller to
   731  // add HTTP headers to the request.
   732  func (c *FoldersCatalogsSearchCall) Header() http.Header {
   733  	if c.header_ == nil {
   734  		c.header_ = make(http.Header)
   735  	}
   736  	return c.header_
   737  }
   738  
   739  func (c *FoldersCatalogsSearchCall) doRequest(alt string) (*http.Response, error) {
   740  	reqHeaders := make(http.Header)
   741  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200310")
   742  	for k, v := range c.header_ {
   743  		reqHeaders[k] = v
   744  	}
   745  	reqHeaders.Set("User-Agent", c.s.userAgent())
   746  	if c.ifNoneMatch_ != "" {
   747  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   748  	}
   749  	var body io.Reader = nil
   750  	c.urlParams_.Set("alt", alt)
   751  	c.urlParams_.Set("prettyPrint", "false")
   752  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}/catalogs:search")
   753  	urls += "?" + c.urlParams_.Encode()
   754  	req, err := http.NewRequest("GET", urls, body)
   755  	if err != nil {
   756  		return nil, err
   757  	}
   758  	req.Header = reqHeaders
   759  	googleapi.Expand(req.URL, map[string]string{
   760  		"resource": c.resource,
   761  	})
   762  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   763  }
   764  
   765  // Do executes the "cloudprivatecatalog.folders.catalogs.search" call.
   766  // Exactly one of
   767  // *GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse or error will
   768  // be non-nil. Any non-2xx status code is an error. Response headers are
   769  // in either
   770  // *GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse.ServerResponse
   771  // .Header or (if a response was returned at all) in
   772  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   773  // whether the returned error was because http.StatusNotModified was
   774  // returned.
   775  func (c *FoldersCatalogsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse, error) {
   776  	gensupport.SetOptions(c.urlParams_, opts...)
   777  	res, err := c.doRequest("json")
   778  	if res != nil && res.StatusCode == http.StatusNotModified {
   779  		if res.Body != nil {
   780  			res.Body.Close()
   781  		}
   782  		return nil, &googleapi.Error{
   783  			Code:   res.StatusCode,
   784  			Header: res.Header,
   785  		}
   786  	}
   787  	if err != nil {
   788  		return nil, err
   789  	}
   790  	defer googleapi.CloseBody(res)
   791  	if err := googleapi.CheckResponse(res); err != nil {
   792  		return nil, err
   793  	}
   794  	ret := &GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse{
   795  		ServerResponse: googleapi.ServerResponse{
   796  			Header:         res.Header,
   797  			HTTPStatusCode: res.StatusCode,
   798  		},
   799  	}
   800  	target := &ret
   801  	if err := gensupport.DecodeResponse(target, res); err != nil {
   802  		return nil, err
   803  	}
   804  	return ret, nil
   805  	// {
   806  	//   "description": "Search Catalog resources that consumers have access to, within the\nscope of the consumer cloud resource hierarchy context.",
   807  	//   "flatPath": "v1beta1/folders/{foldersId}/catalogs:search",
   808  	//   "httpMethod": "GET",
   809  	//   "id": "cloudprivatecatalog.folders.catalogs.search",
   810  	//   "parameterOrder": [
   811  	//     "resource"
   812  	//   ],
   813  	//   "parameters": {
   814  	//     "pageSize": {
   815  	//       "description": "The maximum number of entries that are requested.",
   816  	//       "format": "int32",
   817  	//       "location": "query",
   818  	//       "type": "integer"
   819  	//     },
   820  	//     "pageToken": {
   821  	//       "description": "A pagination token returned from a previous call to SearchCatalogs that\nindicates where this listing should continue from.\nThis field is optional.",
   822  	//       "location": "query",
   823  	//       "type": "string"
   824  	//     },
   825  	//     "query": {
   826  	//       "description": "The query to filter the catalogs. The supported queries are:\n\n* Get a single catalog: `name=catalogs/{catalog_id}`",
   827  	//       "location": "query",
   828  	//       "type": "string"
   829  	//     },
   830  	//     "resource": {
   831  	//       "description": "Required. The name of the resource context. It can be in following formats:\n\n* `projects/{project_id}`\n* `folders/{folder_id}`\n* `organizations/{organization_id}`",
   832  	//       "location": "path",
   833  	//       "pattern": "^folders/[^/]+$",
   834  	//       "required": true,
   835  	//       "type": "string"
   836  	//     }
   837  	//   },
   838  	//   "path": "v1beta1/{+resource}/catalogs:search",
   839  	//   "response": {
   840  	//     "$ref": "GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse"
   841  	//   },
   842  	//   "scopes": [
   843  	//     "https://www.googleapis.com/auth/cloud-platform"
   844  	//   ]
   845  	// }
   846  
   847  }
   848  
   849  // Pages invokes f for each page of results.
   850  // A non-nil error returned from f will halt the iteration.
   851  // The provided context supersedes any context provided to the Context method.
   852  func (c *FoldersCatalogsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse) error) error {
   853  	c.ctx_ = ctx
   854  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
   855  	for {
   856  		x, err := c.Do()
   857  		if err != nil {
   858  			return err
   859  		}
   860  		if err := f(x); err != nil {
   861  			return err
   862  		}
   863  		if x.NextPageToken == "" {
   864  			return nil
   865  		}
   866  		c.PageToken(x.NextPageToken)
   867  	}
   868  }
   869  
   870  // method id "cloudprivatecatalog.folders.products.search":
   871  
   872  type FoldersProductsSearchCall struct {
   873  	s            *Service
   874  	resource     string
   875  	urlParams_   gensupport.URLParams
   876  	ifNoneMatch_ string
   877  	ctx_         context.Context
   878  	header_      http.Header
   879  }
   880  
   881  // Search: Search Product resources that consumers have access to,
   882  // within the
   883  // scope of the consumer cloud resource hierarchy context.
   884  func (r *FoldersProductsService) Search(resource string) *FoldersProductsSearchCall {
   885  	c := &FoldersProductsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   886  	c.resource = resource
   887  	return c
   888  }
   889  
   890  // PageSize sets the optional parameter "pageSize": The maximum number
   891  // of entries that are requested.
   892  func (c *FoldersProductsSearchCall) PageSize(pageSize int64) *FoldersProductsSearchCall {
   893  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   894  	return c
   895  }
   896  
   897  // PageToken sets the optional parameter "pageToken": A pagination token
   898  // returned from a previous call to SearchProducts that
   899  // indicates where this listing should continue from.
   900  // This field is optional.
   901  func (c *FoldersProductsSearchCall) PageToken(pageToken string) *FoldersProductsSearchCall {
   902  	c.urlParams_.Set("pageToken", pageToken)
   903  	return c
   904  }
   905  
   906  // Query sets the optional parameter "query": The query to filter the
   907  // products.
   908  //
   909  // The supported queries are:
   910  // * List products of all catalogs: empty
   911  // * List products under a catalog: `parent=catalogs/{catalog_id}`
   912  // * Get a product by
   913  // name:
   914  // `name=catalogs/{catalog_id}/products/{product_id}`
   915  func (c *FoldersProductsSearchCall) Query(query string) *FoldersProductsSearchCall {
   916  	c.urlParams_.Set("query", query)
   917  	return c
   918  }
   919  
   920  // Fields allows partial responses to be retrieved. See
   921  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
   922  // for more information.
   923  func (c *FoldersProductsSearchCall) Fields(s ...googleapi.Field) *FoldersProductsSearchCall {
   924  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   925  	return c
   926  }
   927  
   928  // IfNoneMatch sets the optional parameter which makes the operation
   929  // fail if the object's ETag matches the given value. This is useful for
   930  // getting updates only after the object has changed since the last
   931  // request. Use googleapi.IsNotModified to check whether the response
   932  // error from Do is the result of In-None-Match.
   933  func (c *FoldersProductsSearchCall) IfNoneMatch(entityTag string) *FoldersProductsSearchCall {
   934  	c.ifNoneMatch_ = entityTag
   935  	return c
   936  }
   937  
   938  // Context sets the context to be used in this call's Do method. Any
   939  // pending HTTP request will be aborted if the provided context is
   940  // canceled.
   941  func (c *FoldersProductsSearchCall) Context(ctx context.Context) *FoldersProductsSearchCall {
   942  	c.ctx_ = ctx
   943  	return c
   944  }
   945  
   946  // Header returns an http.Header that can be modified by the caller to
   947  // add HTTP headers to the request.
   948  func (c *FoldersProductsSearchCall) Header() http.Header {
   949  	if c.header_ == nil {
   950  		c.header_ = make(http.Header)
   951  	}
   952  	return c.header_
   953  }
   954  
   955  func (c *FoldersProductsSearchCall) doRequest(alt string) (*http.Response, error) {
   956  	reqHeaders := make(http.Header)
   957  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200310")
   958  	for k, v := range c.header_ {
   959  		reqHeaders[k] = v
   960  	}
   961  	reqHeaders.Set("User-Agent", c.s.userAgent())
   962  	if c.ifNoneMatch_ != "" {
   963  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   964  	}
   965  	var body io.Reader = nil
   966  	c.urlParams_.Set("alt", alt)
   967  	c.urlParams_.Set("prettyPrint", "false")
   968  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}/products:search")
   969  	urls += "?" + c.urlParams_.Encode()
   970  	req, err := http.NewRequest("GET", urls, body)
   971  	if err != nil {
   972  		return nil, err
   973  	}
   974  	req.Header = reqHeaders
   975  	googleapi.Expand(req.URL, map[string]string{
   976  		"resource": c.resource,
   977  	})
   978  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   979  }
   980  
   981  // Do executes the "cloudprivatecatalog.folders.products.search" call.
   982  // Exactly one of
   983  // *GoogleCloudPrivatecatalogV1beta1SearchProductsResponse or error will
   984  // be non-nil. Any non-2xx status code is an error. Response headers are
   985  // in either
   986  // *GoogleCloudPrivatecatalogV1beta1SearchProductsResponse.ServerResponse
   987  // .Header or (if a response was returned at all) in
   988  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   989  // whether the returned error was because http.StatusNotModified was
   990  // returned.
   991  func (c *FoldersProductsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogV1beta1SearchProductsResponse, error) {
   992  	gensupport.SetOptions(c.urlParams_, opts...)
   993  	res, err := c.doRequest("json")
   994  	if res != nil && res.StatusCode == http.StatusNotModified {
   995  		if res.Body != nil {
   996  			res.Body.Close()
   997  		}
   998  		return nil, &googleapi.Error{
   999  			Code:   res.StatusCode,
  1000  			Header: res.Header,
  1001  		}
  1002  	}
  1003  	if err != nil {
  1004  		return nil, err
  1005  	}
  1006  	defer googleapi.CloseBody(res)
  1007  	if err := googleapi.CheckResponse(res); err != nil {
  1008  		return nil, err
  1009  	}
  1010  	ret := &GoogleCloudPrivatecatalogV1beta1SearchProductsResponse{
  1011  		ServerResponse: googleapi.ServerResponse{
  1012  			Header:         res.Header,
  1013  			HTTPStatusCode: res.StatusCode,
  1014  		},
  1015  	}
  1016  	target := &ret
  1017  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1018  		return nil, err
  1019  	}
  1020  	return ret, nil
  1021  	// {
  1022  	//   "description": "Search Product resources that consumers have access to, within the\nscope of the consumer cloud resource hierarchy context.",
  1023  	//   "flatPath": "v1beta1/folders/{foldersId}/products:search",
  1024  	//   "httpMethod": "GET",
  1025  	//   "id": "cloudprivatecatalog.folders.products.search",
  1026  	//   "parameterOrder": [
  1027  	//     "resource"
  1028  	//   ],
  1029  	//   "parameters": {
  1030  	//     "pageSize": {
  1031  	//       "description": "The maximum number of entries that are requested.",
  1032  	//       "format": "int32",
  1033  	//       "location": "query",
  1034  	//       "type": "integer"
  1035  	//     },
  1036  	//     "pageToken": {
  1037  	//       "description": "A pagination token returned from a previous call to SearchProducts that\nindicates where this listing should continue from.\nThis field is optional.",
  1038  	//       "location": "query",
  1039  	//       "type": "string"
  1040  	//     },
  1041  	//     "query": {
  1042  	//       "description": "The query to filter the products.\n\nThe supported queries are:\n* List products of all catalogs: empty\n* List products under a catalog: `parent=catalogs/{catalog_id}`\n* Get a product by name:\n`name=catalogs/{catalog_id}/products/{product_id}`",
  1043  	//       "location": "query",
  1044  	//       "type": "string"
  1045  	//     },
  1046  	//     "resource": {
  1047  	//       "description": "Required. The name of the resource context. See\nSearchCatalogsRequest.resource for details.",
  1048  	//       "location": "path",
  1049  	//       "pattern": "^folders/[^/]+$",
  1050  	//       "required": true,
  1051  	//       "type": "string"
  1052  	//     }
  1053  	//   },
  1054  	//   "path": "v1beta1/{+resource}/products:search",
  1055  	//   "response": {
  1056  	//     "$ref": "GoogleCloudPrivatecatalogV1beta1SearchProductsResponse"
  1057  	//   },
  1058  	//   "scopes": [
  1059  	//     "https://www.googleapis.com/auth/cloud-platform"
  1060  	//   ]
  1061  	// }
  1062  
  1063  }
  1064  
  1065  // Pages invokes f for each page of results.
  1066  // A non-nil error returned from f will halt the iteration.
  1067  // The provided context supersedes any context provided to the Context method.
  1068  func (c *FoldersProductsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudPrivatecatalogV1beta1SearchProductsResponse) error) error {
  1069  	c.ctx_ = ctx
  1070  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1071  	for {
  1072  		x, err := c.Do()
  1073  		if err != nil {
  1074  			return err
  1075  		}
  1076  		if err := f(x); err != nil {
  1077  			return err
  1078  		}
  1079  		if x.NextPageToken == "" {
  1080  			return nil
  1081  		}
  1082  		c.PageToken(x.NextPageToken)
  1083  	}
  1084  }
  1085  
  1086  // method id "cloudprivatecatalog.folders.versions.search":
  1087  
  1088  type FoldersVersionsSearchCall struct {
  1089  	s            *Service
  1090  	resource     string
  1091  	urlParams_   gensupport.URLParams
  1092  	ifNoneMatch_ string
  1093  	ctx_         context.Context
  1094  	header_      http.Header
  1095  }
  1096  
  1097  // Search: Search Version resources that consumers have access to,
  1098  // within the
  1099  // scope of the consumer cloud resource hierarchy context.
  1100  func (r *FoldersVersionsService) Search(resource string) *FoldersVersionsSearchCall {
  1101  	c := &FoldersVersionsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1102  	c.resource = resource
  1103  	return c
  1104  }
  1105  
  1106  // PageSize sets the optional parameter "pageSize": The maximum number
  1107  // of entries that are requested.
  1108  func (c *FoldersVersionsSearchCall) PageSize(pageSize int64) *FoldersVersionsSearchCall {
  1109  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1110  	return c
  1111  }
  1112  
  1113  // PageToken sets the optional parameter "pageToken": A pagination token
  1114  // returned from a previous call to SearchVersions
  1115  // that indicates where this listing should continue from.
  1116  // This field is optional.
  1117  func (c *FoldersVersionsSearchCall) PageToken(pageToken string) *FoldersVersionsSearchCall {
  1118  	c.urlParams_.Set("pageToken", pageToken)
  1119  	return c
  1120  }
  1121  
  1122  // Query sets the optional parameter "query": The query to filter the
  1123  // versions. Required.
  1124  //
  1125  // The supported queries are:
  1126  // * List versions under a
  1127  // product:
  1128  // `parent=catalogs/{catalog_id}/products/{product_id}`
  1129  // * Get a version by
  1130  // name:
  1131  // `name=catalogs/{catalog_id}/products/{product_id}/versions/{vers
  1132  // ion_id}`
  1133  func (c *FoldersVersionsSearchCall) Query(query string) *FoldersVersionsSearchCall {
  1134  	c.urlParams_.Set("query", query)
  1135  	return c
  1136  }
  1137  
  1138  // Fields allows partial responses to be retrieved. See
  1139  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1140  // for more information.
  1141  func (c *FoldersVersionsSearchCall) Fields(s ...googleapi.Field) *FoldersVersionsSearchCall {
  1142  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1143  	return c
  1144  }
  1145  
  1146  // IfNoneMatch sets the optional parameter which makes the operation
  1147  // fail if the object's ETag matches the given value. This is useful for
  1148  // getting updates only after the object has changed since the last
  1149  // request. Use googleapi.IsNotModified to check whether the response
  1150  // error from Do is the result of In-None-Match.
  1151  func (c *FoldersVersionsSearchCall) IfNoneMatch(entityTag string) *FoldersVersionsSearchCall {
  1152  	c.ifNoneMatch_ = entityTag
  1153  	return c
  1154  }
  1155  
  1156  // Context sets the context to be used in this call's Do method. Any
  1157  // pending HTTP request will be aborted if the provided context is
  1158  // canceled.
  1159  func (c *FoldersVersionsSearchCall) Context(ctx context.Context) *FoldersVersionsSearchCall {
  1160  	c.ctx_ = ctx
  1161  	return c
  1162  }
  1163  
  1164  // Header returns an http.Header that can be modified by the caller to
  1165  // add HTTP headers to the request.
  1166  func (c *FoldersVersionsSearchCall) Header() http.Header {
  1167  	if c.header_ == nil {
  1168  		c.header_ = make(http.Header)
  1169  	}
  1170  	return c.header_
  1171  }
  1172  
  1173  func (c *FoldersVersionsSearchCall) doRequest(alt string) (*http.Response, error) {
  1174  	reqHeaders := make(http.Header)
  1175  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200310")
  1176  	for k, v := range c.header_ {
  1177  		reqHeaders[k] = v
  1178  	}
  1179  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1180  	if c.ifNoneMatch_ != "" {
  1181  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1182  	}
  1183  	var body io.Reader = nil
  1184  	c.urlParams_.Set("alt", alt)
  1185  	c.urlParams_.Set("prettyPrint", "false")
  1186  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}/versions:search")
  1187  	urls += "?" + c.urlParams_.Encode()
  1188  	req, err := http.NewRequest("GET", urls, body)
  1189  	if err != nil {
  1190  		return nil, err
  1191  	}
  1192  	req.Header = reqHeaders
  1193  	googleapi.Expand(req.URL, map[string]string{
  1194  		"resource": c.resource,
  1195  	})
  1196  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1197  }
  1198  
  1199  // Do executes the "cloudprivatecatalog.folders.versions.search" call.
  1200  // Exactly one of
  1201  // *GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse or error will
  1202  // be non-nil. Any non-2xx status code is an error. Response headers are
  1203  // in either
  1204  // *GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse.ServerResponse
  1205  // .Header or (if a response was returned at all) in
  1206  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1207  // whether the returned error was because http.StatusNotModified was
  1208  // returned.
  1209  func (c *FoldersVersionsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse, error) {
  1210  	gensupport.SetOptions(c.urlParams_, opts...)
  1211  	res, err := c.doRequest("json")
  1212  	if res != nil && res.StatusCode == http.StatusNotModified {
  1213  		if res.Body != nil {
  1214  			res.Body.Close()
  1215  		}
  1216  		return nil, &googleapi.Error{
  1217  			Code:   res.StatusCode,
  1218  			Header: res.Header,
  1219  		}
  1220  	}
  1221  	if err != nil {
  1222  		return nil, err
  1223  	}
  1224  	defer googleapi.CloseBody(res)
  1225  	if err := googleapi.CheckResponse(res); err != nil {
  1226  		return nil, err
  1227  	}
  1228  	ret := &GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse{
  1229  		ServerResponse: googleapi.ServerResponse{
  1230  			Header:         res.Header,
  1231  			HTTPStatusCode: res.StatusCode,
  1232  		},
  1233  	}
  1234  	target := &ret
  1235  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1236  		return nil, err
  1237  	}
  1238  	return ret, nil
  1239  	// {
  1240  	//   "description": "Search Version resources that consumers have access to, within the\nscope of the consumer cloud resource hierarchy context.",
  1241  	//   "flatPath": "v1beta1/folders/{foldersId}/versions:search",
  1242  	//   "httpMethod": "GET",
  1243  	//   "id": "cloudprivatecatalog.folders.versions.search",
  1244  	//   "parameterOrder": [
  1245  	//     "resource"
  1246  	//   ],
  1247  	//   "parameters": {
  1248  	//     "pageSize": {
  1249  	//       "description": "The maximum number of entries that are requested.",
  1250  	//       "format": "int32",
  1251  	//       "location": "query",
  1252  	//       "type": "integer"
  1253  	//     },
  1254  	//     "pageToken": {
  1255  	//       "description": "A pagination token returned from a previous call to SearchVersions\nthat indicates where this listing should continue from.\nThis field is optional.",
  1256  	//       "location": "query",
  1257  	//       "type": "string"
  1258  	//     },
  1259  	//     "query": {
  1260  	//       "description": "The query to filter the versions. Required.\n\nThe supported queries are:\n* List versions under a product:\n`parent=catalogs/{catalog_id}/products/{product_id}`\n* Get a version by name:\n`name=catalogs/{catalog_id}/products/{product_id}/versions/{version_id}`",
  1261  	//       "location": "query",
  1262  	//       "type": "string"
  1263  	//     },
  1264  	//     "resource": {
  1265  	//       "description": "Required. The name of the resource context. See\nSearchCatalogsRequest.resource for details.",
  1266  	//       "location": "path",
  1267  	//       "pattern": "^folders/[^/]+$",
  1268  	//       "required": true,
  1269  	//       "type": "string"
  1270  	//     }
  1271  	//   },
  1272  	//   "path": "v1beta1/{+resource}/versions:search",
  1273  	//   "response": {
  1274  	//     "$ref": "GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse"
  1275  	//   },
  1276  	//   "scopes": [
  1277  	//     "https://www.googleapis.com/auth/cloud-platform"
  1278  	//   ]
  1279  	// }
  1280  
  1281  }
  1282  
  1283  // Pages invokes f for each page of results.
  1284  // A non-nil error returned from f will halt the iteration.
  1285  // The provided context supersedes any context provided to the Context method.
  1286  func (c *FoldersVersionsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse) error) error {
  1287  	c.ctx_ = ctx
  1288  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1289  	for {
  1290  		x, err := c.Do()
  1291  		if err != nil {
  1292  			return err
  1293  		}
  1294  		if err := f(x); err != nil {
  1295  			return err
  1296  		}
  1297  		if x.NextPageToken == "" {
  1298  			return nil
  1299  		}
  1300  		c.PageToken(x.NextPageToken)
  1301  	}
  1302  }
  1303  
  1304  // method id "cloudprivatecatalog.organizations.catalogs.search":
  1305  
  1306  type OrganizationsCatalogsSearchCall struct {
  1307  	s            *Service
  1308  	resource     string
  1309  	urlParams_   gensupport.URLParams
  1310  	ifNoneMatch_ string
  1311  	ctx_         context.Context
  1312  	header_      http.Header
  1313  }
  1314  
  1315  // Search: Search Catalog resources that consumers have access to,
  1316  // within the
  1317  // scope of the consumer cloud resource hierarchy context.
  1318  func (r *OrganizationsCatalogsService) Search(resource string) *OrganizationsCatalogsSearchCall {
  1319  	c := &OrganizationsCatalogsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1320  	c.resource = resource
  1321  	return c
  1322  }
  1323  
  1324  // PageSize sets the optional parameter "pageSize": The maximum number
  1325  // of entries that are requested.
  1326  func (c *OrganizationsCatalogsSearchCall) PageSize(pageSize int64) *OrganizationsCatalogsSearchCall {
  1327  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1328  	return c
  1329  }
  1330  
  1331  // PageToken sets the optional parameter "pageToken": A pagination token
  1332  // returned from a previous call to SearchCatalogs that
  1333  // indicates where this listing should continue from.
  1334  // This field is optional.
  1335  func (c *OrganizationsCatalogsSearchCall) PageToken(pageToken string) *OrganizationsCatalogsSearchCall {
  1336  	c.urlParams_.Set("pageToken", pageToken)
  1337  	return c
  1338  }
  1339  
  1340  // Query sets the optional parameter "query": The query to filter the
  1341  // catalogs. The supported queries are:
  1342  //
  1343  // * Get a single catalog: `name=catalogs/{catalog_id}`
  1344  func (c *OrganizationsCatalogsSearchCall) Query(query string) *OrganizationsCatalogsSearchCall {
  1345  	c.urlParams_.Set("query", query)
  1346  	return c
  1347  }
  1348  
  1349  // Fields allows partial responses to be retrieved. See
  1350  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1351  // for more information.
  1352  func (c *OrganizationsCatalogsSearchCall) Fields(s ...googleapi.Field) *OrganizationsCatalogsSearchCall {
  1353  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1354  	return c
  1355  }
  1356  
  1357  // IfNoneMatch sets the optional parameter which makes the operation
  1358  // fail if the object's ETag matches the given value. This is useful for
  1359  // getting updates only after the object has changed since the last
  1360  // request. Use googleapi.IsNotModified to check whether the response
  1361  // error from Do is the result of In-None-Match.
  1362  func (c *OrganizationsCatalogsSearchCall) IfNoneMatch(entityTag string) *OrganizationsCatalogsSearchCall {
  1363  	c.ifNoneMatch_ = entityTag
  1364  	return c
  1365  }
  1366  
  1367  // Context sets the context to be used in this call's Do method. Any
  1368  // pending HTTP request will be aborted if the provided context is
  1369  // canceled.
  1370  func (c *OrganizationsCatalogsSearchCall) Context(ctx context.Context) *OrganizationsCatalogsSearchCall {
  1371  	c.ctx_ = ctx
  1372  	return c
  1373  }
  1374  
  1375  // Header returns an http.Header that can be modified by the caller to
  1376  // add HTTP headers to the request.
  1377  func (c *OrganizationsCatalogsSearchCall) Header() http.Header {
  1378  	if c.header_ == nil {
  1379  		c.header_ = make(http.Header)
  1380  	}
  1381  	return c.header_
  1382  }
  1383  
  1384  func (c *OrganizationsCatalogsSearchCall) doRequest(alt string) (*http.Response, error) {
  1385  	reqHeaders := make(http.Header)
  1386  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200310")
  1387  	for k, v := range c.header_ {
  1388  		reqHeaders[k] = v
  1389  	}
  1390  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1391  	if c.ifNoneMatch_ != "" {
  1392  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1393  	}
  1394  	var body io.Reader = nil
  1395  	c.urlParams_.Set("alt", alt)
  1396  	c.urlParams_.Set("prettyPrint", "false")
  1397  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}/catalogs:search")
  1398  	urls += "?" + c.urlParams_.Encode()
  1399  	req, err := http.NewRequest("GET", urls, body)
  1400  	if err != nil {
  1401  		return nil, err
  1402  	}
  1403  	req.Header = reqHeaders
  1404  	googleapi.Expand(req.URL, map[string]string{
  1405  		"resource": c.resource,
  1406  	})
  1407  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1408  }
  1409  
  1410  // Do executes the "cloudprivatecatalog.organizations.catalogs.search" call.
  1411  // Exactly one of
  1412  // *GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse or error will
  1413  // be non-nil. Any non-2xx status code is an error. Response headers are
  1414  // in either
  1415  // *GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse.ServerResponse
  1416  // .Header or (if a response was returned at all) in
  1417  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1418  // whether the returned error was because http.StatusNotModified was
  1419  // returned.
  1420  func (c *OrganizationsCatalogsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse, error) {
  1421  	gensupport.SetOptions(c.urlParams_, opts...)
  1422  	res, err := c.doRequest("json")
  1423  	if res != nil && res.StatusCode == http.StatusNotModified {
  1424  		if res.Body != nil {
  1425  			res.Body.Close()
  1426  		}
  1427  		return nil, &googleapi.Error{
  1428  			Code:   res.StatusCode,
  1429  			Header: res.Header,
  1430  		}
  1431  	}
  1432  	if err != nil {
  1433  		return nil, err
  1434  	}
  1435  	defer googleapi.CloseBody(res)
  1436  	if err := googleapi.CheckResponse(res); err != nil {
  1437  		return nil, err
  1438  	}
  1439  	ret := &GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse{
  1440  		ServerResponse: googleapi.ServerResponse{
  1441  			Header:         res.Header,
  1442  			HTTPStatusCode: res.StatusCode,
  1443  		},
  1444  	}
  1445  	target := &ret
  1446  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1447  		return nil, err
  1448  	}
  1449  	return ret, nil
  1450  	// {
  1451  	//   "description": "Search Catalog resources that consumers have access to, within the\nscope of the consumer cloud resource hierarchy context.",
  1452  	//   "flatPath": "v1beta1/organizations/{organizationsId}/catalogs:search",
  1453  	//   "httpMethod": "GET",
  1454  	//   "id": "cloudprivatecatalog.organizations.catalogs.search",
  1455  	//   "parameterOrder": [
  1456  	//     "resource"
  1457  	//   ],
  1458  	//   "parameters": {
  1459  	//     "pageSize": {
  1460  	//       "description": "The maximum number of entries that are requested.",
  1461  	//       "format": "int32",
  1462  	//       "location": "query",
  1463  	//       "type": "integer"
  1464  	//     },
  1465  	//     "pageToken": {
  1466  	//       "description": "A pagination token returned from a previous call to SearchCatalogs that\nindicates where this listing should continue from.\nThis field is optional.",
  1467  	//       "location": "query",
  1468  	//       "type": "string"
  1469  	//     },
  1470  	//     "query": {
  1471  	//       "description": "The query to filter the catalogs. The supported queries are:\n\n* Get a single catalog: `name=catalogs/{catalog_id}`",
  1472  	//       "location": "query",
  1473  	//       "type": "string"
  1474  	//     },
  1475  	//     "resource": {
  1476  	//       "description": "Required. The name of the resource context. It can be in following formats:\n\n* `projects/{project_id}`\n* `folders/{folder_id}`\n* `organizations/{organization_id}`",
  1477  	//       "location": "path",
  1478  	//       "pattern": "^organizations/[^/]+$",
  1479  	//       "required": true,
  1480  	//       "type": "string"
  1481  	//     }
  1482  	//   },
  1483  	//   "path": "v1beta1/{+resource}/catalogs:search",
  1484  	//   "response": {
  1485  	//     "$ref": "GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse"
  1486  	//   },
  1487  	//   "scopes": [
  1488  	//     "https://www.googleapis.com/auth/cloud-platform"
  1489  	//   ]
  1490  	// }
  1491  
  1492  }
  1493  
  1494  // Pages invokes f for each page of results.
  1495  // A non-nil error returned from f will halt the iteration.
  1496  // The provided context supersedes any context provided to the Context method.
  1497  func (c *OrganizationsCatalogsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse) error) error {
  1498  	c.ctx_ = ctx
  1499  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1500  	for {
  1501  		x, err := c.Do()
  1502  		if err != nil {
  1503  			return err
  1504  		}
  1505  		if err := f(x); err != nil {
  1506  			return err
  1507  		}
  1508  		if x.NextPageToken == "" {
  1509  			return nil
  1510  		}
  1511  		c.PageToken(x.NextPageToken)
  1512  	}
  1513  }
  1514  
  1515  // method id "cloudprivatecatalog.organizations.products.search":
  1516  
  1517  type OrganizationsProductsSearchCall struct {
  1518  	s            *Service
  1519  	resource     string
  1520  	urlParams_   gensupport.URLParams
  1521  	ifNoneMatch_ string
  1522  	ctx_         context.Context
  1523  	header_      http.Header
  1524  }
  1525  
  1526  // Search: Search Product resources that consumers have access to,
  1527  // within the
  1528  // scope of the consumer cloud resource hierarchy context.
  1529  func (r *OrganizationsProductsService) Search(resource string) *OrganizationsProductsSearchCall {
  1530  	c := &OrganizationsProductsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1531  	c.resource = resource
  1532  	return c
  1533  }
  1534  
  1535  // PageSize sets the optional parameter "pageSize": The maximum number
  1536  // of entries that are requested.
  1537  func (c *OrganizationsProductsSearchCall) PageSize(pageSize int64) *OrganizationsProductsSearchCall {
  1538  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1539  	return c
  1540  }
  1541  
  1542  // PageToken sets the optional parameter "pageToken": A pagination token
  1543  // returned from a previous call to SearchProducts that
  1544  // indicates where this listing should continue from.
  1545  // This field is optional.
  1546  func (c *OrganizationsProductsSearchCall) PageToken(pageToken string) *OrganizationsProductsSearchCall {
  1547  	c.urlParams_.Set("pageToken", pageToken)
  1548  	return c
  1549  }
  1550  
  1551  // Query sets the optional parameter "query": The query to filter the
  1552  // products.
  1553  //
  1554  // The supported queries are:
  1555  // * List products of all catalogs: empty
  1556  // * List products under a catalog: `parent=catalogs/{catalog_id}`
  1557  // * Get a product by
  1558  // name:
  1559  // `name=catalogs/{catalog_id}/products/{product_id}`
  1560  func (c *OrganizationsProductsSearchCall) Query(query string) *OrganizationsProductsSearchCall {
  1561  	c.urlParams_.Set("query", query)
  1562  	return c
  1563  }
  1564  
  1565  // Fields allows partial responses to be retrieved. See
  1566  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1567  // for more information.
  1568  func (c *OrganizationsProductsSearchCall) Fields(s ...googleapi.Field) *OrganizationsProductsSearchCall {
  1569  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1570  	return c
  1571  }
  1572  
  1573  // IfNoneMatch sets the optional parameter which makes the operation
  1574  // fail if the object's ETag matches the given value. This is useful for
  1575  // getting updates only after the object has changed since the last
  1576  // request. Use googleapi.IsNotModified to check whether the response
  1577  // error from Do is the result of In-None-Match.
  1578  func (c *OrganizationsProductsSearchCall) IfNoneMatch(entityTag string) *OrganizationsProductsSearchCall {
  1579  	c.ifNoneMatch_ = entityTag
  1580  	return c
  1581  }
  1582  
  1583  // Context sets the context to be used in this call's Do method. Any
  1584  // pending HTTP request will be aborted if the provided context is
  1585  // canceled.
  1586  func (c *OrganizationsProductsSearchCall) Context(ctx context.Context) *OrganizationsProductsSearchCall {
  1587  	c.ctx_ = ctx
  1588  	return c
  1589  }
  1590  
  1591  // Header returns an http.Header that can be modified by the caller to
  1592  // add HTTP headers to the request.
  1593  func (c *OrganizationsProductsSearchCall) Header() http.Header {
  1594  	if c.header_ == nil {
  1595  		c.header_ = make(http.Header)
  1596  	}
  1597  	return c.header_
  1598  }
  1599  
  1600  func (c *OrganizationsProductsSearchCall) doRequest(alt string) (*http.Response, error) {
  1601  	reqHeaders := make(http.Header)
  1602  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200310")
  1603  	for k, v := range c.header_ {
  1604  		reqHeaders[k] = v
  1605  	}
  1606  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1607  	if c.ifNoneMatch_ != "" {
  1608  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1609  	}
  1610  	var body io.Reader = nil
  1611  	c.urlParams_.Set("alt", alt)
  1612  	c.urlParams_.Set("prettyPrint", "false")
  1613  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}/products:search")
  1614  	urls += "?" + c.urlParams_.Encode()
  1615  	req, err := http.NewRequest("GET", urls, body)
  1616  	if err != nil {
  1617  		return nil, err
  1618  	}
  1619  	req.Header = reqHeaders
  1620  	googleapi.Expand(req.URL, map[string]string{
  1621  		"resource": c.resource,
  1622  	})
  1623  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1624  }
  1625  
  1626  // Do executes the "cloudprivatecatalog.organizations.products.search" call.
  1627  // Exactly one of
  1628  // *GoogleCloudPrivatecatalogV1beta1SearchProductsResponse or error will
  1629  // be non-nil. Any non-2xx status code is an error. Response headers are
  1630  // in either
  1631  // *GoogleCloudPrivatecatalogV1beta1SearchProductsResponse.ServerResponse
  1632  // .Header or (if a response was returned at all) in
  1633  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1634  // whether the returned error was because http.StatusNotModified was
  1635  // returned.
  1636  func (c *OrganizationsProductsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogV1beta1SearchProductsResponse, error) {
  1637  	gensupport.SetOptions(c.urlParams_, opts...)
  1638  	res, err := c.doRequest("json")
  1639  	if res != nil && res.StatusCode == http.StatusNotModified {
  1640  		if res.Body != nil {
  1641  			res.Body.Close()
  1642  		}
  1643  		return nil, &googleapi.Error{
  1644  			Code:   res.StatusCode,
  1645  			Header: res.Header,
  1646  		}
  1647  	}
  1648  	if err != nil {
  1649  		return nil, err
  1650  	}
  1651  	defer googleapi.CloseBody(res)
  1652  	if err := googleapi.CheckResponse(res); err != nil {
  1653  		return nil, err
  1654  	}
  1655  	ret := &GoogleCloudPrivatecatalogV1beta1SearchProductsResponse{
  1656  		ServerResponse: googleapi.ServerResponse{
  1657  			Header:         res.Header,
  1658  			HTTPStatusCode: res.StatusCode,
  1659  		},
  1660  	}
  1661  	target := &ret
  1662  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1663  		return nil, err
  1664  	}
  1665  	return ret, nil
  1666  	// {
  1667  	//   "description": "Search Product resources that consumers have access to, within the\nscope of the consumer cloud resource hierarchy context.",
  1668  	//   "flatPath": "v1beta1/organizations/{organizationsId}/products:search",
  1669  	//   "httpMethod": "GET",
  1670  	//   "id": "cloudprivatecatalog.organizations.products.search",
  1671  	//   "parameterOrder": [
  1672  	//     "resource"
  1673  	//   ],
  1674  	//   "parameters": {
  1675  	//     "pageSize": {
  1676  	//       "description": "The maximum number of entries that are requested.",
  1677  	//       "format": "int32",
  1678  	//       "location": "query",
  1679  	//       "type": "integer"
  1680  	//     },
  1681  	//     "pageToken": {
  1682  	//       "description": "A pagination token returned from a previous call to SearchProducts that\nindicates where this listing should continue from.\nThis field is optional.",
  1683  	//       "location": "query",
  1684  	//       "type": "string"
  1685  	//     },
  1686  	//     "query": {
  1687  	//       "description": "The query to filter the products.\n\nThe supported queries are:\n* List products of all catalogs: empty\n* List products under a catalog: `parent=catalogs/{catalog_id}`\n* Get a product by name:\n`name=catalogs/{catalog_id}/products/{product_id}`",
  1688  	//       "location": "query",
  1689  	//       "type": "string"
  1690  	//     },
  1691  	//     "resource": {
  1692  	//       "description": "Required. The name of the resource context. See\nSearchCatalogsRequest.resource for details.",
  1693  	//       "location": "path",
  1694  	//       "pattern": "^organizations/[^/]+$",
  1695  	//       "required": true,
  1696  	//       "type": "string"
  1697  	//     }
  1698  	//   },
  1699  	//   "path": "v1beta1/{+resource}/products:search",
  1700  	//   "response": {
  1701  	//     "$ref": "GoogleCloudPrivatecatalogV1beta1SearchProductsResponse"
  1702  	//   },
  1703  	//   "scopes": [
  1704  	//     "https://www.googleapis.com/auth/cloud-platform"
  1705  	//   ]
  1706  	// }
  1707  
  1708  }
  1709  
  1710  // Pages invokes f for each page of results.
  1711  // A non-nil error returned from f will halt the iteration.
  1712  // The provided context supersedes any context provided to the Context method.
  1713  func (c *OrganizationsProductsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudPrivatecatalogV1beta1SearchProductsResponse) error) error {
  1714  	c.ctx_ = ctx
  1715  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1716  	for {
  1717  		x, err := c.Do()
  1718  		if err != nil {
  1719  			return err
  1720  		}
  1721  		if err := f(x); err != nil {
  1722  			return err
  1723  		}
  1724  		if x.NextPageToken == "" {
  1725  			return nil
  1726  		}
  1727  		c.PageToken(x.NextPageToken)
  1728  	}
  1729  }
  1730  
  1731  // method id "cloudprivatecatalog.organizations.versions.search":
  1732  
  1733  type OrganizationsVersionsSearchCall struct {
  1734  	s            *Service
  1735  	resource     string
  1736  	urlParams_   gensupport.URLParams
  1737  	ifNoneMatch_ string
  1738  	ctx_         context.Context
  1739  	header_      http.Header
  1740  }
  1741  
  1742  // Search: Search Version resources that consumers have access to,
  1743  // within the
  1744  // scope of the consumer cloud resource hierarchy context.
  1745  func (r *OrganizationsVersionsService) Search(resource string) *OrganizationsVersionsSearchCall {
  1746  	c := &OrganizationsVersionsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1747  	c.resource = resource
  1748  	return c
  1749  }
  1750  
  1751  // PageSize sets the optional parameter "pageSize": The maximum number
  1752  // of entries that are requested.
  1753  func (c *OrganizationsVersionsSearchCall) PageSize(pageSize int64) *OrganizationsVersionsSearchCall {
  1754  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1755  	return c
  1756  }
  1757  
  1758  // PageToken sets the optional parameter "pageToken": A pagination token
  1759  // returned from a previous call to SearchVersions
  1760  // that indicates where this listing should continue from.
  1761  // This field is optional.
  1762  func (c *OrganizationsVersionsSearchCall) PageToken(pageToken string) *OrganizationsVersionsSearchCall {
  1763  	c.urlParams_.Set("pageToken", pageToken)
  1764  	return c
  1765  }
  1766  
  1767  // Query sets the optional parameter "query": The query to filter the
  1768  // versions. Required.
  1769  //
  1770  // The supported queries are:
  1771  // * List versions under a
  1772  // product:
  1773  // `parent=catalogs/{catalog_id}/products/{product_id}`
  1774  // * Get a version by
  1775  // name:
  1776  // `name=catalogs/{catalog_id}/products/{product_id}/versions/{vers
  1777  // ion_id}`
  1778  func (c *OrganizationsVersionsSearchCall) Query(query string) *OrganizationsVersionsSearchCall {
  1779  	c.urlParams_.Set("query", query)
  1780  	return c
  1781  }
  1782  
  1783  // Fields allows partial responses to be retrieved. See
  1784  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1785  // for more information.
  1786  func (c *OrganizationsVersionsSearchCall) Fields(s ...googleapi.Field) *OrganizationsVersionsSearchCall {
  1787  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1788  	return c
  1789  }
  1790  
  1791  // IfNoneMatch sets the optional parameter which makes the operation
  1792  // fail if the object's ETag matches the given value. This is useful for
  1793  // getting updates only after the object has changed since the last
  1794  // request. Use googleapi.IsNotModified to check whether the response
  1795  // error from Do is the result of In-None-Match.
  1796  func (c *OrganizationsVersionsSearchCall) IfNoneMatch(entityTag string) *OrganizationsVersionsSearchCall {
  1797  	c.ifNoneMatch_ = entityTag
  1798  	return c
  1799  }
  1800  
  1801  // Context sets the context to be used in this call's Do method. Any
  1802  // pending HTTP request will be aborted if the provided context is
  1803  // canceled.
  1804  func (c *OrganizationsVersionsSearchCall) Context(ctx context.Context) *OrganizationsVersionsSearchCall {
  1805  	c.ctx_ = ctx
  1806  	return c
  1807  }
  1808  
  1809  // Header returns an http.Header that can be modified by the caller to
  1810  // add HTTP headers to the request.
  1811  func (c *OrganizationsVersionsSearchCall) Header() http.Header {
  1812  	if c.header_ == nil {
  1813  		c.header_ = make(http.Header)
  1814  	}
  1815  	return c.header_
  1816  }
  1817  
  1818  func (c *OrganizationsVersionsSearchCall) doRequest(alt string) (*http.Response, error) {
  1819  	reqHeaders := make(http.Header)
  1820  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200310")
  1821  	for k, v := range c.header_ {
  1822  		reqHeaders[k] = v
  1823  	}
  1824  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1825  	if c.ifNoneMatch_ != "" {
  1826  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1827  	}
  1828  	var body io.Reader = nil
  1829  	c.urlParams_.Set("alt", alt)
  1830  	c.urlParams_.Set("prettyPrint", "false")
  1831  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}/versions:search")
  1832  	urls += "?" + c.urlParams_.Encode()
  1833  	req, err := http.NewRequest("GET", urls, body)
  1834  	if err != nil {
  1835  		return nil, err
  1836  	}
  1837  	req.Header = reqHeaders
  1838  	googleapi.Expand(req.URL, map[string]string{
  1839  		"resource": c.resource,
  1840  	})
  1841  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1842  }
  1843  
  1844  // Do executes the "cloudprivatecatalog.organizations.versions.search" call.
  1845  // Exactly one of
  1846  // *GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse or error will
  1847  // be non-nil. Any non-2xx status code is an error. Response headers are
  1848  // in either
  1849  // *GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse.ServerResponse
  1850  // .Header or (if a response was returned at all) in
  1851  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1852  // whether the returned error was because http.StatusNotModified was
  1853  // returned.
  1854  func (c *OrganizationsVersionsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse, error) {
  1855  	gensupport.SetOptions(c.urlParams_, opts...)
  1856  	res, err := c.doRequest("json")
  1857  	if res != nil && res.StatusCode == http.StatusNotModified {
  1858  		if res.Body != nil {
  1859  			res.Body.Close()
  1860  		}
  1861  		return nil, &googleapi.Error{
  1862  			Code:   res.StatusCode,
  1863  			Header: res.Header,
  1864  		}
  1865  	}
  1866  	if err != nil {
  1867  		return nil, err
  1868  	}
  1869  	defer googleapi.CloseBody(res)
  1870  	if err := googleapi.CheckResponse(res); err != nil {
  1871  		return nil, err
  1872  	}
  1873  	ret := &GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse{
  1874  		ServerResponse: googleapi.ServerResponse{
  1875  			Header:         res.Header,
  1876  			HTTPStatusCode: res.StatusCode,
  1877  		},
  1878  	}
  1879  	target := &ret
  1880  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1881  		return nil, err
  1882  	}
  1883  	return ret, nil
  1884  	// {
  1885  	//   "description": "Search Version resources that consumers have access to, within the\nscope of the consumer cloud resource hierarchy context.",
  1886  	//   "flatPath": "v1beta1/organizations/{organizationsId}/versions:search",
  1887  	//   "httpMethod": "GET",
  1888  	//   "id": "cloudprivatecatalog.organizations.versions.search",
  1889  	//   "parameterOrder": [
  1890  	//     "resource"
  1891  	//   ],
  1892  	//   "parameters": {
  1893  	//     "pageSize": {
  1894  	//       "description": "The maximum number of entries that are requested.",
  1895  	//       "format": "int32",
  1896  	//       "location": "query",
  1897  	//       "type": "integer"
  1898  	//     },
  1899  	//     "pageToken": {
  1900  	//       "description": "A pagination token returned from a previous call to SearchVersions\nthat indicates where this listing should continue from.\nThis field is optional.",
  1901  	//       "location": "query",
  1902  	//       "type": "string"
  1903  	//     },
  1904  	//     "query": {
  1905  	//       "description": "The query to filter the versions. Required.\n\nThe supported queries are:\n* List versions under a product:\n`parent=catalogs/{catalog_id}/products/{product_id}`\n* Get a version by name:\n`name=catalogs/{catalog_id}/products/{product_id}/versions/{version_id}`",
  1906  	//       "location": "query",
  1907  	//       "type": "string"
  1908  	//     },
  1909  	//     "resource": {
  1910  	//       "description": "Required. The name of the resource context. See\nSearchCatalogsRequest.resource for details.",
  1911  	//       "location": "path",
  1912  	//       "pattern": "^organizations/[^/]+$",
  1913  	//       "required": true,
  1914  	//       "type": "string"
  1915  	//     }
  1916  	//   },
  1917  	//   "path": "v1beta1/{+resource}/versions:search",
  1918  	//   "response": {
  1919  	//     "$ref": "GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse"
  1920  	//   },
  1921  	//   "scopes": [
  1922  	//     "https://www.googleapis.com/auth/cloud-platform"
  1923  	//   ]
  1924  	// }
  1925  
  1926  }
  1927  
  1928  // Pages invokes f for each page of results.
  1929  // A non-nil error returned from f will halt the iteration.
  1930  // The provided context supersedes any context provided to the Context method.
  1931  func (c *OrganizationsVersionsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse) error) error {
  1932  	c.ctx_ = ctx
  1933  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1934  	for {
  1935  		x, err := c.Do()
  1936  		if err != nil {
  1937  			return err
  1938  		}
  1939  		if err := f(x); err != nil {
  1940  			return err
  1941  		}
  1942  		if x.NextPageToken == "" {
  1943  			return nil
  1944  		}
  1945  		c.PageToken(x.NextPageToken)
  1946  	}
  1947  }
  1948  
  1949  // method id "cloudprivatecatalog.projects.catalogs.search":
  1950  
  1951  type ProjectsCatalogsSearchCall struct {
  1952  	s            *Service
  1953  	resource     string
  1954  	urlParams_   gensupport.URLParams
  1955  	ifNoneMatch_ string
  1956  	ctx_         context.Context
  1957  	header_      http.Header
  1958  }
  1959  
  1960  // Search: Search Catalog resources that consumers have access to,
  1961  // within the
  1962  // scope of the consumer cloud resource hierarchy context.
  1963  func (r *ProjectsCatalogsService) Search(resource string) *ProjectsCatalogsSearchCall {
  1964  	c := &ProjectsCatalogsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1965  	c.resource = resource
  1966  	return c
  1967  }
  1968  
  1969  // PageSize sets the optional parameter "pageSize": The maximum number
  1970  // of entries that are requested.
  1971  func (c *ProjectsCatalogsSearchCall) PageSize(pageSize int64) *ProjectsCatalogsSearchCall {
  1972  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1973  	return c
  1974  }
  1975  
  1976  // PageToken sets the optional parameter "pageToken": A pagination token
  1977  // returned from a previous call to SearchCatalogs that
  1978  // indicates where this listing should continue from.
  1979  // This field is optional.
  1980  func (c *ProjectsCatalogsSearchCall) PageToken(pageToken string) *ProjectsCatalogsSearchCall {
  1981  	c.urlParams_.Set("pageToken", pageToken)
  1982  	return c
  1983  }
  1984  
  1985  // Query sets the optional parameter "query": The query to filter the
  1986  // catalogs. The supported queries are:
  1987  //
  1988  // * Get a single catalog: `name=catalogs/{catalog_id}`
  1989  func (c *ProjectsCatalogsSearchCall) Query(query string) *ProjectsCatalogsSearchCall {
  1990  	c.urlParams_.Set("query", query)
  1991  	return c
  1992  }
  1993  
  1994  // Fields allows partial responses to be retrieved. See
  1995  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1996  // for more information.
  1997  func (c *ProjectsCatalogsSearchCall) Fields(s ...googleapi.Field) *ProjectsCatalogsSearchCall {
  1998  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1999  	return c
  2000  }
  2001  
  2002  // IfNoneMatch sets the optional parameter which makes the operation
  2003  // fail if the object's ETag matches the given value. This is useful for
  2004  // getting updates only after the object has changed since the last
  2005  // request. Use googleapi.IsNotModified to check whether the response
  2006  // error from Do is the result of In-None-Match.
  2007  func (c *ProjectsCatalogsSearchCall) IfNoneMatch(entityTag string) *ProjectsCatalogsSearchCall {
  2008  	c.ifNoneMatch_ = entityTag
  2009  	return c
  2010  }
  2011  
  2012  // Context sets the context to be used in this call's Do method. Any
  2013  // pending HTTP request will be aborted if the provided context is
  2014  // canceled.
  2015  func (c *ProjectsCatalogsSearchCall) Context(ctx context.Context) *ProjectsCatalogsSearchCall {
  2016  	c.ctx_ = ctx
  2017  	return c
  2018  }
  2019  
  2020  // Header returns an http.Header that can be modified by the caller to
  2021  // add HTTP headers to the request.
  2022  func (c *ProjectsCatalogsSearchCall) Header() http.Header {
  2023  	if c.header_ == nil {
  2024  		c.header_ = make(http.Header)
  2025  	}
  2026  	return c.header_
  2027  }
  2028  
  2029  func (c *ProjectsCatalogsSearchCall) doRequest(alt string) (*http.Response, error) {
  2030  	reqHeaders := make(http.Header)
  2031  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200310")
  2032  	for k, v := range c.header_ {
  2033  		reqHeaders[k] = v
  2034  	}
  2035  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2036  	if c.ifNoneMatch_ != "" {
  2037  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2038  	}
  2039  	var body io.Reader = nil
  2040  	c.urlParams_.Set("alt", alt)
  2041  	c.urlParams_.Set("prettyPrint", "false")
  2042  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}/catalogs:search")
  2043  	urls += "?" + c.urlParams_.Encode()
  2044  	req, err := http.NewRequest("GET", urls, body)
  2045  	if err != nil {
  2046  		return nil, err
  2047  	}
  2048  	req.Header = reqHeaders
  2049  	googleapi.Expand(req.URL, map[string]string{
  2050  		"resource": c.resource,
  2051  	})
  2052  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2053  }
  2054  
  2055  // Do executes the "cloudprivatecatalog.projects.catalogs.search" call.
  2056  // Exactly one of
  2057  // *GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse or error will
  2058  // be non-nil. Any non-2xx status code is an error. Response headers are
  2059  // in either
  2060  // *GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse.ServerResponse
  2061  // .Header or (if a response was returned at all) in
  2062  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2063  // whether the returned error was because http.StatusNotModified was
  2064  // returned.
  2065  func (c *ProjectsCatalogsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse, error) {
  2066  	gensupport.SetOptions(c.urlParams_, opts...)
  2067  	res, err := c.doRequest("json")
  2068  	if res != nil && res.StatusCode == http.StatusNotModified {
  2069  		if res.Body != nil {
  2070  			res.Body.Close()
  2071  		}
  2072  		return nil, &googleapi.Error{
  2073  			Code:   res.StatusCode,
  2074  			Header: res.Header,
  2075  		}
  2076  	}
  2077  	if err != nil {
  2078  		return nil, err
  2079  	}
  2080  	defer googleapi.CloseBody(res)
  2081  	if err := googleapi.CheckResponse(res); err != nil {
  2082  		return nil, err
  2083  	}
  2084  	ret := &GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse{
  2085  		ServerResponse: googleapi.ServerResponse{
  2086  			Header:         res.Header,
  2087  			HTTPStatusCode: res.StatusCode,
  2088  		},
  2089  	}
  2090  	target := &ret
  2091  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2092  		return nil, err
  2093  	}
  2094  	return ret, nil
  2095  	// {
  2096  	//   "description": "Search Catalog resources that consumers have access to, within the\nscope of the consumer cloud resource hierarchy context.",
  2097  	//   "flatPath": "v1beta1/projects/{projectsId}/catalogs:search",
  2098  	//   "httpMethod": "GET",
  2099  	//   "id": "cloudprivatecatalog.projects.catalogs.search",
  2100  	//   "parameterOrder": [
  2101  	//     "resource"
  2102  	//   ],
  2103  	//   "parameters": {
  2104  	//     "pageSize": {
  2105  	//       "description": "The maximum number of entries that are requested.",
  2106  	//       "format": "int32",
  2107  	//       "location": "query",
  2108  	//       "type": "integer"
  2109  	//     },
  2110  	//     "pageToken": {
  2111  	//       "description": "A pagination token returned from a previous call to SearchCatalogs that\nindicates where this listing should continue from.\nThis field is optional.",
  2112  	//       "location": "query",
  2113  	//       "type": "string"
  2114  	//     },
  2115  	//     "query": {
  2116  	//       "description": "The query to filter the catalogs. The supported queries are:\n\n* Get a single catalog: `name=catalogs/{catalog_id}`",
  2117  	//       "location": "query",
  2118  	//       "type": "string"
  2119  	//     },
  2120  	//     "resource": {
  2121  	//       "description": "Required. The name of the resource context. It can be in following formats:\n\n* `projects/{project_id}`\n* `folders/{folder_id}`\n* `organizations/{organization_id}`",
  2122  	//       "location": "path",
  2123  	//       "pattern": "^projects/[^/]+$",
  2124  	//       "required": true,
  2125  	//       "type": "string"
  2126  	//     }
  2127  	//   },
  2128  	//   "path": "v1beta1/{+resource}/catalogs:search",
  2129  	//   "response": {
  2130  	//     "$ref": "GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse"
  2131  	//   },
  2132  	//   "scopes": [
  2133  	//     "https://www.googleapis.com/auth/cloud-platform"
  2134  	//   ]
  2135  	// }
  2136  
  2137  }
  2138  
  2139  // Pages invokes f for each page of results.
  2140  // A non-nil error returned from f will halt the iteration.
  2141  // The provided context supersedes any context provided to the Context method.
  2142  func (c *ProjectsCatalogsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudPrivatecatalogV1beta1SearchCatalogsResponse) error) error {
  2143  	c.ctx_ = ctx
  2144  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2145  	for {
  2146  		x, err := c.Do()
  2147  		if err != nil {
  2148  			return err
  2149  		}
  2150  		if err := f(x); err != nil {
  2151  			return err
  2152  		}
  2153  		if x.NextPageToken == "" {
  2154  			return nil
  2155  		}
  2156  		c.PageToken(x.NextPageToken)
  2157  	}
  2158  }
  2159  
  2160  // method id "cloudprivatecatalog.projects.products.search":
  2161  
  2162  type ProjectsProductsSearchCall struct {
  2163  	s            *Service
  2164  	resource     string
  2165  	urlParams_   gensupport.URLParams
  2166  	ifNoneMatch_ string
  2167  	ctx_         context.Context
  2168  	header_      http.Header
  2169  }
  2170  
  2171  // Search: Search Product resources that consumers have access to,
  2172  // within the
  2173  // scope of the consumer cloud resource hierarchy context.
  2174  func (r *ProjectsProductsService) Search(resource string) *ProjectsProductsSearchCall {
  2175  	c := &ProjectsProductsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2176  	c.resource = resource
  2177  	return c
  2178  }
  2179  
  2180  // PageSize sets the optional parameter "pageSize": The maximum number
  2181  // of entries that are requested.
  2182  func (c *ProjectsProductsSearchCall) PageSize(pageSize int64) *ProjectsProductsSearchCall {
  2183  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2184  	return c
  2185  }
  2186  
  2187  // PageToken sets the optional parameter "pageToken": A pagination token
  2188  // returned from a previous call to SearchProducts that
  2189  // indicates where this listing should continue from.
  2190  // This field is optional.
  2191  func (c *ProjectsProductsSearchCall) PageToken(pageToken string) *ProjectsProductsSearchCall {
  2192  	c.urlParams_.Set("pageToken", pageToken)
  2193  	return c
  2194  }
  2195  
  2196  // Query sets the optional parameter "query": The query to filter the
  2197  // products.
  2198  //
  2199  // The supported queries are:
  2200  // * List products of all catalogs: empty
  2201  // * List products under a catalog: `parent=catalogs/{catalog_id}`
  2202  // * Get a product by
  2203  // name:
  2204  // `name=catalogs/{catalog_id}/products/{product_id}`
  2205  func (c *ProjectsProductsSearchCall) Query(query string) *ProjectsProductsSearchCall {
  2206  	c.urlParams_.Set("query", query)
  2207  	return c
  2208  }
  2209  
  2210  // Fields allows partial responses to be retrieved. See
  2211  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2212  // for more information.
  2213  func (c *ProjectsProductsSearchCall) Fields(s ...googleapi.Field) *ProjectsProductsSearchCall {
  2214  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2215  	return c
  2216  }
  2217  
  2218  // IfNoneMatch sets the optional parameter which makes the operation
  2219  // fail if the object's ETag matches the given value. This is useful for
  2220  // getting updates only after the object has changed since the last
  2221  // request. Use googleapi.IsNotModified to check whether the response
  2222  // error from Do is the result of In-None-Match.
  2223  func (c *ProjectsProductsSearchCall) IfNoneMatch(entityTag string) *ProjectsProductsSearchCall {
  2224  	c.ifNoneMatch_ = entityTag
  2225  	return c
  2226  }
  2227  
  2228  // Context sets the context to be used in this call's Do method. Any
  2229  // pending HTTP request will be aborted if the provided context is
  2230  // canceled.
  2231  func (c *ProjectsProductsSearchCall) Context(ctx context.Context) *ProjectsProductsSearchCall {
  2232  	c.ctx_ = ctx
  2233  	return c
  2234  }
  2235  
  2236  // Header returns an http.Header that can be modified by the caller to
  2237  // add HTTP headers to the request.
  2238  func (c *ProjectsProductsSearchCall) Header() http.Header {
  2239  	if c.header_ == nil {
  2240  		c.header_ = make(http.Header)
  2241  	}
  2242  	return c.header_
  2243  }
  2244  
  2245  func (c *ProjectsProductsSearchCall) doRequest(alt string) (*http.Response, error) {
  2246  	reqHeaders := make(http.Header)
  2247  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200310")
  2248  	for k, v := range c.header_ {
  2249  		reqHeaders[k] = v
  2250  	}
  2251  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2252  	if c.ifNoneMatch_ != "" {
  2253  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2254  	}
  2255  	var body io.Reader = nil
  2256  	c.urlParams_.Set("alt", alt)
  2257  	c.urlParams_.Set("prettyPrint", "false")
  2258  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}/products:search")
  2259  	urls += "?" + c.urlParams_.Encode()
  2260  	req, err := http.NewRequest("GET", urls, body)
  2261  	if err != nil {
  2262  		return nil, err
  2263  	}
  2264  	req.Header = reqHeaders
  2265  	googleapi.Expand(req.URL, map[string]string{
  2266  		"resource": c.resource,
  2267  	})
  2268  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2269  }
  2270  
  2271  // Do executes the "cloudprivatecatalog.projects.products.search" call.
  2272  // Exactly one of
  2273  // *GoogleCloudPrivatecatalogV1beta1SearchProductsResponse or error will
  2274  // be non-nil. Any non-2xx status code is an error. Response headers are
  2275  // in either
  2276  // *GoogleCloudPrivatecatalogV1beta1SearchProductsResponse.ServerResponse
  2277  // .Header or (if a response was returned at all) in
  2278  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2279  // whether the returned error was because http.StatusNotModified was
  2280  // returned.
  2281  func (c *ProjectsProductsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogV1beta1SearchProductsResponse, error) {
  2282  	gensupport.SetOptions(c.urlParams_, opts...)
  2283  	res, err := c.doRequest("json")
  2284  	if res != nil && res.StatusCode == http.StatusNotModified {
  2285  		if res.Body != nil {
  2286  			res.Body.Close()
  2287  		}
  2288  		return nil, &googleapi.Error{
  2289  			Code:   res.StatusCode,
  2290  			Header: res.Header,
  2291  		}
  2292  	}
  2293  	if err != nil {
  2294  		return nil, err
  2295  	}
  2296  	defer googleapi.CloseBody(res)
  2297  	if err := googleapi.CheckResponse(res); err != nil {
  2298  		return nil, err
  2299  	}
  2300  	ret := &GoogleCloudPrivatecatalogV1beta1SearchProductsResponse{
  2301  		ServerResponse: googleapi.ServerResponse{
  2302  			Header:         res.Header,
  2303  			HTTPStatusCode: res.StatusCode,
  2304  		},
  2305  	}
  2306  	target := &ret
  2307  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2308  		return nil, err
  2309  	}
  2310  	return ret, nil
  2311  	// {
  2312  	//   "description": "Search Product resources that consumers have access to, within the\nscope of the consumer cloud resource hierarchy context.",
  2313  	//   "flatPath": "v1beta1/projects/{projectsId}/products:search",
  2314  	//   "httpMethod": "GET",
  2315  	//   "id": "cloudprivatecatalog.projects.products.search",
  2316  	//   "parameterOrder": [
  2317  	//     "resource"
  2318  	//   ],
  2319  	//   "parameters": {
  2320  	//     "pageSize": {
  2321  	//       "description": "The maximum number of entries that are requested.",
  2322  	//       "format": "int32",
  2323  	//       "location": "query",
  2324  	//       "type": "integer"
  2325  	//     },
  2326  	//     "pageToken": {
  2327  	//       "description": "A pagination token returned from a previous call to SearchProducts that\nindicates where this listing should continue from.\nThis field is optional.",
  2328  	//       "location": "query",
  2329  	//       "type": "string"
  2330  	//     },
  2331  	//     "query": {
  2332  	//       "description": "The query to filter the products.\n\nThe supported queries are:\n* List products of all catalogs: empty\n* List products under a catalog: `parent=catalogs/{catalog_id}`\n* Get a product by name:\n`name=catalogs/{catalog_id}/products/{product_id}`",
  2333  	//       "location": "query",
  2334  	//       "type": "string"
  2335  	//     },
  2336  	//     "resource": {
  2337  	//       "description": "Required. The name of the resource context. See\nSearchCatalogsRequest.resource for details.",
  2338  	//       "location": "path",
  2339  	//       "pattern": "^projects/[^/]+$",
  2340  	//       "required": true,
  2341  	//       "type": "string"
  2342  	//     }
  2343  	//   },
  2344  	//   "path": "v1beta1/{+resource}/products:search",
  2345  	//   "response": {
  2346  	//     "$ref": "GoogleCloudPrivatecatalogV1beta1SearchProductsResponse"
  2347  	//   },
  2348  	//   "scopes": [
  2349  	//     "https://www.googleapis.com/auth/cloud-platform"
  2350  	//   ]
  2351  	// }
  2352  
  2353  }
  2354  
  2355  // Pages invokes f for each page of results.
  2356  // A non-nil error returned from f will halt the iteration.
  2357  // The provided context supersedes any context provided to the Context method.
  2358  func (c *ProjectsProductsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudPrivatecatalogV1beta1SearchProductsResponse) error) error {
  2359  	c.ctx_ = ctx
  2360  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2361  	for {
  2362  		x, err := c.Do()
  2363  		if err != nil {
  2364  			return err
  2365  		}
  2366  		if err := f(x); err != nil {
  2367  			return err
  2368  		}
  2369  		if x.NextPageToken == "" {
  2370  			return nil
  2371  		}
  2372  		c.PageToken(x.NextPageToken)
  2373  	}
  2374  }
  2375  
  2376  // method id "cloudprivatecatalog.projects.versions.search":
  2377  
  2378  type ProjectsVersionsSearchCall struct {
  2379  	s            *Service
  2380  	resource     string
  2381  	urlParams_   gensupport.URLParams
  2382  	ifNoneMatch_ string
  2383  	ctx_         context.Context
  2384  	header_      http.Header
  2385  }
  2386  
  2387  // Search: Search Version resources that consumers have access to,
  2388  // within the
  2389  // scope of the consumer cloud resource hierarchy context.
  2390  func (r *ProjectsVersionsService) Search(resource string) *ProjectsVersionsSearchCall {
  2391  	c := &ProjectsVersionsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2392  	c.resource = resource
  2393  	return c
  2394  }
  2395  
  2396  // PageSize sets the optional parameter "pageSize": The maximum number
  2397  // of entries that are requested.
  2398  func (c *ProjectsVersionsSearchCall) PageSize(pageSize int64) *ProjectsVersionsSearchCall {
  2399  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2400  	return c
  2401  }
  2402  
  2403  // PageToken sets the optional parameter "pageToken": A pagination token
  2404  // returned from a previous call to SearchVersions
  2405  // that indicates where this listing should continue from.
  2406  // This field is optional.
  2407  func (c *ProjectsVersionsSearchCall) PageToken(pageToken string) *ProjectsVersionsSearchCall {
  2408  	c.urlParams_.Set("pageToken", pageToken)
  2409  	return c
  2410  }
  2411  
  2412  // Query sets the optional parameter "query": The query to filter the
  2413  // versions. Required.
  2414  //
  2415  // The supported queries are:
  2416  // * List versions under a
  2417  // product:
  2418  // `parent=catalogs/{catalog_id}/products/{product_id}`
  2419  // * Get a version by
  2420  // name:
  2421  // `name=catalogs/{catalog_id}/products/{product_id}/versions/{vers
  2422  // ion_id}`
  2423  func (c *ProjectsVersionsSearchCall) Query(query string) *ProjectsVersionsSearchCall {
  2424  	c.urlParams_.Set("query", query)
  2425  	return c
  2426  }
  2427  
  2428  // Fields allows partial responses to be retrieved. See
  2429  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2430  // for more information.
  2431  func (c *ProjectsVersionsSearchCall) Fields(s ...googleapi.Field) *ProjectsVersionsSearchCall {
  2432  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2433  	return c
  2434  }
  2435  
  2436  // IfNoneMatch sets the optional parameter which makes the operation
  2437  // fail if the object's ETag matches the given value. This is useful for
  2438  // getting updates only after the object has changed since the last
  2439  // request. Use googleapi.IsNotModified to check whether the response
  2440  // error from Do is the result of In-None-Match.
  2441  func (c *ProjectsVersionsSearchCall) IfNoneMatch(entityTag string) *ProjectsVersionsSearchCall {
  2442  	c.ifNoneMatch_ = entityTag
  2443  	return c
  2444  }
  2445  
  2446  // Context sets the context to be used in this call's Do method. Any
  2447  // pending HTTP request will be aborted if the provided context is
  2448  // canceled.
  2449  func (c *ProjectsVersionsSearchCall) Context(ctx context.Context) *ProjectsVersionsSearchCall {
  2450  	c.ctx_ = ctx
  2451  	return c
  2452  }
  2453  
  2454  // Header returns an http.Header that can be modified by the caller to
  2455  // add HTTP headers to the request.
  2456  func (c *ProjectsVersionsSearchCall) Header() http.Header {
  2457  	if c.header_ == nil {
  2458  		c.header_ = make(http.Header)
  2459  	}
  2460  	return c.header_
  2461  }
  2462  
  2463  func (c *ProjectsVersionsSearchCall) doRequest(alt string) (*http.Response, error) {
  2464  	reqHeaders := make(http.Header)
  2465  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200310")
  2466  	for k, v := range c.header_ {
  2467  		reqHeaders[k] = v
  2468  	}
  2469  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2470  	if c.ifNoneMatch_ != "" {
  2471  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2472  	}
  2473  	var body io.Reader = nil
  2474  	c.urlParams_.Set("alt", alt)
  2475  	c.urlParams_.Set("prettyPrint", "false")
  2476  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}/versions:search")
  2477  	urls += "?" + c.urlParams_.Encode()
  2478  	req, err := http.NewRequest("GET", urls, body)
  2479  	if err != nil {
  2480  		return nil, err
  2481  	}
  2482  	req.Header = reqHeaders
  2483  	googleapi.Expand(req.URL, map[string]string{
  2484  		"resource": c.resource,
  2485  	})
  2486  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2487  }
  2488  
  2489  // Do executes the "cloudprivatecatalog.projects.versions.search" call.
  2490  // Exactly one of
  2491  // *GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse or error will
  2492  // be non-nil. Any non-2xx status code is an error. Response headers are
  2493  // in either
  2494  // *GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse.ServerResponse
  2495  // .Header or (if a response was returned at all) in
  2496  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2497  // whether the returned error was because http.StatusNotModified was
  2498  // returned.
  2499  func (c *ProjectsVersionsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse, error) {
  2500  	gensupport.SetOptions(c.urlParams_, opts...)
  2501  	res, err := c.doRequest("json")
  2502  	if res != nil && res.StatusCode == http.StatusNotModified {
  2503  		if res.Body != nil {
  2504  			res.Body.Close()
  2505  		}
  2506  		return nil, &googleapi.Error{
  2507  			Code:   res.StatusCode,
  2508  			Header: res.Header,
  2509  		}
  2510  	}
  2511  	if err != nil {
  2512  		return nil, err
  2513  	}
  2514  	defer googleapi.CloseBody(res)
  2515  	if err := googleapi.CheckResponse(res); err != nil {
  2516  		return nil, err
  2517  	}
  2518  	ret := &GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse{
  2519  		ServerResponse: googleapi.ServerResponse{
  2520  			Header:         res.Header,
  2521  			HTTPStatusCode: res.StatusCode,
  2522  		},
  2523  	}
  2524  	target := &ret
  2525  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2526  		return nil, err
  2527  	}
  2528  	return ret, nil
  2529  	// {
  2530  	//   "description": "Search Version resources that consumers have access to, within the\nscope of the consumer cloud resource hierarchy context.",
  2531  	//   "flatPath": "v1beta1/projects/{projectsId}/versions:search",
  2532  	//   "httpMethod": "GET",
  2533  	//   "id": "cloudprivatecatalog.projects.versions.search",
  2534  	//   "parameterOrder": [
  2535  	//     "resource"
  2536  	//   ],
  2537  	//   "parameters": {
  2538  	//     "pageSize": {
  2539  	//       "description": "The maximum number of entries that are requested.",
  2540  	//       "format": "int32",
  2541  	//       "location": "query",
  2542  	//       "type": "integer"
  2543  	//     },
  2544  	//     "pageToken": {
  2545  	//       "description": "A pagination token returned from a previous call to SearchVersions\nthat indicates where this listing should continue from.\nThis field is optional.",
  2546  	//       "location": "query",
  2547  	//       "type": "string"
  2548  	//     },
  2549  	//     "query": {
  2550  	//       "description": "The query to filter the versions. Required.\n\nThe supported queries are:\n* List versions under a product:\n`parent=catalogs/{catalog_id}/products/{product_id}`\n* Get a version by name:\n`name=catalogs/{catalog_id}/products/{product_id}/versions/{version_id}`",
  2551  	//       "location": "query",
  2552  	//       "type": "string"
  2553  	//     },
  2554  	//     "resource": {
  2555  	//       "description": "Required. The name of the resource context. See\nSearchCatalogsRequest.resource for details.",
  2556  	//       "location": "path",
  2557  	//       "pattern": "^projects/[^/]+$",
  2558  	//       "required": true,
  2559  	//       "type": "string"
  2560  	//     }
  2561  	//   },
  2562  	//   "path": "v1beta1/{+resource}/versions:search",
  2563  	//   "response": {
  2564  	//     "$ref": "GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse"
  2565  	//   },
  2566  	//   "scopes": [
  2567  	//     "https://www.googleapis.com/auth/cloud-platform"
  2568  	//   ]
  2569  	// }
  2570  
  2571  }
  2572  
  2573  // Pages invokes f for each page of results.
  2574  // A non-nil error returned from f will halt the iteration.
  2575  // The provided context supersedes any context provided to the Context method.
  2576  func (c *ProjectsVersionsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudPrivatecatalogV1beta1SearchVersionsResponse) error) error {
  2577  	c.ctx_ = ctx
  2578  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2579  	for {
  2580  		x, err := c.Do()
  2581  		if err != nil {
  2582  			return err
  2583  		}
  2584  		if err := f(x); err != nil {
  2585  			return err
  2586  		}
  2587  		if x.NextPageToken == "" {
  2588  			return nil
  2589  		}
  2590  		c.PageToken(x.NextPageToken)
  2591  	}
  2592  }
  2593  

View as plain text