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 package ideahub
39
40 import (
41 "bytes"
42 "context"
43 "encoding/json"
44 "errors"
45 "fmt"
46 "io"
47 "net/http"
48 "net/url"
49 "strconv"
50 "strings"
51
52 googleapi "google.golang.org/api/googleapi"
53 internal "google.golang.org/api/internal"
54 gensupport "google.golang.org/api/internal/gensupport"
55 option "google.golang.org/api/option"
56 internaloption "google.golang.org/api/option/internaloption"
57 htransport "google.golang.org/api/transport/http"
58 )
59
60
61
62 var _ = bytes.NewBuffer
63 var _ = strconv.Itoa
64 var _ = fmt.Sprintf
65 var _ = json.NewDecoder
66 var _ = io.Copy
67 var _ = url.Parse
68 var _ = gensupport.MarshalJSON
69 var _ = googleapi.Version
70 var _ = errors.New
71 var _ = strings.Replace
72 var _ = context.Canceled
73 var _ = internaloption.WithDefaultEndpoint
74
75 const apiId = "ideahub:v1beta"
76 const apiName = "ideahub"
77 const apiVersion = "v1beta"
78 const basePath = "https://ideahub.googleapis.com/"
79 const mtlsBasePath = "https://ideahub.mtls.googleapis.com/"
80
81
82 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
83 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
84 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
85 client, endpoint, err := htransport.NewClient(ctx, opts...)
86 if err != nil {
87 return nil, err
88 }
89 s, err := New(client)
90 if err != nil {
91 return nil, err
92 }
93 if endpoint != "" {
94 s.BasePath = endpoint
95 }
96 return s, nil
97 }
98
99
100
101
102
103
104 func New(client *http.Client) (*Service, error) {
105 if client == nil {
106 return nil, errors.New("client is nil")
107 }
108 s := &Service{client: client, BasePath: basePath}
109 s.Platforms = NewPlatformsService(s)
110 return s, nil
111 }
112
113 type Service struct {
114 client *http.Client
115 BasePath string
116 UserAgent string
117
118 Platforms *PlatformsService
119 }
120
121 func (s *Service) userAgent() string {
122 if s.UserAgent == "" {
123 return googleapi.UserAgent
124 }
125 return googleapi.UserAgent + " " + s.UserAgent
126 }
127
128 func NewPlatformsService(s *Service) *PlatformsService {
129 rs := &PlatformsService{s: s}
130 rs.Properties = NewPlatformsPropertiesService(s)
131 return rs
132 }
133
134 type PlatformsService struct {
135 s *Service
136
137 Properties *PlatformsPropertiesService
138 }
139
140 func NewPlatformsPropertiesService(s *Service) *PlatformsPropertiesService {
141 rs := &PlatformsPropertiesService{s: s}
142 rs.IdeaActivities = NewPlatformsPropertiesIdeaActivitiesService(s)
143 rs.IdeaStates = NewPlatformsPropertiesIdeaStatesService(s)
144 rs.Ideas = NewPlatformsPropertiesIdeasService(s)
145 rs.Locales = NewPlatformsPropertiesLocalesService(s)
146 rs.TopicStates = NewPlatformsPropertiesTopicStatesService(s)
147 return rs
148 }
149
150 type PlatformsPropertiesService struct {
151 s *Service
152
153 IdeaActivities *PlatformsPropertiesIdeaActivitiesService
154
155 IdeaStates *PlatformsPropertiesIdeaStatesService
156
157 Ideas *PlatformsPropertiesIdeasService
158
159 Locales *PlatformsPropertiesLocalesService
160
161 TopicStates *PlatformsPropertiesTopicStatesService
162 }
163
164 func NewPlatformsPropertiesIdeaActivitiesService(s *Service) *PlatformsPropertiesIdeaActivitiesService {
165 rs := &PlatformsPropertiesIdeaActivitiesService{s: s}
166 return rs
167 }
168
169 type PlatformsPropertiesIdeaActivitiesService struct {
170 s *Service
171 }
172
173 func NewPlatformsPropertiesIdeaStatesService(s *Service) *PlatformsPropertiesIdeaStatesService {
174 rs := &PlatformsPropertiesIdeaStatesService{s: s}
175 return rs
176 }
177
178 type PlatformsPropertiesIdeaStatesService struct {
179 s *Service
180 }
181
182 func NewPlatformsPropertiesIdeasService(s *Service) *PlatformsPropertiesIdeasService {
183 rs := &PlatformsPropertiesIdeasService{s: s}
184 return rs
185 }
186
187 type PlatformsPropertiesIdeasService struct {
188 s *Service
189 }
190
191 func NewPlatformsPropertiesLocalesService(s *Service) *PlatformsPropertiesLocalesService {
192 rs := &PlatformsPropertiesLocalesService{s: s}
193 return rs
194 }
195
196 type PlatformsPropertiesLocalesService struct {
197 s *Service
198 }
199
200 func NewPlatformsPropertiesTopicStatesService(s *Service) *PlatformsPropertiesTopicStatesService {
201 rs := &PlatformsPropertiesTopicStatesService{s: s}
202 return rs
203 }
204
205 type PlatformsPropertiesTopicStatesService struct {
206 s *Service
207 }
208
209
210
211 type GoogleSearchIdeahubV1betaAvailableLocale struct {
212
213 Locale string `json:"locale,omitempty"`
214
215
216
217
218 Name string `json:"name,omitempty"`
219
220
221
222
223
224
225
226 ForceSendFields []string `json:"-"`
227
228
229
230
231
232
233
234 NullFields []string `json:"-"`
235 }
236
237 func (s *GoogleSearchIdeahubV1betaAvailableLocale) MarshalJSON() ([]byte, error) {
238 type NoMethod GoogleSearchIdeahubV1betaAvailableLocale
239 raw := NoMethod(*s)
240 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
241 }
242
243
244
245 type GoogleSearchIdeahubV1betaIdea struct {
246
247 Name string `json:"name,omitempty"`
248
249
250 Text string `json:"text,omitempty"`
251
252
253 Topics []*GoogleSearchIdeahubV1betaTopic `json:"topics,omitempty"`
254
255
256
257
258
259
260
261 ForceSendFields []string `json:"-"`
262
263
264
265
266
267
268
269 NullFields []string `json:"-"`
270 }
271
272 func (s *GoogleSearchIdeahubV1betaIdea) MarshalJSON() ([]byte, error) {
273 type NoMethod GoogleSearchIdeahubV1betaIdea
274 raw := NoMethod(*s)
275 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
276 }
277
278
279 type GoogleSearchIdeahubV1betaIdeaActivity struct {
280
281 Ideas []string `json:"ideas,omitempty"`
282
283
284
285
286
287 Name string `json:"name,omitempty"`
288
289
290 Topics []string `json:"topics,omitempty"`
291
292
293
294
295
296
297
298
299
300
301
302
303
304 Type string `json:"type,omitempty"`
305
306
307 Uri string `json:"uri,omitempty"`
308
309
310
311 googleapi.ServerResponse `json:"-"`
312
313
314
315
316
317
318
319 ForceSendFields []string `json:"-"`
320
321
322
323
324
325
326
327 NullFields []string `json:"-"`
328 }
329
330 func (s *GoogleSearchIdeahubV1betaIdeaActivity) MarshalJSON() ([]byte, error) {
331 type NoMethod GoogleSearchIdeahubV1betaIdeaActivity
332 raw := NoMethod(*s)
333 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
334 }
335
336
337
338 type GoogleSearchIdeahubV1betaIdeaState struct {
339
340 Dismissed bool `json:"dismissed,omitempty"`
341
342
343
344 Name string `json:"name,omitempty"`
345
346
347 Saved bool `json:"saved,omitempty"`
348
349
350
351 googleapi.ServerResponse `json:"-"`
352
353
354
355
356
357
358
359 ForceSendFields []string `json:"-"`
360
361
362
363
364
365
366
367 NullFields []string `json:"-"`
368 }
369
370 func (s *GoogleSearchIdeahubV1betaIdeaState) MarshalJSON() ([]byte, error) {
371 type NoMethod GoogleSearchIdeahubV1betaIdeaState
372 raw := NoMethod(*s)
373 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
374 }
375
376
377
378
379 type GoogleSearchIdeahubV1betaListAvailableLocalesResponse struct {
380
381
382 AvailableLocales []*GoogleSearchIdeahubV1betaAvailableLocale `json:"availableLocales,omitempty"`
383
384
385
386
387 NextPageToken string `json:"nextPageToken,omitempty"`
388
389
390
391 googleapi.ServerResponse `json:"-"`
392
393
394
395
396
397
398
399 ForceSendFields []string `json:"-"`
400
401
402
403
404
405
406
407
408 NullFields []string `json:"-"`
409 }
410
411 func (s *GoogleSearchIdeahubV1betaListAvailableLocalesResponse) MarshalJSON() ([]byte, error) {
412 type NoMethod GoogleSearchIdeahubV1betaListAvailableLocalesResponse
413 raw := NoMethod(*s)
414 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
415 }
416
417 type GoogleSearchIdeahubV1betaListIdeasResponse struct {
418
419 Ideas []*GoogleSearchIdeahubV1betaIdea `json:"ideas,omitempty"`
420
421
422 NextPageToken string `json:"nextPageToken,omitempty"`
423
424
425
426 googleapi.ServerResponse `json:"-"`
427
428
429
430
431
432
433
434 ForceSendFields []string `json:"-"`
435
436
437
438
439
440
441
442 NullFields []string `json:"-"`
443 }
444
445 func (s *GoogleSearchIdeahubV1betaListIdeasResponse) MarshalJSON() ([]byte, error) {
446 type NoMethod GoogleSearchIdeahubV1betaListIdeasResponse
447 raw := NoMethod(*s)
448 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
449 }
450
451
452
453 type GoogleSearchIdeahubV1betaTopic struct {
454
455
456 DisplayName string `json:"displayName,omitempty"`
457
458
459 Mid string `json:"mid,omitempty"`
460
461
462 Name string `json:"name,omitempty"`
463
464
465
466
467
468
469
470 ForceSendFields []string `json:"-"`
471
472
473
474
475
476
477
478 NullFields []string `json:"-"`
479 }
480
481 func (s *GoogleSearchIdeahubV1betaTopic) MarshalJSON() ([]byte, error) {
482 type NoMethod GoogleSearchIdeahubV1betaTopic
483 raw := NoMethod(*s)
484 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
485 }
486
487
488
489 type GoogleSearchIdeahubV1betaTopicState struct {
490
491 Dismissed bool `json:"dismissed,omitempty"`
492
493
494
495 Name string `json:"name,omitempty"`
496
497
498 Saved bool `json:"saved,omitempty"`
499
500
501
502 googleapi.ServerResponse `json:"-"`
503
504
505
506
507
508
509
510 ForceSendFields []string `json:"-"`
511
512
513
514
515
516
517
518 NullFields []string `json:"-"`
519 }
520
521 func (s *GoogleSearchIdeahubV1betaTopicState) MarshalJSON() ([]byte, error) {
522 type NoMethod GoogleSearchIdeahubV1betaTopicState
523 raw := NoMethod(*s)
524 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
525 }
526
527
528
529 type PlatformsPropertiesIdeaActivitiesCreateCall struct {
530 s *Service
531 parent string
532 googlesearchideahubv1betaideaactivity *GoogleSearchIdeahubV1betaIdeaActivity
533 urlParams_ gensupport.URLParams
534 ctx_ context.Context
535 header_ http.Header
536 }
537
538
539
540
541
542 func (r *PlatformsPropertiesIdeaActivitiesService) Create(parent string, googlesearchideahubv1betaideaactivity *GoogleSearchIdeahubV1betaIdeaActivity) *PlatformsPropertiesIdeaActivitiesCreateCall {
543 c := &PlatformsPropertiesIdeaActivitiesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
544 c.parent = parent
545 c.googlesearchideahubv1betaideaactivity = googlesearchideahubv1betaideaactivity
546 return c
547 }
548
549
550
551
552 func (c *PlatformsPropertiesIdeaActivitiesCreateCall) Fields(s ...googleapi.Field) *PlatformsPropertiesIdeaActivitiesCreateCall {
553 c.urlParams_.Set("fields", googleapi.CombineFields(s))
554 return c
555 }
556
557
558
559
560 func (c *PlatformsPropertiesIdeaActivitiesCreateCall) Context(ctx context.Context) *PlatformsPropertiesIdeaActivitiesCreateCall {
561 c.ctx_ = ctx
562 return c
563 }
564
565
566
567 func (c *PlatformsPropertiesIdeaActivitiesCreateCall) Header() http.Header {
568 if c.header_ == nil {
569 c.header_ = make(http.Header)
570 }
571 return c.header_
572 }
573
574 func (c *PlatformsPropertiesIdeaActivitiesCreateCall) doRequest(alt string) (*http.Response, error) {
575 reqHeaders := make(http.Header)
576 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
577 for k, v := range c.header_ {
578 reqHeaders[k] = v
579 }
580 reqHeaders.Set("User-Agent", c.s.userAgent())
581 var body io.Reader = nil
582 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlesearchideahubv1betaideaactivity)
583 if err != nil {
584 return nil, err
585 }
586 reqHeaders.Set("Content-Type", "application/json")
587 c.urlParams_.Set("alt", alt)
588 c.urlParams_.Set("prettyPrint", "false")
589 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/ideaActivities")
590 urls += "?" + c.urlParams_.Encode()
591 req, err := http.NewRequest("POST", urls, body)
592 if err != nil {
593 return nil, err
594 }
595 req.Header = reqHeaders
596 googleapi.Expand(req.URL, map[string]string{
597 "parent": c.parent,
598 })
599 return gensupport.SendRequest(c.ctx_, c.s.client, req)
600 }
601
602
603
604
605
606
607
608
609
610 func (c *PlatformsPropertiesIdeaActivitiesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleSearchIdeahubV1betaIdeaActivity, error) {
611 gensupport.SetOptions(c.urlParams_, opts...)
612 res, err := c.doRequest("json")
613 if res != nil && res.StatusCode == http.StatusNotModified {
614 if res.Body != nil {
615 res.Body.Close()
616 }
617 return nil, gensupport.WrapError(&googleapi.Error{
618 Code: res.StatusCode,
619 Header: res.Header,
620 })
621 }
622 if err != nil {
623 return nil, err
624 }
625 defer googleapi.CloseBody(res)
626 if err := googleapi.CheckResponse(res); err != nil {
627 return nil, gensupport.WrapError(err)
628 }
629 ret := &GoogleSearchIdeahubV1betaIdeaActivity{
630 ServerResponse: googleapi.ServerResponse{
631 Header: res.Header,
632 HTTPStatusCode: res.StatusCode,
633 },
634 }
635 target := &ret
636 if err := gensupport.DecodeResponse(target, res); err != nil {
637 return nil, err
638 }
639 return ret, nil
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666 }
667
668
669
670 type PlatformsPropertiesIdeaStatesPatchCall struct {
671 s *Service
672 nameid string
673 googlesearchideahubv1betaideastate *GoogleSearchIdeahubV1betaIdeaState
674 urlParams_ gensupport.URLParams
675 ctx_ context.Context
676 header_ http.Header
677 }
678
679
680
681
682
683 func (r *PlatformsPropertiesIdeaStatesService) Patch(nameid string, googlesearchideahubv1betaideastate *GoogleSearchIdeahubV1betaIdeaState) *PlatformsPropertiesIdeaStatesPatchCall {
684 c := &PlatformsPropertiesIdeaStatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
685 c.nameid = nameid
686 c.googlesearchideahubv1betaideastate = googlesearchideahubv1betaideastate
687 return c
688 }
689
690
691
692 func (c *PlatformsPropertiesIdeaStatesPatchCall) UpdateMask(updateMask string) *PlatformsPropertiesIdeaStatesPatchCall {
693 c.urlParams_.Set("updateMask", updateMask)
694 return c
695 }
696
697
698
699
700 func (c *PlatformsPropertiesIdeaStatesPatchCall) Fields(s ...googleapi.Field) *PlatformsPropertiesIdeaStatesPatchCall {
701 c.urlParams_.Set("fields", googleapi.CombineFields(s))
702 return c
703 }
704
705
706
707
708 func (c *PlatformsPropertiesIdeaStatesPatchCall) Context(ctx context.Context) *PlatformsPropertiesIdeaStatesPatchCall {
709 c.ctx_ = ctx
710 return c
711 }
712
713
714
715 func (c *PlatformsPropertiesIdeaStatesPatchCall) Header() http.Header {
716 if c.header_ == nil {
717 c.header_ = make(http.Header)
718 }
719 return c.header_
720 }
721
722 func (c *PlatformsPropertiesIdeaStatesPatchCall) doRequest(alt string) (*http.Response, error) {
723 reqHeaders := make(http.Header)
724 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
725 for k, v := range c.header_ {
726 reqHeaders[k] = v
727 }
728 reqHeaders.Set("User-Agent", c.s.userAgent())
729 var body io.Reader = nil
730 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlesearchideahubv1betaideastate)
731 if err != nil {
732 return nil, err
733 }
734 reqHeaders.Set("Content-Type", "application/json")
735 c.urlParams_.Set("alt", alt)
736 c.urlParams_.Set("prettyPrint", "false")
737 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
738 urls += "?" + c.urlParams_.Encode()
739 req, err := http.NewRequest("PATCH", urls, body)
740 if err != nil {
741 return nil, err
742 }
743 req.Header = reqHeaders
744 googleapi.Expand(req.URL, map[string]string{
745 "name": c.nameid,
746 })
747 return gensupport.SendRequest(c.ctx_, c.s.client, req)
748 }
749
750
751
752
753
754
755
756
757
758 func (c *PlatformsPropertiesIdeaStatesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleSearchIdeahubV1betaIdeaState, error) {
759 gensupport.SetOptions(c.urlParams_, opts...)
760 res, err := c.doRequest("json")
761 if res != nil && res.StatusCode == http.StatusNotModified {
762 if res.Body != nil {
763 res.Body.Close()
764 }
765 return nil, gensupport.WrapError(&googleapi.Error{
766 Code: res.StatusCode,
767 Header: res.Header,
768 })
769 }
770 if err != nil {
771 return nil, err
772 }
773 defer googleapi.CloseBody(res)
774 if err := googleapi.CheckResponse(res); err != nil {
775 return nil, gensupport.WrapError(err)
776 }
777 ret := &GoogleSearchIdeahubV1betaIdeaState{
778 ServerResponse: googleapi.ServerResponse{
779 Header: res.Header,
780 HTTPStatusCode: res.StatusCode,
781 },
782 }
783 target := &ret
784 if err := gensupport.DecodeResponse(target, res); err != nil {
785 return nil, err
786 }
787 return ret, nil
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820 }
821
822
823
824 type PlatformsPropertiesIdeasListCall struct {
825 s *Service
826 parent string
827 urlParams_ gensupport.URLParams
828 ifNoneMatch_ string
829 ctx_ context.Context
830 header_ http.Header
831 }
832
833
834
835
836
837 func (r *PlatformsPropertiesIdeasService) List(parent string) *PlatformsPropertiesIdeasListCall {
838 c := &PlatformsPropertiesIdeasListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
839 c.parent = parent
840 return c
841 }
842
843
844
845
846
847
848
849
850
851
852
853
854 func (c *PlatformsPropertiesIdeasListCall) Filter(filter string) *PlatformsPropertiesIdeasListCall {
855 c.urlParams_.Set("filter", filter)
856 return c
857 }
858
859
860
861 func (c *PlatformsPropertiesIdeasListCall) OrderBy(orderBy string) *PlatformsPropertiesIdeasListCall {
862 c.urlParams_.Set("orderBy", orderBy)
863 return c
864 }
865
866
867
868
869 func (c *PlatformsPropertiesIdeasListCall) PageSize(pageSize int64) *PlatformsPropertiesIdeasListCall {
870 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
871 return c
872 }
873
874
875
876 func (c *PlatformsPropertiesIdeasListCall) PageToken(pageToken string) *PlatformsPropertiesIdeasListCall {
877 c.urlParams_.Set("pageToken", pageToken)
878 return c
879 }
880
881
882
883
884 func (c *PlatformsPropertiesIdeasListCall) Fields(s ...googleapi.Field) *PlatformsPropertiesIdeasListCall {
885 c.urlParams_.Set("fields", googleapi.CombineFields(s))
886 return c
887 }
888
889
890
891
892
893
894 func (c *PlatformsPropertiesIdeasListCall) IfNoneMatch(entityTag string) *PlatformsPropertiesIdeasListCall {
895 c.ifNoneMatch_ = entityTag
896 return c
897 }
898
899
900
901
902 func (c *PlatformsPropertiesIdeasListCall) Context(ctx context.Context) *PlatformsPropertiesIdeasListCall {
903 c.ctx_ = ctx
904 return c
905 }
906
907
908
909 func (c *PlatformsPropertiesIdeasListCall) Header() http.Header {
910 if c.header_ == nil {
911 c.header_ = make(http.Header)
912 }
913 return c.header_
914 }
915
916 func (c *PlatformsPropertiesIdeasListCall) doRequest(alt string) (*http.Response, error) {
917 reqHeaders := make(http.Header)
918 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
919 for k, v := range c.header_ {
920 reqHeaders[k] = v
921 }
922 reqHeaders.Set("User-Agent", c.s.userAgent())
923 if c.ifNoneMatch_ != "" {
924 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
925 }
926 var body io.Reader = nil
927 c.urlParams_.Set("alt", alt)
928 c.urlParams_.Set("prettyPrint", "false")
929 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/ideas")
930 urls += "?" + c.urlParams_.Encode()
931 req, err := http.NewRequest("GET", urls, body)
932 if err != nil {
933 return nil, err
934 }
935 req.Header = reqHeaders
936 googleapi.Expand(req.URL, map[string]string{
937 "parent": c.parent,
938 })
939 return gensupport.SendRequest(c.ctx_, c.s.client, req)
940 }
941
942
943
944
945
946
947
948
949
950
951 func (c *PlatformsPropertiesIdeasListCall) Do(opts ...googleapi.CallOption) (*GoogleSearchIdeahubV1betaListIdeasResponse, error) {
952 gensupport.SetOptions(c.urlParams_, opts...)
953 res, err := c.doRequest("json")
954 if res != nil && res.StatusCode == http.StatusNotModified {
955 if res.Body != nil {
956 res.Body.Close()
957 }
958 return nil, gensupport.WrapError(&googleapi.Error{
959 Code: res.StatusCode,
960 Header: res.Header,
961 })
962 }
963 if err != nil {
964 return nil, err
965 }
966 defer googleapi.CloseBody(res)
967 if err := googleapi.CheckResponse(res); err != nil {
968 return nil, gensupport.WrapError(err)
969 }
970 ret := &GoogleSearchIdeahubV1betaListIdeasResponse{
971 ServerResponse: googleapi.ServerResponse{
972 Header: res.Header,
973 HTTPStatusCode: res.StatusCode,
974 },
975 }
976 target := &ret
977 if err := gensupport.DecodeResponse(target, res); err != nil {
978 return nil, err
979 }
980 return ret, nil
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025 }
1026
1027
1028
1029
1030 func (c *PlatformsPropertiesIdeasListCall) Pages(ctx context.Context, f func(*GoogleSearchIdeahubV1betaListIdeasResponse) error) error {
1031 c.ctx_ = ctx
1032 defer c.PageToken(c.urlParams_.Get("pageToken"))
1033 for {
1034 x, err := c.Do()
1035 if err != nil {
1036 return err
1037 }
1038 if err := f(x); err != nil {
1039 return err
1040 }
1041 if x.NextPageToken == "" {
1042 return nil
1043 }
1044 c.PageToken(x.NextPageToken)
1045 }
1046 }
1047
1048
1049
1050 type PlatformsPropertiesLocalesListCall struct {
1051 s *Service
1052 parent string
1053 urlParams_ gensupport.URLParams
1054 ifNoneMatch_ string
1055 ctx_ context.Context
1056 header_ http.Header
1057 }
1058
1059
1060
1061
1062
1063
1064 func (r *PlatformsPropertiesLocalesService) List(parent string) *PlatformsPropertiesLocalesListCall {
1065 c := &PlatformsPropertiesLocalesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1066 c.parent = parent
1067 return c
1068 }
1069
1070
1071
1072
1073
1074 func (c *PlatformsPropertiesLocalesListCall) PageSize(pageSize int64) *PlatformsPropertiesLocalesListCall {
1075 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1076 return c
1077 }
1078
1079
1080
1081
1082
1083
1084 func (c *PlatformsPropertiesLocalesListCall) PageToken(pageToken string) *PlatformsPropertiesLocalesListCall {
1085 c.urlParams_.Set("pageToken", pageToken)
1086 return c
1087 }
1088
1089
1090
1091
1092 func (c *PlatformsPropertiesLocalesListCall) Fields(s ...googleapi.Field) *PlatformsPropertiesLocalesListCall {
1093 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1094 return c
1095 }
1096
1097
1098
1099
1100
1101
1102 func (c *PlatformsPropertiesLocalesListCall) IfNoneMatch(entityTag string) *PlatformsPropertiesLocalesListCall {
1103 c.ifNoneMatch_ = entityTag
1104 return c
1105 }
1106
1107
1108
1109
1110 func (c *PlatformsPropertiesLocalesListCall) Context(ctx context.Context) *PlatformsPropertiesLocalesListCall {
1111 c.ctx_ = ctx
1112 return c
1113 }
1114
1115
1116
1117 func (c *PlatformsPropertiesLocalesListCall) Header() http.Header {
1118 if c.header_ == nil {
1119 c.header_ = make(http.Header)
1120 }
1121 return c.header_
1122 }
1123
1124 func (c *PlatformsPropertiesLocalesListCall) doRequest(alt string) (*http.Response, error) {
1125 reqHeaders := make(http.Header)
1126 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
1127 for k, v := range c.header_ {
1128 reqHeaders[k] = v
1129 }
1130 reqHeaders.Set("User-Agent", c.s.userAgent())
1131 if c.ifNoneMatch_ != "" {
1132 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1133 }
1134 var body io.Reader = nil
1135 c.urlParams_.Set("alt", alt)
1136 c.urlParams_.Set("prettyPrint", "false")
1137 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/locales")
1138 urls += "?" + c.urlParams_.Encode()
1139 req, err := http.NewRequest("GET", urls, body)
1140 if err != nil {
1141 return nil, err
1142 }
1143 req.Header = reqHeaders
1144 googleapi.Expand(req.URL, map[string]string{
1145 "parent": c.parent,
1146 })
1147 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1148 }
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159 func (c *PlatformsPropertiesLocalesListCall) Do(opts ...googleapi.CallOption) (*GoogleSearchIdeahubV1betaListAvailableLocalesResponse, error) {
1160 gensupport.SetOptions(c.urlParams_, opts...)
1161 res, err := c.doRequest("json")
1162 if res != nil && res.StatusCode == http.StatusNotModified {
1163 if res.Body != nil {
1164 res.Body.Close()
1165 }
1166 return nil, gensupport.WrapError(&googleapi.Error{
1167 Code: res.StatusCode,
1168 Header: res.Header,
1169 })
1170 }
1171 if err != nil {
1172 return nil, err
1173 }
1174 defer googleapi.CloseBody(res)
1175 if err := googleapi.CheckResponse(res); err != nil {
1176 return nil, gensupport.WrapError(err)
1177 }
1178 ret := &GoogleSearchIdeahubV1betaListAvailableLocalesResponse{
1179 ServerResponse: googleapi.ServerResponse{
1180 Header: res.Header,
1181 HTTPStatusCode: res.StatusCode,
1182 },
1183 }
1184 target := &ret
1185 if err := gensupport.DecodeResponse(target, res); err != nil {
1186 return nil, err
1187 }
1188 return ret, nil
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223 }
1224
1225
1226
1227
1228 func (c *PlatformsPropertiesLocalesListCall) Pages(ctx context.Context, f func(*GoogleSearchIdeahubV1betaListAvailableLocalesResponse) error) error {
1229 c.ctx_ = ctx
1230 defer c.PageToken(c.urlParams_.Get("pageToken"))
1231 for {
1232 x, err := c.Do()
1233 if err != nil {
1234 return err
1235 }
1236 if err := f(x); err != nil {
1237 return err
1238 }
1239 if x.NextPageToken == "" {
1240 return nil
1241 }
1242 c.PageToken(x.NextPageToken)
1243 }
1244 }
1245
1246
1247
1248 type PlatformsPropertiesTopicStatesPatchCall struct {
1249 s *Service
1250 nameid string
1251 googlesearchideahubv1betatopicstate *GoogleSearchIdeahubV1betaTopicState
1252 urlParams_ gensupport.URLParams
1253 ctx_ context.Context
1254 header_ http.Header
1255 }
1256
1257
1258
1259
1260
1261 func (r *PlatformsPropertiesTopicStatesService) Patch(nameid string, googlesearchideahubv1betatopicstate *GoogleSearchIdeahubV1betaTopicState) *PlatformsPropertiesTopicStatesPatchCall {
1262 c := &PlatformsPropertiesTopicStatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1263 c.nameid = nameid
1264 c.googlesearchideahubv1betatopicstate = googlesearchideahubv1betatopicstate
1265 return c
1266 }
1267
1268
1269
1270 func (c *PlatformsPropertiesTopicStatesPatchCall) UpdateMask(updateMask string) *PlatformsPropertiesTopicStatesPatchCall {
1271 c.urlParams_.Set("updateMask", updateMask)
1272 return c
1273 }
1274
1275
1276
1277
1278 func (c *PlatformsPropertiesTopicStatesPatchCall) Fields(s ...googleapi.Field) *PlatformsPropertiesTopicStatesPatchCall {
1279 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1280 return c
1281 }
1282
1283
1284
1285
1286 func (c *PlatformsPropertiesTopicStatesPatchCall) Context(ctx context.Context) *PlatformsPropertiesTopicStatesPatchCall {
1287 c.ctx_ = ctx
1288 return c
1289 }
1290
1291
1292
1293 func (c *PlatformsPropertiesTopicStatesPatchCall) Header() http.Header {
1294 if c.header_ == nil {
1295 c.header_ = make(http.Header)
1296 }
1297 return c.header_
1298 }
1299
1300 func (c *PlatformsPropertiesTopicStatesPatchCall) doRequest(alt string) (*http.Response, error) {
1301 reqHeaders := make(http.Header)
1302 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
1303 for k, v := range c.header_ {
1304 reqHeaders[k] = v
1305 }
1306 reqHeaders.Set("User-Agent", c.s.userAgent())
1307 var body io.Reader = nil
1308 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlesearchideahubv1betatopicstate)
1309 if err != nil {
1310 return nil, err
1311 }
1312 reqHeaders.Set("Content-Type", "application/json")
1313 c.urlParams_.Set("alt", alt)
1314 c.urlParams_.Set("prettyPrint", "false")
1315 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
1316 urls += "?" + c.urlParams_.Encode()
1317 req, err := http.NewRequest("PATCH", urls, body)
1318 if err != nil {
1319 return nil, err
1320 }
1321 req.Header = reqHeaders
1322 googleapi.Expand(req.URL, map[string]string{
1323 "name": c.nameid,
1324 })
1325 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1326 }
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336 func (c *PlatformsPropertiesTopicStatesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleSearchIdeahubV1betaTopicState, error) {
1337 gensupport.SetOptions(c.urlParams_, opts...)
1338 res, err := c.doRequest("json")
1339 if res != nil && res.StatusCode == http.StatusNotModified {
1340 if res.Body != nil {
1341 res.Body.Close()
1342 }
1343 return nil, gensupport.WrapError(&googleapi.Error{
1344 Code: res.StatusCode,
1345 Header: res.Header,
1346 })
1347 }
1348 if err != nil {
1349 return nil, err
1350 }
1351 defer googleapi.CloseBody(res)
1352 if err := googleapi.CheckResponse(res); err != nil {
1353 return nil, gensupport.WrapError(err)
1354 }
1355 ret := &GoogleSearchIdeahubV1betaTopicState{
1356 ServerResponse: googleapi.ServerResponse{
1357 Header: res.Header,
1358 HTTPStatusCode: res.StatusCode,
1359 },
1360 }
1361 target := &ret
1362 if err := gensupport.DecodeResponse(target, res); err != nil {
1363 return nil, err
1364 }
1365 return ret, nil
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398 }
1399
View as plain text