...

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

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

     1  // Copyright 2024 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package recommender provides access to the Recommender API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/recommender/docs/
    10  //
    11  // # Library status
    12  //
    13  // These client libraries are officially supported by Google. However, this
    14  // library is considered complete and is in maintenance mode. This means
    15  // that we will address critical bugs and security issues but will not add
    16  // any new features.
    17  //
    18  // When possible, we recommend using our newer
    19  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    20  // that are still actively being worked and iterated on.
    21  //
    22  // # Creating a client
    23  //
    24  // Usage example:
    25  //
    26  //	import "google.golang.org/api/recommender/v1beta1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	recommenderService, err := recommender.NewService(ctx)
    30  //
    31  // In this example, Google Application Default Credentials are used for
    32  // authentication. For information on how to create and obtain Application
    33  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    34  //
    35  // # Other authentication options
    36  //
    37  // To use an API key for authentication (note: some APIs do not support API
    38  // keys), use [google.golang.org/api/option.WithAPIKey]:
    39  //
    40  //	recommenderService, err := recommender.NewService(ctx, option.WithAPIKey("AIza..."))
    41  //
    42  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    43  // flow, use [google.golang.org/api/option.WithTokenSource]:
    44  //
    45  //	config := &oauth2.Config{...}
    46  //	// ...
    47  //	token, err := config.Exchange(ctx, ...)
    48  //	recommenderService, err := recommender.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package recommender // import "google.golang.org/api/recommender/v1beta1"
    52  
    53  import (
    54  	"bytes"
    55  	"context"
    56  	"encoding/json"
    57  	"errors"
    58  	"fmt"
    59  	"io"
    60  	"net/http"
    61  	"net/url"
    62  	"strconv"
    63  	"strings"
    64  
    65  	googleapi "google.golang.org/api/googleapi"
    66  	internal "google.golang.org/api/internal"
    67  	gensupport "google.golang.org/api/internal/gensupport"
    68  	option "google.golang.org/api/option"
    69  	internaloption "google.golang.org/api/option/internaloption"
    70  	htransport "google.golang.org/api/transport/http"
    71  )
    72  
    73  // Always reference these packages, just in case the auto-generated code
    74  // below doesn't.
    75  var _ = bytes.NewBuffer
    76  var _ = strconv.Itoa
    77  var _ = fmt.Sprintf
    78  var _ = json.NewDecoder
    79  var _ = io.Copy
    80  var _ = url.Parse
    81  var _ = gensupport.MarshalJSON
    82  var _ = googleapi.Version
    83  var _ = errors.New
    84  var _ = strings.Replace
    85  var _ = context.Canceled
    86  var _ = internaloption.WithDefaultEndpoint
    87  var _ = internal.Version
    88  
    89  const apiId = "recommender:v1beta1"
    90  const apiName = "recommender"
    91  const apiVersion = "v1beta1"
    92  const basePath = "https://recommender.googleapis.com/"
    93  const basePathTemplate = "https://recommender.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://recommender.mtls.googleapis.com/"
    95  
    96  // OAuth2 scopes used by this API.
    97  const (
    98  	// See, edit, configure, and delete your Google Cloud data and see the email
    99  	// address for your Google Account.
   100  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
   101  )
   102  
   103  // NewService creates a new Service.
   104  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   105  	scopesOption := internaloption.WithDefaultScopes(
   106  		"https://www.googleapis.com/auth/cloud-platform",
   107  	)
   108  	// NOTE: prepend, so we don't override user-specified scopes.
   109  	opts = append([]option.ClientOption{scopesOption}, opts...)
   110  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   111  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   112  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   113  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   114  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   115  	if err != nil {
   116  		return nil, err
   117  	}
   118  	s, err := New(client)
   119  	if err != nil {
   120  		return nil, err
   121  	}
   122  	if endpoint != "" {
   123  		s.BasePath = endpoint
   124  	}
   125  	return s, nil
   126  }
   127  
   128  // New creates a new Service. It uses the provided http.Client for requests.
   129  //
   130  // Deprecated: please use NewService instead.
   131  // To provide a custom HTTP client, use option.WithHTTPClient.
   132  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   133  func New(client *http.Client) (*Service, error) {
   134  	if client == nil {
   135  		return nil, errors.New("client is nil")
   136  	}
   137  	s := &Service{client: client, BasePath: basePath}
   138  	s.BillingAccounts = NewBillingAccountsService(s)
   139  	s.Folders = NewFoldersService(s)
   140  	s.InsightTypes = NewInsightTypesService(s)
   141  	s.Organizations = NewOrganizationsService(s)
   142  	s.Projects = NewProjectsService(s)
   143  	s.Recommenders = NewRecommendersService(s)
   144  	return s, nil
   145  }
   146  
   147  type Service struct {
   148  	client    *http.Client
   149  	BasePath  string // API endpoint base URL
   150  	UserAgent string // optional additional User-Agent fragment
   151  
   152  	BillingAccounts *BillingAccountsService
   153  
   154  	Folders *FoldersService
   155  
   156  	InsightTypes *InsightTypesService
   157  
   158  	Organizations *OrganizationsService
   159  
   160  	Projects *ProjectsService
   161  
   162  	Recommenders *RecommendersService
   163  }
   164  
   165  func (s *Service) userAgent() string {
   166  	if s.UserAgent == "" {
   167  		return googleapi.UserAgent
   168  	}
   169  	return googleapi.UserAgent + " " + s.UserAgent
   170  }
   171  
   172  func NewBillingAccountsService(s *Service) *BillingAccountsService {
   173  	rs := &BillingAccountsService{s: s}
   174  	rs.Locations = NewBillingAccountsLocationsService(s)
   175  	return rs
   176  }
   177  
   178  type BillingAccountsService struct {
   179  	s *Service
   180  
   181  	Locations *BillingAccountsLocationsService
   182  }
   183  
   184  func NewBillingAccountsLocationsService(s *Service) *BillingAccountsLocationsService {
   185  	rs := &BillingAccountsLocationsService{s: s}
   186  	rs.InsightTypes = NewBillingAccountsLocationsInsightTypesService(s)
   187  	rs.Recommenders = NewBillingAccountsLocationsRecommendersService(s)
   188  	return rs
   189  }
   190  
   191  type BillingAccountsLocationsService struct {
   192  	s *Service
   193  
   194  	InsightTypes *BillingAccountsLocationsInsightTypesService
   195  
   196  	Recommenders *BillingAccountsLocationsRecommendersService
   197  }
   198  
   199  func NewBillingAccountsLocationsInsightTypesService(s *Service) *BillingAccountsLocationsInsightTypesService {
   200  	rs := &BillingAccountsLocationsInsightTypesService{s: s}
   201  	rs.Insights = NewBillingAccountsLocationsInsightTypesInsightsService(s)
   202  	return rs
   203  }
   204  
   205  type BillingAccountsLocationsInsightTypesService struct {
   206  	s *Service
   207  
   208  	Insights *BillingAccountsLocationsInsightTypesInsightsService
   209  }
   210  
   211  func NewBillingAccountsLocationsInsightTypesInsightsService(s *Service) *BillingAccountsLocationsInsightTypesInsightsService {
   212  	rs := &BillingAccountsLocationsInsightTypesInsightsService{s: s}
   213  	return rs
   214  }
   215  
   216  type BillingAccountsLocationsInsightTypesInsightsService struct {
   217  	s *Service
   218  }
   219  
   220  func NewBillingAccountsLocationsRecommendersService(s *Service) *BillingAccountsLocationsRecommendersService {
   221  	rs := &BillingAccountsLocationsRecommendersService{s: s}
   222  	rs.Recommendations = NewBillingAccountsLocationsRecommendersRecommendationsService(s)
   223  	return rs
   224  }
   225  
   226  type BillingAccountsLocationsRecommendersService struct {
   227  	s *Service
   228  
   229  	Recommendations *BillingAccountsLocationsRecommendersRecommendationsService
   230  }
   231  
   232  func NewBillingAccountsLocationsRecommendersRecommendationsService(s *Service) *BillingAccountsLocationsRecommendersRecommendationsService {
   233  	rs := &BillingAccountsLocationsRecommendersRecommendationsService{s: s}
   234  	return rs
   235  }
   236  
   237  type BillingAccountsLocationsRecommendersRecommendationsService struct {
   238  	s *Service
   239  }
   240  
   241  func NewFoldersService(s *Service) *FoldersService {
   242  	rs := &FoldersService{s: s}
   243  	rs.Locations = NewFoldersLocationsService(s)
   244  	return rs
   245  }
   246  
   247  type FoldersService struct {
   248  	s *Service
   249  
   250  	Locations *FoldersLocationsService
   251  }
   252  
   253  func NewFoldersLocationsService(s *Service) *FoldersLocationsService {
   254  	rs := &FoldersLocationsService{s: s}
   255  	rs.InsightTypes = NewFoldersLocationsInsightTypesService(s)
   256  	rs.Recommenders = NewFoldersLocationsRecommendersService(s)
   257  	return rs
   258  }
   259  
   260  type FoldersLocationsService struct {
   261  	s *Service
   262  
   263  	InsightTypes *FoldersLocationsInsightTypesService
   264  
   265  	Recommenders *FoldersLocationsRecommendersService
   266  }
   267  
   268  func NewFoldersLocationsInsightTypesService(s *Service) *FoldersLocationsInsightTypesService {
   269  	rs := &FoldersLocationsInsightTypesService{s: s}
   270  	rs.Insights = NewFoldersLocationsInsightTypesInsightsService(s)
   271  	return rs
   272  }
   273  
   274  type FoldersLocationsInsightTypesService struct {
   275  	s *Service
   276  
   277  	Insights *FoldersLocationsInsightTypesInsightsService
   278  }
   279  
   280  func NewFoldersLocationsInsightTypesInsightsService(s *Service) *FoldersLocationsInsightTypesInsightsService {
   281  	rs := &FoldersLocationsInsightTypesInsightsService{s: s}
   282  	return rs
   283  }
   284  
   285  type FoldersLocationsInsightTypesInsightsService struct {
   286  	s *Service
   287  }
   288  
   289  func NewFoldersLocationsRecommendersService(s *Service) *FoldersLocationsRecommendersService {
   290  	rs := &FoldersLocationsRecommendersService{s: s}
   291  	rs.Recommendations = NewFoldersLocationsRecommendersRecommendationsService(s)
   292  	return rs
   293  }
   294  
   295  type FoldersLocationsRecommendersService struct {
   296  	s *Service
   297  
   298  	Recommendations *FoldersLocationsRecommendersRecommendationsService
   299  }
   300  
   301  func NewFoldersLocationsRecommendersRecommendationsService(s *Service) *FoldersLocationsRecommendersRecommendationsService {
   302  	rs := &FoldersLocationsRecommendersRecommendationsService{s: s}
   303  	return rs
   304  }
   305  
   306  type FoldersLocationsRecommendersRecommendationsService struct {
   307  	s *Service
   308  }
   309  
   310  func NewInsightTypesService(s *Service) *InsightTypesService {
   311  	rs := &InsightTypesService{s: s}
   312  	return rs
   313  }
   314  
   315  type InsightTypesService struct {
   316  	s *Service
   317  }
   318  
   319  func NewOrganizationsService(s *Service) *OrganizationsService {
   320  	rs := &OrganizationsService{s: s}
   321  	rs.Locations = NewOrganizationsLocationsService(s)
   322  	return rs
   323  }
   324  
   325  type OrganizationsService struct {
   326  	s *Service
   327  
   328  	Locations *OrganizationsLocationsService
   329  }
   330  
   331  func NewOrganizationsLocationsService(s *Service) *OrganizationsLocationsService {
   332  	rs := &OrganizationsLocationsService{s: s}
   333  	rs.InsightTypes = NewOrganizationsLocationsInsightTypesService(s)
   334  	rs.Recommenders = NewOrganizationsLocationsRecommendersService(s)
   335  	return rs
   336  }
   337  
   338  type OrganizationsLocationsService struct {
   339  	s *Service
   340  
   341  	InsightTypes *OrganizationsLocationsInsightTypesService
   342  
   343  	Recommenders *OrganizationsLocationsRecommendersService
   344  }
   345  
   346  func NewOrganizationsLocationsInsightTypesService(s *Service) *OrganizationsLocationsInsightTypesService {
   347  	rs := &OrganizationsLocationsInsightTypesService{s: s}
   348  	rs.Insights = NewOrganizationsLocationsInsightTypesInsightsService(s)
   349  	return rs
   350  }
   351  
   352  type OrganizationsLocationsInsightTypesService struct {
   353  	s *Service
   354  
   355  	Insights *OrganizationsLocationsInsightTypesInsightsService
   356  }
   357  
   358  func NewOrganizationsLocationsInsightTypesInsightsService(s *Service) *OrganizationsLocationsInsightTypesInsightsService {
   359  	rs := &OrganizationsLocationsInsightTypesInsightsService{s: s}
   360  	return rs
   361  }
   362  
   363  type OrganizationsLocationsInsightTypesInsightsService struct {
   364  	s *Service
   365  }
   366  
   367  func NewOrganizationsLocationsRecommendersService(s *Service) *OrganizationsLocationsRecommendersService {
   368  	rs := &OrganizationsLocationsRecommendersService{s: s}
   369  	rs.Recommendations = NewOrganizationsLocationsRecommendersRecommendationsService(s)
   370  	return rs
   371  }
   372  
   373  type OrganizationsLocationsRecommendersService struct {
   374  	s *Service
   375  
   376  	Recommendations *OrganizationsLocationsRecommendersRecommendationsService
   377  }
   378  
   379  func NewOrganizationsLocationsRecommendersRecommendationsService(s *Service) *OrganizationsLocationsRecommendersRecommendationsService {
   380  	rs := &OrganizationsLocationsRecommendersRecommendationsService{s: s}
   381  	return rs
   382  }
   383  
   384  type OrganizationsLocationsRecommendersRecommendationsService struct {
   385  	s *Service
   386  }
   387  
   388  func NewProjectsService(s *Service) *ProjectsService {
   389  	rs := &ProjectsService{s: s}
   390  	rs.Locations = NewProjectsLocationsService(s)
   391  	return rs
   392  }
   393  
   394  type ProjectsService struct {
   395  	s *Service
   396  
   397  	Locations *ProjectsLocationsService
   398  }
   399  
   400  func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
   401  	rs := &ProjectsLocationsService{s: s}
   402  	rs.InsightTypes = NewProjectsLocationsInsightTypesService(s)
   403  	rs.Recommenders = NewProjectsLocationsRecommendersService(s)
   404  	return rs
   405  }
   406  
   407  type ProjectsLocationsService struct {
   408  	s *Service
   409  
   410  	InsightTypes *ProjectsLocationsInsightTypesService
   411  
   412  	Recommenders *ProjectsLocationsRecommendersService
   413  }
   414  
   415  func NewProjectsLocationsInsightTypesService(s *Service) *ProjectsLocationsInsightTypesService {
   416  	rs := &ProjectsLocationsInsightTypesService{s: s}
   417  	rs.Insights = NewProjectsLocationsInsightTypesInsightsService(s)
   418  	return rs
   419  }
   420  
   421  type ProjectsLocationsInsightTypesService struct {
   422  	s *Service
   423  
   424  	Insights *ProjectsLocationsInsightTypesInsightsService
   425  }
   426  
   427  func NewProjectsLocationsInsightTypesInsightsService(s *Service) *ProjectsLocationsInsightTypesInsightsService {
   428  	rs := &ProjectsLocationsInsightTypesInsightsService{s: s}
   429  	return rs
   430  }
   431  
   432  type ProjectsLocationsInsightTypesInsightsService struct {
   433  	s *Service
   434  }
   435  
   436  func NewProjectsLocationsRecommendersService(s *Service) *ProjectsLocationsRecommendersService {
   437  	rs := &ProjectsLocationsRecommendersService{s: s}
   438  	rs.Recommendations = NewProjectsLocationsRecommendersRecommendationsService(s)
   439  	return rs
   440  }
   441  
   442  type ProjectsLocationsRecommendersService struct {
   443  	s *Service
   444  
   445  	Recommendations *ProjectsLocationsRecommendersRecommendationsService
   446  }
   447  
   448  func NewProjectsLocationsRecommendersRecommendationsService(s *Service) *ProjectsLocationsRecommendersRecommendationsService {
   449  	rs := &ProjectsLocationsRecommendersRecommendationsService{s: s}
   450  	return rs
   451  }
   452  
   453  type ProjectsLocationsRecommendersRecommendationsService struct {
   454  	s *Service
   455  }
   456  
   457  func NewRecommendersService(s *Service) *RecommendersService {
   458  	rs := &RecommendersService{s: s}
   459  	return rs
   460  }
   461  
   462  type RecommendersService struct {
   463  	s *Service
   464  }
   465  
   466  // GoogleCloudLocationListLocationsResponse: The response message for
   467  // Locations.ListLocations.
   468  type GoogleCloudLocationListLocationsResponse struct {
   469  	// Locations: A list of locations that matches the specified filter in the
   470  	// request.
   471  	Locations []*GoogleCloudLocationLocation `json:"locations,omitempty"`
   472  	// NextPageToken: The standard List next-page token.
   473  	NextPageToken string `json:"nextPageToken,omitempty"`
   474  
   475  	// ServerResponse contains the HTTP response code and headers from the server.
   476  	googleapi.ServerResponse `json:"-"`
   477  	// ForceSendFields is a list of field names (e.g. "Locations") to
   478  	// unconditionally include in API requests. By default, fields with empty or
   479  	// default values are omitted from API requests. See
   480  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   481  	// details.
   482  	ForceSendFields []string `json:"-"`
   483  	// NullFields is a list of field names (e.g. "Locations") to include in API
   484  	// requests with the JSON null value. By default, fields with empty values are
   485  	// omitted from API requests. See
   486  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   487  	NullFields []string `json:"-"`
   488  }
   489  
   490  func (s *GoogleCloudLocationListLocationsResponse) MarshalJSON() ([]byte, error) {
   491  	type NoMethod GoogleCloudLocationListLocationsResponse
   492  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   493  }
   494  
   495  // GoogleCloudLocationLocation: A resource that represents a Google Cloud
   496  // location.
   497  type GoogleCloudLocationLocation struct {
   498  	// DisplayName: The friendly name for this location, typically a nearby city
   499  	// name. For example, "Tokyo".
   500  	DisplayName string `json:"displayName,omitempty"`
   501  	// Labels: Cross-service attributes for the location. For example
   502  	// {"cloud.googleapis.com/region": "us-east1"}
   503  	Labels map[string]string `json:"labels,omitempty"`
   504  	// LocationId: The canonical id for this location. For example: "us-east1".
   505  	LocationId string `json:"locationId,omitempty"`
   506  	// Metadata: Service-specific metadata. For example the available capacity at
   507  	// the given location.
   508  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   509  	// Name: Resource name for the location, which may vary between
   510  	// implementations. For example:
   511  	// "projects/example-project/locations/us-east1"
   512  	Name string `json:"name,omitempty"`
   513  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
   514  	// unconditionally include in API requests. By default, fields with empty or
   515  	// default values are omitted from API requests. See
   516  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   517  	// details.
   518  	ForceSendFields []string `json:"-"`
   519  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
   520  	// requests with the JSON null value. By default, fields with empty values are
   521  	// omitted from API requests. See
   522  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   523  	NullFields []string `json:"-"`
   524  }
   525  
   526  func (s *GoogleCloudLocationLocation) MarshalJSON() ([]byte, error) {
   527  	type NoMethod GoogleCloudLocationLocation
   528  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   529  }
   530  
   531  // GoogleCloudRecommenderV1beta1CostProjection: Contains metadata about how
   532  // much money a recommendation can save or incur.
   533  type GoogleCloudRecommenderV1beta1CostProjection struct {
   534  	// Cost: An approximate projection on amount saved or amount incurred. Negative
   535  	// cost units indicate cost savings and positive cost units indicate increase.
   536  	// See google.type.Money documentation for positive/negative units. A user's
   537  	// permissions may affect whether the cost is computed using list prices or
   538  	// custom contract prices.
   539  	Cost *GoogleTypeMoney `json:"cost,omitempty"`
   540  	// CostInLocalCurrency: The approximate cost savings in the billing account's
   541  	// local currency.
   542  	CostInLocalCurrency *GoogleTypeMoney `json:"costInLocalCurrency,omitempty"`
   543  	// Duration: Duration for which this cost applies.
   544  	Duration string `json:"duration,omitempty"`
   545  	// PricingType: How the cost is calculated.
   546  	//
   547  	// Possible values:
   548  	//   "PRICING_TYPE_UNSPECIFIED" - Default pricing type.
   549  	//   "LIST_PRICE" - The price listed by GCP for all customers.
   550  	//   "CUSTOM_PRICE" - A price derived from past usage and billing.
   551  	PricingType string `json:"pricingType,omitempty"`
   552  	// ForceSendFields is a list of field names (e.g. "Cost") to unconditionally
   553  	// include in API requests. By default, fields with empty or default values are
   554  	// omitted from API requests. See
   555  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   556  	// details.
   557  	ForceSendFields []string `json:"-"`
   558  	// NullFields is a list of field names (e.g. "Cost") to include in API requests
   559  	// with the JSON null value. By default, fields with empty values are omitted
   560  	// from API requests. See
   561  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   562  	NullFields []string `json:"-"`
   563  }
   564  
   565  func (s *GoogleCloudRecommenderV1beta1CostProjection) MarshalJSON() ([]byte, error) {
   566  	type NoMethod GoogleCloudRecommenderV1beta1CostProjection
   567  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   568  }
   569  
   570  // GoogleCloudRecommenderV1beta1Impact: Contains the impact a recommendation
   571  // can have for a given category.
   572  type GoogleCloudRecommenderV1beta1Impact struct {
   573  	// Category: Category that is being targeted.
   574  	//
   575  	// Possible values:
   576  	//   "CATEGORY_UNSPECIFIED" - Default unspecified category. Don't use directly.
   577  	//   "COST" - Indicates a potential increase or decrease in cost.
   578  	//   "SECURITY" - Indicates a potential increase or decrease in security.
   579  	//   "PERFORMANCE" - Indicates a potential increase or decrease in performance.
   580  	//   "MANAGEABILITY" - Indicates a potential increase or decrease in
   581  	// manageability.
   582  	//   "SUSTAINABILITY" - Indicates a potential increase or decrease in
   583  	// sustainability.
   584  	//   "RELIABILITY" - Indicates a potential increase or decrease in reliability.
   585  	Category string `json:"category,omitempty"`
   586  	// CostProjection: Use with CategoryType.COST
   587  	CostProjection *GoogleCloudRecommenderV1beta1CostProjection `json:"costProjection,omitempty"`
   588  	// ReliabilityProjection: Use with CategoryType.RELIABILITY
   589  	ReliabilityProjection *GoogleCloudRecommenderV1beta1ReliabilityProjection `json:"reliabilityProjection,omitempty"`
   590  	// SecurityProjection: Use with CategoryType.SECURITY
   591  	SecurityProjection *GoogleCloudRecommenderV1beta1SecurityProjection `json:"securityProjection,omitempty"`
   592  	// SustainabilityProjection: Use with CategoryType.SUSTAINABILITY
   593  	SustainabilityProjection *GoogleCloudRecommenderV1beta1SustainabilityProjection `json:"sustainabilityProjection,omitempty"`
   594  	// ForceSendFields is a list of field names (e.g. "Category") to
   595  	// unconditionally include in API requests. By default, fields with empty or
   596  	// default values are omitted from API requests. See
   597  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   598  	// details.
   599  	ForceSendFields []string `json:"-"`
   600  	// NullFields is a list of field names (e.g. "Category") to include in API
   601  	// requests with the JSON null value. By default, fields with empty values are
   602  	// omitted from API requests. See
   603  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   604  	NullFields []string `json:"-"`
   605  }
   606  
   607  func (s *GoogleCloudRecommenderV1beta1Impact) MarshalJSON() ([]byte, error) {
   608  	type NoMethod GoogleCloudRecommenderV1beta1Impact
   609  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   610  }
   611  
   612  // GoogleCloudRecommenderV1beta1Insight: An insight along with the information
   613  // used to derive the insight. The insight may have associated recommendations
   614  // as well.
   615  type GoogleCloudRecommenderV1beta1Insight struct {
   616  	// AssociatedRecommendations: Recommendations derived from this insight.
   617  	AssociatedRecommendations []*GoogleCloudRecommenderV1beta1InsightRecommendationReference `json:"associatedRecommendations,omitempty"`
   618  	// Category: Category being targeted by the insight.
   619  	//
   620  	// Possible values:
   621  	//   "CATEGORY_UNSPECIFIED" - Unspecified category.
   622  	//   "COST" - The insight is related to cost.
   623  	//   "SECURITY" - The insight is related to security.
   624  	//   "PERFORMANCE" - The insight is related to performance.
   625  	//   "MANAGEABILITY" - This insight is related to manageability.
   626  	//   "SUSTAINABILITY" - The insight is related to sustainability.
   627  	//   "RELIABILITY" - The insight is related to reliability.
   628  	Category string `json:"category,omitempty"`
   629  	// Content: A struct of custom fields to explain the insight. Example:
   630  	// "grantedPermissionsCount": "1000"
   631  	Content googleapi.RawMessage `json:"content,omitempty"`
   632  	// Description: Free-form human readable summary in English. The maximum length
   633  	// is 500 characters.
   634  	Description string `json:"description,omitempty"`
   635  	// Etag: Fingerprint of the Insight. Provides optimistic locking when updating
   636  	// states.
   637  	Etag string `json:"etag,omitempty"`
   638  	// InsightSubtype: Insight subtype. Insight content schema will be stable for a
   639  	// given subtype.
   640  	InsightSubtype string `json:"insightSubtype,omitempty"`
   641  	// LastRefreshTime: Timestamp of the latest data used to generate the insight.
   642  	LastRefreshTime string `json:"lastRefreshTime,omitempty"`
   643  	// Name: Identifier. Name of the insight.
   644  	Name string `json:"name,omitempty"`
   645  	// ObservationPeriod: Observation period that led to the insight. The source
   646  	// data used to generate the insight ends at last_refresh_time and begins at
   647  	// (last_refresh_time - observation_period).
   648  	ObservationPeriod string `json:"observationPeriod,omitempty"`
   649  	// Severity: Insight's severity.
   650  	//
   651  	// Possible values:
   652  	//   "SEVERITY_UNSPECIFIED" - Insight has unspecified severity.
   653  	//   "LOW" - Insight has low severity.
   654  	//   "MEDIUM" - Insight has medium severity.
   655  	//   "HIGH" - Insight has high severity.
   656  	//   "CRITICAL" - Insight has critical severity.
   657  	Severity string `json:"severity,omitempty"`
   658  	// StateInfo: Information state and metadata.
   659  	StateInfo *GoogleCloudRecommenderV1beta1InsightStateInfo `json:"stateInfo,omitempty"`
   660  	// TargetResources: Fully qualified resource names that this insight is
   661  	// targeting.
   662  	TargetResources []string `json:"targetResources,omitempty"`
   663  
   664  	// ServerResponse contains the HTTP response code and headers from the server.
   665  	googleapi.ServerResponse `json:"-"`
   666  	// ForceSendFields is a list of field names (e.g. "AssociatedRecommendations")
   667  	// to unconditionally include in API requests. By default, fields with empty or
   668  	// default values are omitted from API requests. See
   669  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   670  	// details.
   671  	ForceSendFields []string `json:"-"`
   672  	// NullFields is a list of field names (e.g. "AssociatedRecommendations") to
   673  	// include in API requests with the JSON null value. By default, fields with
   674  	// empty values are omitted from API requests. See
   675  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   676  	NullFields []string `json:"-"`
   677  }
   678  
   679  func (s *GoogleCloudRecommenderV1beta1Insight) MarshalJSON() ([]byte, error) {
   680  	type NoMethod GoogleCloudRecommenderV1beta1Insight
   681  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   682  }
   683  
   684  // GoogleCloudRecommenderV1beta1InsightRecommendationReference: Reference to an
   685  // associated recommendation.
   686  type GoogleCloudRecommenderV1beta1InsightRecommendationReference struct {
   687  	// Recommendation: Recommendation resource name, e.g.
   688  	// projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/
   689  	// recommendations/[RECOMMENDATION_ID]
   690  	Recommendation string `json:"recommendation,omitempty"`
   691  	// ForceSendFields is a list of field names (e.g. "Recommendation") to
   692  	// unconditionally include in API requests. By default, fields with empty or
   693  	// default values are omitted from API requests. See
   694  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   695  	// details.
   696  	ForceSendFields []string `json:"-"`
   697  	// NullFields is a list of field names (e.g. "Recommendation") to include in
   698  	// API requests with the JSON null value. By default, fields with empty values
   699  	// are omitted from API requests. See
   700  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   701  	NullFields []string `json:"-"`
   702  }
   703  
   704  func (s *GoogleCloudRecommenderV1beta1InsightRecommendationReference) MarshalJSON() ([]byte, error) {
   705  	type NoMethod GoogleCloudRecommenderV1beta1InsightRecommendationReference
   706  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   707  }
   708  
   709  // GoogleCloudRecommenderV1beta1InsightStateInfo: Information related to
   710  // insight state.
   711  type GoogleCloudRecommenderV1beta1InsightStateInfo struct {
   712  	// State: Insight state.
   713  	//
   714  	// Possible values:
   715  	//   "STATE_UNSPECIFIED" - Unspecified state.
   716  	//   "ACTIVE" - Insight is active. Content for ACTIVE insights can be updated
   717  	// by Google. ACTIVE insights can be marked DISMISSED OR ACCEPTED.
   718  	//   "ACCEPTED" - Some action has been taken based on this insight. Insights
   719  	// become accepted when a recommendation derived from the insight has been
   720  	// marked CLAIMED, SUCCEEDED, or FAILED. ACTIVE insights can also be marked
   721  	// ACCEPTED explicitly. Content for ACCEPTED insights is immutable. ACCEPTED
   722  	// insights can only be marked ACCEPTED (which may update state metadata).
   723  	//   "DISMISSED" - Insight is dismissed. Content for DISMISSED insights can be
   724  	// updated by Google. DISMISSED insights can be marked as ACTIVE.
   725  	State string `json:"state,omitempty"`
   726  	// StateMetadata: A map of metadata for the state, provided by user or
   727  	// automations systems.
   728  	StateMetadata map[string]string `json:"stateMetadata,omitempty"`
   729  	// ForceSendFields is a list of field names (e.g. "State") to unconditionally
   730  	// include in API requests. By default, fields with empty or default values are
   731  	// omitted from API requests. See
   732  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   733  	// details.
   734  	ForceSendFields []string `json:"-"`
   735  	// NullFields is a list of field names (e.g. "State") to include in API
   736  	// requests with the JSON null value. By default, fields with empty values are
   737  	// omitted from API requests. See
   738  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   739  	NullFields []string `json:"-"`
   740  }
   741  
   742  func (s *GoogleCloudRecommenderV1beta1InsightStateInfo) MarshalJSON() ([]byte, error) {
   743  	type NoMethod GoogleCloudRecommenderV1beta1InsightStateInfo
   744  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   745  }
   746  
   747  // GoogleCloudRecommenderV1beta1InsightType: The type of insight.
   748  type GoogleCloudRecommenderV1beta1InsightType struct {
   749  	// Name: The insight_type's name in format insightTypes/{insight_type} eg:
   750  	// insightTypes/google.iam.policy.Insight
   751  	Name string `json:"name,omitempty"`
   752  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
   753  	// include in API requests. By default, fields with empty or default values are
   754  	// omitted from API requests. See
   755  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   756  	// details.
   757  	ForceSendFields []string `json:"-"`
   758  	// NullFields is a list of field names (e.g. "Name") to include in API requests
   759  	// with the JSON null value. By default, fields with empty values are omitted
   760  	// from API requests. See
   761  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   762  	NullFields []string `json:"-"`
   763  }
   764  
   765  func (s *GoogleCloudRecommenderV1beta1InsightType) MarshalJSON() ([]byte, error) {
   766  	type NoMethod GoogleCloudRecommenderV1beta1InsightType
   767  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   768  }
   769  
   770  // GoogleCloudRecommenderV1beta1InsightTypeConfig: Configuration for an
   771  // InsightType.
   772  type GoogleCloudRecommenderV1beta1InsightTypeConfig struct {
   773  	// Annotations: Allows clients to store small amounts of arbitrary data.
   774  	// Annotations must follow the Kubernetes syntax. The total size of all keys
   775  	// and values combined is limited to 256k. Key can have 2 segments: prefix
   776  	// (optional) and name (required), separated by a slash (/). Prefix must be a
   777  	// DNS subdomain. Name must be 63 characters or less, begin and end with
   778  	// alphanumerics, with dashes (-), underscores (_), dots (.), and alphanumerics
   779  	// between.
   780  	Annotations map[string]string `json:"annotations,omitempty"`
   781  	// DisplayName: A user-settable field to provide a human-readable name to be
   782  	// used in user interfaces.
   783  	DisplayName string `json:"displayName,omitempty"`
   784  	// Etag: Fingerprint of the InsightTypeConfig. Provides optimistic locking when
   785  	// updating.
   786  	Etag string `json:"etag,omitempty"`
   787  	// InsightTypeGenerationConfig: InsightTypeGenerationConfig which configures
   788  	// the generation of insights for this insight type.
   789  	InsightTypeGenerationConfig *GoogleCloudRecommenderV1beta1InsightTypeGenerationConfig `json:"insightTypeGenerationConfig,omitempty"`
   790  	// Name: Identifier. Name of insight type config. Eg,
   791  	// projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]
   792  	// /config
   793  	Name string `json:"name,omitempty"`
   794  	// RevisionId: Output only. Immutable. The revision ID of the config. A new
   795  	// revision is committed whenever the config is changed in any way. The format
   796  	// is an 8-character hexadecimal string.
   797  	RevisionId string `json:"revisionId,omitempty"`
   798  	// UpdateTime: Last time when the config was updated.
   799  	UpdateTime string `json:"updateTime,omitempty"`
   800  
   801  	// ServerResponse contains the HTTP response code and headers from the server.
   802  	googleapi.ServerResponse `json:"-"`
   803  	// ForceSendFields is a list of field names (e.g. "Annotations") to
   804  	// unconditionally include in API requests. By default, fields with empty or
   805  	// default values are omitted from API requests. See
   806  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   807  	// details.
   808  	ForceSendFields []string `json:"-"`
   809  	// NullFields is a list of field names (e.g. "Annotations") to include in API
   810  	// requests with the JSON null value. By default, fields with empty values are
   811  	// omitted from API requests. See
   812  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   813  	NullFields []string `json:"-"`
   814  }
   815  
   816  func (s *GoogleCloudRecommenderV1beta1InsightTypeConfig) MarshalJSON() ([]byte, error) {
   817  	type NoMethod GoogleCloudRecommenderV1beta1InsightTypeConfig
   818  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   819  }
   820  
   821  // GoogleCloudRecommenderV1beta1InsightTypeGenerationConfig: A configuration to
   822  // customize the generation of insights. Eg, customizing the lookback period
   823  // considered when generating a insight.
   824  type GoogleCloudRecommenderV1beta1InsightTypeGenerationConfig struct {
   825  	// Params: Parameters for this InsightTypeGenerationConfig. These configs can
   826  	// be used by or are applied to all subtypes.
   827  	Params googleapi.RawMessage `json:"params,omitempty"`
   828  	// ForceSendFields is a list of field names (e.g. "Params") to unconditionally
   829  	// include in API requests. By default, fields with empty or default values are
   830  	// omitted from API requests. See
   831  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   832  	// details.
   833  	ForceSendFields []string `json:"-"`
   834  	// NullFields is a list of field names (e.g. "Params") to include in API
   835  	// requests with the JSON null value. By default, fields with empty values are
   836  	// omitted from API requests. See
   837  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   838  	NullFields []string `json:"-"`
   839  }
   840  
   841  func (s *GoogleCloudRecommenderV1beta1InsightTypeGenerationConfig) MarshalJSON() ([]byte, error) {
   842  	type NoMethod GoogleCloudRecommenderV1beta1InsightTypeGenerationConfig
   843  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   844  }
   845  
   846  // GoogleCloudRecommenderV1beta1ListInsightTypesResponse: Response for the
   847  // `ListInsightTypes` method. Next ID: 3
   848  type GoogleCloudRecommenderV1beta1ListInsightTypesResponse struct {
   849  	// InsightTypes: The set of recommenders available
   850  	InsightTypes []*GoogleCloudRecommenderV1beta1InsightType `json:"insightTypes,omitempty"`
   851  	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
   852  	// next page. If this field is omitted, there are no subsequent pages.
   853  	NextPageToken string `json:"nextPageToken,omitempty"`
   854  
   855  	// ServerResponse contains the HTTP response code and headers from the server.
   856  	googleapi.ServerResponse `json:"-"`
   857  	// ForceSendFields is a list of field names (e.g. "InsightTypes") to
   858  	// unconditionally include in API requests. By default, fields with empty or
   859  	// default values are omitted from API requests. See
   860  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   861  	// details.
   862  	ForceSendFields []string `json:"-"`
   863  	// NullFields is a list of field names (e.g. "InsightTypes") to include in API
   864  	// requests with the JSON null value. By default, fields with empty values are
   865  	// omitted from API requests. See
   866  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   867  	NullFields []string `json:"-"`
   868  }
   869  
   870  func (s *GoogleCloudRecommenderV1beta1ListInsightTypesResponse) MarshalJSON() ([]byte, error) {
   871  	type NoMethod GoogleCloudRecommenderV1beta1ListInsightTypesResponse
   872  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   873  }
   874  
   875  // GoogleCloudRecommenderV1beta1ListInsightsResponse: Response to the
   876  // `ListInsights` method.
   877  type GoogleCloudRecommenderV1beta1ListInsightsResponse struct {
   878  	// Insights: The set of insights for the `parent` resource.
   879  	Insights []*GoogleCloudRecommenderV1beta1Insight `json:"insights,omitempty"`
   880  	// NextPageToken: A token that can be used to request the next page of results.
   881  	// This field is empty if there are no additional results.
   882  	NextPageToken string `json:"nextPageToken,omitempty"`
   883  
   884  	// ServerResponse contains the HTTP response code and headers from the server.
   885  	googleapi.ServerResponse `json:"-"`
   886  	// ForceSendFields is a list of field names (e.g. "Insights") to
   887  	// unconditionally include in API requests. By default, fields with empty or
   888  	// default values are omitted from API requests. See
   889  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   890  	// details.
   891  	ForceSendFields []string `json:"-"`
   892  	// NullFields is a list of field names (e.g. "Insights") to include in API
   893  	// requests with the JSON null value. By default, fields with empty values are
   894  	// omitted from API requests. See
   895  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   896  	NullFields []string `json:"-"`
   897  }
   898  
   899  func (s *GoogleCloudRecommenderV1beta1ListInsightsResponse) MarshalJSON() ([]byte, error) {
   900  	type NoMethod GoogleCloudRecommenderV1beta1ListInsightsResponse
   901  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   902  }
   903  
   904  // GoogleCloudRecommenderV1beta1ListRecommendationsResponse: Response to the
   905  // `ListRecommendations` method.
   906  type GoogleCloudRecommenderV1beta1ListRecommendationsResponse struct {
   907  	// NextPageToken: A token that can be used to request the next page of results.
   908  	// This field is empty if there are no additional results.
   909  	NextPageToken string `json:"nextPageToken,omitempty"`
   910  	// Recommendations: The set of recommendations for the `parent` resource.
   911  	Recommendations []*GoogleCloudRecommenderV1beta1Recommendation `json:"recommendations,omitempty"`
   912  
   913  	// ServerResponse contains the HTTP response code and headers from the server.
   914  	googleapi.ServerResponse `json:"-"`
   915  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   916  	// unconditionally include in API requests. By default, fields with empty or
   917  	// default values are omitted from API requests. See
   918  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   919  	// details.
   920  	ForceSendFields []string `json:"-"`
   921  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   922  	// requests with the JSON null value. By default, fields with empty values are
   923  	// omitted from API requests. See
   924  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   925  	NullFields []string `json:"-"`
   926  }
   927  
   928  func (s *GoogleCloudRecommenderV1beta1ListRecommendationsResponse) MarshalJSON() ([]byte, error) {
   929  	type NoMethod GoogleCloudRecommenderV1beta1ListRecommendationsResponse
   930  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   931  }
   932  
   933  // GoogleCloudRecommenderV1beta1ListRecommendersResponse: Response for the
   934  // `ListRecommender` method. Next ID: 3
   935  type GoogleCloudRecommenderV1beta1ListRecommendersResponse struct {
   936  	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
   937  	// next page. If this field is omitted, there are no subsequent pages.
   938  	NextPageToken string `json:"nextPageToken,omitempty"`
   939  	// Recommenders: The set of recommenders available
   940  	Recommenders []*GoogleCloudRecommenderV1beta1RecommenderType `json:"recommenders,omitempty"`
   941  
   942  	// ServerResponse contains the HTTP response code and headers from the server.
   943  	googleapi.ServerResponse `json:"-"`
   944  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   945  	// unconditionally include in API requests. By default, fields with empty or
   946  	// default values are omitted from API requests. See
   947  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   948  	// details.
   949  	ForceSendFields []string `json:"-"`
   950  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   951  	// requests with the JSON null value. By default, fields with empty values are
   952  	// omitted from API requests. See
   953  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   954  	NullFields []string `json:"-"`
   955  }
   956  
   957  func (s *GoogleCloudRecommenderV1beta1ListRecommendersResponse) MarshalJSON() ([]byte, error) {
   958  	type NoMethod GoogleCloudRecommenderV1beta1ListRecommendersResponse
   959  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   960  }
   961  
   962  // GoogleCloudRecommenderV1beta1MarkInsightAcceptedRequest: Request for the
   963  // `MarkInsightAccepted` method.
   964  type GoogleCloudRecommenderV1beta1MarkInsightAcceptedRequest struct {
   965  	// Etag: Required. Fingerprint of the Insight. Provides optimistic locking.
   966  	Etag string `json:"etag,omitempty"`
   967  	// StateMetadata: Optional. State properties user wish to include with this
   968  	// state. Full replace of the current state_metadata.
   969  	StateMetadata map[string]string `json:"stateMetadata,omitempty"`
   970  	// ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
   971  	// include in API requests. By default, fields with empty or default values are
   972  	// omitted from API requests. See
   973  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   974  	// details.
   975  	ForceSendFields []string `json:"-"`
   976  	// NullFields is a list of field names (e.g. "Etag") to include in API requests
   977  	// with the JSON null value. By default, fields with empty values are omitted
   978  	// from API requests. See
   979  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   980  	NullFields []string `json:"-"`
   981  }
   982  
   983  func (s *GoogleCloudRecommenderV1beta1MarkInsightAcceptedRequest) MarshalJSON() ([]byte, error) {
   984  	type NoMethod GoogleCloudRecommenderV1beta1MarkInsightAcceptedRequest
   985  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   986  }
   987  
   988  // GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest: Request for
   989  // the `MarkRecommendationClaimed` Method.
   990  type GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest struct {
   991  	// Etag: Required. Fingerprint of the Recommendation. Provides optimistic
   992  	// locking.
   993  	Etag string `json:"etag,omitempty"`
   994  	// StateMetadata: State properties to include with this state. Overwrites any
   995  	// existing `state_metadata`. Keys must match the regex `/^a-z0-9{0,62}$/`.
   996  	// Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`.
   997  	StateMetadata map[string]string `json:"stateMetadata,omitempty"`
   998  	// ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
   999  	// include in API requests. By default, fields with empty or default values are
  1000  	// omitted from API requests. See
  1001  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1002  	// details.
  1003  	ForceSendFields []string `json:"-"`
  1004  	// NullFields is a list of field names (e.g. "Etag") to include in API requests
  1005  	// with the JSON null value. By default, fields with empty values are omitted
  1006  	// from API requests. See
  1007  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1008  	NullFields []string `json:"-"`
  1009  }
  1010  
  1011  func (s *GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest) MarshalJSON() ([]byte, error) {
  1012  	type NoMethod GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest
  1013  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1014  }
  1015  
  1016  // GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest: Request for
  1017  // the `MarkRecommendationDismissed` Method.
  1018  type GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest struct {
  1019  	// Etag: Fingerprint of the Recommendation. Provides optimistic locking.
  1020  	Etag string `json:"etag,omitempty"`
  1021  	// ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
  1022  	// include in API requests. By default, fields with empty or default values are
  1023  	// omitted from API requests. See
  1024  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1025  	// details.
  1026  	ForceSendFields []string `json:"-"`
  1027  	// NullFields is a list of field names (e.g. "Etag") to include in API requests
  1028  	// with the JSON null value. By default, fields with empty values are omitted
  1029  	// from API requests. See
  1030  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1031  	NullFields []string `json:"-"`
  1032  }
  1033  
  1034  func (s *GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest) MarshalJSON() ([]byte, error) {
  1035  	type NoMethod GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest
  1036  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1037  }
  1038  
  1039  // GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest: Request for
  1040  // the `MarkRecommendationFailed` Method.
  1041  type GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest struct {
  1042  	// Etag: Required. Fingerprint of the Recommendation. Provides optimistic
  1043  	// locking.
  1044  	Etag string `json:"etag,omitempty"`
  1045  	// StateMetadata: State properties to include with this state. Overwrites any
  1046  	// existing `state_metadata`. Keys must match the regex `/^a-z0-9{0,62}$/`.
  1047  	// Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`.
  1048  	StateMetadata map[string]string `json:"stateMetadata,omitempty"`
  1049  	// ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
  1050  	// include in API requests. By default, fields with empty or default values are
  1051  	// omitted from API requests. See
  1052  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1053  	// details.
  1054  	ForceSendFields []string `json:"-"`
  1055  	// NullFields is a list of field names (e.g. "Etag") to include in API requests
  1056  	// with the JSON null value. By default, fields with empty values are omitted
  1057  	// from API requests. See
  1058  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1059  	NullFields []string `json:"-"`
  1060  }
  1061  
  1062  func (s *GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest) MarshalJSON() ([]byte, error) {
  1063  	type NoMethod GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest
  1064  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1065  }
  1066  
  1067  // GoogleCloudRecommenderV1beta1MarkRecommendationSucceededRequest: Request for
  1068  // the `MarkRecommendationSucceeded` Method.
  1069  type GoogleCloudRecommenderV1beta1MarkRecommendationSucceededRequest struct {
  1070  	// Etag: Required. Fingerprint of the Recommendation. Provides optimistic
  1071  	// locking.
  1072  	Etag string `json:"etag,omitempty"`
  1073  	// StateMetadata: State properties to include with this state. Overwrites any
  1074  	// existing `state_metadata`. Keys must match the regex `/^a-z0-9{0,62}$/`.
  1075  	// Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`.
  1076  	StateMetadata map[string]string `json:"stateMetadata,omitempty"`
  1077  	// ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
  1078  	// include in API requests. By default, fields with empty or default values are
  1079  	// omitted from API requests. See
  1080  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1081  	// details.
  1082  	ForceSendFields []string `json:"-"`
  1083  	// NullFields is a list of field names (e.g. "Etag") to include in API requests
  1084  	// with the JSON null value. By default, fields with empty values are omitted
  1085  	// from API requests. See
  1086  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1087  	NullFields []string `json:"-"`
  1088  }
  1089  
  1090  func (s *GoogleCloudRecommenderV1beta1MarkRecommendationSucceededRequest) MarshalJSON() ([]byte, error) {
  1091  	type NoMethod GoogleCloudRecommenderV1beta1MarkRecommendationSucceededRequest
  1092  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1093  }
  1094  
  1095  // GoogleCloudRecommenderV1beta1Operation: Contains an operation for a resource
  1096  // loosely based on the JSON-PATCH format with support for: * Custom filters
  1097  // for describing partial array patch. * Extended path values for describing
  1098  // nested arrays. * Custom fields for describing the resource for which the
  1099  // operation is being described. * Allows extension to custom operations not
  1100  // natively supported by RFC6902. See https://tools.ietf.org/html/rfc6902 for
  1101  // details on the original RFC.
  1102  type GoogleCloudRecommenderV1beta1Operation struct {
  1103  	// Action: Type of this operation. Contains one of 'add', 'remove', 'replace',
  1104  	// 'move', 'copy', 'test' and 'custom' operations. This field is
  1105  	// case-insensitive and always populated.
  1106  	Action string `json:"action,omitempty"`
  1107  	// Path: Path to the target field being operated on. If the operation is at the
  1108  	// resource level, then path should be "/". This field is always populated.
  1109  	Path string `json:"path,omitempty"`
  1110  	// PathFilters: Set of filters to apply if `path` refers to array elements or
  1111  	// nested array elements in order to narrow down to a single unique element
  1112  	// that is being tested/modified. This is intended to be an exact match per
  1113  	// filter. To perform advanced matching, use path_value_matchers. * Example:
  1114  	// ``` { "/versions/*/name" : "it-123" "/versions/*/targetSize/percent": 20 }
  1115  	// ``` * Example: ``` { "/bindings/*/role": "roles/owner"
  1116  	// "/bindings/*/condition" : null } ``` * Example: ``` { "/bindings/*/role":
  1117  	// "roles/owner" "/bindings/*/members/*" : ["x@example.com", "y@example.com"] }
  1118  	// ``` When both path_filters and path_value_matchers are set, an implicit AND
  1119  	// must be performed.
  1120  	PathFilters googleapi.RawMessage `json:"pathFilters,omitempty"`
  1121  	// PathValueMatchers: Similar to path_filters, this contains set of filters to
  1122  	// apply if `path` field refers to array elements. This is meant to support
  1123  	// value matching beyond exact match. To perform exact match, use path_filters.
  1124  	// When both path_filters and path_value_matchers are set, an implicit AND must
  1125  	// be performed.
  1126  	PathValueMatchers map[string]GoogleCloudRecommenderV1beta1ValueMatcher `json:"pathValueMatchers,omitempty"`
  1127  	// Resource: Contains the fully qualified resource name. This field is always
  1128  	// populated. ex: //cloudresourcemanager.googleapis.com/projects/foo.
  1129  	Resource string `json:"resource,omitempty"`
  1130  	// ResourceType: Type of GCP resource being modified/tested. This field is
  1131  	// always populated. Example: cloudresourcemanager.googleapis.com/Project,
  1132  	// compute.googleapis.com/Instance
  1133  	ResourceType string `json:"resourceType,omitempty"`
  1134  	// SourcePath: Can be set with action 'copy' or 'move' to indicate the source
  1135  	// field within resource or source_resource, ignored if provided for other
  1136  	// operation types.
  1137  	SourcePath string `json:"sourcePath,omitempty"`
  1138  	// SourceResource: Can be set with action 'copy' to copy resource configuration
  1139  	// across different resources of the same type. Example: A resource clone can
  1140  	// be done via action = 'copy', path = "/", from = "/", source_resource = and
  1141  	// resource_name = . This field is empty for all other values of `action`.
  1142  	SourceResource string `json:"sourceResource,omitempty"`
  1143  	// Value: Value for the `path` field. Will be set for actions:'add'/'replace'.
  1144  	// Maybe set for action: 'test'. Either this or `value_matcher` will be set for
  1145  	// 'test' operation. An exact match must be performed.
  1146  	Value interface{} `json:"value,omitempty"`
  1147  	// ValueMatcher: Can be set for action 'test' for advanced matching for the
  1148  	// value of 'path' field. Either this or `value` will be set for 'test'
  1149  	// operation.
  1150  	ValueMatcher *GoogleCloudRecommenderV1beta1ValueMatcher `json:"valueMatcher,omitempty"`
  1151  	// ForceSendFields is a list of field names (e.g. "Action") to unconditionally
  1152  	// include in API requests. By default, fields with empty or default values are
  1153  	// omitted from API requests. See
  1154  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1155  	// details.
  1156  	ForceSendFields []string `json:"-"`
  1157  	// NullFields is a list of field names (e.g. "Action") to include in API
  1158  	// requests with the JSON null value. By default, fields with empty values are
  1159  	// omitted from API requests. See
  1160  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1161  	NullFields []string `json:"-"`
  1162  }
  1163  
  1164  func (s *GoogleCloudRecommenderV1beta1Operation) MarshalJSON() ([]byte, error) {
  1165  	type NoMethod GoogleCloudRecommenderV1beta1Operation
  1166  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1167  }
  1168  
  1169  // GoogleCloudRecommenderV1beta1OperationGroup: Group of operations that need
  1170  // to be performed atomically.
  1171  type GoogleCloudRecommenderV1beta1OperationGroup struct {
  1172  	// Operations: List of operations across one or more resources that belong to
  1173  	// this group. Loosely based on RFC6902 and should be performed in the order
  1174  	// they appear.
  1175  	Operations []*GoogleCloudRecommenderV1beta1Operation `json:"operations,omitempty"`
  1176  	// ForceSendFields is a list of field names (e.g. "Operations") to
  1177  	// unconditionally include in API requests. By default, fields with empty or
  1178  	// default values are omitted from API requests. See
  1179  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1180  	// details.
  1181  	ForceSendFields []string `json:"-"`
  1182  	// NullFields is a list of field names (e.g. "Operations") to include in API
  1183  	// requests with the JSON null value. By default, fields with empty values are
  1184  	// omitted from API requests. See
  1185  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1186  	NullFields []string `json:"-"`
  1187  }
  1188  
  1189  func (s *GoogleCloudRecommenderV1beta1OperationGroup) MarshalJSON() ([]byte, error) {
  1190  	type NoMethod GoogleCloudRecommenderV1beta1OperationGroup
  1191  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1192  }
  1193  
  1194  // GoogleCloudRecommenderV1beta1Recommendation: A recommendation along with a
  1195  // suggested action. E.g., a rightsizing recommendation for an underutilized
  1196  // VM, IAM role recommendations, etc
  1197  type GoogleCloudRecommenderV1beta1Recommendation struct {
  1198  	// AdditionalImpact: Optional set of additional impact that this recommendation
  1199  	// may have when trying to optimize for the primary category. These may be
  1200  	// positive or negative.
  1201  	AdditionalImpact []*GoogleCloudRecommenderV1beta1Impact `json:"additionalImpact,omitempty"`
  1202  	// AssociatedInsights: Insights that led to this recommendation.
  1203  	AssociatedInsights []*GoogleCloudRecommenderV1beta1RecommendationInsightReference `json:"associatedInsights,omitempty"`
  1204  	// Content: Content of the recommendation describing recommended changes to
  1205  	// resources.
  1206  	Content *GoogleCloudRecommenderV1beta1RecommendationContent `json:"content,omitempty"`
  1207  	// Description: Free-form human readable summary in English. The maximum length
  1208  	// is 500 characters.
  1209  	Description string `json:"description,omitempty"`
  1210  	// Etag: Fingerprint of the Recommendation. Provides optimistic locking when
  1211  	// updating states.
  1212  	Etag string `json:"etag,omitempty"`
  1213  	// LastRefreshTime: Last time this recommendation was refreshed by the system
  1214  	// that created it in the first place.
  1215  	LastRefreshTime string `json:"lastRefreshTime,omitempty"`
  1216  	// Name: Identifier. Name of recommendation.
  1217  	Name string `json:"name,omitempty"`
  1218  	// PrimaryImpact: The primary impact that this recommendation can have while
  1219  	// trying to optimize for one category.
  1220  	PrimaryImpact *GoogleCloudRecommenderV1beta1Impact `json:"primaryImpact,omitempty"`
  1221  	// Priority: Recommendation's priority.
  1222  	//
  1223  	// Possible values:
  1224  	//   "PRIORITY_UNSPECIFIED" - Recommendation has unspecified priority.
  1225  	//   "P4" - Recommendation has P4 priority (lowest priority).
  1226  	//   "P3" - Recommendation has P3 priority (second lowest priority).
  1227  	//   "P2" - Recommendation has P2 priority (second highest priority).
  1228  	//   "P1" - Recommendation has P1 priority (highest priority).
  1229  	Priority string `json:"priority,omitempty"`
  1230  	// RecommenderSubtype: Contains an identifier for a subtype of recommendations
  1231  	// produced for the same recommender. Subtype is a function of content and
  1232  	// impact, meaning a new subtype might be added when significant changes to
  1233  	// `content` or `primary_impact.category` are introduced. See the Recommenders
  1234  	// section to see a list of subtypes for a given Recommender. Examples: For
  1235  	// recommender = "google.iam.policy.Recommender", recommender_subtype can be
  1236  	// one of "REMOVE_ROLE"/"REPLACE_ROLE"
  1237  	RecommenderSubtype string `json:"recommenderSubtype,omitempty"`
  1238  	// StateInfo: Information for state. Contains state and metadata.
  1239  	StateInfo *GoogleCloudRecommenderV1beta1RecommendationStateInfo `json:"stateInfo,omitempty"`
  1240  	// TargetResources: Fully qualified resource names that this recommendation is
  1241  	// targeting.
  1242  	TargetResources []string `json:"targetResources,omitempty"`
  1243  	// XorGroupId: Corresponds to a mutually exclusive group ID within a
  1244  	// recommender. A non-empty ID indicates that the recommendation belongs to a
  1245  	// mutually exclusive group. This means that only one recommendation within the
  1246  	// group is suggested to be applied.
  1247  	XorGroupId string `json:"xorGroupId,omitempty"`
  1248  
  1249  	// ServerResponse contains the HTTP response code and headers from the server.
  1250  	googleapi.ServerResponse `json:"-"`
  1251  	// ForceSendFields is a list of field names (e.g. "AdditionalImpact") to
  1252  	// unconditionally include in API requests. By default, fields with empty or
  1253  	// default values are omitted from API requests. See
  1254  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1255  	// details.
  1256  	ForceSendFields []string `json:"-"`
  1257  	// NullFields is a list of field names (e.g. "AdditionalImpact") to include in
  1258  	// API requests with the JSON null value. By default, fields with empty values
  1259  	// are omitted from API requests. See
  1260  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1261  	NullFields []string `json:"-"`
  1262  }
  1263  
  1264  func (s *GoogleCloudRecommenderV1beta1Recommendation) MarshalJSON() ([]byte, error) {
  1265  	type NoMethod GoogleCloudRecommenderV1beta1Recommendation
  1266  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1267  }
  1268  
  1269  // GoogleCloudRecommenderV1beta1RecommendationContent: Contains what resources
  1270  // are changing and how they are changing.
  1271  type GoogleCloudRecommenderV1beta1RecommendationContent struct {
  1272  	// OperationGroups: Operations to one or more Google Cloud resources grouped in
  1273  	// such a way that, all operations within one group are expected to be
  1274  	// performed atomically and in an order.
  1275  	OperationGroups []*GoogleCloudRecommenderV1beta1OperationGroup `json:"operationGroups,omitempty"`
  1276  	// Overview: Condensed overview information about the recommendation.
  1277  	Overview googleapi.RawMessage `json:"overview,omitempty"`
  1278  	// ForceSendFields is a list of field names (e.g. "OperationGroups") to
  1279  	// unconditionally include in API requests. By default, fields with empty or
  1280  	// default values are omitted from API requests. See
  1281  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1282  	// details.
  1283  	ForceSendFields []string `json:"-"`
  1284  	// NullFields is a list of field names (e.g. "OperationGroups") to include in
  1285  	// API requests with the JSON null value. By default, fields with empty values
  1286  	// are omitted from API requests. See
  1287  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1288  	NullFields []string `json:"-"`
  1289  }
  1290  
  1291  func (s *GoogleCloudRecommenderV1beta1RecommendationContent) MarshalJSON() ([]byte, error) {
  1292  	type NoMethod GoogleCloudRecommenderV1beta1RecommendationContent
  1293  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1294  }
  1295  
  1296  // GoogleCloudRecommenderV1beta1RecommendationInsightReference: Reference to an
  1297  // associated insight.
  1298  type GoogleCloudRecommenderV1beta1RecommendationInsightReference struct {
  1299  	// Insight: Insight resource name, e.g.
  1300  	// projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]
  1301  	// /insights/[INSIGHT_ID]
  1302  	Insight string `json:"insight,omitempty"`
  1303  	// ForceSendFields is a list of field names (e.g. "Insight") to unconditionally
  1304  	// include in API requests. By default, fields with empty or default values are
  1305  	// omitted from API requests. See
  1306  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1307  	// details.
  1308  	ForceSendFields []string `json:"-"`
  1309  	// NullFields is a list of field names (e.g. "Insight") to include in API
  1310  	// requests with the JSON null value. By default, fields with empty values are
  1311  	// omitted from API requests. See
  1312  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1313  	NullFields []string `json:"-"`
  1314  }
  1315  
  1316  func (s *GoogleCloudRecommenderV1beta1RecommendationInsightReference) MarshalJSON() ([]byte, error) {
  1317  	type NoMethod GoogleCloudRecommenderV1beta1RecommendationInsightReference
  1318  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1319  }
  1320  
  1321  // GoogleCloudRecommenderV1beta1RecommendationStateInfo: Information for state.
  1322  // Contains state and metadata.
  1323  type GoogleCloudRecommenderV1beta1RecommendationStateInfo struct {
  1324  	// State: The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED.
  1325  	//
  1326  	// Possible values:
  1327  	//   "STATE_UNSPECIFIED" - Default state. Don't use directly.
  1328  	//   "ACTIVE" - Recommendation is active and can be applied. Recommendations
  1329  	// content can be updated by Google. ACTIVE recommendations can be marked as
  1330  	// CLAIMED, SUCCEEDED, or FAILED.
  1331  	//   "CLAIMED" - Recommendation is in claimed state. Recommendations content is
  1332  	// immutable and cannot be updated by Google. CLAIMED recommendations can be
  1333  	// marked as CLAIMED, SUCCEEDED, or FAILED.
  1334  	//   "SUCCEEDED" - Recommendation is in succeeded state. Recommendations
  1335  	// content is immutable and cannot be updated by Google. SUCCEEDED
  1336  	// recommendations can be marked as SUCCEEDED, or FAILED.
  1337  	//   "FAILED" - Recommendation is in failed state. Recommendations content is
  1338  	// immutable and cannot be updated by Google. FAILED recommendations can be
  1339  	// marked as SUCCEEDED, or FAILED.
  1340  	//   "DISMISSED" - Recommendation is in dismissed state. Recommendation content
  1341  	// can be updated by Google. DISMISSED recommendations can be marked as ACTIVE.
  1342  	State string `json:"state,omitempty"`
  1343  	// StateMetadata: A map of metadata for the state, provided by user or
  1344  	// automations systems.
  1345  	StateMetadata map[string]string `json:"stateMetadata,omitempty"`
  1346  	// ForceSendFields is a list of field names (e.g. "State") to unconditionally
  1347  	// include in API requests. By default, fields with empty or default values are
  1348  	// omitted from API requests. See
  1349  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1350  	// details.
  1351  	ForceSendFields []string `json:"-"`
  1352  	// NullFields is a list of field names (e.g. "State") to include in API
  1353  	// requests with the JSON null value. By default, fields with empty values are
  1354  	// omitted from API requests. See
  1355  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1356  	NullFields []string `json:"-"`
  1357  }
  1358  
  1359  func (s *GoogleCloudRecommenderV1beta1RecommendationStateInfo) MarshalJSON() ([]byte, error) {
  1360  	type NoMethod GoogleCloudRecommenderV1beta1RecommendationStateInfo
  1361  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1362  }
  1363  
  1364  // GoogleCloudRecommenderV1beta1RecommenderConfig: Configuration for a
  1365  // Recommender.
  1366  type GoogleCloudRecommenderV1beta1RecommenderConfig struct {
  1367  	// Annotations: Allows clients to store small amounts of arbitrary data.
  1368  	// Annotations must follow the Kubernetes syntax. The total size of all keys
  1369  	// and values combined is limited to 256k. Key can have 2 segments: prefix
  1370  	// (optional) and name (required), separated by a slash (/). Prefix must be a
  1371  	// DNS subdomain. Name must be 63 characters or less, begin and end with
  1372  	// alphanumerics, with dashes (-), underscores (_), dots (.), and alphanumerics
  1373  	// between.
  1374  	Annotations map[string]string `json:"annotations,omitempty"`
  1375  	// DisplayName: A user-settable field to provide a human-readable name to be
  1376  	// used in user interfaces.
  1377  	DisplayName string `json:"displayName,omitempty"`
  1378  	// Etag: Fingerprint of the RecommenderConfig. Provides optimistic locking when
  1379  	// updating.
  1380  	Etag string `json:"etag,omitempty"`
  1381  	// Name: Identifier. Name of recommender config. Eg,
  1382  	// projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/
  1383  	// config
  1384  	Name string `json:"name,omitempty"`
  1385  	// RecommenderGenerationConfig: RecommenderGenerationConfig which configures
  1386  	// the Generation of recommendations for this recommender.
  1387  	RecommenderGenerationConfig *GoogleCloudRecommenderV1beta1RecommenderGenerationConfig `json:"recommenderGenerationConfig,omitempty"`
  1388  	// RevisionId: Output only. Immutable. The revision ID of the config. A new
  1389  	// revision is committed whenever the config is changed in any way. The format
  1390  	// is an 8-character hexadecimal string.
  1391  	RevisionId string `json:"revisionId,omitempty"`
  1392  	// UpdateTime: Last time when the config was updated.
  1393  	UpdateTime string `json:"updateTime,omitempty"`
  1394  
  1395  	// ServerResponse contains the HTTP response code and headers from the server.
  1396  	googleapi.ServerResponse `json:"-"`
  1397  	// ForceSendFields is a list of field names (e.g. "Annotations") to
  1398  	// unconditionally include in API requests. By default, fields with empty or
  1399  	// default values are omitted from API requests. See
  1400  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1401  	// details.
  1402  	ForceSendFields []string `json:"-"`
  1403  	// NullFields is a list of field names (e.g. "Annotations") to include in API
  1404  	// requests with the JSON null value. By default, fields with empty values are
  1405  	// omitted from API requests. See
  1406  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1407  	NullFields []string `json:"-"`
  1408  }
  1409  
  1410  func (s *GoogleCloudRecommenderV1beta1RecommenderConfig) MarshalJSON() ([]byte, error) {
  1411  	type NoMethod GoogleCloudRecommenderV1beta1RecommenderConfig
  1412  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1413  }
  1414  
  1415  // GoogleCloudRecommenderV1beta1RecommenderGenerationConfig: A Configuration to
  1416  // customize the generation of recommendations. Eg, customizing the lookback
  1417  // period considered when generating a recommendation.
  1418  type GoogleCloudRecommenderV1beta1RecommenderGenerationConfig struct {
  1419  	// Params: Parameters for this RecommenderGenerationConfig. These configs can
  1420  	// be used by or are applied to all subtypes.
  1421  	Params googleapi.RawMessage `json:"params,omitempty"`
  1422  	// ForceSendFields is a list of field names (e.g. "Params") to unconditionally
  1423  	// include in API requests. By default, fields with empty or default values are
  1424  	// omitted from API requests. See
  1425  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1426  	// details.
  1427  	ForceSendFields []string `json:"-"`
  1428  	// NullFields is a list of field names (e.g. "Params") to include in API
  1429  	// requests with the JSON null value. By default, fields with empty values are
  1430  	// omitted from API requests. See
  1431  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1432  	NullFields []string `json:"-"`
  1433  }
  1434  
  1435  func (s *GoogleCloudRecommenderV1beta1RecommenderGenerationConfig) MarshalJSON() ([]byte, error) {
  1436  	type NoMethod GoogleCloudRecommenderV1beta1RecommenderGenerationConfig
  1437  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1438  }
  1439  
  1440  // GoogleCloudRecommenderV1beta1RecommenderType: The type of a recommender.
  1441  type GoogleCloudRecommenderV1beta1RecommenderType struct {
  1442  	// Name: The recommender's name in format RecommenderTypes/{recommender_type}
  1443  	// eg: recommenderTypes/google.iam.policy.Recommender
  1444  	Name string `json:"name,omitempty"`
  1445  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
  1446  	// include in API requests. By default, fields with empty or default values are
  1447  	// omitted from API requests. See
  1448  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1449  	// details.
  1450  	ForceSendFields []string `json:"-"`
  1451  	// NullFields is a list of field names (e.g. "Name") to include in API requests
  1452  	// with the JSON null value. By default, fields with empty values are omitted
  1453  	// from API requests. See
  1454  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1455  	NullFields []string `json:"-"`
  1456  }
  1457  
  1458  func (s *GoogleCloudRecommenderV1beta1RecommenderType) MarshalJSON() ([]byte, error) {
  1459  	type NoMethod GoogleCloudRecommenderV1beta1RecommenderType
  1460  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1461  }
  1462  
  1463  // GoogleCloudRecommenderV1beta1ReliabilityProjection: Contains information on
  1464  // the impact of a reliability recommendation.
  1465  type GoogleCloudRecommenderV1beta1ReliabilityProjection struct {
  1466  	// Details: Per-recommender projection.
  1467  	Details googleapi.RawMessage `json:"details,omitempty"`
  1468  	// Risks: Reliability risks mitigated by this recommendation.
  1469  	//
  1470  	// Possible values:
  1471  	//   "RISK_TYPE_UNSPECIFIED" - Default unspecified risk. Don't use directly.
  1472  	//   "SERVICE_DISRUPTION" - Potential service downtime.
  1473  	//   "DATA_LOSS" - Potential data loss.
  1474  	//   "ACCESS_DENY" - Potential access denial. The service is still up but some
  1475  	// or all clients can't access it.
  1476  	Risks []string `json:"risks,omitempty"`
  1477  	// ForceSendFields is a list of field names (e.g. "Details") to unconditionally
  1478  	// include in API requests. By default, fields with empty or default values are
  1479  	// omitted from API requests. See
  1480  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1481  	// details.
  1482  	ForceSendFields []string `json:"-"`
  1483  	// NullFields is a list of field names (e.g. "Details") to include in API
  1484  	// requests with the JSON null value. By default, fields with empty values are
  1485  	// omitted from API requests. See
  1486  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1487  	NullFields []string `json:"-"`
  1488  }
  1489  
  1490  func (s *GoogleCloudRecommenderV1beta1ReliabilityProjection) MarshalJSON() ([]byte, error) {
  1491  	type NoMethod GoogleCloudRecommenderV1beta1ReliabilityProjection
  1492  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1493  }
  1494  
  1495  // GoogleCloudRecommenderV1beta1SecurityProjection: Contains various ways of
  1496  // describing the impact on Security.
  1497  type GoogleCloudRecommenderV1beta1SecurityProjection struct {
  1498  	// Details: This field can be used by the recommender to define details
  1499  	// specific to security impact.
  1500  	Details googleapi.RawMessage `json:"details,omitempty"`
  1501  	// ForceSendFields is a list of field names (e.g. "Details") to unconditionally
  1502  	// include in API requests. By default, fields with empty or default values are
  1503  	// omitted from API requests. See
  1504  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1505  	// details.
  1506  	ForceSendFields []string `json:"-"`
  1507  	// NullFields is a list of field names (e.g. "Details") to include in API
  1508  	// requests with the JSON null value. By default, fields with empty values are
  1509  	// omitted from API requests. See
  1510  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1511  	NullFields []string `json:"-"`
  1512  }
  1513  
  1514  func (s *GoogleCloudRecommenderV1beta1SecurityProjection) MarshalJSON() ([]byte, error) {
  1515  	type NoMethod GoogleCloudRecommenderV1beta1SecurityProjection
  1516  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1517  }
  1518  
  1519  // GoogleCloudRecommenderV1beta1SustainabilityProjection: Contains metadata
  1520  // about how much sustainability a recommendation can save or incur.
  1521  type GoogleCloudRecommenderV1beta1SustainabilityProjection struct {
  1522  	// Duration: Duration for which this sustanability applies.
  1523  	Duration string `json:"duration,omitempty"`
  1524  	// KgCO2e: Carbon Footprint generated in kg of CO2 equivalent. Chose kg_c_o2e
  1525  	// so that the name renders correctly in camelCase (kgCO2e).
  1526  	KgCO2e float64 `json:"kgCO2e,omitempty"`
  1527  	// ForceSendFields is a list of field names (e.g. "Duration") to
  1528  	// unconditionally include in API requests. By default, fields with empty or
  1529  	// default values are omitted from API requests. See
  1530  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1531  	// details.
  1532  	ForceSendFields []string `json:"-"`
  1533  	// NullFields is a list of field names (e.g. "Duration") to include in API
  1534  	// requests with the JSON null value. By default, fields with empty values are
  1535  	// omitted from API requests. See
  1536  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1537  	NullFields []string `json:"-"`
  1538  }
  1539  
  1540  func (s *GoogleCloudRecommenderV1beta1SustainabilityProjection) MarshalJSON() ([]byte, error) {
  1541  	type NoMethod GoogleCloudRecommenderV1beta1SustainabilityProjection
  1542  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1543  }
  1544  
  1545  func (s *GoogleCloudRecommenderV1beta1SustainabilityProjection) UnmarshalJSON(data []byte) error {
  1546  	type NoMethod GoogleCloudRecommenderV1beta1SustainabilityProjection
  1547  	var s1 struct {
  1548  		KgCO2e gensupport.JSONFloat64 `json:"kgCO2e"`
  1549  		*NoMethod
  1550  	}
  1551  	s1.NoMethod = (*NoMethod)(s)
  1552  	if err := json.Unmarshal(data, &s1); err != nil {
  1553  		return err
  1554  	}
  1555  	s.KgCO2e = float64(s1.KgCO2e)
  1556  	return nil
  1557  }
  1558  
  1559  // GoogleCloudRecommenderV1beta1ValueMatcher: Contains various matching options
  1560  // for values for a GCP resource field.
  1561  type GoogleCloudRecommenderV1beta1ValueMatcher struct {
  1562  	// MatchesPattern: To be used for full regex matching. The regular expression
  1563  	// is using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax),
  1564  	// so to be used with RE2::FullMatch
  1565  	MatchesPattern string `json:"matchesPattern,omitempty"`
  1566  	// ForceSendFields is a list of field names (e.g. "MatchesPattern") to
  1567  	// unconditionally include in API requests. By default, fields with empty or
  1568  	// default values are omitted from API requests. See
  1569  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1570  	// details.
  1571  	ForceSendFields []string `json:"-"`
  1572  	// NullFields is a list of field names (e.g. "MatchesPattern") to include in
  1573  	// API requests with the JSON null value. By default, fields with empty values
  1574  	// are omitted from API requests. See
  1575  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1576  	NullFields []string `json:"-"`
  1577  }
  1578  
  1579  func (s *GoogleCloudRecommenderV1beta1ValueMatcher) MarshalJSON() ([]byte, error) {
  1580  	type NoMethod GoogleCloudRecommenderV1beta1ValueMatcher
  1581  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1582  }
  1583  
  1584  // GoogleTypeMoney: Represents an amount of money with its currency type.
  1585  type GoogleTypeMoney struct {
  1586  	// CurrencyCode: The three-letter currency code defined in ISO 4217.
  1587  	CurrencyCode string `json:"currencyCode,omitempty"`
  1588  	// Nanos: Number of nano (10^-9) units of the amount. The value must be between
  1589  	// -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos`
  1590  	// must be positive or zero. If `units` is zero, `nanos` can be positive, zero,
  1591  	// or negative. If `units` is negative, `nanos` must be negative or zero. For
  1592  	// example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
  1593  	Nanos int64 `json:"nanos,omitempty"`
  1594  	// Units: The whole units of the amount. For example if `currencyCode` is
  1595  	// "USD", then 1 unit is one US dollar.
  1596  	Units int64 `json:"units,omitempty,string"`
  1597  	// ForceSendFields is a list of field names (e.g. "CurrencyCode") to
  1598  	// unconditionally include in API requests. By default, fields with empty or
  1599  	// default values are omitted from API requests. See
  1600  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1601  	// details.
  1602  	ForceSendFields []string `json:"-"`
  1603  	// NullFields is a list of field names (e.g. "CurrencyCode") to include in API
  1604  	// requests with the JSON null value. By default, fields with empty values are
  1605  	// omitted from API requests. See
  1606  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1607  	NullFields []string `json:"-"`
  1608  }
  1609  
  1610  func (s *GoogleTypeMoney) MarshalJSON() ([]byte, error) {
  1611  	type NoMethod GoogleTypeMoney
  1612  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1613  }
  1614  
  1615  type BillingAccountsLocationsListCall struct {
  1616  	s            *Service
  1617  	name         string
  1618  	urlParams_   gensupport.URLParams
  1619  	ifNoneMatch_ string
  1620  	ctx_         context.Context
  1621  	header_      http.Header
  1622  }
  1623  
  1624  // List: Lists locations with recommendations or insights.
  1625  //
  1626  // - name: The resource that owns the locations collection, if applicable.
  1627  func (r *BillingAccountsLocationsService) List(name string) *BillingAccountsLocationsListCall {
  1628  	c := &BillingAccountsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1629  	c.name = name
  1630  	return c
  1631  }
  1632  
  1633  // Filter sets the optional parameter "filter": A filter to narrow down results
  1634  // to a preferred subset. The filtering language accepts strings like
  1635  // "displayName=tokyo", and is documented in more detail in AIP-160
  1636  // (https://google.aip.dev/160).
  1637  func (c *BillingAccountsLocationsListCall) Filter(filter string) *BillingAccountsLocationsListCall {
  1638  	c.urlParams_.Set("filter", filter)
  1639  	return c
  1640  }
  1641  
  1642  // PageSize sets the optional parameter "pageSize": The maximum number of
  1643  // results to return. If not set, the service selects a default.
  1644  func (c *BillingAccountsLocationsListCall) PageSize(pageSize int64) *BillingAccountsLocationsListCall {
  1645  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1646  	return c
  1647  }
  1648  
  1649  // PageToken sets the optional parameter "pageToken": A page token received
  1650  // from the `next_page_token` field in the response. Send that page token to
  1651  // receive the subsequent page.
  1652  func (c *BillingAccountsLocationsListCall) PageToken(pageToken string) *BillingAccountsLocationsListCall {
  1653  	c.urlParams_.Set("pageToken", pageToken)
  1654  	return c
  1655  }
  1656  
  1657  // Fields allows partial responses to be retrieved. See
  1658  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1659  // details.
  1660  func (c *BillingAccountsLocationsListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsListCall {
  1661  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1662  	return c
  1663  }
  1664  
  1665  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1666  // object's ETag matches the given value. This is useful for getting updates
  1667  // only after the object has changed since the last request.
  1668  func (c *BillingAccountsLocationsListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsListCall {
  1669  	c.ifNoneMatch_ = entityTag
  1670  	return c
  1671  }
  1672  
  1673  // Context sets the context to be used in this call's Do method.
  1674  func (c *BillingAccountsLocationsListCall) Context(ctx context.Context) *BillingAccountsLocationsListCall {
  1675  	c.ctx_ = ctx
  1676  	return c
  1677  }
  1678  
  1679  // Header returns a http.Header that can be modified by the caller to add
  1680  // headers to the request.
  1681  func (c *BillingAccountsLocationsListCall) Header() http.Header {
  1682  	if c.header_ == nil {
  1683  		c.header_ = make(http.Header)
  1684  	}
  1685  	return c.header_
  1686  }
  1687  
  1688  func (c *BillingAccountsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  1689  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1690  	if c.ifNoneMatch_ != "" {
  1691  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1692  	}
  1693  	var body io.Reader = nil
  1694  	c.urlParams_.Set("alt", alt)
  1695  	c.urlParams_.Set("prettyPrint", "false")
  1696  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations")
  1697  	urls += "?" + c.urlParams_.Encode()
  1698  	req, err := http.NewRequest("GET", urls, body)
  1699  	if err != nil {
  1700  		return nil, err
  1701  	}
  1702  	req.Header = reqHeaders
  1703  	googleapi.Expand(req.URL, map[string]string{
  1704  		"name": c.name,
  1705  	})
  1706  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1707  }
  1708  
  1709  // Do executes the "recommender.billingAccounts.locations.list" call.
  1710  // Any non-2xx status code is an error. Response headers are in either
  1711  // *GoogleCloudLocationListLocationsResponse.ServerResponse.Header or (if a
  1712  // response was returned at all) in error.(*googleapi.Error).Header. Use
  1713  // googleapi.IsNotModified to check whether the returned error was because
  1714  // http.StatusNotModified was returned.
  1715  func (c *BillingAccountsLocationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudLocationListLocationsResponse, error) {
  1716  	gensupport.SetOptions(c.urlParams_, opts...)
  1717  	res, err := c.doRequest("json")
  1718  	if res != nil && res.StatusCode == http.StatusNotModified {
  1719  		if res.Body != nil {
  1720  			res.Body.Close()
  1721  		}
  1722  		return nil, gensupport.WrapError(&googleapi.Error{
  1723  			Code:   res.StatusCode,
  1724  			Header: res.Header,
  1725  		})
  1726  	}
  1727  	if err != nil {
  1728  		return nil, err
  1729  	}
  1730  	defer googleapi.CloseBody(res)
  1731  	if err := googleapi.CheckResponse(res); err != nil {
  1732  		return nil, gensupport.WrapError(err)
  1733  	}
  1734  	ret := &GoogleCloudLocationListLocationsResponse{
  1735  		ServerResponse: googleapi.ServerResponse{
  1736  			Header:         res.Header,
  1737  			HTTPStatusCode: res.StatusCode,
  1738  		},
  1739  	}
  1740  	target := &ret
  1741  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1742  		return nil, err
  1743  	}
  1744  	return ret, nil
  1745  }
  1746  
  1747  // Pages invokes f for each page of results.
  1748  // A non-nil error returned from f will halt the iteration.
  1749  // The provided context supersedes any context provided to the Context method.
  1750  func (c *BillingAccountsLocationsListCall) Pages(ctx context.Context, f func(*GoogleCloudLocationListLocationsResponse) error) error {
  1751  	c.ctx_ = ctx
  1752  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1753  	for {
  1754  		x, err := c.Do()
  1755  		if err != nil {
  1756  			return err
  1757  		}
  1758  		if err := f(x); err != nil {
  1759  			return err
  1760  		}
  1761  		if x.NextPageToken == "" {
  1762  			return nil
  1763  		}
  1764  		c.PageToken(x.NextPageToken)
  1765  	}
  1766  }
  1767  
  1768  type BillingAccountsLocationsInsightTypesGetConfigCall struct {
  1769  	s            *Service
  1770  	name         string
  1771  	urlParams_   gensupport.URLParams
  1772  	ifNoneMatch_ string
  1773  	ctx_         context.Context
  1774  	header_      http.Header
  1775  }
  1776  
  1777  // GetConfig: Gets the requested InsightTypeConfig. There is only one instance
  1778  // of the config for each InsightType.
  1779  //
  1780  //   - name: Name of the InsightTypeConfig to get. Acceptable formats: *
  1781  //     `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_
  1782  //     ID]/config` *
  1783  //     `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/
  1784  //     config` *
  1785  //     `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT
  1786  //     _TYPE_ID]/config` *
  1787  //     `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[IN
  1788  //     SIGHT_TYPE_ID]/config`.
  1789  func (r *BillingAccountsLocationsInsightTypesService) GetConfig(name string) *BillingAccountsLocationsInsightTypesGetConfigCall {
  1790  	c := &BillingAccountsLocationsInsightTypesGetConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1791  	c.name = name
  1792  	return c
  1793  }
  1794  
  1795  // Fields allows partial responses to be retrieved. See
  1796  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1797  // details.
  1798  func (c *BillingAccountsLocationsInsightTypesGetConfigCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsInsightTypesGetConfigCall {
  1799  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1800  	return c
  1801  }
  1802  
  1803  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1804  // object's ETag matches the given value. This is useful for getting updates
  1805  // only after the object has changed since the last request.
  1806  func (c *BillingAccountsLocationsInsightTypesGetConfigCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsInsightTypesGetConfigCall {
  1807  	c.ifNoneMatch_ = entityTag
  1808  	return c
  1809  }
  1810  
  1811  // Context sets the context to be used in this call's Do method.
  1812  func (c *BillingAccountsLocationsInsightTypesGetConfigCall) Context(ctx context.Context) *BillingAccountsLocationsInsightTypesGetConfigCall {
  1813  	c.ctx_ = ctx
  1814  	return c
  1815  }
  1816  
  1817  // Header returns a http.Header that can be modified by the caller to add
  1818  // headers to the request.
  1819  func (c *BillingAccountsLocationsInsightTypesGetConfigCall) Header() http.Header {
  1820  	if c.header_ == nil {
  1821  		c.header_ = make(http.Header)
  1822  	}
  1823  	return c.header_
  1824  }
  1825  
  1826  func (c *BillingAccountsLocationsInsightTypesGetConfigCall) doRequest(alt string) (*http.Response, error) {
  1827  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1828  	if c.ifNoneMatch_ != "" {
  1829  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1830  	}
  1831  	var body io.Reader = nil
  1832  	c.urlParams_.Set("alt", alt)
  1833  	c.urlParams_.Set("prettyPrint", "false")
  1834  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1835  	urls += "?" + c.urlParams_.Encode()
  1836  	req, err := http.NewRequest("GET", urls, body)
  1837  	if err != nil {
  1838  		return nil, err
  1839  	}
  1840  	req.Header = reqHeaders
  1841  	googleapi.Expand(req.URL, map[string]string{
  1842  		"name": c.name,
  1843  	})
  1844  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1845  }
  1846  
  1847  // Do executes the "recommender.billingAccounts.locations.insightTypes.getConfig" call.
  1848  // Any non-2xx status code is an error. Response headers are in either
  1849  // *GoogleCloudRecommenderV1beta1InsightTypeConfig.ServerResponse.Header or (if
  1850  // a response was returned at all) in error.(*googleapi.Error).Header. Use
  1851  // googleapi.IsNotModified to check whether the returned error was because
  1852  // http.StatusNotModified was returned.
  1853  func (c *BillingAccountsLocationsInsightTypesGetConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1InsightTypeConfig, error) {
  1854  	gensupport.SetOptions(c.urlParams_, opts...)
  1855  	res, err := c.doRequest("json")
  1856  	if res != nil && res.StatusCode == http.StatusNotModified {
  1857  		if res.Body != nil {
  1858  			res.Body.Close()
  1859  		}
  1860  		return nil, gensupport.WrapError(&googleapi.Error{
  1861  			Code:   res.StatusCode,
  1862  			Header: res.Header,
  1863  		})
  1864  	}
  1865  	if err != nil {
  1866  		return nil, err
  1867  	}
  1868  	defer googleapi.CloseBody(res)
  1869  	if err := googleapi.CheckResponse(res); err != nil {
  1870  		return nil, gensupport.WrapError(err)
  1871  	}
  1872  	ret := &GoogleCloudRecommenderV1beta1InsightTypeConfig{
  1873  		ServerResponse: googleapi.ServerResponse{
  1874  			Header:         res.Header,
  1875  			HTTPStatusCode: res.StatusCode,
  1876  		},
  1877  	}
  1878  	target := &ret
  1879  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1880  		return nil, err
  1881  	}
  1882  	return ret, nil
  1883  }
  1884  
  1885  type BillingAccountsLocationsInsightTypesUpdateConfigCall struct {
  1886  	s                                              *Service
  1887  	name                                           string
  1888  	googlecloudrecommenderv1beta1insighttypeconfig *GoogleCloudRecommenderV1beta1InsightTypeConfig
  1889  	urlParams_                                     gensupport.URLParams
  1890  	ctx_                                           context.Context
  1891  	header_                                        http.Header
  1892  }
  1893  
  1894  // UpdateConfig: Updates an InsightTypeConfig change. This will create a new
  1895  // revision of the config.
  1896  //
  1897  //   - name: Identifier. Name of insight type config. Eg,
  1898  //     projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_I
  1899  //     D]/config.
  1900  func (r *BillingAccountsLocationsInsightTypesService) UpdateConfig(name string, googlecloudrecommenderv1beta1insighttypeconfig *GoogleCloudRecommenderV1beta1InsightTypeConfig) *BillingAccountsLocationsInsightTypesUpdateConfigCall {
  1901  	c := &BillingAccountsLocationsInsightTypesUpdateConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1902  	c.name = name
  1903  	c.googlecloudrecommenderv1beta1insighttypeconfig = googlecloudrecommenderv1beta1insighttypeconfig
  1904  	return c
  1905  }
  1906  
  1907  // UpdateMask sets the optional parameter "updateMask": The list of fields to
  1908  // be updated.
  1909  func (c *BillingAccountsLocationsInsightTypesUpdateConfigCall) UpdateMask(updateMask string) *BillingAccountsLocationsInsightTypesUpdateConfigCall {
  1910  	c.urlParams_.Set("updateMask", updateMask)
  1911  	return c
  1912  }
  1913  
  1914  // ValidateOnly sets the optional parameter "validateOnly": If true, validate
  1915  // the request and preview the change, but do not actually update it.
  1916  func (c *BillingAccountsLocationsInsightTypesUpdateConfigCall) ValidateOnly(validateOnly bool) *BillingAccountsLocationsInsightTypesUpdateConfigCall {
  1917  	c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  1918  	return c
  1919  }
  1920  
  1921  // Fields allows partial responses to be retrieved. See
  1922  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1923  // details.
  1924  func (c *BillingAccountsLocationsInsightTypesUpdateConfigCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsInsightTypesUpdateConfigCall {
  1925  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1926  	return c
  1927  }
  1928  
  1929  // Context sets the context to be used in this call's Do method.
  1930  func (c *BillingAccountsLocationsInsightTypesUpdateConfigCall) Context(ctx context.Context) *BillingAccountsLocationsInsightTypesUpdateConfigCall {
  1931  	c.ctx_ = ctx
  1932  	return c
  1933  }
  1934  
  1935  // Header returns a http.Header that can be modified by the caller to add
  1936  // headers to the request.
  1937  func (c *BillingAccountsLocationsInsightTypesUpdateConfigCall) Header() http.Header {
  1938  	if c.header_ == nil {
  1939  		c.header_ = make(http.Header)
  1940  	}
  1941  	return c.header_
  1942  }
  1943  
  1944  func (c *BillingAccountsLocationsInsightTypesUpdateConfigCall) doRequest(alt string) (*http.Response, error) {
  1945  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1946  	var body io.Reader = nil
  1947  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1insighttypeconfig)
  1948  	if err != nil {
  1949  		return nil, err
  1950  	}
  1951  	c.urlParams_.Set("alt", alt)
  1952  	c.urlParams_.Set("prettyPrint", "false")
  1953  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1954  	urls += "?" + c.urlParams_.Encode()
  1955  	req, err := http.NewRequest("PATCH", urls, body)
  1956  	if err != nil {
  1957  		return nil, err
  1958  	}
  1959  	req.Header = reqHeaders
  1960  	googleapi.Expand(req.URL, map[string]string{
  1961  		"name": c.name,
  1962  	})
  1963  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1964  }
  1965  
  1966  // Do executes the "recommender.billingAccounts.locations.insightTypes.updateConfig" call.
  1967  // Any non-2xx status code is an error. Response headers are in either
  1968  // *GoogleCloudRecommenderV1beta1InsightTypeConfig.ServerResponse.Header or (if
  1969  // a response was returned at all) in error.(*googleapi.Error).Header. Use
  1970  // googleapi.IsNotModified to check whether the returned error was because
  1971  // http.StatusNotModified was returned.
  1972  func (c *BillingAccountsLocationsInsightTypesUpdateConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1InsightTypeConfig, error) {
  1973  	gensupport.SetOptions(c.urlParams_, opts...)
  1974  	res, err := c.doRequest("json")
  1975  	if res != nil && res.StatusCode == http.StatusNotModified {
  1976  		if res.Body != nil {
  1977  			res.Body.Close()
  1978  		}
  1979  		return nil, gensupport.WrapError(&googleapi.Error{
  1980  			Code:   res.StatusCode,
  1981  			Header: res.Header,
  1982  		})
  1983  	}
  1984  	if err != nil {
  1985  		return nil, err
  1986  	}
  1987  	defer googleapi.CloseBody(res)
  1988  	if err := googleapi.CheckResponse(res); err != nil {
  1989  		return nil, gensupport.WrapError(err)
  1990  	}
  1991  	ret := &GoogleCloudRecommenderV1beta1InsightTypeConfig{
  1992  		ServerResponse: googleapi.ServerResponse{
  1993  			Header:         res.Header,
  1994  			HTTPStatusCode: res.StatusCode,
  1995  		},
  1996  	}
  1997  	target := &ret
  1998  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1999  		return nil, err
  2000  	}
  2001  	return ret, nil
  2002  }
  2003  
  2004  type BillingAccountsLocationsInsightTypesInsightsGetCall struct {
  2005  	s            *Service
  2006  	name         string
  2007  	urlParams_   gensupport.URLParams
  2008  	ifNoneMatch_ string
  2009  	ctx_         context.Context
  2010  	header_      http.Header
  2011  }
  2012  
  2013  // Get: Gets the requested insight. Requires the recommender.*.get IAM
  2014  // permission for the specified insight type.
  2015  //
  2016  // - name: Name of the insight.
  2017  func (r *BillingAccountsLocationsInsightTypesInsightsService) Get(name string) *BillingAccountsLocationsInsightTypesInsightsGetCall {
  2018  	c := &BillingAccountsLocationsInsightTypesInsightsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2019  	c.name = name
  2020  	return c
  2021  }
  2022  
  2023  // Fields allows partial responses to be retrieved. See
  2024  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2025  // details.
  2026  func (c *BillingAccountsLocationsInsightTypesInsightsGetCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsInsightTypesInsightsGetCall {
  2027  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2028  	return c
  2029  }
  2030  
  2031  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2032  // object's ETag matches the given value. This is useful for getting updates
  2033  // only after the object has changed since the last request.
  2034  func (c *BillingAccountsLocationsInsightTypesInsightsGetCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsInsightTypesInsightsGetCall {
  2035  	c.ifNoneMatch_ = entityTag
  2036  	return c
  2037  }
  2038  
  2039  // Context sets the context to be used in this call's Do method.
  2040  func (c *BillingAccountsLocationsInsightTypesInsightsGetCall) Context(ctx context.Context) *BillingAccountsLocationsInsightTypesInsightsGetCall {
  2041  	c.ctx_ = ctx
  2042  	return c
  2043  }
  2044  
  2045  // Header returns a http.Header that can be modified by the caller to add
  2046  // headers to the request.
  2047  func (c *BillingAccountsLocationsInsightTypesInsightsGetCall) Header() http.Header {
  2048  	if c.header_ == nil {
  2049  		c.header_ = make(http.Header)
  2050  	}
  2051  	return c.header_
  2052  }
  2053  
  2054  func (c *BillingAccountsLocationsInsightTypesInsightsGetCall) doRequest(alt string) (*http.Response, error) {
  2055  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2056  	if c.ifNoneMatch_ != "" {
  2057  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2058  	}
  2059  	var body io.Reader = nil
  2060  	c.urlParams_.Set("alt", alt)
  2061  	c.urlParams_.Set("prettyPrint", "false")
  2062  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2063  	urls += "?" + c.urlParams_.Encode()
  2064  	req, err := http.NewRequest("GET", urls, body)
  2065  	if err != nil {
  2066  		return nil, err
  2067  	}
  2068  	req.Header = reqHeaders
  2069  	googleapi.Expand(req.URL, map[string]string{
  2070  		"name": c.name,
  2071  	})
  2072  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2073  }
  2074  
  2075  // Do executes the "recommender.billingAccounts.locations.insightTypes.insights.get" call.
  2076  // Any non-2xx status code is an error. Response headers are in either
  2077  // *GoogleCloudRecommenderV1beta1Insight.ServerResponse.Header or (if a
  2078  // response was returned at all) in error.(*googleapi.Error).Header. Use
  2079  // googleapi.IsNotModified to check whether the returned error was because
  2080  // http.StatusNotModified was returned.
  2081  func (c *BillingAccountsLocationsInsightTypesInsightsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Insight, error) {
  2082  	gensupport.SetOptions(c.urlParams_, opts...)
  2083  	res, err := c.doRequest("json")
  2084  	if res != nil && res.StatusCode == http.StatusNotModified {
  2085  		if res.Body != nil {
  2086  			res.Body.Close()
  2087  		}
  2088  		return nil, gensupport.WrapError(&googleapi.Error{
  2089  			Code:   res.StatusCode,
  2090  			Header: res.Header,
  2091  		})
  2092  	}
  2093  	if err != nil {
  2094  		return nil, err
  2095  	}
  2096  	defer googleapi.CloseBody(res)
  2097  	if err := googleapi.CheckResponse(res); err != nil {
  2098  		return nil, gensupport.WrapError(err)
  2099  	}
  2100  	ret := &GoogleCloudRecommenderV1beta1Insight{
  2101  		ServerResponse: googleapi.ServerResponse{
  2102  			Header:         res.Header,
  2103  			HTTPStatusCode: res.StatusCode,
  2104  		},
  2105  	}
  2106  	target := &ret
  2107  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2108  		return nil, err
  2109  	}
  2110  	return ret, nil
  2111  }
  2112  
  2113  type BillingAccountsLocationsInsightTypesInsightsListCall struct {
  2114  	s            *Service
  2115  	parent       string
  2116  	urlParams_   gensupport.URLParams
  2117  	ifNoneMatch_ string
  2118  	ctx_         context.Context
  2119  	header_      http.Header
  2120  }
  2121  
  2122  // List: Lists insights for the specified Cloud Resource. Requires the
  2123  // recommender.*.list IAM permission for the specified insight type.
  2124  //
  2125  //   - parent: The container resource on which to execute the request. Acceptable
  2126  //     formats: *
  2127  //     `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_
  2128  //     ID]` *
  2129  //     `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]`
  2130  //     *
  2131  //     `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[IN
  2132  //     SIGHT_TYPE_ID]` *
  2133  //     `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]`
  2134  //     *
  2135  //     `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT
  2136  //     _TYPE_ID]` LOCATION here refers to GCP Locations:
  2137  //     https://cloud.google.com/about/locations/ INSIGHT_TYPE_ID refers to
  2138  //     supported insight types:
  2139  //     https://cloud.google.com/recommender/docs/insights/insight-types.
  2140  func (r *BillingAccountsLocationsInsightTypesInsightsService) List(parent string) *BillingAccountsLocationsInsightTypesInsightsListCall {
  2141  	c := &BillingAccountsLocationsInsightTypesInsightsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2142  	c.parent = parent
  2143  	return c
  2144  }
  2145  
  2146  // Filter sets the optional parameter "filter": Filter expression to restrict
  2147  // the insights returned. Supported filter fields: * `stateInfo.state` *
  2148  // `insightSubtype` * `severity` * `targetResources` Examples: *
  2149  // `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` * `insightSubtype
  2150  // = PERMISSIONS_USAGE` * `severity = CRITICAL OR severity = HIGH` *
  2151  // `targetResources :
  2152  // //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance
  2153  // -1` * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity =
  2154  // HIGH)` The max allowed filter length is 500 characters. (These expressions
  2155  // are based on the filter language described at https://google.aip.dev/160)
  2156  func (c *BillingAccountsLocationsInsightTypesInsightsListCall) Filter(filter string) *BillingAccountsLocationsInsightTypesInsightsListCall {
  2157  	c.urlParams_.Set("filter", filter)
  2158  	return c
  2159  }
  2160  
  2161  // PageSize sets the optional parameter "pageSize": The maximum number of
  2162  // results to return from this request. Non-positive values are ignored. If not
  2163  // specified, the server will determine the number of results to return.
  2164  func (c *BillingAccountsLocationsInsightTypesInsightsListCall) PageSize(pageSize int64) *BillingAccountsLocationsInsightTypesInsightsListCall {
  2165  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2166  	return c
  2167  }
  2168  
  2169  // PageToken sets the optional parameter "pageToken": If present, retrieves the
  2170  // next batch of results from the preceding call to this method. `page_token`
  2171  // must be the value of `next_page_token` from the previous response. The
  2172  // values of other method parameters must be identical to those in the previous
  2173  // call.
  2174  func (c *BillingAccountsLocationsInsightTypesInsightsListCall) PageToken(pageToken string) *BillingAccountsLocationsInsightTypesInsightsListCall {
  2175  	c.urlParams_.Set("pageToken", pageToken)
  2176  	return c
  2177  }
  2178  
  2179  // Fields allows partial responses to be retrieved. See
  2180  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2181  // details.
  2182  func (c *BillingAccountsLocationsInsightTypesInsightsListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsInsightTypesInsightsListCall {
  2183  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2184  	return c
  2185  }
  2186  
  2187  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2188  // object's ETag matches the given value. This is useful for getting updates
  2189  // only after the object has changed since the last request.
  2190  func (c *BillingAccountsLocationsInsightTypesInsightsListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsInsightTypesInsightsListCall {
  2191  	c.ifNoneMatch_ = entityTag
  2192  	return c
  2193  }
  2194  
  2195  // Context sets the context to be used in this call's Do method.
  2196  func (c *BillingAccountsLocationsInsightTypesInsightsListCall) Context(ctx context.Context) *BillingAccountsLocationsInsightTypesInsightsListCall {
  2197  	c.ctx_ = ctx
  2198  	return c
  2199  }
  2200  
  2201  // Header returns a http.Header that can be modified by the caller to add
  2202  // headers to the request.
  2203  func (c *BillingAccountsLocationsInsightTypesInsightsListCall) Header() http.Header {
  2204  	if c.header_ == nil {
  2205  		c.header_ = make(http.Header)
  2206  	}
  2207  	return c.header_
  2208  }
  2209  
  2210  func (c *BillingAccountsLocationsInsightTypesInsightsListCall) doRequest(alt string) (*http.Response, error) {
  2211  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2212  	if c.ifNoneMatch_ != "" {
  2213  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2214  	}
  2215  	var body io.Reader = nil
  2216  	c.urlParams_.Set("alt", alt)
  2217  	c.urlParams_.Set("prettyPrint", "false")
  2218  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/insights")
  2219  	urls += "?" + c.urlParams_.Encode()
  2220  	req, err := http.NewRequest("GET", urls, body)
  2221  	if err != nil {
  2222  		return nil, err
  2223  	}
  2224  	req.Header = reqHeaders
  2225  	googleapi.Expand(req.URL, map[string]string{
  2226  		"parent": c.parent,
  2227  	})
  2228  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2229  }
  2230  
  2231  // Do executes the "recommender.billingAccounts.locations.insightTypes.insights.list" call.
  2232  // Any non-2xx status code is an error. Response headers are in either
  2233  // *GoogleCloudRecommenderV1beta1ListInsightsResponse.ServerResponse.Header or
  2234  // (if a response was returned at all) in error.(*googleapi.Error).Header. Use
  2235  // googleapi.IsNotModified to check whether the returned error was because
  2236  // http.StatusNotModified was returned.
  2237  func (c *BillingAccountsLocationsInsightTypesInsightsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1ListInsightsResponse, error) {
  2238  	gensupport.SetOptions(c.urlParams_, opts...)
  2239  	res, err := c.doRequest("json")
  2240  	if res != nil && res.StatusCode == http.StatusNotModified {
  2241  		if res.Body != nil {
  2242  			res.Body.Close()
  2243  		}
  2244  		return nil, gensupport.WrapError(&googleapi.Error{
  2245  			Code:   res.StatusCode,
  2246  			Header: res.Header,
  2247  		})
  2248  	}
  2249  	if err != nil {
  2250  		return nil, err
  2251  	}
  2252  	defer googleapi.CloseBody(res)
  2253  	if err := googleapi.CheckResponse(res); err != nil {
  2254  		return nil, gensupport.WrapError(err)
  2255  	}
  2256  	ret := &GoogleCloudRecommenderV1beta1ListInsightsResponse{
  2257  		ServerResponse: googleapi.ServerResponse{
  2258  			Header:         res.Header,
  2259  			HTTPStatusCode: res.StatusCode,
  2260  		},
  2261  	}
  2262  	target := &ret
  2263  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2264  		return nil, err
  2265  	}
  2266  	return ret, nil
  2267  }
  2268  
  2269  // Pages invokes f for each page of results.
  2270  // A non-nil error returned from f will halt the iteration.
  2271  // The provided context supersedes any context provided to the Context method.
  2272  func (c *BillingAccountsLocationsInsightTypesInsightsListCall) Pages(ctx context.Context, f func(*GoogleCloudRecommenderV1beta1ListInsightsResponse) error) error {
  2273  	c.ctx_ = ctx
  2274  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2275  	for {
  2276  		x, err := c.Do()
  2277  		if err != nil {
  2278  			return err
  2279  		}
  2280  		if err := f(x); err != nil {
  2281  			return err
  2282  		}
  2283  		if x.NextPageToken == "" {
  2284  			return nil
  2285  		}
  2286  		c.PageToken(x.NextPageToken)
  2287  	}
  2288  }
  2289  
  2290  type BillingAccountsLocationsInsightTypesInsightsMarkAcceptedCall struct {
  2291  	s                                                       *Service
  2292  	name                                                    string
  2293  	googlecloudrecommenderv1beta1markinsightacceptedrequest *GoogleCloudRecommenderV1beta1MarkInsightAcceptedRequest
  2294  	urlParams_                                              gensupport.URLParams
  2295  	ctx_                                                    context.Context
  2296  	header_                                                 http.Header
  2297  }
  2298  
  2299  // MarkAccepted: Marks the Insight State as Accepted. Users can use this method
  2300  // to indicate to the Recommender API that they have applied some action based
  2301  // on the insight. This stops the insight content from being updated.
  2302  // MarkInsightAccepted can be applied to insights in ACTIVE state. Requires the
  2303  // recommender.*.update IAM permission for the specified insight.
  2304  //
  2305  // - name: Name of the insight.
  2306  func (r *BillingAccountsLocationsInsightTypesInsightsService) MarkAccepted(name string, googlecloudrecommenderv1beta1markinsightacceptedrequest *GoogleCloudRecommenderV1beta1MarkInsightAcceptedRequest) *BillingAccountsLocationsInsightTypesInsightsMarkAcceptedCall {
  2307  	c := &BillingAccountsLocationsInsightTypesInsightsMarkAcceptedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2308  	c.name = name
  2309  	c.googlecloudrecommenderv1beta1markinsightacceptedrequest = googlecloudrecommenderv1beta1markinsightacceptedrequest
  2310  	return c
  2311  }
  2312  
  2313  // Fields allows partial responses to be retrieved. See
  2314  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2315  // details.
  2316  func (c *BillingAccountsLocationsInsightTypesInsightsMarkAcceptedCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsInsightTypesInsightsMarkAcceptedCall {
  2317  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2318  	return c
  2319  }
  2320  
  2321  // Context sets the context to be used in this call's Do method.
  2322  func (c *BillingAccountsLocationsInsightTypesInsightsMarkAcceptedCall) Context(ctx context.Context) *BillingAccountsLocationsInsightTypesInsightsMarkAcceptedCall {
  2323  	c.ctx_ = ctx
  2324  	return c
  2325  }
  2326  
  2327  // Header returns a http.Header that can be modified by the caller to add
  2328  // headers to the request.
  2329  func (c *BillingAccountsLocationsInsightTypesInsightsMarkAcceptedCall) Header() http.Header {
  2330  	if c.header_ == nil {
  2331  		c.header_ = make(http.Header)
  2332  	}
  2333  	return c.header_
  2334  }
  2335  
  2336  func (c *BillingAccountsLocationsInsightTypesInsightsMarkAcceptedCall) doRequest(alt string) (*http.Response, error) {
  2337  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2338  	var body io.Reader = nil
  2339  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markinsightacceptedrequest)
  2340  	if err != nil {
  2341  		return nil, err
  2342  	}
  2343  	c.urlParams_.Set("alt", alt)
  2344  	c.urlParams_.Set("prettyPrint", "false")
  2345  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markAccepted")
  2346  	urls += "?" + c.urlParams_.Encode()
  2347  	req, err := http.NewRequest("POST", urls, body)
  2348  	if err != nil {
  2349  		return nil, err
  2350  	}
  2351  	req.Header = reqHeaders
  2352  	googleapi.Expand(req.URL, map[string]string{
  2353  		"name": c.name,
  2354  	})
  2355  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2356  }
  2357  
  2358  // Do executes the "recommender.billingAccounts.locations.insightTypes.insights.markAccepted" call.
  2359  // Any non-2xx status code is an error. Response headers are in either
  2360  // *GoogleCloudRecommenderV1beta1Insight.ServerResponse.Header or (if a
  2361  // response was returned at all) in error.(*googleapi.Error).Header. Use
  2362  // googleapi.IsNotModified to check whether the returned error was because
  2363  // http.StatusNotModified was returned.
  2364  func (c *BillingAccountsLocationsInsightTypesInsightsMarkAcceptedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Insight, error) {
  2365  	gensupport.SetOptions(c.urlParams_, opts...)
  2366  	res, err := c.doRequest("json")
  2367  	if res != nil && res.StatusCode == http.StatusNotModified {
  2368  		if res.Body != nil {
  2369  			res.Body.Close()
  2370  		}
  2371  		return nil, gensupport.WrapError(&googleapi.Error{
  2372  			Code:   res.StatusCode,
  2373  			Header: res.Header,
  2374  		})
  2375  	}
  2376  	if err != nil {
  2377  		return nil, err
  2378  	}
  2379  	defer googleapi.CloseBody(res)
  2380  	if err := googleapi.CheckResponse(res); err != nil {
  2381  		return nil, gensupport.WrapError(err)
  2382  	}
  2383  	ret := &GoogleCloudRecommenderV1beta1Insight{
  2384  		ServerResponse: googleapi.ServerResponse{
  2385  			Header:         res.Header,
  2386  			HTTPStatusCode: res.StatusCode,
  2387  		},
  2388  	}
  2389  	target := &ret
  2390  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2391  		return nil, err
  2392  	}
  2393  	return ret, nil
  2394  }
  2395  
  2396  type BillingAccountsLocationsRecommendersGetConfigCall struct {
  2397  	s            *Service
  2398  	name         string
  2399  	urlParams_   gensupport.URLParams
  2400  	ifNoneMatch_ string
  2401  	ctx_         context.Context
  2402  	header_      http.Header
  2403  }
  2404  
  2405  // GetConfig: Gets the requested Recommender Config. There is only one instance
  2406  // of the config for each Recommender.
  2407  //
  2408  //   - name: Name of the Recommendation Config to get. Acceptable formats: *
  2409  //     `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_I
  2410  //     D]/config` *
  2411  //     `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/c
  2412  //     onfig` *
  2413  //     `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMME
  2414  //     NDER_ID]/config` *
  2415  //     `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RE
  2416  //     COMMENDER_ID]/config`.
  2417  func (r *BillingAccountsLocationsRecommendersService) GetConfig(name string) *BillingAccountsLocationsRecommendersGetConfigCall {
  2418  	c := &BillingAccountsLocationsRecommendersGetConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2419  	c.name = name
  2420  	return c
  2421  }
  2422  
  2423  // Fields allows partial responses to be retrieved. See
  2424  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2425  // details.
  2426  func (c *BillingAccountsLocationsRecommendersGetConfigCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsRecommendersGetConfigCall {
  2427  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2428  	return c
  2429  }
  2430  
  2431  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2432  // object's ETag matches the given value. This is useful for getting updates
  2433  // only after the object has changed since the last request.
  2434  func (c *BillingAccountsLocationsRecommendersGetConfigCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsRecommendersGetConfigCall {
  2435  	c.ifNoneMatch_ = entityTag
  2436  	return c
  2437  }
  2438  
  2439  // Context sets the context to be used in this call's Do method.
  2440  func (c *BillingAccountsLocationsRecommendersGetConfigCall) Context(ctx context.Context) *BillingAccountsLocationsRecommendersGetConfigCall {
  2441  	c.ctx_ = ctx
  2442  	return c
  2443  }
  2444  
  2445  // Header returns a http.Header that can be modified by the caller to add
  2446  // headers to the request.
  2447  func (c *BillingAccountsLocationsRecommendersGetConfigCall) Header() http.Header {
  2448  	if c.header_ == nil {
  2449  		c.header_ = make(http.Header)
  2450  	}
  2451  	return c.header_
  2452  }
  2453  
  2454  func (c *BillingAccountsLocationsRecommendersGetConfigCall) doRequest(alt string) (*http.Response, error) {
  2455  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2456  	if c.ifNoneMatch_ != "" {
  2457  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2458  	}
  2459  	var body io.Reader = nil
  2460  	c.urlParams_.Set("alt", alt)
  2461  	c.urlParams_.Set("prettyPrint", "false")
  2462  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2463  	urls += "?" + c.urlParams_.Encode()
  2464  	req, err := http.NewRequest("GET", urls, body)
  2465  	if err != nil {
  2466  		return nil, err
  2467  	}
  2468  	req.Header = reqHeaders
  2469  	googleapi.Expand(req.URL, map[string]string{
  2470  		"name": c.name,
  2471  	})
  2472  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2473  }
  2474  
  2475  // Do executes the "recommender.billingAccounts.locations.recommenders.getConfig" call.
  2476  // Any non-2xx status code is an error. Response headers are in either
  2477  // *GoogleCloudRecommenderV1beta1RecommenderConfig.ServerResponse.Header or (if
  2478  // a response was returned at all) in error.(*googleapi.Error).Header. Use
  2479  // googleapi.IsNotModified to check whether the returned error was because
  2480  // http.StatusNotModified was returned.
  2481  func (c *BillingAccountsLocationsRecommendersGetConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1RecommenderConfig, error) {
  2482  	gensupport.SetOptions(c.urlParams_, opts...)
  2483  	res, err := c.doRequest("json")
  2484  	if res != nil && res.StatusCode == http.StatusNotModified {
  2485  		if res.Body != nil {
  2486  			res.Body.Close()
  2487  		}
  2488  		return nil, gensupport.WrapError(&googleapi.Error{
  2489  			Code:   res.StatusCode,
  2490  			Header: res.Header,
  2491  		})
  2492  	}
  2493  	if err != nil {
  2494  		return nil, err
  2495  	}
  2496  	defer googleapi.CloseBody(res)
  2497  	if err := googleapi.CheckResponse(res); err != nil {
  2498  		return nil, gensupport.WrapError(err)
  2499  	}
  2500  	ret := &GoogleCloudRecommenderV1beta1RecommenderConfig{
  2501  		ServerResponse: googleapi.ServerResponse{
  2502  			Header:         res.Header,
  2503  			HTTPStatusCode: res.StatusCode,
  2504  		},
  2505  	}
  2506  	target := &ret
  2507  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2508  		return nil, err
  2509  	}
  2510  	return ret, nil
  2511  }
  2512  
  2513  type BillingAccountsLocationsRecommendersUpdateConfigCall struct {
  2514  	s                                              *Service
  2515  	name                                           string
  2516  	googlecloudrecommenderv1beta1recommenderconfig *GoogleCloudRecommenderV1beta1RecommenderConfig
  2517  	urlParams_                                     gensupport.URLParams
  2518  	ctx_                                           context.Context
  2519  	header_                                        http.Header
  2520  }
  2521  
  2522  // UpdateConfig: Updates a Recommender Config. This will create a new revision
  2523  // of the config.
  2524  //
  2525  //   - name: Identifier. Name of recommender config. Eg,
  2526  //     projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID
  2527  //     ]/config.
  2528  func (r *BillingAccountsLocationsRecommendersService) UpdateConfig(name string, googlecloudrecommenderv1beta1recommenderconfig *GoogleCloudRecommenderV1beta1RecommenderConfig) *BillingAccountsLocationsRecommendersUpdateConfigCall {
  2529  	c := &BillingAccountsLocationsRecommendersUpdateConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2530  	c.name = name
  2531  	c.googlecloudrecommenderv1beta1recommenderconfig = googlecloudrecommenderv1beta1recommenderconfig
  2532  	return c
  2533  }
  2534  
  2535  // UpdateMask sets the optional parameter "updateMask": The list of fields to
  2536  // be updated.
  2537  func (c *BillingAccountsLocationsRecommendersUpdateConfigCall) UpdateMask(updateMask string) *BillingAccountsLocationsRecommendersUpdateConfigCall {
  2538  	c.urlParams_.Set("updateMask", updateMask)
  2539  	return c
  2540  }
  2541  
  2542  // ValidateOnly sets the optional parameter "validateOnly": If true, validate
  2543  // the request and preview the change, but do not actually update it.
  2544  func (c *BillingAccountsLocationsRecommendersUpdateConfigCall) ValidateOnly(validateOnly bool) *BillingAccountsLocationsRecommendersUpdateConfigCall {
  2545  	c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  2546  	return c
  2547  }
  2548  
  2549  // Fields allows partial responses to be retrieved. See
  2550  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2551  // details.
  2552  func (c *BillingAccountsLocationsRecommendersUpdateConfigCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsRecommendersUpdateConfigCall {
  2553  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2554  	return c
  2555  }
  2556  
  2557  // Context sets the context to be used in this call's Do method.
  2558  func (c *BillingAccountsLocationsRecommendersUpdateConfigCall) Context(ctx context.Context) *BillingAccountsLocationsRecommendersUpdateConfigCall {
  2559  	c.ctx_ = ctx
  2560  	return c
  2561  }
  2562  
  2563  // Header returns a http.Header that can be modified by the caller to add
  2564  // headers to the request.
  2565  func (c *BillingAccountsLocationsRecommendersUpdateConfigCall) Header() http.Header {
  2566  	if c.header_ == nil {
  2567  		c.header_ = make(http.Header)
  2568  	}
  2569  	return c.header_
  2570  }
  2571  
  2572  func (c *BillingAccountsLocationsRecommendersUpdateConfigCall) doRequest(alt string) (*http.Response, error) {
  2573  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2574  	var body io.Reader = nil
  2575  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1recommenderconfig)
  2576  	if err != nil {
  2577  		return nil, err
  2578  	}
  2579  	c.urlParams_.Set("alt", alt)
  2580  	c.urlParams_.Set("prettyPrint", "false")
  2581  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2582  	urls += "?" + c.urlParams_.Encode()
  2583  	req, err := http.NewRequest("PATCH", urls, body)
  2584  	if err != nil {
  2585  		return nil, err
  2586  	}
  2587  	req.Header = reqHeaders
  2588  	googleapi.Expand(req.URL, map[string]string{
  2589  		"name": c.name,
  2590  	})
  2591  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2592  }
  2593  
  2594  // Do executes the "recommender.billingAccounts.locations.recommenders.updateConfig" call.
  2595  // Any non-2xx status code is an error. Response headers are in either
  2596  // *GoogleCloudRecommenderV1beta1RecommenderConfig.ServerResponse.Header or (if
  2597  // a response was returned at all) in error.(*googleapi.Error).Header. Use
  2598  // googleapi.IsNotModified to check whether the returned error was because
  2599  // http.StatusNotModified was returned.
  2600  func (c *BillingAccountsLocationsRecommendersUpdateConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1RecommenderConfig, error) {
  2601  	gensupport.SetOptions(c.urlParams_, opts...)
  2602  	res, err := c.doRequest("json")
  2603  	if res != nil && res.StatusCode == http.StatusNotModified {
  2604  		if res.Body != nil {
  2605  			res.Body.Close()
  2606  		}
  2607  		return nil, gensupport.WrapError(&googleapi.Error{
  2608  			Code:   res.StatusCode,
  2609  			Header: res.Header,
  2610  		})
  2611  	}
  2612  	if err != nil {
  2613  		return nil, err
  2614  	}
  2615  	defer googleapi.CloseBody(res)
  2616  	if err := googleapi.CheckResponse(res); err != nil {
  2617  		return nil, gensupport.WrapError(err)
  2618  	}
  2619  	ret := &GoogleCloudRecommenderV1beta1RecommenderConfig{
  2620  		ServerResponse: googleapi.ServerResponse{
  2621  			Header:         res.Header,
  2622  			HTTPStatusCode: res.StatusCode,
  2623  		},
  2624  	}
  2625  	target := &ret
  2626  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2627  		return nil, err
  2628  	}
  2629  	return ret, nil
  2630  }
  2631  
  2632  type BillingAccountsLocationsRecommendersRecommendationsGetCall struct {
  2633  	s            *Service
  2634  	name         string
  2635  	urlParams_   gensupport.URLParams
  2636  	ifNoneMatch_ string
  2637  	ctx_         context.Context
  2638  	header_      http.Header
  2639  }
  2640  
  2641  // Get: Gets the requested recommendation. Requires the recommender.*.get IAM
  2642  // permission for the specified recommender.
  2643  //
  2644  // - name: Name of the recommendation.
  2645  func (r *BillingAccountsLocationsRecommendersRecommendationsService) Get(name string) *BillingAccountsLocationsRecommendersRecommendationsGetCall {
  2646  	c := &BillingAccountsLocationsRecommendersRecommendationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2647  	c.name = name
  2648  	return c
  2649  }
  2650  
  2651  // Fields allows partial responses to be retrieved. See
  2652  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2653  // details.
  2654  func (c *BillingAccountsLocationsRecommendersRecommendationsGetCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsRecommendersRecommendationsGetCall {
  2655  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2656  	return c
  2657  }
  2658  
  2659  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2660  // object's ETag matches the given value. This is useful for getting updates
  2661  // only after the object has changed since the last request.
  2662  func (c *BillingAccountsLocationsRecommendersRecommendationsGetCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsRecommendersRecommendationsGetCall {
  2663  	c.ifNoneMatch_ = entityTag
  2664  	return c
  2665  }
  2666  
  2667  // Context sets the context to be used in this call's Do method.
  2668  func (c *BillingAccountsLocationsRecommendersRecommendationsGetCall) Context(ctx context.Context) *BillingAccountsLocationsRecommendersRecommendationsGetCall {
  2669  	c.ctx_ = ctx
  2670  	return c
  2671  }
  2672  
  2673  // Header returns a http.Header that can be modified by the caller to add
  2674  // headers to the request.
  2675  func (c *BillingAccountsLocationsRecommendersRecommendationsGetCall) Header() http.Header {
  2676  	if c.header_ == nil {
  2677  		c.header_ = make(http.Header)
  2678  	}
  2679  	return c.header_
  2680  }
  2681  
  2682  func (c *BillingAccountsLocationsRecommendersRecommendationsGetCall) doRequest(alt string) (*http.Response, error) {
  2683  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2684  	if c.ifNoneMatch_ != "" {
  2685  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2686  	}
  2687  	var body io.Reader = nil
  2688  	c.urlParams_.Set("alt", alt)
  2689  	c.urlParams_.Set("prettyPrint", "false")
  2690  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2691  	urls += "?" + c.urlParams_.Encode()
  2692  	req, err := http.NewRequest("GET", urls, body)
  2693  	if err != nil {
  2694  		return nil, err
  2695  	}
  2696  	req.Header = reqHeaders
  2697  	googleapi.Expand(req.URL, map[string]string{
  2698  		"name": c.name,
  2699  	})
  2700  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2701  }
  2702  
  2703  // Do executes the "recommender.billingAccounts.locations.recommenders.recommendations.get" call.
  2704  // Any non-2xx status code is an error. Response headers are in either
  2705  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  2706  // response was returned at all) in error.(*googleapi.Error).Header. Use
  2707  // googleapi.IsNotModified to check whether the returned error was because
  2708  // http.StatusNotModified was returned.
  2709  func (c *BillingAccountsLocationsRecommendersRecommendationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  2710  	gensupport.SetOptions(c.urlParams_, opts...)
  2711  	res, err := c.doRequest("json")
  2712  	if res != nil && res.StatusCode == http.StatusNotModified {
  2713  		if res.Body != nil {
  2714  			res.Body.Close()
  2715  		}
  2716  		return nil, gensupport.WrapError(&googleapi.Error{
  2717  			Code:   res.StatusCode,
  2718  			Header: res.Header,
  2719  		})
  2720  	}
  2721  	if err != nil {
  2722  		return nil, err
  2723  	}
  2724  	defer googleapi.CloseBody(res)
  2725  	if err := googleapi.CheckResponse(res); err != nil {
  2726  		return nil, gensupport.WrapError(err)
  2727  	}
  2728  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  2729  		ServerResponse: googleapi.ServerResponse{
  2730  			Header:         res.Header,
  2731  			HTTPStatusCode: res.StatusCode,
  2732  		},
  2733  	}
  2734  	target := &ret
  2735  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2736  		return nil, err
  2737  	}
  2738  	return ret, nil
  2739  }
  2740  
  2741  type BillingAccountsLocationsRecommendersRecommendationsListCall struct {
  2742  	s            *Service
  2743  	parent       string
  2744  	urlParams_   gensupport.URLParams
  2745  	ifNoneMatch_ string
  2746  	ctx_         context.Context
  2747  	header_      http.Header
  2748  }
  2749  
  2750  // List: Lists recommendations for the specified Cloud Resource. Requires the
  2751  // recommender.*.list IAM permission for the specified recommender.
  2752  //
  2753  //   - parent: The container resource on which to execute the request. Acceptable
  2754  //     formats: *
  2755  //     `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_I
  2756  //     D]` *
  2757  //     `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]`
  2758  //     *
  2759  //     `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RE
  2760  //     COMMENDER_ID]` *
  2761  //     `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` *
  2762  //     `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMME
  2763  //     NDER_ID]` LOCATION here refers to GCP Locations:
  2764  //     https://cloud.google.com/about/locations/ RECOMMENDER_ID refers to
  2765  //     supported recommenders:
  2766  //     https://cloud.google.com/recommender/docs/recommenders.
  2767  func (r *BillingAccountsLocationsRecommendersRecommendationsService) List(parent string) *BillingAccountsLocationsRecommendersRecommendationsListCall {
  2768  	c := &BillingAccountsLocationsRecommendersRecommendationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2769  	c.parent = parent
  2770  	return c
  2771  }
  2772  
  2773  // Filter sets the optional parameter "filter": Filter expression to restrict
  2774  // the recommendations returned. Supported filter fields: * `state_info.state`
  2775  // * `recommenderSubtype` * `priority` * `targetResources` Examples: *
  2776  // `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` *
  2777  // `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` *
  2778  // `priority = P1 OR priority = P2` * `targetResources :
  2779  // //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance
  2780  // -1` * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` The
  2781  // max allowed filter length is 500 characters. (These expressions are based on
  2782  // the filter language described at https://google.aip.dev/160)
  2783  func (c *BillingAccountsLocationsRecommendersRecommendationsListCall) Filter(filter string) *BillingAccountsLocationsRecommendersRecommendationsListCall {
  2784  	c.urlParams_.Set("filter", filter)
  2785  	return c
  2786  }
  2787  
  2788  // PageSize sets the optional parameter "pageSize": The maximum number of
  2789  // results to return from this request. Non-positive values are ignored. If not
  2790  // specified, the server will determine the number of results to return.
  2791  func (c *BillingAccountsLocationsRecommendersRecommendationsListCall) PageSize(pageSize int64) *BillingAccountsLocationsRecommendersRecommendationsListCall {
  2792  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2793  	return c
  2794  }
  2795  
  2796  // PageToken sets the optional parameter "pageToken": If present, retrieves the
  2797  // next batch of results from the preceding call to this method. `page_token`
  2798  // must be the value of `next_page_token` from the previous response. The
  2799  // values of other method parameters must be identical to those in the previous
  2800  // call.
  2801  func (c *BillingAccountsLocationsRecommendersRecommendationsListCall) PageToken(pageToken string) *BillingAccountsLocationsRecommendersRecommendationsListCall {
  2802  	c.urlParams_.Set("pageToken", pageToken)
  2803  	return c
  2804  }
  2805  
  2806  // Fields allows partial responses to be retrieved. See
  2807  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2808  // details.
  2809  func (c *BillingAccountsLocationsRecommendersRecommendationsListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsRecommendersRecommendationsListCall {
  2810  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2811  	return c
  2812  }
  2813  
  2814  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2815  // object's ETag matches the given value. This is useful for getting updates
  2816  // only after the object has changed since the last request.
  2817  func (c *BillingAccountsLocationsRecommendersRecommendationsListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsRecommendersRecommendationsListCall {
  2818  	c.ifNoneMatch_ = entityTag
  2819  	return c
  2820  }
  2821  
  2822  // Context sets the context to be used in this call's Do method.
  2823  func (c *BillingAccountsLocationsRecommendersRecommendationsListCall) Context(ctx context.Context) *BillingAccountsLocationsRecommendersRecommendationsListCall {
  2824  	c.ctx_ = ctx
  2825  	return c
  2826  }
  2827  
  2828  // Header returns a http.Header that can be modified by the caller to add
  2829  // headers to the request.
  2830  func (c *BillingAccountsLocationsRecommendersRecommendationsListCall) Header() http.Header {
  2831  	if c.header_ == nil {
  2832  		c.header_ = make(http.Header)
  2833  	}
  2834  	return c.header_
  2835  }
  2836  
  2837  func (c *BillingAccountsLocationsRecommendersRecommendationsListCall) doRequest(alt string) (*http.Response, error) {
  2838  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2839  	if c.ifNoneMatch_ != "" {
  2840  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2841  	}
  2842  	var body io.Reader = nil
  2843  	c.urlParams_.Set("alt", alt)
  2844  	c.urlParams_.Set("prettyPrint", "false")
  2845  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/recommendations")
  2846  	urls += "?" + c.urlParams_.Encode()
  2847  	req, err := http.NewRequest("GET", urls, body)
  2848  	if err != nil {
  2849  		return nil, err
  2850  	}
  2851  	req.Header = reqHeaders
  2852  	googleapi.Expand(req.URL, map[string]string{
  2853  		"parent": c.parent,
  2854  	})
  2855  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2856  }
  2857  
  2858  // Do executes the "recommender.billingAccounts.locations.recommenders.recommendations.list" call.
  2859  // Any non-2xx status code is an error. Response headers are in either
  2860  // *GoogleCloudRecommenderV1beta1ListRecommendationsResponse.ServerResponse.Head
  2861  // er or (if a response was returned at all) in
  2862  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2863  // whether the returned error was because http.StatusNotModified was returned.
  2864  func (c *BillingAccountsLocationsRecommendersRecommendationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1ListRecommendationsResponse, error) {
  2865  	gensupport.SetOptions(c.urlParams_, opts...)
  2866  	res, err := c.doRequest("json")
  2867  	if res != nil && res.StatusCode == http.StatusNotModified {
  2868  		if res.Body != nil {
  2869  			res.Body.Close()
  2870  		}
  2871  		return nil, gensupport.WrapError(&googleapi.Error{
  2872  			Code:   res.StatusCode,
  2873  			Header: res.Header,
  2874  		})
  2875  	}
  2876  	if err != nil {
  2877  		return nil, err
  2878  	}
  2879  	defer googleapi.CloseBody(res)
  2880  	if err := googleapi.CheckResponse(res); err != nil {
  2881  		return nil, gensupport.WrapError(err)
  2882  	}
  2883  	ret := &GoogleCloudRecommenderV1beta1ListRecommendationsResponse{
  2884  		ServerResponse: googleapi.ServerResponse{
  2885  			Header:         res.Header,
  2886  			HTTPStatusCode: res.StatusCode,
  2887  		},
  2888  	}
  2889  	target := &ret
  2890  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2891  		return nil, err
  2892  	}
  2893  	return ret, nil
  2894  }
  2895  
  2896  // Pages invokes f for each page of results.
  2897  // A non-nil error returned from f will halt the iteration.
  2898  // The provided context supersedes any context provided to the Context method.
  2899  func (c *BillingAccountsLocationsRecommendersRecommendationsListCall) Pages(ctx context.Context, f func(*GoogleCloudRecommenderV1beta1ListRecommendationsResponse) error) error {
  2900  	c.ctx_ = ctx
  2901  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2902  	for {
  2903  		x, err := c.Do()
  2904  		if err != nil {
  2905  			return err
  2906  		}
  2907  		if err := f(x); err != nil {
  2908  			return err
  2909  		}
  2910  		if x.NextPageToken == "" {
  2911  			return nil
  2912  		}
  2913  		c.PageToken(x.NextPageToken)
  2914  	}
  2915  }
  2916  
  2917  type BillingAccountsLocationsRecommendersRecommendationsMarkClaimedCall struct {
  2918  	s                                                             *Service
  2919  	name                                                          string
  2920  	googlecloudrecommenderv1beta1markrecommendationclaimedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest
  2921  	urlParams_                                                    gensupport.URLParams
  2922  	ctx_                                                          context.Context
  2923  	header_                                                       http.Header
  2924  }
  2925  
  2926  // MarkClaimed: Marks the Recommendation State as Claimed. Users can use this
  2927  // method to indicate to the Recommender API that they are starting to apply
  2928  // the recommendation themselves. This stops the recommendation content from
  2929  // being updated. Associated insights are frozen and placed in the ACCEPTED
  2930  // state. MarkRecommendationClaimed can be applied to recommendations in
  2931  // CLAIMED or ACTIVE state. Requires the recommender.*.update IAM permission
  2932  // for the specified recommender.
  2933  //
  2934  // - name: Name of the recommendation.
  2935  func (r *BillingAccountsLocationsRecommendersRecommendationsService) MarkClaimed(name string, googlecloudrecommenderv1beta1markrecommendationclaimedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest) *BillingAccountsLocationsRecommendersRecommendationsMarkClaimedCall {
  2936  	c := &BillingAccountsLocationsRecommendersRecommendationsMarkClaimedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2937  	c.name = name
  2938  	c.googlecloudrecommenderv1beta1markrecommendationclaimedrequest = googlecloudrecommenderv1beta1markrecommendationclaimedrequest
  2939  	return c
  2940  }
  2941  
  2942  // Fields allows partial responses to be retrieved. See
  2943  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2944  // details.
  2945  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkClaimedCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsRecommendersRecommendationsMarkClaimedCall {
  2946  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2947  	return c
  2948  }
  2949  
  2950  // Context sets the context to be used in this call's Do method.
  2951  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkClaimedCall) Context(ctx context.Context) *BillingAccountsLocationsRecommendersRecommendationsMarkClaimedCall {
  2952  	c.ctx_ = ctx
  2953  	return c
  2954  }
  2955  
  2956  // Header returns a http.Header that can be modified by the caller to add
  2957  // headers to the request.
  2958  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkClaimedCall) Header() http.Header {
  2959  	if c.header_ == nil {
  2960  		c.header_ = make(http.Header)
  2961  	}
  2962  	return c.header_
  2963  }
  2964  
  2965  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkClaimedCall) doRequest(alt string) (*http.Response, error) {
  2966  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2967  	var body io.Reader = nil
  2968  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationclaimedrequest)
  2969  	if err != nil {
  2970  		return nil, err
  2971  	}
  2972  	c.urlParams_.Set("alt", alt)
  2973  	c.urlParams_.Set("prettyPrint", "false")
  2974  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markClaimed")
  2975  	urls += "?" + c.urlParams_.Encode()
  2976  	req, err := http.NewRequest("POST", urls, body)
  2977  	if err != nil {
  2978  		return nil, err
  2979  	}
  2980  	req.Header = reqHeaders
  2981  	googleapi.Expand(req.URL, map[string]string{
  2982  		"name": c.name,
  2983  	})
  2984  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2985  }
  2986  
  2987  // Do executes the "recommender.billingAccounts.locations.recommenders.recommendations.markClaimed" call.
  2988  // Any non-2xx status code is an error. Response headers are in either
  2989  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  2990  // response was returned at all) in error.(*googleapi.Error).Header. Use
  2991  // googleapi.IsNotModified to check whether the returned error was because
  2992  // http.StatusNotModified was returned.
  2993  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkClaimedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  2994  	gensupport.SetOptions(c.urlParams_, opts...)
  2995  	res, err := c.doRequest("json")
  2996  	if res != nil && res.StatusCode == http.StatusNotModified {
  2997  		if res.Body != nil {
  2998  			res.Body.Close()
  2999  		}
  3000  		return nil, gensupport.WrapError(&googleapi.Error{
  3001  			Code:   res.StatusCode,
  3002  			Header: res.Header,
  3003  		})
  3004  	}
  3005  	if err != nil {
  3006  		return nil, err
  3007  	}
  3008  	defer googleapi.CloseBody(res)
  3009  	if err := googleapi.CheckResponse(res); err != nil {
  3010  		return nil, gensupport.WrapError(err)
  3011  	}
  3012  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  3013  		ServerResponse: googleapi.ServerResponse{
  3014  			Header:         res.Header,
  3015  			HTTPStatusCode: res.StatusCode,
  3016  		},
  3017  	}
  3018  	target := &ret
  3019  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3020  		return nil, err
  3021  	}
  3022  	return ret, nil
  3023  }
  3024  
  3025  type BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall struct {
  3026  	s                                                               *Service
  3027  	name                                                            string
  3028  	googlecloudrecommenderv1beta1markrecommendationdismissedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest
  3029  	urlParams_                                                      gensupport.URLParams
  3030  	ctx_                                                            context.Context
  3031  	header_                                                         http.Header
  3032  }
  3033  
  3034  // MarkDismissed: Mark the Recommendation State as Dismissed. Users can use
  3035  // this method to indicate to the Recommender API that an ACTIVE recommendation
  3036  // has to be marked back as DISMISSED. MarkRecommendationDismissed can be
  3037  // applied to recommendations in ACTIVE state. Requires the
  3038  // recommender.*.update IAM permission for the specified recommender.
  3039  //
  3040  // - name: Name of the recommendation.
  3041  func (r *BillingAccountsLocationsRecommendersRecommendationsService) MarkDismissed(name string, googlecloudrecommenderv1beta1markrecommendationdismissedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest) *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall {
  3042  	c := &BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3043  	c.name = name
  3044  	c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest = googlecloudrecommenderv1beta1markrecommendationdismissedrequest
  3045  	return c
  3046  }
  3047  
  3048  // Fields allows partial responses to be retrieved. See
  3049  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3050  // details.
  3051  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall {
  3052  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3053  	return c
  3054  }
  3055  
  3056  // Context sets the context to be used in this call's Do method.
  3057  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall) Context(ctx context.Context) *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall {
  3058  	c.ctx_ = ctx
  3059  	return c
  3060  }
  3061  
  3062  // Header returns a http.Header that can be modified by the caller to add
  3063  // headers to the request.
  3064  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall) Header() http.Header {
  3065  	if c.header_ == nil {
  3066  		c.header_ = make(http.Header)
  3067  	}
  3068  	return c.header_
  3069  }
  3070  
  3071  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) {
  3072  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3073  	var body io.Reader = nil
  3074  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest)
  3075  	if err != nil {
  3076  		return nil, err
  3077  	}
  3078  	c.urlParams_.Set("alt", alt)
  3079  	c.urlParams_.Set("prettyPrint", "false")
  3080  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markDismissed")
  3081  	urls += "?" + c.urlParams_.Encode()
  3082  	req, err := http.NewRequest("POST", urls, body)
  3083  	if err != nil {
  3084  		return nil, err
  3085  	}
  3086  	req.Header = reqHeaders
  3087  	googleapi.Expand(req.URL, map[string]string{
  3088  		"name": c.name,
  3089  	})
  3090  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3091  }
  3092  
  3093  // Do executes the "recommender.billingAccounts.locations.recommenders.recommendations.markDismissed" call.
  3094  // Any non-2xx status code is an error. Response headers are in either
  3095  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  3096  // response was returned at all) in error.(*googleapi.Error).Header. Use
  3097  // googleapi.IsNotModified to check whether the returned error was because
  3098  // http.StatusNotModified was returned.
  3099  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  3100  	gensupport.SetOptions(c.urlParams_, opts...)
  3101  	res, err := c.doRequest("json")
  3102  	if res != nil && res.StatusCode == http.StatusNotModified {
  3103  		if res.Body != nil {
  3104  			res.Body.Close()
  3105  		}
  3106  		return nil, gensupport.WrapError(&googleapi.Error{
  3107  			Code:   res.StatusCode,
  3108  			Header: res.Header,
  3109  		})
  3110  	}
  3111  	if err != nil {
  3112  		return nil, err
  3113  	}
  3114  	defer googleapi.CloseBody(res)
  3115  	if err := googleapi.CheckResponse(res); err != nil {
  3116  		return nil, gensupport.WrapError(err)
  3117  	}
  3118  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  3119  		ServerResponse: googleapi.ServerResponse{
  3120  			Header:         res.Header,
  3121  			HTTPStatusCode: res.StatusCode,
  3122  		},
  3123  	}
  3124  	target := &ret
  3125  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3126  		return nil, err
  3127  	}
  3128  	return ret, nil
  3129  }
  3130  
  3131  type BillingAccountsLocationsRecommendersRecommendationsMarkFailedCall struct {
  3132  	s                                                            *Service
  3133  	name                                                         string
  3134  	googlecloudrecommenderv1beta1markrecommendationfailedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest
  3135  	urlParams_                                                   gensupport.URLParams
  3136  	ctx_                                                         context.Context
  3137  	header_                                                      http.Header
  3138  }
  3139  
  3140  // MarkFailed: Marks the Recommendation State as Failed. Users can use this
  3141  // method to indicate to the Recommender API that they have applied the
  3142  // recommendation themselves, and the operation failed. This stops the
  3143  // recommendation content from being updated. Associated insights are frozen
  3144  // and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to
  3145  // recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the
  3146  // recommender.*.update IAM permission for the specified recommender.
  3147  //
  3148  // - name: Name of the recommendation.
  3149  func (r *BillingAccountsLocationsRecommendersRecommendationsService) MarkFailed(name string, googlecloudrecommenderv1beta1markrecommendationfailedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest) *BillingAccountsLocationsRecommendersRecommendationsMarkFailedCall {
  3150  	c := &BillingAccountsLocationsRecommendersRecommendationsMarkFailedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3151  	c.name = name
  3152  	c.googlecloudrecommenderv1beta1markrecommendationfailedrequest = googlecloudrecommenderv1beta1markrecommendationfailedrequest
  3153  	return c
  3154  }
  3155  
  3156  // Fields allows partial responses to be retrieved. See
  3157  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3158  // details.
  3159  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkFailedCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsRecommendersRecommendationsMarkFailedCall {
  3160  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3161  	return c
  3162  }
  3163  
  3164  // Context sets the context to be used in this call's Do method.
  3165  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkFailedCall) Context(ctx context.Context) *BillingAccountsLocationsRecommendersRecommendationsMarkFailedCall {
  3166  	c.ctx_ = ctx
  3167  	return c
  3168  }
  3169  
  3170  // Header returns a http.Header that can be modified by the caller to add
  3171  // headers to the request.
  3172  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkFailedCall) Header() http.Header {
  3173  	if c.header_ == nil {
  3174  		c.header_ = make(http.Header)
  3175  	}
  3176  	return c.header_
  3177  }
  3178  
  3179  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkFailedCall) doRequest(alt string) (*http.Response, error) {
  3180  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3181  	var body io.Reader = nil
  3182  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationfailedrequest)
  3183  	if err != nil {
  3184  		return nil, err
  3185  	}
  3186  	c.urlParams_.Set("alt", alt)
  3187  	c.urlParams_.Set("prettyPrint", "false")
  3188  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markFailed")
  3189  	urls += "?" + c.urlParams_.Encode()
  3190  	req, err := http.NewRequest("POST", urls, body)
  3191  	if err != nil {
  3192  		return nil, err
  3193  	}
  3194  	req.Header = reqHeaders
  3195  	googleapi.Expand(req.URL, map[string]string{
  3196  		"name": c.name,
  3197  	})
  3198  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3199  }
  3200  
  3201  // Do executes the "recommender.billingAccounts.locations.recommenders.recommendations.markFailed" call.
  3202  // Any non-2xx status code is an error. Response headers are in either
  3203  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  3204  // response was returned at all) in error.(*googleapi.Error).Header. Use
  3205  // googleapi.IsNotModified to check whether the returned error was because
  3206  // http.StatusNotModified was returned.
  3207  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkFailedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  3208  	gensupport.SetOptions(c.urlParams_, opts...)
  3209  	res, err := c.doRequest("json")
  3210  	if res != nil && res.StatusCode == http.StatusNotModified {
  3211  		if res.Body != nil {
  3212  			res.Body.Close()
  3213  		}
  3214  		return nil, gensupport.WrapError(&googleapi.Error{
  3215  			Code:   res.StatusCode,
  3216  			Header: res.Header,
  3217  		})
  3218  	}
  3219  	if err != nil {
  3220  		return nil, err
  3221  	}
  3222  	defer googleapi.CloseBody(res)
  3223  	if err := googleapi.CheckResponse(res); err != nil {
  3224  		return nil, gensupport.WrapError(err)
  3225  	}
  3226  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  3227  		ServerResponse: googleapi.ServerResponse{
  3228  			Header:         res.Header,
  3229  			HTTPStatusCode: res.StatusCode,
  3230  		},
  3231  	}
  3232  	target := &ret
  3233  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3234  		return nil, err
  3235  	}
  3236  	return ret, nil
  3237  }
  3238  
  3239  type BillingAccountsLocationsRecommendersRecommendationsMarkSucceededCall struct {
  3240  	s                                                               *Service
  3241  	name                                                            string
  3242  	googlecloudrecommenderv1beta1markrecommendationsucceededrequest *GoogleCloudRecommenderV1beta1MarkRecommendationSucceededRequest
  3243  	urlParams_                                                      gensupport.URLParams
  3244  	ctx_                                                            context.Context
  3245  	header_                                                         http.Header
  3246  }
  3247  
  3248  // MarkSucceeded: Marks the Recommendation State as Succeeded. Users can use
  3249  // this method to indicate to the Recommender API that they have applied the
  3250  // recommendation themselves, and the operation was successful. This stops the
  3251  // recommendation content from being updated. Associated insights are frozen
  3252  // and placed in the ACCEPTED state. MarkRecommendationSucceeded can be applied
  3253  // to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires
  3254  // the recommender.*.update IAM permission for the specified recommender.
  3255  //
  3256  // - name: Name of the recommendation.
  3257  func (r *BillingAccountsLocationsRecommendersRecommendationsService) MarkSucceeded(name string, googlecloudrecommenderv1beta1markrecommendationsucceededrequest *GoogleCloudRecommenderV1beta1MarkRecommendationSucceededRequest) *BillingAccountsLocationsRecommendersRecommendationsMarkSucceededCall {
  3258  	c := &BillingAccountsLocationsRecommendersRecommendationsMarkSucceededCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3259  	c.name = name
  3260  	c.googlecloudrecommenderv1beta1markrecommendationsucceededrequest = googlecloudrecommenderv1beta1markrecommendationsucceededrequest
  3261  	return c
  3262  }
  3263  
  3264  // Fields allows partial responses to be retrieved. See
  3265  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3266  // details.
  3267  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkSucceededCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsRecommendersRecommendationsMarkSucceededCall {
  3268  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3269  	return c
  3270  }
  3271  
  3272  // Context sets the context to be used in this call's Do method.
  3273  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkSucceededCall) Context(ctx context.Context) *BillingAccountsLocationsRecommendersRecommendationsMarkSucceededCall {
  3274  	c.ctx_ = ctx
  3275  	return c
  3276  }
  3277  
  3278  // Header returns a http.Header that can be modified by the caller to add
  3279  // headers to the request.
  3280  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkSucceededCall) Header() http.Header {
  3281  	if c.header_ == nil {
  3282  		c.header_ = make(http.Header)
  3283  	}
  3284  	return c.header_
  3285  }
  3286  
  3287  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkSucceededCall) doRequest(alt string) (*http.Response, error) {
  3288  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3289  	var body io.Reader = nil
  3290  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationsucceededrequest)
  3291  	if err != nil {
  3292  		return nil, err
  3293  	}
  3294  	c.urlParams_.Set("alt", alt)
  3295  	c.urlParams_.Set("prettyPrint", "false")
  3296  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markSucceeded")
  3297  	urls += "?" + c.urlParams_.Encode()
  3298  	req, err := http.NewRequest("POST", urls, body)
  3299  	if err != nil {
  3300  		return nil, err
  3301  	}
  3302  	req.Header = reqHeaders
  3303  	googleapi.Expand(req.URL, map[string]string{
  3304  		"name": c.name,
  3305  	})
  3306  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3307  }
  3308  
  3309  // Do executes the "recommender.billingAccounts.locations.recommenders.recommendations.markSucceeded" call.
  3310  // Any non-2xx status code is an error. Response headers are in either
  3311  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  3312  // response was returned at all) in error.(*googleapi.Error).Header. Use
  3313  // googleapi.IsNotModified to check whether the returned error was because
  3314  // http.StatusNotModified was returned.
  3315  func (c *BillingAccountsLocationsRecommendersRecommendationsMarkSucceededCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  3316  	gensupport.SetOptions(c.urlParams_, opts...)
  3317  	res, err := c.doRequest("json")
  3318  	if res != nil && res.StatusCode == http.StatusNotModified {
  3319  		if res.Body != nil {
  3320  			res.Body.Close()
  3321  		}
  3322  		return nil, gensupport.WrapError(&googleapi.Error{
  3323  			Code:   res.StatusCode,
  3324  			Header: res.Header,
  3325  		})
  3326  	}
  3327  	if err != nil {
  3328  		return nil, err
  3329  	}
  3330  	defer googleapi.CloseBody(res)
  3331  	if err := googleapi.CheckResponse(res); err != nil {
  3332  		return nil, gensupport.WrapError(err)
  3333  	}
  3334  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  3335  		ServerResponse: googleapi.ServerResponse{
  3336  			Header:         res.Header,
  3337  			HTTPStatusCode: res.StatusCode,
  3338  		},
  3339  	}
  3340  	target := &ret
  3341  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3342  		return nil, err
  3343  	}
  3344  	return ret, nil
  3345  }
  3346  
  3347  type FoldersLocationsListCall struct {
  3348  	s            *Service
  3349  	name         string
  3350  	urlParams_   gensupport.URLParams
  3351  	ifNoneMatch_ string
  3352  	ctx_         context.Context
  3353  	header_      http.Header
  3354  }
  3355  
  3356  // List: Lists locations with recommendations or insights.
  3357  //
  3358  // - name: The resource that owns the locations collection, if applicable.
  3359  func (r *FoldersLocationsService) List(name string) *FoldersLocationsListCall {
  3360  	c := &FoldersLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3361  	c.name = name
  3362  	return c
  3363  }
  3364  
  3365  // Filter sets the optional parameter "filter": A filter to narrow down results
  3366  // to a preferred subset. The filtering language accepts strings like
  3367  // "displayName=tokyo", and is documented in more detail in AIP-160
  3368  // (https://google.aip.dev/160).
  3369  func (c *FoldersLocationsListCall) Filter(filter string) *FoldersLocationsListCall {
  3370  	c.urlParams_.Set("filter", filter)
  3371  	return c
  3372  }
  3373  
  3374  // PageSize sets the optional parameter "pageSize": The maximum number of
  3375  // results to return. If not set, the service selects a default.
  3376  func (c *FoldersLocationsListCall) PageSize(pageSize int64) *FoldersLocationsListCall {
  3377  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3378  	return c
  3379  }
  3380  
  3381  // PageToken sets the optional parameter "pageToken": A page token received
  3382  // from the `next_page_token` field in the response. Send that page token to
  3383  // receive the subsequent page.
  3384  func (c *FoldersLocationsListCall) PageToken(pageToken string) *FoldersLocationsListCall {
  3385  	c.urlParams_.Set("pageToken", pageToken)
  3386  	return c
  3387  }
  3388  
  3389  // Fields allows partial responses to be retrieved. See
  3390  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3391  // details.
  3392  func (c *FoldersLocationsListCall) Fields(s ...googleapi.Field) *FoldersLocationsListCall {
  3393  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3394  	return c
  3395  }
  3396  
  3397  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3398  // object's ETag matches the given value. This is useful for getting updates
  3399  // only after the object has changed since the last request.
  3400  func (c *FoldersLocationsListCall) IfNoneMatch(entityTag string) *FoldersLocationsListCall {
  3401  	c.ifNoneMatch_ = entityTag
  3402  	return c
  3403  }
  3404  
  3405  // Context sets the context to be used in this call's Do method.
  3406  func (c *FoldersLocationsListCall) Context(ctx context.Context) *FoldersLocationsListCall {
  3407  	c.ctx_ = ctx
  3408  	return c
  3409  }
  3410  
  3411  // Header returns a http.Header that can be modified by the caller to add
  3412  // headers to the request.
  3413  func (c *FoldersLocationsListCall) Header() http.Header {
  3414  	if c.header_ == nil {
  3415  		c.header_ = make(http.Header)
  3416  	}
  3417  	return c.header_
  3418  }
  3419  
  3420  func (c *FoldersLocationsListCall) doRequest(alt string) (*http.Response, error) {
  3421  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3422  	if c.ifNoneMatch_ != "" {
  3423  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3424  	}
  3425  	var body io.Reader = nil
  3426  	c.urlParams_.Set("alt", alt)
  3427  	c.urlParams_.Set("prettyPrint", "false")
  3428  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations")
  3429  	urls += "?" + c.urlParams_.Encode()
  3430  	req, err := http.NewRequest("GET", urls, body)
  3431  	if err != nil {
  3432  		return nil, err
  3433  	}
  3434  	req.Header = reqHeaders
  3435  	googleapi.Expand(req.URL, map[string]string{
  3436  		"name": c.name,
  3437  	})
  3438  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3439  }
  3440  
  3441  // Do executes the "recommender.folders.locations.list" call.
  3442  // Any non-2xx status code is an error. Response headers are in either
  3443  // *GoogleCloudLocationListLocationsResponse.ServerResponse.Header or (if a
  3444  // response was returned at all) in error.(*googleapi.Error).Header. Use
  3445  // googleapi.IsNotModified to check whether the returned error was because
  3446  // http.StatusNotModified was returned.
  3447  func (c *FoldersLocationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudLocationListLocationsResponse, error) {
  3448  	gensupport.SetOptions(c.urlParams_, opts...)
  3449  	res, err := c.doRequest("json")
  3450  	if res != nil && res.StatusCode == http.StatusNotModified {
  3451  		if res.Body != nil {
  3452  			res.Body.Close()
  3453  		}
  3454  		return nil, gensupport.WrapError(&googleapi.Error{
  3455  			Code:   res.StatusCode,
  3456  			Header: res.Header,
  3457  		})
  3458  	}
  3459  	if err != nil {
  3460  		return nil, err
  3461  	}
  3462  	defer googleapi.CloseBody(res)
  3463  	if err := googleapi.CheckResponse(res); err != nil {
  3464  		return nil, gensupport.WrapError(err)
  3465  	}
  3466  	ret := &GoogleCloudLocationListLocationsResponse{
  3467  		ServerResponse: googleapi.ServerResponse{
  3468  			Header:         res.Header,
  3469  			HTTPStatusCode: res.StatusCode,
  3470  		},
  3471  	}
  3472  	target := &ret
  3473  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3474  		return nil, err
  3475  	}
  3476  	return ret, nil
  3477  }
  3478  
  3479  // Pages invokes f for each page of results.
  3480  // A non-nil error returned from f will halt the iteration.
  3481  // The provided context supersedes any context provided to the Context method.
  3482  func (c *FoldersLocationsListCall) Pages(ctx context.Context, f func(*GoogleCloudLocationListLocationsResponse) error) error {
  3483  	c.ctx_ = ctx
  3484  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3485  	for {
  3486  		x, err := c.Do()
  3487  		if err != nil {
  3488  			return err
  3489  		}
  3490  		if err := f(x); err != nil {
  3491  			return err
  3492  		}
  3493  		if x.NextPageToken == "" {
  3494  			return nil
  3495  		}
  3496  		c.PageToken(x.NextPageToken)
  3497  	}
  3498  }
  3499  
  3500  type FoldersLocationsInsightTypesInsightsGetCall struct {
  3501  	s            *Service
  3502  	name         string
  3503  	urlParams_   gensupport.URLParams
  3504  	ifNoneMatch_ string
  3505  	ctx_         context.Context
  3506  	header_      http.Header
  3507  }
  3508  
  3509  // Get: Gets the requested insight. Requires the recommender.*.get IAM
  3510  // permission for the specified insight type.
  3511  //
  3512  // - name: Name of the insight.
  3513  func (r *FoldersLocationsInsightTypesInsightsService) Get(name string) *FoldersLocationsInsightTypesInsightsGetCall {
  3514  	c := &FoldersLocationsInsightTypesInsightsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3515  	c.name = name
  3516  	return c
  3517  }
  3518  
  3519  // Fields allows partial responses to be retrieved. See
  3520  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3521  // details.
  3522  func (c *FoldersLocationsInsightTypesInsightsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsInsightTypesInsightsGetCall {
  3523  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3524  	return c
  3525  }
  3526  
  3527  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3528  // object's ETag matches the given value. This is useful for getting updates
  3529  // only after the object has changed since the last request.
  3530  func (c *FoldersLocationsInsightTypesInsightsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsInsightTypesInsightsGetCall {
  3531  	c.ifNoneMatch_ = entityTag
  3532  	return c
  3533  }
  3534  
  3535  // Context sets the context to be used in this call's Do method.
  3536  func (c *FoldersLocationsInsightTypesInsightsGetCall) Context(ctx context.Context) *FoldersLocationsInsightTypesInsightsGetCall {
  3537  	c.ctx_ = ctx
  3538  	return c
  3539  }
  3540  
  3541  // Header returns a http.Header that can be modified by the caller to add
  3542  // headers to the request.
  3543  func (c *FoldersLocationsInsightTypesInsightsGetCall) Header() http.Header {
  3544  	if c.header_ == nil {
  3545  		c.header_ = make(http.Header)
  3546  	}
  3547  	return c.header_
  3548  }
  3549  
  3550  func (c *FoldersLocationsInsightTypesInsightsGetCall) doRequest(alt string) (*http.Response, error) {
  3551  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3552  	if c.ifNoneMatch_ != "" {
  3553  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3554  	}
  3555  	var body io.Reader = nil
  3556  	c.urlParams_.Set("alt", alt)
  3557  	c.urlParams_.Set("prettyPrint", "false")
  3558  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  3559  	urls += "?" + c.urlParams_.Encode()
  3560  	req, err := http.NewRequest("GET", urls, body)
  3561  	if err != nil {
  3562  		return nil, err
  3563  	}
  3564  	req.Header = reqHeaders
  3565  	googleapi.Expand(req.URL, map[string]string{
  3566  		"name": c.name,
  3567  	})
  3568  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3569  }
  3570  
  3571  // Do executes the "recommender.folders.locations.insightTypes.insights.get" call.
  3572  // Any non-2xx status code is an error. Response headers are in either
  3573  // *GoogleCloudRecommenderV1beta1Insight.ServerResponse.Header or (if a
  3574  // response was returned at all) in error.(*googleapi.Error).Header. Use
  3575  // googleapi.IsNotModified to check whether the returned error was because
  3576  // http.StatusNotModified was returned.
  3577  func (c *FoldersLocationsInsightTypesInsightsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Insight, error) {
  3578  	gensupport.SetOptions(c.urlParams_, opts...)
  3579  	res, err := c.doRequest("json")
  3580  	if res != nil && res.StatusCode == http.StatusNotModified {
  3581  		if res.Body != nil {
  3582  			res.Body.Close()
  3583  		}
  3584  		return nil, gensupport.WrapError(&googleapi.Error{
  3585  			Code:   res.StatusCode,
  3586  			Header: res.Header,
  3587  		})
  3588  	}
  3589  	if err != nil {
  3590  		return nil, err
  3591  	}
  3592  	defer googleapi.CloseBody(res)
  3593  	if err := googleapi.CheckResponse(res); err != nil {
  3594  		return nil, gensupport.WrapError(err)
  3595  	}
  3596  	ret := &GoogleCloudRecommenderV1beta1Insight{
  3597  		ServerResponse: googleapi.ServerResponse{
  3598  			Header:         res.Header,
  3599  			HTTPStatusCode: res.StatusCode,
  3600  		},
  3601  	}
  3602  	target := &ret
  3603  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3604  		return nil, err
  3605  	}
  3606  	return ret, nil
  3607  }
  3608  
  3609  type FoldersLocationsInsightTypesInsightsListCall struct {
  3610  	s            *Service
  3611  	parent       string
  3612  	urlParams_   gensupport.URLParams
  3613  	ifNoneMatch_ string
  3614  	ctx_         context.Context
  3615  	header_      http.Header
  3616  }
  3617  
  3618  // List: Lists insights for the specified Cloud Resource. Requires the
  3619  // recommender.*.list IAM permission for the specified insight type.
  3620  //
  3621  //   - parent: The container resource on which to execute the request. Acceptable
  3622  //     formats: *
  3623  //     `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_
  3624  //     ID]` *
  3625  //     `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]`
  3626  //     *
  3627  //     `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[IN
  3628  //     SIGHT_TYPE_ID]` *
  3629  //     `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]`
  3630  //     *
  3631  //     `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT
  3632  //     _TYPE_ID]` LOCATION here refers to GCP Locations:
  3633  //     https://cloud.google.com/about/locations/ INSIGHT_TYPE_ID refers to
  3634  //     supported insight types:
  3635  //     https://cloud.google.com/recommender/docs/insights/insight-types.
  3636  func (r *FoldersLocationsInsightTypesInsightsService) List(parent string) *FoldersLocationsInsightTypesInsightsListCall {
  3637  	c := &FoldersLocationsInsightTypesInsightsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3638  	c.parent = parent
  3639  	return c
  3640  }
  3641  
  3642  // Filter sets the optional parameter "filter": Filter expression to restrict
  3643  // the insights returned. Supported filter fields: * `stateInfo.state` *
  3644  // `insightSubtype` * `severity` * `targetResources` Examples: *
  3645  // `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` * `insightSubtype
  3646  // = PERMISSIONS_USAGE` * `severity = CRITICAL OR severity = HIGH` *
  3647  // `targetResources :
  3648  // //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance
  3649  // -1` * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity =
  3650  // HIGH)` The max allowed filter length is 500 characters. (These expressions
  3651  // are based on the filter language described at https://google.aip.dev/160)
  3652  func (c *FoldersLocationsInsightTypesInsightsListCall) Filter(filter string) *FoldersLocationsInsightTypesInsightsListCall {
  3653  	c.urlParams_.Set("filter", filter)
  3654  	return c
  3655  }
  3656  
  3657  // PageSize sets the optional parameter "pageSize": The maximum number of
  3658  // results to return from this request. Non-positive values are ignored. If not
  3659  // specified, the server will determine the number of results to return.
  3660  func (c *FoldersLocationsInsightTypesInsightsListCall) PageSize(pageSize int64) *FoldersLocationsInsightTypesInsightsListCall {
  3661  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3662  	return c
  3663  }
  3664  
  3665  // PageToken sets the optional parameter "pageToken": If present, retrieves the
  3666  // next batch of results from the preceding call to this method. `page_token`
  3667  // must be the value of `next_page_token` from the previous response. The
  3668  // values of other method parameters must be identical to those in the previous
  3669  // call.
  3670  func (c *FoldersLocationsInsightTypesInsightsListCall) PageToken(pageToken string) *FoldersLocationsInsightTypesInsightsListCall {
  3671  	c.urlParams_.Set("pageToken", pageToken)
  3672  	return c
  3673  }
  3674  
  3675  // Fields allows partial responses to be retrieved. See
  3676  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3677  // details.
  3678  func (c *FoldersLocationsInsightTypesInsightsListCall) Fields(s ...googleapi.Field) *FoldersLocationsInsightTypesInsightsListCall {
  3679  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3680  	return c
  3681  }
  3682  
  3683  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3684  // object's ETag matches the given value. This is useful for getting updates
  3685  // only after the object has changed since the last request.
  3686  func (c *FoldersLocationsInsightTypesInsightsListCall) IfNoneMatch(entityTag string) *FoldersLocationsInsightTypesInsightsListCall {
  3687  	c.ifNoneMatch_ = entityTag
  3688  	return c
  3689  }
  3690  
  3691  // Context sets the context to be used in this call's Do method.
  3692  func (c *FoldersLocationsInsightTypesInsightsListCall) Context(ctx context.Context) *FoldersLocationsInsightTypesInsightsListCall {
  3693  	c.ctx_ = ctx
  3694  	return c
  3695  }
  3696  
  3697  // Header returns a http.Header that can be modified by the caller to add
  3698  // headers to the request.
  3699  func (c *FoldersLocationsInsightTypesInsightsListCall) Header() http.Header {
  3700  	if c.header_ == nil {
  3701  		c.header_ = make(http.Header)
  3702  	}
  3703  	return c.header_
  3704  }
  3705  
  3706  func (c *FoldersLocationsInsightTypesInsightsListCall) doRequest(alt string) (*http.Response, error) {
  3707  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3708  	if c.ifNoneMatch_ != "" {
  3709  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3710  	}
  3711  	var body io.Reader = nil
  3712  	c.urlParams_.Set("alt", alt)
  3713  	c.urlParams_.Set("prettyPrint", "false")
  3714  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/insights")
  3715  	urls += "?" + c.urlParams_.Encode()
  3716  	req, err := http.NewRequest("GET", urls, body)
  3717  	if err != nil {
  3718  		return nil, err
  3719  	}
  3720  	req.Header = reqHeaders
  3721  	googleapi.Expand(req.URL, map[string]string{
  3722  		"parent": c.parent,
  3723  	})
  3724  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3725  }
  3726  
  3727  // Do executes the "recommender.folders.locations.insightTypes.insights.list" call.
  3728  // Any non-2xx status code is an error. Response headers are in either
  3729  // *GoogleCloudRecommenderV1beta1ListInsightsResponse.ServerResponse.Header or
  3730  // (if a response was returned at all) in error.(*googleapi.Error).Header. Use
  3731  // googleapi.IsNotModified to check whether the returned error was because
  3732  // http.StatusNotModified was returned.
  3733  func (c *FoldersLocationsInsightTypesInsightsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1ListInsightsResponse, error) {
  3734  	gensupport.SetOptions(c.urlParams_, opts...)
  3735  	res, err := c.doRequest("json")
  3736  	if res != nil && res.StatusCode == http.StatusNotModified {
  3737  		if res.Body != nil {
  3738  			res.Body.Close()
  3739  		}
  3740  		return nil, gensupport.WrapError(&googleapi.Error{
  3741  			Code:   res.StatusCode,
  3742  			Header: res.Header,
  3743  		})
  3744  	}
  3745  	if err != nil {
  3746  		return nil, err
  3747  	}
  3748  	defer googleapi.CloseBody(res)
  3749  	if err := googleapi.CheckResponse(res); err != nil {
  3750  		return nil, gensupport.WrapError(err)
  3751  	}
  3752  	ret := &GoogleCloudRecommenderV1beta1ListInsightsResponse{
  3753  		ServerResponse: googleapi.ServerResponse{
  3754  			Header:         res.Header,
  3755  			HTTPStatusCode: res.StatusCode,
  3756  		},
  3757  	}
  3758  	target := &ret
  3759  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3760  		return nil, err
  3761  	}
  3762  	return ret, nil
  3763  }
  3764  
  3765  // Pages invokes f for each page of results.
  3766  // A non-nil error returned from f will halt the iteration.
  3767  // The provided context supersedes any context provided to the Context method.
  3768  func (c *FoldersLocationsInsightTypesInsightsListCall) Pages(ctx context.Context, f func(*GoogleCloudRecommenderV1beta1ListInsightsResponse) error) error {
  3769  	c.ctx_ = ctx
  3770  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3771  	for {
  3772  		x, err := c.Do()
  3773  		if err != nil {
  3774  			return err
  3775  		}
  3776  		if err := f(x); err != nil {
  3777  			return err
  3778  		}
  3779  		if x.NextPageToken == "" {
  3780  			return nil
  3781  		}
  3782  		c.PageToken(x.NextPageToken)
  3783  	}
  3784  }
  3785  
  3786  type FoldersLocationsInsightTypesInsightsMarkAcceptedCall struct {
  3787  	s                                                       *Service
  3788  	name                                                    string
  3789  	googlecloudrecommenderv1beta1markinsightacceptedrequest *GoogleCloudRecommenderV1beta1MarkInsightAcceptedRequest
  3790  	urlParams_                                              gensupport.URLParams
  3791  	ctx_                                                    context.Context
  3792  	header_                                                 http.Header
  3793  }
  3794  
  3795  // MarkAccepted: Marks the Insight State as Accepted. Users can use this method
  3796  // to indicate to the Recommender API that they have applied some action based
  3797  // on the insight. This stops the insight content from being updated.
  3798  // MarkInsightAccepted can be applied to insights in ACTIVE state. Requires the
  3799  // recommender.*.update IAM permission for the specified insight.
  3800  //
  3801  // - name: Name of the insight.
  3802  func (r *FoldersLocationsInsightTypesInsightsService) MarkAccepted(name string, googlecloudrecommenderv1beta1markinsightacceptedrequest *GoogleCloudRecommenderV1beta1MarkInsightAcceptedRequest) *FoldersLocationsInsightTypesInsightsMarkAcceptedCall {
  3803  	c := &FoldersLocationsInsightTypesInsightsMarkAcceptedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3804  	c.name = name
  3805  	c.googlecloudrecommenderv1beta1markinsightacceptedrequest = googlecloudrecommenderv1beta1markinsightacceptedrequest
  3806  	return c
  3807  }
  3808  
  3809  // Fields allows partial responses to be retrieved. See
  3810  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3811  // details.
  3812  func (c *FoldersLocationsInsightTypesInsightsMarkAcceptedCall) Fields(s ...googleapi.Field) *FoldersLocationsInsightTypesInsightsMarkAcceptedCall {
  3813  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3814  	return c
  3815  }
  3816  
  3817  // Context sets the context to be used in this call's Do method.
  3818  func (c *FoldersLocationsInsightTypesInsightsMarkAcceptedCall) Context(ctx context.Context) *FoldersLocationsInsightTypesInsightsMarkAcceptedCall {
  3819  	c.ctx_ = ctx
  3820  	return c
  3821  }
  3822  
  3823  // Header returns a http.Header that can be modified by the caller to add
  3824  // headers to the request.
  3825  func (c *FoldersLocationsInsightTypesInsightsMarkAcceptedCall) Header() http.Header {
  3826  	if c.header_ == nil {
  3827  		c.header_ = make(http.Header)
  3828  	}
  3829  	return c.header_
  3830  }
  3831  
  3832  func (c *FoldersLocationsInsightTypesInsightsMarkAcceptedCall) doRequest(alt string) (*http.Response, error) {
  3833  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3834  	var body io.Reader = nil
  3835  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markinsightacceptedrequest)
  3836  	if err != nil {
  3837  		return nil, err
  3838  	}
  3839  	c.urlParams_.Set("alt", alt)
  3840  	c.urlParams_.Set("prettyPrint", "false")
  3841  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markAccepted")
  3842  	urls += "?" + c.urlParams_.Encode()
  3843  	req, err := http.NewRequest("POST", urls, body)
  3844  	if err != nil {
  3845  		return nil, err
  3846  	}
  3847  	req.Header = reqHeaders
  3848  	googleapi.Expand(req.URL, map[string]string{
  3849  		"name": c.name,
  3850  	})
  3851  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3852  }
  3853  
  3854  // Do executes the "recommender.folders.locations.insightTypes.insights.markAccepted" call.
  3855  // Any non-2xx status code is an error. Response headers are in either
  3856  // *GoogleCloudRecommenderV1beta1Insight.ServerResponse.Header or (if a
  3857  // response was returned at all) in error.(*googleapi.Error).Header. Use
  3858  // googleapi.IsNotModified to check whether the returned error was because
  3859  // http.StatusNotModified was returned.
  3860  func (c *FoldersLocationsInsightTypesInsightsMarkAcceptedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Insight, error) {
  3861  	gensupport.SetOptions(c.urlParams_, opts...)
  3862  	res, err := c.doRequest("json")
  3863  	if res != nil && res.StatusCode == http.StatusNotModified {
  3864  		if res.Body != nil {
  3865  			res.Body.Close()
  3866  		}
  3867  		return nil, gensupport.WrapError(&googleapi.Error{
  3868  			Code:   res.StatusCode,
  3869  			Header: res.Header,
  3870  		})
  3871  	}
  3872  	if err != nil {
  3873  		return nil, err
  3874  	}
  3875  	defer googleapi.CloseBody(res)
  3876  	if err := googleapi.CheckResponse(res); err != nil {
  3877  		return nil, gensupport.WrapError(err)
  3878  	}
  3879  	ret := &GoogleCloudRecommenderV1beta1Insight{
  3880  		ServerResponse: googleapi.ServerResponse{
  3881  			Header:         res.Header,
  3882  			HTTPStatusCode: res.StatusCode,
  3883  		},
  3884  	}
  3885  	target := &ret
  3886  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3887  		return nil, err
  3888  	}
  3889  	return ret, nil
  3890  }
  3891  
  3892  type FoldersLocationsRecommendersRecommendationsGetCall struct {
  3893  	s            *Service
  3894  	name         string
  3895  	urlParams_   gensupport.URLParams
  3896  	ifNoneMatch_ string
  3897  	ctx_         context.Context
  3898  	header_      http.Header
  3899  }
  3900  
  3901  // Get: Gets the requested recommendation. Requires the recommender.*.get IAM
  3902  // permission for the specified recommender.
  3903  //
  3904  // - name: Name of the recommendation.
  3905  func (r *FoldersLocationsRecommendersRecommendationsService) Get(name string) *FoldersLocationsRecommendersRecommendationsGetCall {
  3906  	c := &FoldersLocationsRecommendersRecommendationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3907  	c.name = name
  3908  	return c
  3909  }
  3910  
  3911  // Fields allows partial responses to be retrieved. See
  3912  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3913  // details.
  3914  func (c *FoldersLocationsRecommendersRecommendationsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsRecommendersRecommendationsGetCall {
  3915  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3916  	return c
  3917  }
  3918  
  3919  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3920  // object's ETag matches the given value. This is useful for getting updates
  3921  // only after the object has changed since the last request.
  3922  func (c *FoldersLocationsRecommendersRecommendationsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsRecommendersRecommendationsGetCall {
  3923  	c.ifNoneMatch_ = entityTag
  3924  	return c
  3925  }
  3926  
  3927  // Context sets the context to be used in this call's Do method.
  3928  func (c *FoldersLocationsRecommendersRecommendationsGetCall) Context(ctx context.Context) *FoldersLocationsRecommendersRecommendationsGetCall {
  3929  	c.ctx_ = ctx
  3930  	return c
  3931  }
  3932  
  3933  // Header returns a http.Header that can be modified by the caller to add
  3934  // headers to the request.
  3935  func (c *FoldersLocationsRecommendersRecommendationsGetCall) Header() http.Header {
  3936  	if c.header_ == nil {
  3937  		c.header_ = make(http.Header)
  3938  	}
  3939  	return c.header_
  3940  }
  3941  
  3942  func (c *FoldersLocationsRecommendersRecommendationsGetCall) doRequest(alt string) (*http.Response, error) {
  3943  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3944  	if c.ifNoneMatch_ != "" {
  3945  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3946  	}
  3947  	var body io.Reader = nil
  3948  	c.urlParams_.Set("alt", alt)
  3949  	c.urlParams_.Set("prettyPrint", "false")
  3950  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  3951  	urls += "?" + c.urlParams_.Encode()
  3952  	req, err := http.NewRequest("GET", urls, body)
  3953  	if err != nil {
  3954  		return nil, err
  3955  	}
  3956  	req.Header = reqHeaders
  3957  	googleapi.Expand(req.URL, map[string]string{
  3958  		"name": c.name,
  3959  	})
  3960  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3961  }
  3962  
  3963  // Do executes the "recommender.folders.locations.recommenders.recommendations.get" call.
  3964  // Any non-2xx status code is an error. Response headers are in either
  3965  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  3966  // response was returned at all) in error.(*googleapi.Error).Header. Use
  3967  // googleapi.IsNotModified to check whether the returned error was because
  3968  // http.StatusNotModified was returned.
  3969  func (c *FoldersLocationsRecommendersRecommendationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  3970  	gensupport.SetOptions(c.urlParams_, opts...)
  3971  	res, err := c.doRequest("json")
  3972  	if res != nil && res.StatusCode == http.StatusNotModified {
  3973  		if res.Body != nil {
  3974  			res.Body.Close()
  3975  		}
  3976  		return nil, gensupport.WrapError(&googleapi.Error{
  3977  			Code:   res.StatusCode,
  3978  			Header: res.Header,
  3979  		})
  3980  	}
  3981  	if err != nil {
  3982  		return nil, err
  3983  	}
  3984  	defer googleapi.CloseBody(res)
  3985  	if err := googleapi.CheckResponse(res); err != nil {
  3986  		return nil, gensupport.WrapError(err)
  3987  	}
  3988  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  3989  		ServerResponse: googleapi.ServerResponse{
  3990  			Header:         res.Header,
  3991  			HTTPStatusCode: res.StatusCode,
  3992  		},
  3993  	}
  3994  	target := &ret
  3995  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3996  		return nil, err
  3997  	}
  3998  	return ret, nil
  3999  }
  4000  
  4001  type FoldersLocationsRecommendersRecommendationsListCall struct {
  4002  	s            *Service
  4003  	parent       string
  4004  	urlParams_   gensupport.URLParams
  4005  	ifNoneMatch_ string
  4006  	ctx_         context.Context
  4007  	header_      http.Header
  4008  }
  4009  
  4010  // List: Lists recommendations for the specified Cloud Resource. Requires the
  4011  // recommender.*.list IAM permission for the specified recommender.
  4012  //
  4013  //   - parent: The container resource on which to execute the request. Acceptable
  4014  //     formats: *
  4015  //     `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_I
  4016  //     D]` *
  4017  //     `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]`
  4018  //     *
  4019  //     `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RE
  4020  //     COMMENDER_ID]` *
  4021  //     `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` *
  4022  //     `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMME
  4023  //     NDER_ID]` LOCATION here refers to GCP Locations:
  4024  //     https://cloud.google.com/about/locations/ RECOMMENDER_ID refers to
  4025  //     supported recommenders:
  4026  //     https://cloud.google.com/recommender/docs/recommenders.
  4027  func (r *FoldersLocationsRecommendersRecommendationsService) List(parent string) *FoldersLocationsRecommendersRecommendationsListCall {
  4028  	c := &FoldersLocationsRecommendersRecommendationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4029  	c.parent = parent
  4030  	return c
  4031  }
  4032  
  4033  // Filter sets the optional parameter "filter": Filter expression to restrict
  4034  // the recommendations returned. Supported filter fields: * `state_info.state`
  4035  // * `recommenderSubtype` * `priority` * `targetResources` Examples: *
  4036  // `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` *
  4037  // `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` *
  4038  // `priority = P1 OR priority = P2` * `targetResources :
  4039  // //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance
  4040  // -1` * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` The
  4041  // max allowed filter length is 500 characters. (These expressions are based on
  4042  // the filter language described at https://google.aip.dev/160)
  4043  func (c *FoldersLocationsRecommendersRecommendationsListCall) Filter(filter string) *FoldersLocationsRecommendersRecommendationsListCall {
  4044  	c.urlParams_.Set("filter", filter)
  4045  	return c
  4046  }
  4047  
  4048  // PageSize sets the optional parameter "pageSize": The maximum number of
  4049  // results to return from this request. Non-positive values are ignored. If not
  4050  // specified, the server will determine the number of results to return.
  4051  func (c *FoldersLocationsRecommendersRecommendationsListCall) PageSize(pageSize int64) *FoldersLocationsRecommendersRecommendationsListCall {
  4052  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4053  	return c
  4054  }
  4055  
  4056  // PageToken sets the optional parameter "pageToken": If present, retrieves the
  4057  // next batch of results from the preceding call to this method. `page_token`
  4058  // must be the value of `next_page_token` from the previous response. The
  4059  // values of other method parameters must be identical to those in the previous
  4060  // call.
  4061  func (c *FoldersLocationsRecommendersRecommendationsListCall) PageToken(pageToken string) *FoldersLocationsRecommendersRecommendationsListCall {
  4062  	c.urlParams_.Set("pageToken", pageToken)
  4063  	return c
  4064  }
  4065  
  4066  // Fields allows partial responses to be retrieved. See
  4067  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4068  // details.
  4069  func (c *FoldersLocationsRecommendersRecommendationsListCall) Fields(s ...googleapi.Field) *FoldersLocationsRecommendersRecommendationsListCall {
  4070  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4071  	return c
  4072  }
  4073  
  4074  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4075  // object's ETag matches the given value. This is useful for getting updates
  4076  // only after the object has changed since the last request.
  4077  func (c *FoldersLocationsRecommendersRecommendationsListCall) IfNoneMatch(entityTag string) *FoldersLocationsRecommendersRecommendationsListCall {
  4078  	c.ifNoneMatch_ = entityTag
  4079  	return c
  4080  }
  4081  
  4082  // Context sets the context to be used in this call's Do method.
  4083  func (c *FoldersLocationsRecommendersRecommendationsListCall) Context(ctx context.Context) *FoldersLocationsRecommendersRecommendationsListCall {
  4084  	c.ctx_ = ctx
  4085  	return c
  4086  }
  4087  
  4088  // Header returns a http.Header that can be modified by the caller to add
  4089  // headers to the request.
  4090  func (c *FoldersLocationsRecommendersRecommendationsListCall) Header() http.Header {
  4091  	if c.header_ == nil {
  4092  		c.header_ = make(http.Header)
  4093  	}
  4094  	return c.header_
  4095  }
  4096  
  4097  func (c *FoldersLocationsRecommendersRecommendationsListCall) doRequest(alt string) (*http.Response, error) {
  4098  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4099  	if c.ifNoneMatch_ != "" {
  4100  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4101  	}
  4102  	var body io.Reader = nil
  4103  	c.urlParams_.Set("alt", alt)
  4104  	c.urlParams_.Set("prettyPrint", "false")
  4105  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/recommendations")
  4106  	urls += "?" + c.urlParams_.Encode()
  4107  	req, err := http.NewRequest("GET", urls, body)
  4108  	if err != nil {
  4109  		return nil, err
  4110  	}
  4111  	req.Header = reqHeaders
  4112  	googleapi.Expand(req.URL, map[string]string{
  4113  		"parent": c.parent,
  4114  	})
  4115  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4116  }
  4117  
  4118  // Do executes the "recommender.folders.locations.recommenders.recommendations.list" call.
  4119  // Any non-2xx status code is an error. Response headers are in either
  4120  // *GoogleCloudRecommenderV1beta1ListRecommendationsResponse.ServerResponse.Head
  4121  // er or (if a response was returned at all) in
  4122  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4123  // whether the returned error was because http.StatusNotModified was returned.
  4124  func (c *FoldersLocationsRecommendersRecommendationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1ListRecommendationsResponse, error) {
  4125  	gensupport.SetOptions(c.urlParams_, opts...)
  4126  	res, err := c.doRequest("json")
  4127  	if res != nil && res.StatusCode == http.StatusNotModified {
  4128  		if res.Body != nil {
  4129  			res.Body.Close()
  4130  		}
  4131  		return nil, gensupport.WrapError(&googleapi.Error{
  4132  			Code:   res.StatusCode,
  4133  			Header: res.Header,
  4134  		})
  4135  	}
  4136  	if err != nil {
  4137  		return nil, err
  4138  	}
  4139  	defer googleapi.CloseBody(res)
  4140  	if err := googleapi.CheckResponse(res); err != nil {
  4141  		return nil, gensupport.WrapError(err)
  4142  	}
  4143  	ret := &GoogleCloudRecommenderV1beta1ListRecommendationsResponse{
  4144  		ServerResponse: googleapi.ServerResponse{
  4145  			Header:         res.Header,
  4146  			HTTPStatusCode: res.StatusCode,
  4147  		},
  4148  	}
  4149  	target := &ret
  4150  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4151  		return nil, err
  4152  	}
  4153  	return ret, nil
  4154  }
  4155  
  4156  // Pages invokes f for each page of results.
  4157  // A non-nil error returned from f will halt the iteration.
  4158  // The provided context supersedes any context provided to the Context method.
  4159  func (c *FoldersLocationsRecommendersRecommendationsListCall) Pages(ctx context.Context, f func(*GoogleCloudRecommenderV1beta1ListRecommendationsResponse) error) error {
  4160  	c.ctx_ = ctx
  4161  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4162  	for {
  4163  		x, err := c.Do()
  4164  		if err != nil {
  4165  			return err
  4166  		}
  4167  		if err := f(x); err != nil {
  4168  			return err
  4169  		}
  4170  		if x.NextPageToken == "" {
  4171  			return nil
  4172  		}
  4173  		c.PageToken(x.NextPageToken)
  4174  	}
  4175  }
  4176  
  4177  type FoldersLocationsRecommendersRecommendationsMarkClaimedCall struct {
  4178  	s                                                             *Service
  4179  	name                                                          string
  4180  	googlecloudrecommenderv1beta1markrecommendationclaimedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest
  4181  	urlParams_                                                    gensupport.URLParams
  4182  	ctx_                                                          context.Context
  4183  	header_                                                       http.Header
  4184  }
  4185  
  4186  // MarkClaimed: Marks the Recommendation State as Claimed. Users can use this
  4187  // method to indicate to the Recommender API that they are starting to apply
  4188  // the recommendation themselves. This stops the recommendation content from
  4189  // being updated. Associated insights are frozen and placed in the ACCEPTED
  4190  // state. MarkRecommendationClaimed can be applied to recommendations in
  4191  // CLAIMED or ACTIVE state. Requires the recommender.*.update IAM permission
  4192  // for the specified recommender.
  4193  //
  4194  // - name: Name of the recommendation.
  4195  func (r *FoldersLocationsRecommendersRecommendationsService) MarkClaimed(name string, googlecloudrecommenderv1beta1markrecommendationclaimedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest) *FoldersLocationsRecommendersRecommendationsMarkClaimedCall {
  4196  	c := &FoldersLocationsRecommendersRecommendationsMarkClaimedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4197  	c.name = name
  4198  	c.googlecloudrecommenderv1beta1markrecommendationclaimedrequest = googlecloudrecommenderv1beta1markrecommendationclaimedrequest
  4199  	return c
  4200  }
  4201  
  4202  // Fields allows partial responses to be retrieved. See
  4203  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4204  // details.
  4205  func (c *FoldersLocationsRecommendersRecommendationsMarkClaimedCall) Fields(s ...googleapi.Field) *FoldersLocationsRecommendersRecommendationsMarkClaimedCall {
  4206  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4207  	return c
  4208  }
  4209  
  4210  // Context sets the context to be used in this call's Do method.
  4211  func (c *FoldersLocationsRecommendersRecommendationsMarkClaimedCall) Context(ctx context.Context) *FoldersLocationsRecommendersRecommendationsMarkClaimedCall {
  4212  	c.ctx_ = ctx
  4213  	return c
  4214  }
  4215  
  4216  // Header returns a http.Header that can be modified by the caller to add
  4217  // headers to the request.
  4218  func (c *FoldersLocationsRecommendersRecommendationsMarkClaimedCall) Header() http.Header {
  4219  	if c.header_ == nil {
  4220  		c.header_ = make(http.Header)
  4221  	}
  4222  	return c.header_
  4223  }
  4224  
  4225  func (c *FoldersLocationsRecommendersRecommendationsMarkClaimedCall) doRequest(alt string) (*http.Response, error) {
  4226  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4227  	var body io.Reader = nil
  4228  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationclaimedrequest)
  4229  	if err != nil {
  4230  		return nil, err
  4231  	}
  4232  	c.urlParams_.Set("alt", alt)
  4233  	c.urlParams_.Set("prettyPrint", "false")
  4234  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markClaimed")
  4235  	urls += "?" + c.urlParams_.Encode()
  4236  	req, err := http.NewRequest("POST", urls, body)
  4237  	if err != nil {
  4238  		return nil, err
  4239  	}
  4240  	req.Header = reqHeaders
  4241  	googleapi.Expand(req.URL, map[string]string{
  4242  		"name": c.name,
  4243  	})
  4244  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4245  }
  4246  
  4247  // Do executes the "recommender.folders.locations.recommenders.recommendations.markClaimed" call.
  4248  // Any non-2xx status code is an error. Response headers are in either
  4249  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  4250  // response was returned at all) in error.(*googleapi.Error).Header. Use
  4251  // googleapi.IsNotModified to check whether the returned error was because
  4252  // http.StatusNotModified was returned.
  4253  func (c *FoldersLocationsRecommendersRecommendationsMarkClaimedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  4254  	gensupport.SetOptions(c.urlParams_, opts...)
  4255  	res, err := c.doRequest("json")
  4256  	if res != nil && res.StatusCode == http.StatusNotModified {
  4257  		if res.Body != nil {
  4258  			res.Body.Close()
  4259  		}
  4260  		return nil, gensupport.WrapError(&googleapi.Error{
  4261  			Code:   res.StatusCode,
  4262  			Header: res.Header,
  4263  		})
  4264  	}
  4265  	if err != nil {
  4266  		return nil, err
  4267  	}
  4268  	defer googleapi.CloseBody(res)
  4269  	if err := googleapi.CheckResponse(res); err != nil {
  4270  		return nil, gensupport.WrapError(err)
  4271  	}
  4272  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  4273  		ServerResponse: googleapi.ServerResponse{
  4274  			Header:         res.Header,
  4275  			HTTPStatusCode: res.StatusCode,
  4276  		},
  4277  	}
  4278  	target := &ret
  4279  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4280  		return nil, err
  4281  	}
  4282  	return ret, nil
  4283  }
  4284  
  4285  type FoldersLocationsRecommendersRecommendationsMarkDismissedCall struct {
  4286  	s                                                               *Service
  4287  	name                                                            string
  4288  	googlecloudrecommenderv1beta1markrecommendationdismissedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest
  4289  	urlParams_                                                      gensupport.URLParams
  4290  	ctx_                                                            context.Context
  4291  	header_                                                         http.Header
  4292  }
  4293  
  4294  // MarkDismissed: Mark the Recommendation State as Dismissed. Users can use
  4295  // this method to indicate to the Recommender API that an ACTIVE recommendation
  4296  // has to be marked back as DISMISSED. MarkRecommendationDismissed can be
  4297  // applied to recommendations in ACTIVE state. Requires the
  4298  // recommender.*.update IAM permission for the specified recommender.
  4299  //
  4300  // - name: Name of the recommendation.
  4301  func (r *FoldersLocationsRecommendersRecommendationsService) MarkDismissed(name string, googlecloudrecommenderv1beta1markrecommendationdismissedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest) *FoldersLocationsRecommendersRecommendationsMarkDismissedCall {
  4302  	c := &FoldersLocationsRecommendersRecommendationsMarkDismissedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4303  	c.name = name
  4304  	c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest = googlecloudrecommenderv1beta1markrecommendationdismissedrequest
  4305  	return c
  4306  }
  4307  
  4308  // Fields allows partial responses to be retrieved. See
  4309  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4310  // details.
  4311  func (c *FoldersLocationsRecommendersRecommendationsMarkDismissedCall) Fields(s ...googleapi.Field) *FoldersLocationsRecommendersRecommendationsMarkDismissedCall {
  4312  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4313  	return c
  4314  }
  4315  
  4316  // Context sets the context to be used in this call's Do method.
  4317  func (c *FoldersLocationsRecommendersRecommendationsMarkDismissedCall) Context(ctx context.Context) *FoldersLocationsRecommendersRecommendationsMarkDismissedCall {
  4318  	c.ctx_ = ctx
  4319  	return c
  4320  }
  4321  
  4322  // Header returns a http.Header that can be modified by the caller to add
  4323  // headers to the request.
  4324  func (c *FoldersLocationsRecommendersRecommendationsMarkDismissedCall) Header() http.Header {
  4325  	if c.header_ == nil {
  4326  		c.header_ = make(http.Header)
  4327  	}
  4328  	return c.header_
  4329  }
  4330  
  4331  func (c *FoldersLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) {
  4332  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4333  	var body io.Reader = nil
  4334  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest)
  4335  	if err != nil {
  4336  		return nil, err
  4337  	}
  4338  	c.urlParams_.Set("alt", alt)
  4339  	c.urlParams_.Set("prettyPrint", "false")
  4340  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markDismissed")
  4341  	urls += "?" + c.urlParams_.Encode()
  4342  	req, err := http.NewRequest("POST", urls, body)
  4343  	if err != nil {
  4344  		return nil, err
  4345  	}
  4346  	req.Header = reqHeaders
  4347  	googleapi.Expand(req.URL, map[string]string{
  4348  		"name": c.name,
  4349  	})
  4350  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4351  }
  4352  
  4353  // Do executes the "recommender.folders.locations.recommenders.recommendations.markDismissed" call.
  4354  // Any non-2xx status code is an error. Response headers are in either
  4355  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  4356  // response was returned at all) in error.(*googleapi.Error).Header. Use
  4357  // googleapi.IsNotModified to check whether the returned error was because
  4358  // http.StatusNotModified was returned.
  4359  func (c *FoldersLocationsRecommendersRecommendationsMarkDismissedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  4360  	gensupport.SetOptions(c.urlParams_, opts...)
  4361  	res, err := c.doRequest("json")
  4362  	if res != nil && res.StatusCode == http.StatusNotModified {
  4363  		if res.Body != nil {
  4364  			res.Body.Close()
  4365  		}
  4366  		return nil, gensupport.WrapError(&googleapi.Error{
  4367  			Code:   res.StatusCode,
  4368  			Header: res.Header,
  4369  		})
  4370  	}
  4371  	if err != nil {
  4372  		return nil, err
  4373  	}
  4374  	defer googleapi.CloseBody(res)
  4375  	if err := googleapi.CheckResponse(res); err != nil {
  4376  		return nil, gensupport.WrapError(err)
  4377  	}
  4378  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  4379  		ServerResponse: googleapi.ServerResponse{
  4380  			Header:         res.Header,
  4381  			HTTPStatusCode: res.StatusCode,
  4382  		},
  4383  	}
  4384  	target := &ret
  4385  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4386  		return nil, err
  4387  	}
  4388  	return ret, nil
  4389  }
  4390  
  4391  type FoldersLocationsRecommendersRecommendationsMarkFailedCall struct {
  4392  	s                                                            *Service
  4393  	name                                                         string
  4394  	googlecloudrecommenderv1beta1markrecommendationfailedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest
  4395  	urlParams_                                                   gensupport.URLParams
  4396  	ctx_                                                         context.Context
  4397  	header_                                                      http.Header
  4398  }
  4399  
  4400  // MarkFailed: Marks the Recommendation State as Failed. Users can use this
  4401  // method to indicate to the Recommender API that they have applied the
  4402  // recommendation themselves, and the operation failed. This stops the
  4403  // recommendation content from being updated. Associated insights are frozen
  4404  // and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to
  4405  // recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the
  4406  // recommender.*.update IAM permission for the specified recommender.
  4407  //
  4408  // - name: Name of the recommendation.
  4409  func (r *FoldersLocationsRecommendersRecommendationsService) MarkFailed(name string, googlecloudrecommenderv1beta1markrecommendationfailedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest) *FoldersLocationsRecommendersRecommendationsMarkFailedCall {
  4410  	c := &FoldersLocationsRecommendersRecommendationsMarkFailedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4411  	c.name = name
  4412  	c.googlecloudrecommenderv1beta1markrecommendationfailedrequest = googlecloudrecommenderv1beta1markrecommendationfailedrequest
  4413  	return c
  4414  }
  4415  
  4416  // Fields allows partial responses to be retrieved. See
  4417  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4418  // details.
  4419  func (c *FoldersLocationsRecommendersRecommendationsMarkFailedCall) Fields(s ...googleapi.Field) *FoldersLocationsRecommendersRecommendationsMarkFailedCall {
  4420  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4421  	return c
  4422  }
  4423  
  4424  // Context sets the context to be used in this call's Do method.
  4425  func (c *FoldersLocationsRecommendersRecommendationsMarkFailedCall) Context(ctx context.Context) *FoldersLocationsRecommendersRecommendationsMarkFailedCall {
  4426  	c.ctx_ = ctx
  4427  	return c
  4428  }
  4429  
  4430  // Header returns a http.Header that can be modified by the caller to add
  4431  // headers to the request.
  4432  func (c *FoldersLocationsRecommendersRecommendationsMarkFailedCall) Header() http.Header {
  4433  	if c.header_ == nil {
  4434  		c.header_ = make(http.Header)
  4435  	}
  4436  	return c.header_
  4437  }
  4438  
  4439  func (c *FoldersLocationsRecommendersRecommendationsMarkFailedCall) doRequest(alt string) (*http.Response, error) {
  4440  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4441  	var body io.Reader = nil
  4442  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationfailedrequest)
  4443  	if err != nil {
  4444  		return nil, err
  4445  	}
  4446  	c.urlParams_.Set("alt", alt)
  4447  	c.urlParams_.Set("prettyPrint", "false")
  4448  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markFailed")
  4449  	urls += "?" + c.urlParams_.Encode()
  4450  	req, err := http.NewRequest("POST", urls, body)
  4451  	if err != nil {
  4452  		return nil, err
  4453  	}
  4454  	req.Header = reqHeaders
  4455  	googleapi.Expand(req.URL, map[string]string{
  4456  		"name": c.name,
  4457  	})
  4458  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4459  }
  4460  
  4461  // Do executes the "recommender.folders.locations.recommenders.recommendations.markFailed" call.
  4462  // Any non-2xx status code is an error. Response headers are in either
  4463  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  4464  // response was returned at all) in error.(*googleapi.Error).Header. Use
  4465  // googleapi.IsNotModified to check whether the returned error was because
  4466  // http.StatusNotModified was returned.
  4467  func (c *FoldersLocationsRecommendersRecommendationsMarkFailedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  4468  	gensupport.SetOptions(c.urlParams_, opts...)
  4469  	res, err := c.doRequest("json")
  4470  	if res != nil && res.StatusCode == http.StatusNotModified {
  4471  		if res.Body != nil {
  4472  			res.Body.Close()
  4473  		}
  4474  		return nil, gensupport.WrapError(&googleapi.Error{
  4475  			Code:   res.StatusCode,
  4476  			Header: res.Header,
  4477  		})
  4478  	}
  4479  	if err != nil {
  4480  		return nil, err
  4481  	}
  4482  	defer googleapi.CloseBody(res)
  4483  	if err := googleapi.CheckResponse(res); err != nil {
  4484  		return nil, gensupport.WrapError(err)
  4485  	}
  4486  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  4487  		ServerResponse: googleapi.ServerResponse{
  4488  			Header:         res.Header,
  4489  			HTTPStatusCode: res.StatusCode,
  4490  		},
  4491  	}
  4492  	target := &ret
  4493  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4494  		return nil, err
  4495  	}
  4496  	return ret, nil
  4497  }
  4498  
  4499  type FoldersLocationsRecommendersRecommendationsMarkSucceededCall struct {
  4500  	s                                                               *Service
  4501  	name                                                            string
  4502  	googlecloudrecommenderv1beta1markrecommendationsucceededrequest *GoogleCloudRecommenderV1beta1MarkRecommendationSucceededRequest
  4503  	urlParams_                                                      gensupport.URLParams
  4504  	ctx_                                                            context.Context
  4505  	header_                                                         http.Header
  4506  }
  4507  
  4508  // MarkSucceeded: Marks the Recommendation State as Succeeded. Users can use
  4509  // this method to indicate to the Recommender API that they have applied the
  4510  // recommendation themselves, and the operation was successful. This stops the
  4511  // recommendation content from being updated. Associated insights are frozen
  4512  // and placed in the ACCEPTED state. MarkRecommendationSucceeded can be applied
  4513  // to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires
  4514  // the recommender.*.update IAM permission for the specified recommender.
  4515  //
  4516  // - name: Name of the recommendation.
  4517  func (r *FoldersLocationsRecommendersRecommendationsService) MarkSucceeded(name string, googlecloudrecommenderv1beta1markrecommendationsucceededrequest *GoogleCloudRecommenderV1beta1MarkRecommendationSucceededRequest) *FoldersLocationsRecommendersRecommendationsMarkSucceededCall {
  4518  	c := &FoldersLocationsRecommendersRecommendationsMarkSucceededCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4519  	c.name = name
  4520  	c.googlecloudrecommenderv1beta1markrecommendationsucceededrequest = googlecloudrecommenderv1beta1markrecommendationsucceededrequest
  4521  	return c
  4522  }
  4523  
  4524  // Fields allows partial responses to be retrieved. See
  4525  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4526  // details.
  4527  func (c *FoldersLocationsRecommendersRecommendationsMarkSucceededCall) Fields(s ...googleapi.Field) *FoldersLocationsRecommendersRecommendationsMarkSucceededCall {
  4528  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4529  	return c
  4530  }
  4531  
  4532  // Context sets the context to be used in this call's Do method.
  4533  func (c *FoldersLocationsRecommendersRecommendationsMarkSucceededCall) Context(ctx context.Context) *FoldersLocationsRecommendersRecommendationsMarkSucceededCall {
  4534  	c.ctx_ = ctx
  4535  	return c
  4536  }
  4537  
  4538  // Header returns a http.Header that can be modified by the caller to add
  4539  // headers to the request.
  4540  func (c *FoldersLocationsRecommendersRecommendationsMarkSucceededCall) Header() http.Header {
  4541  	if c.header_ == nil {
  4542  		c.header_ = make(http.Header)
  4543  	}
  4544  	return c.header_
  4545  }
  4546  
  4547  func (c *FoldersLocationsRecommendersRecommendationsMarkSucceededCall) doRequest(alt string) (*http.Response, error) {
  4548  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4549  	var body io.Reader = nil
  4550  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationsucceededrequest)
  4551  	if err != nil {
  4552  		return nil, err
  4553  	}
  4554  	c.urlParams_.Set("alt", alt)
  4555  	c.urlParams_.Set("prettyPrint", "false")
  4556  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markSucceeded")
  4557  	urls += "?" + c.urlParams_.Encode()
  4558  	req, err := http.NewRequest("POST", urls, body)
  4559  	if err != nil {
  4560  		return nil, err
  4561  	}
  4562  	req.Header = reqHeaders
  4563  	googleapi.Expand(req.URL, map[string]string{
  4564  		"name": c.name,
  4565  	})
  4566  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4567  }
  4568  
  4569  // Do executes the "recommender.folders.locations.recommenders.recommendations.markSucceeded" call.
  4570  // Any non-2xx status code is an error. Response headers are in either
  4571  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  4572  // response was returned at all) in error.(*googleapi.Error).Header. Use
  4573  // googleapi.IsNotModified to check whether the returned error was because
  4574  // http.StatusNotModified was returned.
  4575  func (c *FoldersLocationsRecommendersRecommendationsMarkSucceededCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  4576  	gensupport.SetOptions(c.urlParams_, opts...)
  4577  	res, err := c.doRequest("json")
  4578  	if res != nil && res.StatusCode == http.StatusNotModified {
  4579  		if res.Body != nil {
  4580  			res.Body.Close()
  4581  		}
  4582  		return nil, gensupport.WrapError(&googleapi.Error{
  4583  			Code:   res.StatusCode,
  4584  			Header: res.Header,
  4585  		})
  4586  	}
  4587  	if err != nil {
  4588  		return nil, err
  4589  	}
  4590  	defer googleapi.CloseBody(res)
  4591  	if err := googleapi.CheckResponse(res); err != nil {
  4592  		return nil, gensupport.WrapError(err)
  4593  	}
  4594  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  4595  		ServerResponse: googleapi.ServerResponse{
  4596  			Header:         res.Header,
  4597  			HTTPStatusCode: res.StatusCode,
  4598  		},
  4599  	}
  4600  	target := &ret
  4601  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4602  		return nil, err
  4603  	}
  4604  	return ret, nil
  4605  }
  4606  
  4607  type InsightTypesListCall struct {
  4608  	s            *Service
  4609  	urlParams_   gensupport.URLParams
  4610  	ifNoneMatch_ string
  4611  	ctx_         context.Context
  4612  	header_      http.Header
  4613  }
  4614  
  4615  // List: Lists available InsightTypes. No IAM permissions are required.
  4616  func (r *InsightTypesService) List() *InsightTypesListCall {
  4617  	c := &InsightTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4618  	return c
  4619  }
  4620  
  4621  // PageSize sets the optional parameter "pageSize": The number of InsightTypes
  4622  // to return per page. The service may return fewer than this value.
  4623  func (c *InsightTypesListCall) PageSize(pageSize int64) *InsightTypesListCall {
  4624  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4625  	return c
  4626  }
  4627  
  4628  // PageToken sets the optional parameter "pageToken": A page token, received
  4629  // from a previous `ListRecommenders` call. Provide this to retrieve the
  4630  // subsequent page.
  4631  func (c *InsightTypesListCall) PageToken(pageToken string) *InsightTypesListCall {
  4632  	c.urlParams_.Set("pageToken", pageToken)
  4633  	return c
  4634  }
  4635  
  4636  // Fields allows partial responses to be retrieved. See
  4637  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4638  // details.
  4639  func (c *InsightTypesListCall) Fields(s ...googleapi.Field) *InsightTypesListCall {
  4640  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4641  	return c
  4642  }
  4643  
  4644  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4645  // object's ETag matches the given value. This is useful for getting updates
  4646  // only after the object has changed since the last request.
  4647  func (c *InsightTypesListCall) IfNoneMatch(entityTag string) *InsightTypesListCall {
  4648  	c.ifNoneMatch_ = entityTag
  4649  	return c
  4650  }
  4651  
  4652  // Context sets the context to be used in this call's Do method.
  4653  func (c *InsightTypesListCall) Context(ctx context.Context) *InsightTypesListCall {
  4654  	c.ctx_ = ctx
  4655  	return c
  4656  }
  4657  
  4658  // Header returns a http.Header that can be modified by the caller to add
  4659  // headers to the request.
  4660  func (c *InsightTypesListCall) Header() http.Header {
  4661  	if c.header_ == nil {
  4662  		c.header_ = make(http.Header)
  4663  	}
  4664  	return c.header_
  4665  }
  4666  
  4667  func (c *InsightTypesListCall) doRequest(alt string) (*http.Response, error) {
  4668  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4669  	if c.ifNoneMatch_ != "" {
  4670  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4671  	}
  4672  	var body io.Reader = nil
  4673  	c.urlParams_.Set("alt", alt)
  4674  	c.urlParams_.Set("prettyPrint", "false")
  4675  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/insightTypes")
  4676  	urls += "?" + c.urlParams_.Encode()
  4677  	req, err := http.NewRequest("GET", urls, body)
  4678  	if err != nil {
  4679  		return nil, err
  4680  	}
  4681  	req.Header = reqHeaders
  4682  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4683  }
  4684  
  4685  // Do executes the "recommender.insightTypes.list" call.
  4686  // Any non-2xx status code is an error. Response headers are in either
  4687  // *GoogleCloudRecommenderV1beta1ListInsightTypesResponse.ServerResponse.Header
  4688  // or (if a response was returned at all) in error.(*googleapi.Error).Header.
  4689  // Use googleapi.IsNotModified to check whether the returned error was because
  4690  // http.StatusNotModified was returned.
  4691  func (c *InsightTypesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1ListInsightTypesResponse, error) {
  4692  	gensupport.SetOptions(c.urlParams_, opts...)
  4693  	res, err := c.doRequest("json")
  4694  	if res != nil && res.StatusCode == http.StatusNotModified {
  4695  		if res.Body != nil {
  4696  			res.Body.Close()
  4697  		}
  4698  		return nil, gensupport.WrapError(&googleapi.Error{
  4699  			Code:   res.StatusCode,
  4700  			Header: res.Header,
  4701  		})
  4702  	}
  4703  	if err != nil {
  4704  		return nil, err
  4705  	}
  4706  	defer googleapi.CloseBody(res)
  4707  	if err := googleapi.CheckResponse(res); err != nil {
  4708  		return nil, gensupport.WrapError(err)
  4709  	}
  4710  	ret := &GoogleCloudRecommenderV1beta1ListInsightTypesResponse{
  4711  		ServerResponse: googleapi.ServerResponse{
  4712  			Header:         res.Header,
  4713  			HTTPStatusCode: res.StatusCode,
  4714  		},
  4715  	}
  4716  	target := &ret
  4717  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4718  		return nil, err
  4719  	}
  4720  	return ret, nil
  4721  }
  4722  
  4723  // Pages invokes f for each page of results.
  4724  // A non-nil error returned from f will halt the iteration.
  4725  // The provided context supersedes any context provided to the Context method.
  4726  func (c *InsightTypesListCall) Pages(ctx context.Context, f func(*GoogleCloudRecommenderV1beta1ListInsightTypesResponse) error) error {
  4727  	c.ctx_ = ctx
  4728  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4729  	for {
  4730  		x, err := c.Do()
  4731  		if err != nil {
  4732  			return err
  4733  		}
  4734  		if err := f(x); err != nil {
  4735  			return err
  4736  		}
  4737  		if x.NextPageToken == "" {
  4738  			return nil
  4739  		}
  4740  		c.PageToken(x.NextPageToken)
  4741  	}
  4742  }
  4743  
  4744  type OrganizationsLocationsListCall struct {
  4745  	s            *Service
  4746  	name         string
  4747  	urlParams_   gensupport.URLParams
  4748  	ifNoneMatch_ string
  4749  	ctx_         context.Context
  4750  	header_      http.Header
  4751  }
  4752  
  4753  // List: Lists locations with recommendations or insights.
  4754  //
  4755  // - name: The resource that owns the locations collection, if applicable.
  4756  func (r *OrganizationsLocationsService) List(name string) *OrganizationsLocationsListCall {
  4757  	c := &OrganizationsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4758  	c.name = name
  4759  	return c
  4760  }
  4761  
  4762  // Filter sets the optional parameter "filter": A filter to narrow down results
  4763  // to a preferred subset. The filtering language accepts strings like
  4764  // "displayName=tokyo", and is documented in more detail in AIP-160
  4765  // (https://google.aip.dev/160).
  4766  func (c *OrganizationsLocationsListCall) Filter(filter string) *OrganizationsLocationsListCall {
  4767  	c.urlParams_.Set("filter", filter)
  4768  	return c
  4769  }
  4770  
  4771  // PageSize sets the optional parameter "pageSize": The maximum number of
  4772  // results to return. If not set, the service selects a default.
  4773  func (c *OrganizationsLocationsListCall) PageSize(pageSize int64) *OrganizationsLocationsListCall {
  4774  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4775  	return c
  4776  }
  4777  
  4778  // PageToken sets the optional parameter "pageToken": A page token received
  4779  // from the `next_page_token` field in the response. Send that page token to
  4780  // receive the subsequent page.
  4781  func (c *OrganizationsLocationsListCall) PageToken(pageToken string) *OrganizationsLocationsListCall {
  4782  	c.urlParams_.Set("pageToken", pageToken)
  4783  	return c
  4784  }
  4785  
  4786  // Fields allows partial responses to be retrieved. See
  4787  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4788  // details.
  4789  func (c *OrganizationsLocationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsListCall {
  4790  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4791  	return c
  4792  }
  4793  
  4794  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4795  // object's ETag matches the given value. This is useful for getting updates
  4796  // only after the object has changed since the last request.
  4797  func (c *OrganizationsLocationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsListCall {
  4798  	c.ifNoneMatch_ = entityTag
  4799  	return c
  4800  }
  4801  
  4802  // Context sets the context to be used in this call's Do method.
  4803  func (c *OrganizationsLocationsListCall) Context(ctx context.Context) *OrganizationsLocationsListCall {
  4804  	c.ctx_ = ctx
  4805  	return c
  4806  }
  4807  
  4808  // Header returns a http.Header that can be modified by the caller to add
  4809  // headers to the request.
  4810  func (c *OrganizationsLocationsListCall) Header() http.Header {
  4811  	if c.header_ == nil {
  4812  		c.header_ = make(http.Header)
  4813  	}
  4814  	return c.header_
  4815  }
  4816  
  4817  func (c *OrganizationsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  4818  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4819  	if c.ifNoneMatch_ != "" {
  4820  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4821  	}
  4822  	var body io.Reader = nil
  4823  	c.urlParams_.Set("alt", alt)
  4824  	c.urlParams_.Set("prettyPrint", "false")
  4825  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations")
  4826  	urls += "?" + c.urlParams_.Encode()
  4827  	req, err := http.NewRequest("GET", urls, body)
  4828  	if err != nil {
  4829  		return nil, err
  4830  	}
  4831  	req.Header = reqHeaders
  4832  	googleapi.Expand(req.URL, map[string]string{
  4833  		"name": c.name,
  4834  	})
  4835  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4836  }
  4837  
  4838  // Do executes the "recommender.organizations.locations.list" call.
  4839  // Any non-2xx status code is an error. Response headers are in either
  4840  // *GoogleCloudLocationListLocationsResponse.ServerResponse.Header or (if a
  4841  // response was returned at all) in error.(*googleapi.Error).Header. Use
  4842  // googleapi.IsNotModified to check whether the returned error was because
  4843  // http.StatusNotModified was returned.
  4844  func (c *OrganizationsLocationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudLocationListLocationsResponse, error) {
  4845  	gensupport.SetOptions(c.urlParams_, opts...)
  4846  	res, err := c.doRequest("json")
  4847  	if res != nil && res.StatusCode == http.StatusNotModified {
  4848  		if res.Body != nil {
  4849  			res.Body.Close()
  4850  		}
  4851  		return nil, gensupport.WrapError(&googleapi.Error{
  4852  			Code:   res.StatusCode,
  4853  			Header: res.Header,
  4854  		})
  4855  	}
  4856  	if err != nil {
  4857  		return nil, err
  4858  	}
  4859  	defer googleapi.CloseBody(res)
  4860  	if err := googleapi.CheckResponse(res); err != nil {
  4861  		return nil, gensupport.WrapError(err)
  4862  	}
  4863  	ret := &GoogleCloudLocationListLocationsResponse{
  4864  		ServerResponse: googleapi.ServerResponse{
  4865  			Header:         res.Header,
  4866  			HTTPStatusCode: res.StatusCode,
  4867  		},
  4868  	}
  4869  	target := &ret
  4870  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4871  		return nil, err
  4872  	}
  4873  	return ret, nil
  4874  }
  4875  
  4876  // Pages invokes f for each page of results.
  4877  // A non-nil error returned from f will halt the iteration.
  4878  // The provided context supersedes any context provided to the Context method.
  4879  func (c *OrganizationsLocationsListCall) Pages(ctx context.Context, f func(*GoogleCloudLocationListLocationsResponse) error) error {
  4880  	c.ctx_ = ctx
  4881  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4882  	for {
  4883  		x, err := c.Do()
  4884  		if err != nil {
  4885  			return err
  4886  		}
  4887  		if err := f(x); err != nil {
  4888  			return err
  4889  		}
  4890  		if x.NextPageToken == "" {
  4891  			return nil
  4892  		}
  4893  		c.PageToken(x.NextPageToken)
  4894  	}
  4895  }
  4896  
  4897  type OrganizationsLocationsInsightTypesGetConfigCall struct {
  4898  	s            *Service
  4899  	name         string
  4900  	urlParams_   gensupport.URLParams
  4901  	ifNoneMatch_ string
  4902  	ctx_         context.Context
  4903  	header_      http.Header
  4904  }
  4905  
  4906  // GetConfig: Gets the requested InsightTypeConfig. There is only one instance
  4907  // of the config for each InsightType.
  4908  //
  4909  //   - name: Name of the InsightTypeConfig to get. Acceptable formats: *
  4910  //     `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_
  4911  //     ID]/config` *
  4912  //     `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/
  4913  //     config` *
  4914  //     `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT
  4915  //     _TYPE_ID]/config` *
  4916  //     `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[IN
  4917  //     SIGHT_TYPE_ID]/config`.
  4918  func (r *OrganizationsLocationsInsightTypesService) GetConfig(name string) *OrganizationsLocationsInsightTypesGetConfigCall {
  4919  	c := &OrganizationsLocationsInsightTypesGetConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4920  	c.name = name
  4921  	return c
  4922  }
  4923  
  4924  // Fields allows partial responses to be retrieved. See
  4925  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4926  // details.
  4927  func (c *OrganizationsLocationsInsightTypesGetConfigCall) Fields(s ...googleapi.Field) *OrganizationsLocationsInsightTypesGetConfigCall {
  4928  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4929  	return c
  4930  }
  4931  
  4932  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4933  // object's ETag matches the given value. This is useful for getting updates
  4934  // only after the object has changed since the last request.
  4935  func (c *OrganizationsLocationsInsightTypesGetConfigCall) IfNoneMatch(entityTag string) *OrganizationsLocationsInsightTypesGetConfigCall {
  4936  	c.ifNoneMatch_ = entityTag
  4937  	return c
  4938  }
  4939  
  4940  // Context sets the context to be used in this call's Do method.
  4941  func (c *OrganizationsLocationsInsightTypesGetConfigCall) Context(ctx context.Context) *OrganizationsLocationsInsightTypesGetConfigCall {
  4942  	c.ctx_ = ctx
  4943  	return c
  4944  }
  4945  
  4946  // Header returns a http.Header that can be modified by the caller to add
  4947  // headers to the request.
  4948  func (c *OrganizationsLocationsInsightTypesGetConfigCall) Header() http.Header {
  4949  	if c.header_ == nil {
  4950  		c.header_ = make(http.Header)
  4951  	}
  4952  	return c.header_
  4953  }
  4954  
  4955  func (c *OrganizationsLocationsInsightTypesGetConfigCall) doRequest(alt string) (*http.Response, error) {
  4956  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4957  	if c.ifNoneMatch_ != "" {
  4958  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4959  	}
  4960  	var body io.Reader = nil
  4961  	c.urlParams_.Set("alt", alt)
  4962  	c.urlParams_.Set("prettyPrint", "false")
  4963  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  4964  	urls += "?" + c.urlParams_.Encode()
  4965  	req, err := http.NewRequest("GET", urls, body)
  4966  	if err != nil {
  4967  		return nil, err
  4968  	}
  4969  	req.Header = reqHeaders
  4970  	googleapi.Expand(req.URL, map[string]string{
  4971  		"name": c.name,
  4972  	})
  4973  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4974  }
  4975  
  4976  // Do executes the "recommender.organizations.locations.insightTypes.getConfig" call.
  4977  // Any non-2xx status code is an error. Response headers are in either
  4978  // *GoogleCloudRecommenderV1beta1InsightTypeConfig.ServerResponse.Header or (if
  4979  // a response was returned at all) in error.(*googleapi.Error).Header. Use
  4980  // googleapi.IsNotModified to check whether the returned error was because
  4981  // http.StatusNotModified was returned.
  4982  func (c *OrganizationsLocationsInsightTypesGetConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1InsightTypeConfig, error) {
  4983  	gensupport.SetOptions(c.urlParams_, opts...)
  4984  	res, err := c.doRequest("json")
  4985  	if res != nil && res.StatusCode == http.StatusNotModified {
  4986  		if res.Body != nil {
  4987  			res.Body.Close()
  4988  		}
  4989  		return nil, gensupport.WrapError(&googleapi.Error{
  4990  			Code:   res.StatusCode,
  4991  			Header: res.Header,
  4992  		})
  4993  	}
  4994  	if err != nil {
  4995  		return nil, err
  4996  	}
  4997  	defer googleapi.CloseBody(res)
  4998  	if err := googleapi.CheckResponse(res); err != nil {
  4999  		return nil, gensupport.WrapError(err)
  5000  	}
  5001  	ret := &GoogleCloudRecommenderV1beta1InsightTypeConfig{
  5002  		ServerResponse: googleapi.ServerResponse{
  5003  			Header:         res.Header,
  5004  			HTTPStatusCode: res.StatusCode,
  5005  		},
  5006  	}
  5007  	target := &ret
  5008  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5009  		return nil, err
  5010  	}
  5011  	return ret, nil
  5012  }
  5013  
  5014  type OrganizationsLocationsInsightTypesUpdateConfigCall struct {
  5015  	s                                              *Service
  5016  	name                                           string
  5017  	googlecloudrecommenderv1beta1insighttypeconfig *GoogleCloudRecommenderV1beta1InsightTypeConfig
  5018  	urlParams_                                     gensupport.URLParams
  5019  	ctx_                                           context.Context
  5020  	header_                                        http.Header
  5021  }
  5022  
  5023  // UpdateConfig: Updates an InsightTypeConfig change. This will create a new
  5024  // revision of the config.
  5025  //
  5026  //   - name: Identifier. Name of insight type config. Eg,
  5027  //     projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_I
  5028  //     D]/config.
  5029  func (r *OrganizationsLocationsInsightTypesService) UpdateConfig(name string, googlecloudrecommenderv1beta1insighttypeconfig *GoogleCloudRecommenderV1beta1InsightTypeConfig) *OrganizationsLocationsInsightTypesUpdateConfigCall {
  5030  	c := &OrganizationsLocationsInsightTypesUpdateConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5031  	c.name = name
  5032  	c.googlecloudrecommenderv1beta1insighttypeconfig = googlecloudrecommenderv1beta1insighttypeconfig
  5033  	return c
  5034  }
  5035  
  5036  // UpdateMask sets the optional parameter "updateMask": The list of fields to
  5037  // be updated.
  5038  func (c *OrganizationsLocationsInsightTypesUpdateConfigCall) UpdateMask(updateMask string) *OrganizationsLocationsInsightTypesUpdateConfigCall {
  5039  	c.urlParams_.Set("updateMask", updateMask)
  5040  	return c
  5041  }
  5042  
  5043  // ValidateOnly sets the optional parameter "validateOnly": If true, validate
  5044  // the request and preview the change, but do not actually update it.
  5045  func (c *OrganizationsLocationsInsightTypesUpdateConfigCall) ValidateOnly(validateOnly bool) *OrganizationsLocationsInsightTypesUpdateConfigCall {
  5046  	c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  5047  	return c
  5048  }
  5049  
  5050  // Fields allows partial responses to be retrieved. See
  5051  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5052  // details.
  5053  func (c *OrganizationsLocationsInsightTypesUpdateConfigCall) Fields(s ...googleapi.Field) *OrganizationsLocationsInsightTypesUpdateConfigCall {
  5054  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5055  	return c
  5056  }
  5057  
  5058  // Context sets the context to be used in this call's Do method.
  5059  func (c *OrganizationsLocationsInsightTypesUpdateConfigCall) Context(ctx context.Context) *OrganizationsLocationsInsightTypesUpdateConfigCall {
  5060  	c.ctx_ = ctx
  5061  	return c
  5062  }
  5063  
  5064  // Header returns a http.Header that can be modified by the caller to add
  5065  // headers to the request.
  5066  func (c *OrganizationsLocationsInsightTypesUpdateConfigCall) Header() http.Header {
  5067  	if c.header_ == nil {
  5068  		c.header_ = make(http.Header)
  5069  	}
  5070  	return c.header_
  5071  }
  5072  
  5073  func (c *OrganizationsLocationsInsightTypesUpdateConfigCall) doRequest(alt string) (*http.Response, error) {
  5074  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5075  	var body io.Reader = nil
  5076  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1insighttypeconfig)
  5077  	if err != nil {
  5078  		return nil, err
  5079  	}
  5080  	c.urlParams_.Set("alt", alt)
  5081  	c.urlParams_.Set("prettyPrint", "false")
  5082  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  5083  	urls += "?" + c.urlParams_.Encode()
  5084  	req, err := http.NewRequest("PATCH", urls, body)
  5085  	if err != nil {
  5086  		return nil, err
  5087  	}
  5088  	req.Header = reqHeaders
  5089  	googleapi.Expand(req.URL, map[string]string{
  5090  		"name": c.name,
  5091  	})
  5092  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5093  }
  5094  
  5095  // Do executes the "recommender.organizations.locations.insightTypes.updateConfig" call.
  5096  // Any non-2xx status code is an error. Response headers are in either
  5097  // *GoogleCloudRecommenderV1beta1InsightTypeConfig.ServerResponse.Header or (if
  5098  // a response was returned at all) in error.(*googleapi.Error).Header. Use
  5099  // googleapi.IsNotModified to check whether the returned error was because
  5100  // http.StatusNotModified was returned.
  5101  func (c *OrganizationsLocationsInsightTypesUpdateConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1InsightTypeConfig, error) {
  5102  	gensupport.SetOptions(c.urlParams_, opts...)
  5103  	res, err := c.doRequest("json")
  5104  	if res != nil && res.StatusCode == http.StatusNotModified {
  5105  		if res.Body != nil {
  5106  			res.Body.Close()
  5107  		}
  5108  		return nil, gensupport.WrapError(&googleapi.Error{
  5109  			Code:   res.StatusCode,
  5110  			Header: res.Header,
  5111  		})
  5112  	}
  5113  	if err != nil {
  5114  		return nil, err
  5115  	}
  5116  	defer googleapi.CloseBody(res)
  5117  	if err := googleapi.CheckResponse(res); err != nil {
  5118  		return nil, gensupport.WrapError(err)
  5119  	}
  5120  	ret := &GoogleCloudRecommenderV1beta1InsightTypeConfig{
  5121  		ServerResponse: googleapi.ServerResponse{
  5122  			Header:         res.Header,
  5123  			HTTPStatusCode: res.StatusCode,
  5124  		},
  5125  	}
  5126  	target := &ret
  5127  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5128  		return nil, err
  5129  	}
  5130  	return ret, nil
  5131  }
  5132  
  5133  type OrganizationsLocationsInsightTypesInsightsGetCall struct {
  5134  	s            *Service
  5135  	name         string
  5136  	urlParams_   gensupport.URLParams
  5137  	ifNoneMatch_ string
  5138  	ctx_         context.Context
  5139  	header_      http.Header
  5140  }
  5141  
  5142  // Get: Gets the requested insight. Requires the recommender.*.get IAM
  5143  // permission for the specified insight type.
  5144  //
  5145  // - name: Name of the insight.
  5146  func (r *OrganizationsLocationsInsightTypesInsightsService) Get(name string) *OrganizationsLocationsInsightTypesInsightsGetCall {
  5147  	c := &OrganizationsLocationsInsightTypesInsightsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5148  	c.name = name
  5149  	return c
  5150  }
  5151  
  5152  // Fields allows partial responses to be retrieved. See
  5153  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5154  // details.
  5155  func (c *OrganizationsLocationsInsightTypesInsightsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsInsightTypesInsightsGetCall {
  5156  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5157  	return c
  5158  }
  5159  
  5160  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5161  // object's ETag matches the given value. This is useful for getting updates
  5162  // only after the object has changed since the last request.
  5163  func (c *OrganizationsLocationsInsightTypesInsightsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsInsightTypesInsightsGetCall {
  5164  	c.ifNoneMatch_ = entityTag
  5165  	return c
  5166  }
  5167  
  5168  // Context sets the context to be used in this call's Do method.
  5169  func (c *OrganizationsLocationsInsightTypesInsightsGetCall) Context(ctx context.Context) *OrganizationsLocationsInsightTypesInsightsGetCall {
  5170  	c.ctx_ = ctx
  5171  	return c
  5172  }
  5173  
  5174  // Header returns a http.Header that can be modified by the caller to add
  5175  // headers to the request.
  5176  func (c *OrganizationsLocationsInsightTypesInsightsGetCall) Header() http.Header {
  5177  	if c.header_ == nil {
  5178  		c.header_ = make(http.Header)
  5179  	}
  5180  	return c.header_
  5181  }
  5182  
  5183  func (c *OrganizationsLocationsInsightTypesInsightsGetCall) doRequest(alt string) (*http.Response, error) {
  5184  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5185  	if c.ifNoneMatch_ != "" {
  5186  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5187  	}
  5188  	var body io.Reader = nil
  5189  	c.urlParams_.Set("alt", alt)
  5190  	c.urlParams_.Set("prettyPrint", "false")
  5191  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  5192  	urls += "?" + c.urlParams_.Encode()
  5193  	req, err := http.NewRequest("GET", urls, body)
  5194  	if err != nil {
  5195  		return nil, err
  5196  	}
  5197  	req.Header = reqHeaders
  5198  	googleapi.Expand(req.URL, map[string]string{
  5199  		"name": c.name,
  5200  	})
  5201  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5202  }
  5203  
  5204  // Do executes the "recommender.organizations.locations.insightTypes.insights.get" call.
  5205  // Any non-2xx status code is an error. Response headers are in either
  5206  // *GoogleCloudRecommenderV1beta1Insight.ServerResponse.Header or (if a
  5207  // response was returned at all) in error.(*googleapi.Error).Header. Use
  5208  // googleapi.IsNotModified to check whether the returned error was because
  5209  // http.StatusNotModified was returned.
  5210  func (c *OrganizationsLocationsInsightTypesInsightsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Insight, error) {
  5211  	gensupport.SetOptions(c.urlParams_, opts...)
  5212  	res, err := c.doRequest("json")
  5213  	if res != nil && res.StatusCode == http.StatusNotModified {
  5214  		if res.Body != nil {
  5215  			res.Body.Close()
  5216  		}
  5217  		return nil, gensupport.WrapError(&googleapi.Error{
  5218  			Code:   res.StatusCode,
  5219  			Header: res.Header,
  5220  		})
  5221  	}
  5222  	if err != nil {
  5223  		return nil, err
  5224  	}
  5225  	defer googleapi.CloseBody(res)
  5226  	if err := googleapi.CheckResponse(res); err != nil {
  5227  		return nil, gensupport.WrapError(err)
  5228  	}
  5229  	ret := &GoogleCloudRecommenderV1beta1Insight{
  5230  		ServerResponse: googleapi.ServerResponse{
  5231  			Header:         res.Header,
  5232  			HTTPStatusCode: res.StatusCode,
  5233  		},
  5234  	}
  5235  	target := &ret
  5236  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5237  		return nil, err
  5238  	}
  5239  	return ret, nil
  5240  }
  5241  
  5242  type OrganizationsLocationsInsightTypesInsightsListCall struct {
  5243  	s            *Service
  5244  	parent       string
  5245  	urlParams_   gensupport.URLParams
  5246  	ifNoneMatch_ string
  5247  	ctx_         context.Context
  5248  	header_      http.Header
  5249  }
  5250  
  5251  // List: Lists insights for the specified Cloud Resource. Requires the
  5252  // recommender.*.list IAM permission for the specified insight type.
  5253  //
  5254  //   - parent: The container resource on which to execute the request. Acceptable
  5255  //     formats: *
  5256  //     `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_
  5257  //     ID]` *
  5258  //     `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]`
  5259  //     *
  5260  //     `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[IN
  5261  //     SIGHT_TYPE_ID]` *
  5262  //     `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]`
  5263  //     *
  5264  //     `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT
  5265  //     _TYPE_ID]` LOCATION here refers to GCP Locations:
  5266  //     https://cloud.google.com/about/locations/ INSIGHT_TYPE_ID refers to
  5267  //     supported insight types:
  5268  //     https://cloud.google.com/recommender/docs/insights/insight-types.
  5269  func (r *OrganizationsLocationsInsightTypesInsightsService) List(parent string) *OrganizationsLocationsInsightTypesInsightsListCall {
  5270  	c := &OrganizationsLocationsInsightTypesInsightsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5271  	c.parent = parent
  5272  	return c
  5273  }
  5274  
  5275  // Filter sets the optional parameter "filter": Filter expression to restrict
  5276  // the insights returned. Supported filter fields: * `stateInfo.state` *
  5277  // `insightSubtype` * `severity` * `targetResources` Examples: *
  5278  // `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` * `insightSubtype
  5279  // = PERMISSIONS_USAGE` * `severity = CRITICAL OR severity = HIGH` *
  5280  // `targetResources :
  5281  // //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance
  5282  // -1` * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity =
  5283  // HIGH)` The max allowed filter length is 500 characters. (These expressions
  5284  // are based on the filter language described at https://google.aip.dev/160)
  5285  func (c *OrganizationsLocationsInsightTypesInsightsListCall) Filter(filter string) *OrganizationsLocationsInsightTypesInsightsListCall {
  5286  	c.urlParams_.Set("filter", filter)
  5287  	return c
  5288  }
  5289  
  5290  // PageSize sets the optional parameter "pageSize": The maximum number of
  5291  // results to return from this request. Non-positive values are ignored. If not
  5292  // specified, the server will determine the number of results to return.
  5293  func (c *OrganizationsLocationsInsightTypesInsightsListCall) PageSize(pageSize int64) *OrganizationsLocationsInsightTypesInsightsListCall {
  5294  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5295  	return c
  5296  }
  5297  
  5298  // PageToken sets the optional parameter "pageToken": If present, retrieves the
  5299  // next batch of results from the preceding call to this method. `page_token`
  5300  // must be the value of `next_page_token` from the previous response. The
  5301  // values of other method parameters must be identical to those in the previous
  5302  // call.
  5303  func (c *OrganizationsLocationsInsightTypesInsightsListCall) PageToken(pageToken string) *OrganizationsLocationsInsightTypesInsightsListCall {
  5304  	c.urlParams_.Set("pageToken", pageToken)
  5305  	return c
  5306  }
  5307  
  5308  // Fields allows partial responses to be retrieved. See
  5309  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5310  // details.
  5311  func (c *OrganizationsLocationsInsightTypesInsightsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsInsightTypesInsightsListCall {
  5312  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5313  	return c
  5314  }
  5315  
  5316  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5317  // object's ETag matches the given value. This is useful for getting updates
  5318  // only after the object has changed since the last request.
  5319  func (c *OrganizationsLocationsInsightTypesInsightsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsInsightTypesInsightsListCall {
  5320  	c.ifNoneMatch_ = entityTag
  5321  	return c
  5322  }
  5323  
  5324  // Context sets the context to be used in this call's Do method.
  5325  func (c *OrganizationsLocationsInsightTypesInsightsListCall) Context(ctx context.Context) *OrganizationsLocationsInsightTypesInsightsListCall {
  5326  	c.ctx_ = ctx
  5327  	return c
  5328  }
  5329  
  5330  // Header returns a http.Header that can be modified by the caller to add
  5331  // headers to the request.
  5332  func (c *OrganizationsLocationsInsightTypesInsightsListCall) Header() http.Header {
  5333  	if c.header_ == nil {
  5334  		c.header_ = make(http.Header)
  5335  	}
  5336  	return c.header_
  5337  }
  5338  
  5339  func (c *OrganizationsLocationsInsightTypesInsightsListCall) doRequest(alt string) (*http.Response, error) {
  5340  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5341  	if c.ifNoneMatch_ != "" {
  5342  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5343  	}
  5344  	var body io.Reader = nil
  5345  	c.urlParams_.Set("alt", alt)
  5346  	c.urlParams_.Set("prettyPrint", "false")
  5347  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/insights")
  5348  	urls += "?" + c.urlParams_.Encode()
  5349  	req, err := http.NewRequest("GET", urls, body)
  5350  	if err != nil {
  5351  		return nil, err
  5352  	}
  5353  	req.Header = reqHeaders
  5354  	googleapi.Expand(req.URL, map[string]string{
  5355  		"parent": c.parent,
  5356  	})
  5357  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5358  }
  5359  
  5360  // Do executes the "recommender.organizations.locations.insightTypes.insights.list" call.
  5361  // Any non-2xx status code is an error. Response headers are in either
  5362  // *GoogleCloudRecommenderV1beta1ListInsightsResponse.ServerResponse.Header or
  5363  // (if a response was returned at all) in error.(*googleapi.Error).Header. Use
  5364  // googleapi.IsNotModified to check whether the returned error was because
  5365  // http.StatusNotModified was returned.
  5366  func (c *OrganizationsLocationsInsightTypesInsightsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1ListInsightsResponse, error) {
  5367  	gensupport.SetOptions(c.urlParams_, opts...)
  5368  	res, err := c.doRequest("json")
  5369  	if res != nil && res.StatusCode == http.StatusNotModified {
  5370  		if res.Body != nil {
  5371  			res.Body.Close()
  5372  		}
  5373  		return nil, gensupport.WrapError(&googleapi.Error{
  5374  			Code:   res.StatusCode,
  5375  			Header: res.Header,
  5376  		})
  5377  	}
  5378  	if err != nil {
  5379  		return nil, err
  5380  	}
  5381  	defer googleapi.CloseBody(res)
  5382  	if err := googleapi.CheckResponse(res); err != nil {
  5383  		return nil, gensupport.WrapError(err)
  5384  	}
  5385  	ret := &GoogleCloudRecommenderV1beta1ListInsightsResponse{
  5386  		ServerResponse: googleapi.ServerResponse{
  5387  			Header:         res.Header,
  5388  			HTTPStatusCode: res.StatusCode,
  5389  		},
  5390  	}
  5391  	target := &ret
  5392  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5393  		return nil, err
  5394  	}
  5395  	return ret, nil
  5396  }
  5397  
  5398  // Pages invokes f for each page of results.
  5399  // A non-nil error returned from f will halt the iteration.
  5400  // The provided context supersedes any context provided to the Context method.
  5401  func (c *OrganizationsLocationsInsightTypesInsightsListCall) Pages(ctx context.Context, f func(*GoogleCloudRecommenderV1beta1ListInsightsResponse) error) error {
  5402  	c.ctx_ = ctx
  5403  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  5404  	for {
  5405  		x, err := c.Do()
  5406  		if err != nil {
  5407  			return err
  5408  		}
  5409  		if err := f(x); err != nil {
  5410  			return err
  5411  		}
  5412  		if x.NextPageToken == "" {
  5413  			return nil
  5414  		}
  5415  		c.PageToken(x.NextPageToken)
  5416  	}
  5417  }
  5418  
  5419  type OrganizationsLocationsInsightTypesInsightsMarkAcceptedCall struct {
  5420  	s                                                       *Service
  5421  	name                                                    string
  5422  	googlecloudrecommenderv1beta1markinsightacceptedrequest *GoogleCloudRecommenderV1beta1MarkInsightAcceptedRequest
  5423  	urlParams_                                              gensupport.URLParams
  5424  	ctx_                                                    context.Context
  5425  	header_                                                 http.Header
  5426  }
  5427  
  5428  // MarkAccepted: Marks the Insight State as Accepted. Users can use this method
  5429  // to indicate to the Recommender API that they have applied some action based
  5430  // on the insight. This stops the insight content from being updated.
  5431  // MarkInsightAccepted can be applied to insights in ACTIVE state. Requires the
  5432  // recommender.*.update IAM permission for the specified insight.
  5433  //
  5434  // - name: Name of the insight.
  5435  func (r *OrganizationsLocationsInsightTypesInsightsService) MarkAccepted(name string, googlecloudrecommenderv1beta1markinsightacceptedrequest *GoogleCloudRecommenderV1beta1MarkInsightAcceptedRequest) *OrganizationsLocationsInsightTypesInsightsMarkAcceptedCall {
  5436  	c := &OrganizationsLocationsInsightTypesInsightsMarkAcceptedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5437  	c.name = name
  5438  	c.googlecloudrecommenderv1beta1markinsightacceptedrequest = googlecloudrecommenderv1beta1markinsightacceptedrequest
  5439  	return c
  5440  }
  5441  
  5442  // Fields allows partial responses to be retrieved. See
  5443  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5444  // details.
  5445  func (c *OrganizationsLocationsInsightTypesInsightsMarkAcceptedCall) Fields(s ...googleapi.Field) *OrganizationsLocationsInsightTypesInsightsMarkAcceptedCall {
  5446  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5447  	return c
  5448  }
  5449  
  5450  // Context sets the context to be used in this call's Do method.
  5451  func (c *OrganizationsLocationsInsightTypesInsightsMarkAcceptedCall) Context(ctx context.Context) *OrganizationsLocationsInsightTypesInsightsMarkAcceptedCall {
  5452  	c.ctx_ = ctx
  5453  	return c
  5454  }
  5455  
  5456  // Header returns a http.Header that can be modified by the caller to add
  5457  // headers to the request.
  5458  func (c *OrganizationsLocationsInsightTypesInsightsMarkAcceptedCall) Header() http.Header {
  5459  	if c.header_ == nil {
  5460  		c.header_ = make(http.Header)
  5461  	}
  5462  	return c.header_
  5463  }
  5464  
  5465  func (c *OrganizationsLocationsInsightTypesInsightsMarkAcceptedCall) doRequest(alt string) (*http.Response, error) {
  5466  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5467  	var body io.Reader = nil
  5468  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markinsightacceptedrequest)
  5469  	if err != nil {
  5470  		return nil, err
  5471  	}
  5472  	c.urlParams_.Set("alt", alt)
  5473  	c.urlParams_.Set("prettyPrint", "false")
  5474  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markAccepted")
  5475  	urls += "?" + c.urlParams_.Encode()
  5476  	req, err := http.NewRequest("POST", urls, body)
  5477  	if err != nil {
  5478  		return nil, err
  5479  	}
  5480  	req.Header = reqHeaders
  5481  	googleapi.Expand(req.URL, map[string]string{
  5482  		"name": c.name,
  5483  	})
  5484  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5485  }
  5486  
  5487  // Do executes the "recommender.organizations.locations.insightTypes.insights.markAccepted" call.
  5488  // Any non-2xx status code is an error. Response headers are in either
  5489  // *GoogleCloudRecommenderV1beta1Insight.ServerResponse.Header or (if a
  5490  // response was returned at all) in error.(*googleapi.Error).Header. Use
  5491  // googleapi.IsNotModified to check whether the returned error was because
  5492  // http.StatusNotModified was returned.
  5493  func (c *OrganizationsLocationsInsightTypesInsightsMarkAcceptedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Insight, error) {
  5494  	gensupport.SetOptions(c.urlParams_, opts...)
  5495  	res, err := c.doRequest("json")
  5496  	if res != nil && res.StatusCode == http.StatusNotModified {
  5497  		if res.Body != nil {
  5498  			res.Body.Close()
  5499  		}
  5500  		return nil, gensupport.WrapError(&googleapi.Error{
  5501  			Code:   res.StatusCode,
  5502  			Header: res.Header,
  5503  		})
  5504  	}
  5505  	if err != nil {
  5506  		return nil, err
  5507  	}
  5508  	defer googleapi.CloseBody(res)
  5509  	if err := googleapi.CheckResponse(res); err != nil {
  5510  		return nil, gensupport.WrapError(err)
  5511  	}
  5512  	ret := &GoogleCloudRecommenderV1beta1Insight{
  5513  		ServerResponse: googleapi.ServerResponse{
  5514  			Header:         res.Header,
  5515  			HTTPStatusCode: res.StatusCode,
  5516  		},
  5517  	}
  5518  	target := &ret
  5519  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5520  		return nil, err
  5521  	}
  5522  	return ret, nil
  5523  }
  5524  
  5525  type OrganizationsLocationsRecommendersGetConfigCall struct {
  5526  	s            *Service
  5527  	name         string
  5528  	urlParams_   gensupport.URLParams
  5529  	ifNoneMatch_ string
  5530  	ctx_         context.Context
  5531  	header_      http.Header
  5532  }
  5533  
  5534  // GetConfig: Gets the requested Recommender Config. There is only one instance
  5535  // of the config for each Recommender.
  5536  //
  5537  //   - name: Name of the Recommendation Config to get. Acceptable formats: *
  5538  //     `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_I
  5539  //     D]/config` *
  5540  //     `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/c
  5541  //     onfig` *
  5542  //     `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMME
  5543  //     NDER_ID]/config` *
  5544  //     `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RE
  5545  //     COMMENDER_ID]/config`.
  5546  func (r *OrganizationsLocationsRecommendersService) GetConfig(name string) *OrganizationsLocationsRecommendersGetConfigCall {
  5547  	c := &OrganizationsLocationsRecommendersGetConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5548  	c.name = name
  5549  	return c
  5550  }
  5551  
  5552  // Fields allows partial responses to be retrieved. See
  5553  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5554  // details.
  5555  func (c *OrganizationsLocationsRecommendersGetConfigCall) Fields(s ...googleapi.Field) *OrganizationsLocationsRecommendersGetConfigCall {
  5556  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5557  	return c
  5558  }
  5559  
  5560  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5561  // object's ETag matches the given value. This is useful for getting updates
  5562  // only after the object has changed since the last request.
  5563  func (c *OrganizationsLocationsRecommendersGetConfigCall) IfNoneMatch(entityTag string) *OrganizationsLocationsRecommendersGetConfigCall {
  5564  	c.ifNoneMatch_ = entityTag
  5565  	return c
  5566  }
  5567  
  5568  // Context sets the context to be used in this call's Do method.
  5569  func (c *OrganizationsLocationsRecommendersGetConfigCall) Context(ctx context.Context) *OrganizationsLocationsRecommendersGetConfigCall {
  5570  	c.ctx_ = ctx
  5571  	return c
  5572  }
  5573  
  5574  // Header returns a http.Header that can be modified by the caller to add
  5575  // headers to the request.
  5576  func (c *OrganizationsLocationsRecommendersGetConfigCall) Header() http.Header {
  5577  	if c.header_ == nil {
  5578  		c.header_ = make(http.Header)
  5579  	}
  5580  	return c.header_
  5581  }
  5582  
  5583  func (c *OrganizationsLocationsRecommendersGetConfigCall) doRequest(alt string) (*http.Response, error) {
  5584  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5585  	if c.ifNoneMatch_ != "" {
  5586  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5587  	}
  5588  	var body io.Reader = nil
  5589  	c.urlParams_.Set("alt", alt)
  5590  	c.urlParams_.Set("prettyPrint", "false")
  5591  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  5592  	urls += "?" + c.urlParams_.Encode()
  5593  	req, err := http.NewRequest("GET", urls, body)
  5594  	if err != nil {
  5595  		return nil, err
  5596  	}
  5597  	req.Header = reqHeaders
  5598  	googleapi.Expand(req.URL, map[string]string{
  5599  		"name": c.name,
  5600  	})
  5601  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5602  }
  5603  
  5604  // Do executes the "recommender.organizations.locations.recommenders.getConfig" call.
  5605  // Any non-2xx status code is an error. Response headers are in either
  5606  // *GoogleCloudRecommenderV1beta1RecommenderConfig.ServerResponse.Header or (if
  5607  // a response was returned at all) in error.(*googleapi.Error).Header. Use
  5608  // googleapi.IsNotModified to check whether the returned error was because
  5609  // http.StatusNotModified was returned.
  5610  func (c *OrganizationsLocationsRecommendersGetConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1RecommenderConfig, error) {
  5611  	gensupport.SetOptions(c.urlParams_, opts...)
  5612  	res, err := c.doRequest("json")
  5613  	if res != nil && res.StatusCode == http.StatusNotModified {
  5614  		if res.Body != nil {
  5615  			res.Body.Close()
  5616  		}
  5617  		return nil, gensupport.WrapError(&googleapi.Error{
  5618  			Code:   res.StatusCode,
  5619  			Header: res.Header,
  5620  		})
  5621  	}
  5622  	if err != nil {
  5623  		return nil, err
  5624  	}
  5625  	defer googleapi.CloseBody(res)
  5626  	if err := googleapi.CheckResponse(res); err != nil {
  5627  		return nil, gensupport.WrapError(err)
  5628  	}
  5629  	ret := &GoogleCloudRecommenderV1beta1RecommenderConfig{
  5630  		ServerResponse: googleapi.ServerResponse{
  5631  			Header:         res.Header,
  5632  			HTTPStatusCode: res.StatusCode,
  5633  		},
  5634  	}
  5635  	target := &ret
  5636  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5637  		return nil, err
  5638  	}
  5639  	return ret, nil
  5640  }
  5641  
  5642  type OrganizationsLocationsRecommendersUpdateConfigCall struct {
  5643  	s                                              *Service
  5644  	name                                           string
  5645  	googlecloudrecommenderv1beta1recommenderconfig *GoogleCloudRecommenderV1beta1RecommenderConfig
  5646  	urlParams_                                     gensupport.URLParams
  5647  	ctx_                                           context.Context
  5648  	header_                                        http.Header
  5649  }
  5650  
  5651  // UpdateConfig: Updates a Recommender Config. This will create a new revision
  5652  // of the config.
  5653  //
  5654  //   - name: Identifier. Name of recommender config. Eg,
  5655  //     projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID
  5656  //     ]/config.
  5657  func (r *OrganizationsLocationsRecommendersService) UpdateConfig(name string, googlecloudrecommenderv1beta1recommenderconfig *GoogleCloudRecommenderV1beta1RecommenderConfig) *OrganizationsLocationsRecommendersUpdateConfigCall {
  5658  	c := &OrganizationsLocationsRecommendersUpdateConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5659  	c.name = name
  5660  	c.googlecloudrecommenderv1beta1recommenderconfig = googlecloudrecommenderv1beta1recommenderconfig
  5661  	return c
  5662  }
  5663  
  5664  // UpdateMask sets the optional parameter "updateMask": The list of fields to
  5665  // be updated.
  5666  func (c *OrganizationsLocationsRecommendersUpdateConfigCall) UpdateMask(updateMask string) *OrganizationsLocationsRecommendersUpdateConfigCall {
  5667  	c.urlParams_.Set("updateMask", updateMask)
  5668  	return c
  5669  }
  5670  
  5671  // ValidateOnly sets the optional parameter "validateOnly": If true, validate
  5672  // the request and preview the change, but do not actually update it.
  5673  func (c *OrganizationsLocationsRecommendersUpdateConfigCall) ValidateOnly(validateOnly bool) *OrganizationsLocationsRecommendersUpdateConfigCall {
  5674  	c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  5675  	return c
  5676  }
  5677  
  5678  // Fields allows partial responses to be retrieved. See
  5679  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5680  // details.
  5681  func (c *OrganizationsLocationsRecommendersUpdateConfigCall) Fields(s ...googleapi.Field) *OrganizationsLocationsRecommendersUpdateConfigCall {
  5682  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5683  	return c
  5684  }
  5685  
  5686  // Context sets the context to be used in this call's Do method.
  5687  func (c *OrganizationsLocationsRecommendersUpdateConfigCall) Context(ctx context.Context) *OrganizationsLocationsRecommendersUpdateConfigCall {
  5688  	c.ctx_ = ctx
  5689  	return c
  5690  }
  5691  
  5692  // Header returns a http.Header that can be modified by the caller to add
  5693  // headers to the request.
  5694  func (c *OrganizationsLocationsRecommendersUpdateConfigCall) Header() http.Header {
  5695  	if c.header_ == nil {
  5696  		c.header_ = make(http.Header)
  5697  	}
  5698  	return c.header_
  5699  }
  5700  
  5701  func (c *OrganizationsLocationsRecommendersUpdateConfigCall) doRequest(alt string) (*http.Response, error) {
  5702  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5703  	var body io.Reader = nil
  5704  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1recommenderconfig)
  5705  	if err != nil {
  5706  		return nil, err
  5707  	}
  5708  	c.urlParams_.Set("alt", alt)
  5709  	c.urlParams_.Set("prettyPrint", "false")
  5710  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  5711  	urls += "?" + c.urlParams_.Encode()
  5712  	req, err := http.NewRequest("PATCH", urls, body)
  5713  	if err != nil {
  5714  		return nil, err
  5715  	}
  5716  	req.Header = reqHeaders
  5717  	googleapi.Expand(req.URL, map[string]string{
  5718  		"name": c.name,
  5719  	})
  5720  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5721  }
  5722  
  5723  // Do executes the "recommender.organizations.locations.recommenders.updateConfig" call.
  5724  // Any non-2xx status code is an error. Response headers are in either
  5725  // *GoogleCloudRecommenderV1beta1RecommenderConfig.ServerResponse.Header or (if
  5726  // a response was returned at all) in error.(*googleapi.Error).Header. Use
  5727  // googleapi.IsNotModified to check whether the returned error was because
  5728  // http.StatusNotModified was returned.
  5729  func (c *OrganizationsLocationsRecommendersUpdateConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1RecommenderConfig, error) {
  5730  	gensupport.SetOptions(c.urlParams_, opts...)
  5731  	res, err := c.doRequest("json")
  5732  	if res != nil && res.StatusCode == http.StatusNotModified {
  5733  		if res.Body != nil {
  5734  			res.Body.Close()
  5735  		}
  5736  		return nil, gensupport.WrapError(&googleapi.Error{
  5737  			Code:   res.StatusCode,
  5738  			Header: res.Header,
  5739  		})
  5740  	}
  5741  	if err != nil {
  5742  		return nil, err
  5743  	}
  5744  	defer googleapi.CloseBody(res)
  5745  	if err := googleapi.CheckResponse(res); err != nil {
  5746  		return nil, gensupport.WrapError(err)
  5747  	}
  5748  	ret := &GoogleCloudRecommenderV1beta1RecommenderConfig{
  5749  		ServerResponse: googleapi.ServerResponse{
  5750  			Header:         res.Header,
  5751  			HTTPStatusCode: res.StatusCode,
  5752  		},
  5753  	}
  5754  	target := &ret
  5755  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5756  		return nil, err
  5757  	}
  5758  	return ret, nil
  5759  }
  5760  
  5761  type OrganizationsLocationsRecommendersRecommendationsGetCall struct {
  5762  	s            *Service
  5763  	name         string
  5764  	urlParams_   gensupport.URLParams
  5765  	ifNoneMatch_ string
  5766  	ctx_         context.Context
  5767  	header_      http.Header
  5768  }
  5769  
  5770  // Get: Gets the requested recommendation. Requires the recommender.*.get IAM
  5771  // permission for the specified recommender.
  5772  //
  5773  // - name: Name of the recommendation.
  5774  func (r *OrganizationsLocationsRecommendersRecommendationsService) Get(name string) *OrganizationsLocationsRecommendersRecommendationsGetCall {
  5775  	c := &OrganizationsLocationsRecommendersRecommendationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5776  	c.name = name
  5777  	return c
  5778  }
  5779  
  5780  // Fields allows partial responses to be retrieved. See
  5781  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5782  // details.
  5783  func (c *OrganizationsLocationsRecommendersRecommendationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsRecommendersRecommendationsGetCall {
  5784  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5785  	return c
  5786  }
  5787  
  5788  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5789  // object's ETag matches the given value. This is useful for getting updates
  5790  // only after the object has changed since the last request.
  5791  func (c *OrganizationsLocationsRecommendersRecommendationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsRecommendersRecommendationsGetCall {
  5792  	c.ifNoneMatch_ = entityTag
  5793  	return c
  5794  }
  5795  
  5796  // Context sets the context to be used in this call's Do method.
  5797  func (c *OrganizationsLocationsRecommendersRecommendationsGetCall) Context(ctx context.Context) *OrganizationsLocationsRecommendersRecommendationsGetCall {
  5798  	c.ctx_ = ctx
  5799  	return c
  5800  }
  5801  
  5802  // Header returns a http.Header that can be modified by the caller to add
  5803  // headers to the request.
  5804  func (c *OrganizationsLocationsRecommendersRecommendationsGetCall) Header() http.Header {
  5805  	if c.header_ == nil {
  5806  		c.header_ = make(http.Header)
  5807  	}
  5808  	return c.header_
  5809  }
  5810  
  5811  func (c *OrganizationsLocationsRecommendersRecommendationsGetCall) doRequest(alt string) (*http.Response, error) {
  5812  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5813  	if c.ifNoneMatch_ != "" {
  5814  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5815  	}
  5816  	var body io.Reader = nil
  5817  	c.urlParams_.Set("alt", alt)
  5818  	c.urlParams_.Set("prettyPrint", "false")
  5819  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  5820  	urls += "?" + c.urlParams_.Encode()
  5821  	req, err := http.NewRequest("GET", urls, body)
  5822  	if err != nil {
  5823  		return nil, err
  5824  	}
  5825  	req.Header = reqHeaders
  5826  	googleapi.Expand(req.URL, map[string]string{
  5827  		"name": c.name,
  5828  	})
  5829  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5830  }
  5831  
  5832  // Do executes the "recommender.organizations.locations.recommenders.recommendations.get" call.
  5833  // Any non-2xx status code is an error. Response headers are in either
  5834  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  5835  // response was returned at all) in error.(*googleapi.Error).Header. Use
  5836  // googleapi.IsNotModified to check whether the returned error was because
  5837  // http.StatusNotModified was returned.
  5838  func (c *OrganizationsLocationsRecommendersRecommendationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  5839  	gensupport.SetOptions(c.urlParams_, opts...)
  5840  	res, err := c.doRequest("json")
  5841  	if res != nil && res.StatusCode == http.StatusNotModified {
  5842  		if res.Body != nil {
  5843  			res.Body.Close()
  5844  		}
  5845  		return nil, gensupport.WrapError(&googleapi.Error{
  5846  			Code:   res.StatusCode,
  5847  			Header: res.Header,
  5848  		})
  5849  	}
  5850  	if err != nil {
  5851  		return nil, err
  5852  	}
  5853  	defer googleapi.CloseBody(res)
  5854  	if err := googleapi.CheckResponse(res); err != nil {
  5855  		return nil, gensupport.WrapError(err)
  5856  	}
  5857  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  5858  		ServerResponse: googleapi.ServerResponse{
  5859  			Header:         res.Header,
  5860  			HTTPStatusCode: res.StatusCode,
  5861  		},
  5862  	}
  5863  	target := &ret
  5864  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5865  		return nil, err
  5866  	}
  5867  	return ret, nil
  5868  }
  5869  
  5870  type OrganizationsLocationsRecommendersRecommendationsListCall struct {
  5871  	s            *Service
  5872  	parent       string
  5873  	urlParams_   gensupport.URLParams
  5874  	ifNoneMatch_ string
  5875  	ctx_         context.Context
  5876  	header_      http.Header
  5877  }
  5878  
  5879  // List: Lists recommendations for the specified Cloud Resource. Requires the
  5880  // recommender.*.list IAM permission for the specified recommender.
  5881  //
  5882  //   - parent: The container resource on which to execute the request. Acceptable
  5883  //     formats: *
  5884  //     `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_I
  5885  //     D]` *
  5886  //     `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]`
  5887  //     *
  5888  //     `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RE
  5889  //     COMMENDER_ID]` *
  5890  //     `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` *
  5891  //     `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMME
  5892  //     NDER_ID]` LOCATION here refers to GCP Locations:
  5893  //     https://cloud.google.com/about/locations/ RECOMMENDER_ID refers to
  5894  //     supported recommenders:
  5895  //     https://cloud.google.com/recommender/docs/recommenders.
  5896  func (r *OrganizationsLocationsRecommendersRecommendationsService) List(parent string) *OrganizationsLocationsRecommendersRecommendationsListCall {
  5897  	c := &OrganizationsLocationsRecommendersRecommendationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5898  	c.parent = parent
  5899  	return c
  5900  }
  5901  
  5902  // Filter sets the optional parameter "filter": Filter expression to restrict
  5903  // the recommendations returned. Supported filter fields: * `state_info.state`
  5904  // * `recommenderSubtype` * `priority` * `targetResources` Examples: *
  5905  // `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` *
  5906  // `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` *
  5907  // `priority = P1 OR priority = P2` * `targetResources :
  5908  // //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance
  5909  // -1` * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` The
  5910  // max allowed filter length is 500 characters. (These expressions are based on
  5911  // the filter language described at https://google.aip.dev/160)
  5912  func (c *OrganizationsLocationsRecommendersRecommendationsListCall) Filter(filter string) *OrganizationsLocationsRecommendersRecommendationsListCall {
  5913  	c.urlParams_.Set("filter", filter)
  5914  	return c
  5915  }
  5916  
  5917  // PageSize sets the optional parameter "pageSize": The maximum number of
  5918  // results to return from this request. Non-positive values are ignored. If not
  5919  // specified, the server will determine the number of results to return.
  5920  func (c *OrganizationsLocationsRecommendersRecommendationsListCall) PageSize(pageSize int64) *OrganizationsLocationsRecommendersRecommendationsListCall {
  5921  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5922  	return c
  5923  }
  5924  
  5925  // PageToken sets the optional parameter "pageToken": If present, retrieves the
  5926  // next batch of results from the preceding call to this method. `page_token`
  5927  // must be the value of `next_page_token` from the previous response. The
  5928  // values of other method parameters must be identical to those in the previous
  5929  // call.
  5930  func (c *OrganizationsLocationsRecommendersRecommendationsListCall) PageToken(pageToken string) *OrganizationsLocationsRecommendersRecommendationsListCall {
  5931  	c.urlParams_.Set("pageToken", pageToken)
  5932  	return c
  5933  }
  5934  
  5935  // Fields allows partial responses to be retrieved. See
  5936  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5937  // details.
  5938  func (c *OrganizationsLocationsRecommendersRecommendationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsRecommendersRecommendationsListCall {
  5939  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5940  	return c
  5941  }
  5942  
  5943  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5944  // object's ETag matches the given value. This is useful for getting updates
  5945  // only after the object has changed since the last request.
  5946  func (c *OrganizationsLocationsRecommendersRecommendationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsRecommendersRecommendationsListCall {
  5947  	c.ifNoneMatch_ = entityTag
  5948  	return c
  5949  }
  5950  
  5951  // Context sets the context to be used in this call's Do method.
  5952  func (c *OrganizationsLocationsRecommendersRecommendationsListCall) Context(ctx context.Context) *OrganizationsLocationsRecommendersRecommendationsListCall {
  5953  	c.ctx_ = ctx
  5954  	return c
  5955  }
  5956  
  5957  // Header returns a http.Header that can be modified by the caller to add
  5958  // headers to the request.
  5959  func (c *OrganizationsLocationsRecommendersRecommendationsListCall) Header() http.Header {
  5960  	if c.header_ == nil {
  5961  		c.header_ = make(http.Header)
  5962  	}
  5963  	return c.header_
  5964  }
  5965  
  5966  func (c *OrganizationsLocationsRecommendersRecommendationsListCall) doRequest(alt string) (*http.Response, error) {
  5967  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5968  	if c.ifNoneMatch_ != "" {
  5969  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5970  	}
  5971  	var body io.Reader = nil
  5972  	c.urlParams_.Set("alt", alt)
  5973  	c.urlParams_.Set("prettyPrint", "false")
  5974  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/recommendations")
  5975  	urls += "?" + c.urlParams_.Encode()
  5976  	req, err := http.NewRequest("GET", urls, body)
  5977  	if err != nil {
  5978  		return nil, err
  5979  	}
  5980  	req.Header = reqHeaders
  5981  	googleapi.Expand(req.URL, map[string]string{
  5982  		"parent": c.parent,
  5983  	})
  5984  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5985  }
  5986  
  5987  // Do executes the "recommender.organizations.locations.recommenders.recommendations.list" call.
  5988  // Any non-2xx status code is an error. Response headers are in either
  5989  // *GoogleCloudRecommenderV1beta1ListRecommendationsResponse.ServerResponse.Head
  5990  // er or (if a response was returned at all) in
  5991  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5992  // whether the returned error was because http.StatusNotModified was returned.
  5993  func (c *OrganizationsLocationsRecommendersRecommendationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1ListRecommendationsResponse, error) {
  5994  	gensupport.SetOptions(c.urlParams_, opts...)
  5995  	res, err := c.doRequest("json")
  5996  	if res != nil && res.StatusCode == http.StatusNotModified {
  5997  		if res.Body != nil {
  5998  			res.Body.Close()
  5999  		}
  6000  		return nil, gensupport.WrapError(&googleapi.Error{
  6001  			Code:   res.StatusCode,
  6002  			Header: res.Header,
  6003  		})
  6004  	}
  6005  	if err != nil {
  6006  		return nil, err
  6007  	}
  6008  	defer googleapi.CloseBody(res)
  6009  	if err := googleapi.CheckResponse(res); err != nil {
  6010  		return nil, gensupport.WrapError(err)
  6011  	}
  6012  	ret := &GoogleCloudRecommenderV1beta1ListRecommendationsResponse{
  6013  		ServerResponse: googleapi.ServerResponse{
  6014  			Header:         res.Header,
  6015  			HTTPStatusCode: res.StatusCode,
  6016  		},
  6017  	}
  6018  	target := &ret
  6019  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6020  		return nil, err
  6021  	}
  6022  	return ret, nil
  6023  }
  6024  
  6025  // Pages invokes f for each page of results.
  6026  // A non-nil error returned from f will halt the iteration.
  6027  // The provided context supersedes any context provided to the Context method.
  6028  func (c *OrganizationsLocationsRecommendersRecommendationsListCall) Pages(ctx context.Context, f func(*GoogleCloudRecommenderV1beta1ListRecommendationsResponse) error) error {
  6029  	c.ctx_ = ctx
  6030  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  6031  	for {
  6032  		x, err := c.Do()
  6033  		if err != nil {
  6034  			return err
  6035  		}
  6036  		if err := f(x); err != nil {
  6037  			return err
  6038  		}
  6039  		if x.NextPageToken == "" {
  6040  			return nil
  6041  		}
  6042  		c.PageToken(x.NextPageToken)
  6043  	}
  6044  }
  6045  
  6046  type OrganizationsLocationsRecommendersRecommendationsMarkClaimedCall struct {
  6047  	s                                                             *Service
  6048  	name                                                          string
  6049  	googlecloudrecommenderv1beta1markrecommendationclaimedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest
  6050  	urlParams_                                                    gensupport.URLParams
  6051  	ctx_                                                          context.Context
  6052  	header_                                                       http.Header
  6053  }
  6054  
  6055  // MarkClaimed: Marks the Recommendation State as Claimed. Users can use this
  6056  // method to indicate to the Recommender API that they are starting to apply
  6057  // the recommendation themselves. This stops the recommendation content from
  6058  // being updated. Associated insights are frozen and placed in the ACCEPTED
  6059  // state. MarkRecommendationClaimed can be applied to recommendations in
  6060  // CLAIMED or ACTIVE state. Requires the recommender.*.update IAM permission
  6061  // for the specified recommender.
  6062  //
  6063  // - name: Name of the recommendation.
  6064  func (r *OrganizationsLocationsRecommendersRecommendationsService) MarkClaimed(name string, googlecloudrecommenderv1beta1markrecommendationclaimedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest) *OrganizationsLocationsRecommendersRecommendationsMarkClaimedCall {
  6065  	c := &OrganizationsLocationsRecommendersRecommendationsMarkClaimedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6066  	c.name = name
  6067  	c.googlecloudrecommenderv1beta1markrecommendationclaimedrequest = googlecloudrecommenderv1beta1markrecommendationclaimedrequest
  6068  	return c
  6069  }
  6070  
  6071  // Fields allows partial responses to be retrieved. See
  6072  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6073  // details.
  6074  func (c *OrganizationsLocationsRecommendersRecommendationsMarkClaimedCall) Fields(s ...googleapi.Field) *OrganizationsLocationsRecommendersRecommendationsMarkClaimedCall {
  6075  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6076  	return c
  6077  }
  6078  
  6079  // Context sets the context to be used in this call's Do method.
  6080  func (c *OrganizationsLocationsRecommendersRecommendationsMarkClaimedCall) Context(ctx context.Context) *OrganizationsLocationsRecommendersRecommendationsMarkClaimedCall {
  6081  	c.ctx_ = ctx
  6082  	return c
  6083  }
  6084  
  6085  // Header returns a http.Header that can be modified by the caller to add
  6086  // headers to the request.
  6087  func (c *OrganizationsLocationsRecommendersRecommendationsMarkClaimedCall) Header() http.Header {
  6088  	if c.header_ == nil {
  6089  		c.header_ = make(http.Header)
  6090  	}
  6091  	return c.header_
  6092  }
  6093  
  6094  func (c *OrganizationsLocationsRecommendersRecommendationsMarkClaimedCall) doRequest(alt string) (*http.Response, error) {
  6095  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6096  	var body io.Reader = nil
  6097  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationclaimedrequest)
  6098  	if err != nil {
  6099  		return nil, err
  6100  	}
  6101  	c.urlParams_.Set("alt", alt)
  6102  	c.urlParams_.Set("prettyPrint", "false")
  6103  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markClaimed")
  6104  	urls += "?" + c.urlParams_.Encode()
  6105  	req, err := http.NewRequest("POST", urls, body)
  6106  	if err != nil {
  6107  		return nil, err
  6108  	}
  6109  	req.Header = reqHeaders
  6110  	googleapi.Expand(req.URL, map[string]string{
  6111  		"name": c.name,
  6112  	})
  6113  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6114  }
  6115  
  6116  // Do executes the "recommender.organizations.locations.recommenders.recommendations.markClaimed" call.
  6117  // Any non-2xx status code is an error. Response headers are in either
  6118  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  6119  // response was returned at all) in error.(*googleapi.Error).Header. Use
  6120  // googleapi.IsNotModified to check whether the returned error was because
  6121  // http.StatusNotModified was returned.
  6122  func (c *OrganizationsLocationsRecommendersRecommendationsMarkClaimedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  6123  	gensupport.SetOptions(c.urlParams_, opts...)
  6124  	res, err := c.doRequest("json")
  6125  	if res != nil && res.StatusCode == http.StatusNotModified {
  6126  		if res.Body != nil {
  6127  			res.Body.Close()
  6128  		}
  6129  		return nil, gensupport.WrapError(&googleapi.Error{
  6130  			Code:   res.StatusCode,
  6131  			Header: res.Header,
  6132  		})
  6133  	}
  6134  	if err != nil {
  6135  		return nil, err
  6136  	}
  6137  	defer googleapi.CloseBody(res)
  6138  	if err := googleapi.CheckResponse(res); err != nil {
  6139  		return nil, gensupport.WrapError(err)
  6140  	}
  6141  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  6142  		ServerResponse: googleapi.ServerResponse{
  6143  			Header:         res.Header,
  6144  			HTTPStatusCode: res.StatusCode,
  6145  		},
  6146  	}
  6147  	target := &ret
  6148  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6149  		return nil, err
  6150  	}
  6151  	return ret, nil
  6152  }
  6153  
  6154  type OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall struct {
  6155  	s                                                               *Service
  6156  	name                                                            string
  6157  	googlecloudrecommenderv1beta1markrecommendationdismissedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest
  6158  	urlParams_                                                      gensupport.URLParams
  6159  	ctx_                                                            context.Context
  6160  	header_                                                         http.Header
  6161  }
  6162  
  6163  // MarkDismissed: Mark the Recommendation State as Dismissed. Users can use
  6164  // this method to indicate to the Recommender API that an ACTIVE recommendation
  6165  // has to be marked back as DISMISSED. MarkRecommendationDismissed can be
  6166  // applied to recommendations in ACTIVE state. Requires the
  6167  // recommender.*.update IAM permission for the specified recommender.
  6168  //
  6169  // - name: Name of the recommendation.
  6170  func (r *OrganizationsLocationsRecommendersRecommendationsService) MarkDismissed(name string, googlecloudrecommenderv1beta1markrecommendationdismissedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest) *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall {
  6171  	c := &OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6172  	c.name = name
  6173  	c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest = googlecloudrecommenderv1beta1markrecommendationdismissedrequest
  6174  	return c
  6175  }
  6176  
  6177  // Fields allows partial responses to be retrieved. See
  6178  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6179  // details.
  6180  func (c *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall) Fields(s ...googleapi.Field) *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall {
  6181  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6182  	return c
  6183  }
  6184  
  6185  // Context sets the context to be used in this call's Do method.
  6186  func (c *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall) Context(ctx context.Context) *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall {
  6187  	c.ctx_ = ctx
  6188  	return c
  6189  }
  6190  
  6191  // Header returns a http.Header that can be modified by the caller to add
  6192  // headers to the request.
  6193  func (c *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall) Header() http.Header {
  6194  	if c.header_ == nil {
  6195  		c.header_ = make(http.Header)
  6196  	}
  6197  	return c.header_
  6198  }
  6199  
  6200  func (c *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) {
  6201  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6202  	var body io.Reader = nil
  6203  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest)
  6204  	if err != nil {
  6205  		return nil, err
  6206  	}
  6207  	c.urlParams_.Set("alt", alt)
  6208  	c.urlParams_.Set("prettyPrint", "false")
  6209  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markDismissed")
  6210  	urls += "?" + c.urlParams_.Encode()
  6211  	req, err := http.NewRequest("POST", urls, body)
  6212  	if err != nil {
  6213  		return nil, err
  6214  	}
  6215  	req.Header = reqHeaders
  6216  	googleapi.Expand(req.URL, map[string]string{
  6217  		"name": c.name,
  6218  	})
  6219  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6220  }
  6221  
  6222  // Do executes the "recommender.organizations.locations.recommenders.recommendations.markDismissed" call.
  6223  // Any non-2xx status code is an error. Response headers are in either
  6224  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  6225  // response was returned at all) in error.(*googleapi.Error).Header. Use
  6226  // googleapi.IsNotModified to check whether the returned error was because
  6227  // http.StatusNotModified was returned.
  6228  func (c *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  6229  	gensupport.SetOptions(c.urlParams_, opts...)
  6230  	res, err := c.doRequest("json")
  6231  	if res != nil && res.StatusCode == http.StatusNotModified {
  6232  		if res.Body != nil {
  6233  			res.Body.Close()
  6234  		}
  6235  		return nil, gensupport.WrapError(&googleapi.Error{
  6236  			Code:   res.StatusCode,
  6237  			Header: res.Header,
  6238  		})
  6239  	}
  6240  	if err != nil {
  6241  		return nil, err
  6242  	}
  6243  	defer googleapi.CloseBody(res)
  6244  	if err := googleapi.CheckResponse(res); err != nil {
  6245  		return nil, gensupport.WrapError(err)
  6246  	}
  6247  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  6248  		ServerResponse: googleapi.ServerResponse{
  6249  			Header:         res.Header,
  6250  			HTTPStatusCode: res.StatusCode,
  6251  		},
  6252  	}
  6253  	target := &ret
  6254  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6255  		return nil, err
  6256  	}
  6257  	return ret, nil
  6258  }
  6259  
  6260  type OrganizationsLocationsRecommendersRecommendationsMarkFailedCall struct {
  6261  	s                                                            *Service
  6262  	name                                                         string
  6263  	googlecloudrecommenderv1beta1markrecommendationfailedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest
  6264  	urlParams_                                                   gensupport.URLParams
  6265  	ctx_                                                         context.Context
  6266  	header_                                                      http.Header
  6267  }
  6268  
  6269  // MarkFailed: Marks the Recommendation State as Failed. Users can use this
  6270  // method to indicate to the Recommender API that they have applied the
  6271  // recommendation themselves, and the operation failed. This stops the
  6272  // recommendation content from being updated. Associated insights are frozen
  6273  // and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to
  6274  // recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the
  6275  // recommender.*.update IAM permission for the specified recommender.
  6276  //
  6277  // - name: Name of the recommendation.
  6278  func (r *OrganizationsLocationsRecommendersRecommendationsService) MarkFailed(name string, googlecloudrecommenderv1beta1markrecommendationfailedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest) *OrganizationsLocationsRecommendersRecommendationsMarkFailedCall {
  6279  	c := &OrganizationsLocationsRecommendersRecommendationsMarkFailedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6280  	c.name = name
  6281  	c.googlecloudrecommenderv1beta1markrecommendationfailedrequest = googlecloudrecommenderv1beta1markrecommendationfailedrequest
  6282  	return c
  6283  }
  6284  
  6285  // Fields allows partial responses to be retrieved. See
  6286  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6287  // details.
  6288  func (c *OrganizationsLocationsRecommendersRecommendationsMarkFailedCall) Fields(s ...googleapi.Field) *OrganizationsLocationsRecommendersRecommendationsMarkFailedCall {
  6289  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6290  	return c
  6291  }
  6292  
  6293  // Context sets the context to be used in this call's Do method.
  6294  func (c *OrganizationsLocationsRecommendersRecommendationsMarkFailedCall) Context(ctx context.Context) *OrganizationsLocationsRecommendersRecommendationsMarkFailedCall {
  6295  	c.ctx_ = ctx
  6296  	return c
  6297  }
  6298  
  6299  // Header returns a http.Header that can be modified by the caller to add
  6300  // headers to the request.
  6301  func (c *OrganizationsLocationsRecommendersRecommendationsMarkFailedCall) Header() http.Header {
  6302  	if c.header_ == nil {
  6303  		c.header_ = make(http.Header)
  6304  	}
  6305  	return c.header_
  6306  }
  6307  
  6308  func (c *OrganizationsLocationsRecommendersRecommendationsMarkFailedCall) doRequest(alt string) (*http.Response, error) {
  6309  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6310  	var body io.Reader = nil
  6311  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationfailedrequest)
  6312  	if err != nil {
  6313  		return nil, err
  6314  	}
  6315  	c.urlParams_.Set("alt", alt)
  6316  	c.urlParams_.Set("prettyPrint", "false")
  6317  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markFailed")
  6318  	urls += "?" + c.urlParams_.Encode()
  6319  	req, err := http.NewRequest("POST", urls, body)
  6320  	if err != nil {
  6321  		return nil, err
  6322  	}
  6323  	req.Header = reqHeaders
  6324  	googleapi.Expand(req.URL, map[string]string{
  6325  		"name": c.name,
  6326  	})
  6327  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6328  }
  6329  
  6330  // Do executes the "recommender.organizations.locations.recommenders.recommendations.markFailed" call.
  6331  // Any non-2xx status code is an error. Response headers are in either
  6332  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  6333  // response was returned at all) in error.(*googleapi.Error).Header. Use
  6334  // googleapi.IsNotModified to check whether the returned error was because
  6335  // http.StatusNotModified was returned.
  6336  func (c *OrganizationsLocationsRecommendersRecommendationsMarkFailedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  6337  	gensupport.SetOptions(c.urlParams_, opts...)
  6338  	res, err := c.doRequest("json")
  6339  	if res != nil && res.StatusCode == http.StatusNotModified {
  6340  		if res.Body != nil {
  6341  			res.Body.Close()
  6342  		}
  6343  		return nil, gensupport.WrapError(&googleapi.Error{
  6344  			Code:   res.StatusCode,
  6345  			Header: res.Header,
  6346  		})
  6347  	}
  6348  	if err != nil {
  6349  		return nil, err
  6350  	}
  6351  	defer googleapi.CloseBody(res)
  6352  	if err := googleapi.CheckResponse(res); err != nil {
  6353  		return nil, gensupport.WrapError(err)
  6354  	}
  6355  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  6356  		ServerResponse: googleapi.ServerResponse{
  6357  			Header:         res.Header,
  6358  			HTTPStatusCode: res.StatusCode,
  6359  		},
  6360  	}
  6361  	target := &ret
  6362  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6363  		return nil, err
  6364  	}
  6365  	return ret, nil
  6366  }
  6367  
  6368  type OrganizationsLocationsRecommendersRecommendationsMarkSucceededCall struct {
  6369  	s                                                               *Service
  6370  	name                                                            string
  6371  	googlecloudrecommenderv1beta1markrecommendationsucceededrequest *GoogleCloudRecommenderV1beta1MarkRecommendationSucceededRequest
  6372  	urlParams_                                                      gensupport.URLParams
  6373  	ctx_                                                            context.Context
  6374  	header_                                                         http.Header
  6375  }
  6376  
  6377  // MarkSucceeded: Marks the Recommendation State as Succeeded. Users can use
  6378  // this method to indicate to the Recommender API that they have applied the
  6379  // recommendation themselves, and the operation was successful. This stops the
  6380  // recommendation content from being updated. Associated insights are frozen
  6381  // and placed in the ACCEPTED state. MarkRecommendationSucceeded can be applied
  6382  // to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires
  6383  // the recommender.*.update IAM permission for the specified recommender.
  6384  //
  6385  // - name: Name of the recommendation.
  6386  func (r *OrganizationsLocationsRecommendersRecommendationsService) MarkSucceeded(name string, googlecloudrecommenderv1beta1markrecommendationsucceededrequest *GoogleCloudRecommenderV1beta1MarkRecommendationSucceededRequest) *OrganizationsLocationsRecommendersRecommendationsMarkSucceededCall {
  6387  	c := &OrganizationsLocationsRecommendersRecommendationsMarkSucceededCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6388  	c.name = name
  6389  	c.googlecloudrecommenderv1beta1markrecommendationsucceededrequest = googlecloudrecommenderv1beta1markrecommendationsucceededrequest
  6390  	return c
  6391  }
  6392  
  6393  // Fields allows partial responses to be retrieved. See
  6394  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6395  // details.
  6396  func (c *OrganizationsLocationsRecommendersRecommendationsMarkSucceededCall) Fields(s ...googleapi.Field) *OrganizationsLocationsRecommendersRecommendationsMarkSucceededCall {
  6397  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6398  	return c
  6399  }
  6400  
  6401  // Context sets the context to be used in this call's Do method.
  6402  func (c *OrganizationsLocationsRecommendersRecommendationsMarkSucceededCall) Context(ctx context.Context) *OrganizationsLocationsRecommendersRecommendationsMarkSucceededCall {
  6403  	c.ctx_ = ctx
  6404  	return c
  6405  }
  6406  
  6407  // Header returns a http.Header that can be modified by the caller to add
  6408  // headers to the request.
  6409  func (c *OrganizationsLocationsRecommendersRecommendationsMarkSucceededCall) Header() http.Header {
  6410  	if c.header_ == nil {
  6411  		c.header_ = make(http.Header)
  6412  	}
  6413  	return c.header_
  6414  }
  6415  
  6416  func (c *OrganizationsLocationsRecommendersRecommendationsMarkSucceededCall) doRequest(alt string) (*http.Response, error) {
  6417  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6418  	var body io.Reader = nil
  6419  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationsucceededrequest)
  6420  	if err != nil {
  6421  		return nil, err
  6422  	}
  6423  	c.urlParams_.Set("alt", alt)
  6424  	c.urlParams_.Set("prettyPrint", "false")
  6425  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markSucceeded")
  6426  	urls += "?" + c.urlParams_.Encode()
  6427  	req, err := http.NewRequest("POST", urls, body)
  6428  	if err != nil {
  6429  		return nil, err
  6430  	}
  6431  	req.Header = reqHeaders
  6432  	googleapi.Expand(req.URL, map[string]string{
  6433  		"name": c.name,
  6434  	})
  6435  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6436  }
  6437  
  6438  // Do executes the "recommender.organizations.locations.recommenders.recommendations.markSucceeded" call.
  6439  // Any non-2xx status code is an error. Response headers are in either
  6440  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  6441  // response was returned at all) in error.(*googleapi.Error).Header. Use
  6442  // googleapi.IsNotModified to check whether the returned error was because
  6443  // http.StatusNotModified was returned.
  6444  func (c *OrganizationsLocationsRecommendersRecommendationsMarkSucceededCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  6445  	gensupport.SetOptions(c.urlParams_, opts...)
  6446  	res, err := c.doRequest("json")
  6447  	if res != nil && res.StatusCode == http.StatusNotModified {
  6448  		if res.Body != nil {
  6449  			res.Body.Close()
  6450  		}
  6451  		return nil, gensupport.WrapError(&googleapi.Error{
  6452  			Code:   res.StatusCode,
  6453  			Header: res.Header,
  6454  		})
  6455  	}
  6456  	if err != nil {
  6457  		return nil, err
  6458  	}
  6459  	defer googleapi.CloseBody(res)
  6460  	if err := googleapi.CheckResponse(res); err != nil {
  6461  		return nil, gensupport.WrapError(err)
  6462  	}
  6463  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  6464  		ServerResponse: googleapi.ServerResponse{
  6465  			Header:         res.Header,
  6466  			HTTPStatusCode: res.StatusCode,
  6467  		},
  6468  	}
  6469  	target := &ret
  6470  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6471  		return nil, err
  6472  	}
  6473  	return ret, nil
  6474  }
  6475  
  6476  type ProjectsLocationsListCall struct {
  6477  	s            *Service
  6478  	name         string
  6479  	urlParams_   gensupport.URLParams
  6480  	ifNoneMatch_ string
  6481  	ctx_         context.Context
  6482  	header_      http.Header
  6483  }
  6484  
  6485  // List: Lists locations with recommendations or insights.
  6486  //
  6487  // - name: The resource that owns the locations collection, if applicable.
  6488  func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
  6489  	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6490  	c.name = name
  6491  	return c
  6492  }
  6493  
  6494  // Filter sets the optional parameter "filter": A filter to narrow down results
  6495  // to a preferred subset. The filtering language accepts strings like
  6496  // "displayName=tokyo", and is documented in more detail in AIP-160
  6497  // (https://google.aip.dev/160).
  6498  func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
  6499  	c.urlParams_.Set("filter", filter)
  6500  	return c
  6501  }
  6502  
  6503  // PageSize sets the optional parameter "pageSize": The maximum number of
  6504  // results to return. If not set, the service selects a default.
  6505  func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
  6506  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6507  	return c
  6508  }
  6509  
  6510  // PageToken sets the optional parameter "pageToken": A page token received
  6511  // from the `next_page_token` field in the response. Send that page token to
  6512  // receive the subsequent page.
  6513  func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
  6514  	c.urlParams_.Set("pageToken", pageToken)
  6515  	return c
  6516  }
  6517  
  6518  // Fields allows partial responses to be retrieved. See
  6519  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6520  // details.
  6521  func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
  6522  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6523  	return c
  6524  }
  6525  
  6526  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  6527  // object's ETag matches the given value. This is useful for getting updates
  6528  // only after the object has changed since the last request.
  6529  func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
  6530  	c.ifNoneMatch_ = entityTag
  6531  	return c
  6532  }
  6533  
  6534  // Context sets the context to be used in this call's Do method.
  6535  func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
  6536  	c.ctx_ = ctx
  6537  	return c
  6538  }
  6539  
  6540  // Header returns a http.Header that can be modified by the caller to add
  6541  // headers to the request.
  6542  func (c *ProjectsLocationsListCall) Header() http.Header {
  6543  	if c.header_ == nil {
  6544  		c.header_ = make(http.Header)
  6545  	}
  6546  	return c.header_
  6547  }
  6548  
  6549  func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  6550  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6551  	if c.ifNoneMatch_ != "" {
  6552  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6553  	}
  6554  	var body io.Reader = nil
  6555  	c.urlParams_.Set("alt", alt)
  6556  	c.urlParams_.Set("prettyPrint", "false")
  6557  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations")
  6558  	urls += "?" + c.urlParams_.Encode()
  6559  	req, err := http.NewRequest("GET", urls, body)
  6560  	if err != nil {
  6561  		return nil, err
  6562  	}
  6563  	req.Header = reqHeaders
  6564  	googleapi.Expand(req.URL, map[string]string{
  6565  		"name": c.name,
  6566  	})
  6567  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6568  }
  6569  
  6570  // Do executes the "recommender.projects.locations.list" call.
  6571  // Any non-2xx status code is an error. Response headers are in either
  6572  // *GoogleCloudLocationListLocationsResponse.ServerResponse.Header or (if a
  6573  // response was returned at all) in error.(*googleapi.Error).Header. Use
  6574  // googleapi.IsNotModified to check whether the returned error was because
  6575  // http.StatusNotModified was returned.
  6576  func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudLocationListLocationsResponse, error) {
  6577  	gensupport.SetOptions(c.urlParams_, opts...)
  6578  	res, err := c.doRequest("json")
  6579  	if res != nil && res.StatusCode == http.StatusNotModified {
  6580  		if res.Body != nil {
  6581  			res.Body.Close()
  6582  		}
  6583  		return nil, gensupport.WrapError(&googleapi.Error{
  6584  			Code:   res.StatusCode,
  6585  			Header: res.Header,
  6586  		})
  6587  	}
  6588  	if err != nil {
  6589  		return nil, err
  6590  	}
  6591  	defer googleapi.CloseBody(res)
  6592  	if err := googleapi.CheckResponse(res); err != nil {
  6593  		return nil, gensupport.WrapError(err)
  6594  	}
  6595  	ret := &GoogleCloudLocationListLocationsResponse{
  6596  		ServerResponse: googleapi.ServerResponse{
  6597  			Header:         res.Header,
  6598  			HTTPStatusCode: res.StatusCode,
  6599  		},
  6600  	}
  6601  	target := &ret
  6602  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6603  		return nil, err
  6604  	}
  6605  	return ret, nil
  6606  }
  6607  
  6608  // Pages invokes f for each page of results.
  6609  // A non-nil error returned from f will halt the iteration.
  6610  // The provided context supersedes any context provided to the Context method.
  6611  func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*GoogleCloudLocationListLocationsResponse) error) error {
  6612  	c.ctx_ = ctx
  6613  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  6614  	for {
  6615  		x, err := c.Do()
  6616  		if err != nil {
  6617  			return err
  6618  		}
  6619  		if err := f(x); err != nil {
  6620  			return err
  6621  		}
  6622  		if x.NextPageToken == "" {
  6623  			return nil
  6624  		}
  6625  		c.PageToken(x.NextPageToken)
  6626  	}
  6627  }
  6628  
  6629  type ProjectsLocationsInsightTypesGetConfigCall struct {
  6630  	s            *Service
  6631  	name         string
  6632  	urlParams_   gensupport.URLParams
  6633  	ifNoneMatch_ string
  6634  	ctx_         context.Context
  6635  	header_      http.Header
  6636  }
  6637  
  6638  // GetConfig: Gets the requested InsightTypeConfig. There is only one instance
  6639  // of the config for each InsightType.
  6640  //
  6641  //   - name: Name of the InsightTypeConfig to get. Acceptable formats: *
  6642  //     `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_
  6643  //     ID]/config` *
  6644  //     `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/
  6645  //     config` *
  6646  //     `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT
  6647  //     _TYPE_ID]/config` *
  6648  //     `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[IN
  6649  //     SIGHT_TYPE_ID]/config`.
  6650  func (r *ProjectsLocationsInsightTypesService) GetConfig(name string) *ProjectsLocationsInsightTypesGetConfigCall {
  6651  	c := &ProjectsLocationsInsightTypesGetConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6652  	c.name = name
  6653  	return c
  6654  }
  6655  
  6656  // Fields allows partial responses to be retrieved. See
  6657  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6658  // details.
  6659  func (c *ProjectsLocationsInsightTypesGetConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsInsightTypesGetConfigCall {
  6660  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6661  	return c
  6662  }
  6663  
  6664  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  6665  // object's ETag matches the given value. This is useful for getting updates
  6666  // only after the object has changed since the last request.
  6667  func (c *ProjectsLocationsInsightTypesGetConfigCall) IfNoneMatch(entityTag string) *ProjectsLocationsInsightTypesGetConfigCall {
  6668  	c.ifNoneMatch_ = entityTag
  6669  	return c
  6670  }
  6671  
  6672  // Context sets the context to be used in this call's Do method.
  6673  func (c *ProjectsLocationsInsightTypesGetConfigCall) Context(ctx context.Context) *ProjectsLocationsInsightTypesGetConfigCall {
  6674  	c.ctx_ = ctx
  6675  	return c
  6676  }
  6677  
  6678  // Header returns a http.Header that can be modified by the caller to add
  6679  // headers to the request.
  6680  func (c *ProjectsLocationsInsightTypesGetConfigCall) Header() http.Header {
  6681  	if c.header_ == nil {
  6682  		c.header_ = make(http.Header)
  6683  	}
  6684  	return c.header_
  6685  }
  6686  
  6687  func (c *ProjectsLocationsInsightTypesGetConfigCall) doRequest(alt string) (*http.Response, error) {
  6688  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6689  	if c.ifNoneMatch_ != "" {
  6690  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6691  	}
  6692  	var body io.Reader = nil
  6693  	c.urlParams_.Set("alt", alt)
  6694  	c.urlParams_.Set("prettyPrint", "false")
  6695  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  6696  	urls += "?" + c.urlParams_.Encode()
  6697  	req, err := http.NewRequest("GET", urls, body)
  6698  	if err != nil {
  6699  		return nil, err
  6700  	}
  6701  	req.Header = reqHeaders
  6702  	googleapi.Expand(req.URL, map[string]string{
  6703  		"name": c.name,
  6704  	})
  6705  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6706  }
  6707  
  6708  // Do executes the "recommender.projects.locations.insightTypes.getConfig" call.
  6709  // Any non-2xx status code is an error. Response headers are in either
  6710  // *GoogleCloudRecommenderV1beta1InsightTypeConfig.ServerResponse.Header or (if
  6711  // a response was returned at all) in error.(*googleapi.Error).Header. Use
  6712  // googleapi.IsNotModified to check whether the returned error was because
  6713  // http.StatusNotModified was returned.
  6714  func (c *ProjectsLocationsInsightTypesGetConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1InsightTypeConfig, error) {
  6715  	gensupport.SetOptions(c.urlParams_, opts...)
  6716  	res, err := c.doRequest("json")
  6717  	if res != nil && res.StatusCode == http.StatusNotModified {
  6718  		if res.Body != nil {
  6719  			res.Body.Close()
  6720  		}
  6721  		return nil, gensupport.WrapError(&googleapi.Error{
  6722  			Code:   res.StatusCode,
  6723  			Header: res.Header,
  6724  		})
  6725  	}
  6726  	if err != nil {
  6727  		return nil, err
  6728  	}
  6729  	defer googleapi.CloseBody(res)
  6730  	if err := googleapi.CheckResponse(res); err != nil {
  6731  		return nil, gensupport.WrapError(err)
  6732  	}
  6733  	ret := &GoogleCloudRecommenderV1beta1InsightTypeConfig{
  6734  		ServerResponse: googleapi.ServerResponse{
  6735  			Header:         res.Header,
  6736  			HTTPStatusCode: res.StatusCode,
  6737  		},
  6738  	}
  6739  	target := &ret
  6740  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6741  		return nil, err
  6742  	}
  6743  	return ret, nil
  6744  }
  6745  
  6746  type ProjectsLocationsInsightTypesUpdateConfigCall struct {
  6747  	s                                              *Service
  6748  	name                                           string
  6749  	googlecloudrecommenderv1beta1insighttypeconfig *GoogleCloudRecommenderV1beta1InsightTypeConfig
  6750  	urlParams_                                     gensupport.URLParams
  6751  	ctx_                                           context.Context
  6752  	header_                                        http.Header
  6753  }
  6754  
  6755  // UpdateConfig: Updates an InsightTypeConfig change. This will create a new
  6756  // revision of the config.
  6757  //
  6758  //   - name: Identifier. Name of insight type config. Eg,
  6759  //     projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_I
  6760  //     D]/config.
  6761  func (r *ProjectsLocationsInsightTypesService) UpdateConfig(name string, googlecloudrecommenderv1beta1insighttypeconfig *GoogleCloudRecommenderV1beta1InsightTypeConfig) *ProjectsLocationsInsightTypesUpdateConfigCall {
  6762  	c := &ProjectsLocationsInsightTypesUpdateConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6763  	c.name = name
  6764  	c.googlecloudrecommenderv1beta1insighttypeconfig = googlecloudrecommenderv1beta1insighttypeconfig
  6765  	return c
  6766  }
  6767  
  6768  // UpdateMask sets the optional parameter "updateMask": The list of fields to
  6769  // be updated.
  6770  func (c *ProjectsLocationsInsightTypesUpdateConfigCall) UpdateMask(updateMask string) *ProjectsLocationsInsightTypesUpdateConfigCall {
  6771  	c.urlParams_.Set("updateMask", updateMask)
  6772  	return c
  6773  }
  6774  
  6775  // ValidateOnly sets the optional parameter "validateOnly": If true, validate
  6776  // the request and preview the change, but do not actually update it.
  6777  func (c *ProjectsLocationsInsightTypesUpdateConfigCall) ValidateOnly(validateOnly bool) *ProjectsLocationsInsightTypesUpdateConfigCall {
  6778  	c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  6779  	return c
  6780  }
  6781  
  6782  // Fields allows partial responses to be retrieved. See
  6783  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6784  // details.
  6785  func (c *ProjectsLocationsInsightTypesUpdateConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsInsightTypesUpdateConfigCall {
  6786  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6787  	return c
  6788  }
  6789  
  6790  // Context sets the context to be used in this call's Do method.
  6791  func (c *ProjectsLocationsInsightTypesUpdateConfigCall) Context(ctx context.Context) *ProjectsLocationsInsightTypesUpdateConfigCall {
  6792  	c.ctx_ = ctx
  6793  	return c
  6794  }
  6795  
  6796  // Header returns a http.Header that can be modified by the caller to add
  6797  // headers to the request.
  6798  func (c *ProjectsLocationsInsightTypesUpdateConfigCall) Header() http.Header {
  6799  	if c.header_ == nil {
  6800  		c.header_ = make(http.Header)
  6801  	}
  6802  	return c.header_
  6803  }
  6804  
  6805  func (c *ProjectsLocationsInsightTypesUpdateConfigCall) doRequest(alt string) (*http.Response, error) {
  6806  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6807  	var body io.Reader = nil
  6808  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1insighttypeconfig)
  6809  	if err != nil {
  6810  		return nil, err
  6811  	}
  6812  	c.urlParams_.Set("alt", alt)
  6813  	c.urlParams_.Set("prettyPrint", "false")
  6814  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  6815  	urls += "?" + c.urlParams_.Encode()
  6816  	req, err := http.NewRequest("PATCH", urls, body)
  6817  	if err != nil {
  6818  		return nil, err
  6819  	}
  6820  	req.Header = reqHeaders
  6821  	googleapi.Expand(req.URL, map[string]string{
  6822  		"name": c.name,
  6823  	})
  6824  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6825  }
  6826  
  6827  // Do executes the "recommender.projects.locations.insightTypes.updateConfig" call.
  6828  // Any non-2xx status code is an error. Response headers are in either
  6829  // *GoogleCloudRecommenderV1beta1InsightTypeConfig.ServerResponse.Header or (if
  6830  // a response was returned at all) in error.(*googleapi.Error).Header. Use
  6831  // googleapi.IsNotModified to check whether the returned error was because
  6832  // http.StatusNotModified was returned.
  6833  func (c *ProjectsLocationsInsightTypesUpdateConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1InsightTypeConfig, error) {
  6834  	gensupport.SetOptions(c.urlParams_, opts...)
  6835  	res, err := c.doRequest("json")
  6836  	if res != nil && res.StatusCode == http.StatusNotModified {
  6837  		if res.Body != nil {
  6838  			res.Body.Close()
  6839  		}
  6840  		return nil, gensupport.WrapError(&googleapi.Error{
  6841  			Code:   res.StatusCode,
  6842  			Header: res.Header,
  6843  		})
  6844  	}
  6845  	if err != nil {
  6846  		return nil, err
  6847  	}
  6848  	defer googleapi.CloseBody(res)
  6849  	if err := googleapi.CheckResponse(res); err != nil {
  6850  		return nil, gensupport.WrapError(err)
  6851  	}
  6852  	ret := &GoogleCloudRecommenderV1beta1InsightTypeConfig{
  6853  		ServerResponse: googleapi.ServerResponse{
  6854  			Header:         res.Header,
  6855  			HTTPStatusCode: res.StatusCode,
  6856  		},
  6857  	}
  6858  	target := &ret
  6859  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6860  		return nil, err
  6861  	}
  6862  	return ret, nil
  6863  }
  6864  
  6865  type ProjectsLocationsInsightTypesInsightsGetCall struct {
  6866  	s            *Service
  6867  	name         string
  6868  	urlParams_   gensupport.URLParams
  6869  	ifNoneMatch_ string
  6870  	ctx_         context.Context
  6871  	header_      http.Header
  6872  }
  6873  
  6874  // Get: Gets the requested insight. Requires the recommender.*.get IAM
  6875  // permission for the specified insight type.
  6876  //
  6877  // - name: Name of the insight.
  6878  func (r *ProjectsLocationsInsightTypesInsightsService) Get(name string) *ProjectsLocationsInsightTypesInsightsGetCall {
  6879  	c := &ProjectsLocationsInsightTypesInsightsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6880  	c.name = name
  6881  	return c
  6882  }
  6883  
  6884  // Fields allows partial responses to be retrieved. See
  6885  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6886  // details.
  6887  func (c *ProjectsLocationsInsightTypesInsightsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInsightTypesInsightsGetCall {
  6888  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6889  	return c
  6890  }
  6891  
  6892  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  6893  // object's ETag matches the given value. This is useful for getting updates
  6894  // only after the object has changed since the last request.
  6895  func (c *ProjectsLocationsInsightTypesInsightsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsInsightTypesInsightsGetCall {
  6896  	c.ifNoneMatch_ = entityTag
  6897  	return c
  6898  }
  6899  
  6900  // Context sets the context to be used in this call's Do method.
  6901  func (c *ProjectsLocationsInsightTypesInsightsGetCall) Context(ctx context.Context) *ProjectsLocationsInsightTypesInsightsGetCall {
  6902  	c.ctx_ = ctx
  6903  	return c
  6904  }
  6905  
  6906  // Header returns a http.Header that can be modified by the caller to add
  6907  // headers to the request.
  6908  func (c *ProjectsLocationsInsightTypesInsightsGetCall) Header() http.Header {
  6909  	if c.header_ == nil {
  6910  		c.header_ = make(http.Header)
  6911  	}
  6912  	return c.header_
  6913  }
  6914  
  6915  func (c *ProjectsLocationsInsightTypesInsightsGetCall) doRequest(alt string) (*http.Response, error) {
  6916  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6917  	if c.ifNoneMatch_ != "" {
  6918  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6919  	}
  6920  	var body io.Reader = nil
  6921  	c.urlParams_.Set("alt", alt)
  6922  	c.urlParams_.Set("prettyPrint", "false")
  6923  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  6924  	urls += "?" + c.urlParams_.Encode()
  6925  	req, err := http.NewRequest("GET", urls, body)
  6926  	if err != nil {
  6927  		return nil, err
  6928  	}
  6929  	req.Header = reqHeaders
  6930  	googleapi.Expand(req.URL, map[string]string{
  6931  		"name": c.name,
  6932  	})
  6933  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6934  }
  6935  
  6936  // Do executes the "recommender.projects.locations.insightTypes.insights.get" call.
  6937  // Any non-2xx status code is an error. Response headers are in either
  6938  // *GoogleCloudRecommenderV1beta1Insight.ServerResponse.Header or (if a
  6939  // response was returned at all) in error.(*googleapi.Error).Header. Use
  6940  // googleapi.IsNotModified to check whether the returned error was because
  6941  // http.StatusNotModified was returned.
  6942  func (c *ProjectsLocationsInsightTypesInsightsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Insight, error) {
  6943  	gensupport.SetOptions(c.urlParams_, opts...)
  6944  	res, err := c.doRequest("json")
  6945  	if res != nil && res.StatusCode == http.StatusNotModified {
  6946  		if res.Body != nil {
  6947  			res.Body.Close()
  6948  		}
  6949  		return nil, gensupport.WrapError(&googleapi.Error{
  6950  			Code:   res.StatusCode,
  6951  			Header: res.Header,
  6952  		})
  6953  	}
  6954  	if err != nil {
  6955  		return nil, err
  6956  	}
  6957  	defer googleapi.CloseBody(res)
  6958  	if err := googleapi.CheckResponse(res); err != nil {
  6959  		return nil, gensupport.WrapError(err)
  6960  	}
  6961  	ret := &GoogleCloudRecommenderV1beta1Insight{
  6962  		ServerResponse: googleapi.ServerResponse{
  6963  			Header:         res.Header,
  6964  			HTTPStatusCode: res.StatusCode,
  6965  		},
  6966  	}
  6967  	target := &ret
  6968  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6969  		return nil, err
  6970  	}
  6971  	return ret, nil
  6972  }
  6973  
  6974  type ProjectsLocationsInsightTypesInsightsListCall struct {
  6975  	s            *Service
  6976  	parent       string
  6977  	urlParams_   gensupport.URLParams
  6978  	ifNoneMatch_ string
  6979  	ctx_         context.Context
  6980  	header_      http.Header
  6981  }
  6982  
  6983  // List: Lists insights for the specified Cloud Resource. Requires the
  6984  // recommender.*.list IAM permission for the specified insight type.
  6985  //
  6986  //   - parent: The container resource on which to execute the request. Acceptable
  6987  //     formats: *
  6988  //     `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_
  6989  //     ID]` *
  6990  //     `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]`
  6991  //     *
  6992  //     `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[IN
  6993  //     SIGHT_TYPE_ID]` *
  6994  //     `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]`
  6995  //     *
  6996  //     `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT
  6997  //     _TYPE_ID]` LOCATION here refers to GCP Locations:
  6998  //     https://cloud.google.com/about/locations/ INSIGHT_TYPE_ID refers to
  6999  //     supported insight types:
  7000  //     https://cloud.google.com/recommender/docs/insights/insight-types.
  7001  func (r *ProjectsLocationsInsightTypesInsightsService) List(parent string) *ProjectsLocationsInsightTypesInsightsListCall {
  7002  	c := &ProjectsLocationsInsightTypesInsightsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7003  	c.parent = parent
  7004  	return c
  7005  }
  7006  
  7007  // Filter sets the optional parameter "filter": Filter expression to restrict
  7008  // the insights returned. Supported filter fields: * `stateInfo.state` *
  7009  // `insightSubtype` * `severity` * `targetResources` Examples: *
  7010  // `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` * `insightSubtype
  7011  // = PERMISSIONS_USAGE` * `severity = CRITICAL OR severity = HIGH` *
  7012  // `targetResources :
  7013  // //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance
  7014  // -1` * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity =
  7015  // HIGH)` The max allowed filter length is 500 characters. (These expressions
  7016  // are based on the filter language described at https://google.aip.dev/160)
  7017  func (c *ProjectsLocationsInsightTypesInsightsListCall) Filter(filter string) *ProjectsLocationsInsightTypesInsightsListCall {
  7018  	c.urlParams_.Set("filter", filter)
  7019  	return c
  7020  }
  7021  
  7022  // PageSize sets the optional parameter "pageSize": The maximum number of
  7023  // results to return from this request. Non-positive values are ignored. If not
  7024  // specified, the server will determine the number of results to return.
  7025  func (c *ProjectsLocationsInsightTypesInsightsListCall) PageSize(pageSize int64) *ProjectsLocationsInsightTypesInsightsListCall {
  7026  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7027  	return c
  7028  }
  7029  
  7030  // PageToken sets the optional parameter "pageToken": If present, retrieves the
  7031  // next batch of results from the preceding call to this method. `page_token`
  7032  // must be the value of `next_page_token` from the previous response. The
  7033  // values of other method parameters must be identical to those in the previous
  7034  // call.
  7035  func (c *ProjectsLocationsInsightTypesInsightsListCall) PageToken(pageToken string) *ProjectsLocationsInsightTypesInsightsListCall {
  7036  	c.urlParams_.Set("pageToken", pageToken)
  7037  	return c
  7038  }
  7039  
  7040  // Fields allows partial responses to be retrieved. See
  7041  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7042  // details.
  7043  func (c *ProjectsLocationsInsightTypesInsightsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsInsightTypesInsightsListCall {
  7044  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7045  	return c
  7046  }
  7047  
  7048  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  7049  // object's ETag matches the given value. This is useful for getting updates
  7050  // only after the object has changed since the last request.
  7051  func (c *ProjectsLocationsInsightTypesInsightsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsInsightTypesInsightsListCall {
  7052  	c.ifNoneMatch_ = entityTag
  7053  	return c
  7054  }
  7055  
  7056  // Context sets the context to be used in this call's Do method.
  7057  func (c *ProjectsLocationsInsightTypesInsightsListCall) Context(ctx context.Context) *ProjectsLocationsInsightTypesInsightsListCall {
  7058  	c.ctx_ = ctx
  7059  	return c
  7060  }
  7061  
  7062  // Header returns a http.Header that can be modified by the caller to add
  7063  // headers to the request.
  7064  func (c *ProjectsLocationsInsightTypesInsightsListCall) Header() http.Header {
  7065  	if c.header_ == nil {
  7066  		c.header_ = make(http.Header)
  7067  	}
  7068  	return c.header_
  7069  }
  7070  
  7071  func (c *ProjectsLocationsInsightTypesInsightsListCall) doRequest(alt string) (*http.Response, error) {
  7072  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7073  	if c.ifNoneMatch_ != "" {
  7074  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7075  	}
  7076  	var body io.Reader = nil
  7077  	c.urlParams_.Set("alt", alt)
  7078  	c.urlParams_.Set("prettyPrint", "false")
  7079  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/insights")
  7080  	urls += "?" + c.urlParams_.Encode()
  7081  	req, err := http.NewRequest("GET", urls, body)
  7082  	if err != nil {
  7083  		return nil, err
  7084  	}
  7085  	req.Header = reqHeaders
  7086  	googleapi.Expand(req.URL, map[string]string{
  7087  		"parent": c.parent,
  7088  	})
  7089  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7090  }
  7091  
  7092  // Do executes the "recommender.projects.locations.insightTypes.insights.list" call.
  7093  // Any non-2xx status code is an error. Response headers are in either
  7094  // *GoogleCloudRecommenderV1beta1ListInsightsResponse.ServerResponse.Header or
  7095  // (if a response was returned at all) in error.(*googleapi.Error).Header. Use
  7096  // googleapi.IsNotModified to check whether the returned error was because
  7097  // http.StatusNotModified was returned.
  7098  func (c *ProjectsLocationsInsightTypesInsightsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1ListInsightsResponse, error) {
  7099  	gensupport.SetOptions(c.urlParams_, opts...)
  7100  	res, err := c.doRequest("json")
  7101  	if res != nil && res.StatusCode == http.StatusNotModified {
  7102  		if res.Body != nil {
  7103  			res.Body.Close()
  7104  		}
  7105  		return nil, gensupport.WrapError(&googleapi.Error{
  7106  			Code:   res.StatusCode,
  7107  			Header: res.Header,
  7108  		})
  7109  	}
  7110  	if err != nil {
  7111  		return nil, err
  7112  	}
  7113  	defer googleapi.CloseBody(res)
  7114  	if err := googleapi.CheckResponse(res); err != nil {
  7115  		return nil, gensupport.WrapError(err)
  7116  	}
  7117  	ret := &GoogleCloudRecommenderV1beta1ListInsightsResponse{
  7118  		ServerResponse: googleapi.ServerResponse{
  7119  			Header:         res.Header,
  7120  			HTTPStatusCode: res.StatusCode,
  7121  		},
  7122  	}
  7123  	target := &ret
  7124  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7125  		return nil, err
  7126  	}
  7127  	return ret, nil
  7128  }
  7129  
  7130  // Pages invokes f for each page of results.
  7131  // A non-nil error returned from f will halt the iteration.
  7132  // The provided context supersedes any context provided to the Context method.
  7133  func (c *ProjectsLocationsInsightTypesInsightsListCall) Pages(ctx context.Context, f func(*GoogleCloudRecommenderV1beta1ListInsightsResponse) error) error {
  7134  	c.ctx_ = ctx
  7135  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  7136  	for {
  7137  		x, err := c.Do()
  7138  		if err != nil {
  7139  			return err
  7140  		}
  7141  		if err := f(x); err != nil {
  7142  			return err
  7143  		}
  7144  		if x.NextPageToken == "" {
  7145  			return nil
  7146  		}
  7147  		c.PageToken(x.NextPageToken)
  7148  	}
  7149  }
  7150  
  7151  type ProjectsLocationsInsightTypesInsightsMarkAcceptedCall struct {
  7152  	s                                                       *Service
  7153  	name                                                    string
  7154  	googlecloudrecommenderv1beta1markinsightacceptedrequest *GoogleCloudRecommenderV1beta1MarkInsightAcceptedRequest
  7155  	urlParams_                                              gensupport.URLParams
  7156  	ctx_                                                    context.Context
  7157  	header_                                                 http.Header
  7158  }
  7159  
  7160  // MarkAccepted: Marks the Insight State as Accepted. Users can use this method
  7161  // to indicate to the Recommender API that they have applied some action based
  7162  // on the insight. This stops the insight content from being updated.
  7163  // MarkInsightAccepted can be applied to insights in ACTIVE state. Requires the
  7164  // recommender.*.update IAM permission for the specified insight.
  7165  //
  7166  // - name: Name of the insight.
  7167  func (r *ProjectsLocationsInsightTypesInsightsService) MarkAccepted(name string, googlecloudrecommenderv1beta1markinsightacceptedrequest *GoogleCloudRecommenderV1beta1MarkInsightAcceptedRequest) *ProjectsLocationsInsightTypesInsightsMarkAcceptedCall {
  7168  	c := &ProjectsLocationsInsightTypesInsightsMarkAcceptedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7169  	c.name = name
  7170  	c.googlecloudrecommenderv1beta1markinsightacceptedrequest = googlecloudrecommenderv1beta1markinsightacceptedrequest
  7171  	return c
  7172  }
  7173  
  7174  // Fields allows partial responses to be retrieved. See
  7175  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7176  // details.
  7177  func (c *ProjectsLocationsInsightTypesInsightsMarkAcceptedCall) Fields(s ...googleapi.Field) *ProjectsLocationsInsightTypesInsightsMarkAcceptedCall {
  7178  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7179  	return c
  7180  }
  7181  
  7182  // Context sets the context to be used in this call's Do method.
  7183  func (c *ProjectsLocationsInsightTypesInsightsMarkAcceptedCall) Context(ctx context.Context) *ProjectsLocationsInsightTypesInsightsMarkAcceptedCall {
  7184  	c.ctx_ = ctx
  7185  	return c
  7186  }
  7187  
  7188  // Header returns a http.Header that can be modified by the caller to add
  7189  // headers to the request.
  7190  func (c *ProjectsLocationsInsightTypesInsightsMarkAcceptedCall) Header() http.Header {
  7191  	if c.header_ == nil {
  7192  		c.header_ = make(http.Header)
  7193  	}
  7194  	return c.header_
  7195  }
  7196  
  7197  func (c *ProjectsLocationsInsightTypesInsightsMarkAcceptedCall) doRequest(alt string) (*http.Response, error) {
  7198  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  7199  	var body io.Reader = nil
  7200  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markinsightacceptedrequest)
  7201  	if err != nil {
  7202  		return nil, err
  7203  	}
  7204  	c.urlParams_.Set("alt", alt)
  7205  	c.urlParams_.Set("prettyPrint", "false")
  7206  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markAccepted")
  7207  	urls += "?" + c.urlParams_.Encode()
  7208  	req, err := http.NewRequest("POST", urls, body)
  7209  	if err != nil {
  7210  		return nil, err
  7211  	}
  7212  	req.Header = reqHeaders
  7213  	googleapi.Expand(req.URL, map[string]string{
  7214  		"name": c.name,
  7215  	})
  7216  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7217  }
  7218  
  7219  // Do executes the "recommender.projects.locations.insightTypes.insights.markAccepted" call.
  7220  // Any non-2xx status code is an error. Response headers are in either
  7221  // *GoogleCloudRecommenderV1beta1Insight.ServerResponse.Header or (if a
  7222  // response was returned at all) in error.(*googleapi.Error).Header. Use
  7223  // googleapi.IsNotModified to check whether the returned error was because
  7224  // http.StatusNotModified was returned.
  7225  func (c *ProjectsLocationsInsightTypesInsightsMarkAcceptedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Insight, error) {
  7226  	gensupport.SetOptions(c.urlParams_, opts...)
  7227  	res, err := c.doRequest("json")
  7228  	if res != nil && res.StatusCode == http.StatusNotModified {
  7229  		if res.Body != nil {
  7230  			res.Body.Close()
  7231  		}
  7232  		return nil, gensupport.WrapError(&googleapi.Error{
  7233  			Code:   res.StatusCode,
  7234  			Header: res.Header,
  7235  		})
  7236  	}
  7237  	if err != nil {
  7238  		return nil, err
  7239  	}
  7240  	defer googleapi.CloseBody(res)
  7241  	if err := googleapi.CheckResponse(res); err != nil {
  7242  		return nil, gensupport.WrapError(err)
  7243  	}
  7244  	ret := &GoogleCloudRecommenderV1beta1Insight{
  7245  		ServerResponse: googleapi.ServerResponse{
  7246  			Header:         res.Header,
  7247  			HTTPStatusCode: res.StatusCode,
  7248  		},
  7249  	}
  7250  	target := &ret
  7251  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7252  		return nil, err
  7253  	}
  7254  	return ret, nil
  7255  }
  7256  
  7257  type ProjectsLocationsRecommendersGetConfigCall struct {
  7258  	s            *Service
  7259  	name         string
  7260  	urlParams_   gensupport.URLParams
  7261  	ifNoneMatch_ string
  7262  	ctx_         context.Context
  7263  	header_      http.Header
  7264  }
  7265  
  7266  // GetConfig: Gets the requested Recommender Config. There is only one instance
  7267  // of the config for each Recommender.
  7268  //
  7269  //   - name: Name of the Recommendation Config to get. Acceptable formats: *
  7270  //     `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_I
  7271  //     D]/config` *
  7272  //     `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/c
  7273  //     onfig` *
  7274  //     `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMME
  7275  //     NDER_ID]/config` *
  7276  //     `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RE
  7277  //     COMMENDER_ID]/config`.
  7278  func (r *ProjectsLocationsRecommendersService) GetConfig(name string) *ProjectsLocationsRecommendersGetConfigCall {
  7279  	c := &ProjectsLocationsRecommendersGetConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7280  	c.name = name
  7281  	return c
  7282  }
  7283  
  7284  // Fields allows partial responses to be retrieved. See
  7285  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7286  // details.
  7287  func (c *ProjectsLocationsRecommendersGetConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsRecommendersGetConfigCall {
  7288  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7289  	return c
  7290  }
  7291  
  7292  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  7293  // object's ETag matches the given value. This is useful for getting updates
  7294  // only after the object has changed since the last request.
  7295  func (c *ProjectsLocationsRecommendersGetConfigCall) IfNoneMatch(entityTag string) *ProjectsLocationsRecommendersGetConfigCall {
  7296  	c.ifNoneMatch_ = entityTag
  7297  	return c
  7298  }
  7299  
  7300  // Context sets the context to be used in this call's Do method.
  7301  func (c *ProjectsLocationsRecommendersGetConfigCall) Context(ctx context.Context) *ProjectsLocationsRecommendersGetConfigCall {
  7302  	c.ctx_ = ctx
  7303  	return c
  7304  }
  7305  
  7306  // Header returns a http.Header that can be modified by the caller to add
  7307  // headers to the request.
  7308  func (c *ProjectsLocationsRecommendersGetConfigCall) Header() http.Header {
  7309  	if c.header_ == nil {
  7310  		c.header_ = make(http.Header)
  7311  	}
  7312  	return c.header_
  7313  }
  7314  
  7315  func (c *ProjectsLocationsRecommendersGetConfigCall) doRequest(alt string) (*http.Response, error) {
  7316  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7317  	if c.ifNoneMatch_ != "" {
  7318  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7319  	}
  7320  	var body io.Reader = nil
  7321  	c.urlParams_.Set("alt", alt)
  7322  	c.urlParams_.Set("prettyPrint", "false")
  7323  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  7324  	urls += "?" + c.urlParams_.Encode()
  7325  	req, err := http.NewRequest("GET", urls, body)
  7326  	if err != nil {
  7327  		return nil, err
  7328  	}
  7329  	req.Header = reqHeaders
  7330  	googleapi.Expand(req.URL, map[string]string{
  7331  		"name": c.name,
  7332  	})
  7333  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7334  }
  7335  
  7336  // Do executes the "recommender.projects.locations.recommenders.getConfig" call.
  7337  // Any non-2xx status code is an error. Response headers are in either
  7338  // *GoogleCloudRecommenderV1beta1RecommenderConfig.ServerResponse.Header or (if
  7339  // a response was returned at all) in error.(*googleapi.Error).Header. Use
  7340  // googleapi.IsNotModified to check whether the returned error was because
  7341  // http.StatusNotModified was returned.
  7342  func (c *ProjectsLocationsRecommendersGetConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1RecommenderConfig, error) {
  7343  	gensupport.SetOptions(c.urlParams_, opts...)
  7344  	res, err := c.doRequest("json")
  7345  	if res != nil && res.StatusCode == http.StatusNotModified {
  7346  		if res.Body != nil {
  7347  			res.Body.Close()
  7348  		}
  7349  		return nil, gensupport.WrapError(&googleapi.Error{
  7350  			Code:   res.StatusCode,
  7351  			Header: res.Header,
  7352  		})
  7353  	}
  7354  	if err != nil {
  7355  		return nil, err
  7356  	}
  7357  	defer googleapi.CloseBody(res)
  7358  	if err := googleapi.CheckResponse(res); err != nil {
  7359  		return nil, gensupport.WrapError(err)
  7360  	}
  7361  	ret := &GoogleCloudRecommenderV1beta1RecommenderConfig{
  7362  		ServerResponse: googleapi.ServerResponse{
  7363  			Header:         res.Header,
  7364  			HTTPStatusCode: res.StatusCode,
  7365  		},
  7366  	}
  7367  	target := &ret
  7368  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7369  		return nil, err
  7370  	}
  7371  	return ret, nil
  7372  }
  7373  
  7374  type ProjectsLocationsRecommendersUpdateConfigCall struct {
  7375  	s                                              *Service
  7376  	name                                           string
  7377  	googlecloudrecommenderv1beta1recommenderconfig *GoogleCloudRecommenderV1beta1RecommenderConfig
  7378  	urlParams_                                     gensupport.URLParams
  7379  	ctx_                                           context.Context
  7380  	header_                                        http.Header
  7381  }
  7382  
  7383  // UpdateConfig: Updates a Recommender Config. This will create a new revision
  7384  // of the config.
  7385  //
  7386  //   - name: Identifier. Name of recommender config. Eg,
  7387  //     projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID
  7388  //     ]/config.
  7389  func (r *ProjectsLocationsRecommendersService) UpdateConfig(name string, googlecloudrecommenderv1beta1recommenderconfig *GoogleCloudRecommenderV1beta1RecommenderConfig) *ProjectsLocationsRecommendersUpdateConfigCall {
  7390  	c := &ProjectsLocationsRecommendersUpdateConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7391  	c.name = name
  7392  	c.googlecloudrecommenderv1beta1recommenderconfig = googlecloudrecommenderv1beta1recommenderconfig
  7393  	return c
  7394  }
  7395  
  7396  // UpdateMask sets the optional parameter "updateMask": The list of fields to
  7397  // be updated.
  7398  func (c *ProjectsLocationsRecommendersUpdateConfigCall) UpdateMask(updateMask string) *ProjectsLocationsRecommendersUpdateConfigCall {
  7399  	c.urlParams_.Set("updateMask", updateMask)
  7400  	return c
  7401  }
  7402  
  7403  // ValidateOnly sets the optional parameter "validateOnly": If true, validate
  7404  // the request and preview the change, but do not actually update it.
  7405  func (c *ProjectsLocationsRecommendersUpdateConfigCall) ValidateOnly(validateOnly bool) *ProjectsLocationsRecommendersUpdateConfigCall {
  7406  	c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  7407  	return c
  7408  }
  7409  
  7410  // Fields allows partial responses to be retrieved. See
  7411  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7412  // details.
  7413  func (c *ProjectsLocationsRecommendersUpdateConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsRecommendersUpdateConfigCall {
  7414  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7415  	return c
  7416  }
  7417  
  7418  // Context sets the context to be used in this call's Do method.
  7419  func (c *ProjectsLocationsRecommendersUpdateConfigCall) Context(ctx context.Context) *ProjectsLocationsRecommendersUpdateConfigCall {
  7420  	c.ctx_ = ctx
  7421  	return c
  7422  }
  7423  
  7424  // Header returns a http.Header that can be modified by the caller to add
  7425  // headers to the request.
  7426  func (c *ProjectsLocationsRecommendersUpdateConfigCall) Header() http.Header {
  7427  	if c.header_ == nil {
  7428  		c.header_ = make(http.Header)
  7429  	}
  7430  	return c.header_
  7431  }
  7432  
  7433  func (c *ProjectsLocationsRecommendersUpdateConfigCall) doRequest(alt string) (*http.Response, error) {
  7434  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  7435  	var body io.Reader = nil
  7436  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1recommenderconfig)
  7437  	if err != nil {
  7438  		return nil, err
  7439  	}
  7440  	c.urlParams_.Set("alt", alt)
  7441  	c.urlParams_.Set("prettyPrint", "false")
  7442  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  7443  	urls += "?" + c.urlParams_.Encode()
  7444  	req, err := http.NewRequest("PATCH", urls, body)
  7445  	if err != nil {
  7446  		return nil, err
  7447  	}
  7448  	req.Header = reqHeaders
  7449  	googleapi.Expand(req.URL, map[string]string{
  7450  		"name": c.name,
  7451  	})
  7452  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7453  }
  7454  
  7455  // Do executes the "recommender.projects.locations.recommenders.updateConfig" call.
  7456  // Any non-2xx status code is an error. Response headers are in either
  7457  // *GoogleCloudRecommenderV1beta1RecommenderConfig.ServerResponse.Header or (if
  7458  // a response was returned at all) in error.(*googleapi.Error).Header. Use
  7459  // googleapi.IsNotModified to check whether the returned error was because
  7460  // http.StatusNotModified was returned.
  7461  func (c *ProjectsLocationsRecommendersUpdateConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1RecommenderConfig, error) {
  7462  	gensupport.SetOptions(c.urlParams_, opts...)
  7463  	res, err := c.doRequest("json")
  7464  	if res != nil && res.StatusCode == http.StatusNotModified {
  7465  		if res.Body != nil {
  7466  			res.Body.Close()
  7467  		}
  7468  		return nil, gensupport.WrapError(&googleapi.Error{
  7469  			Code:   res.StatusCode,
  7470  			Header: res.Header,
  7471  		})
  7472  	}
  7473  	if err != nil {
  7474  		return nil, err
  7475  	}
  7476  	defer googleapi.CloseBody(res)
  7477  	if err := googleapi.CheckResponse(res); err != nil {
  7478  		return nil, gensupport.WrapError(err)
  7479  	}
  7480  	ret := &GoogleCloudRecommenderV1beta1RecommenderConfig{
  7481  		ServerResponse: googleapi.ServerResponse{
  7482  			Header:         res.Header,
  7483  			HTTPStatusCode: res.StatusCode,
  7484  		},
  7485  	}
  7486  	target := &ret
  7487  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7488  		return nil, err
  7489  	}
  7490  	return ret, nil
  7491  }
  7492  
  7493  type ProjectsLocationsRecommendersRecommendationsGetCall struct {
  7494  	s            *Service
  7495  	name         string
  7496  	urlParams_   gensupport.URLParams
  7497  	ifNoneMatch_ string
  7498  	ctx_         context.Context
  7499  	header_      http.Header
  7500  }
  7501  
  7502  // Get: Gets the requested recommendation. Requires the recommender.*.get IAM
  7503  // permission for the specified recommender.
  7504  //
  7505  // - name: Name of the recommendation.
  7506  func (r *ProjectsLocationsRecommendersRecommendationsService) Get(name string) *ProjectsLocationsRecommendersRecommendationsGetCall {
  7507  	c := &ProjectsLocationsRecommendersRecommendationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7508  	c.name = name
  7509  	return c
  7510  }
  7511  
  7512  // Fields allows partial responses to be retrieved. See
  7513  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7514  // details.
  7515  func (c *ProjectsLocationsRecommendersRecommendationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsRecommendersRecommendationsGetCall {
  7516  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7517  	return c
  7518  }
  7519  
  7520  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  7521  // object's ETag matches the given value. This is useful for getting updates
  7522  // only after the object has changed since the last request.
  7523  func (c *ProjectsLocationsRecommendersRecommendationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsRecommendersRecommendationsGetCall {
  7524  	c.ifNoneMatch_ = entityTag
  7525  	return c
  7526  }
  7527  
  7528  // Context sets the context to be used in this call's Do method.
  7529  func (c *ProjectsLocationsRecommendersRecommendationsGetCall) Context(ctx context.Context) *ProjectsLocationsRecommendersRecommendationsGetCall {
  7530  	c.ctx_ = ctx
  7531  	return c
  7532  }
  7533  
  7534  // Header returns a http.Header that can be modified by the caller to add
  7535  // headers to the request.
  7536  func (c *ProjectsLocationsRecommendersRecommendationsGetCall) Header() http.Header {
  7537  	if c.header_ == nil {
  7538  		c.header_ = make(http.Header)
  7539  	}
  7540  	return c.header_
  7541  }
  7542  
  7543  func (c *ProjectsLocationsRecommendersRecommendationsGetCall) doRequest(alt string) (*http.Response, error) {
  7544  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7545  	if c.ifNoneMatch_ != "" {
  7546  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7547  	}
  7548  	var body io.Reader = nil
  7549  	c.urlParams_.Set("alt", alt)
  7550  	c.urlParams_.Set("prettyPrint", "false")
  7551  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  7552  	urls += "?" + c.urlParams_.Encode()
  7553  	req, err := http.NewRequest("GET", urls, body)
  7554  	if err != nil {
  7555  		return nil, err
  7556  	}
  7557  	req.Header = reqHeaders
  7558  	googleapi.Expand(req.URL, map[string]string{
  7559  		"name": c.name,
  7560  	})
  7561  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7562  }
  7563  
  7564  // Do executes the "recommender.projects.locations.recommenders.recommendations.get" call.
  7565  // Any non-2xx status code is an error. Response headers are in either
  7566  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  7567  // response was returned at all) in error.(*googleapi.Error).Header. Use
  7568  // googleapi.IsNotModified to check whether the returned error was because
  7569  // http.StatusNotModified was returned.
  7570  func (c *ProjectsLocationsRecommendersRecommendationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  7571  	gensupport.SetOptions(c.urlParams_, opts...)
  7572  	res, err := c.doRequest("json")
  7573  	if res != nil && res.StatusCode == http.StatusNotModified {
  7574  		if res.Body != nil {
  7575  			res.Body.Close()
  7576  		}
  7577  		return nil, gensupport.WrapError(&googleapi.Error{
  7578  			Code:   res.StatusCode,
  7579  			Header: res.Header,
  7580  		})
  7581  	}
  7582  	if err != nil {
  7583  		return nil, err
  7584  	}
  7585  	defer googleapi.CloseBody(res)
  7586  	if err := googleapi.CheckResponse(res); err != nil {
  7587  		return nil, gensupport.WrapError(err)
  7588  	}
  7589  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  7590  		ServerResponse: googleapi.ServerResponse{
  7591  			Header:         res.Header,
  7592  			HTTPStatusCode: res.StatusCode,
  7593  		},
  7594  	}
  7595  	target := &ret
  7596  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7597  		return nil, err
  7598  	}
  7599  	return ret, nil
  7600  }
  7601  
  7602  type ProjectsLocationsRecommendersRecommendationsListCall struct {
  7603  	s            *Service
  7604  	parent       string
  7605  	urlParams_   gensupport.URLParams
  7606  	ifNoneMatch_ string
  7607  	ctx_         context.Context
  7608  	header_      http.Header
  7609  }
  7610  
  7611  // List: Lists recommendations for the specified Cloud Resource. Requires the
  7612  // recommender.*.list IAM permission for the specified recommender.
  7613  //
  7614  //   - parent: The container resource on which to execute the request. Acceptable
  7615  //     formats: *
  7616  //     `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_I
  7617  //     D]` *
  7618  //     `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]`
  7619  //     *
  7620  //     `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RE
  7621  //     COMMENDER_ID]` *
  7622  //     `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` *
  7623  //     `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMME
  7624  //     NDER_ID]` LOCATION here refers to GCP Locations:
  7625  //     https://cloud.google.com/about/locations/ RECOMMENDER_ID refers to
  7626  //     supported recommenders:
  7627  //     https://cloud.google.com/recommender/docs/recommenders.
  7628  func (r *ProjectsLocationsRecommendersRecommendationsService) List(parent string) *ProjectsLocationsRecommendersRecommendationsListCall {
  7629  	c := &ProjectsLocationsRecommendersRecommendationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7630  	c.parent = parent
  7631  	return c
  7632  }
  7633  
  7634  // Filter sets the optional parameter "filter": Filter expression to restrict
  7635  // the recommendations returned. Supported filter fields: * `state_info.state`
  7636  // * `recommenderSubtype` * `priority` * `targetResources` Examples: *
  7637  // `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` *
  7638  // `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` *
  7639  // `priority = P1 OR priority = P2` * `targetResources :
  7640  // //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance
  7641  // -1` * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` The
  7642  // max allowed filter length is 500 characters. (These expressions are based on
  7643  // the filter language described at https://google.aip.dev/160)
  7644  func (c *ProjectsLocationsRecommendersRecommendationsListCall) Filter(filter string) *ProjectsLocationsRecommendersRecommendationsListCall {
  7645  	c.urlParams_.Set("filter", filter)
  7646  	return c
  7647  }
  7648  
  7649  // PageSize sets the optional parameter "pageSize": The maximum number of
  7650  // results to return from this request. Non-positive values are ignored. If not
  7651  // specified, the server will determine the number of results to return.
  7652  func (c *ProjectsLocationsRecommendersRecommendationsListCall) PageSize(pageSize int64) *ProjectsLocationsRecommendersRecommendationsListCall {
  7653  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7654  	return c
  7655  }
  7656  
  7657  // PageToken sets the optional parameter "pageToken": If present, retrieves the
  7658  // next batch of results from the preceding call to this method. `page_token`
  7659  // must be the value of `next_page_token` from the previous response. The
  7660  // values of other method parameters must be identical to those in the previous
  7661  // call.
  7662  func (c *ProjectsLocationsRecommendersRecommendationsListCall) PageToken(pageToken string) *ProjectsLocationsRecommendersRecommendationsListCall {
  7663  	c.urlParams_.Set("pageToken", pageToken)
  7664  	return c
  7665  }
  7666  
  7667  // Fields allows partial responses to be retrieved. See
  7668  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7669  // details.
  7670  func (c *ProjectsLocationsRecommendersRecommendationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsRecommendersRecommendationsListCall {
  7671  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7672  	return c
  7673  }
  7674  
  7675  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  7676  // object's ETag matches the given value. This is useful for getting updates
  7677  // only after the object has changed since the last request.
  7678  func (c *ProjectsLocationsRecommendersRecommendationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsRecommendersRecommendationsListCall {
  7679  	c.ifNoneMatch_ = entityTag
  7680  	return c
  7681  }
  7682  
  7683  // Context sets the context to be used in this call's Do method.
  7684  func (c *ProjectsLocationsRecommendersRecommendationsListCall) Context(ctx context.Context) *ProjectsLocationsRecommendersRecommendationsListCall {
  7685  	c.ctx_ = ctx
  7686  	return c
  7687  }
  7688  
  7689  // Header returns a http.Header that can be modified by the caller to add
  7690  // headers to the request.
  7691  func (c *ProjectsLocationsRecommendersRecommendationsListCall) Header() http.Header {
  7692  	if c.header_ == nil {
  7693  		c.header_ = make(http.Header)
  7694  	}
  7695  	return c.header_
  7696  }
  7697  
  7698  func (c *ProjectsLocationsRecommendersRecommendationsListCall) doRequest(alt string) (*http.Response, error) {
  7699  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7700  	if c.ifNoneMatch_ != "" {
  7701  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7702  	}
  7703  	var body io.Reader = nil
  7704  	c.urlParams_.Set("alt", alt)
  7705  	c.urlParams_.Set("prettyPrint", "false")
  7706  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/recommendations")
  7707  	urls += "?" + c.urlParams_.Encode()
  7708  	req, err := http.NewRequest("GET", urls, body)
  7709  	if err != nil {
  7710  		return nil, err
  7711  	}
  7712  	req.Header = reqHeaders
  7713  	googleapi.Expand(req.URL, map[string]string{
  7714  		"parent": c.parent,
  7715  	})
  7716  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7717  }
  7718  
  7719  // Do executes the "recommender.projects.locations.recommenders.recommendations.list" call.
  7720  // Any non-2xx status code is an error. Response headers are in either
  7721  // *GoogleCloudRecommenderV1beta1ListRecommendationsResponse.ServerResponse.Head
  7722  // er or (if a response was returned at all) in
  7723  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7724  // whether the returned error was because http.StatusNotModified was returned.
  7725  func (c *ProjectsLocationsRecommendersRecommendationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1ListRecommendationsResponse, error) {
  7726  	gensupport.SetOptions(c.urlParams_, opts...)
  7727  	res, err := c.doRequest("json")
  7728  	if res != nil && res.StatusCode == http.StatusNotModified {
  7729  		if res.Body != nil {
  7730  			res.Body.Close()
  7731  		}
  7732  		return nil, gensupport.WrapError(&googleapi.Error{
  7733  			Code:   res.StatusCode,
  7734  			Header: res.Header,
  7735  		})
  7736  	}
  7737  	if err != nil {
  7738  		return nil, err
  7739  	}
  7740  	defer googleapi.CloseBody(res)
  7741  	if err := googleapi.CheckResponse(res); err != nil {
  7742  		return nil, gensupport.WrapError(err)
  7743  	}
  7744  	ret := &GoogleCloudRecommenderV1beta1ListRecommendationsResponse{
  7745  		ServerResponse: googleapi.ServerResponse{
  7746  			Header:         res.Header,
  7747  			HTTPStatusCode: res.StatusCode,
  7748  		},
  7749  	}
  7750  	target := &ret
  7751  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7752  		return nil, err
  7753  	}
  7754  	return ret, nil
  7755  }
  7756  
  7757  // Pages invokes f for each page of results.
  7758  // A non-nil error returned from f will halt the iteration.
  7759  // The provided context supersedes any context provided to the Context method.
  7760  func (c *ProjectsLocationsRecommendersRecommendationsListCall) Pages(ctx context.Context, f func(*GoogleCloudRecommenderV1beta1ListRecommendationsResponse) error) error {
  7761  	c.ctx_ = ctx
  7762  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  7763  	for {
  7764  		x, err := c.Do()
  7765  		if err != nil {
  7766  			return err
  7767  		}
  7768  		if err := f(x); err != nil {
  7769  			return err
  7770  		}
  7771  		if x.NextPageToken == "" {
  7772  			return nil
  7773  		}
  7774  		c.PageToken(x.NextPageToken)
  7775  	}
  7776  }
  7777  
  7778  type ProjectsLocationsRecommendersRecommendationsMarkClaimedCall struct {
  7779  	s                                                             *Service
  7780  	name                                                          string
  7781  	googlecloudrecommenderv1beta1markrecommendationclaimedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest
  7782  	urlParams_                                                    gensupport.URLParams
  7783  	ctx_                                                          context.Context
  7784  	header_                                                       http.Header
  7785  }
  7786  
  7787  // MarkClaimed: Marks the Recommendation State as Claimed. Users can use this
  7788  // method to indicate to the Recommender API that they are starting to apply
  7789  // the recommendation themselves. This stops the recommendation content from
  7790  // being updated. Associated insights are frozen and placed in the ACCEPTED
  7791  // state. MarkRecommendationClaimed can be applied to recommendations in
  7792  // CLAIMED or ACTIVE state. Requires the recommender.*.update IAM permission
  7793  // for the specified recommender.
  7794  //
  7795  // - name: Name of the recommendation.
  7796  func (r *ProjectsLocationsRecommendersRecommendationsService) MarkClaimed(name string, googlecloudrecommenderv1beta1markrecommendationclaimedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest) *ProjectsLocationsRecommendersRecommendationsMarkClaimedCall {
  7797  	c := &ProjectsLocationsRecommendersRecommendationsMarkClaimedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7798  	c.name = name
  7799  	c.googlecloudrecommenderv1beta1markrecommendationclaimedrequest = googlecloudrecommenderv1beta1markrecommendationclaimedrequest
  7800  	return c
  7801  }
  7802  
  7803  // Fields allows partial responses to be retrieved. See
  7804  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7805  // details.
  7806  func (c *ProjectsLocationsRecommendersRecommendationsMarkClaimedCall) Fields(s ...googleapi.Field) *ProjectsLocationsRecommendersRecommendationsMarkClaimedCall {
  7807  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7808  	return c
  7809  }
  7810  
  7811  // Context sets the context to be used in this call's Do method.
  7812  func (c *ProjectsLocationsRecommendersRecommendationsMarkClaimedCall) Context(ctx context.Context) *ProjectsLocationsRecommendersRecommendationsMarkClaimedCall {
  7813  	c.ctx_ = ctx
  7814  	return c
  7815  }
  7816  
  7817  // Header returns a http.Header that can be modified by the caller to add
  7818  // headers to the request.
  7819  func (c *ProjectsLocationsRecommendersRecommendationsMarkClaimedCall) Header() http.Header {
  7820  	if c.header_ == nil {
  7821  		c.header_ = make(http.Header)
  7822  	}
  7823  	return c.header_
  7824  }
  7825  
  7826  func (c *ProjectsLocationsRecommendersRecommendationsMarkClaimedCall) doRequest(alt string) (*http.Response, error) {
  7827  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  7828  	var body io.Reader = nil
  7829  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationclaimedrequest)
  7830  	if err != nil {
  7831  		return nil, err
  7832  	}
  7833  	c.urlParams_.Set("alt", alt)
  7834  	c.urlParams_.Set("prettyPrint", "false")
  7835  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markClaimed")
  7836  	urls += "?" + c.urlParams_.Encode()
  7837  	req, err := http.NewRequest("POST", urls, body)
  7838  	if err != nil {
  7839  		return nil, err
  7840  	}
  7841  	req.Header = reqHeaders
  7842  	googleapi.Expand(req.URL, map[string]string{
  7843  		"name": c.name,
  7844  	})
  7845  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7846  }
  7847  
  7848  // Do executes the "recommender.projects.locations.recommenders.recommendations.markClaimed" call.
  7849  // Any non-2xx status code is an error. Response headers are in either
  7850  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  7851  // response was returned at all) in error.(*googleapi.Error).Header. Use
  7852  // googleapi.IsNotModified to check whether the returned error was because
  7853  // http.StatusNotModified was returned.
  7854  func (c *ProjectsLocationsRecommendersRecommendationsMarkClaimedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  7855  	gensupport.SetOptions(c.urlParams_, opts...)
  7856  	res, err := c.doRequest("json")
  7857  	if res != nil && res.StatusCode == http.StatusNotModified {
  7858  		if res.Body != nil {
  7859  			res.Body.Close()
  7860  		}
  7861  		return nil, gensupport.WrapError(&googleapi.Error{
  7862  			Code:   res.StatusCode,
  7863  			Header: res.Header,
  7864  		})
  7865  	}
  7866  	if err != nil {
  7867  		return nil, err
  7868  	}
  7869  	defer googleapi.CloseBody(res)
  7870  	if err := googleapi.CheckResponse(res); err != nil {
  7871  		return nil, gensupport.WrapError(err)
  7872  	}
  7873  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  7874  		ServerResponse: googleapi.ServerResponse{
  7875  			Header:         res.Header,
  7876  			HTTPStatusCode: res.StatusCode,
  7877  		},
  7878  	}
  7879  	target := &ret
  7880  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7881  		return nil, err
  7882  	}
  7883  	return ret, nil
  7884  }
  7885  
  7886  type ProjectsLocationsRecommendersRecommendationsMarkDismissedCall struct {
  7887  	s                                                               *Service
  7888  	name                                                            string
  7889  	googlecloudrecommenderv1beta1markrecommendationdismissedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest
  7890  	urlParams_                                                      gensupport.URLParams
  7891  	ctx_                                                            context.Context
  7892  	header_                                                         http.Header
  7893  }
  7894  
  7895  // MarkDismissed: Mark the Recommendation State as Dismissed. Users can use
  7896  // this method to indicate to the Recommender API that an ACTIVE recommendation
  7897  // has to be marked back as DISMISSED. MarkRecommendationDismissed can be
  7898  // applied to recommendations in ACTIVE state. Requires the
  7899  // recommender.*.update IAM permission for the specified recommender.
  7900  //
  7901  // - name: Name of the recommendation.
  7902  func (r *ProjectsLocationsRecommendersRecommendationsService) MarkDismissed(name string, googlecloudrecommenderv1beta1markrecommendationdismissedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest) *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall {
  7903  	c := &ProjectsLocationsRecommendersRecommendationsMarkDismissedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7904  	c.name = name
  7905  	c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest = googlecloudrecommenderv1beta1markrecommendationdismissedrequest
  7906  	return c
  7907  }
  7908  
  7909  // Fields allows partial responses to be retrieved. See
  7910  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7911  // details.
  7912  func (c *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall) Fields(s ...googleapi.Field) *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall {
  7913  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7914  	return c
  7915  }
  7916  
  7917  // Context sets the context to be used in this call's Do method.
  7918  func (c *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall) Context(ctx context.Context) *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall {
  7919  	c.ctx_ = ctx
  7920  	return c
  7921  }
  7922  
  7923  // Header returns a http.Header that can be modified by the caller to add
  7924  // headers to the request.
  7925  func (c *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall) Header() http.Header {
  7926  	if c.header_ == nil {
  7927  		c.header_ = make(http.Header)
  7928  	}
  7929  	return c.header_
  7930  }
  7931  
  7932  func (c *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) {
  7933  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  7934  	var body io.Reader = nil
  7935  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest)
  7936  	if err != nil {
  7937  		return nil, err
  7938  	}
  7939  	c.urlParams_.Set("alt", alt)
  7940  	c.urlParams_.Set("prettyPrint", "false")
  7941  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markDismissed")
  7942  	urls += "?" + c.urlParams_.Encode()
  7943  	req, err := http.NewRequest("POST", urls, body)
  7944  	if err != nil {
  7945  		return nil, err
  7946  	}
  7947  	req.Header = reqHeaders
  7948  	googleapi.Expand(req.URL, map[string]string{
  7949  		"name": c.name,
  7950  	})
  7951  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7952  }
  7953  
  7954  // Do executes the "recommender.projects.locations.recommenders.recommendations.markDismissed" call.
  7955  // Any non-2xx status code is an error. Response headers are in either
  7956  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  7957  // response was returned at all) in error.(*googleapi.Error).Header. Use
  7958  // googleapi.IsNotModified to check whether the returned error was because
  7959  // http.StatusNotModified was returned.
  7960  func (c *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  7961  	gensupport.SetOptions(c.urlParams_, opts...)
  7962  	res, err := c.doRequest("json")
  7963  	if res != nil && res.StatusCode == http.StatusNotModified {
  7964  		if res.Body != nil {
  7965  			res.Body.Close()
  7966  		}
  7967  		return nil, gensupport.WrapError(&googleapi.Error{
  7968  			Code:   res.StatusCode,
  7969  			Header: res.Header,
  7970  		})
  7971  	}
  7972  	if err != nil {
  7973  		return nil, err
  7974  	}
  7975  	defer googleapi.CloseBody(res)
  7976  	if err := googleapi.CheckResponse(res); err != nil {
  7977  		return nil, gensupport.WrapError(err)
  7978  	}
  7979  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  7980  		ServerResponse: googleapi.ServerResponse{
  7981  			Header:         res.Header,
  7982  			HTTPStatusCode: res.StatusCode,
  7983  		},
  7984  	}
  7985  	target := &ret
  7986  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7987  		return nil, err
  7988  	}
  7989  	return ret, nil
  7990  }
  7991  
  7992  type ProjectsLocationsRecommendersRecommendationsMarkFailedCall struct {
  7993  	s                                                            *Service
  7994  	name                                                         string
  7995  	googlecloudrecommenderv1beta1markrecommendationfailedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest
  7996  	urlParams_                                                   gensupport.URLParams
  7997  	ctx_                                                         context.Context
  7998  	header_                                                      http.Header
  7999  }
  8000  
  8001  // MarkFailed: Marks the Recommendation State as Failed. Users can use this
  8002  // method to indicate to the Recommender API that they have applied the
  8003  // recommendation themselves, and the operation failed. This stops the
  8004  // recommendation content from being updated. Associated insights are frozen
  8005  // and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to
  8006  // recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the
  8007  // recommender.*.update IAM permission for the specified recommender.
  8008  //
  8009  // - name: Name of the recommendation.
  8010  func (r *ProjectsLocationsRecommendersRecommendationsService) MarkFailed(name string, googlecloudrecommenderv1beta1markrecommendationfailedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest) *ProjectsLocationsRecommendersRecommendationsMarkFailedCall {
  8011  	c := &ProjectsLocationsRecommendersRecommendationsMarkFailedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8012  	c.name = name
  8013  	c.googlecloudrecommenderv1beta1markrecommendationfailedrequest = googlecloudrecommenderv1beta1markrecommendationfailedrequest
  8014  	return c
  8015  }
  8016  
  8017  // Fields allows partial responses to be retrieved. See
  8018  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8019  // details.
  8020  func (c *ProjectsLocationsRecommendersRecommendationsMarkFailedCall) Fields(s ...googleapi.Field) *ProjectsLocationsRecommendersRecommendationsMarkFailedCall {
  8021  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8022  	return c
  8023  }
  8024  
  8025  // Context sets the context to be used in this call's Do method.
  8026  func (c *ProjectsLocationsRecommendersRecommendationsMarkFailedCall) Context(ctx context.Context) *ProjectsLocationsRecommendersRecommendationsMarkFailedCall {
  8027  	c.ctx_ = ctx
  8028  	return c
  8029  }
  8030  
  8031  // Header returns a http.Header that can be modified by the caller to add
  8032  // headers to the request.
  8033  func (c *ProjectsLocationsRecommendersRecommendationsMarkFailedCall) Header() http.Header {
  8034  	if c.header_ == nil {
  8035  		c.header_ = make(http.Header)
  8036  	}
  8037  	return c.header_
  8038  }
  8039  
  8040  func (c *ProjectsLocationsRecommendersRecommendationsMarkFailedCall) doRequest(alt string) (*http.Response, error) {
  8041  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  8042  	var body io.Reader = nil
  8043  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationfailedrequest)
  8044  	if err != nil {
  8045  		return nil, err
  8046  	}
  8047  	c.urlParams_.Set("alt", alt)
  8048  	c.urlParams_.Set("prettyPrint", "false")
  8049  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markFailed")
  8050  	urls += "?" + c.urlParams_.Encode()
  8051  	req, err := http.NewRequest("POST", urls, body)
  8052  	if err != nil {
  8053  		return nil, err
  8054  	}
  8055  	req.Header = reqHeaders
  8056  	googleapi.Expand(req.URL, map[string]string{
  8057  		"name": c.name,
  8058  	})
  8059  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8060  }
  8061  
  8062  // Do executes the "recommender.projects.locations.recommenders.recommendations.markFailed" call.
  8063  // Any non-2xx status code is an error. Response headers are in either
  8064  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  8065  // response was returned at all) in error.(*googleapi.Error).Header. Use
  8066  // googleapi.IsNotModified to check whether the returned error was because
  8067  // http.StatusNotModified was returned.
  8068  func (c *ProjectsLocationsRecommendersRecommendationsMarkFailedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  8069  	gensupport.SetOptions(c.urlParams_, opts...)
  8070  	res, err := c.doRequest("json")
  8071  	if res != nil && res.StatusCode == http.StatusNotModified {
  8072  		if res.Body != nil {
  8073  			res.Body.Close()
  8074  		}
  8075  		return nil, gensupport.WrapError(&googleapi.Error{
  8076  			Code:   res.StatusCode,
  8077  			Header: res.Header,
  8078  		})
  8079  	}
  8080  	if err != nil {
  8081  		return nil, err
  8082  	}
  8083  	defer googleapi.CloseBody(res)
  8084  	if err := googleapi.CheckResponse(res); err != nil {
  8085  		return nil, gensupport.WrapError(err)
  8086  	}
  8087  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  8088  		ServerResponse: googleapi.ServerResponse{
  8089  			Header:         res.Header,
  8090  			HTTPStatusCode: res.StatusCode,
  8091  		},
  8092  	}
  8093  	target := &ret
  8094  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8095  		return nil, err
  8096  	}
  8097  	return ret, nil
  8098  }
  8099  
  8100  type ProjectsLocationsRecommendersRecommendationsMarkSucceededCall struct {
  8101  	s                                                               *Service
  8102  	name                                                            string
  8103  	googlecloudrecommenderv1beta1markrecommendationsucceededrequest *GoogleCloudRecommenderV1beta1MarkRecommendationSucceededRequest
  8104  	urlParams_                                                      gensupport.URLParams
  8105  	ctx_                                                            context.Context
  8106  	header_                                                         http.Header
  8107  }
  8108  
  8109  // MarkSucceeded: Marks the Recommendation State as Succeeded. Users can use
  8110  // this method to indicate to the Recommender API that they have applied the
  8111  // recommendation themselves, and the operation was successful. This stops the
  8112  // recommendation content from being updated. Associated insights are frozen
  8113  // and placed in the ACCEPTED state. MarkRecommendationSucceeded can be applied
  8114  // to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires
  8115  // the recommender.*.update IAM permission for the specified recommender.
  8116  //
  8117  // - name: Name of the recommendation.
  8118  func (r *ProjectsLocationsRecommendersRecommendationsService) MarkSucceeded(name string, googlecloudrecommenderv1beta1markrecommendationsucceededrequest *GoogleCloudRecommenderV1beta1MarkRecommendationSucceededRequest) *ProjectsLocationsRecommendersRecommendationsMarkSucceededCall {
  8119  	c := &ProjectsLocationsRecommendersRecommendationsMarkSucceededCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8120  	c.name = name
  8121  	c.googlecloudrecommenderv1beta1markrecommendationsucceededrequest = googlecloudrecommenderv1beta1markrecommendationsucceededrequest
  8122  	return c
  8123  }
  8124  
  8125  // Fields allows partial responses to be retrieved. See
  8126  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8127  // details.
  8128  func (c *ProjectsLocationsRecommendersRecommendationsMarkSucceededCall) Fields(s ...googleapi.Field) *ProjectsLocationsRecommendersRecommendationsMarkSucceededCall {
  8129  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8130  	return c
  8131  }
  8132  
  8133  // Context sets the context to be used in this call's Do method.
  8134  func (c *ProjectsLocationsRecommendersRecommendationsMarkSucceededCall) Context(ctx context.Context) *ProjectsLocationsRecommendersRecommendationsMarkSucceededCall {
  8135  	c.ctx_ = ctx
  8136  	return c
  8137  }
  8138  
  8139  // Header returns a http.Header that can be modified by the caller to add
  8140  // headers to the request.
  8141  func (c *ProjectsLocationsRecommendersRecommendationsMarkSucceededCall) Header() http.Header {
  8142  	if c.header_ == nil {
  8143  		c.header_ = make(http.Header)
  8144  	}
  8145  	return c.header_
  8146  }
  8147  
  8148  func (c *ProjectsLocationsRecommendersRecommendationsMarkSucceededCall) doRequest(alt string) (*http.Response, error) {
  8149  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  8150  	var body io.Reader = nil
  8151  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationsucceededrequest)
  8152  	if err != nil {
  8153  		return nil, err
  8154  	}
  8155  	c.urlParams_.Set("alt", alt)
  8156  	c.urlParams_.Set("prettyPrint", "false")
  8157  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markSucceeded")
  8158  	urls += "?" + c.urlParams_.Encode()
  8159  	req, err := http.NewRequest("POST", urls, body)
  8160  	if err != nil {
  8161  		return nil, err
  8162  	}
  8163  	req.Header = reqHeaders
  8164  	googleapi.Expand(req.URL, map[string]string{
  8165  		"name": c.name,
  8166  	})
  8167  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8168  }
  8169  
  8170  // Do executes the "recommender.projects.locations.recommenders.recommendations.markSucceeded" call.
  8171  // Any non-2xx status code is an error. Response headers are in either
  8172  // *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or (if a
  8173  // response was returned at all) in error.(*googleapi.Error).Header. Use
  8174  // googleapi.IsNotModified to check whether the returned error was because
  8175  // http.StatusNotModified was returned.
  8176  func (c *ProjectsLocationsRecommendersRecommendationsMarkSucceededCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) {
  8177  	gensupport.SetOptions(c.urlParams_, opts...)
  8178  	res, err := c.doRequest("json")
  8179  	if res != nil && res.StatusCode == http.StatusNotModified {
  8180  		if res.Body != nil {
  8181  			res.Body.Close()
  8182  		}
  8183  		return nil, gensupport.WrapError(&googleapi.Error{
  8184  			Code:   res.StatusCode,
  8185  			Header: res.Header,
  8186  		})
  8187  	}
  8188  	if err != nil {
  8189  		return nil, err
  8190  	}
  8191  	defer googleapi.CloseBody(res)
  8192  	if err := googleapi.CheckResponse(res); err != nil {
  8193  		return nil, gensupport.WrapError(err)
  8194  	}
  8195  	ret := &GoogleCloudRecommenderV1beta1Recommendation{
  8196  		ServerResponse: googleapi.ServerResponse{
  8197  			Header:         res.Header,
  8198  			HTTPStatusCode: res.StatusCode,
  8199  		},
  8200  	}
  8201  	target := &ret
  8202  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8203  		return nil, err
  8204  	}
  8205  	return ret, nil
  8206  }
  8207  
  8208  type RecommendersListCall struct {
  8209  	s            *Service
  8210  	urlParams_   gensupport.URLParams
  8211  	ifNoneMatch_ string
  8212  	ctx_         context.Context
  8213  	header_      http.Header
  8214  }
  8215  
  8216  // List: Lists all available Recommenders. No IAM permissions are required.
  8217  func (r *RecommendersService) List() *RecommendersListCall {
  8218  	c := &RecommendersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8219  	return c
  8220  }
  8221  
  8222  // PageSize sets the optional parameter "pageSize": The number of
  8223  // RecommenderTypes to return per page. The service may return fewer than this
  8224  // value.
  8225  func (c *RecommendersListCall) PageSize(pageSize int64) *RecommendersListCall {
  8226  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8227  	return c
  8228  }
  8229  
  8230  // PageToken sets the optional parameter "pageToken": A page token, received
  8231  // from a previous `ListRecommenders` call. Provide this to retrieve the
  8232  // subsequent page.
  8233  func (c *RecommendersListCall) PageToken(pageToken string) *RecommendersListCall {
  8234  	c.urlParams_.Set("pageToken", pageToken)
  8235  	return c
  8236  }
  8237  
  8238  // Fields allows partial responses to be retrieved. See
  8239  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8240  // details.
  8241  func (c *RecommendersListCall) Fields(s ...googleapi.Field) *RecommendersListCall {
  8242  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8243  	return c
  8244  }
  8245  
  8246  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  8247  // object's ETag matches the given value. This is useful for getting updates
  8248  // only after the object has changed since the last request.
  8249  func (c *RecommendersListCall) IfNoneMatch(entityTag string) *RecommendersListCall {
  8250  	c.ifNoneMatch_ = entityTag
  8251  	return c
  8252  }
  8253  
  8254  // Context sets the context to be used in this call's Do method.
  8255  func (c *RecommendersListCall) Context(ctx context.Context) *RecommendersListCall {
  8256  	c.ctx_ = ctx
  8257  	return c
  8258  }
  8259  
  8260  // Header returns a http.Header that can be modified by the caller to add
  8261  // headers to the request.
  8262  func (c *RecommendersListCall) Header() http.Header {
  8263  	if c.header_ == nil {
  8264  		c.header_ = make(http.Header)
  8265  	}
  8266  	return c.header_
  8267  }
  8268  
  8269  func (c *RecommendersListCall) doRequest(alt string) (*http.Response, error) {
  8270  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  8271  	if c.ifNoneMatch_ != "" {
  8272  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8273  	}
  8274  	var body io.Reader = nil
  8275  	c.urlParams_.Set("alt", alt)
  8276  	c.urlParams_.Set("prettyPrint", "false")
  8277  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/recommenders")
  8278  	urls += "?" + c.urlParams_.Encode()
  8279  	req, err := http.NewRequest("GET", urls, body)
  8280  	if err != nil {
  8281  		return nil, err
  8282  	}
  8283  	req.Header = reqHeaders
  8284  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8285  }
  8286  
  8287  // Do executes the "recommender.recommenders.list" call.
  8288  // Any non-2xx status code is an error. Response headers are in either
  8289  // *GoogleCloudRecommenderV1beta1ListRecommendersResponse.ServerResponse.Header
  8290  // or (if a response was returned at all) in error.(*googleapi.Error).Header.
  8291  // Use googleapi.IsNotModified to check whether the returned error was because
  8292  // http.StatusNotModified was returned.
  8293  func (c *RecommendersListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1ListRecommendersResponse, error) {
  8294  	gensupport.SetOptions(c.urlParams_, opts...)
  8295  	res, err := c.doRequest("json")
  8296  	if res != nil && res.StatusCode == http.StatusNotModified {
  8297  		if res.Body != nil {
  8298  			res.Body.Close()
  8299  		}
  8300  		return nil, gensupport.WrapError(&googleapi.Error{
  8301  			Code:   res.StatusCode,
  8302  			Header: res.Header,
  8303  		})
  8304  	}
  8305  	if err != nil {
  8306  		return nil, err
  8307  	}
  8308  	defer googleapi.CloseBody(res)
  8309  	if err := googleapi.CheckResponse(res); err != nil {
  8310  		return nil, gensupport.WrapError(err)
  8311  	}
  8312  	ret := &GoogleCloudRecommenderV1beta1ListRecommendersResponse{
  8313  		ServerResponse: googleapi.ServerResponse{
  8314  			Header:         res.Header,
  8315  			HTTPStatusCode: res.StatusCode,
  8316  		},
  8317  	}
  8318  	target := &ret
  8319  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8320  		return nil, err
  8321  	}
  8322  	return ret, nil
  8323  }
  8324  
  8325  // Pages invokes f for each page of results.
  8326  // A non-nil error returned from f will halt the iteration.
  8327  // The provided context supersedes any context provided to the Context method.
  8328  func (c *RecommendersListCall) Pages(ctx context.Context, f func(*GoogleCloudRecommenderV1beta1ListRecommendersResponse) error) error {
  8329  	c.ctx_ = ctx
  8330  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  8331  	for {
  8332  		x, err := c.Do()
  8333  		if err != nil {
  8334  			return err
  8335  		}
  8336  		if err := f(x); err != nil {
  8337  			return err
  8338  		}
  8339  		if x.NextPageToken == "" {
  8340  			return nil
  8341  		}
  8342  		c.PageToken(x.NextPageToken)
  8343  	}
  8344  }
  8345  

View as plain text