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