1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56 package script
57
58 import (
59 "bytes"
60 "context"
61 "encoding/json"
62 "errors"
63 "fmt"
64 "io"
65 "net/http"
66 "net/url"
67 "strconv"
68 "strings"
69
70 googleapi "google.golang.org/api/googleapi"
71 internal "google.golang.org/api/internal"
72 gensupport "google.golang.org/api/internal/gensupport"
73 option "google.golang.org/api/option"
74 internaloption "google.golang.org/api/option/internaloption"
75 htransport "google.golang.org/api/transport/http"
76 )
77
78
79
80 var _ = bytes.NewBuffer
81 var _ = strconv.Itoa
82 var _ = fmt.Sprintf
83 var _ = json.NewDecoder
84 var _ = io.Copy
85 var _ = url.Parse
86 var _ = gensupport.MarshalJSON
87 var _ = googleapi.Version
88 var _ = errors.New
89 var _ = strings.Replace
90 var _ = context.Canceled
91 var _ = internaloption.WithDefaultEndpoint
92 var _ = internal.Version
93
94 const apiId = "script:v1"
95 const apiName = "script"
96 const apiVersion = "v1"
97 const basePath = "https://script.googleapis.com/"
98 const basePathTemplate = "https://script.UNIVERSE_DOMAIN/"
99 const mtlsBasePath = "https://script.mtls.googleapis.com/"
100
101
102 const (
103
104 MailGoogleComScope = "https://mail.google.com/"
105
106
107
108 WwwGoogleComCalendarFeedsScope = "https://www.google.com/calendar/feeds"
109
110
111 WwwGoogleComM8FeedsScope = "https://www.google.com/m8/feeds"
112
113
114 AdminDirectoryGroupScope = "https://www.googleapis.com/auth/admin.directory.group"
115
116
117 AdminDirectoryUserScope = "https://www.googleapis.com/auth/admin.directory.user"
118
119
120 DocumentsScope = "https://www.googleapis.com/auth/documents"
121
122
123 DriveScope = "https://www.googleapis.com/auth/drive"
124
125
126 FormsScope = "https://www.googleapis.com/auth/forms"
127
128
129 FormsCurrentonlyScope = "https://www.googleapis.com/auth/forms.currentonly"
130
131
132 GroupsScope = "https://www.googleapis.com/auth/groups"
133
134
135 ScriptDeploymentsScope = "https://www.googleapis.com/auth/script.deployments"
136
137
138 ScriptDeploymentsReadonlyScope = "https://www.googleapis.com/auth/script.deployments.readonly"
139
140
141 ScriptMetricsScope = "https://www.googleapis.com/auth/script.metrics"
142
143
144 ScriptProcessesScope = "https://www.googleapis.com/auth/script.processes"
145
146
147 ScriptProjectsScope = "https://www.googleapis.com/auth/script.projects"
148
149
150 ScriptProjectsReadonlyScope = "https://www.googleapis.com/auth/script.projects.readonly"
151
152
153 SpreadsheetsScope = "https://www.googleapis.com/auth/spreadsheets"
154
155
156 UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email"
157 )
158
159
160 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
161 scopesOption := internaloption.WithDefaultScopes(
162 "https://mail.google.com/",
163 "https://www.google.com/calendar/feeds",
164 "https://www.google.com/m8/feeds",
165 "https://www.googleapis.com/auth/admin.directory.group",
166 "https://www.googleapis.com/auth/admin.directory.user",
167 "https://www.googleapis.com/auth/documents",
168 "https://www.googleapis.com/auth/drive",
169 "https://www.googleapis.com/auth/forms",
170 "https://www.googleapis.com/auth/forms.currentonly",
171 "https://www.googleapis.com/auth/groups",
172 "https://www.googleapis.com/auth/script.deployments",
173 "https://www.googleapis.com/auth/script.deployments.readonly",
174 "https://www.googleapis.com/auth/script.metrics",
175 "https://www.googleapis.com/auth/script.processes",
176 "https://www.googleapis.com/auth/script.projects",
177 "https://www.googleapis.com/auth/script.projects.readonly",
178 "https://www.googleapis.com/auth/spreadsheets",
179 "https://www.googleapis.com/auth/userinfo.email",
180 )
181
182 opts = append([]option.ClientOption{scopesOption}, opts...)
183 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
184 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
185 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
186 opts = append(opts, internaloption.EnableNewAuthLibrary())
187 client, endpoint, err := htransport.NewClient(ctx, opts...)
188 if err != nil {
189 return nil, err
190 }
191 s, err := New(client)
192 if err != nil {
193 return nil, err
194 }
195 if endpoint != "" {
196 s.BasePath = endpoint
197 }
198 return s, nil
199 }
200
201
202
203
204
205
206 func New(client *http.Client) (*Service, error) {
207 if client == nil {
208 return nil, errors.New("client is nil")
209 }
210 s := &Service{client: client, BasePath: basePath}
211 s.Processes = NewProcessesService(s)
212 s.Projects = NewProjectsService(s)
213 s.Scripts = NewScriptsService(s)
214 return s, nil
215 }
216
217 type Service struct {
218 client *http.Client
219 BasePath string
220 UserAgent string
221
222 Processes *ProcessesService
223
224 Projects *ProjectsService
225
226 Scripts *ScriptsService
227 }
228
229 func (s *Service) userAgent() string {
230 if s.UserAgent == "" {
231 return googleapi.UserAgent
232 }
233 return googleapi.UserAgent + " " + s.UserAgent
234 }
235
236 func NewProcessesService(s *Service) *ProcessesService {
237 rs := &ProcessesService{s: s}
238 return rs
239 }
240
241 type ProcessesService struct {
242 s *Service
243 }
244
245 func NewProjectsService(s *Service) *ProjectsService {
246 rs := &ProjectsService{s: s}
247 rs.Deployments = NewProjectsDeploymentsService(s)
248 rs.Versions = NewProjectsVersionsService(s)
249 return rs
250 }
251
252 type ProjectsService struct {
253 s *Service
254
255 Deployments *ProjectsDeploymentsService
256
257 Versions *ProjectsVersionsService
258 }
259
260 func NewProjectsDeploymentsService(s *Service) *ProjectsDeploymentsService {
261 rs := &ProjectsDeploymentsService{s: s}
262 return rs
263 }
264
265 type ProjectsDeploymentsService struct {
266 s *Service
267 }
268
269 func NewProjectsVersionsService(s *Service) *ProjectsVersionsService {
270 rs := &ProjectsVersionsService{s: s}
271 return rs
272 }
273
274 type ProjectsVersionsService struct {
275 s *Service
276 }
277
278 func NewScriptsService(s *Service) *ScriptsService {
279 rs := &ScriptsService{s: s}
280 return rs
281 }
282
283 type ScriptsService struct {
284 s *Service
285 }
286
287
288 type Content struct {
289
290
291
292 Files []*File `json:"files,omitempty"`
293
294 ScriptId string `json:"scriptId,omitempty"`
295
296
297 googleapi.ServerResponse `json:"-"`
298
299
300
301
302
303 ForceSendFields []string `json:"-"`
304
305
306
307
308 NullFields []string `json:"-"`
309 }
310
311 func (s *Content) MarshalJSON() ([]byte, error) {
312 type NoMethod Content
313 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
314 }
315
316
317
318 type CreateProjectRequest struct {
319
320
321
322 ParentId string `json:"parentId,omitempty"`
323
324 Title string `json:"title,omitempty"`
325
326
327
328
329
330 ForceSendFields []string `json:"-"`
331
332
333
334
335 NullFields []string `json:"-"`
336 }
337
338 func (s *CreateProjectRequest) MarshalJSON() ([]byte, error) {
339 type NoMethod CreateProjectRequest
340 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
341 }
342
343
344 type Deployment struct {
345
346 DeploymentConfig *DeploymentConfig `json:"deploymentConfig,omitempty"`
347
348 DeploymentId string `json:"deploymentId,omitempty"`
349
350 EntryPoints []*EntryPoint `json:"entryPoints,omitempty"`
351
352 UpdateTime string `json:"updateTime,omitempty"`
353
354
355 googleapi.ServerResponse `json:"-"`
356
357
358
359
360
361 ForceSendFields []string `json:"-"`
362
363
364
365
366 NullFields []string `json:"-"`
367 }
368
369 func (s *Deployment) MarshalJSON() ([]byte, error) {
370 type NoMethod Deployment
371 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
372 }
373
374
375 type DeploymentConfig struct {
376
377 Description string `json:"description,omitempty"`
378
379 ManifestFileName string `json:"manifestFileName,omitempty"`
380
381 ScriptId string `json:"scriptId,omitempty"`
382
383 VersionNumber int64 `json:"versionNumber,omitempty"`
384
385
386
387
388
389 ForceSendFields []string `json:"-"`
390
391
392
393
394 NullFields []string `json:"-"`
395 }
396
397 func (s *DeploymentConfig) MarshalJSON() ([]byte, error) {
398 type NoMethod DeploymentConfig
399 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
400 }
401
402
403
404
405
406 type Empty struct {
407
408 googleapi.ServerResponse `json:"-"`
409 }
410
411
412
413 type EntryPoint struct {
414
415 AddOn *GoogleAppsScriptTypeAddOnEntryPoint `json:"addOn,omitempty"`
416
417
418
419
420
421
422
423 EntryPointType string `json:"entryPointType,omitempty"`
424
425
426 ExecutionApi *GoogleAppsScriptTypeExecutionApiEntryPoint `json:"executionApi,omitempty"`
427
428 WebApp *GoogleAppsScriptTypeWebAppEntryPoint `json:"webApp,omitempty"`
429
430
431
432
433
434 ForceSendFields []string `json:"-"`
435
436
437
438
439 NullFields []string `json:"-"`
440 }
441
442 func (s *EntryPoint) MarshalJSON() ([]byte, error) {
443 type NoMethod EntryPoint
444 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
445 }
446
447
448
449 type ExecuteStreamResponse struct {
450
451 Result *ScriptExecutionResult `json:"result,omitempty"`
452
453
454
455
456
457 ForceSendFields []string `json:"-"`
458
459
460
461
462 NullFields []string `json:"-"`
463 }
464
465 func (s *ExecuteStreamResponse) MarshalJSON() ([]byte, error) {
466 type NoMethod ExecuteStreamResponse
467 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
468 }
469
470
471
472
473
474
475
476 type ExecutionError struct {
477
478
479 ErrorMessage string `json:"errorMessage,omitempty"`
480
481
482 ErrorType string `json:"errorType,omitempty"`
483
484
485
486 ScriptStackTraceElements []*ScriptStackTraceElement `json:"scriptStackTraceElements,omitempty"`
487
488
489
490
491
492 ForceSendFields []string `json:"-"`
493
494
495
496
497 NullFields []string `json:"-"`
498 }
499
500 func (s *ExecutionError) MarshalJSON() ([]byte, error) {
501 type NoMethod ExecutionError
502 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
503 }
504
505
506
507
508 type ExecutionRequest struct {
509
510
511
512 DevMode bool `json:"devMode,omitempty"`
513
514
515
516 Function string `json:"function,omitempty"`
517
518
519
520
521
522 Parameters []interface{} `json:"parameters,omitempty"`
523
524
525
526
527
528
529
530
531
532
533
534 SessionState string `json:"sessionState,omitempty"`
535
536
537
538
539
540 ForceSendFields []string `json:"-"`
541
542
543
544
545 NullFields []string `json:"-"`
546 }
547
548 func (s *ExecutionRequest) MarshalJSON() ([]byte, error) {
549 type NoMethod ExecutionRequest
550 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
551 }
552
553
554
555
556
557 type ExecutionResponse struct {
558
559
560
561
562
563 Result interface{} `json:"result,omitempty"`
564
565
566
567
568
569 ForceSendFields []string `json:"-"`
570
571
572
573
574 NullFields []string `json:"-"`
575 }
576
577 func (s *ExecutionResponse) MarshalJSON() ([]byte, error) {
578 type NoMethod ExecutionResponse
579 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
580 }
581
582
583
584
585
586 type File struct {
587
588
589 CreateTime string `json:"createTime,omitempty"`
590
591 FunctionSet *GoogleAppsScriptTypeFunctionSet `json:"functionSet,omitempty"`
592
593
594
595 LastModifyUser *GoogleAppsScriptTypeUser `json:"lastModifyUser,omitempty"`
596
597
598 Name string `json:"name,omitempty"`
599
600 Source string `json:"source,omitempty"`
601
602
603
604
605
606
607
608
609
610 Type string `json:"type,omitempty"`
611
612
613 UpdateTime string `json:"updateTime,omitempty"`
614
615
616
617
618
619 ForceSendFields []string `json:"-"`
620
621
622
623
624 NullFields []string `json:"-"`
625 }
626
627 func (s *File) MarshalJSON() ([]byte, error) {
628 type NoMethod File
629 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
630 }
631
632
633 type GoogleAppsScriptTypeAddOnEntryPoint struct {
634
635
636
637
638
639
640 AddOnType string `json:"addOnType,omitempty"`
641
642 Description string `json:"description,omitempty"`
643
644 HelpUrl string `json:"helpUrl,omitempty"`
645
646 PostInstallTipUrl string `json:"postInstallTipUrl,omitempty"`
647
648 ReportIssueUrl string `json:"reportIssueUrl,omitempty"`
649
650 Title string `json:"title,omitempty"`
651
652
653
654
655
656 ForceSendFields []string `json:"-"`
657
658
659
660
661 NullFields []string `json:"-"`
662 }
663
664 func (s *GoogleAppsScriptTypeAddOnEntryPoint) MarshalJSON() ([]byte, error) {
665 type NoMethod GoogleAppsScriptTypeAddOnEntryPoint
666 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
667 }
668
669
670
671 type GoogleAppsScriptTypeExecutionApiConfig struct {
672
673
674
675
676
677
678
679
680
681
682
683 Access string `json:"access,omitempty"`
684
685
686
687
688
689 ForceSendFields []string `json:"-"`
690
691
692
693
694 NullFields []string `json:"-"`
695 }
696
697 func (s *GoogleAppsScriptTypeExecutionApiConfig) MarshalJSON() ([]byte, error) {
698 type NoMethod GoogleAppsScriptTypeExecutionApiConfig
699 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
700 }
701
702
703 type GoogleAppsScriptTypeExecutionApiEntryPoint struct {
704
705 EntryPointConfig *GoogleAppsScriptTypeExecutionApiConfig `json:"entryPointConfig,omitempty"`
706
707
708
709
710
711 ForceSendFields []string `json:"-"`
712
713
714
715
716 NullFields []string `json:"-"`
717 }
718
719 func (s *GoogleAppsScriptTypeExecutionApiEntryPoint) MarshalJSON() ([]byte, error) {
720 type NoMethod GoogleAppsScriptTypeExecutionApiEntryPoint
721 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
722 }
723
724
725 type GoogleAppsScriptTypeFunction struct {
726
727 Name string `json:"name,omitempty"`
728
729
730 Parameters []string `json:"parameters,omitempty"`
731
732
733
734
735
736 ForceSendFields []string `json:"-"`
737
738
739
740
741 NullFields []string `json:"-"`
742 }
743
744 func (s *GoogleAppsScriptTypeFunction) MarshalJSON() ([]byte, error) {
745 type NoMethod GoogleAppsScriptTypeFunction
746 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
747 }
748
749
750
751 type GoogleAppsScriptTypeFunctionSet struct {
752
753 Values []*GoogleAppsScriptTypeFunction `json:"values,omitempty"`
754
755
756
757
758
759 ForceSendFields []string `json:"-"`
760
761
762
763
764 NullFields []string `json:"-"`
765 }
766
767 func (s *GoogleAppsScriptTypeFunctionSet) MarshalJSON() ([]byte, error) {
768 type NoMethod GoogleAppsScriptTypeFunctionSet
769 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
770 }
771
772
773
774
775
776
777 type GoogleAppsScriptTypeProcess struct {
778
779 Duration string `json:"duration,omitempty"`
780
781 FunctionName string `json:"functionName,omitempty"`
782
783
784
785
786
787
788
789
790
791
792
793
794
795 ProcessStatus string `json:"processStatus,omitempty"`
796
797
798
799
800
801
802
803
804
805
806
807
808
809 ProcessType string `json:"processType,omitempty"`
810
811 ProjectName string `json:"projectName,omitempty"`
812
813
814
815
816
817
818 RuntimeVersion string `json:"runtimeVersion,omitempty"`
819
820 StartTime string `json:"startTime,omitempty"`
821
822
823
824
825
826
827
828
829 UserAccessLevel string `json:"userAccessLevel,omitempty"`
830
831
832
833
834
835 ForceSendFields []string `json:"-"`
836
837
838
839
840 NullFields []string `json:"-"`
841 }
842
843 func (s *GoogleAppsScriptTypeProcess) MarshalJSON() ([]byte, error) {
844 type NoMethod GoogleAppsScriptTypeProcess
845 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
846 }
847
848
849 type GoogleAppsScriptTypeUser struct {
850
851 Domain string `json:"domain,omitempty"`
852
853 Email string `json:"email,omitempty"`
854
855 Name string `json:"name,omitempty"`
856
857 PhotoUrl string `json:"photoUrl,omitempty"`
858
859
860
861
862
863 ForceSendFields []string `json:"-"`
864
865
866
867
868 NullFields []string `json:"-"`
869 }
870
871 func (s *GoogleAppsScriptTypeUser) MarshalJSON() ([]byte, error) {
872 type NoMethod GoogleAppsScriptTypeUser
873 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
874 }
875
876
877 type GoogleAppsScriptTypeWebAppConfig struct {
878
879
880
881
882
883
884
885
886
887
888
889 Access string `json:"access,omitempty"`
890
891
892
893
894
895
896
897 ExecuteAs string `json:"executeAs,omitempty"`
898
899
900
901
902
903 ForceSendFields []string `json:"-"`
904
905
906
907
908 NullFields []string `json:"-"`
909 }
910
911 func (s *GoogleAppsScriptTypeWebAppConfig) MarshalJSON() ([]byte, error) {
912 type NoMethod GoogleAppsScriptTypeWebAppConfig
913 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
914 }
915
916
917 type GoogleAppsScriptTypeWebAppEntryPoint struct {
918
919 EntryPointConfig *GoogleAppsScriptTypeWebAppConfig `json:"entryPointConfig,omitempty"`
920
921 Url string `json:"url,omitempty"`
922
923
924
925
926
927 ForceSendFields []string `json:"-"`
928
929
930
931
932 NullFields []string `json:"-"`
933 }
934
935 func (s *GoogleAppsScriptTypeWebAppEntryPoint) MarshalJSON() ([]byte, error) {
936 type NoMethod GoogleAppsScriptTypeWebAppEntryPoint
937 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
938 }
939
940
941
942 type ListDeploymentsResponse struct {
943
944 Deployments []*Deployment `json:"deployments,omitempty"`
945
946
947 NextPageToken string `json:"nextPageToken,omitempty"`
948
949
950 googleapi.ServerResponse `json:"-"`
951
952
953
954
955
956 ForceSendFields []string `json:"-"`
957
958
959
960
961 NullFields []string `json:"-"`
962 }
963
964 func (s *ListDeploymentsResponse) MarshalJSON() ([]byte, error) {
965 type NoMethod ListDeploymentsResponse
966 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
967 }
968
969
970 type ListScriptProcessesResponse struct {
971
972
973 NextPageToken string `json:"nextPageToken,omitempty"`
974
975 Processes []*GoogleAppsScriptTypeProcess `json:"processes,omitempty"`
976
977
978 googleapi.ServerResponse `json:"-"`
979
980
981
982
983
984 ForceSendFields []string `json:"-"`
985
986
987
988
989 NullFields []string `json:"-"`
990 }
991
992 func (s *ListScriptProcessesResponse) MarshalJSON() ([]byte, error) {
993 type NoMethod ListScriptProcessesResponse
994 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
995 }
996
997
998 type ListUserProcessesResponse struct {
999
1000
1001 NextPageToken string `json:"nextPageToken,omitempty"`
1002
1003 Processes []*GoogleAppsScriptTypeProcess `json:"processes,omitempty"`
1004
1005
1006 googleapi.ServerResponse `json:"-"`
1007
1008
1009
1010
1011
1012 ForceSendFields []string `json:"-"`
1013
1014
1015
1016
1017 NullFields []string `json:"-"`
1018 }
1019
1020 func (s *ListUserProcessesResponse) MarshalJSON() ([]byte, error) {
1021 type NoMethod ListUserProcessesResponse
1022 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1023 }
1024
1025
1026 type ListValue struct {
1027
1028 Values []*Value `json:"values,omitempty"`
1029
1030
1031
1032
1033
1034 ForceSendFields []string `json:"-"`
1035
1036
1037
1038
1039 NullFields []string `json:"-"`
1040 }
1041
1042 func (s *ListValue) MarshalJSON() ([]byte, error) {
1043 type NoMethod ListValue
1044 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1045 }
1046
1047
1048
1049 type ListVersionsResponse struct {
1050
1051
1052 NextPageToken string `json:"nextPageToken,omitempty"`
1053
1054 Versions []*Version `json:"versions,omitempty"`
1055
1056
1057 googleapi.ServerResponse `json:"-"`
1058
1059
1060
1061
1062
1063 ForceSendFields []string `json:"-"`
1064
1065
1066
1067
1068 NullFields []string `json:"-"`
1069 }
1070
1071 func (s *ListVersionsResponse) MarshalJSON() ([]byte, error) {
1072 type NoMethod ListVersionsResponse
1073 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1074 }
1075
1076
1077
1078 type Metrics struct {
1079
1080 ActiveUsers []*MetricsValue `json:"activeUsers,omitempty"`
1081
1082 FailedExecutions []*MetricsValue `json:"failedExecutions,omitempty"`
1083
1084 TotalExecutions []*MetricsValue `json:"totalExecutions,omitempty"`
1085
1086
1087 googleapi.ServerResponse `json:"-"`
1088
1089
1090
1091
1092
1093 ForceSendFields []string `json:"-"`
1094
1095
1096
1097
1098 NullFields []string `json:"-"`
1099 }
1100
1101 func (s *Metrics) MarshalJSON() ([]byte, error) {
1102 type NoMethod Metrics
1103 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1104 }
1105
1106
1107 type MetricsValue struct {
1108
1109 EndTime string `json:"endTime,omitempty"`
1110
1111 StartTime string `json:"startTime,omitempty"`
1112
1113 Value uint64 `json:"value,omitempty,string"`
1114
1115
1116
1117
1118
1119 ForceSendFields []string `json:"-"`
1120
1121
1122
1123
1124 NullFields []string `json:"-"`
1125 }
1126
1127 func (s *MetricsValue) MarshalJSON() ([]byte, error) {
1128 type NoMethod MetricsValue
1129 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1130 }
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150 type Operation struct {
1151
1152
1153
1154 Done bool `json:"done,omitempty"`
1155
1156
1157
1158
1159
1160 Error *Status `json:"error,omitempty"`
1161
1162
1163 Response googleapi.RawMessage `json:"response,omitempty"`
1164
1165
1166 googleapi.ServerResponse `json:"-"`
1167
1168
1169
1170
1171
1172 ForceSendFields []string `json:"-"`
1173
1174
1175
1176
1177 NullFields []string `json:"-"`
1178 }
1179
1180 func (s *Operation) MarshalJSON() ([]byte, error) {
1181 type NoMethod Operation
1182 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1183 }
1184
1185
1186 type Project struct {
1187
1188 CreateTime string `json:"createTime,omitempty"`
1189
1190 Creator *GoogleAppsScriptTypeUser `json:"creator,omitempty"`
1191
1192 LastModifyUser *GoogleAppsScriptTypeUser `json:"lastModifyUser,omitempty"`
1193
1194
1195
1196 ParentId string `json:"parentId,omitempty"`
1197
1198 ScriptId string `json:"scriptId,omitempty"`
1199
1200 Title string `json:"title,omitempty"`
1201
1202 UpdateTime string `json:"updateTime,omitempty"`
1203
1204
1205 googleapi.ServerResponse `json:"-"`
1206
1207
1208
1209
1210
1211 ForceSendFields []string `json:"-"`
1212
1213
1214
1215
1216 NullFields []string `json:"-"`
1217 }
1218
1219 func (s *Project) MarshalJSON() ([]byte, error) {
1220 type NoMethod Project
1221 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1222 }
1223
1224
1225 type ScriptExecutionResult struct {
1226
1227 ReturnValue *Value `json:"returnValue,omitempty"`
1228
1229
1230
1231
1232
1233 ForceSendFields []string `json:"-"`
1234
1235
1236
1237
1238 NullFields []string `json:"-"`
1239 }
1240
1241 func (s *ScriptExecutionResult) MarshalJSON() ([]byte, error) {
1242 type NoMethod ScriptExecutionResult
1243 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1244 }
1245
1246
1247
1248 type ScriptStackTraceElement struct {
1249
1250 Function string `json:"function,omitempty"`
1251
1252 LineNumber int64 `json:"lineNumber,omitempty"`
1253
1254
1255
1256
1257
1258 ForceSendFields []string `json:"-"`
1259
1260
1261
1262
1263 NullFields []string `json:"-"`
1264 }
1265
1266 func (s *ScriptStackTraceElement) MarshalJSON() ([]byte, error) {
1267 type NoMethod ScriptStackTraceElement
1268 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1269 }
1270
1271
1272
1273
1274 type Status struct {
1275
1276
1277
1278 Code int64 `json:"code,omitempty"`
1279
1280
1281 Details []googleapi.RawMessage `json:"details,omitempty"`
1282
1283
1284
1285 Message string `json:"message,omitempty"`
1286
1287
1288
1289
1290
1291 ForceSendFields []string `json:"-"`
1292
1293
1294
1295
1296 NullFields []string `json:"-"`
1297 }
1298
1299 func (s *Status) MarshalJSON() ([]byte, error) {
1300 type NoMethod Status
1301 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1302 }
1303
1304
1305
1306 type Struct struct {
1307
1308 Fields map[string]Value `json:"fields,omitempty"`
1309
1310
1311
1312
1313
1314 ForceSendFields []string `json:"-"`
1315
1316
1317
1318
1319 NullFields []string `json:"-"`
1320 }
1321
1322 func (s *Struct) MarshalJSON() ([]byte, error) {
1323 type NoMethod Struct
1324 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1325 }
1326
1327
1328
1329 type UpdateDeploymentRequest struct {
1330
1331 DeploymentConfig *DeploymentConfig `json:"deploymentConfig,omitempty"`
1332
1333
1334
1335
1336
1337 ForceSendFields []string `json:"-"`
1338
1339
1340
1341
1342 NullFields []string `json:"-"`
1343 }
1344
1345 func (s *UpdateDeploymentRequest) MarshalJSON() ([]byte, error) {
1346 type NoMethod UpdateDeploymentRequest
1347 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1348 }
1349
1350
1351
1352 type Value struct {
1353
1354 BoolValue bool `json:"boolValue,omitempty"`
1355
1356 BytesValue string `json:"bytesValue,omitempty"`
1357
1358 DateValue int64 `json:"dateValue,omitempty,string"`
1359
1360 ListValue *ListValue `json:"listValue,omitempty"`
1361
1362
1363
1364
1365 NullValue string `json:"nullValue,omitempty"`
1366
1367 NumberValue float64 `json:"numberValue,omitempty"`
1368
1369 ProtoValue googleapi.RawMessage `json:"protoValue,omitempty"`
1370
1371 StringValue string `json:"stringValue,omitempty"`
1372
1373 StructValue *Struct `json:"structValue,omitempty"`
1374
1375
1376
1377
1378
1379 ForceSendFields []string `json:"-"`
1380
1381
1382
1383
1384 NullFields []string `json:"-"`
1385 }
1386
1387 func (s *Value) MarshalJSON() ([]byte, error) {
1388 type NoMethod Value
1389 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1390 }
1391
1392 func (s *Value) UnmarshalJSON(data []byte) error {
1393 type NoMethod Value
1394 var s1 struct {
1395 NumberValue gensupport.JSONFloat64 `json:"numberValue"`
1396 *NoMethod
1397 }
1398 s1.NoMethod = (*NoMethod)(s)
1399 if err := json.Unmarshal(data, &s1); err != nil {
1400 return err
1401 }
1402 s.NumberValue = float64(s1.NumberValue)
1403 return nil
1404 }
1405
1406
1407
1408
1409 type Version struct {
1410
1411 CreateTime string `json:"createTime,omitempty"`
1412
1413 Description string `json:"description,omitempty"`
1414
1415 ScriptId string `json:"scriptId,omitempty"`
1416
1417
1418
1419 VersionNumber int64 `json:"versionNumber,omitempty"`
1420
1421
1422 googleapi.ServerResponse `json:"-"`
1423
1424
1425
1426
1427
1428 ForceSendFields []string `json:"-"`
1429
1430
1431
1432
1433 NullFields []string `json:"-"`
1434 }
1435
1436 func (s *Version) MarshalJSON() ([]byte, error) {
1437 type NoMethod Version
1438 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1439 }
1440
1441 type ProcessesListCall struct {
1442 s *Service
1443 urlParams_ gensupport.URLParams
1444 ifNoneMatch_ string
1445 ctx_ context.Context
1446 header_ http.Header
1447 }
1448
1449
1450
1451 func (r *ProcessesService) List() *ProcessesListCall {
1452 c := &ProcessesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1453 return c
1454 }
1455
1456
1457
1458 func (c *ProcessesListCall) PageSize(pageSize int64) *ProcessesListCall {
1459 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1460 return c
1461 }
1462
1463
1464
1465
1466 func (c *ProcessesListCall) PageToken(pageToken string) *ProcessesListCall {
1467 c.urlParams_.Set("pageToken", pageToken)
1468 return c
1469 }
1470
1471
1472
1473
1474 func (c *ProcessesListCall) UserProcessFilterDeploymentId(userProcessFilterDeploymentId string) *ProcessesListCall {
1475 c.urlParams_.Set("userProcessFilter.deploymentId", userProcessFilterDeploymentId)
1476 return c
1477 }
1478
1479
1480
1481
1482 func (c *ProcessesListCall) UserProcessFilterEndTime(userProcessFilterEndTime string) *ProcessesListCall {
1483 c.urlParams_.Set("userProcessFilter.endTime", userProcessFilterEndTime)
1484 return c
1485 }
1486
1487
1488
1489
1490
1491 func (c *ProcessesListCall) UserProcessFilterFunctionName(userProcessFilterFunctionName string) *ProcessesListCall {
1492 c.urlParams_.Set("userProcessFilter.functionName", userProcessFilterFunctionName)
1493 return c
1494 }
1495
1496
1497
1498
1499
1500 func (c *ProcessesListCall) UserProcessFilterProjectName(userProcessFilterProjectName string) *ProcessesListCall {
1501 c.urlParams_.Set("userProcessFilter.projectName", userProcessFilterProjectName)
1502 return c
1503 }
1504
1505
1506
1507
1508 func (c *ProcessesListCall) UserProcessFilterScriptId(userProcessFilterScriptId string) *ProcessesListCall {
1509 c.urlParams_.Set("userProcessFilter.scriptId", userProcessFilterScriptId)
1510 return c
1511 }
1512
1513
1514
1515
1516 func (c *ProcessesListCall) UserProcessFilterStartTime(userProcessFilterStartTime string) *ProcessesListCall {
1517 c.urlParams_.Set("userProcessFilter.startTime", userProcessFilterStartTime)
1518 return c
1519 }
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537 func (c *ProcessesListCall) UserProcessFilterStatuses(userProcessFilterStatuses ...string) *ProcessesListCall {
1538 c.urlParams_.SetMulti("userProcessFilter.statuses", append([]string{}, userProcessFilterStatuses...))
1539 return c
1540 }
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558 func (c *ProcessesListCall) UserProcessFilterTypes(userProcessFilterTypes ...string) *ProcessesListCall {
1559 c.urlParams_.SetMulti("userProcessFilter.types", append([]string{}, userProcessFilterTypes...))
1560 return c
1561 }
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574 func (c *ProcessesListCall) UserProcessFilterUserAccessLevels(userProcessFilterUserAccessLevels ...string) *ProcessesListCall {
1575 c.urlParams_.SetMulti("userProcessFilter.userAccessLevels", append([]string{}, userProcessFilterUserAccessLevels...))
1576 return c
1577 }
1578
1579
1580
1581
1582 func (c *ProcessesListCall) Fields(s ...googleapi.Field) *ProcessesListCall {
1583 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1584 return c
1585 }
1586
1587
1588
1589
1590 func (c *ProcessesListCall) IfNoneMatch(entityTag string) *ProcessesListCall {
1591 c.ifNoneMatch_ = entityTag
1592 return c
1593 }
1594
1595
1596 func (c *ProcessesListCall) Context(ctx context.Context) *ProcessesListCall {
1597 c.ctx_ = ctx
1598 return c
1599 }
1600
1601
1602
1603 func (c *ProcessesListCall) Header() http.Header {
1604 if c.header_ == nil {
1605 c.header_ = make(http.Header)
1606 }
1607 return c.header_
1608 }
1609
1610 func (c *ProcessesListCall) doRequest(alt string) (*http.Response, error) {
1611 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1612 if c.ifNoneMatch_ != "" {
1613 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1614 }
1615 var body io.Reader = nil
1616 c.urlParams_.Set("alt", alt)
1617 c.urlParams_.Set("prettyPrint", "false")
1618 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/processes")
1619 urls += "?" + c.urlParams_.Encode()
1620 req, err := http.NewRequest("GET", urls, body)
1621 if err != nil {
1622 return nil, err
1623 }
1624 req.Header = reqHeaders
1625 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1626 }
1627
1628
1629
1630
1631
1632
1633
1634 func (c *ProcessesListCall) Do(opts ...googleapi.CallOption) (*ListUserProcessesResponse, error) {
1635 gensupport.SetOptions(c.urlParams_, opts...)
1636 res, err := c.doRequest("json")
1637 if res != nil && res.StatusCode == http.StatusNotModified {
1638 if res.Body != nil {
1639 res.Body.Close()
1640 }
1641 return nil, gensupport.WrapError(&googleapi.Error{
1642 Code: res.StatusCode,
1643 Header: res.Header,
1644 })
1645 }
1646 if err != nil {
1647 return nil, err
1648 }
1649 defer googleapi.CloseBody(res)
1650 if err := googleapi.CheckResponse(res); err != nil {
1651 return nil, gensupport.WrapError(err)
1652 }
1653 ret := &ListUserProcessesResponse{
1654 ServerResponse: googleapi.ServerResponse{
1655 Header: res.Header,
1656 HTTPStatusCode: res.StatusCode,
1657 },
1658 }
1659 target := &ret
1660 if err := gensupport.DecodeResponse(target, res); err != nil {
1661 return nil, err
1662 }
1663 return ret, nil
1664 }
1665
1666
1667
1668
1669 func (c *ProcessesListCall) Pages(ctx context.Context, f func(*ListUserProcessesResponse) error) error {
1670 c.ctx_ = ctx
1671 defer c.PageToken(c.urlParams_.Get("pageToken"))
1672 for {
1673 x, err := c.Do()
1674 if err != nil {
1675 return err
1676 }
1677 if err := f(x); err != nil {
1678 return err
1679 }
1680 if x.NextPageToken == "" {
1681 return nil
1682 }
1683 c.PageToken(x.NextPageToken)
1684 }
1685 }
1686
1687 type ProcessesListScriptProcessesCall struct {
1688 s *Service
1689 urlParams_ gensupport.URLParams
1690 ifNoneMatch_ string
1691 ctx_ context.Context
1692 header_ http.Header
1693 }
1694
1695
1696
1697 func (r *ProcessesService) ListScriptProcesses() *ProcessesListScriptProcessesCall {
1698 c := &ProcessesListScriptProcessesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1699 return c
1700 }
1701
1702
1703
1704 func (c *ProcessesListScriptProcessesCall) PageSize(pageSize int64) *ProcessesListScriptProcessesCall {
1705 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1706 return c
1707 }
1708
1709
1710
1711
1712 func (c *ProcessesListScriptProcessesCall) PageToken(pageToken string) *ProcessesListScriptProcessesCall {
1713 c.urlParams_.Set("pageToken", pageToken)
1714 return c
1715 }
1716
1717
1718
1719 func (c *ProcessesListScriptProcessesCall) ScriptId(scriptId string) *ProcessesListScriptProcessesCall {
1720 c.urlParams_.Set("scriptId", scriptId)
1721 return c
1722 }
1723
1724
1725
1726
1727 func (c *ProcessesListScriptProcessesCall) ScriptProcessFilterDeploymentId(scriptProcessFilterDeploymentId string) *ProcessesListScriptProcessesCall {
1728 c.urlParams_.Set("scriptProcessFilter.deploymentId", scriptProcessFilterDeploymentId)
1729 return c
1730 }
1731
1732
1733
1734
1735 func (c *ProcessesListScriptProcessesCall) ScriptProcessFilterEndTime(scriptProcessFilterEndTime string) *ProcessesListScriptProcessesCall {
1736 c.urlParams_.Set("scriptProcessFilter.endTime", scriptProcessFilterEndTime)
1737 return c
1738 }
1739
1740
1741
1742
1743
1744 func (c *ProcessesListScriptProcessesCall) ScriptProcessFilterFunctionName(scriptProcessFilterFunctionName string) *ProcessesListScriptProcessesCall {
1745 c.urlParams_.Set("scriptProcessFilter.functionName", scriptProcessFilterFunctionName)
1746 return c
1747 }
1748
1749
1750
1751
1752 func (c *ProcessesListScriptProcessesCall) ScriptProcessFilterStartTime(scriptProcessFilterStartTime string) *ProcessesListScriptProcessesCall {
1753 c.urlParams_.Set("scriptProcessFilter.startTime", scriptProcessFilterStartTime)
1754 return c
1755 }
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773 func (c *ProcessesListScriptProcessesCall) ScriptProcessFilterStatuses(scriptProcessFilterStatuses ...string) *ProcessesListScriptProcessesCall {
1774 c.urlParams_.SetMulti("scriptProcessFilter.statuses", append([]string{}, scriptProcessFilterStatuses...))
1775 return c
1776 }
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794 func (c *ProcessesListScriptProcessesCall) ScriptProcessFilterTypes(scriptProcessFilterTypes ...string) *ProcessesListScriptProcessesCall {
1795 c.urlParams_.SetMulti("scriptProcessFilter.types", append([]string{}, scriptProcessFilterTypes...))
1796 return c
1797 }
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810 func (c *ProcessesListScriptProcessesCall) ScriptProcessFilterUserAccessLevels(scriptProcessFilterUserAccessLevels ...string) *ProcessesListScriptProcessesCall {
1811 c.urlParams_.SetMulti("scriptProcessFilter.userAccessLevels", append([]string{}, scriptProcessFilterUserAccessLevels...))
1812 return c
1813 }
1814
1815
1816
1817
1818 func (c *ProcessesListScriptProcessesCall) Fields(s ...googleapi.Field) *ProcessesListScriptProcessesCall {
1819 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1820 return c
1821 }
1822
1823
1824
1825
1826 func (c *ProcessesListScriptProcessesCall) IfNoneMatch(entityTag string) *ProcessesListScriptProcessesCall {
1827 c.ifNoneMatch_ = entityTag
1828 return c
1829 }
1830
1831
1832 func (c *ProcessesListScriptProcessesCall) Context(ctx context.Context) *ProcessesListScriptProcessesCall {
1833 c.ctx_ = ctx
1834 return c
1835 }
1836
1837
1838
1839 func (c *ProcessesListScriptProcessesCall) Header() http.Header {
1840 if c.header_ == nil {
1841 c.header_ = make(http.Header)
1842 }
1843 return c.header_
1844 }
1845
1846 func (c *ProcessesListScriptProcessesCall) doRequest(alt string) (*http.Response, error) {
1847 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1848 if c.ifNoneMatch_ != "" {
1849 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1850 }
1851 var body io.Reader = nil
1852 c.urlParams_.Set("alt", alt)
1853 c.urlParams_.Set("prettyPrint", "false")
1854 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/processes:listScriptProcesses")
1855 urls += "?" + c.urlParams_.Encode()
1856 req, err := http.NewRequest("GET", urls, body)
1857 if err != nil {
1858 return nil, err
1859 }
1860 req.Header = reqHeaders
1861 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1862 }
1863
1864
1865
1866
1867
1868
1869
1870 func (c *ProcessesListScriptProcessesCall) Do(opts ...googleapi.CallOption) (*ListScriptProcessesResponse, error) {
1871 gensupport.SetOptions(c.urlParams_, opts...)
1872 res, err := c.doRequest("json")
1873 if res != nil && res.StatusCode == http.StatusNotModified {
1874 if res.Body != nil {
1875 res.Body.Close()
1876 }
1877 return nil, gensupport.WrapError(&googleapi.Error{
1878 Code: res.StatusCode,
1879 Header: res.Header,
1880 })
1881 }
1882 if err != nil {
1883 return nil, err
1884 }
1885 defer googleapi.CloseBody(res)
1886 if err := googleapi.CheckResponse(res); err != nil {
1887 return nil, gensupport.WrapError(err)
1888 }
1889 ret := &ListScriptProcessesResponse{
1890 ServerResponse: googleapi.ServerResponse{
1891 Header: res.Header,
1892 HTTPStatusCode: res.StatusCode,
1893 },
1894 }
1895 target := &ret
1896 if err := gensupport.DecodeResponse(target, res); err != nil {
1897 return nil, err
1898 }
1899 return ret, nil
1900 }
1901
1902
1903
1904
1905 func (c *ProcessesListScriptProcessesCall) Pages(ctx context.Context, f func(*ListScriptProcessesResponse) error) error {
1906 c.ctx_ = ctx
1907 defer c.PageToken(c.urlParams_.Get("pageToken"))
1908 for {
1909 x, err := c.Do()
1910 if err != nil {
1911 return err
1912 }
1913 if err := f(x); err != nil {
1914 return err
1915 }
1916 if x.NextPageToken == "" {
1917 return nil
1918 }
1919 c.PageToken(x.NextPageToken)
1920 }
1921 }
1922
1923 type ProjectsCreateCall struct {
1924 s *Service
1925 createprojectrequest *CreateProjectRequest
1926 urlParams_ gensupport.URLParams
1927 ctx_ context.Context
1928 header_ http.Header
1929 }
1930
1931
1932
1933 func (r *ProjectsService) Create(createprojectrequest *CreateProjectRequest) *ProjectsCreateCall {
1934 c := &ProjectsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1935 c.createprojectrequest = createprojectrequest
1936 return c
1937 }
1938
1939
1940
1941
1942 func (c *ProjectsCreateCall) Fields(s ...googleapi.Field) *ProjectsCreateCall {
1943 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1944 return c
1945 }
1946
1947
1948 func (c *ProjectsCreateCall) Context(ctx context.Context) *ProjectsCreateCall {
1949 c.ctx_ = ctx
1950 return c
1951 }
1952
1953
1954
1955 func (c *ProjectsCreateCall) Header() http.Header {
1956 if c.header_ == nil {
1957 c.header_ = make(http.Header)
1958 }
1959 return c.header_
1960 }
1961
1962 func (c *ProjectsCreateCall) doRequest(alt string) (*http.Response, error) {
1963 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1964 var body io.Reader = nil
1965 body, err := googleapi.WithoutDataWrapper.JSONReader(c.createprojectrequest)
1966 if err != nil {
1967 return nil, err
1968 }
1969 c.urlParams_.Set("alt", alt)
1970 c.urlParams_.Set("prettyPrint", "false")
1971 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects")
1972 urls += "?" + c.urlParams_.Encode()
1973 req, err := http.NewRequest("POST", urls, body)
1974 if err != nil {
1975 return nil, err
1976 }
1977 req.Header = reqHeaders
1978 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1979 }
1980
1981
1982
1983
1984
1985
1986 func (c *ProjectsCreateCall) Do(opts ...googleapi.CallOption) (*Project, error) {
1987 gensupport.SetOptions(c.urlParams_, opts...)
1988 res, err := c.doRequest("json")
1989 if res != nil && res.StatusCode == http.StatusNotModified {
1990 if res.Body != nil {
1991 res.Body.Close()
1992 }
1993 return nil, gensupport.WrapError(&googleapi.Error{
1994 Code: res.StatusCode,
1995 Header: res.Header,
1996 })
1997 }
1998 if err != nil {
1999 return nil, err
2000 }
2001 defer googleapi.CloseBody(res)
2002 if err := googleapi.CheckResponse(res); err != nil {
2003 return nil, gensupport.WrapError(err)
2004 }
2005 ret := &Project{
2006 ServerResponse: googleapi.ServerResponse{
2007 Header: res.Header,
2008 HTTPStatusCode: res.StatusCode,
2009 },
2010 }
2011 target := &ret
2012 if err := gensupport.DecodeResponse(target, res); err != nil {
2013 return nil, err
2014 }
2015 return ret, nil
2016 }
2017
2018 type ProjectsGetCall struct {
2019 s *Service
2020 scriptId string
2021 urlParams_ gensupport.URLParams
2022 ifNoneMatch_ string
2023 ctx_ context.Context
2024 header_ http.Header
2025 }
2026
2027
2028
2029
2030 func (r *ProjectsService) Get(scriptId string) *ProjectsGetCall {
2031 c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2032 c.scriptId = scriptId
2033 return c
2034 }
2035
2036
2037
2038
2039 func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
2040 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2041 return c
2042 }
2043
2044
2045
2046
2047 func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
2048 c.ifNoneMatch_ = entityTag
2049 return c
2050 }
2051
2052
2053 func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
2054 c.ctx_ = ctx
2055 return c
2056 }
2057
2058
2059
2060 func (c *ProjectsGetCall) Header() http.Header {
2061 if c.header_ == nil {
2062 c.header_ = make(http.Header)
2063 }
2064 return c.header_
2065 }
2066
2067 func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
2068 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2069 if c.ifNoneMatch_ != "" {
2070 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2071 }
2072 var body io.Reader = nil
2073 c.urlParams_.Set("alt", alt)
2074 c.urlParams_.Set("prettyPrint", "false")
2075 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}")
2076 urls += "?" + c.urlParams_.Encode()
2077 req, err := http.NewRequest("GET", urls, body)
2078 if err != nil {
2079 return nil, err
2080 }
2081 req.Header = reqHeaders
2082 googleapi.Expand(req.URL, map[string]string{
2083 "scriptId": c.scriptId,
2084 })
2085 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2086 }
2087
2088
2089
2090
2091
2092
2093 func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
2094 gensupport.SetOptions(c.urlParams_, opts...)
2095 res, err := c.doRequest("json")
2096 if res != nil && res.StatusCode == http.StatusNotModified {
2097 if res.Body != nil {
2098 res.Body.Close()
2099 }
2100 return nil, gensupport.WrapError(&googleapi.Error{
2101 Code: res.StatusCode,
2102 Header: res.Header,
2103 })
2104 }
2105 if err != nil {
2106 return nil, err
2107 }
2108 defer googleapi.CloseBody(res)
2109 if err := googleapi.CheckResponse(res); err != nil {
2110 return nil, gensupport.WrapError(err)
2111 }
2112 ret := &Project{
2113 ServerResponse: googleapi.ServerResponse{
2114 Header: res.Header,
2115 HTTPStatusCode: res.StatusCode,
2116 },
2117 }
2118 target := &ret
2119 if err := gensupport.DecodeResponse(target, res); err != nil {
2120 return nil, err
2121 }
2122 return ret, nil
2123 }
2124
2125 type ProjectsGetContentCall struct {
2126 s *Service
2127 scriptId string
2128 urlParams_ gensupport.URLParams
2129 ifNoneMatch_ string
2130 ctx_ context.Context
2131 header_ http.Header
2132 }
2133
2134
2135
2136
2137
2138 func (r *ProjectsService) GetContent(scriptId string) *ProjectsGetContentCall {
2139 c := &ProjectsGetContentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2140 c.scriptId = scriptId
2141 return c
2142 }
2143
2144
2145
2146
2147 func (c *ProjectsGetContentCall) VersionNumber(versionNumber int64) *ProjectsGetContentCall {
2148 c.urlParams_.Set("versionNumber", fmt.Sprint(versionNumber))
2149 return c
2150 }
2151
2152
2153
2154
2155 func (c *ProjectsGetContentCall) Fields(s ...googleapi.Field) *ProjectsGetContentCall {
2156 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2157 return c
2158 }
2159
2160
2161
2162
2163 func (c *ProjectsGetContentCall) IfNoneMatch(entityTag string) *ProjectsGetContentCall {
2164 c.ifNoneMatch_ = entityTag
2165 return c
2166 }
2167
2168
2169 func (c *ProjectsGetContentCall) Context(ctx context.Context) *ProjectsGetContentCall {
2170 c.ctx_ = ctx
2171 return c
2172 }
2173
2174
2175
2176 func (c *ProjectsGetContentCall) Header() http.Header {
2177 if c.header_ == nil {
2178 c.header_ = make(http.Header)
2179 }
2180 return c.header_
2181 }
2182
2183 func (c *ProjectsGetContentCall) doRequest(alt string) (*http.Response, error) {
2184 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2185 if c.ifNoneMatch_ != "" {
2186 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2187 }
2188 var body io.Reader = nil
2189 c.urlParams_.Set("alt", alt)
2190 c.urlParams_.Set("prettyPrint", "false")
2191 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/content")
2192 urls += "?" + c.urlParams_.Encode()
2193 req, err := http.NewRequest("GET", urls, body)
2194 if err != nil {
2195 return nil, err
2196 }
2197 req.Header = reqHeaders
2198 googleapi.Expand(req.URL, map[string]string{
2199 "scriptId": c.scriptId,
2200 })
2201 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2202 }
2203
2204
2205
2206
2207
2208
2209 func (c *ProjectsGetContentCall) Do(opts ...googleapi.CallOption) (*Content, error) {
2210 gensupport.SetOptions(c.urlParams_, opts...)
2211 res, err := c.doRequest("json")
2212 if res != nil && res.StatusCode == http.StatusNotModified {
2213 if res.Body != nil {
2214 res.Body.Close()
2215 }
2216 return nil, gensupport.WrapError(&googleapi.Error{
2217 Code: res.StatusCode,
2218 Header: res.Header,
2219 })
2220 }
2221 if err != nil {
2222 return nil, err
2223 }
2224 defer googleapi.CloseBody(res)
2225 if err := googleapi.CheckResponse(res); err != nil {
2226 return nil, gensupport.WrapError(err)
2227 }
2228 ret := &Content{
2229 ServerResponse: googleapi.ServerResponse{
2230 Header: res.Header,
2231 HTTPStatusCode: res.StatusCode,
2232 },
2233 }
2234 target := &ret
2235 if err := gensupport.DecodeResponse(target, res); err != nil {
2236 return nil, err
2237 }
2238 return ret, nil
2239 }
2240
2241 type ProjectsGetMetricsCall struct {
2242 s *Service
2243 scriptId string
2244 urlParams_ gensupport.URLParams
2245 ifNoneMatch_ string
2246 ctx_ context.Context
2247 header_ http.Header
2248 }
2249
2250
2251
2252
2253
2254 func (r *ProjectsService) GetMetrics(scriptId string) *ProjectsGetMetricsCall {
2255 c := &ProjectsGetMetricsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2256 c.scriptId = scriptId
2257 return c
2258 }
2259
2260
2261
2262
2263 func (c *ProjectsGetMetricsCall) MetricsFilterDeploymentId(metricsFilterDeploymentId string) *ProjectsGetMetricsCall {
2264 c.urlParams_.Set("metricsFilter.deploymentId", metricsFilterDeploymentId)
2265 return c
2266 }
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279 func (c *ProjectsGetMetricsCall) MetricsGranularity(metricsGranularity string) *ProjectsGetMetricsCall {
2280 c.urlParams_.Set("metricsGranularity", metricsGranularity)
2281 return c
2282 }
2283
2284
2285
2286
2287 func (c *ProjectsGetMetricsCall) Fields(s ...googleapi.Field) *ProjectsGetMetricsCall {
2288 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2289 return c
2290 }
2291
2292
2293
2294
2295 func (c *ProjectsGetMetricsCall) IfNoneMatch(entityTag string) *ProjectsGetMetricsCall {
2296 c.ifNoneMatch_ = entityTag
2297 return c
2298 }
2299
2300
2301 func (c *ProjectsGetMetricsCall) Context(ctx context.Context) *ProjectsGetMetricsCall {
2302 c.ctx_ = ctx
2303 return c
2304 }
2305
2306
2307
2308 func (c *ProjectsGetMetricsCall) Header() http.Header {
2309 if c.header_ == nil {
2310 c.header_ = make(http.Header)
2311 }
2312 return c.header_
2313 }
2314
2315 func (c *ProjectsGetMetricsCall) doRequest(alt string) (*http.Response, error) {
2316 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2317 if c.ifNoneMatch_ != "" {
2318 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2319 }
2320 var body io.Reader = nil
2321 c.urlParams_.Set("alt", alt)
2322 c.urlParams_.Set("prettyPrint", "false")
2323 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/metrics")
2324 urls += "?" + c.urlParams_.Encode()
2325 req, err := http.NewRequest("GET", urls, body)
2326 if err != nil {
2327 return nil, err
2328 }
2329 req.Header = reqHeaders
2330 googleapi.Expand(req.URL, map[string]string{
2331 "scriptId": c.scriptId,
2332 })
2333 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2334 }
2335
2336
2337
2338
2339
2340
2341 func (c *ProjectsGetMetricsCall) Do(opts ...googleapi.CallOption) (*Metrics, error) {
2342 gensupport.SetOptions(c.urlParams_, opts...)
2343 res, err := c.doRequest("json")
2344 if res != nil && res.StatusCode == http.StatusNotModified {
2345 if res.Body != nil {
2346 res.Body.Close()
2347 }
2348 return nil, gensupport.WrapError(&googleapi.Error{
2349 Code: res.StatusCode,
2350 Header: res.Header,
2351 })
2352 }
2353 if err != nil {
2354 return nil, err
2355 }
2356 defer googleapi.CloseBody(res)
2357 if err := googleapi.CheckResponse(res); err != nil {
2358 return nil, gensupport.WrapError(err)
2359 }
2360 ret := &Metrics{
2361 ServerResponse: googleapi.ServerResponse{
2362 Header: res.Header,
2363 HTTPStatusCode: res.StatusCode,
2364 },
2365 }
2366 target := &ret
2367 if err := gensupport.DecodeResponse(target, res); err != nil {
2368 return nil, err
2369 }
2370 return ret, nil
2371 }
2372
2373 type ProjectsUpdateContentCall struct {
2374 s *Service
2375 scriptId string
2376 content *Content
2377 urlParams_ gensupport.URLParams
2378 ctx_ context.Context
2379 header_ http.Header
2380 }
2381
2382
2383
2384
2385
2386
2387
2388
2389 func (r *ProjectsService) UpdateContent(scriptId string, content *Content) *ProjectsUpdateContentCall {
2390 c := &ProjectsUpdateContentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2391 c.scriptId = scriptId
2392 c.content = content
2393 return c
2394 }
2395
2396
2397
2398
2399 func (c *ProjectsUpdateContentCall) Fields(s ...googleapi.Field) *ProjectsUpdateContentCall {
2400 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2401 return c
2402 }
2403
2404
2405 func (c *ProjectsUpdateContentCall) Context(ctx context.Context) *ProjectsUpdateContentCall {
2406 c.ctx_ = ctx
2407 return c
2408 }
2409
2410
2411
2412 func (c *ProjectsUpdateContentCall) Header() http.Header {
2413 if c.header_ == nil {
2414 c.header_ = make(http.Header)
2415 }
2416 return c.header_
2417 }
2418
2419 func (c *ProjectsUpdateContentCall) doRequest(alt string) (*http.Response, error) {
2420 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2421 var body io.Reader = nil
2422 body, err := googleapi.WithoutDataWrapper.JSONReader(c.content)
2423 if err != nil {
2424 return nil, err
2425 }
2426 c.urlParams_.Set("alt", alt)
2427 c.urlParams_.Set("prettyPrint", "false")
2428 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/content")
2429 urls += "?" + c.urlParams_.Encode()
2430 req, err := http.NewRequest("PUT", urls, body)
2431 if err != nil {
2432 return nil, err
2433 }
2434 req.Header = reqHeaders
2435 googleapi.Expand(req.URL, map[string]string{
2436 "scriptId": c.scriptId,
2437 })
2438 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2439 }
2440
2441
2442
2443
2444
2445
2446 func (c *ProjectsUpdateContentCall) Do(opts ...googleapi.CallOption) (*Content, error) {
2447 gensupport.SetOptions(c.urlParams_, opts...)
2448 res, err := c.doRequest("json")
2449 if res != nil && res.StatusCode == http.StatusNotModified {
2450 if res.Body != nil {
2451 res.Body.Close()
2452 }
2453 return nil, gensupport.WrapError(&googleapi.Error{
2454 Code: res.StatusCode,
2455 Header: res.Header,
2456 })
2457 }
2458 if err != nil {
2459 return nil, err
2460 }
2461 defer googleapi.CloseBody(res)
2462 if err := googleapi.CheckResponse(res); err != nil {
2463 return nil, gensupport.WrapError(err)
2464 }
2465 ret := &Content{
2466 ServerResponse: googleapi.ServerResponse{
2467 Header: res.Header,
2468 HTTPStatusCode: res.StatusCode,
2469 },
2470 }
2471 target := &ret
2472 if err := gensupport.DecodeResponse(target, res); err != nil {
2473 return nil, err
2474 }
2475 return ret, nil
2476 }
2477
2478 type ProjectsDeploymentsCreateCall struct {
2479 s *Service
2480 scriptId string
2481 deploymentconfig *DeploymentConfig
2482 urlParams_ gensupport.URLParams
2483 ctx_ context.Context
2484 header_ http.Header
2485 }
2486
2487
2488
2489
2490 func (r *ProjectsDeploymentsService) Create(scriptId string, deploymentconfig *DeploymentConfig) *ProjectsDeploymentsCreateCall {
2491 c := &ProjectsDeploymentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2492 c.scriptId = scriptId
2493 c.deploymentconfig = deploymentconfig
2494 return c
2495 }
2496
2497
2498
2499
2500 func (c *ProjectsDeploymentsCreateCall) Fields(s ...googleapi.Field) *ProjectsDeploymentsCreateCall {
2501 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2502 return c
2503 }
2504
2505
2506 func (c *ProjectsDeploymentsCreateCall) Context(ctx context.Context) *ProjectsDeploymentsCreateCall {
2507 c.ctx_ = ctx
2508 return c
2509 }
2510
2511
2512
2513 func (c *ProjectsDeploymentsCreateCall) Header() http.Header {
2514 if c.header_ == nil {
2515 c.header_ = make(http.Header)
2516 }
2517 return c.header_
2518 }
2519
2520 func (c *ProjectsDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) {
2521 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2522 var body io.Reader = nil
2523 body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploymentconfig)
2524 if err != nil {
2525 return nil, err
2526 }
2527 c.urlParams_.Set("alt", alt)
2528 c.urlParams_.Set("prettyPrint", "false")
2529 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/deployments")
2530 urls += "?" + c.urlParams_.Encode()
2531 req, err := http.NewRequest("POST", urls, body)
2532 if err != nil {
2533 return nil, err
2534 }
2535 req.Header = reqHeaders
2536 googleapi.Expand(req.URL, map[string]string{
2537 "scriptId": c.scriptId,
2538 })
2539 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2540 }
2541
2542
2543
2544
2545
2546
2547 func (c *ProjectsDeploymentsCreateCall) Do(opts ...googleapi.CallOption) (*Deployment, error) {
2548 gensupport.SetOptions(c.urlParams_, opts...)
2549 res, err := c.doRequest("json")
2550 if res != nil && res.StatusCode == http.StatusNotModified {
2551 if res.Body != nil {
2552 res.Body.Close()
2553 }
2554 return nil, gensupport.WrapError(&googleapi.Error{
2555 Code: res.StatusCode,
2556 Header: res.Header,
2557 })
2558 }
2559 if err != nil {
2560 return nil, err
2561 }
2562 defer googleapi.CloseBody(res)
2563 if err := googleapi.CheckResponse(res); err != nil {
2564 return nil, gensupport.WrapError(err)
2565 }
2566 ret := &Deployment{
2567 ServerResponse: googleapi.ServerResponse{
2568 Header: res.Header,
2569 HTTPStatusCode: res.StatusCode,
2570 },
2571 }
2572 target := &ret
2573 if err := gensupport.DecodeResponse(target, res); err != nil {
2574 return nil, err
2575 }
2576 return ret, nil
2577 }
2578
2579 type ProjectsDeploymentsDeleteCall struct {
2580 s *Service
2581 scriptId string
2582 deploymentId string
2583 urlParams_ gensupport.URLParams
2584 ctx_ context.Context
2585 header_ http.Header
2586 }
2587
2588
2589
2590
2591
2592 func (r *ProjectsDeploymentsService) Delete(scriptId string, deploymentId string) *ProjectsDeploymentsDeleteCall {
2593 c := &ProjectsDeploymentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2594 c.scriptId = scriptId
2595 c.deploymentId = deploymentId
2596 return c
2597 }
2598
2599
2600
2601
2602 func (c *ProjectsDeploymentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsDeploymentsDeleteCall {
2603 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2604 return c
2605 }
2606
2607
2608 func (c *ProjectsDeploymentsDeleteCall) Context(ctx context.Context) *ProjectsDeploymentsDeleteCall {
2609 c.ctx_ = ctx
2610 return c
2611 }
2612
2613
2614
2615 func (c *ProjectsDeploymentsDeleteCall) Header() http.Header {
2616 if c.header_ == nil {
2617 c.header_ = make(http.Header)
2618 }
2619 return c.header_
2620 }
2621
2622 func (c *ProjectsDeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) {
2623 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2624 var body io.Reader = nil
2625 c.urlParams_.Set("alt", alt)
2626 c.urlParams_.Set("prettyPrint", "false")
2627 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/deployments/{deploymentId}")
2628 urls += "?" + c.urlParams_.Encode()
2629 req, err := http.NewRequest("DELETE", urls, body)
2630 if err != nil {
2631 return nil, err
2632 }
2633 req.Header = reqHeaders
2634 googleapi.Expand(req.URL, map[string]string{
2635 "scriptId": c.scriptId,
2636 "deploymentId": c.deploymentId,
2637 })
2638 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2639 }
2640
2641
2642
2643
2644
2645
2646 func (c *ProjectsDeploymentsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2647 gensupport.SetOptions(c.urlParams_, opts...)
2648 res, err := c.doRequest("json")
2649 if res != nil && res.StatusCode == http.StatusNotModified {
2650 if res.Body != nil {
2651 res.Body.Close()
2652 }
2653 return nil, gensupport.WrapError(&googleapi.Error{
2654 Code: res.StatusCode,
2655 Header: res.Header,
2656 })
2657 }
2658 if err != nil {
2659 return nil, err
2660 }
2661 defer googleapi.CloseBody(res)
2662 if err := googleapi.CheckResponse(res); err != nil {
2663 return nil, gensupport.WrapError(err)
2664 }
2665 ret := &Empty{
2666 ServerResponse: googleapi.ServerResponse{
2667 Header: res.Header,
2668 HTTPStatusCode: res.StatusCode,
2669 },
2670 }
2671 target := &ret
2672 if err := gensupport.DecodeResponse(target, res); err != nil {
2673 return nil, err
2674 }
2675 return ret, nil
2676 }
2677
2678 type ProjectsDeploymentsGetCall struct {
2679 s *Service
2680 scriptId string
2681 deploymentId string
2682 urlParams_ gensupport.URLParams
2683 ifNoneMatch_ string
2684 ctx_ context.Context
2685 header_ http.Header
2686 }
2687
2688
2689
2690
2691
2692 func (r *ProjectsDeploymentsService) Get(scriptId string, deploymentId string) *ProjectsDeploymentsGetCall {
2693 c := &ProjectsDeploymentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2694 c.scriptId = scriptId
2695 c.deploymentId = deploymentId
2696 return c
2697 }
2698
2699
2700
2701
2702 func (c *ProjectsDeploymentsGetCall) Fields(s ...googleapi.Field) *ProjectsDeploymentsGetCall {
2703 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2704 return c
2705 }
2706
2707
2708
2709
2710 func (c *ProjectsDeploymentsGetCall) IfNoneMatch(entityTag string) *ProjectsDeploymentsGetCall {
2711 c.ifNoneMatch_ = entityTag
2712 return c
2713 }
2714
2715
2716 func (c *ProjectsDeploymentsGetCall) Context(ctx context.Context) *ProjectsDeploymentsGetCall {
2717 c.ctx_ = ctx
2718 return c
2719 }
2720
2721
2722
2723 func (c *ProjectsDeploymentsGetCall) Header() http.Header {
2724 if c.header_ == nil {
2725 c.header_ = make(http.Header)
2726 }
2727 return c.header_
2728 }
2729
2730 func (c *ProjectsDeploymentsGetCall) doRequest(alt string) (*http.Response, error) {
2731 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2732 if c.ifNoneMatch_ != "" {
2733 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2734 }
2735 var body io.Reader = nil
2736 c.urlParams_.Set("alt", alt)
2737 c.urlParams_.Set("prettyPrint", "false")
2738 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/deployments/{deploymentId}")
2739 urls += "?" + c.urlParams_.Encode()
2740 req, err := http.NewRequest("GET", urls, body)
2741 if err != nil {
2742 return nil, err
2743 }
2744 req.Header = reqHeaders
2745 googleapi.Expand(req.URL, map[string]string{
2746 "scriptId": c.scriptId,
2747 "deploymentId": c.deploymentId,
2748 })
2749 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2750 }
2751
2752
2753
2754
2755
2756
2757 func (c *ProjectsDeploymentsGetCall) Do(opts ...googleapi.CallOption) (*Deployment, error) {
2758 gensupport.SetOptions(c.urlParams_, opts...)
2759 res, err := c.doRequest("json")
2760 if res != nil && res.StatusCode == http.StatusNotModified {
2761 if res.Body != nil {
2762 res.Body.Close()
2763 }
2764 return nil, gensupport.WrapError(&googleapi.Error{
2765 Code: res.StatusCode,
2766 Header: res.Header,
2767 })
2768 }
2769 if err != nil {
2770 return nil, err
2771 }
2772 defer googleapi.CloseBody(res)
2773 if err := googleapi.CheckResponse(res); err != nil {
2774 return nil, gensupport.WrapError(err)
2775 }
2776 ret := &Deployment{
2777 ServerResponse: googleapi.ServerResponse{
2778 Header: res.Header,
2779 HTTPStatusCode: res.StatusCode,
2780 },
2781 }
2782 target := &ret
2783 if err := gensupport.DecodeResponse(target, res); err != nil {
2784 return nil, err
2785 }
2786 return ret, nil
2787 }
2788
2789 type ProjectsDeploymentsListCall struct {
2790 s *Service
2791 scriptId string
2792 urlParams_ gensupport.URLParams
2793 ifNoneMatch_ string
2794 ctx_ context.Context
2795 header_ http.Header
2796 }
2797
2798
2799
2800
2801 func (r *ProjectsDeploymentsService) List(scriptId string) *ProjectsDeploymentsListCall {
2802 c := &ProjectsDeploymentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2803 c.scriptId = scriptId
2804 return c
2805 }
2806
2807
2808
2809 func (c *ProjectsDeploymentsListCall) PageSize(pageSize int64) *ProjectsDeploymentsListCall {
2810 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2811 return c
2812 }
2813
2814
2815
2816
2817 func (c *ProjectsDeploymentsListCall) PageToken(pageToken string) *ProjectsDeploymentsListCall {
2818 c.urlParams_.Set("pageToken", pageToken)
2819 return c
2820 }
2821
2822
2823
2824
2825 func (c *ProjectsDeploymentsListCall) Fields(s ...googleapi.Field) *ProjectsDeploymentsListCall {
2826 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2827 return c
2828 }
2829
2830
2831
2832
2833 func (c *ProjectsDeploymentsListCall) IfNoneMatch(entityTag string) *ProjectsDeploymentsListCall {
2834 c.ifNoneMatch_ = entityTag
2835 return c
2836 }
2837
2838
2839 func (c *ProjectsDeploymentsListCall) Context(ctx context.Context) *ProjectsDeploymentsListCall {
2840 c.ctx_ = ctx
2841 return c
2842 }
2843
2844
2845
2846 func (c *ProjectsDeploymentsListCall) Header() http.Header {
2847 if c.header_ == nil {
2848 c.header_ = make(http.Header)
2849 }
2850 return c.header_
2851 }
2852
2853 func (c *ProjectsDeploymentsListCall) doRequest(alt string) (*http.Response, error) {
2854 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2855 if c.ifNoneMatch_ != "" {
2856 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2857 }
2858 var body io.Reader = nil
2859 c.urlParams_.Set("alt", alt)
2860 c.urlParams_.Set("prettyPrint", "false")
2861 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/deployments")
2862 urls += "?" + c.urlParams_.Encode()
2863 req, err := http.NewRequest("GET", urls, body)
2864 if err != nil {
2865 return nil, err
2866 }
2867 req.Header = reqHeaders
2868 googleapi.Expand(req.URL, map[string]string{
2869 "scriptId": c.scriptId,
2870 })
2871 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2872 }
2873
2874
2875
2876
2877
2878
2879
2880 func (c *ProjectsDeploymentsListCall) Do(opts ...googleapi.CallOption) (*ListDeploymentsResponse, error) {
2881 gensupport.SetOptions(c.urlParams_, opts...)
2882 res, err := c.doRequest("json")
2883 if res != nil && res.StatusCode == http.StatusNotModified {
2884 if res.Body != nil {
2885 res.Body.Close()
2886 }
2887 return nil, gensupport.WrapError(&googleapi.Error{
2888 Code: res.StatusCode,
2889 Header: res.Header,
2890 })
2891 }
2892 if err != nil {
2893 return nil, err
2894 }
2895 defer googleapi.CloseBody(res)
2896 if err := googleapi.CheckResponse(res); err != nil {
2897 return nil, gensupport.WrapError(err)
2898 }
2899 ret := &ListDeploymentsResponse{
2900 ServerResponse: googleapi.ServerResponse{
2901 Header: res.Header,
2902 HTTPStatusCode: res.StatusCode,
2903 },
2904 }
2905 target := &ret
2906 if err := gensupport.DecodeResponse(target, res); err != nil {
2907 return nil, err
2908 }
2909 return ret, nil
2910 }
2911
2912
2913
2914
2915 func (c *ProjectsDeploymentsListCall) Pages(ctx context.Context, f func(*ListDeploymentsResponse) error) error {
2916 c.ctx_ = ctx
2917 defer c.PageToken(c.urlParams_.Get("pageToken"))
2918 for {
2919 x, err := c.Do()
2920 if err != nil {
2921 return err
2922 }
2923 if err := f(x); err != nil {
2924 return err
2925 }
2926 if x.NextPageToken == "" {
2927 return nil
2928 }
2929 c.PageToken(x.NextPageToken)
2930 }
2931 }
2932
2933 type ProjectsDeploymentsUpdateCall struct {
2934 s *Service
2935 scriptId string
2936 deploymentId string
2937 updatedeploymentrequest *UpdateDeploymentRequest
2938 urlParams_ gensupport.URLParams
2939 ctx_ context.Context
2940 header_ http.Header
2941 }
2942
2943
2944
2945
2946
2947 func (r *ProjectsDeploymentsService) Update(scriptId string, deploymentId string, updatedeploymentrequest *UpdateDeploymentRequest) *ProjectsDeploymentsUpdateCall {
2948 c := &ProjectsDeploymentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2949 c.scriptId = scriptId
2950 c.deploymentId = deploymentId
2951 c.updatedeploymentrequest = updatedeploymentrequest
2952 return c
2953 }
2954
2955
2956
2957
2958 func (c *ProjectsDeploymentsUpdateCall) Fields(s ...googleapi.Field) *ProjectsDeploymentsUpdateCall {
2959 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2960 return c
2961 }
2962
2963
2964 func (c *ProjectsDeploymentsUpdateCall) Context(ctx context.Context) *ProjectsDeploymentsUpdateCall {
2965 c.ctx_ = ctx
2966 return c
2967 }
2968
2969
2970
2971 func (c *ProjectsDeploymentsUpdateCall) Header() http.Header {
2972 if c.header_ == nil {
2973 c.header_ = make(http.Header)
2974 }
2975 return c.header_
2976 }
2977
2978 func (c *ProjectsDeploymentsUpdateCall) doRequest(alt string) (*http.Response, error) {
2979 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2980 var body io.Reader = nil
2981 body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatedeploymentrequest)
2982 if err != nil {
2983 return nil, err
2984 }
2985 c.urlParams_.Set("alt", alt)
2986 c.urlParams_.Set("prettyPrint", "false")
2987 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/deployments/{deploymentId}")
2988 urls += "?" + c.urlParams_.Encode()
2989 req, err := http.NewRequest("PUT", urls, body)
2990 if err != nil {
2991 return nil, err
2992 }
2993 req.Header = reqHeaders
2994 googleapi.Expand(req.URL, map[string]string{
2995 "scriptId": c.scriptId,
2996 "deploymentId": c.deploymentId,
2997 })
2998 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2999 }
3000
3001
3002
3003
3004
3005
3006 func (c *ProjectsDeploymentsUpdateCall) Do(opts ...googleapi.CallOption) (*Deployment, error) {
3007 gensupport.SetOptions(c.urlParams_, opts...)
3008 res, err := c.doRequest("json")
3009 if res != nil && res.StatusCode == http.StatusNotModified {
3010 if res.Body != nil {
3011 res.Body.Close()
3012 }
3013 return nil, gensupport.WrapError(&googleapi.Error{
3014 Code: res.StatusCode,
3015 Header: res.Header,
3016 })
3017 }
3018 if err != nil {
3019 return nil, err
3020 }
3021 defer googleapi.CloseBody(res)
3022 if err := googleapi.CheckResponse(res); err != nil {
3023 return nil, gensupport.WrapError(err)
3024 }
3025 ret := &Deployment{
3026 ServerResponse: googleapi.ServerResponse{
3027 Header: res.Header,
3028 HTTPStatusCode: res.StatusCode,
3029 },
3030 }
3031 target := &ret
3032 if err := gensupport.DecodeResponse(target, res); err != nil {
3033 return nil, err
3034 }
3035 return ret, nil
3036 }
3037
3038 type ProjectsVersionsCreateCall struct {
3039 s *Service
3040 scriptId string
3041 version *Version
3042 urlParams_ gensupport.URLParams
3043 ctx_ context.Context
3044 header_ http.Header
3045 }
3046
3047
3048
3049
3050
3051 func (r *ProjectsVersionsService) Create(scriptId string, version *Version) *ProjectsVersionsCreateCall {
3052 c := &ProjectsVersionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3053 c.scriptId = scriptId
3054 c.version = version
3055 return c
3056 }
3057
3058
3059
3060
3061 func (c *ProjectsVersionsCreateCall) Fields(s ...googleapi.Field) *ProjectsVersionsCreateCall {
3062 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3063 return c
3064 }
3065
3066
3067 func (c *ProjectsVersionsCreateCall) Context(ctx context.Context) *ProjectsVersionsCreateCall {
3068 c.ctx_ = ctx
3069 return c
3070 }
3071
3072
3073
3074 func (c *ProjectsVersionsCreateCall) Header() http.Header {
3075 if c.header_ == nil {
3076 c.header_ = make(http.Header)
3077 }
3078 return c.header_
3079 }
3080
3081 func (c *ProjectsVersionsCreateCall) doRequest(alt string) (*http.Response, error) {
3082 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3083 var body io.Reader = nil
3084 body, err := googleapi.WithoutDataWrapper.JSONReader(c.version)
3085 if err != nil {
3086 return nil, err
3087 }
3088 c.urlParams_.Set("alt", alt)
3089 c.urlParams_.Set("prettyPrint", "false")
3090 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/versions")
3091 urls += "?" + c.urlParams_.Encode()
3092 req, err := http.NewRequest("POST", urls, body)
3093 if err != nil {
3094 return nil, err
3095 }
3096 req.Header = reqHeaders
3097 googleapi.Expand(req.URL, map[string]string{
3098 "scriptId": c.scriptId,
3099 })
3100 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3101 }
3102
3103
3104
3105
3106
3107
3108 func (c *ProjectsVersionsCreateCall) Do(opts ...googleapi.CallOption) (*Version, error) {
3109 gensupport.SetOptions(c.urlParams_, opts...)
3110 res, err := c.doRequest("json")
3111 if res != nil && res.StatusCode == http.StatusNotModified {
3112 if res.Body != nil {
3113 res.Body.Close()
3114 }
3115 return nil, gensupport.WrapError(&googleapi.Error{
3116 Code: res.StatusCode,
3117 Header: res.Header,
3118 })
3119 }
3120 if err != nil {
3121 return nil, err
3122 }
3123 defer googleapi.CloseBody(res)
3124 if err := googleapi.CheckResponse(res); err != nil {
3125 return nil, gensupport.WrapError(err)
3126 }
3127 ret := &Version{
3128 ServerResponse: googleapi.ServerResponse{
3129 Header: res.Header,
3130 HTTPStatusCode: res.StatusCode,
3131 },
3132 }
3133 target := &ret
3134 if err := gensupport.DecodeResponse(target, res); err != nil {
3135 return nil, err
3136 }
3137 return ret, nil
3138 }
3139
3140 type ProjectsVersionsGetCall struct {
3141 s *Service
3142 scriptId string
3143 versionNumber int64
3144 urlParams_ gensupport.URLParams
3145 ifNoneMatch_ string
3146 ctx_ context.Context
3147 header_ http.Header
3148 }
3149
3150
3151
3152
3153
3154 func (r *ProjectsVersionsService) Get(scriptId string, versionNumber int64) *ProjectsVersionsGetCall {
3155 c := &ProjectsVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3156 c.scriptId = scriptId
3157 c.versionNumber = versionNumber
3158 return c
3159 }
3160
3161
3162
3163
3164 func (c *ProjectsVersionsGetCall) Fields(s ...googleapi.Field) *ProjectsVersionsGetCall {
3165 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3166 return c
3167 }
3168
3169
3170
3171
3172 func (c *ProjectsVersionsGetCall) IfNoneMatch(entityTag string) *ProjectsVersionsGetCall {
3173 c.ifNoneMatch_ = entityTag
3174 return c
3175 }
3176
3177
3178 func (c *ProjectsVersionsGetCall) Context(ctx context.Context) *ProjectsVersionsGetCall {
3179 c.ctx_ = ctx
3180 return c
3181 }
3182
3183
3184
3185 func (c *ProjectsVersionsGetCall) Header() http.Header {
3186 if c.header_ == nil {
3187 c.header_ = make(http.Header)
3188 }
3189 return c.header_
3190 }
3191
3192 func (c *ProjectsVersionsGetCall) doRequest(alt string) (*http.Response, error) {
3193 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3194 if c.ifNoneMatch_ != "" {
3195 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3196 }
3197 var body io.Reader = nil
3198 c.urlParams_.Set("alt", alt)
3199 c.urlParams_.Set("prettyPrint", "false")
3200 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/versions/{versionNumber}")
3201 urls += "?" + c.urlParams_.Encode()
3202 req, err := http.NewRequest("GET", urls, body)
3203 if err != nil {
3204 return nil, err
3205 }
3206 req.Header = reqHeaders
3207 googleapi.Expand(req.URL, map[string]string{
3208 "scriptId": c.scriptId,
3209 "versionNumber": strconv.FormatInt(c.versionNumber, 10),
3210 })
3211 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3212 }
3213
3214
3215
3216
3217
3218
3219 func (c *ProjectsVersionsGetCall) Do(opts ...googleapi.CallOption) (*Version, error) {
3220 gensupport.SetOptions(c.urlParams_, opts...)
3221 res, err := c.doRequest("json")
3222 if res != nil && res.StatusCode == http.StatusNotModified {
3223 if res.Body != nil {
3224 res.Body.Close()
3225 }
3226 return nil, gensupport.WrapError(&googleapi.Error{
3227 Code: res.StatusCode,
3228 Header: res.Header,
3229 })
3230 }
3231 if err != nil {
3232 return nil, err
3233 }
3234 defer googleapi.CloseBody(res)
3235 if err := googleapi.CheckResponse(res); err != nil {
3236 return nil, gensupport.WrapError(err)
3237 }
3238 ret := &Version{
3239 ServerResponse: googleapi.ServerResponse{
3240 Header: res.Header,
3241 HTTPStatusCode: res.StatusCode,
3242 },
3243 }
3244 target := &ret
3245 if err := gensupport.DecodeResponse(target, res); err != nil {
3246 return nil, err
3247 }
3248 return ret, nil
3249 }
3250
3251 type ProjectsVersionsListCall struct {
3252 s *Service
3253 scriptId string
3254 urlParams_ gensupport.URLParams
3255 ifNoneMatch_ string
3256 ctx_ context.Context
3257 header_ http.Header
3258 }
3259
3260
3261
3262
3263 func (r *ProjectsVersionsService) List(scriptId string) *ProjectsVersionsListCall {
3264 c := &ProjectsVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3265 c.scriptId = scriptId
3266 return c
3267 }
3268
3269
3270
3271 func (c *ProjectsVersionsListCall) PageSize(pageSize int64) *ProjectsVersionsListCall {
3272 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3273 return c
3274 }
3275
3276
3277
3278
3279 func (c *ProjectsVersionsListCall) PageToken(pageToken string) *ProjectsVersionsListCall {
3280 c.urlParams_.Set("pageToken", pageToken)
3281 return c
3282 }
3283
3284
3285
3286
3287 func (c *ProjectsVersionsListCall) Fields(s ...googleapi.Field) *ProjectsVersionsListCall {
3288 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3289 return c
3290 }
3291
3292
3293
3294
3295 func (c *ProjectsVersionsListCall) IfNoneMatch(entityTag string) *ProjectsVersionsListCall {
3296 c.ifNoneMatch_ = entityTag
3297 return c
3298 }
3299
3300
3301 func (c *ProjectsVersionsListCall) Context(ctx context.Context) *ProjectsVersionsListCall {
3302 c.ctx_ = ctx
3303 return c
3304 }
3305
3306
3307
3308 func (c *ProjectsVersionsListCall) Header() http.Header {
3309 if c.header_ == nil {
3310 c.header_ = make(http.Header)
3311 }
3312 return c.header_
3313 }
3314
3315 func (c *ProjectsVersionsListCall) doRequest(alt string) (*http.Response, error) {
3316 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3317 if c.ifNoneMatch_ != "" {
3318 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3319 }
3320 var body io.Reader = nil
3321 c.urlParams_.Set("alt", alt)
3322 c.urlParams_.Set("prettyPrint", "false")
3323 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/versions")
3324 urls += "?" + c.urlParams_.Encode()
3325 req, err := http.NewRequest("GET", urls, body)
3326 if err != nil {
3327 return nil, err
3328 }
3329 req.Header = reqHeaders
3330 googleapi.Expand(req.URL, map[string]string{
3331 "scriptId": c.scriptId,
3332 })
3333 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3334 }
3335
3336
3337
3338
3339
3340
3341
3342 func (c *ProjectsVersionsListCall) Do(opts ...googleapi.CallOption) (*ListVersionsResponse, error) {
3343 gensupport.SetOptions(c.urlParams_, opts...)
3344 res, err := c.doRequest("json")
3345 if res != nil && res.StatusCode == http.StatusNotModified {
3346 if res.Body != nil {
3347 res.Body.Close()
3348 }
3349 return nil, gensupport.WrapError(&googleapi.Error{
3350 Code: res.StatusCode,
3351 Header: res.Header,
3352 })
3353 }
3354 if err != nil {
3355 return nil, err
3356 }
3357 defer googleapi.CloseBody(res)
3358 if err := googleapi.CheckResponse(res); err != nil {
3359 return nil, gensupport.WrapError(err)
3360 }
3361 ret := &ListVersionsResponse{
3362 ServerResponse: googleapi.ServerResponse{
3363 Header: res.Header,
3364 HTTPStatusCode: res.StatusCode,
3365 },
3366 }
3367 target := &ret
3368 if err := gensupport.DecodeResponse(target, res); err != nil {
3369 return nil, err
3370 }
3371 return ret, nil
3372 }
3373
3374
3375
3376
3377 func (c *ProjectsVersionsListCall) Pages(ctx context.Context, f func(*ListVersionsResponse) error) error {
3378 c.ctx_ = ctx
3379 defer c.PageToken(c.urlParams_.Get("pageToken"))
3380 for {
3381 x, err := c.Do()
3382 if err != nil {
3383 return err
3384 }
3385 if err := f(x); err != nil {
3386 return err
3387 }
3388 if x.NextPageToken == "" {
3389 return nil
3390 }
3391 c.PageToken(x.NextPageToken)
3392 }
3393 }
3394
3395 type ScriptsRunCall struct {
3396 s *Service
3397 scriptId string
3398 executionrequest *ExecutionRequest
3399 urlParams_ gensupport.URLParams
3400 ctx_ context.Context
3401 header_ http.Header
3402 }
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421 func (r *ScriptsService) Run(scriptId string, executionrequest *ExecutionRequest) *ScriptsRunCall {
3422 c := &ScriptsRunCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3423 c.scriptId = scriptId
3424 c.executionrequest = executionrequest
3425 return c
3426 }
3427
3428
3429
3430
3431 func (c *ScriptsRunCall) Fields(s ...googleapi.Field) *ScriptsRunCall {
3432 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3433 return c
3434 }
3435
3436
3437 func (c *ScriptsRunCall) Context(ctx context.Context) *ScriptsRunCall {
3438 c.ctx_ = ctx
3439 return c
3440 }
3441
3442
3443
3444 func (c *ScriptsRunCall) Header() http.Header {
3445 if c.header_ == nil {
3446 c.header_ = make(http.Header)
3447 }
3448 return c.header_
3449 }
3450
3451 func (c *ScriptsRunCall) doRequest(alt string) (*http.Response, error) {
3452 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3453 var body io.Reader = nil
3454 body, err := googleapi.WithoutDataWrapper.JSONReader(c.executionrequest)
3455 if err != nil {
3456 return nil, err
3457 }
3458 c.urlParams_.Set("alt", alt)
3459 c.urlParams_.Set("prettyPrint", "false")
3460 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/scripts/{scriptId}:run")
3461 urls += "?" + c.urlParams_.Encode()
3462 req, err := http.NewRequest("POST", urls, body)
3463 if err != nil {
3464 return nil, err
3465 }
3466 req.Header = reqHeaders
3467 googleapi.Expand(req.URL, map[string]string{
3468 "scriptId": c.scriptId,
3469 })
3470 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3471 }
3472
3473
3474
3475
3476
3477
3478 func (c *ScriptsRunCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3479 gensupport.SetOptions(c.urlParams_, opts...)
3480 res, err := c.doRequest("json")
3481 if res != nil && res.StatusCode == http.StatusNotModified {
3482 if res.Body != nil {
3483 res.Body.Close()
3484 }
3485 return nil, gensupport.WrapError(&googleapi.Error{
3486 Code: res.StatusCode,
3487 Header: res.Header,
3488 })
3489 }
3490 if err != nil {
3491 return nil, err
3492 }
3493 defer googleapi.CloseBody(res)
3494 if err := googleapi.CheckResponse(res); err != nil {
3495 return nil, gensupport.WrapError(err)
3496 }
3497 ret := &Operation{
3498 ServerResponse: googleapi.ServerResponse{
3499 Header: res.Header,
3500 HTTPStatusCode: res.StatusCode,
3501 },
3502 }
3503 target := &ret
3504 if err := gensupport.DecodeResponse(target, res); err != nil {
3505 return nil, err
3506 }
3507 return ret, nil
3508 }
3509
View as plain text