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 package consumersurveys
41
42 import (
43 "bytes"
44 "context"
45 "encoding/json"
46 "errors"
47 "fmt"
48 "io"
49 "net/http"
50 "net/url"
51 "strconv"
52 "strings"
53
54 googleapi "google.golang.org/api/googleapi"
55 gensupport "google.golang.org/api/internal/gensupport"
56 option "google.golang.org/api/option"
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
74 const apiId = "consumersurveys:v2"
75 const apiName = "consumersurveys"
76 const apiVersion = "v2"
77 const basePath = "https://www.googleapis.com/consumersurveys/v2/"
78
79
80 const (
81
82 ConsumersurveysScope = "https://www.googleapis.com/auth/consumersurveys"
83
84
85 ConsumersurveysReadonlyScope = "https://www.googleapis.com/auth/consumersurveys.readonly"
86
87
88 UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email"
89 )
90
91
92 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
93 scopesOption := option.WithScopes(
94 "https://www.googleapis.com/auth/consumersurveys",
95 "https://www.googleapis.com/auth/consumersurveys.readonly",
96 "https://www.googleapis.com/auth/userinfo.email",
97 )
98
99 opts = append([]option.ClientOption{scopesOption}, opts...)
100 client, endpoint, err := htransport.NewClient(ctx, opts...)
101 if err != nil {
102 return nil, err
103 }
104 s, err := New(client)
105 if err != nil {
106 return nil, err
107 }
108 if endpoint != "" {
109 s.BasePath = endpoint
110 }
111 return s, nil
112 }
113
114
115
116
117
118
119 func New(client *http.Client) (*Service, error) {
120 if client == nil {
121 return nil, errors.New("client is nil")
122 }
123 s := &Service{client: client, BasePath: basePath}
124 s.Mobileapppanels = NewMobileapppanelsService(s)
125 s.Results = NewResultsService(s)
126 s.Surveys = NewSurveysService(s)
127 return s, nil
128 }
129
130 type Service struct {
131 client *http.Client
132 BasePath string
133 UserAgent string
134
135 Mobileapppanels *MobileapppanelsService
136
137 Results *ResultsService
138
139 Surveys *SurveysService
140 }
141
142 func (s *Service) userAgent() string {
143 if s.UserAgent == "" {
144 return googleapi.UserAgent
145 }
146 return googleapi.UserAgent + " " + s.UserAgent
147 }
148
149 func NewMobileapppanelsService(s *Service) *MobileapppanelsService {
150 rs := &MobileapppanelsService{s: s}
151 return rs
152 }
153
154 type MobileapppanelsService struct {
155 s *Service
156 }
157
158 func NewResultsService(s *Service) *ResultsService {
159 rs := &ResultsService{s: s}
160 return rs
161 }
162
163 type ResultsService struct {
164 s *Service
165 }
166
167 func NewSurveysService(s *Service) *SurveysService {
168 rs := &SurveysService{s: s}
169 return rs
170 }
171
172 type SurveysService struct {
173 s *Service
174 }
175
176 type FieldMask struct {
177 Fields []*FieldMask `json:"fields,omitempty"`
178
179 Id int64 `json:"id,omitempty"`
180
181
182
183
184
185
186
187 ForceSendFields []string `json:"-"`
188
189
190
191
192
193
194
195 NullFields []string `json:"-"`
196 }
197
198 func (s *FieldMask) MarshalJSON() ([]byte, error) {
199 type NoMethod FieldMask
200 raw := NoMethod(*s)
201 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
202 }
203
204 type MobileAppPanel struct {
205 Country string `json:"country,omitempty"`
206
207 IsPublicPanel bool `json:"isPublicPanel,omitempty"`
208
209 Language string `json:"language,omitempty"`
210
211 MobileAppPanelId string `json:"mobileAppPanelId,omitempty"`
212
213 Name string `json:"name,omitempty"`
214
215 Owners []string `json:"owners,omitempty"`
216
217
218
219 googleapi.ServerResponse `json:"-"`
220
221
222
223
224
225
226
227 ForceSendFields []string `json:"-"`
228
229
230
231
232
233
234
235 NullFields []string `json:"-"`
236 }
237
238 func (s *MobileAppPanel) MarshalJSON() ([]byte, error) {
239 type NoMethod MobileAppPanel
240 raw := NoMethod(*s)
241 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
242 }
243
244 type MobileAppPanelsListResponse struct {
245 PageInfo *PageInfo `json:"pageInfo,omitempty"`
246
247
248
249 RequestId string `json:"requestId,omitempty"`
250
251
252
253 Resources []*MobileAppPanel `json:"resources,omitempty"`
254
255 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
256
257
258
259 googleapi.ServerResponse `json:"-"`
260
261
262
263
264
265
266
267 ForceSendFields []string `json:"-"`
268
269
270
271
272
273
274
275 NullFields []string `json:"-"`
276 }
277
278 func (s *MobileAppPanelsListResponse) MarshalJSON() ([]byte, error) {
279 type NoMethod MobileAppPanelsListResponse
280 raw := NoMethod(*s)
281 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
282 }
283
284 type PageInfo struct {
285 ResultPerPage int64 `json:"resultPerPage,omitempty"`
286
287 StartIndex int64 `json:"startIndex,omitempty"`
288
289 TotalResults int64 `json:"totalResults,omitempty"`
290
291
292
293
294
295
296
297 ForceSendFields []string `json:"-"`
298
299
300
301
302
303
304
305 NullFields []string `json:"-"`
306 }
307
308 func (s *PageInfo) MarshalJSON() ([]byte, error) {
309 type NoMethod PageInfo
310 raw := NoMethod(*s)
311 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
312 }
313
314 type ResultsGetRequest struct {
315 ResultMask *ResultsMask `json:"resultMask,omitempty"`
316
317
318
319
320
321
322
323 ForceSendFields []string `json:"-"`
324
325
326
327
328
329
330
331 NullFields []string `json:"-"`
332 }
333
334 func (s *ResultsGetRequest) MarshalJSON() ([]byte, error) {
335 type NoMethod ResultsGetRequest
336 raw := NoMethod(*s)
337 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
338 }
339
340 type ResultsMask struct {
341 Fields []*FieldMask `json:"fields,omitempty"`
342
343 Projection string `json:"projection,omitempty"`
344
345
346
347
348
349
350
351 ForceSendFields []string `json:"-"`
352
353
354
355
356
357
358
359 NullFields []string `json:"-"`
360 }
361
362 func (s *ResultsMask) MarshalJSON() ([]byte, error) {
363 type NoMethod ResultsMask
364 raw := NoMethod(*s)
365 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
366 }
367
368 type Survey struct {
369 Audience *SurveyAudience `json:"audience,omitempty"`
370
371 Cost *SurveyCost `json:"cost,omitempty"`
372
373 CustomerData string `json:"customerData,omitempty"`
374
375 Description string `json:"description,omitempty"`
376
377 Owners []string `json:"owners,omitempty"`
378
379 Questions []*SurveyQuestion `json:"questions,omitempty"`
380
381 RejectionReason *SurveyRejection `json:"rejectionReason,omitempty"`
382
383 State string `json:"state,omitempty"`
384
385 SurveyUrlId string `json:"surveyUrlId,omitempty"`
386
387 Title string `json:"title,omitempty"`
388
389 WantedResponseCount int64 `json:"wantedResponseCount,omitempty"`
390
391
392
393 googleapi.ServerResponse `json:"-"`
394
395
396
397
398
399
400
401 ForceSendFields []string `json:"-"`
402
403
404
405
406
407
408
409 NullFields []string `json:"-"`
410 }
411
412 func (s *Survey) MarshalJSON() ([]byte, error) {
413 type NoMethod Survey
414 raw := NoMethod(*s)
415 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
416 }
417
418 type SurveyAudience struct {
419 Ages []string `json:"ages,omitempty"`
420
421 Country string `json:"country,omitempty"`
422
423 CountrySubdivision string `json:"countrySubdivision,omitempty"`
424
425 Gender string `json:"gender,omitempty"`
426
427 Languages []string `json:"languages,omitempty"`
428
429 MobileAppPanelId string `json:"mobileAppPanelId,omitempty"`
430
431 PopulationSource string `json:"populationSource,omitempty"`
432
433
434
435
436
437
438
439 ForceSendFields []string `json:"-"`
440
441
442
443
444
445
446
447 NullFields []string `json:"-"`
448 }
449
450 func (s *SurveyAudience) MarshalJSON() ([]byte, error) {
451 type NoMethod SurveyAudience
452 raw := NoMethod(*s)
453 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
454 }
455
456 type SurveyCost struct {
457 CostPerResponseNanos int64 `json:"costPerResponseNanos,omitempty,string"`
458
459 CurrencyCode string `json:"currencyCode,omitempty"`
460
461 MaxCostPerResponseNanos int64 `json:"maxCostPerResponseNanos,omitempty,string"`
462
463 Nanos int64 `json:"nanos,omitempty,string"`
464
465
466
467
468
469
470
471
472 ForceSendFields []string `json:"-"`
473
474
475
476
477
478
479
480
481 NullFields []string `json:"-"`
482 }
483
484 func (s *SurveyCost) MarshalJSON() ([]byte, error) {
485 type NoMethod SurveyCost
486 raw := NoMethod(*s)
487 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
488 }
489
490 type SurveyQuestion struct {
491 AnswerOrder string `json:"answerOrder,omitempty"`
492
493 Answers []string `json:"answers,omitempty"`
494
495 HasOther bool `json:"hasOther,omitempty"`
496
497 HighValueLabel string `json:"highValueLabel,omitempty"`
498
499 Images []*SurveyQuestionImage `json:"images,omitempty"`
500
501 LastAnswerPositionPinned bool `json:"lastAnswerPositionPinned,omitempty"`
502
503 LowValueLabel string `json:"lowValueLabel,omitempty"`
504
505 MustPickSuggestion bool `json:"mustPickSuggestion,omitempty"`
506
507 NumStars string `json:"numStars,omitempty"`
508
509 OpenTextPlaceholder string `json:"openTextPlaceholder,omitempty"`
510
511 OpenTextSuggestions []string `json:"openTextSuggestions,omitempty"`
512
513 Question string `json:"question,omitempty"`
514
515 SentimentText string `json:"sentimentText,omitempty"`
516
517 SingleLineResponse bool `json:"singleLineResponse,omitempty"`
518
519 ThresholdAnswers []string `json:"thresholdAnswers,omitempty"`
520
521 Type string `json:"type,omitempty"`
522
523 UnitOfMeasurementLabel string `json:"unitOfMeasurementLabel,omitempty"`
524
525 VideoId string `json:"videoId,omitempty"`
526
527
528
529
530
531
532
533 ForceSendFields []string `json:"-"`
534
535
536
537
538
539
540
541 NullFields []string `json:"-"`
542 }
543
544 func (s *SurveyQuestion) MarshalJSON() ([]byte, error) {
545 type NoMethod SurveyQuestion
546 raw := NoMethod(*s)
547 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
548 }
549
550 type SurveyQuestionImage struct {
551 AltText string `json:"altText,omitempty"`
552
553 Data string `json:"data,omitempty"`
554
555 Url string `json:"url,omitempty"`
556
557
558
559
560
561
562
563 ForceSendFields []string `json:"-"`
564
565
566
567
568
569
570
571 NullFields []string `json:"-"`
572 }
573
574 func (s *SurveyQuestionImage) MarshalJSON() ([]byte, error) {
575 type NoMethod SurveyQuestionImage
576 raw := NoMethod(*s)
577 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
578 }
579
580 type SurveyRejection struct {
581 Explanation string `json:"explanation,omitempty"`
582
583 Type string `json:"type,omitempty"`
584
585
586
587
588
589
590
591 ForceSendFields []string `json:"-"`
592
593
594
595
596
597
598
599 NullFields []string `json:"-"`
600 }
601
602 func (s *SurveyRejection) MarshalJSON() ([]byte, error) {
603 type NoMethod SurveyRejection
604 raw := NoMethod(*s)
605 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
606 }
607
608 type SurveyResults struct {
609 Status string `json:"status,omitempty"`
610
611 SurveyUrlId string `json:"surveyUrlId,omitempty"`
612
613
614
615 googleapi.ServerResponse `json:"-"`
616
617
618
619
620
621
622
623 ForceSendFields []string `json:"-"`
624
625
626
627
628
629
630
631 NullFields []string `json:"-"`
632 }
633
634 func (s *SurveyResults) MarshalJSON() ([]byte, error) {
635 type NoMethod SurveyResults
636 raw := NoMethod(*s)
637 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
638 }
639
640 type SurveysDeleteResponse struct {
641
642
643 RequestId string `json:"requestId,omitempty"`
644
645
646
647 googleapi.ServerResponse `json:"-"`
648
649
650
651
652
653
654
655 ForceSendFields []string `json:"-"`
656
657
658
659
660
661
662
663 NullFields []string `json:"-"`
664 }
665
666 func (s *SurveysDeleteResponse) MarshalJSON() ([]byte, error) {
667 type NoMethod SurveysDeleteResponse
668 raw := NoMethod(*s)
669 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
670 }
671
672 type SurveysListResponse struct {
673 PageInfo *PageInfo `json:"pageInfo,omitempty"`
674
675
676
677 RequestId string `json:"requestId,omitempty"`
678
679
680 Resources []*Survey `json:"resources,omitempty"`
681
682 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
683
684
685
686 googleapi.ServerResponse `json:"-"`
687
688
689
690
691
692
693
694 ForceSendFields []string `json:"-"`
695
696
697
698
699
700
701
702 NullFields []string `json:"-"`
703 }
704
705 func (s *SurveysListResponse) MarshalJSON() ([]byte, error) {
706 type NoMethod SurveysListResponse
707 raw := NoMethod(*s)
708 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
709 }
710
711 type SurveysStartRequest struct {
712
713
714
715 MaxCostPerResponseNanos int64 `json:"maxCostPerResponseNanos,omitempty,string"`
716
717
718
719
720
721
722
723
724 ForceSendFields []string `json:"-"`
725
726
727
728
729
730
731
732
733 NullFields []string `json:"-"`
734 }
735
736 func (s *SurveysStartRequest) MarshalJSON() ([]byte, error) {
737 type NoMethod SurveysStartRequest
738 raw := NoMethod(*s)
739 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
740 }
741
742 type SurveysStartResponse struct {
743
744
745 RequestId string `json:"requestId,omitempty"`
746
747
748
749 googleapi.ServerResponse `json:"-"`
750
751
752
753
754
755
756
757 ForceSendFields []string `json:"-"`
758
759
760
761
762
763
764
765 NullFields []string `json:"-"`
766 }
767
768 func (s *SurveysStartResponse) MarshalJSON() ([]byte, error) {
769 type NoMethod SurveysStartResponse
770 raw := NoMethod(*s)
771 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
772 }
773
774 type SurveysStopResponse struct {
775
776
777 RequestId string `json:"requestId,omitempty"`
778
779
780
781 googleapi.ServerResponse `json:"-"`
782
783
784
785
786
787
788
789 ForceSendFields []string `json:"-"`
790
791
792
793
794
795
796
797 NullFields []string `json:"-"`
798 }
799
800 func (s *SurveysStopResponse) MarshalJSON() ([]byte, error) {
801 type NoMethod SurveysStopResponse
802 raw := NoMethod(*s)
803 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
804 }
805
806 type TokenPagination struct {
807 NextPageToken string `json:"nextPageToken,omitempty"`
808
809 PreviousPageToken string `json:"previousPageToken,omitempty"`
810
811
812
813
814
815
816
817 ForceSendFields []string `json:"-"`
818
819
820
821
822
823
824
825 NullFields []string `json:"-"`
826 }
827
828 func (s *TokenPagination) MarshalJSON() ([]byte, error) {
829 type NoMethod TokenPagination
830 raw := NoMethod(*s)
831 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
832 }
833
834
835
836 type MobileapppanelsGetCall struct {
837 s *Service
838 panelId string
839 urlParams_ gensupport.URLParams
840 ifNoneMatch_ string
841 ctx_ context.Context
842 header_ http.Header
843 }
844
845
846
847 func (r *MobileapppanelsService) Get(panelId string) *MobileapppanelsGetCall {
848 c := &MobileapppanelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
849 c.panelId = panelId
850 return c
851 }
852
853
854
855
856 func (c *MobileapppanelsGetCall) Fields(s ...googleapi.Field) *MobileapppanelsGetCall {
857 c.urlParams_.Set("fields", googleapi.CombineFields(s))
858 return c
859 }
860
861
862
863
864
865
866 func (c *MobileapppanelsGetCall) IfNoneMatch(entityTag string) *MobileapppanelsGetCall {
867 c.ifNoneMatch_ = entityTag
868 return c
869 }
870
871
872
873
874 func (c *MobileapppanelsGetCall) Context(ctx context.Context) *MobileapppanelsGetCall {
875 c.ctx_ = ctx
876 return c
877 }
878
879
880
881 func (c *MobileapppanelsGetCall) Header() http.Header {
882 if c.header_ == nil {
883 c.header_ = make(http.Header)
884 }
885 return c.header_
886 }
887
888 func (c *MobileapppanelsGetCall) doRequest(alt string) (*http.Response, error) {
889 reqHeaders := make(http.Header)
890 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
891 for k, v := range c.header_ {
892 reqHeaders[k] = v
893 }
894 reqHeaders.Set("User-Agent", c.s.userAgent())
895 if c.ifNoneMatch_ != "" {
896 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
897 }
898 var body io.Reader = nil
899 c.urlParams_.Set("alt", alt)
900 c.urlParams_.Set("prettyPrint", "false")
901 urls := googleapi.ResolveRelative(c.s.BasePath, "mobileAppPanels/{panelId}")
902 urls += "?" + c.urlParams_.Encode()
903 req, err := http.NewRequest("GET", urls, body)
904 if err != nil {
905 return nil, err
906 }
907 req.Header = reqHeaders
908 googleapi.Expand(req.URL, map[string]string{
909 "panelId": c.panelId,
910 })
911 return gensupport.SendRequest(c.ctx_, c.s.client, req)
912 }
913
914
915
916
917
918
919
920
921 func (c *MobileapppanelsGetCall) Do(opts ...googleapi.CallOption) (*MobileAppPanel, error) {
922 gensupport.SetOptions(c.urlParams_, opts...)
923 res, err := c.doRequest("json")
924 if res != nil && res.StatusCode == http.StatusNotModified {
925 if res.Body != nil {
926 res.Body.Close()
927 }
928 return nil, &googleapi.Error{
929 Code: res.StatusCode,
930 Header: res.Header,
931 }
932 }
933 if err != nil {
934 return nil, err
935 }
936 defer googleapi.CloseBody(res)
937 if err := googleapi.CheckResponse(res); err != nil {
938 return nil, err
939 }
940 ret := &MobileAppPanel{
941 ServerResponse: googleapi.ServerResponse{
942 Header: res.Header,
943 HTTPStatusCode: res.StatusCode,
944 },
945 }
946 target := &ret
947 if err := gensupport.DecodeResponse(target, res); err != nil {
948 return nil, err
949 }
950 return ret, nil
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977 }
978
979
980
981 type MobileapppanelsListCall struct {
982 s *Service
983 urlParams_ gensupport.URLParams
984 ifNoneMatch_ string
985 ctx_ context.Context
986 header_ http.Header
987 }
988
989
990 func (r *MobileapppanelsService) List() *MobileapppanelsListCall {
991 c := &MobileapppanelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
992 return c
993 }
994
995
996 func (c *MobileapppanelsListCall) MaxResults(maxResults int64) *MobileapppanelsListCall {
997 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
998 return c
999 }
1000
1001
1002 func (c *MobileapppanelsListCall) StartIndex(startIndex int64) *MobileapppanelsListCall {
1003 c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
1004 return c
1005 }
1006
1007
1008 func (c *MobileapppanelsListCall) Token(token string) *MobileapppanelsListCall {
1009 c.urlParams_.Set("token", token)
1010 return c
1011 }
1012
1013
1014
1015
1016 func (c *MobileapppanelsListCall) Fields(s ...googleapi.Field) *MobileapppanelsListCall {
1017 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1018 return c
1019 }
1020
1021
1022
1023
1024
1025
1026 func (c *MobileapppanelsListCall) IfNoneMatch(entityTag string) *MobileapppanelsListCall {
1027 c.ifNoneMatch_ = entityTag
1028 return c
1029 }
1030
1031
1032
1033
1034 func (c *MobileapppanelsListCall) Context(ctx context.Context) *MobileapppanelsListCall {
1035 c.ctx_ = ctx
1036 return c
1037 }
1038
1039
1040
1041 func (c *MobileapppanelsListCall) Header() http.Header {
1042 if c.header_ == nil {
1043 c.header_ = make(http.Header)
1044 }
1045 return c.header_
1046 }
1047
1048 func (c *MobileapppanelsListCall) doRequest(alt string) (*http.Response, error) {
1049 reqHeaders := make(http.Header)
1050 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1051 for k, v := range c.header_ {
1052 reqHeaders[k] = v
1053 }
1054 reqHeaders.Set("User-Agent", c.s.userAgent())
1055 if c.ifNoneMatch_ != "" {
1056 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1057 }
1058 var body io.Reader = nil
1059 c.urlParams_.Set("alt", alt)
1060 c.urlParams_.Set("prettyPrint", "false")
1061 urls := googleapi.ResolveRelative(c.s.BasePath, "mobileAppPanels")
1062 urls += "?" + c.urlParams_.Encode()
1063 req, err := http.NewRequest("GET", urls, body)
1064 if err != nil {
1065 return nil, err
1066 }
1067 req.Header = reqHeaders
1068 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1069 }
1070
1071
1072
1073
1074
1075
1076
1077
1078 func (c *MobileapppanelsListCall) Do(opts ...googleapi.CallOption) (*MobileAppPanelsListResponse, error) {
1079 gensupport.SetOptions(c.urlParams_, opts...)
1080 res, err := c.doRequest("json")
1081 if res != nil && res.StatusCode == http.StatusNotModified {
1082 if res.Body != nil {
1083 res.Body.Close()
1084 }
1085 return nil, &googleapi.Error{
1086 Code: res.StatusCode,
1087 Header: res.Header,
1088 }
1089 }
1090 if err != nil {
1091 return nil, err
1092 }
1093 defer googleapi.CloseBody(res)
1094 if err := googleapi.CheckResponse(res); err != nil {
1095 return nil, err
1096 }
1097 ret := &MobileAppPanelsListResponse{
1098 ServerResponse: googleapi.ServerResponse{
1099 Header: res.Header,
1100 HTTPStatusCode: res.StatusCode,
1101 },
1102 }
1103 target := &ret
1104 if err := gensupport.DecodeResponse(target, res); err != nil {
1105 return nil, err
1106 }
1107 return ret, nil
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139 }
1140
1141
1142
1143 type MobileapppanelsUpdateCall struct {
1144 s *Service
1145 panelId string
1146 mobileapppanel *MobileAppPanel
1147 urlParams_ gensupport.URLParams
1148 ctx_ context.Context
1149 header_ http.Header
1150 }
1151
1152
1153
1154 func (r *MobileapppanelsService) Update(panelId string, mobileapppanel *MobileAppPanel) *MobileapppanelsUpdateCall {
1155 c := &MobileapppanelsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1156 c.panelId = panelId
1157 c.mobileapppanel = mobileapppanel
1158 return c
1159 }
1160
1161
1162
1163
1164 func (c *MobileapppanelsUpdateCall) Fields(s ...googleapi.Field) *MobileapppanelsUpdateCall {
1165 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1166 return c
1167 }
1168
1169
1170
1171
1172 func (c *MobileapppanelsUpdateCall) Context(ctx context.Context) *MobileapppanelsUpdateCall {
1173 c.ctx_ = ctx
1174 return c
1175 }
1176
1177
1178
1179 func (c *MobileapppanelsUpdateCall) Header() http.Header {
1180 if c.header_ == nil {
1181 c.header_ = make(http.Header)
1182 }
1183 return c.header_
1184 }
1185
1186 func (c *MobileapppanelsUpdateCall) doRequest(alt string) (*http.Response, error) {
1187 reqHeaders := make(http.Header)
1188 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1189 for k, v := range c.header_ {
1190 reqHeaders[k] = v
1191 }
1192 reqHeaders.Set("User-Agent", c.s.userAgent())
1193 var body io.Reader = nil
1194 body, err := googleapi.WithoutDataWrapper.JSONReader(c.mobileapppanel)
1195 if err != nil {
1196 return nil, err
1197 }
1198 reqHeaders.Set("Content-Type", "application/json")
1199 c.urlParams_.Set("alt", alt)
1200 c.urlParams_.Set("prettyPrint", "false")
1201 urls := googleapi.ResolveRelative(c.s.BasePath, "mobileAppPanels/{panelId}")
1202 urls += "?" + c.urlParams_.Encode()
1203 req, err := http.NewRequest("PUT", urls, body)
1204 if err != nil {
1205 return nil, err
1206 }
1207 req.Header = reqHeaders
1208 googleapi.Expand(req.URL, map[string]string{
1209 "panelId": c.panelId,
1210 })
1211 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1212 }
1213
1214
1215
1216
1217
1218
1219
1220
1221 func (c *MobileapppanelsUpdateCall) Do(opts ...googleapi.CallOption) (*MobileAppPanel, error) {
1222 gensupport.SetOptions(c.urlParams_, opts...)
1223 res, err := c.doRequest("json")
1224 if res != nil && res.StatusCode == http.StatusNotModified {
1225 if res.Body != nil {
1226 res.Body.Close()
1227 }
1228 return nil, &googleapi.Error{
1229 Code: res.StatusCode,
1230 Header: res.Header,
1231 }
1232 }
1233 if err != nil {
1234 return nil, err
1235 }
1236 defer googleapi.CloseBody(res)
1237 if err := googleapi.CheckResponse(res); err != nil {
1238 return nil, err
1239 }
1240 ret := &MobileAppPanel{
1241 ServerResponse: googleapi.ServerResponse{
1242 Header: res.Header,
1243 HTTPStatusCode: res.StatusCode,
1244 },
1245 }
1246 target := &ret
1247 if err := gensupport.DecodeResponse(target, res); err != nil {
1248 return nil, err
1249 }
1250 return ret, nil
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279 }
1280
1281
1282
1283 type ResultsGetCall struct {
1284 s *Service
1285 surveyUrlId string
1286 resultsgetrequest *ResultsGetRequest
1287 urlParams_ gensupport.URLParams
1288 ifNoneMatch_ string
1289 ctx_ context.Context
1290 header_ http.Header
1291 }
1292
1293
1294
1295
1296 func (r *ResultsService) Get(surveyUrlId string, resultsgetrequest *ResultsGetRequest) *ResultsGetCall {
1297 c := &ResultsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1298 c.surveyUrlId = surveyUrlId
1299 c.resultsgetrequest = resultsgetrequest
1300 return c
1301 }
1302
1303
1304
1305
1306 func (c *ResultsGetCall) Fields(s ...googleapi.Field) *ResultsGetCall {
1307 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1308 return c
1309 }
1310
1311
1312
1313
1314
1315
1316 func (c *ResultsGetCall) IfNoneMatch(entityTag string) *ResultsGetCall {
1317 c.ifNoneMatch_ = entityTag
1318 return c
1319 }
1320
1321
1322
1323
1324 func (c *ResultsGetCall) Context(ctx context.Context) *ResultsGetCall {
1325 c.ctx_ = ctx
1326 return c
1327 }
1328
1329
1330
1331 func (c *ResultsGetCall) Header() http.Header {
1332 if c.header_ == nil {
1333 c.header_ = make(http.Header)
1334 }
1335 return c.header_
1336 }
1337
1338 func (c *ResultsGetCall) doRequest(alt string) (*http.Response, error) {
1339 reqHeaders := make(http.Header)
1340 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1341 for k, v := range c.header_ {
1342 reqHeaders[k] = v
1343 }
1344 reqHeaders.Set("User-Agent", c.s.userAgent())
1345 if c.ifNoneMatch_ != "" {
1346 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1347 }
1348 var body io.Reader = nil
1349 c.urlParams_.Set("alt", alt)
1350 c.urlParams_.Set("prettyPrint", "false")
1351 urls := googleapi.ResolveRelative(c.s.BasePath, "surveys/{surveyUrlId}/results")
1352 urls += "?" + c.urlParams_.Encode()
1353 req, err := http.NewRequest("GET", urls, body)
1354 if err != nil {
1355 return nil, err
1356 }
1357 req.Header = reqHeaders
1358 googleapi.Expand(req.URL, map[string]string{
1359 "surveyUrlId": c.surveyUrlId,
1360 })
1361 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1362 }
1363
1364
1365
1366
1367 func (c *ResultsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
1368 gensupport.SetOptions(c.urlParams_, opts...)
1369 res, err := c.doRequest("media")
1370 if err != nil {
1371 return nil, err
1372 }
1373 if err := googleapi.CheckMediaResponse(res); err != nil {
1374 res.Body.Close()
1375 return nil, err
1376 }
1377 return res, nil
1378 }
1379
1380
1381
1382
1383
1384
1385
1386
1387 func (c *ResultsGetCall) Do(opts ...googleapi.CallOption) (*SurveyResults, error) {
1388 gensupport.SetOptions(c.urlParams_, opts...)
1389 res, err := c.doRequest("json")
1390 if res != nil && res.StatusCode == http.StatusNotModified {
1391 if res.Body != nil {
1392 res.Body.Close()
1393 }
1394 return nil, &googleapi.Error{
1395 Code: res.StatusCode,
1396 Header: res.Header,
1397 }
1398 }
1399 if err != nil {
1400 return nil, err
1401 }
1402 defer googleapi.CloseBody(res)
1403 if err := googleapi.CheckResponse(res); err != nil {
1404 return nil, err
1405 }
1406 ret := &SurveyResults{
1407 ServerResponse: googleapi.ServerResponse{
1408 Header: res.Header,
1409 HTTPStatusCode: res.StatusCode,
1410 },
1411 }
1412 target := &ret
1413 if err := gensupport.DecodeResponse(target, res); err != nil {
1414 return nil, err
1415 }
1416 return ret, nil
1417
1418
1419
1420
1421
1422
1423
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 type SurveysDeleteCall struct {
1452 s *Service
1453 surveyUrlId string
1454 urlParams_ gensupport.URLParams
1455 ctx_ context.Context
1456 header_ http.Header
1457 }
1458
1459
1460 func (r *SurveysService) Delete(surveyUrlId string) *SurveysDeleteCall {
1461 c := &SurveysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1462 c.surveyUrlId = surveyUrlId
1463 return c
1464 }
1465
1466
1467
1468
1469 func (c *SurveysDeleteCall) Fields(s ...googleapi.Field) *SurveysDeleteCall {
1470 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1471 return c
1472 }
1473
1474
1475
1476
1477 func (c *SurveysDeleteCall) Context(ctx context.Context) *SurveysDeleteCall {
1478 c.ctx_ = ctx
1479 return c
1480 }
1481
1482
1483
1484 func (c *SurveysDeleteCall) Header() http.Header {
1485 if c.header_ == nil {
1486 c.header_ = make(http.Header)
1487 }
1488 return c.header_
1489 }
1490
1491 func (c *SurveysDeleteCall) doRequest(alt string) (*http.Response, error) {
1492 reqHeaders := make(http.Header)
1493 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1494 for k, v := range c.header_ {
1495 reqHeaders[k] = v
1496 }
1497 reqHeaders.Set("User-Agent", c.s.userAgent())
1498 var body io.Reader = nil
1499 c.urlParams_.Set("alt", alt)
1500 c.urlParams_.Set("prettyPrint", "false")
1501 urls := googleapi.ResolveRelative(c.s.BasePath, "surveys/{surveyUrlId}")
1502 urls += "?" + c.urlParams_.Encode()
1503 req, err := http.NewRequest("DELETE", urls, body)
1504 if err != nil {
1505 return nil, err
1506 }
1507 req.Header = reqHeaders
1508 googleapi.Expand(req.URL, map[string]string{
1509 "surveyUrlId": c.surveyUrlId,
1510 })
1511 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1512 }
1513
1514
1515
1516
1517
1518
1519
1520
1521 func (c *SurveysDeleteCall) Do(opts ...googleapi.CallOption) (*SurveysDeleteResponse, error) {
1522 gensupport.SetOptions(c.urlParams_, opts...)
1523 res, err := c.doRequest("json")
1524 if res != nil && res.StatusCode == http.StatusNotModified {
1525 if res.Body != nil {
1526 res.Body.Close()
1527 }
1528 return nil, &googleapi.Error{
1529 Code: res.StatusCode,
1530 Header: res.Header,
1531 }
1532 }
1533 if err != nil {
1534 return nil, err
1535 }
1536 defer googleapi.CloseBody(res)
1537 if err := googleapi.CheckResponse(res); err != nil {
1538 return nil, err
1539 }
1540 ret := &SurveysDeleteResponse{
1541 ServerResponse: googleapi.ServerResponse{
1542 Header: res.Header,
1543 HTTPStatusCode: res.StatusCode,
1544 },
1545 }
1546 target := &ret
1547 if err := gensupport.DecodeResponse(target, res); err != nil {
1548 return nil, err
1549 }
1550 return ret, nil
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576 }
1577
1578
1579
1580 type SurveysGetCall struct {
1581 s *Service
1582 surveyUrlId string
1583 urlParams_ gensupport.URLParams
1584 ifNoneMatch_ string
1585 ctx_ context.Context
1586 header_ http.Header
1587 }
1588
1589
1590 func (r *SurveysService) Get(surveyUrlId string) *SurveysGetCall {
1591 c := &SurveysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1592 c.surveyUrlId = surveyUrlId
1593 return c
1594 }
1595
1596
1597
1598
1599 func (c *SurveysGetCall) Fields(s ...googleapi.Field) *SurveysGetCall {
1600 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1601 return c
1602 }
1603
1604
1605
1606
1607
1608
1609 func (c *SurveysGetCall) IfNoneMatch(entityTag string) *SurveysGetCall {
1610 c.ifNoneMatch_ = entityTag
1611 return c
1612 }
1613
1614
1615
1616
1617 func (c *SurveysGetCall) Context(ctx context.Context) *SurveysGetCall {
1618 c.ctx_ = ctx
1619 return c
1620 }
1621
1622
1623
1624 func (c *SurveysGetCall) Header() http.Header {
1625 if c.header_ == nil {
1626 c.header_ = make(http.Header)
1627 }
1628 return c.header_
1629 }
1630
1631 func (c *SurveysGetCall) doRequest(alt string) (*http.Response, error) {
1632 reqHeaders := make(http.Header)
1633 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1634 for k, v := range c.header_ {
1635 reqHeaders[k] = v
1636 }
1637 reqHeaders.Set("User-Agent", c.s.userAgent())
1638 if c.ifNoneMatch_ != "" {
1639 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1640 }
1641 var body io.Reader = nil
1642 c.urlParams_.Set("alt", alt)
1643 c.urlParams_.Set("prettyPrint", "false")
1644 urls := googleapi.ResolveRelative(c.s.BasePath, "surveys/{surveyUrlId}")
1645 urls += "?" + c.urlParams_.Encode()
1646 req, err := http.NewRequest("GET", urls, body)
1647 if err != nil {
1648 return nil, err
1649 }
1650 req.Header = reqHeaders
1651 googleapi.Expand(req.URL, map[string]string{
1652 "surveyUrlId": c.surveyUrlId,
1653 })
1654 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1655 }
1656
1657
1658
1659
1660
1661
1662
1663
1664 func (c *SurveysGetCall) Do(opts ...googleapi.CallOption) (*Survey, error) {
1665 gensupport.SetOptions(c.urlParams_, opts...)
1666 res, err := c.doRequest("json")
1667 if res != nil && res.StatusCode == http.StatusNotModified {
1668 if res.Body != nil {
1669 res.Body.Close()
1670 }
1671 return nil, &googleapi.Error{
1672 Code: res.StatusCode,
1673 Header: res.Header,
1674 }
1675 }
1676 if err != nil {
1677 return nil, err
1678 }
1679 defer googleapi.CloseBody(res)
1680 if err := googleapi.CheckResponse(res); err != nil {
1681 return nil, err
1682 }
1683 ret := &Survey{
1684 ServerResponse: googleapi.ServerResponse{
1685 Header: res.Header,
1686 HTTPStatusCode: res.StatusCode,
1687 },
1688 }
1689 target := &ret
1690 if err := gensupport.DecodeResponse(target, res); err != nil {
1691 return nil, err
1692 }
1693 return ret, nil
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720 }
1721
1722
1723
1724 type SurveysInsertCall struct {
1725 s *Service
1726 survey *Survey
1727 urlParams_ gensupport.URLParams
1728 ctx_ context.Context
1729 header_ http.Header
1730 }
1731
1732
1733 func (r *SurveysService) Insert(survey *Survey) *SurveysInsertCall {
1734 c := &SurveysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1735 c.survey = survey
1736 return c
1737 }
1738
1739
1740
1741
1742 func (c *SurveysInsertCall) Fields(s ...googleapi.Field) *SurveysInsertCall {
1743 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1744 return c
1745 }
1746
1747
1748
1749
1750 func (c *SurveysInsertCall) Context(ctx context.Context) *SurveysInsertCall {
1751 c.ctx_ = ctx
1752 return c
1753 }
1754
1755
1756
1757 func (c *SurveysInsertCall) Header() http.Header {
1758 if c.header_ == nil {
1759 c.header_ = make(http.Header)
1760 }
1761 return c.header_
1762 }
1763
1764 func (c *SurveysInsertCall) doRequest(alt string) (*http.Response, error) {
1765 reqHeaders := make(http.Header)
1766 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1767 for k, v := range c.header_ {
1768 reqHeaders[k] = v
1769 }
1770 reqHeaders.Set("User-Agent", c.s.userAgent())
1771 var body io.Reader = nil
1772 body, err := googleapi.WithoutDataWrapper.JSONReader(c.survey)
1773 if err != nil {
1774 return nil, err
1775 }
1776 reqHeaders.Set("Content-Type", "application/json")
1777 c.urlParams_.Set("alt", alt)
1778 c.urlParams_.Set("prettyPrint", "false")
1779 urls := googleapi.ResolveRelative(c.s.BasePath, "surveys")
1780 urls += "?" + c.urlParams_.Encode()
1781 req, err := http.NewRequest("POST", urls, body)
1782 if err != nil {
1783 return nil, err
1784 }
1785 req.Header = reqHeaders
1786 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1787 }
1788
1789
1790
1791
1792
1793
1794
1795
1796 func (c *SurveysInsertCall) Do(opts ...googleapi.CallOption) (*Survey, error) {
1797 gensupport.SetOptions(c.urlParams_, opts...)
1798 res, err := c.doRequest("json")
1799 if res != nil && res.StatusCode == http.StatusNotModified {
1800 if res.Body != nil {
1801 res.Body.Close()
1802 }
1803 return nil, &googleapi.Error{
1804 Code: res.StatusCode,
1805 Header: res.Header,
1806 }
1807 }
1808 if err != nil {
1809 return nil, err
1810 }
1811 defer googleapi.CloseBody(res)
1812 if err := googleapi.CheckResponse(res); err != nil {
1813 return nil, err
1814 }
1815 ret := &Survey{
1816 ServerResponse: googleapi.ServerResponse{
1817 Header: res.Header,
1818 HTTPStatusCode: res.StatusCode,
1819 },
1820 }
1821 target := &ret
1822 if err := gensupport.DecodeResponse(target, res); err != nil {
1823 return nil, err
1824 }
1825 return ret, nil
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843 }
1844
1845
1846
1847 type SurveysListCall struct {
1848 s *Service
1849 urlParams_ gensupport.URLParams
1850 ifNoneMatch_ string
1851 ctx_ context.Context
1852 header_ http.Header
1853 }
1854
1855
1856 func (r *SurveysService) List() *SurveysListCall {
1857 c := &SurveysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1858 return c
1859 }
1860
1861
1862 func (c *SurveysListCall) MaxResults(maxResults int64) *SurveysListCall {
1863 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1864 return c
1865 }
1866
1867
1868 func (c *SurveysListCall) StartIndex(startIndex int64) *SurveysListCall {
1869 c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
1870 return c
1871 }
1872
1873
1874 func (c *SurveysListCall) Token(token string) *SurveysListCall {
1875 c.urlParams_.Set("token", token)
1876 return c
1877 }
1878
1879
1880
1881
1882 func (c *SurveysListCall) Fields(s ...googleapi.Field) *SurveysListCall {
1883 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1884 return c
1885 }
1886
1887
1888
1889
1890
1891
1892 func (c *SurveysListCall) IfNoneMatch(entityTag string) *SurveysListCall {
1893 c.ifNoneMatch_ = entityTag
1894 return c
1895 }
1896
1897
1898
1899
1900 func (c *SurveysListCall) Context(ctx context.Context) *SurveysListCall {
1901 c.ctx_ = ctx
1902 return c
1903 }
1904
1905
1906
1907 func (c *SurveysListCall) Header() http.Header {
1908 if c.header_ == nil {
1909 c.header_ = make(http.Header)
1910 }
1911 return c.header_
1912 }
1913
1914 func (c *SurveysListCall) doRequest(alt string) (*http.Response, error) {
1915 reqHeaders := make(http.Header)
1916 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1917 for k, v := range c.header_ {
1918 reqHeaders[k] = v
1919 }
1920 reqHeaders.Set("User-Agent", c.s.userAgent())
1921 if c.ifNoneMatch_ != "" {
1922 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1923 }
1924 var body io.Reader = nil
1925 c.urlParams_.Set("alt", alt)
1926 c.urlParams_.Set("prettyPrint", "false")
1927 urls := googleapi.ResolveRelative(c.s.BasePath, "surveys")
1928 urls += "?" + c.urlParams_.Encode()
1929 req, err := http.NewRequest("GET", urls, body)
1930 if err != nil {
1931 return nil, err
1932 }
1933 req.Header = reqHeaders
1934 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1935 }
1936
1937
1938
1939
1940
1941
1942
1943
1944 func (c *SurveysListCall) Do(opts ...googleapi.CallOption) (*SurveysListResponse, error) {
1945 gensupport.SetOptions(c.urlParams_, opts...)
1946 res, err := c.doRequest("json")
1947 if res != nil && res.StatusCode == http.StatusNotModified {
1948 if res.Body != nil {
1949 res.Body.Close()
1950 }
1951 return nil, &googleapi.Error{
1952 Code: res.StatusCode,
1953 Header: res.Header,
1954 }
1955 }
1956 if err != nil {
1957 return nil, err
1958 }
1959 defer googleapi.CloseBody(res)
1960 if err := googleapi.CheckResponse(res); err != nil {
1961 return nil, err
1962 }
1963 ret := &SurveysListResponse{
1964 ServerResponse: googleapi.ServerResponse{
1965 Header: res.Header,
1966 HTTPStatusCode: res.StatusCode,
1967 },
1968 }
1969 target := &ret
1970 if err := gensupport.DecodeResponse(target, res); err != nil {
1971 return nil, err
1972 }
1973 return ret, nil
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005 }
2006
2007
2008
2009 type SurveysStartCall struct {
2010 s *Service
2011 resourceId string
2012 surveysstartrequest *SurveysStartRequest
2013 urlParams_ gensupport.URLParams
2014 ctx_ context.Context
2015 header_ http.Header
2016 }
2017
2018
2019 func (r *SurveysService) Start(resourceId string, surveysstartrequest *SurveysStartRequest) *SurveysStartCall {
2020 c := &SurveysStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2021 c.resourceId = resourceId
2022 c.surveysstartrequest = surveysstartrequest
2023 return c
2024 }
2025
2026
2027
2028
2029 func (c *SurveysStartCall) Fields(s ...googleapi.Field) *SurveysStartCall {
2030 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2031 return c
2032 }
2033
2034
2035
2036
2037 func (c *SurveysStartCall) Context(ctx context.Context) *SurveysStartCall {
2038 c.ctx_ = ctx
2039 return c
2040 }
2041
2042
2043
2044 func (c *SurveysStartCall) Header() http.Header {
2045 if c.header_ == nil {
2046 c.header_ = make(http.Header)
2047 }
2048 return c.header_
2049 }
2050
2051 func (c *SurveysStartCall) doRequest(alt string) (*http.Response, error) {
2052 reqHeaders := make(http.Header)
2053 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2054 for k, v := range c.header_ {
2055 reqHeaders[k] = v
2056 }
2057 reqHeaders.Set("User-Agent", c.s.userAgent())
2058 var body io.Reader = nil
2059 body, err := googleapi.WithoutDataWrapper.JSONReader(c.surveysstartrequest)
2060 if err != nil {
2061 return nil, err
2062 }
2063 reqHeaders.Set("Content-Type", "application/json")
2064 c.urlParams_.Set("alt", alt)
2065 c.urlParams_.Set("prettyPrint", "false")
2066 urls := googleapi.ResolveRelative(c.s.BasePath, "surveys/{resourceId}/start")
2067 urls += "?" + c.urlParams_.Encode()
2068 req, err := http.NewRequest("POST", urls, body)
2069 if err != nil {
2070 return nil, err
2071 }
2072 req.Header = reqHeaders
2073 googleapi.Expand(req.URL, map[string]string{
2074 "resourceId": c.resourceId,
2075 })
2076 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2077 }
2078
2079
2080
2081
2082
2083
2084
2085
2086 func (c *SurveysStartCall) Do(opts ...googleapi.CallOption) (*SurveysStartResponse, error) {
2087 gensupport.SetOptions(c.urlParams_, opts...)
2088 res, err := c.doRequest("json")
2089 if res != nil && res.StatusCode == http.StatusNotModified {
2090 if res.Body != nil {
2091 res.Body.Close()
2092 }
2093 return nil, &googleapi.Error{
2094 Code: res.StatusCode,
2095 Header: res.Header,
2096 }
2097 }
2098 if err != nil {
2099 return nil, err
2100 }
2101 defer googleapi.CloseBody(res)
2102 if err := googleapi.CheckResponse(res); err != nil {
2103 return nil, err
2104 }
2105 ret := &SurveysStartResponse{
2106 ServerResponse: googleapi.ServerResponse{
2107 Header: res.Header,
2108 HTTPStatusCode: res.StatusCode,
2109 },
2110 }
2111 target := &ret
2112 if err := gensupport.DecodeResponse(target, res); err != nil {
2113 return nil, err
2114 }
2115 return ret, nil
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143 }
2144
2145
2146
2147 type SurveysStopCall struct {
2148 s *Service
2149 resourceId string
2150 urlParams_ gensupport.URLParams
2151 ctx_ context.Context
2152 header_ http.Header
2153 }
2154
2155
2156 func (r *SurveysService) Stop(resourceId string) *SurveysStopCall {
2157 c := &SurveysStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2158 c.resourceId = resourceId
2159 return c
2160 }
2161
2162
2163
2164
2165 func (c *SurveysStopCall) Fields(s ...googleapi.Field) *SurveysStopCall {
2166 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2167 return c
2168 }
2169
2170
2171
2172
2173 func (c *SurveysStopCall) Context(ctx context.Context) *SurveysStopCall {
2174 c.ctx_ = ctx
2175 return c
2176 }
2177
2178
2179
2180 func (c *SurveysStopCall) Header() http.Header {
2181 if c.header_ == nil {
2182 c.header_ = make(http.Header)
2183 }
2184 return c.header_
2185 }
2186
2187 func (c *SurveysStopCall) doRequest(alt string) (*http.Response, error) {
2188 reqHeaders := make(http.Header)
2189 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2190 for k, v := range c.header_ {
2191 reqHeaders[k] = v
2192 }
2193 reqHeaders.Set("User-Agent", c.s.userAgent())
2194 var body io.Reader = nil
2195 c.urlParams_.Set("alt", alt)
2196 c.urlParams_.Set("prettyPrint", "false")
2197 urls := googleapi.ResolveRelative(c.s.BasePath, "surveys/{resourceId}/stop")
2198 urls += "?" + c.urlParams_.Encode()
2199 req, err := http.NewRequest("POST", urls, body)
2200 if err != nil {
2201 return nil, err
2202 }
2203 req.Header = reqHeaders
2204 googleapi.Expand(req.URL, map[string]string{
2205 "resourceId": c.resourceId,
2206 })
2207 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2208 }
2209
2210
2211
2212
2213
2214
2215
2216
2217 func (c *SurveysStopCall) Do(opts ...googleapi.CallOption) (*SurveysStopResponse, error) {
2218 gensupport.SetOptions(c.urlParams_, opts...)
2219 res, err := c.doRequest("json")
2220 if res != nil && res.StatusCode == http.StatusNotModified {
2221 if res.Body != nil {
2222 res.Body.Close()
2223 }
2224 return nil, &googleapi.Error{
2225 Code: res.StatusCode,
2226 Header: res.Header,
2227 }
2228 }
2229 if err != nil {
2230 return nil, err
2231 }
2232 defer googleapi.CloseBody(res)
2233 if err := googleapi.CheckResponse(res); err != nil {
2234 return nil, err
2235 }
2236 ret := &SurveysStopResponse{
2237 ServerResponse: googleapi.ServerResponse{
2238 Header: res.Header,
2239 HTTPStatusCode: res.StatusCode,
2240 },
2241 }
2242 target := &ret
2243 if err := gensupport.DecodeResponse(target, res); err != nil {
2244 return nil, err
2245 }
2246 return ret, nil
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271 }
2272
2273
2274
2275 type SurveysUpdateCall struct {
2276 s *Service
2277 surveyUrlId string
2278 survey *Survey
2279 urlParams_ gensupport.URLParams
2280 ctx_ context.Context
2281 header_ http.Header
2282 }
2283
2284
2285
2286 func (r *SurveysService) Update(surveyUrlId string, survey *Survey) *SurveysUpdateCall {
2287 c := &SurveysUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2288 c.surveyUrlId = surveyUrlId
2289 c.survey = survey
2290 return c
2291 }
2292
2293
2294
2295
2296 func (c *SurveysUpdateCall) Fields(s ...googleapi.Field) *SurveysUpdateCall {
2297 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2298 return c
2299 }
2300
2301
2302
2303
2304 func (c *SurveysUpdateCall) Context(ctx context.Context) *SurveysUpdateCall {
2305 c.ctx_ = ctx
2306 return c
2307 }
2308
2309
2310
2311 func (c *SurveysUpdateCall) Header() http.Header {
2312 if c.header_ == nil {
2313 c.header_ = make(http.Header)
2314 }
2315 return c.header_
2316 }
2317
2318 func (c *SurveysUpdateCall) doRequest(alt string) (*http.Response, error) {
2319 reqHeaders := make(http.Header)
2320 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2321 for k, v := range c.header_ {
2322 reqHeaders[k] = v
2323 }
2324 reqHeaders.Set("User-Agent", c.s.userAgent())
2325 var body io.Reader = nil
2326 body, err := googleapi.WithoutDataWrapper.JSONReader(c.survey)
2327 if err != nil {
2328 return nil, err
2329 }
2330 reqHeaders.Set("Content-Type", "application/json")
2331 c.urlParams_.Set("alt", alt)
2332 c.urlParams_.Set("prettyPrint", "false")
2333 urls := googleapi.ResolveRelative(c.s.BasePath, "surveys/{surveyUrlId}")
2334 urls += "?" + c.urlParams_.Encode()
2335 req, err := http.NewRequest("PUT", urls, body)
2336 if err != nil {
2337 return nil, err
2338 }
2339 req.Header = reqHeaders
2340 googleapi.Expand(req.URL, map[string]string{
2341 "surveyUrlId": c.surveyUrlId,
2342 })
2343 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2344 }
2345
2346
2347
2348
2349
2350
2351
2352
2353 func (c *SurveysUpdateCall) Do(opts ...googleapi.CallOption) (*Survey, error) {
2354 gensupport.SetOptions(c.urlParams_, opts...)
2355 res, err := c.doRequest("json")
2356 if res != nil && res.StatusCode == http.StatusNotModified {
2357 if res.Body != nil {
2358 res.Body.Close()
2359 }
2360 return nil, &googleapi.Error{
2361 Code: res.StatusCode,
2362 Header: res.Header,
2363 }
2364 }
2365 if err != nil {
2366 return nil, err
2367 }
2368 defer googleapi.CloseBody(res)
2369 if err := googleapi.CheckResponse(res); err != nil {
2370 return nil, err
2371 }
2372 ret := &Survey{
2373 ServerResponse: googleapi.ServerResponse{
2374 Header: res.Header,
2375 HTTPStatusCode: res.StatusCode,
2376 },
2377 }
2378 target := &ret
2379 if err := gensupport.DecodeResponse(target, res); err != nil {
2380 return nil, err
2381 }
2382 return ret, nil
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411 }
2412
View as plain text