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