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 resourcesettings
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 = "resourcesettings:v1"
90 const apiName = "resourcesettings"
91 const apiVersion = "v1"
92 const basePath = "https://resourcesettings.googleapis.com/"
93 const basePathTemplate = "https://resourcesettings.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://resourcesettings.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.Folders = NewFoldersService(s)
139 s.Organizations = NewOrganizationsService(s)
140 s.Projects = NewProjectsService(s)
141 return s, nil
142 }
143
144 type Service struct {
145 client *http.Client
146 BasePath string
147 UserAgent string
148
149 Folders *FoldersService
150
151 Organizations *OrganizationsService
152
153 Projects *ProjectsService
154 }
155
156 func (s *Service) userAgent() string {
157 if s.UserAgent == "" {
158 return googleapi.UserAgent
159 }
160 return googleapi.UserAgent + " " + s.UserAgent
161 }
162
163 func NewFoldersService(s *Service) *FoldersService {
164 rs := &FoldersService{s: s}
165 rs.Settings = NewFoldersSettingsService(s)
166 return rs
167 }
168
169 type FoldersService struct {
170 s *Service
171
172 Settings *FoldersSettingsService
173 }
174
175 func NewFoldersSettingsService(s *Service) *FoldersSettingsService {
176 rs := &FoldersSettingsService{s: s}
177 return rs
178 }
179
180 type FoldersSettingsService struct {
181 s *Service
182 }
183
184 func NewOrganizationsService(s *Service) *OrganizationsService {
185 rs := &OrganizationsService{s: s}
186 rs.Settings = NewOrganizationsSettingsService(s)
187 return rs
188 }
189
190 type OrganizationsService struct {
191 s *Service
192
193 Settings *OrganizationsSettingsService
194 }
195
196 func NewOrganizationsSettingsService(s *Service) *OrganizationsSettingsService {
197 rs := &OrganizationsSettingsService{s: s}
198 return rs
199 }
200
201 type OrganizationsSettingsService struct {
202 s *Service
203 }
204
205 func NewProjectsService(s *Service) *ProjectsService {
206 rs := &ProjectsService{s: s}
207 rs.Settings = NewProjectsSettingsService(s)
208 return rs
209 }
210
211 type ProjectsService struct {
212 s *Service
213
214 Settings *ProjectsSettingsService
215 }
216
217 func NewProjectsSettingsService(s *Service) *ProjectsSettingsService {
218 rs := &ProjectsSettingsService{s: s}
219 return rs
220 }
221
222 type ProjectsSettingsService struct {
223 s *Service
224 }
225
226
227
228 type GoogleCloudResourcesettingsV1ListSettingsResponse struct {
229
230 NextPageToken string `json:"nextPageToken,omitempty"`
231
232
233 Settings []*GoogleCloudResourcesettingsV1Setting `json:"settings,omitempty"`
234
235
236 googleapi.ServerResponse `json:"-"`
237
238
239
240
241
242 ForceSendFields []string `json:"-"`
243
244
245
246
247 NullFields []string `json:"-"`
248 }
249
250 func (s *GoogleCloudResourcesettingsV1ListSettingsResponse) MarshalJSON() ([]byte, error) {
251 type NoMethod GoogleCloudResourcesettingsV1ListSettingsResponse
252 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
253 }
254
255
256 type GoogleCloudResourcesettingsV1Setting struct {
257
258
259
260
261
262
263
264
265
266
267 EffectiveValue *GoogleCloudResourcesettingsV1Value `json:"effectiveValue,omitempty"`
268
269
270 Etag string `json:"etag,omitempty"`
271
272
273
274 LocalValue *GoogleCloudResourcesettingsV1Value `json:"localValue,omitempty"`
275
276
277 Metadata *GoogleCloudResourcesettingsV1SettingMetadata `json:"metadata,omitempty"`
278
279
280
281
282
283 Name string `json:"name,omitempty"`
284
285
286 googleapi.ServerResponse `json:"-"`
287
288
289
290
291
292 ForceSendFields []string `json:"-"`
293
294
295
296
297 NullFields []string `json:"-"`
298 }
299
300 func (s *GoogleCloudResourcesettingsV1Setting) MarshalJSON() ([]byte, error) {
301 type NoMethod GoogleCloudResourcesettingsV1Setting
302 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
303 }
304
305
306
307 type GoogleCloudResourcesettingsV1SettingMetadata struct {
308
309
310
311
312
313
314
315
316
317
318 DataType string `json:"dataType,omitempty"`
319
320
321 DefaultValue *GoogleCloudResourcesettingsV1Value `json:"defaultValue,omitempty"`
322
323 Description string `json:"description,omitempty"`
324
325 DisplayName string `json:"displayName,omitempty"`
326
327
328 ReadOnly bool `json:"readOnly,omitempty"`
329
330
331
332
333
334 ForceSendFields []string `json:"-"`
335
336
337
338
339 NullFields []string `json:"-"`
340 }
341
342 func (s *GoogleCloudResourcesettingsV1SettingMetadata) MarshalJSON() ([]byte, error) {
343 type NoMethod GoogleCloudResourcesettingsV1SettingMetadata
344 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
345 }
346
347
348 type GoogleCloudResourcesettingsV1Value struct {
349
350 BooleanValue bool `json:"booleanValue,omitempty"`
351
352 DurationValue string `json:"durationValue,omitempty"`
353
354 EnumValue *GoogleCloudResourcesettingsV1ValueEnumValue `json:"enumValue,omitempty"`
355
356 StringMapValue *GoogleCloudResourcesettingsV1ValueStringMap `json:"stringMapValue,omitempty"`
357
358 StringSetValue *GoogleCloudResourcesettingsV1ValueStringSet `json:"stringSetValue,omitempty"`
359
360 StringValue string `json:"stringValue,omitempty"`
361
362
363
364
365
366 ForceSendFields []string `json:"-"`
367
368
369
370
371 NullFields []string `json:"-"`
372 }
373
374 func (s *GoogleCloudResourcesettingsV1Value) MarshalJSON() ([]byte, error) {
375 type NoMethod GoogleCloudResourcesettingsV1Value
376 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
377 }
378
379
380
381
382 type GoogleCloudResourcesettingsV1ValueEnumValue struct {
383
384 Value string `json:"value,omitempty"`
385
386
387
388
389
390 ForceSendFields []string `json:"-"`
391
392
393
394
395 NullFields []string `json:"-"`
396 }
397
398 func (s *GoogleCloudResourcesettingsV1ValueEnumValue) MarshalJSON() ([]byte, error) {
399 type NoMethod GoogleCloudResourcesettingsV1ValueEnumValue
400 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
401 }
402
403
404
405
406
407 type GoogleCloudResourcesettingsV1ValueStringMap struct {
408
409 Mappings map[string]string `json:"mappings,omitempty"`
410
411
412
413
414
415 ForceSendFields []string `json:"-"`
416
417
418
419
420 NullFields []string `json:"-"`
421 }
422
423 func (s *GoogleCloudResourcesettingsV1ValueStringMap) MarshalJSON() ([]byte, error) {
424 type NoMethod GoogleCloudResourcesettingsV1ValueStringMap
425 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
426 }
427
428
429
430
431 type GoogleCloudResourcesettingsV1ValueStringSet struct {
432
433 Values []string `json:"values,omitempty"`
434
435
436
437
438
439 ForceSendFields []string `json:"-"`
440
441
442
443
444 NullFields []string `json:"-"`
445 }
446
447 func (s *GoogleCloudResourcesettingsV1ValueStringSet) MarshalJSON() ([]byte, error) {
448 type NoMethod GoogleCloudResourcesettingsV1ValueStringSet
449 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
450 }
451
452 type FoldersSettingsGetCall struct {
453 s *Service
454 name string
455 urlParams_ gensupport.URLParams
456 ifNoneMatch_ string
457 ctx_ context.Context
458 header_ http.Header
459 }
460
461
462
463
464
465 func (r *FoldersSettingsService) Get(name string) *FoldersSettingsGetCall {
466 c := &FoldersSettingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
467 c.name = name
468 return c
469 }
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490 func (c *FoldersSettingsGetCall) View(view string) *FoldersSettingsGetCall {
491 c.urlParams_.Set("view", view)
492 return c
493 }
494
495
496
497
498 func (c *FoldersSettingsGetCall) Fields(s ...googleapi.Field) *FoldersSettingsGetCall {
499 c.urlParams_.Set("fields", googleapi.CombineFields(s))
500 return c
501 }
502
503
504
505
506 func (c *FoldersSettingsGetCall) IfNoneMatch(entityTag string) *FoldersSettingsGetCall {
507 c.ifNoneMatch_ = entityTag
508 return c
509 }
510
511
512 func (c *FoldersSettingsGetCall) Context(ctx context.Context) *FoldersSettingsGetCall {
513 c.ctx_ = ctx
514 return c
515 }
516
517
518
519 func (c *FoldersSettingsGetCall) Header() http.Header {
520 if c.header_ == nil {
521 c.header_ = make(http.Header)
522 }
523 return c.header_
524 }
525
526 func (c *FoldersSettingsGetCall) doRequest(alt string) (*http.Response, error) {
527 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
528 if c.ifNoneMatch_ != "" {
529 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
530 }
531 var body io.Reader = nil
532 c.urlParams_.Set("alt", alt)
533 c.urlParams_.Set("prettyPrint", "false")
534 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
535 urls += "?" + c.urlParams_.Encode()
536 req, err := http.NewRequest("GET", urls, body)
537 if err != nil {
538 return nil, err
539 }
540 req.Header = reqHeaders
541 googleapi.Expand(req.URL, map[string]string{
542 "name": c.name,
543 })
544 return gensupport.SendRequest(c.ctx_, c.s.client, req)
545 }
546
547
548
549
550
551
552
553 func (c *FoldersSettingsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudResourcesettingsV1Setting, error) {
554 gensupport.SetOptions(c.urlParams_, opts...)
555 res, err := c.doRequest("json")
556 if res != nil && res.StatusCode == http.StatusNotModified {
557 if res.Body != nil {
558 res.Body.Close()
559 }
560 return nil, gensupport.WrapError(&googleapi.Error{
561 Code: res.StatusCode,
562 Header: res.Header,
563 })
564 }
565 if err != nil {
566 return nil, err
567 }
568 defer googleapi.CloseBody(res)
569 if err := googleapi.CheckResponse(res); err != nil {
570 return nil, gensupport.WrapError(err)
571 }
572 ret := &GoogleCloudResourcesettingsV1Setting{
573 ServerResponse: googleapi.ServerResponse{
574 Header: res.Header,
575 HTTPStatusCode: res.StatusCode,
576 },
577 }
578 target := &ret
579 if err := gensupport.DecodeResponse(target, res); err != nil {
580 return nil, err
581 }
582 return ret, nil
583 }
584
585 type FoldersSettingsListCall struct {
586 s *Service
587 parent string
588 urlParams_ gensupport.URLParams
589 ifNoneMatch_ string
590 ctx_ context.Context
591 header_ http.Header
592 }
593
594
595
596
597
598
599
600
601 func (r *FoldersSettingsService) List(parent string) *FoldersSettingsListCall {
602 c := &FoldersSettingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
603 c.parent = parent
604 return c
605 }
606
607
608
609 func (c *FoldersSettingsListCall) PageSize(pageSize int64) *FoldersSettingsListCall {
610 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
611 return c
612 }
613
614
615
616 func (c *FoldersSettingsListCall) PageToken(pageToken string) *FoldersSettingsListCall {
617 c.urlParams_.Set("pageToken", pageToken)
618 return c
619 }
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640 func (c *FoldersSettingsListCall) View(view string) *FoldersSettingsListCall {
641 c.urlParams_.Set("view", view)
642 return c
643 }
644
645
646
647
648 func (c *FoldersSettingsListCall) Fields(s ...googleapi.Field) *FoldersSettingsListCall {
649 c.urlParams_.Set("fields", googleapi.CombineFields(s))
650 return c
651 }
652
653
654
655
656 func (c *FoldersSettingsListCall) IfNoneMatch(entityTag string) *FoldersSettingsListCall {
657 c.ifNoneMatch_ = entityTag
658 return c
659 }
660
661
662 func (c *FoldersSettingsListCall) Context(ctx context.Context) *FoldersSettingsListCall {
663 c.ctx_ = ctx
664 return c
665 }
666
667
668
669 func (c *FoldersSettingsListCall) Header() http.Header {
670 if c.header_ == nil {
671 c.header_ = make(http.Header)
672 }
673 return c.header_
674 }
675
676 func (c *FoldersSettingsListCall) doRequest(alt string) (*http.Response, error) {
677 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
678 if c.ifNoneMatch_ != "" {
679 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
680 }
681 var body io.Reader = nil
682 c.urlParams_.Set("alt", alt)
683 c.urlParams_.Set("prettyPrint", "false")
684 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/settings")
685 urls += "?" + c.urlParams_.Encode()
686 req, err := http.NewRequest("GET", urls, body)
687 if err != nil {
688 return nil, err
689 }
690 req.Header = reqHeaders
691 googleapi.Expand(req.URL, map[string]string{
692 "parent": c.parent,
693 })
694 return gensupport.SendRequest(c.ctx_, c.s.client, req)
695 }
696
697
698
699
700
701
702
703 func (c *FoldersSettingsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudResourcesettingsV1ListSettingsResponse, error) {
704 gensupport.SetOptions(c.urlParams_, opts...)
705 res, err := c.doRequest("json")
706 if res != nil && res.StatusCode == http.StatusNotModified {
707 if res.Body != nil {
708 res.Body.Close()
709 }
710 return nil, gensupport.WrapError(&googleapi.Error{
711 Code: res.StatusCode,
712 Header: res.Header,
713 })
714 }
715 if err != nil {
716 return nil, err
717 }
718 defer googleapi.CloseBody(res)
719 if err := googleapi.CheckResponse(res); err != nil {
720 return nil, gensupport.WrapError(err)
721 }
722 ret := &GoogleCloudResourcesettingsV1ListSettingsResponse{
723 ServerResponse: googleapi.ServerResponse{
724 Header: res.Header,
725 HTTPStatusCode: res.StatusCode,
726 },
727 }
728 target := &ret
729 if err := gensupport.DecodeResponse(target, res); err != nil {
730 return nil, err
731 }
732 return ret, nil
733 }
734
735
736
737
738 func (c *FoldersSettingsListCall) Pages(ctx context.Context, f func(*GoogleCloudResourcesettingsV1ListSettingsResponse) error) error {
739 c.ctx_ = ctx
740 defer c.PageToken(c.urlParams_.Get("pageToken"))
741 for {
742 x, err := c.Do()
743 if err != nil {
744 return err
745 }
746 if err := f(x); err != nil {
747 return err
748 }
749 if x.NextPageToken == "" {
750 return nil
751 }
752 c.PageToken(x.NextPageToken)
753 }
754 }
755
756 type FoldersSettingsPatchCall struct {
757 s *Service
758 name string
759 googlecloudresourcesettingsv1setting *GoogleCloudResourcesettingsV1Setting
760 urlParams_ gensupport.URLParams
761 ctx_ context.Context
762 header_ http.Header
763 }
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780 func (r *FoldersSettingsService) Patch(name string, googlecloudresourcesettingsv1setting *GoogleCloudResourcesettingsV1Setting) *FoldersSettingsPatchCall {
781 c := &FoldersSettingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
782 c.name = name
783 c.googlecloudresourcesettingsv1setting = googlecloudresourcesettingsv1setting
784 return c
785 }
786
787
788
789
790 func (c *FoldersSettingsPatchCall) Fields(s ...googleapi.Field) *FoldersSettingsPatchCall {
791 c.urlParams_.Set("fields", googleapi.CombineFields(s))
792 return c
793 }
794
795
796 func (c *FoldersSettingsPatchCall) Context(ctx context.Context) *FoldersSettingsPatchCall {
797 c.ctx_ = ctx
798 return c
799 }
800
801
802
803 func (c *FoldersSettingsPatchCall) Header() http.Header {
804 if c.header_ == nil {
805 c.header_ = make(http.Header)
806 }
807 return c.header_
808 }
809
810 func (c *FoldersSettingsPatchCall) doRequest(alt string) (*http.Response, error) {
811 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
812 var body io.Reader = nil
813 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudresourcesettingsv1setting)
814 if err != nil {
815 return nil, err
816 }
817 c.urlParams_.Set("alt", alt)
818 c.urlParams_.Set("prettyPrint", "false")
819 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
820 urls += "?" + c.urlParams_.Encode()
821 req, err := http.NewRequest("PATCH", urls, body)
822 if err != nil {
823 return nil, err
824 }
825 req.Header = reqHeaders
826 googleapi.Expand(req.URL, map[string]string{
827 "name": c.name,
828 })
829 return gensupport.SendRequest(c.ctx_, c.s.client, req)
830 }
831
832
833
834
835
836
837
838 func (c *FoldersSettingsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudResourcesettingsV1Setting, error) {
839 gensupport.SetOptions(c.urlParams_, opts...)
840 res, err := c.doRequest("json")
841 if res != nil && res.StatusCode == http.StatusNotModified {
842 if res.Body != nil {
843 res.Body.Close()
844 }
845 return nil, gensupport.WrapError(&googleapi.Error{
846 Code: res.StatusCode,
847 Header: res.Header,
848 })
849 }
850 if err != nil {
851 return nil, err
852 }
853 defer googleapi.CloseBody(res)
854 if err := googleapi.CheckResponse(res); err != nil {
855 return nil, gensupport.WrapError(err)
856 }
857 ret := &GoogleCloudResourcesettingsV1Setting{
858 ServerResponse: googleapi.ServerResponse{
859 Header: res.Header,
860 HTTPStatusCode: res.StatusCode,
861 },
862 }
863 target := &ret
864 if err := gensupport.DecodeResponse(target, res); err != nil {
865 return nil, err
866 }
867 return ret, nil
868 }
869
870 type OrganizationsSettingsGetCall struct {
871 s *Service
872 name string
873 urlParams_ gensupport.URLParams
874 ifNoneMatch_ string
875 ctx_ context.Context
876 header_ http.Header
877 }
878
879
880
881
882
883 func (r *OrganizationsSettingsService) Get(name string) *OrganizationsSettingsGetCall {
884 c := &OrganizationsSettingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
885 c.name = name
886 return c
887 }
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908 func (c *OrganizationsSettingsGetCall) View(view string) *OrganizationsSettingsGetCall {
909 c.urlParams_.Set("view", view)
910 return c
911 }
912
913
914
915
916 func (c *OrganizationsSettingsGetCall) Fields(s ...googleapi.Field) *OrganizationsSettingsGetCall {
917 c.urlParams_.Set("fields", googleapi.CombineFields(s))
918 return c
919 }
920
921
922
923
924 func (c *OrganizationsSettingsGetCall) IfNoneMatch(entityTag string) *OrganizationsSettingsGetCall {
925 c.ifNoneMatch_ = entityTag
926 return c
927 }
928
929
930 func (c *OrganizationsSettingsGetCall) Context(ctx context.Context) *OrganizationsSettingsGetCall {
931 c.ctx_ = ctx
932 return c
933 }
934
935
936
937 func (c *OrganizationsSettingsGetCall) Header() http.Header {
938 if c.header_ == nil {
939 c.header_ = make(http.Header)
940 }
941 return c.header_
942 }
943
944 func (c *OrganizationsSettingsGetCall) doRequest(alt string) (*http.Response, error) {
945 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
946 if c.ifNoneMatch_ != "" {
947 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
948 }
949 var body io.Reader = nil
950 c.urlParams_.Set("alt", alt)
951 c.urlParams_.Set("prettyPrint", "false")
952 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
953 urls += "?" + c.urlParams_.Encode()
954 req, err := http.NewRequest("GET", urls, body)
955 if err != nil {
956 return nil, err
957 }
958 req.Header = reqHeaders
959 googleapi.Expand(req.URL, map[string]string{
960 "name": c.name,
961 })
962 return gensupport.SendRequest(c.ctx_, c.s.client, req)
963 }
964
965
966
967
968
969
970
971 func (c *OrganizationsSettingsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudResourcesettingsV1Setting, error) {
972 gensupport.SetOptions(c.urlParams_, opts...)
973 res, err := c.doRequest("json")
974 if res != nil && res.StatusCode == http.StatusNotModified {
975 if res.Body != nil {
976 res.Body.Close()
977 }
978 return nil, gensupport.WrapError(&googleapi.Error{
979 Code: res.StatusCode,
980 Header: res.Header,
981 })
982 }
983 if err != nil {
984 return nil, err
985 }
986 defer googleapi.CloseBody(res)
987 if err := googleapi.CheckResponse(res); err != nil {
988 return nil, gensupport.WrapError(err)
989 }
990 ret := &GoogleCloudResourcesettingsV1Setting{
991 ServerResponse: googleapi.ServerResponse{
992 Header: res.Header,
993 HTTPStatusCode: res.StatusCode,
994 },
995 }
996 target := &ret
997 if err := gensupport.DecodeResponse(target, res); err != nil {
998 return nil, err
999 }
1000 return ret, nil
1001 }
1002
1003 type OrganizationsSettingsListCall struct {
1004 s *Service
1005 parent string
1006 urlParams_ gensupport.URLParams
1007 ifNoneMatch_ string
1008 ctx_ context.Context
1009 header_ http.Header
1010 }
1011
1012
1013
1014
1015
1016
1017
1018
1019 func (r *OrganizationsSettingsService) List(parent string) *OrganizationsSettingsListCall {
1020 c := &OrganizationsSettingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1021 c.parent = parent
1022 return c
1023 }
1024
1025
1026
1027 func (c *OrganizationsSettingsListCall) PageSize(pageSize int64) *OrganizationsSettingsListCall {
1028 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1029 return c
1030 }
1031
1032
1033
1034 func (c *OrganizationsSettingsListCall) PageToken(pageToken string) *OrganizationsSettingsListCall {
1035 c.urlParams_.Set("pageToken", pageToken)
1036 return c
1037 }
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058 func (c *OrganizationsSettingsListCall) View(view string) *OrganizationsSettingsListCall {
1059 c.urlParams_.Set("view", view)
1060 return c
1061 }
1062
1063
1064
1065
1066 func (c *OrganizationsSettingsListCall) Fields(s ...googleapi.Field) *OrganizationsSettingsListCall {
1067 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1068 return c
1069 }
1070
1071
1072
1073
1074 func (c *OrganizationsSettingsListCall) IfNoneMatch(entityTag string) *OrganizationsSettingsListCall {
1075 c.ifNoneMatch_ = entityTag
1076 return c
1077 }
1078
1079
1080 func (c *OrganizationsSettingsListCall) Context(ctx context.Context) *OrganizationsSettingsListCall {
1081 c.ctx_ = ctx
1082 return c
1083 }
1084
1085
1086
1087 func (c *OrganizationsSettingsListCall) Header() http.Header {
1088 if c.header_ == nil {
1089 c.header_ = make(http.Header)
1090 }
1091 return c.header_
1092 }
1093
1094 func (c *OrganizationsSettingsListCall) doRequest(alt string) (*http.Response, error) {
1095 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1096 if c.ifNoneMatch_ != "" {
1097 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1098 }
1099 var body io.Reader = nil
1100 c.urlParams_.Set("alt", alt)
1101 c.urlParams_.Set("prettyPrint", "false")
1102 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/settings")
1103 urls += "?" + c.urlParams_.Encode()
1104 req, err := http.NewRequest("GET", urls, body)
1105 if err != nil {
1106 return nil, err
1107 }
1108 req.Header = reqHeaders
1109 googleapi.Expand(req.URL, map[string]string{
1110 "parent": c.parent,
1111 })
1112 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1113 }
1114
1115
1116
1117
1118
1119
1120
1121 func (c *OrganizationsSettingsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudResourcesettingsV1ListSettingsResponse, error) {
1122 gensupport.SetOptions(c.urlParams_, opts...)
1123 res, err := c.doRequest("json")
1124 if res != nil && res.StatusCode == http.StatusNotModified {
1125 if res.Body != nil {
1126 res.Body.Close()
1127 }
1128 return nil, gensupport.WrapError(&googleapi.Error{
1129 Code: res.StatusCode,
1130 Header: res.Header,
1131 })
1132 }
1133 if err != nil {
1134 return nil, err
1135 }
1136 defer googleapi.CloseBody(res)
1137 if err := googleapi.CheckResponse(res); err != nil {
1138 return nil, gensupport.WrapError(err)
1139 }
1140 ret := &GoogleCloudResourcesettingsV1ListSettingsResponse{
1141 ServerResponse: googleapi.ServerResponse{
1142 Header: res.Header,
1143 HTTPStatusCode: res.StatusCode,
1144 },
1145 }
1146 target := &ret
1147 if err := gensupport.DecodeResponse(target, res); err != nil {
1148 return nil, err
1149 }
1150 return ret, nil
1151 }
1152
1153
1154
1155
1156 func (c *OrganizationsSettingsListCall) Pages(ctx context.Context, f func(*GoogleCloudResourcesettingsV1ListSettingsResponse) error) error {
1157 c.ctx_ = ctx
1158 defer c.PageToken(c.urlParams_.Get("pageToken"))
1159 for {
1160 x, err := c.Do()
1161 if err != nil {
1162 return err
1163 }
1164 if err := f(x); err != nil {
1165 return err
1166 }
1167 if x.NextPageToken == "" {
1168 return nil
1169 }
1170 c.PageToken(x.NextPageToken)
1171 }
1172 }
1173
1174 type OrganizationsSettingsPatchCall struct {
1175 s *Service
1176 name string
1177 googlecloudresourcesettingsv1setting *GoogleCloudResourcesettingsV1Setting
1178 urlParams_ gensupport.URLParams
1179 ctx_ context.Context
1180 header_ http.Header
1181 }
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198 func (r *OrganizationsSettingsService) Patch(name string, googlecloudresourcesettingsv1setting *GoogleCloudResourcesettingsV1Setting) *OrganizationsSettingsPatchCall {
1199 c := &OrganizationsSettingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1200 c.name = name
1201 c.googlecloudresourcesettingsv1setting = googlecloudresourcesettingsv1setting
1202 return c
1203 }
1204
1205
1206
1207
1208 func (c *OrganizationsSettingsPatchCall) Fields(s ...googleapi.Field) *OrganizationsSettingsPatchCall {
1209 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1210 return c
1211 }
1212
1213
1214 func (c *OrganizationsSettingsPatchCall) Context(ctx context.Context) *OrganizationsSettingsPatchCall {
1215 c.ctx_ = ctx
1216 return c
1217 }
1218
1219
1220
1221 func (c *OrganizationsSettingsPatchCall) Header() http.Header {
1222 if c.header_ == nil {
1223 c.header_ = make(http.Header)
1224 }
1225 return c.header_
1226 }
1227
1228 func (c *OrganizationsSettingsPatchCall) doRequest(alt string) (*http.Response, error) {
1229 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1230 var body io.Reader = nil
1231 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudresourcesettingsv1setting)
1232 if err != nil {
1233 return nil, err
1234 }
1235 c.urlParams_.Set("alt", alt)
1236 c.urlParams_.Set("prettyPrint", "false")
1237 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1238 urls += "?" + c.urlParams_.Encode()
1239 req, err := http.NewRequest("PATCH", urls, body)
1240 if err != nil {
1241 return nil, err
1242 }
1243 req.Header = reqHeaders
1244 googleapi.Expand(req.URL, map[string]string{
1245 "name": c.name,
1246 })
1247 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1248 }
1249
1250
1251
1252
1253
1254
1255
1256 func (c *OrganizationsSettingsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudResourcesettingsV1Setting, error) {
1257 gensupport.SetOptions(c.urlParams_, opts...)
1258 res, err := c.doRequest("json")
1259 if res != nil && res.StatusCode == http.StatusNotModified {
1260 if res.Body != nil {
1261 res.Body.Close()
1262 }
1263 return nil, gensupport.WrapError(&googleapi.Error{
1264 Code: res.StatusCode,
1265 Header: res.Header,
1266 })
1267 }
1268 if err != nil {
1269 return nil, err
1270 }
1271 defer googleapi.CloseBody(res)
1272 if err := googleapi.CheckResponse(res); err != nil {
1273 return nil, gensupport.WrapError(err)
1274 }
1275 ret := &GoogleCloudResourcesettingsV1Setting{
1276 ServerResponse: googleapi.ServerResponse{
1277 Header: res.Header,
1278 HTTPStatusCode: res.StatusCode,
1279 },
1280 }
1281 target := &ret
1282 if err := gensupport.DecodeResponse(target, res); err != nil {
1283 return nil, err
1284 }
1285 return ret, nil
1286 }
1287
1288 type ProjectsSettingsGetCall struct {
1289 s *Service
1290 name string
1291 urlParams_ gensupport.URLParams
1292 ifNoneMatch_ string
1293 ctx_ context.Context
1294 header_ http.Header
1295 }
1296
1297
1298
1299
1300
1301 func (r *ProjectsSettingsService) Get(name string) *ProjectsSettingsGetCall {
1302 c := &ProjectsSettingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1303 c.name = name
1304 return c
1305 }
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326 func (c *ProjectsSettingsGetCall) View(view string) *ProjectsSettingsGetCall {
1327 c.urlParams_.Set("view", view)
1328 return c
1329 }
1330
1331
1332
1333
1334 func (c *ProjectsSettingsGetCall) Fields(s ...googleapi.Field) *ProjectsSettingsGetCall {
1335 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1336 return c
1337 }
1338
1339
1340
1341
1342 func (c *ProjectsSettingsGetCall) IfNoneMatch(entityTag string) *ProjectsSettingsGetCall {
1343 c.ifNoneMatch_ = entityTag
1344 return c
1345 }
1346
1347
1348 func (c *ProjectsSettingsGetCall) Context(ctx context.Context) *ProjectsSettingsGetCall {
1349 c.ctx_ = ctx
1350 return c
1351 }
1352
1353
1354
1355 func (c *ProjectsSettingsGetCall) Header() http.Header {
1356 if c.header_ == nil {
1357 c.header_ = make(http.Header)
1358 }
1359 return c.header_
1360 }
1361
1362 func (c *ProjectsSettingsGetCall) doRequest(alt string) (*http.Response, error) {
1363 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1364 if c.ifNoneMatch_ != "" {
1365 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1366 }
1367 var body io.Reader = nil
1368 c.urlParams_.Set("alt", alt)
1369 c.urlParams_.Set("prettyPrint", "false")
1370 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1371 urls += "?" + c.urlParams_.Encode()
1372 req, err := http.NewRequest("GET", urls, body)
1373 if err != nil {
1374 return nil, err
1375 }
1376 req.Header = reqHeaders
1377 googleapi.Expand(req.URL, map[string]string{
1378 "name": c.name,
1379 })
1380 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1381 }
1382
1383
1384
1385
1386
1387
1388
1389 func (c *ProjectsSettingsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudResourcesettingsV1Setting, error) {
1390 gensupport.SetOptions(c.urlParams_, opts...)
1391 res, err := c.doRequest("json")
1392 if res != nil && res.StatusCode == http.StatusNotModified {
1393 if res.Body != nil {
1394 res.Body.Close()
1395 }
1396 return nil, gensupport.WrapError(&googleapi.Error{
1397 Code: res.StatusCode,
1398 Header: res.Header,
1399 })
1400 }
1401 if err != nil {
1402 return nil, err
1403 }
1404 defer googleapi.CloseBody(res)
1405 if err := googleapi.CheckResponse(res); err != nil {
1406 return nil, gensupport.WrapError(err)
1407 }
1408 ret := &GoogleCloudResourcesettingsV1Setting{
1409 ServerResponse: googleapi.ServerResponse{
1410 Header: res.Header,
1411 HTTPStatusCode: res.StatusCode,
1412 },
1413 }
1414 target := &ret
1415 if err := gensupport.DecodeResponse(target, res); err != nil {
1416 return nil, err
1417 }
1418 return ret, nil
1419 }
1420
1421 type ProjectsSettingsListCall struct {
1422 s *Service
1423 parent string
1424 urlParams_ gensupport.URLParams
1425 ifNoneMatch_ string
1426 ctx_ context.Context
1427 header_ http.Header
1428 }
1429
1430
1431
1432
1433
1434
1435
1436
1437 func (r *ProjectsSettingsService) List(parent string) *ProjectsSettingsListCall {
1438 c := &ProjectsSettingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1439 c.parent = parent
1440 return c
1441 }
1442
1443
1444
1445 func (c *ProjectsSettingsListCall) PageSize(pageSize int64) *ProjectsSettingsListCall {
1446 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1447 return c
1448 }
1449
1450
1451
1452 func (c *ProjectsSettingsListCall) PageToken(pageToken string) *ProjectsSettingsListCall {
1453 c.urlParams_.Set("pageToken", pageToken)
1454 return c
1455 }
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476 func (c *ProjectsSettingsListCall) View(view string) *ProjectsSettingsListCall {
1477 c.urlParams_.Set("view", view)
1478 return c
1479 }
1480
1481
1482
1483
1484 func (c *ProjectsSettingsListCall) Fields(s ...googleapi.Field) *ProjectsSettingsListCall {
1485 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1486 return c
1487 }
1488
1489
1490
1491
1492 func (c *ProjectsSettingsListCall) IfNoneMatch(entityTag string) *ProjectsSettingsListCall {
1493 c.ifNoneMatch_ = entityTag
1494 return c
1495 }
1496
1497
1498 func (c *ProjectsSettingsListCall) Context(ctx context.Context) *ProjectsSettingsListCall {
1499 c.ctx_ = ctx
1500 return c
1501 }
1502
1503
1504
1505 func (c *ProjectsSettingsListCall) Header() http.Header {
1506 if c.header_ == nil {
1507 c.header_ = make(http.Header)
1508 }
1509 return c.header_
1510 }
1511
1512 func (c *ProjectsSettingsListCall) doRequest(alt string) (*http.Response, error) {
1513 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1514 if c.ifNoneMatch_ != "" {
1515 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1516 }
1517 var body io.Reader = nil
1518 c.urlParams_.Set("alt", alt)
1519 c.urlParams_.Set("prettyPrint", "false")
1520 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/settings")
1521 urls += "?" + c.urlParams_.Encode()
1522 req, err := http.NewRequest("GET", urls, body)
1523 if err != nil {
1524 return nil, err
1525 }
1526 req.Header = reqHeaders
1527 googleapi.Expand(req.URL, map[string]string{
1528 "parent": c.parent,
1529 })
1530 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1531 }
1532
1533
1534
1535
1536
1537
1538
1539 func (c *ProjectsSettingsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudResourcesettingsV1ListSettingsResponse, error) {
1540 gensupport.SetOptions(c.urlParams_, opts...)
1541 res, err := c.doRequest("json")
1542 if res != nil && res.StatusCode == http.StatusNotModified {
1543 if res.Body != nil {
1544 res.Body.Close()
1545 }
1546 return nil, gensupport.WrapError(&googleapi.Error{
1547 Code: res.StatusCode,
1548 Header: res.Header,
1549 })
1550 }
1551 if err != nil {
1552 return nil, err
1553 }
1554 defer googleapi.CloseBody(res)
1555 if err := googleapi.CheckResponse(res); err != nil {
1556 return nil, gensupport.WrapError(err)
1557 }
1558 ret := &GoogleCloudResourcesettingsV1ListSettingsResponse{
1559 ServerResponse: googleapi.ServerResponse{
1560 Header: res.Header,
1561 HTTPStatusCode: res.StatusCode,
1562 },
1563 }
1564 target := &ret
1565 if err := gensupport.DecodeResponse(target, res); err != nil {
1566 return nil, err
1567 }
1568 return ret, nil
1569 }
1570
1571
1572
1573
1574 func (c *ProjectsSettingsListCall) Pages(ctx context.Context, f func(*GoogleCloudResourcesettingsV1ListSettingsResponse) error) error {
1575 c.ctx_ = ctx
1576 defer c.PageToken(c.urlParams_.Get("pageToken"))
1577 for {
1578 x, err := c.Do()
1579 if err != nil {
1580 return err
1581 }
1582 if err := f(x); err != nil {
1583 return err
1584 }
1585 if x.NextPageToken == "" {
1586 return nil
1587 }
1588 c.PageToken(x.NextPageToken)
1589 }
1590 }
1591
1592 type ProjectsSettingsPatchCall struct {
1593 s *Service
1594 name string
1595 googlecloudresourcesettingsv1setting *GoogleCloudResourcesettingsV1Setting
1596 urlParams_ gensupport.URLParams
1597 ctx_ context.Context
1598 header_ http.Header
1599 }
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616 func (r *ProjectsSettingsService) Patch(name string, googlecloudresourcesettingsv1setting *GoogleCloudResourcesettingsV1Setting) *ProjectsSettingsPatchCall {
1617 c := &ProjectsSettingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1618 c.name = name
1619 c.googlecloudresourcesettingsv1setting = googlecloudresourcesettingsv1setting
1620 return c
1621 }
1622
1623
1624
1625
1626 func (c *ProjectsSettingsPatchCall) Fields(s ...googleapi.Field) *ProjectsSettingsPatchCall {
1627 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1628 return c
1629 }
1630
1631
1632 func (c *ProjectsSettingsPatchCall) Context(ctx context.Context) *ProjectsSettingsPatchCall {
1633 c.ctx_ = ctx
1634 return c
1635 }
1636
1637
1638
1639 func (c *ProjectsSettingsPatchCall) Header() http.Header {
1640 if c.header_ == nil {
1641 c.header_ = make(http.Header)
1642 }
1643 return c.header_
1644 }
1645
1646 func (c *ProjectsSettingsPatchCall) doRequest(alt string) (*http.Response, error) {
1647 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1648 var body io.Reader = nil
1649 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudresourcesettingsv1setting)
1650 if err != nil {
1651 return nil, err
1652 }
1653 c.urlParams_.Set("alt", alt)
1654 c.urlParams_.Set("prettyPrint", "false")
1655 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1656 urls += "?" + c.urlParams_.Encode()
1657 req, err := http.NewRequest("PATCH", urls, body)
1658 if err != nil {
1659 return nil, err
1660 }
1661 req.Header = reqHeaders
1662 googleapi.Expand(req.URL, map[string]string{
1663 "name": c.name,
1664 })
1665 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1666 }
1667
1668
1669
1670
1671
1672
1673
1674 func (c *ProjectsSettingsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudResourcesettingsV1Setting, error) {
1675 gensupport.SetOptions(c.urlParams_, opts...)
1676 res, err := c.doRequest("json")
1677 if res != nil && res.StatusCode == http.StatusNotModified {
1678 if res.Body != nil {
1679 res.Body.Close()
1680 }
1681 return nil, gensupport.WrapError(&googleapi.Error{
1682 Code: res.StatusCode,
1683 Header: res.Header,
1684 })
1685 }
1686 if err != nil {
1687 return nil, err
1688 }
1689 defer googleapi.CloseBody(res)
1690 if err := googleapi.CheckResponse(res); err != nil {
1691 return nil, gensupport.WrapError(err)
1692 }
1693 ret := &GoogleCloudResourcesettingsV1Setting{
1694 ServerResponse: googleapi.ServerResponse{
1695 Header: res.Header,
1696 HTTPStatusCode: res.StatusCode,
1697 },
1698 }
1699 target := &ret
1700 if err := gensupport.DecodeResponse(target, res); err != nil {
1701 return nil, err
1702 }
1703 return ret, nil
1704 }
1705
View as plain text