...

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

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

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

View as plain text