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