1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51 package apigeeregistry
52
53 import (
54 "bytes"
55 "context"
56 "encoding/json"
57 "errors"
58 "fmt"
59 "io"
60 "net/http"
61 "net/url"
62 "strconv"
63 "strings"
64
65 googleapi "google.golang.org/api/googleapi"
66 internal "google.golang.org/api/internal"
67 gensupport "google.golang.org/api/internal/gensupport"
68 option "google.golang.org/api/option"
69 internaloption "google.golang.org/api/option/internaloption"
70 htransport "google.golang.org/api/transport/http"
71 )
72
73
74
75 var _ = bytes.NewBuffer
76 var _ = strconv.Itoa
77 var _ = fmt.Sprintf
78 var _ = json.NewDecoder
79 var _ = io.Copy
80 var _ = url.Parse
81 var _ = gensupport.MarshalJSON
82 var _ = googleapi.Version
83 var _ = errors.New
84 var _ = strings.Replace
85 var _ = context.Canceled
86 var _ = internaloption.WithDefaultEndpoint
87 var _ = internal.Version
88
89 const apiId = "apigeeregistry:v1"
90 const apiName = "apigeeregistry"
91 const apiVersion = "v1"
92 const basePath = "https://apigeeregistry.googleapis.com/"
93 const basePathTemplate = "https://apigeeregistry.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://apigeeregistry.mtls.googleapis.com/"
95
96
97 const (
98
99
100 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
101 )
102
103
104 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
105 scopesOption := internaloption.WithDefaultScopes(
106 "https://www.googleapis.com/auth/cloud-platform",
107 )
108
109 opts = append([]option.ClientOption{scopesOption}, opts...)
110 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
111 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
112 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
113 opts = append(opts, internaloption.EnableNewAuthLibrary())
114 client, endpoint, err := htransport.NewClient(ctx, opts...)
115 if err != nil {
116 return nil, err
117 }
118 s, err := New(client)
119 if err != nil {
120 return nil, err
121 }
122 if endpoint != "" {
123 s.BasePath = endpoint
124 }
125 return s, nil
126 }
127
128
129
130
131
132
133 func New(client *http.Client) (*Service, error) {
134 if client == nil {
135 return nil, errors.New("client is nil")
136 }
137 s := &Service{client: client, BasePath: basePath}
138 s.Projects = NewProjectsService(s)
139 return s, nil
140 }
141
142 type Service struct {
143 client *http.Client
144 BasePath string
145 UserAgent string
146
147 Projects *ProjectsService
148 }
149
150 func (s *Service) userAgent() string {
151 if s.UserAgent == "" {
152 return googleapi.UserAgent
153 }
154 return googleapi.UserAgent + " " + s.UserAgent
155 }
156
157 func NewProjectsService(s *Service) *ProjectsService {
158 rs := &ProjectsService{s: s}
159 rs.Locations = NewProjectsLocationsService(s)
160 return rs
161 }
162
163 type ProjectsService struct {
164 s *Service
165
166 Locations *ProjectsLocationsService
167 }
168
169 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
170 rs := &ProjectsLocationsService{s: s}
171 rs.Apis = NewProjectsLocationsApisService(s)
172 rs.Artifacts = NewProjectsLocationsArtifactsService(s)
173 rs.Documents = NewProjectsLocationsDocumentsService(s)
174 rs.Instances = NewProjectsLocationsInstancesService(s)
175 rs.Operations = NewProjectsLocationsOperationsService(s)
176 rs.Runtime = NewProjectsLocationsRuntimeService(s)
177 return rs
178 }
179
180 type ProjectsLocationsService struct {
181 s *Service
182
183 Apis *ProjectsLocationsApisService
184
185 Artifacts *ProjectsLocationsArtifactsService
186
187 Documents *ProjectsLocationsDocumentsService
188
189 Instances *ProjectsLocationsInstancesService
190
191 Operations *ProjectsLocationsOperationsService
192
193 Runtime *ProjectsLocationsRuntimeService
194 }
195
196 func NewProjectsLocationsApisService(s *Service) *ProjectsLocationsApisService {
197 rs := &ProjectsLocationsApisService{s: s}
198 rs.Artifacts = NewProjectsLocationsApisArtifactsService(s)
199 rs.Deployments = NewProjectsLocationsApisDeploymentsService(s)
200 rs.Versions = NewProjectsLocationsApisVersionsService(s)
201 return rs
202 }
203
204 type ProjectsLocationsApisService struct {
205 s *Service
206
207 Artifacts *ProjectsLocationsApisArtifactsService
208
209 Deployments *ProjectsLocationsApisDeploymentsService
210
211 Versions *ProjectsLocationsApisVersionsService
212 }
213
214 func NewProjectsLocationsApisArtifactsService(s *Service) *ProjectsLocationsApisArtifactsService {
215 rs := &ProjectsLocationsApisArtifactsService{s: s}
216 return rs
217 }
218
219 type ProjectsLocationsApisArtifactsService struct {
220 s *Service
221 }
222
223 func NewProjectsLocationsApisDeploymentsService(s *Service) *ProjectsLocationsApisDeploymentsService {
224 rs := &ProjectsLocationsApisDeploymentsService{s: s}
225 rs.Artifacts = NewProjectsLocationsApisDeploymentsArtifactsService(s)
226 return rs
227 }
228
229 type ProjectsLocationsApisDeploymentsService struct {
230 s *Service
231
232 Artifacts *ProjectsLocationsApisDeploymentsArtifactsService
233 }
234
235 func NewProjectsLocationsApisDeploymentsArtifactsService(s *Service) *ProjectsLocationsApisDeploymentsArtifactsService {
236 rs := &ProjectsLocationsApisDeploymentsArtifactsService{s: s}
237 return rs
238 }
239
240 type ProjectsLocationsApisDeploymentsArtifactsService struct {
241 s *Service
242 }
243
244 func NewProjectsLocationsApisVersionsService(s *Service) *ProjectsLocationsApisVersionsService {
245 rs := &ProjectsLocationsApisVersionsService{s: s}
246 rs.Artifacts = NewProjectsLocationsApisVersionsArtifactsService(s)
247 rs.Specs = NewProjectsLocationsApisVersionsSpecsService(s)
248 return rs
249 }
250
251 type ProjectsLocationsApisVersionsService struct {
252 s *Service
253
254 Artifacts *ProjectsLocationsApisVersionsArtifactsService
255
256 Specs *ProjectsLocationsApisVersionsSpecsService
257 }
258
259 func NewProjectsLocationsApisVersionsArtifactsService(s *Service) *ProjectsLocationsApisVersionsArtifactsService {
260 rs := &ProjectsLocationsApisVersionsArtifactsService{s: s}
261 return rs
262 }
263
264 type ProjectsLocationsApisVersionsArtifactsService struct {
265 s *Service
266 }
267
268 func NewProjectsLocationsApisVersionsSpecsService(s *Service) *ProjectsLocationsApisVersionsSpecsService {
269 rs := &ProjectsLocationsApisVersionsSpecsService{s: s}
270 rs.Artifacts = NewProjectsLocationsApisVersionsSpecsArtifactsService(s)
271 return rs
272 }
273
274 type ProjectsLocationsApisVersionsSpecsService struct {
275 s *Service
276
277 Artifacts *ProjectsLocationsApisVersionsSpecsArtifactsService
278 }
279
280 func NewProjectsLocationsApisVersionsSpecsArtifactsService(s *Service) *ProjectsLocationsApisVersionsSpecsArtifactsService {
281 rs := &ProjectsLocationsApisVersionsSpecsArtifactsService{s: s}
282 return rs
283 }
284
285 type ProjectsLocationsApisVersionsSpecsArtifactsService struct {
286 s *Service
287 }
288
289 func NewProjectsLocationsArtifactsService(s *Service) *ProjectsLocationsArtifactsService {
290 rs := &ProjectsLocationsArtifactsService{s: s}
291 return rs
292 }
293
294 type ProjectsLocationsArtifactsService struct {
295 s *Service
296 }
297
298 func NewProjectsLocationsDocumentsService(s *Service) *ProjectsLocationsDocumentsService {
299 rs := &ProjectsLocationsDocumentsService{s: s}
300 return rs
301 }
302
303 type ProjectsLocationsDocumentsService struct {
304 s *Service
305 }
306
307 func NewProjectsLocationsInstancesService(s *Service) *ProjectsLocationsInstancesService {
308 rs := &ProjectsLocationsInstancesService{s: s}
309 return rs
310 }
311
312 type ProjectsLocationsInstancesService struct {
313 s *Service
314 }
315
316 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
317 rs := &ProjectsLocationsOperationsService{s: s}
318 return rs
319 }
320
321 type ProjectsLocationsOperationsService struct {
322 s *Service
323 }
324
325 func NewProjectsLocationsRuntimeService(s *Service) *ProjectsLocationsRuntimeService {
326 rs := &ProjectsLocationsRuntimeService{s: s}
327 return rs
328 }
329
330 type ProjectsLocationsRuntimeService struct {
331 s *Service
332 }
333
334
335
336 type Api struct {
337
338
339
340
341 Annotations map[string]string `json:"annotations,omitempty"`
342
343
344
345
346 Availability string `json:"availability,omitempty"`
347
348 CreateTime string `json:"createTime,omitempty"`
349
350 Description string `json:"description,omitempty"`
351
352 DisplayName string `json:"displayName,omitempty"`
353
354
355
356
357
358
359
360
361
362 Labels map[string]string `json:"labels,omitempty"`
363
364 Name string `json:"name,omitempty"`
365
366
367 RecommendedDeployment string `json:"recommendedDeployment,omitempty"`
368
369
370 RecommendedVersion string `json:"recommendedVersion,omitempty"`
371
372 UpdateTime string `json:"updateTime,omitempty"`
373
374
375 googleapi.ServerResponse `json:"-"`
376
377
378
379
380
381 ForceSendFields []string `json:"-"`
382
383
384
385
386 NullFields []string `json:"-"`
387 }
388
389 func (s *Api) MarshalJSON() ([]byte, error) {
390 type NoMethod Api
391 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
392 }
393
394
395
396
397
398
399 type ApiDeployment struct {
400
401
402 AccessGuidance string `json:"accessGuidance,omitempty"`
403
404
405
406
407 Annotations map[string]string `json:"annotations,omitempty"`
408
409
410
411
412
413 ApiSpecRevision string `json:"apiSpecRevision,omitempty"`
414
415
416 CreateTime string `json:"createTime,omitempty"`
417
418 Description string `json:"description,omitempty"`
419
420 DisplayName string `json:"displayName,omitempty"`
421
422
423 EndpointUri string `json:"endpointUri,omitempty"`
424
425
426 ExternalChannelUri string `json:"externalChannelUri,omitempty"`
427
428
429 IntendedAudience string `json:"intendedAudience,omitempty"`
430
431
432
433
434
435
436
437
438 Labels map[string]string `json:"labels,omitempty"`
439
440 Name string `json:"name,omitempty"`
441
442
443 RevisionCreateTime string `json:"revisionCreateTime,omitempty"`
444
445
446
447 RevisionId string `json:"revisionId,omitempty"`
448
449
450 RevisionUpdateTime string `json:"revisionUpdateTime,omitempty"`
451
452
453 googleapi.ServerResponse `json:"-"`
454
455
456
457
458
459 ForceSendFields []string `json:"-"`
460
461
462
463
464 NullFields []string `json:"-"`
465 }
466
467 func (s *ApiDeployment) MarshalJSON() ([]byte, error) {
468 type NoMethod ApiDeployment
469 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
470 }
471
472
473
474
475
476
477
478
479
480 type ApiSpec struct {
481
482
483
484
485 Annotations map[string]string `json:"annotations,omitempty"`
486
487
488
489 Contents string `json:"contents,omitempty"`
490
491
492 CreateTime string `json:"createTime,omitempty"`
493
494 Description string `json:"description,omitempty"`
495
496
497 Filename string `json:"filename,omitempty"`
498
499
500 Hash string `json:"hash,omitempty"`
501
502
503
504
505
506
507
508
509 Labels map[string]string `json:"labels,omitempty"`
510
511
512
513
514
515
516
517
518 MimeType string `json:"mimeType,omitempty"`
519
520 Name string `json:"name,omitempty"`
521
522
523 RevisionCreateTime string `json:"revisionCreateTime,omitempty"`
524
525
526
527 RevisionId string `json:"revisionId,omitempty"`
528
529
530 RevisionUpdateTime string `json:"revisionUpdateTime,omitempty"`
531
532
533 SizeBytes int64 `json:"sizeBytes,omitempty"`
534
535
536
537
538 SourceUri string `json:"sourceUri,omitempty"`
539
540
541 googleapi.ServerResponse `json:"-"`
542
543
544
545
546
547 ForceSendFields []string `json:"-"`
548
549
550
551
552 NullFields []string `json:"-"`
553 }
554
555 func (s *ApiSpec) MarshalJSON() ([]byte, error) {
556 type NoMethod ApiSpec
557 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
558 }
559
560
561
562 type ApiVersion struct {
563
564
565
566
567 Annotations map[string]string `json:"annotations,omitempty"`
568
569 CreateTime string `json:"createTime,omitempty"`
570
571 Description string `json:"description,omitempty"`
572
573 DisplayName string `json:"displayName,omitempty"`
574
575
576
577
578
579
580
581
582 Labels map[string]string `json:"labels,omitempty"`
583
584 Name string `json:"name,omitempty"`
585
586
587
588 PrimarySpec string `json:"primarySpec,omitempty"`
589
590
591
592
593 State string `json:"state,omitempty"`
594
595 UpdateTime string `json:"updateTime,omitempty"`
596
597
598 googleapi.ServerResponse `json:"-"`
599
600
601
602
603
604 ForceSendFields []string `json:"-"`
605
606
607
608
609 NullFields []string `json:"-"`
610 }
611
612 func (s *ApiVersion) MarshalJSON() ([]byte, error) {
613 type NoMethod ApiVersion
614 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
615 }
616
617
618
619
620
621
622
623
624
625 type Artifact struct {
626
627
628
629
630 Annotations map[string]string `json:"annotations,omitempty"`
631
632
633
634 Contents string `json:"contents,omitempty"`
635
636 CreateTime string `json:"createTime,omitempty"`
637
638
639 Hash string `json:"hash,omitempty"`
640
641
642
643
644
645
646
647
648 Labels map[string]string `json:"labels,omitempty"`
649
650
651
652
653
654 MimeType string `json:"mimeType,omitempty"`
655
656 Name string `json:"name,omitempty"`
657
658
659 SizeBytes int64 `json:"sizeBytes,omitempty"`
660
661 UpdateTime string `json:"updateTime,omitempty"`
662
663
664 googleapi.ServerResponse `json:"-"`
665
666
667
668
669
670 ForceSendFields []string `json:"-"`
671
672
673
674
675 NullFields []string `json:"-"`
676 }
677
678 func (s *Artifact) MarshalJSON() ([]byte, error) {
679 type NoMethod Artifact
680 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
681 }
682
683
684 type Binding struct {
685
686
687
688
689
690
691
692
693 Condition *Expr `json:"condition,omitempty"`
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729 Members []string `json:"members,omitempty"`
730
731
732 Role string `json:"role,omitempty"`
733
734
735
736
737
738 ForceSendFields []string `json:"-"`
739
740
741
742
743 NullFields []string `json:"-"`
744 }
745
746 func (s *Binding) MarshalJSON() ([]byte, error) {
747 type NoMethod Binding
748 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
749 }
750
751
752 type Build struct {
753
754 CommitId string `json:"commitId,omitempty"`
755
756 CommitTime string `json:"commitTime,omitempty"`
757
758
759 Repo string `json:"repo,omitempty"`
760
761
762
763
764
765 ForceSendFields []string `json:"-"`
766
767
768
769
770 NullFields []string `json:"-"`
771 }
772
773 func (s *Build) MarshalJSON() ([]byte, error) {
774 type NoMethod Build
775 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
776 }
777
778
779 type CancelOperationRequest struct {
780 }
781
782
783 type Config struct {
784
785
786
787
788 CmekKeyName string `json:"cmekKeyName,omitempty"`
789
790 Location string `json:"location,omitempty"`
791
792
793
794
795
796 ForceSendFields []string `json:"-"`
797
798
799
800
801 NullFields []string `json:"-"`
802 }
803
804 func (s *Config) MarshalJSON() ([]byte, error) {
805 type NoMethod Config
806 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
807 }
808
809
810
811
812
813 type Empty struct {
814
815 googleapi.ServerResponse `json:"-"`
816 }
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834 type Expr struct {
835
836
837 Description string `json:"description,omitempty"`
838
839
840 Expression string `json:"expression,omitempty"`
841
842
843 Location string `json:"location,omitempty"`
844
845
846
847 Title string `json:"title,omitempty"`
848
849
850
851
852
853 ForceSendFields []string `json:"-"`
854
855
856
857
858 NullFields []string `json:"-"`
859 }
860
861 func (s *Expr) MarshalJSON() ([]byte, error) {
862 type NoMethod Expr
863 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
864 }
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883 type HttpBody struct {
884
885
886 ContentType string `json:"contentType,omitempty"`
887
888 Data string `json:"data,omitempty"`
889
890
891 Extensions []googleapi.RawMessage `json:"extensions,omitempty"`
892
893
894 googleapi.ServerResponse `json:"-"`
895
896
897
898
899
900 ForceSendFields []string `json:"-"`
901
902
903
904
905 NullFields []string `json:"-"`
906 }
907
908 func (s *HttpBody) MarshalJSON() ([]byte, error) {
909 type NoMethod HttpBody
910 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
911 }
912
913
914
915 type Instance struct {
916
917 Build *Build `json:"build,omitempty"`
918
919 Config *Config `json:"config,omitempty"`
920
921 CreateTime string `json:"createTime,omitempty"`
922
923
924 Name string `json:"name,omitempty"`
925
926
927
928
929
930
931
932
933
934
935
936 State string `json:"state,omitempty"`
937
938
939 StateMessage string `json:"stateMessage,omitempty"`
940
941 UpdateTime string `json:"updateTime,omitempty"`
942
943
944 googleapi.ServerResponse `json:"-"`
945
946
947
948
949
950 ForceSendFields []string `json:"-"`
951
952
953
954
955 NullFields []string `json:"-"`
956 }
957
958 func (s *Instance) MarshalJSON() ([]byte, error) {
959 type NoMethod Instance
960 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
961 }
962
963
964
965 type ListApiDeploymentRevisionsResponse struct {
966
967 ApiDeployments []*ApiDeployment `json:"apiDeployments,omitempty"`
968
969
970 NextPageToken string `json:"nextPageToken,omitempty"`
971
972
973 googleapi.ServerResponse `json:"-"`
974
975
976
977
978
979 ForceSendFields []string `json:"-"`
980
981
982
983
984 NullFields []string `json:"-"`
985 }
986
987 func (s *ListApiDeploymentRevisionsResponse) MarshalJSON() ([]byte, error) {
988 type NoMethod ListApiDeploymentRevisionsResponse
989 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
990 }
991
992
993 type ListApiDeploymentsResponse struct {
994
995 ApiDeployments []*ApiDeployment `json:"apiDeployments,omitempty"`
996
997
998 NextPageToken string `json:"nextPageToken,omitempty"`
999
1000
1001 googleapi.ServerResponse `json:"-"`
1002
1003
1004
1005
1006
1007 ForceSendFields []string `json:"-"`
1008
1009
1010
1011
1012 NullFields []string `json:"-"`
1013 }
1014
1015 func (s *ListApiDeploymentsResponse) MarshalJSON() ([]byte, error) {
1016 type NoMethod ListApiDeploymentsResponse
1017 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1018 }
1019
1020
1021
1022 type ListApiSpecRevisionsResponse struct {
1023
1024 ApiSpecs []*ApiSpec `json:"apiSpecs,omitempty"`
1025
1026
1027 NextPageToken string `json:"nextPageToken,omitempty"`
1028
1029
1030 googleapi.ServerResponse `json:"-"`
1031
1032
1033
1034
1035
1036 ForceSendFields []string `json:"-"`
1037
1038
1039
1040
1041 NullFields []string `json:"-"`
1042 }
1043
1044 func (s *ListApiSpecRevisionsResponse) MarshalJSON() ([]byte, error) {
1045 type NoMethod ListApiSpecRevisionsResponse
1046 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1047 }
1048
1049
1050 type ListApiSpecsResponse struct {
1051
1052 ApiSpecs []*ApiSpec `json:"apiSpecs,omitempty"`
1053
1054
1055 NextPageToken string `json:"nextPageToken,omitempty"`
1056
1057
1058 googleapi.ServerResponse `json:"-"`
1059
1060
1061
1062
1063
1064 ForceSendFields []string `json:"-"`
1065
1066
1067
1068
1069 NullFields []string `json:"-"`
1070 }
1071
1072 func (s *ListApiSpecsResponse) MarshalJSON() ([]byte, error) {
1073 type NoMethod ListApiSpecsResponse
1074 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1075 }
1076
1077
1078 type ListApiVersionsResponse struct {
1079
1080 ApiVersions []*ApiVersion `json:"apiVersions,omitempty"`
1081
1082
1083 NextPageToken string `json:"nextPageToken,omitempty"`
1084
1085
1086 googleapi.ServerResponse `json:"-"`
1087
1088
1089
1090
1091
1092 ForceSendFields []string `json:"-"`
1093
1094
1095
1096
1097 NullFields []string `json:"-"`
1098 }
1099
1100 func (s *ListApiVersionsResponse) MarshalJSON() ([]byte, error) {
1101 type NoMethod ListApiVersionsResponse
1102 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1103 }
1104
1105
1106 type ListApisResponse struct {
1107
1108 Apis []*Api `json:"apis,omitempty"`
1109
1110
1111 NextPageToken string `json:"nextPageToken,omitempty"`
1112
1113
1114 googleapi.ServerResponse `json:"-"`
1115
1116
1117
1118
1119
1120 ForceSendFields []string `json:"-"`
1121
1122
1123
1124
1125 NullFields []string `json:"-"`
1126 }
1127
1128 func (s *ListApisResponse) MarshalJSON() ([]byte, error) {
1129 type NoMethod ListApisResponse
1130 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1131 }
1132
1133
1134 type ListArtifactsResponse struct {
1135
1136 Artifacts []*Artifact `json:"artifacts,omitempty"`
1137
1138
1139 NextPageToken string `json:"nextPageToken,omitempty"`
1140
1141
1142 googleapi.ServerResponse `json:"-"`
1143
1144
1145
1146
1147
1148 ForceSendFields []string `json:"-"`
1149
1150
1151
1152
1153 NullFields []string `json:"-"`
1154 }
1155
1156 func (s *ListArtifactsResponse) MarshalJSON() ([]byte, error) {
1157 type NoMethod ListArtifactsResponse
1158 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1159 }
1160
1161
1162 type ListLocationsResponse struct {
1163
1164
1165 Locations []*Location `json:"locations,omitempty"`
1166
1167 NextPageToken string `json:"nextPageToken,omitempty"`
1168
1169
1170 googleapi.ServerResponse `json:"-"`
1171
1172
1173
1174
1175
1176 ForceSendFields []string `json:"-"`
1177
1178
1179
1180
1181 NullFields []string `json:"-"`
1182 }
1183
1184 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
1185 type NoMethod ListLocationsResponse
1186 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1187 }
1188
1189
1190 type ListOperationsResponse struct {
1191
1192 NextPageToken string `json:"nextPageToken,omitempty"`
1193
1194
1195 Operations []*Operation `json:"operations,omitempty"`
1196
1197
1198 googleapi.ServerResponse `json:"-"`
1199
1200
1201
1202
1203
1204 ForceSendFields []string `json:"-"`
1205
1206
1207
1208
1209 NullFields []string `json:"-"`
1210 }
1211
1212 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
1213 type NoMethod ListOperationsResponse
1214 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1215 }
1216
1217
1218 type Location struct {
1219
1220
1221 DisplayName string `json:"displayName,omitempty"`
1222
1223
1224 Labels map[string]string `json:"labels,omitempty"`
1225
1226 LocationId string `json:"locationId,omitempty"`
1227
1228
1229 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1230
1231
1232
1233 Name string `json:"name,omitempty"`
1234
1235
1236 googleapi.ServerResponse `json:"-"`
1237
1238
1239
1240
1241
1242 ForceSendFields []string `json:"-"`
1243
1244
1245
1246
1247 NullFields []string `json:"-"`
1248 }
1249
1250 func (s *Location) MarshalJSON() ([]byte, error) {
1251 type NoMethod Location
1252 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1253 }
1254
1255
1256
1257 type Operation struct {
1258
1259
1260
1261 Done bool `json:"done,omitempty"`
1262
1263 Error *Status `json:"error,omitempty"`
1264
1265
1266
1267
1268 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1269
1270
1271
1272 Name string `json:"name,omitempty"`
1273
1274
1275
1276
1277
1278
1279
1280 Response googleapi.RawMessage `json:"response,omitempty"`
1281
1282
1283 googleapi.ServerResponse `json:"-"`
1284
1285
1286
1287
1288
1289 ForceSendFields []string `json:"-"`
1290
1291
1292
1293
1294 NullFields []string `json:"-"`
1295 }
1296
1297 func (s *Operation) MarshalJSON() ([]byte, error) {
1298 type NoMethod Operation
1299 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1300 }
1301
1302
1303 type OperationMetadata struct {
1304
1305 ApiVersion string `json:"apiVersion,omitempty"`
1306
1307
1308
1309
1310 CancellationRequested bool `json:"cancellationRequested,omitempty"`
1311
1312 CreateTime string `json:"createTime,omitempty"`
1313
1314 EndTime string `json:"endTime,omitempty"`
1315
1316 StatusMessage string `json:"statusMessage,omitempty"`
1317
1318 Target string `json:"target,omitempty"`
1319
1320 Verb string `json:"verb,omitempty"`
1321
1322
1323
1324
1325
1326 ForceSendFields []string `json:"-"`
1327
1328
1329
1330
1331 NullFields []string `json:"-"`
1332 }
1333
1334 func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
1335 type NoMethod OperationMetadata
1336 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1337 }
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369 type Policy struct {
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379 Bindings []*Binding `json:"bindings,omitempty"`
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391 Etag string `json:"etag,omitempty"`
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407 Version int64 `json:"version,omitempty"`
1408
1409
1410 googleapi.ServerResponse `json:"-"`
1411
1412
1413
1414
1415
1416 ForceSendFields []string `json:"-"`
1417
1418
1419
1420
1421 NullFields []string `json:"-"`
1422 }
1423
1424 func (s *Policy) MarshalJSON() ([]byte, error) {
1425 type NoMethod Policy
1426 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1427 }
1428
1429
1430 type RollbackApiDeploymentRequest struct {
1431
1432
1433 RevisionId string `json:"revisionId,omitempty"`
1434
1435
1436
1437
1438
1439 ForceSendFields []string `json:"-"`
1440
1441
1442
1443
1444 NullFields []string `json:"-"`
1445 }
1446
1447 func (s *RollbackApiDeploymentRequest) MarshalJSON() ([]byte, error) {
1448 type NoMethod RollbackApiDeploymentRequest
1449 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1450 }
1451
1452
1453 type RollbackApiSpecRequest struct {
1454
1455
1456 RevisionId string `json:"revisionId,omitempty"`
1457
1458
1459
1460
1461
1462 ForceSendFields []string `json:"-"`
1463
1464
1465
1466
1467 NullFields []string `json:"-"`
1468 }
1469
1470 func (s *RollbackApiSpecRequest) MarshalJSON() ([]byte, error) {
1471 type NoMethod RollbackApiSpecRequest
1472 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1473 }
1474
1475
1476 type SetIamPolicyRequest struct {
1477
1478
1479
1480
1481 Policy *Policy `json:"policy,omitempty"`
1482
1483
1484
1485
1486
1487 ForceSendFields []string `json:"-"`
1488
1489
1490
1491
1492 NullFields []string `json:"-"`
1493 }
1494
1495 func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
1496 type NoMethod SetIamPolicyRequest
1497 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1498 }
1499
1500
1501
1502
1503
1504
1505
1506 type Status struct {
1507
1508 Code int64 `json:"code,omitempty"`
1509
1510
1511 Details []googleapi.RawMessage `json:"details,omitempty"`
1512
1513
1514
1515 Message string `json:"message,omitempty"`
1516
1517
1518
1519
1520
1521 ForceSendFields []string `json:"-"`
1522
1523
1524
1525
1526 NullFields []string `json:"-"`
1527 }
1528
1529 func (s *Status) MarshalJSON() ([]byte, error) {
1530 type NoMethod Status
1531 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1532 }
1533
1534
1535
1536 type TagApiDeploymentRevisionRequest struct {
1537
1538
1539 Tag string `json:"tag,omitempty"`
1540
1541
1542
1543
1544
1545 ForceSendFields []string `json:"-"`
1546
1547
1548
1549
1550 NullFields []string `json:"-"`
1551 }
1552
1553 func (s *TagApiDeploymentRevisionRequest) MarshalJSON() ([]byte, error) {
1554 type NoMethod TagApiDeploymentRevisionRequest
1555 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1556 }
1557
1558
1559 type TagApiSpecRevisionRequest struct {
1560
1561
1562 Tag string `json:"tag,omitempty"`
1563
1564
1565
1566
1567
1568 ForceSendFields []string `json:"-"`
1569
1570
1571
1572
1573 NullFields []string `json:"-"`
1574 }
1575
1576 func (s *TagApiSpecRevisionRequest) MarshalJSON() ([]byte, error) {
1577 type NoMethod TagApiSpecRevisionRequest
1578 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1579 }
1580
1581
1582 type TestIamPermissionsRequest struct {
1583
1584
1585
1586
1587 Permissions []string `json:"permissions,omitempty"`
1588
1589
1590
1591
1592
1593 ForceSendFields []string `json:"-"`
1594
1595
1596
1597
1598 NullFields []string `json:"-"`
1599 }
1600
1601 func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
1602 type NoMethod TestIamPermissionsRequest
1603 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1604 }
1605
1606
1607
1608 type TestIamPermissionsResponse struct {
1609
1610
1611 Permissions []string `json:"permissions,omitempty"`
1612
1613
1614 googleapi.ServerResponse `json:"-"`
1615
1616
1617
1618
1619
1620 ForceSendFields []string `json:"-"`
1621
1622
1623
1624
1625 NullFields []string `json:"-"`
1626 }
1627
1628 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
1629 type NoMethod TestIamPermissionsResponse
1630 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1631 }
1632
1633 type ProjectsLocationsGetCall struct {
1634 s *Service
1635 name string
1636 urlParams_ gensupport.URLParams
1637 ifNoneMatch_ string
1638 ctx_ context.Context
1639 header_ http.Header
1640 }
1641
1642
1643
1644
1645 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
1646 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1647 c.name = name
1648 return c
1649 }
1650
1651
1652
1653
1654 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
1655 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1656 return c
1657 }
1658
1659
1660
1661
1662 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
1663 c.ifNoneMatch_ = entityTag
1664 return c
1665 }
1666
1667
1668 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
1669 c.ctx_ = ctx
1670 return c
1671 }
1672
1673
1674
1675 func (c *ProjectsLocationsGetCall) Header() http.Header {
1676 if c.header_ == nil {
1677 c.header_ = make(http.Header)
1678 }
1679 return c.header_
1680 }
1681
1682 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
1683 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1684 if c.ifNoneMatch_ != "" {
1685 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1686 }
1687 var body io.Reader = nil
1688 c.urlParams_.Set("alt", alt)
1689 c.urlParams_.Set("prettyPrint", "false")
1690 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1691 urls += "?" + c.urlParams_.Encode()
1692 req, err := http.NewRequest("GET", urls, body)
1693 if err != nil {
1694 return nil, err
1695 }
1696 req.Header = reqHeaders
1697 googleapi.Expand(req.URL, map[string]string{
1698 "name": c.name,
1699 })
1700 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1701 }
1702
1703
1704
1705
1706
1707
1708 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
1709 gensupport.SetOptions(c.urlParams_, opts...)
1710 res, err := c.doRequest("json")
1711 if res != nil && res.StatusCode == http.StatusNotModified {
1712 if res.Body != nil {
1713 res.Body.Close()
1714 }
1715 return nil, gensupport.WrapError(&googleapi.Error{
1716 Code: res.StatusCode,
1717 Header: res.Header,
1718 })
1719 }
1720 if err != nil {
1721 return nil, err
1722 }
1723 defer googleapi.CloseBody(res)
1724 if err := googleapi.CheckResponse(res); err != nil {
1725 return nil, gensupport.WrapError(err)
1726 }
1727 ret := &Location{
1728 ServerResponse: googleapi.ServerResponse{
1729 Header: res.Header,
1730 HTTPStatusCode: res.StatusCode,
1731 },
1732 }
1733 target := &ret
1734 if err := gensupport.DecodeResponse(target, res); err != nil {
1735 return nil, err
1736 }
1737 return ret, nil
1738 }
1739
1740 type ProjectsLocationsListCall struct {
1741 s *Service
1742 name string
1743 urlParams_ gensupport.URLParams
1744 ifNoneMatch_ string
1745 ctx_ context.Context
1746 header_ http.Header
1747 }
1748
1749
1750
1751
1752 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
1753 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1754 c.name = name
1755 return c
1756 }
1757
1758
1759
1760
1761
1762 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
1763 c.urlParams_.Set("filter", filter)
1764 return c
1765 }
1766
1767
1768
1769 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
1770 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1771 return c
1772 }
1773
1774
1775
1776
1777 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
1778 c.urlParams_.Set("pageToken", pageToken)
1779 return c
1780 }
1781
1782
1783
1784
1785 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
1786 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1787 return c
1788 }
1789
1790
1791
1792
1793 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
1794 c.ifNoneMatch_ = entityTag
1795 return c
1796 }
1797
1798
1799 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
1800 c.ctx_ = ctx
1801 return c
1802 }
1803
1804
1805
1806 func (c *ProjectsLocationsListCall) Header() http.Header {
1807 if c.header_ == nil {
1808 c.header_ = make(http.Header)
1809 }
1810 return c.header_
1811 }
1812
1813 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
1814 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1815 if c.ifNoneMatch_ != "" {
1816 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1817 }
1818 var body io.Reader = nil
1819 c.urlParams_.Set("alt", alt)
1820 c.urlParams_.Set("prettyPrint", "false")
1821 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
1822 urls += "?" + c.urlParams_.Encode()
1823 req, err := http.NewRequest("GET", urls, body)
1824 if err != nil {
1825 return nil, err
1826 }
1827 req.Header = reqHeaders
1828 googleapi.Expand(req.URL, map[string]string{
1829 "name": c.name,
1830 })
1831 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1832 }
1833
1834
1835
1836
1837
1838
1839
1840 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
1841 gensupport.SetOptions(c.urlParams_, opts...)
1842 res, err := c.doRequest("json")
1843 if res != nil && res.StatusCode == http.StatusNotModified {
1844 if res.Body != nil {
1845 res.Body.Close()
1846 }
1847 return nil, gensupport.WrapError(&googleapi.Error{
1848 Code: res.StatusCode,
1849 Header: res.Header,
1850 })
1851 }
1852 if err != nil {
1853 return nil, err
1854 }
1855 defer googleapi.CloseBody(res)
1856 if err := googleapi.CheckResponse(res); err != nil {
1857 return nil, gensupport.WrapError(err)
1858 }
1859 ret := &ListLocationsResponse{
1860 ServerResponse: googleapi.ServerResponse{
1861 Header: res.Header,
1862 HTTPStatusCode: res.StatusCode,
1863 },
1864 }
1865 target := &ret
1866 if err := gensupport.DecodeResponse(target, res); err != nil {
1867 return nil, err
1868 }
1869 return ret, nil
1870 }
1871
1872
1873
1874
1875 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
1876 c.ctx_ = ctx
1877 defer c.PageToken(c.urlParams_.Get("pageToken"))
1878 for {
1879 x, err := c.Do()
1880 if err != nil {
1881 return err
1882 }
1883 if err := f(x); err != nil {
1884 return err
1885 }
1886 if x.NextPageToken == "" {
1887 return nil
1888 }
1889 c.PageToken(x.NextPageToken)
1890 }
1891 }
1892
1893 type ProjectsLocationsApisCreateCall struct {
1894 s *Service
1895 parent string
1896 api *Api
1897 urlParams_ gensupport.URLParams
1898 ctx_ context.Context
1899 header_ http.Header
1900 }
1901
1902
1903
1904
1905
1906 func (r *ProjectsLocationsApisService) Create(parent string, api *Api) *ProjectsLocationsApisCreateCall {
1907 c := &ProjectsLocationsApisCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1908 c.parent = parent
1909 c.api = api
1910 return c
1911 }
1912
1913
1914
1915
1916
1917 func (c *ProjectsLocationsApisCreateCall) ApiId(apiId string) *ProjectsLocationsApisCreateCall {
1918 c.urlParams_.Set("apiId", apiId)
1919 return c
1920 }
1921
1922
1923
1924
1925 func (c *ProjectsLocationsApisCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisCreateCall {
1926 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1927 return c
1928 }
1929
1930
1931 func (c *ProjectsLocationsApisCreateCall) Context(ctx context.Context) *ProjectsLocationsApisCreateCall {
1932 c.ctx_ = ctx
1933 return c
1934 }
1935
1936
1937
1938 func (c *ProjectsLocationsApisCreateCall) Header() http.Header {
1939 if c.header_ == nil {
1940 c.header_ = make(http.Header)
1941 }
1942 return c.header_
1943 }
1944
1945 func (c *ProjectsLocationsApisCreateCall) doRequest(alt string) (*http.Response, error) {
1946 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1947 var body io.Reader = nil
1948 body, err := googleapi.WithoutDataWrapper.JSONReader(c.api)
1949 if err != nil {
1950 return nil, err
1951 }
1952 c.urlParams_.Set("alt", alt)
1953 c.urlParams_.Set("prettyPrint", "false")
1954 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apis")
1955 urls += "?" + c.urlParams_.Encode()
1956 req, err := http.NewRequest("POST", urls, body)
1957 if err != nil {
1958 return nil, err
1959 }
1960 req.Header = reqHeaders
1961 googleapi.Expand(req.URL, map[string]string{
1962 "parent": c.parent,
1963 })
1964 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1965 }
1966
1967
1968
1969
1970
1971
1972 func (c *ProjectsLocationsApisCreateCall) Do(opts ...googleapi.CallOption) (*Api, error) {
1973 gensupport.SetOptions(c.urlParams_, opts...)
1974 res, err := c.doRequest("json")
1975 if res != nil && res.StatusCode == http.StatusNotModified {
1976 if res.Body != nil {
1977 res.Body.Close()
1978 }
1979 return nil, gensupport.WrapError(&googleapi.Error{
1980 Code: res.StatusCode,
1981 Header: res.Header,
1982 })
1983 }
1984 if err != nil {
1985 return nil, err
1986 }
1987 defer googleapi.CloseBody(res)
1988 if err := googleapi.CheckResponse(res); err != nil {
1989 return nil, gensupport.WrapError(err)
1990 }
1991 ret := &Api{
1992 ServerResponse: googleapi.ServerResponse{
1993 Header: res.Header,
1994 HTTPStatusCode: res.StatusCode,
1995 },
1996 }
1997 target := &ret
1998 if err := gensupport.DecodeResponse(target, res); err != nil {
1999 return nil, err
2000 }
2001 return ret, nil
2002 }
2003
2004 type ProjectsLocationsApisDeleteCall struct {
2005 s *Service
2006 name string
2007 urlParams_ gensupport.URLParams
2008 ctx_ context.Context
2009 header_ http.Header
2010 }
2011
2012
2013
2014
2015
2016 func (r *ProjectsLocationsApisService) Delete(name string) *ProjectsLocationsApisDeleteCall {
2017 c := &ProjectsLocationsApisDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2018 c.name = name
2019 return c
2020 }
2021
2022
2023
2024
2025 func (c *ProjectsLocationsApisDeleteCall) Force(force bool) *ProjectsLocationsApisDeleteCall {
2026 c.urlParams_.Set("force", fmt.Sprint(force))
2027 return c
2028 }
2029
2030
2031
2032
2033 func (c *ProjectsLocationsApisDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeleteCall {
2034 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2035 return c
2036 }
2037
2038
2039 func (c *ProjectsLocationsApisDeleteCall) Context(ctx context.Context) *ProjectsLocationsApisDeleteCall {
2040 c.ctx_ = ctx
2041 return c
2042 }
2043
2044
2045
2046 func (c *ProjectsLocationsApisDeleteCall) Header() http.Header {
2047 if c.header_ == nil {
2048 c.header_ = make(http.Header)
2049 }
2050 return c.header_
2051 }
2052
2053 func (c *ProjectsLocationsApisDeleteCall) doRequest(alt string) (*http.Response, error) {
2054 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2055 var body io.Reader = nil
2056 c.urlParams_.Set("alt", alt)
2057 c.urlParams_.Set("prettyPrint", "false")
2058 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2059 urls += "?" + c.urlParams_.Encode()
2060 req, err := http.NewRequest("DELETE", urls, body)
2061 if err != nil {
2062 return nil, err
2063 }
2064 req.Header = reqHeaders
2065 googleapi.Expand(req.URL, map[string]string{
2066 "name": c.name,
2067 })
2068 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2069 }
2070
2071
2072
2073
2074
2075
2076 func (c *ProjectsLocationsApisDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2077 gensupport.SetOptions(c.urlParams_, opts...)
2078 res, err := c.doRequest("json")
2079 if res != nil && res.StatusCode == http.StatusNotModified {
2080 if res.Body != nil {
2081 res.Body.Close()
2082 }
2083 return nil, gensupport.WrapError(&googleapi.Error{
2084 Code: res.StatusCode,
2085 Header: res.Header,
2086 })
2087 }
2088 if err != nil {
2089 return nil, err
2090 }
2091 defer googleapi.CloseBody(res)
2092 if err := googleapi.CheckResponse(res); err != nil {
2093 return nil, gensupport.WrapError(err)
2094 }
2095 ret := &Empty{
2096 ServerResponse: googleapi.ServerResponse{
2097 Header: res.Header,
2098 HTTPStatusCode: res.StatusCode,
2099 },
2100 }
2101 target := &ret
2102 if err := gensupport.DecodeResponse(target, res); err != nil {
2103 return nil, err
2104 }
2105 return ret, nil
2106 }
2107
2108 type ProjectsLocationsApisGetCall struct {
2109 s *Service
2110 name string
2111 urlParams_ gensupport.URLParams
2112 ifNoneMatch_ string
2113 ctx_ context.Context
2114 header_ http.Header
2115 }
2116
2117
2118
2119
2120
2121 func (r *ProjectsLocationsApisService) Get(name string) *ProjectsLocationsApisGetCall {
2122 c := &ProjectsLocationsApisGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2123 c.name = name
2124 return c
2125 }
2126
2127
2128
2129
2130 func (c *ProjectsLocationsApisGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisGetCall {
2131 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2132 return c
2133 }
2134
2135
2136
2137
2138 func (c *ProjectsLocationsApisGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisGetCall {
2139 c.ifNoneMatch_ = entityTag
2140 return c
2141 }
2142
2143
2144 func (c *ProjectsLocationsApisGetCall) Context(ctx context.Context) *ProjectsLocationsApisGetCall {
2145 c.ctx_ = ctx
2146 return c
2147 }
2148
2149
2150
2151 func (c *ProjectsLocationsApisGetCall) Header() http.Header {
2152 if c.header_ == nil {
2153 c.header_ = make(http.Header)
2154 }
2155 return c.header_
2156 }
2157
2158 func (c *ProjectsLocationsApisGetCall) doRequest(alt string) (*http.Response, error) {
2159 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2160 if c.ifNoneMatch_ != "" {
2161 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2162 }
2163 var body io.Reader = nil
2164 c.urlParams_.Set("alt", alt)
2165 c.urlParams_.Set("prettyPrint", "false")
2166 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2167 urls += "?" + c.urlParams_.Encode()
2168 req, err := http.NewRequest("GET", urls, body)
2169 if err != nil {
2170 return nil, err
2171 }
2172 req.Header = reqHeaders
2173 googleapi.Expand(req.URL, map[string]string{
2174 "name": c.name,
2175 })
2176 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2177 }
2178
2179
2180
2181
2182
2183
2184 func (c *ProjectsLocationsApisGetCall) Do(opts ...googleapi.CallOption) (*Api, error) {
2185 gensupport.SetOptions(c.urlParams_, opts...)
2186 res, err := c.doRequest("json")
2187 if res != nil && res.StatusCode == http.StatusNotModified {
2188 if res.Body != nil {
2189 res.Body.Close()
2190 }
2191 return nil, gensupport.WrapError(&googleapi.Error{
2192 Code: res.StatusCode,
2193 Header: res.Header,
2194 })
2195 }
2196 if err != nil {
2197 return nil, err
2198 }
2199 defer googleapi.CloseBody(res)
2200 if err := googleapi.CheckResponse(res); err != nil {
2201 return nil, gensupport.WrapError(err)
2202 }
2203 ret := &Api{
2204 ServerResponse: googleapi.ServerResponse{
2205 Header: res.Header,
2206 HTTPStatusCode: res.StatusCode,
2207 },
2208 }
2209 target := &ret
2210 if err := gensupport.DecodeResponse(target, res); err != nil {
2211 return nil, err
2212 }
2213 return ret, nil
2214 }
2215
2216 type ProjectsLocationsApisGetIamPolicyCall struct {
2217 s *Service
2218 resource string
2219 urlParams_ gensupport.URLParams
2220 ifNoneMatch_ string
2221 ctx_ context.Context
2222 header_ http.Header
2223 }
2224
2225
2226
2227
2228
2229
2230
2231 func (r *ProjectsLocationsApisService) GetIamPolicy(resource string) *ProjectsLocationsApisGetIamPolicyCall {
2232 c := &ProjectsLocationsApisGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2233 c.resource = resource
2234 return c
2235 }
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249 func (c *ProjectsLocationsApisGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsApisGetIamPolicyCall {
2250 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
2251 return c
2252 }
2253
2254
2255
2256
2257 func (c *ProjectsLocationsApisGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisGetIamPolicyCall {
2258 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2259 return c
2260 }
2261
2262
2263
2264
2265 func (c *ProjectsLocationsApisGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisGetIamPolicyCall {
2266 c.ifNoneMatch_ = entityTag
2267 return c
2268 }
2269
2270
2271 func (c *ProjectsLocationsApisGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisGetIamPolicyCall {
2272 c.ctx_ = ctx
2273 return c
2274 }
2275
2276
2277
2278 func (c *ProjectsLocationsApisGetIamPolicyCall) Header() http.Header {
2279 if c.header_ == nil {
2280 c.header_ = make(http.Header)
2281 }
2282 return c.header_
2283 }
2284
2285 func (c *ProjectsLocationsApisGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2286 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2287 if c.ifNoneMatch_ != "" {
2288 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2289 }
2290 var body io.Reader = nil
2291 c.urlParams_.Set("alt", alt)
2292 c.urlParams_.Set("prettyPrint", "false")
2293 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
2294 urls += "?" + c.urlParams_.Encode()
2295 req, err := http.NewRequest("GET", urls, body)
2296 if err != nil {
2297 return nil, err
2298 }
2299 req.Header = reqHeaders
2300 googleapi.Expand(req.URL, map[string]string{
2301 "resource": c.resource,
2302 })
2303 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2304 }
2305
2306
2307
2308
2309
2310
2311 func (c *ProjectsLocationsApisGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2312 gensupport.SetOptions(c.urlParams_, opts...)
2313 res, err := c.doRequest("json")
2314 if res != nil && res.StatusCode == http.StatusNotModified {
2315 if res.Body != nil {
2316 res.Body.Close()
2317 }
2318 return nil, gensupport.WrapError(&googleapi.Error{
2319 Code: res.StatusCode,
2320 Header: res.Header,
2321 })
2322 }
2323 if err != nil {
2324 return nil, err
2325 }
2326 defer googleapi.CloseBody(res)
2327 if err := googleapi.CheckResponse(res); err != nil {
2328 return nil, gensupport.WrapError(err)
2329 }
2330 ret := &Policy{
2331 ServerResponse: googleapi.ServerResponse{
2332 Header: res.Header,
2333 HTTPStatusCode: res.StatusCode,
2334 },
2335 }
2336 target := &ret
2337 if err := gensupport.DecodeResponse(target, res); err != nil {
2338 return nil, err
2339 }
2340 return ret, nil
2341 }
2342
2343 type ProjectsLocationsApisListCall struct {
2344 s *Service
2345 parent string
2346 urlParams_ gensupport.URLParams
2347 ifNoneMatch_ string
2348 ctx_ context.Context
2349 header_ http.Header
2350 }
2351
2352
2353
2354
2355
2356 func (r *ProjectsLocationsApisService) List(parent string) *ProjectsLocationsApisListCall {
2357 c := &ProjectsLocationsApisListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2358 c.parent = parent
2359 return c
2360 }
2361
2362
2363
2364
2365 func (c *ProjectsLocationsApisListCall) Filter(filter string) *ProjectsLocationsApisListCall {
2366 c.urlParams_.Set("filter", filter)
2367 return c
2368 }
2369
2370
2371
2372
2373 func (c *ProjectsLocationsApisListCall) OrderBy(orderBy string) *ProjectsLocationsApisListCall {
2374 c.urlParams_.Set("orderBy", orderBy)
2375 return c
2376 }
2377
2378
2379
2380
2381
2382 func (c *ProjectsLocationsApisListCall) PageSize(pageSize int64) *ProjectsLocationsApisListCall {
2383 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2384 return c
2385 }
2386
2387
2388
2389
2390
2391 func (c *ProjectsLocationsApisListCall) PageToken(pageToken string) *ProjectsLocationsApisListCall {
2392 c.urlParams_.Set("pageToken", pageToken)
2393 return c
2394 }
2395
2396
2397
2398
2399 func (c *ProjectsLocationsApisListCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisListCall {
2400 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2401 return c
2402 }
2403
2404
2405
2406
2407 func (c *ProjectsLocationsApisListCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisListCall {
2408 c.ifNoneMatch_ = entityTag
2409 return c
2410 }
2411
2412
2413 func (c *ProjectsLocationsApisListCall) Context(ctx context.Context) *ProjectsLocationsApisListCall {
2414 c.ctx_ = ctx
2415 return c
2416 }
2417
2418
2419
2420 func (c *ProjectsLocationsApisListCall) Header() http.Header {
2421 if c.header_ == nil {
2422 c.header_ = make(http.Header)
2423 }
2424 return c.header_
2425 }
2426
2427 func (c *ProjectsLocationsApisListCall) doRequest(alt string) (*http.Response, error) {
2428 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2429 if c.ifNoneMatch_ != "" {
2430 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2431 }
2432 var body io.Reader = nil
2433 c.urlParams_.Set("alt", alt)
2434 c.urlParams_.Set("prettyPrint", "false")
2435 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apis")
2436 urls += "?" + c.urlParams_.Encode()
2437 req, err := http.NewRequest("GET", urls, body)
2438 if err != nil {
2439 return nil, err
2440 }
2441 req.Header = reqHeaders
2442 googleapi.Expand(req.URL, map[string]string{
2443 "parent": c.parent,
2444 })
2445 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2446 }
2447
2448
2449
2450
2451
2452
2453
2454 func (c *ProjectsLocationsApisListCall) Do(opts ...googleapi.CallOption) (*ListApisResponse, error) {
2455 gensupport.SetOptions(c.urlParams_, opts...)
2456 res, err := c.doRequest("json")
2457 if res != nil && res.StatusCode == http.StatusNotModified {
2458 if res.Body != nil {
2459 res.Body.Close()
2460 }
2461 return nil, gensupport.WrapError(&googleapi.Error{
2462 Code: res.StatusCode,
2463 Header: res.Header,
2464 })
2465 }
2466 if err != nil {
2467 return nil, err
2468 }
2469 defer googleapi.CloseBody(res)
2470 if err := googleapi.CheckResponse(res); err != nil {
2471 return nil, gensupport.WrapError(err)
2472 }
2473 ret := &ListApisResponse{
2474 ServerResponse: googleapi.ServerResponse{
2475 Header: res.Header,
2476 HTTPStatusCode: res.StatusCode,
2477 },
2478 }
2479 target := &ret
2480 if err := gensupport.DecodeResponse(target, res); err != nil {
2481 return nil, err
2482 }
2483 return ret, nil
2484 }
2485
2486
2487
2488
2489 func (c *ProjectsLocationsApisListCall) Pages(ctx context.Context, f func(*ListApisResponse) error) error {
2490 c.ctx_ = ctx
2491 defer c.PageToken(c.urlParams_.Get("pageToken"))
2492 for {
2493 x, err := c.Do()
2494 if err != nil {
2495 return err
2496 }
2497 if err := f(x); err != nil {
2498 return err
2499 }
2500 if x.NextPageToken == "" {
2501 return nil
2502 }
2503 c.PageToken(x.NextPageToken)
2504 }
2505 }
2506
2507 type ProjectsLocationsApisPatchCall struct {
2508 s *Service
2509 name string
2510 api *Api
2511 urlParams_ gensupport.URLParams
2512 ctx_ context.Context
2513 header_ http.Header
2514 }
2515
2516
2517
2518
2519 func (r *ProjectsLocationsApisService) Patch(name string, api *Api) *ProjectsLocationsApisPatchCall {
2520 c := &ProjectsLocationsApisPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2521 c.name = name
2522 c.api = api
2523 return c
2524 }
2525
2526
2527
2528
2529 func (c *ProjectsLocationsApisPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsApisPatchCall {
2530 c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing))
2531 return c
2532 }
2533
2534
2535
2536
2537
2538
2539 func (c *ProjectsLocationsApisPatchCall) UpdateMask(updateMask string) *ProjectsLocationsApisPatchCall {
2540 c.urlParams_.Set("updateMask", updateMask)
2541 return c
2542 }
2543
2544
2545
2546
2547 func (c *ProjectsLocationsApisPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisPatchCall {
2548 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2549 return c
2550 }
2551
2552
2553 func (c *ProjectsLocationsApisPatchCall) Context(ctx context.Context) *ProjectsLocationsApisPatchCall {
2554 c.ctx_ = ctx
2555 return c
2556 }
2557
2558
2559
2560 func (c *ProjectsLocationsApisPatchCall) Header() http.Header {
2561 if c.header_ == nil {
2562 c.header_ = make(http.Header)
2563 }
2564 return c.header_
2565 }
2566
2567 func (c *ProjectsLocationsApisPatchCall) doRequest(alt string) (*http.Response, error) {
2568 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2569 var body io.Reader = nil
2570 body, err := googleapi.WithoutDataWrapper.JSONReader(c.api)
2571 if err != nil {
2572 return nil, err
2573 }
2574 c.urlParams_.Set("alt", alt)
2575 c.urlParams_.Set("prettyPrint", "false")
2576 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2577 urls += "?" + c.urlParams_.Encode()
2578 req, err := http.NewRequest("PATCH", urls, body)
2579 if err != nil {
2580 return nil, err
2581 }
2582 req.Header = reqHeaders
2583 googleapi.Expand(req.URL, map[string]string{
2584 "name": c.name,
2585 })
2586 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2587 }
2588
2589
2590
2591
2592
2593
2594 func (c *ProjectsLocationsApisPatchCall) Do(opts ...googleapi.CallOption) (*Api, error) {
2595 gensupport.SetOptions(c.urlParams_, opts...)
2596 res, err := c.doRequest("json")
2597 if res != nil && res.StatusCode == http.StatusNotModified {
2598 if res.Body != nil {
2599 res.Body.Close()
2600 }
2601 return nil, gensupport.WrapError(&googleapi.Error{
2602 Code: res.StatusCode,
2603 Header: res.Header,
2604 })
2605 }
2606 if err != nil {
2607 return nil, err
2608 }
2609 defer googleapi.CloseBody(res)
2610 if err := googleapi.CheckResponse(res); err != nil {
2611 return nil, gensupport.WrapError(err)
2612 }
2613 ret := &Api{
2614 ServerResponse: googleapi.ServerResponse{
2615 Header: res.Header,
2616 HTTPStatusCode: res.StatusCode,
2617 },
2618 }
2619 target := &ret
2620 if err := gensupport.DecodeResponse(target, res); err != nil {
2621 return nil, err
2622 }
2623 return ret, nil
2624 }
2625
2626 type ProjectsLocationsApisSetIamPolicyCall struct {
2627 s *Service
2628 resource string
2629 setiampolicyrequest *SetIamPolicyRequest
2630 urlParams_ gensupport.URLParams
2631 ctx_ context.Context
2632 header_ http.Header
2633 }
2634
2635
2636
2637
2638
2639
2640
2641
2642 func (r *ProjectsLocationsApisService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsApisSetIamPolicyCall {
2643 c := &ProjectsLocationsApisSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2644 c.resource = resource
2645 c.setiampolicyrequest = setiampolicyrequest
2646 return c
2647 }
2648
2649
2650
2651
2652 func (c *ProjectsLocationsApisSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisSetIamPolicyCall {
2653 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2654 return c
2655 }
2656
2657
2658 func (c *ProjectsLocationsApisSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisSetIamPolicyCall {
2659 c.ctx_ = ctx
2660 return c
2661 }
2662
2663
2664
2665 func (c *ProjectsLocationsApisSetIamPolicyCall) Header() http.Header {
2666 if c.header_ == nil {
2667 c.header_ = make(http.Header)
2668 }
2669 return c.header_
2670 }
2671
2672 func (c *ProjectsLocationsApisSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2673 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2674 var body io.Reader = nil
2675 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
2676 if err != nil {
2677 return nil, err
2678 }
2679 c.urlParams_.Set("alt", alt)
2680 c.urlParams_.Set("prettyPrint", "false")
2681 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
2682 urls += "?" + c.urlParams_.Encode()
2683 req, err := http.NewRequest("POST", urls, body)
2684 if err != nil {
2685 return nil, err
2686 }
2687 req.Header = reqHeaders
2688 googleapi.Expand(req.URL, map[string]string{
2689 "resource": c.resource,
2690 })
2691 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2692 }
2693
2694
2695
2696
2697
2698
2699 func (c *ProjectsLocationsApisSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2700 gensupport.SetOptions(c.urlParams_, opts...)
2701 res, err := c.doRequest("json")
2702 if res != nil && res.StatusCode == http.StatusNotModified {
2703 if res.Body != nil {
2704 res.Body.Close()
2705 }
2706 return nil, gensupport.WrapError(&googleapi.Error{
2707 Code: res.StatusCode,
2708 Header: res.Header,
2709 })
2710 }
2711 if err != nil {
2712 return nil, err
2713 }
2714 defer googleapi.CloseBody(res)
2715 if err := googleapi.CheckResponse(res); err != nil {
2716 return nil, gensupport.WrapError(err)
2717 }
2718 ret := &Policy{
2719 ServerResponse: googleapi.ServerResponse{
2720 Header: res.Header,
2721 HTTPStatusCode: res.StatusCode,
2722 },
2723 }
2724 target := &ret
2725 if err := gensupport.DecodeResponse(target, res); err != nil {
2726 return nil, err
2727 }
2728 return ret, nil
2729 }
2730
2731 type ProjectsLocationsApisTestIamPermissionsCall struct {
2732 s *Service
2733 resource string
2734 testiampermissionsrequest *TestIamPermissionsRequest
2735 urlParams_ gensupport.URLParams
2736 ctx_ context.Context
2737 header_ http.Header
2738 }
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750 func (r *ProjectsLocationsApisService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsApisTestIamPermissionsCall {
2751 c := &ProjectsLocationsApisTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2752 c.resource = resource
2753 c.testiampermissionsrequest = testiampermissionsrequest
2754 return c
2755 }
2756
2757
2758
2759
2760 func (c *ProjectsLocationsApisTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisTestIamPermissionsCall {
2761 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2762 return c
2763 }
2764
2765
2766 func (c *ProjectsLocationsApisTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsApisTestIamPermissionsCall {
2767 c.ctx_ = ctx
2768 return c
2769 }
2770
2771
2772
2773 func (c *ProjectsLocationsApisTestIamPermissionsCall) Header() http.Header {
2774 if c.header_ == nil {
2775 c.header_ = make(http.Header)
2776 }
2777 return c.header_
2778 }
2779
2780 func (c *ProjectsLocationsApisTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
2781 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2782 var body io.Reader = nil
2783 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
2784 if err != nil {
2785 return nil, err
2786 }
2787 c.urlParams_.Set("alt", alt)
2788 c.urlParams_.Set("prettyPrint", "false")
2789 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
2790 urls += "?" + c.urlParams_.Encode()
2791 req, err := http.NewRequest("POST", urls, body)
2792 if err != nil {
2793 return nil, err
2794 }
2795 req.Header = reqHeaders
2796 googleapi.Expand(req.URL, map[string]string{
2797 "resource": c.resource,
2798 })
2799 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2800 }
2801
2802
2803
2804
2805
2806
2807
2808 func (c *ProjectsLocationsApisTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
2809 gensupport.SetOptions(c.urlParams_, opts...)
2810 res, err := c.doRequest("json")
2811 if res != nil && res.StatusCode == http.StatusNotModified {
2812 if res.Body != nil {
2813 res.Body.Close()
2814 }
2815 return nil, gensupport.WrapError(&googleapi.Error{
2816 Code: res.StatusCode,
2817 Header: res.Header,
2818 })
2819 }
2820 if err != nil {
2821 return nil, err
2822 }
2823 defer googleapi.CloseBody(res)
2824 if err := googleapi.CheckResponse(res); err != nil {
2825 return nil, gensupport.WrapError(err)
2826 }
2827 ret := &TestIamPermissionsResponse{
2828 ServerResponse: googleapi.ServerResponse{
2829 Header: res.Header,
2830 HTTPStatusCode: res.StatusCode,
2831 },
2832 }
2833 target := &ret
2834 if err := gensupport.DecodeResponse(target, res); err != nil {
2835 return nil, err
2836 }
2837 return ret, nil
2838 }
2839
2840 type ProjectsLocationsApisArtifactsCreateCall struct {
2841 s *Service
2842 parent string
2843 artifact *Artifact
2844 urlParams_ gensupport.URLParams
2845 ctx_ context.Context
2846 header_ http.Header
2847 }
2848
2849
2850
2851
2852
2853 func (r *ProjectsLocationsApisArtifactsService) Create(parent string, artifact *Artifact) *ProjectsLocationsApisArtifactsCreateCall {
2854 c := &ProjectsLocationsApisArtifactsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2855 c.parent = parent
2856 c.artifact = artifact
2857 return c
2858 }
2859
2860
2861
2862
2863
2864 func (c *ProjectsLocationsApisArtifactsCreateCall) ArtifactId(artifactId string) *ProjectsLocationsApisArtifactsCreateCall {
2865 c.urlParams_.Set("artifactId", artifactId)
2866 return c
2867 }
2868
2869
2870
2871
2872 func (c *ProjectsLocationsApisArtifactsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisArtifactsCreateCall {
2873 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2874 return c
2875 }
2876
2877
2878 func (c *ProjectsLocationsApisArtifactsCreateCall) Context(ctx context.Context) *ProjectsLocationsApisArtifactsCreateCall {
2879 c.ctx_ = ctx
2880 return c
2881 }
2882
2883
2884
2885 func (c *ProjectsLocationsApisArtifactsCreateCall) Header() http.Header {
2886 if c.header_ == nil {
2887 c.header_ = make(http.Header)
2888 }
2889 return c.header_
2890 }
2891
2892 func (c *ProjectsLocationsApisArtifactsCreateCall) doRequest(alt string) (*http.Response, error) {
2893 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2894 var body io.Reader = nil
2895 body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact)
2896 if err != nil {
2897 return nil, err
2898 }
2899 c.urlParams_.Set("alt", alt)
2900 c.urlParams_.Set("prettyPrint", "false")
2901 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
2902 urls += "?" + c.urlParams_.Encode()
2903 req, err := http.NewRequest("POST", urls, body)
2904 if err != nil {
2905 return nil, err
2906 }
2907 req.Header = reqHeaders
2908 googleapi.Expand(req.URL, map[string]string{
2909 "parent": c.parent,
2910 })
2911 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2912 }
2913
2914
2915
2916
2917
2918
2919 func (c *ProjectsLocationsApisArtifactsCreateCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
2920 gensupport.SetOptions(c.urlParams_, opts...)
2921 res, err := c.doRequest("json")
2922 if res != nil && res.StatusCode == http.StatusNotModified {
2923 if res.Body != nil {
2924 res.Body.Close()
2925 }
2926 return nil, gensupport.WrapError(&googleapi.Error{
2927 Code: res.StatusCode,
2928 Header: res.Header,
2929 })
2930 }
2931 if err != nil {
2932 return nil, err
2933 }
2934 defer googleapi.CloseBody(res)
2935 if err := googleapi.CheckResponse(res); err != nil {
2936 return nil, gensupport.WrapError(err)
2937 }
2938 ret := &Artifact{
2939 ServerResponse: googleapi.ServerResponse{
2940 Header: res.Header,
2941 HTTPStatusCode: res.StatusCode,
2942 },
2943 }
2944 target := &ret
2945 if err := gensupport.DecodeResponse(target, res); err != nil {
2946 return nil, err
2947 }
2948 return ret, nil
2949 }
2950
2951 type ProjectsLocationsApisArtifactsDeleteCall struct {
2952 s *Service
2953 name string
2954 urlParams_ gensupport.URLParams
2955 ctx_ context.Context
2956 header_ http.Header
2957 }
2958
2959
2960
2961
2962 func (r *ProjectsLocationsApisArtifactsService) Delete(name string) *ProjectsLocationsApisArtifactsDeleteCall {
2963 c := &ProjectsLocationsApisArtifactsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2964 c.name = name
2965 return c
2966 }
2967
2968
2969
2970
2971 func (c *ProjectsLocationsApisArtifactsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisArtifactsDeleteCall {
2972 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2973 return c
2974 }
2975
2976
2977 func (c *ProjectsLocationsApisArtifactsDeleteCall) Context(ctx context.Context) *ProjectsLocationsApisArtifactsDeleteCall {
2978 c.ctx_ = ctx
2979 return c
2980 }
2981
2982
2983
2984 func (c *ProjectsLocationsApisArtifactsDeleteCall) Header() http.Header {
2985 if c.header_ == nil {
2986 c.header_ = make(http.Header)
2987 }
2988 return c.header_
2989 }
2990
2991 func (c *ProjectsLocationsApisArtifactsDeleteCall) doRequest(alt string) (*http.Response, error) {
2992 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2993 var body io.Reader = nil
2994 c.urlParams_.Set("alt", alt)
2995 c.urlParams_.Set("prettyPrint", "false")
2996 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2997 urls += "?" + c.urlParams_.Encode()
2998 req, err := http.NewRequest("DELETE", urls, body)
2999 if err != nil {
3000 return nil, err
3001 }
3002 req.Header = reqHeaders
3003 googleapi.Expand(req.URL, map[string]string{
3004 "name": c.name,
3005 })
3006 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3007 }
3008
3009
3010
3011
3012
3013
3014 func (c *ProjectsLocationsApisArtifactsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3015 gensupport.SetOptions(c.urlParams_, opts...)
3016 res, err := c.doRequest("json")
3017 if res != nil && res.StatusCode == http.StatusNotModified {
3018 if res.Body != nil {
3019 res.Body.Close()
3020 }
3021 return nil, gensupport.WrapError(&googleapi.Error{
3022 Code: res.StatusCode,
3023 Header: res.Header,
3024 })
3025 }
3026 if err != nil {
3027 return nil, err
3028 }
3029 defer googleapi.CloseBody(res)
3030 if err := googleapi.CheckResponse(res); err != nil {
3031 return nil, gensupport.WrapError(err)
3032 }
3033 ret := &Empty{
3034 ServerResponse: googleapi.ServerResponse{
3035 Header: res.Header,
3036 HTTPStatusCode: res.StatusCode,
3037 },
3038 }
3039 target := &ret
3040 if err := gensupport.DecodeResponse(target, res); err != nil {
3041 return nil, err
3042 }
3043 return ret, nil
3044 }
3045
3046 type ProjectsLocationsApisArtifactsGetCall struct {
3047 s *Service
3048 name string
3049 urlParams_ gensupport.URLParams
3050 ifNoneMatch_ string
3051 ctx_ context.Context
3052 header_ http.Header
3053 }
3054
3055
3056
3057
3058 func (r *ProjectsLocationsApisArtifactsService) Get(name string) *ProjectsLocationsApisArtifactsGetCall {
3059 c := &ProjectsLocationsApisArtifactsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3060 c.name = name
3061 return c
3062 }
3063
3064
3065
3066
3067 func (c *ProjectsLocationsApisArtifactsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisArtifactsGetCall {
3068 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3069 return c
3070 }
3071
3072
3073
3074
3075 func (c *ProjectsLocationsApisArtifactsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisArtifactsGetCall {
3076 c.ifNoneMatch_ = entityTag
3077 return c
3078 }
3079
3080
3081 func (c *ProjectsLocationsApisArtifactsGetCall) Context(ctx context.Context) *ProjectsLocationsApisArtifactsGetCall {
3082 c.ctx_ = ctx
3083 return c
3084 }
3085
3086
3087
3088 func (c *ProjectsLocationsApisArtifactsGetCall) Header() http.Header {
3089 if c.header_ == nil {
3090 c.header_ = make(http.Header)
3091 }
3092 return c.header_
3093 }
3094
3095 func (c *ProjectsLocationsApisArtifactsGetCall) doRequest(alt string) (*http.Response, error) {
3096 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3097 if c.ifNoneMatch_ != "" {
3098 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3099 }
3100 var body io.Reader = nil
3101 c.urlParams_.Set("alt", alt)
3102 c.urlParams_.Set("prettyPrint", "false")
3103 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3104 urls += "?" + c.urlParams_.Encode()
3105 req, err := http.NewRequest("GET", urls, body)
3106 if err != nil {
3107 return nil, err
3108 }
3109 req.Header = reqHeaders
3110 googleapi.Expand(req.URL, map[string]string{
3111 "name": c.name,
3112 })
3113 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3114 }
3115
3116
3117
3118
3119
3120
3121 func (c *ProjectsLocationsApisArtifactsGetCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
3122 gensupport.SetOptions(c.urlParams_, opts...)
3123 res, err := c.doRequest("json")
3124 if res != nil && res.StatusCode == http.StatusNotModified {
3125 if res.Body != nil {
3126 res.Body.Close()
3127 }
3128 return nil, gensupport.WrapError(&googleapi.Error{
3129 Code: res.StatusCode,
3130 Header: res.Header,
3131 })
3132 }
3133 if err != nil {
3134 return nil, err
3135 }
3136 defer googleapi.CloseBody(res)
3137 if err := googleapi.CheckResponse(res); err != nil {
3138 return nil, gensupport.WrapError(err)
3139 }
3140 ret := &Artifact{
3141 ServerResponse: googleapi.ServerResponse{
3142 Header: res.Header,
3143 HTTPStatusCode: res.StatusCode,
3144 },
3145 }
3146 target := &ret
3147 if err := gensupport.DecodeResponse(target, res); err != nil {
3148 return nil, err
3149 }
3150 return ret, nil
3151 }
3152
3153 type ProjectsLocationsApisArtifactsGetContentsCall struct {
3154 s *Service
3155 name string
3156 urlParams_ gensupport.URLParams
3157 ifNoneMatch_ string
3158 ctx_ context.Context
3159 header_ http.Header
3160 }
3161
3162
3163
3164
3165
3166
3167
3168
3169 func (r *ProjectsLocationsApisArtifactsService) GetContents(name string) *ProjectsLocationsApisArtifactsGetContentsCall {
3170 c := &ProjectsLocationsApisArtifactsGetContentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3171 c.name = name
3172 return c
3173 }
3174
3175
3176
3177
3178 func (c *ProjectsLocationsApisArtifactsGetContentsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisArtifactsGetContentsCall {
3179 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3180 return c
3181 }
3182
3183
3184
3185
3186 func (c *ProjectsLocationsApisArtifactsGetContentsCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisArtifactsGetContentsCall {
3187 c.ifNoneMatch_ = entityTag
3188 return c
3189 }
3190
3191
3192 func (c *ProjectsLocationsApisArtifactsGetContentsCall) Context(ctx context.Context) *ProjectsLocationsApisArtifactsGetContentsCall {
3193 c.ctx_ = ctx
3194 return c
3195 }
3196
3197
3198
3199 func (c *ProjectsLocationsApisArtifactsGetContentsCall) Header() http.Header {
3200 if c.header_ == nil {
3201 c.header_ = make(http.Header)
3202 }
3203 return c.header_
3204 }
3205
3206 func (c *ProjectsLocationsApisArtifactsGetContentsCall) doRequest(alt string) (*http.Response, error) {
3207 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3208 if c.ifNoneMatch_ != "" {
3209 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3210 }
3211 var body io.Reader = nil
3212 c.urlParams_.Set("alt", alt)
3213 c.urlParams_.Set("prettyPrint", "false")
3214 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getContents")
3215 urls += "?" + c.urlParams_.Encode()
3216 req, err := http.NewRequest("GET", urls, body)
3217 if err != nil {
3218 return nil, err
3219 }
3220 req.Header = reqHeaders
3221 googleapi.Expand(req.URL, map[string]string{
3222 "name": c.name,
3223 })
3224 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3225 }
3226
3227
3228
3229
3230
3231
3232 func (c *ProjectsLocationsApisArtifactsGetContentsCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
3233 gensupport.SetOptions(c.urlParams_, opts...)
3234 res, err := c.doRequest("json")
3235 if res != nil && res.StatusCode == http.StatusNotModified {
3236 if res.Body != nil {
3237 res.Body.Close()
3238 }
3239 return nil, gensupport.WrapError(&googleapi.Error{
3240 Code: res.StatusCode,
3241 Header: res.Header,
3242 })
3243 }
3244 if err != nil {
3245 return nil, err
3246 }
3247 defer googleapi.CloseBody(res)
3248 if err := googleapi.CheckResponse(res); err != nil {
3249 return nil, gensupport.WrapError(err)
3250 }
3251 ret := &HttpBody{
3252 ServerResponse: googleapi.ServerResponse{
3253 Header: res.Header,
3254 HTTPStatusCode: res.StatusCode,
3255 },
3256 }
3257 target := &ret
3258 if err := gensupport.DecodeResponse(target, res); err != nil {
3259 return nil, err
3260 }
3261 return ret, nil
3262 }
3263
3264 type ProjectsLocationsApisArtifactsGetIamPolicyCall struct {
3265 s *Service
3266 resource string
3267 urlParams_ gensupport.URLParams
3268 ifNoneMatch_ string
3269 ctx_ context.Context
3270 header_ http.Header
3271 }
3272
3273
3274
3275
3276
3277
3278
3279 func (r *ProjectsLocationsApisArtifactsService) GetIamPolicy(resource string) *ProjectsLocationsApisArtifactsGetIamPolicyCall {
3280 c := &ProjectsLocationsApisArtifactsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3281 c.resource = resource
3282 return c
3283 }
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297 func (c *ProjectsLocationsApisArtifactsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsApisArtifactsGetIamPolicyCall {
3298 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
3299 return c
3300 }
3301
3302
3303
3304
3305 func (c *ProjectsLocationsApisArtifactsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisArtifactsGetIamPolicyCall {
3306 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3307 return c
3308 }
3309
3310
3311
3312
3313 func (c *ProjectsLocationsApisArtifactsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisArtifactsGetIamPolicyCall {
3314 c.ifNoneMatch_ = entityTag
3315 return c
3316 }
3317
3318
3319 func (c *ProjectsLocationsApisArtifactsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisArtifactsGetIamPolicyCall {
3320 c.ctx_ = ctx
3321 return c
3322 }
3323
3324
3325
3326 func (c *ProjectsLocationsApisArtifactsGetIamPolicyCall) Header() http.Header {
3327 if c.header_ == nil {
3328 c.header_ = make(http.Header)
3329 }
3330 return c.header_
3331 }
3332
3333 func (c *ProjectsLocationsApisArtifactsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3334 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3335 if c.ifNoneMatch_ != "" {
3336 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3337 }
3338 var body io.Reader = nil
3339 c.urlParams_.Set("alt", alt)
3340 c.urlParams_.Set("prettyPrint", "false")
3341 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
3342 urls += "?" + c.urlParams_.Encode()
3343 req, err := http.NewRequest("GET", urls, body)
3344 if err != nil {
3345 return nil, err
3346 }
3347 req.Header = reqHeaders
3348 googleapi.Expand(req.URL, map[string]string{
3349 "resource": c.resource,
3350 })
3351 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3352 }
3353
3354
3355
3356
3357
3358
3359 func (c *ProjectsLocationsApisArtifactsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3360 gensupport.SetOptions(c.urlParams_, opts...)
3361 res, err := c.doRequest("json")
3362 if res != nil && res.StatusCode == http.StatusNotModified {
3363 if res.Body != nil {
3364 res.Body.Close()
3365 }
3366 return nil, gensupport.WrapError(&googleapi.Error{
3367 Code: res.StatusCode,
3368 Header: res.Header,
3369 })
3370 }
3371 if err != nil {
3372 return nil, err
3373 }
3374 defer googleapi.CloseBody(res)
3375 if err := googleapi.CheckResponse(res); err != nil {
3376 return nil, gensupport.WrapError(err)
3377 }
3378 ret := &Policy{
3379 ServerResponse: googleapi.ServerResponse{
3380 Header: res.Header,
3381 HTTPStatusCode: res.StatusCode,
3382 },
3383 }
3384 target := &ret
3385 if err := gensupport.DecodeResponse(target, res); err != nil {
3386 return nil, err
3387 }
3388 return ret, nil
3389 }
3390
3391 type ProjectsLocationsApisArtifactsListCall struct {
3392 s *Service
3393 parent string
3394 urlParams_ gensupport.URLParams
3395 ifNoneMatch_ string
3396 ctx_ context.Context
3397 header_ http.Header
3398 }
3399
3400
3401
3402
3403
3404 func (r *ProjectsLocationsApisArtifactsService) List(parent string) *ProjectsLocationsApisArtifactsListCall {
3405 c := &ProjectsLocationsApisArtifactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3406 c.parent = parent
3407 return c
3408 }
3409
3410
3411
3412
3413 func (c *ProjectsLocationsApisArtifactsListCall) Filter(filter string) *ProjectsLocationsApisArtifactsListCall {
3414 c.urlParams_.Set("filter", filter)
3415 return c
3416 }
3417
3418
3419
3420
3421 func (c *ProjectsLocationsApisArtifactsListCall) OrderBy(orderBy string) *ProjectsLocationsApisArtifactsListCall {
3422 c.urlParams_.Set("orderBy", orderBy)
3423 return c
3424 }
3425
3426
3427
3428
3429
3430 func (c *ProjectsLocationsApisArtifactsListCall) PageSize(pageSize int64) *ProjectsLocationsApisArtifactsListCall {
3431 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3432 return c
3433 }
3434
3435
3436
3437
3438
3439 func (c *ProjectsLocationsApisArtifactsListCall) PageToken(pageToken string) *ProjectsLocationsApisArtifactsListCall {
3440 c.urlParams_.Set("pageToken", pageToken)
3441 return c
3442 }
3443
3444
3445
3446
3447 func (c *ProjectsLocationsApisArtifactsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisArtifactsListCall {
3448 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3449 return c
3450 }
3451
3452
3453
3454
3455 func (c *ProjectsLocationsApisArtifactsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisArtifactsListCall {
3456 c.ifNoneMatch_ = entityTag
3457 return c
3458 }
3459
3460
3461 func (c *ProjectsLocationsApisArtifactsListCall) Context(ctx context.Context) *ProjectsLocationsApisArtifactsListCall {
3462 c.ctx_ = ctx
3463 return c
3464 }
3465
3466
3467
3468 func (c *ProjectsLocationsApisArtifactsListCall) Header() http.Header {
3469 if c.header_ == nil {
3470 c.header_ = make(http.Header)
3471 }
3472 return c.header_
3473 }
3474
3475 func (c *ProjectsLocationsApisArtifactsListCall) doRequest(alt string) (*http.Response, error) {
3476 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3477 if c.ifNoneMatch_ != "" {
3478 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3479 }
3480 var body io.Reader = nil
3481 c.urlParams_.Set("alt", alt)
3482 c.urlParams_.Set("prettyPrint", "false")
3483 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
3484 urls += "?" + c.urlParams_.Encode()
3485 req, err := http.NewRequest("GET", urls, body)
3486 if err != nil {
3487 return nil, err
3488 }
3489 req.Header = reqHeaders
3490 googleapi.Expand(req.URL, map[string]string{
3491 "parent": c.parent,
3492 })
3493 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3494 }
3495
3496
3497
3498
3499
3500
3501
3502 func (c *ProjectsLocationsApisArtifactsListCall) Do(opts ...googleapi.CallOption) (*ListArtifactsResponse, error) {
3503 gensupport.SetOptions(c.urlParams_, opts...)
3504 res, err := c.doRequest("json")
3505 if res != nil && res.StatusCode == http.StatusNotModified {
3506 if res.Body != nil {
3507 res.Body.Close()
3508 }
3509 return nil, gensupport.WrapError(&googleapi.Error{
3510 Code: res.StatusCode,
3511 Header: res.Header,
3512 })
3513 }
3514 if err != nil {
3515 return nil, err
3516 }
3517 defer googleapi.CloseBody(res)
3518 if err := googleapi.CheckResponse(res); err != nil {
3519 return nil, gensupport.WrapError(err)
3520 }
3521 ret := &ListArtifactsResponse{
3522 ServerResponse: googleapi.ServerResponse{
3523 Header: res.Header,
3524 HTTPStatusCode: res.StatusCode,
3525 },
3526 }
3527 target := &ret
3528 if err := gensupport.DecodeResponse(target, res); err != nil {
3529 return nil, err
3530 }
3531 return ret, nil
3532 }
3533
3534
3535
3536
3537 func (c *ProjectsLocationsApisArtifactsListCall) Pages(ctx context.Context, f func(*ListArtifactsResponse) error) error {
3538 c.ctx_ = ctx
3539 defer c.PageToken(c.urlParams_.Get("pageToken"))
3540 for {
3541 x, err := c.Do()
3542 if err != nil {
3543 return err
3544 }
3545 if err := f(x); err != nil {
3546 return err
3547 }
3548 if x.NextPageToken == "" {
3549 return nil
3550 }
3551 c.PageToken(x.NextPageToken)
3552 }
3553 }
3554
3555 type ProjectsLocationsApisArtifactsReplaceArtifactCall struct {
3556 s *Service
3557 name string
3558 artifact *Artifact
3559 urlParams_ gensupport.URLParams
3560 ctx_ context.Context
3561 header_ http.Header
3562 }
3563
3564
3565
3566
3567 func (r *ProjectsLocationsApisArtifactsService) ReplaceArtifact(name string, artifact *Artifact) *ProjectsLocationsApisArtifactsReplaceArtifactCall {
3568 c := &ProjectsLocationsApisArtifactsReplaceArtifactCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3569 c.name = name
3570 c.artifact = artifact
3571 return c
3572 }
3573
3574
3575
3576
3577 func (c *ProjectsLocationsApisArtifactsReplaceArtifactCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisArtifactsReplaceArtifactCall {
3578 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3579 return c
3580 }
3581
3582
3583 func (c *ProjectsLocationsApisArtifactsReplaceArtifactCall) Context(ctx context.Context) *ProjectsLocationsApisArtifactsReplaceArtifactCall {
3584 c.ctx_ = ctx
3585 return c
3586 }
3587
3588
3589
3590 func (c *ProjectsLocationsApisArtifactsReplaceArtifactCall) Header() http.Header {
3591 if c.header_ == nil {
3592 c.header_ = make(http.Header)
3593 }
3594 return c.header_
3595 }
3596
3597 func (c *ProjectsLocationsApisArtifactsReplaceArtifactCall) doRequest(alt string) (*http.Response, error) {
3598 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3599 var body io.Reader = nil
3600 body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact)
3601 if err != nil {
3602 return nil, err
3603 }
3604 c.urlParams_.Set("alt", alt)
3605 c.urlParams_.Set("prettyPrint", "false")
3606 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3607 urls += "?" + c.urlParams_.Encode()
3608 req, err := http.NewRequest("PUT", urls, body)
3609 if err != nil {
3610 return nil, err
3611 }
3612 req.Header = reqHeaders
3613 googleapi.Expand(req.URL, map[string]string{
3614 "name": c.name,
3615 })
3616 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3617 }
3618
3619
3620
3621
3622
3623
3624 func (c *ProjectsLocationsApisArtifactsReplaceArtifactCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
3625 gensupport.SetOptions(c.urlParams_, opts...)
3626 res, err := c.doRequest("json")
3627 if res != nil && res.StatusCode == http.StatusNotModified {
3628 if res.Body != nil {
3629 res.Body.Close()
3630 }
3631 return nil, gensupport.WrapError(&googleapi.Error{
3632 Code: res.StatusCode,
3633 Header: res.Header,
3634 })
3635 }
3636 if err != nil {
3637 return nil, err
3638 }
3639 defer googleapi.CloseBody(res)
3640 if err := googleapi.CheckResponse(res); err != nil {
3641 return nil, gensupport.WrapError(err)
3642 }
3643 ret := &Artifact{
3644 ServerResponse: googleapi.ServerResponse{
3645 Header: res.Header,
3646 HTTPStatusCode: res.StatusCode,
3647 },
3648 }
3649 target := &ret
3650 if err := gensupport.DecodeResponse(target, res); err != nil {
3651 return nil, err
3652 }
3653 return ret, nil
3654 }
3655
3656 type ProjectsLocationsApisArtifactsSetIamPolicyCall struct {
3657 s *Service
3658 resource string
3659 setiampolicyrequest *SetIamPolicyRequest
3660 urlParams_ gensupport.URLParams
3661 ctx_ context.Context
3662 header_ http.Header
3663 }
3664
3665
3666
3667
3668
3669
3670
3671
3672 func (r *ProjectsLocationsApisArtifactsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsApisArtifactsSetIamPolicyCall {
3673 c := &ProjectsLocationsApisArtifactsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3674 c.resource = resource
3675 c.setiampolicyrequest = setiampolicyrequest
3676 return c
3677 }
3678
3679
3680
3681
3682 func (c *ProjectsLocationsApisArtifactsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisArtifactsSetIamPolicyCall {
3683 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3684 return c
3685 }
3686
3687
3688 func (c *ProjectsLocationsApisArtifactsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisArtifactsSetIamPolicyCall {
3689 c.ctx_ = ctx
3690 return c
3691 }
3692
3693
3694
3695 func (c *ProjectsLocationsApisArtifactsSetIamPolicyCall) Header() http.Header {
3696 if c.header_ == nil {
3697 c.header_ = make(http.Header)
3698 }
3699 return c.header_
3700 }
3701
3702 func (c *ProjectsLocationsApisArtifactsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3703 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3704 var body io.Reader = nil
3705 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
3706 if err != nil {
3707 return nil, err
3708 }
3709 c.urlParams_.Set("alt", alt)
3710 c.urlParams_.Set("prettyPrint", "false")
3711 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
3712 urls += "?" + c.urlParams_.Encode()
3713 req, err := http.NewRequest("POST", urls, body)
3714 if err != nil {
3715 return nil, err
3716 }
3717 req.Header = reqHeaders
3718 googleapi.Expand(req.URL, map[string]string{
3719 "resource": c.resource,
3720 })
3721 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3722 }
3723
3724
3725
3726
3727
3728
3729 func (c *ProjectsLocationsApisArtifactsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3730 gensupport.SetOptions(c.urlParams_, opts...)
3731 res, err := c.doRequest("json")
3732 if res != nil && res.StatusCode == http.StatusNotModified {
3733 if res.Body != nil {
3734 res.Body.Close()
3735 }
3736 return nil, gensupport.WrapError(&googleapi.Error{
3737 Code: res.StatusCode,
3738 Header: res.Header,
3739 })
3740 }
3741 if err != nil {
3742 return nil, err
3743 }
3744 defer googleapi.CloseBody(res)
3745 if err := googleapi.CheckResponse(res); err != nil {
3746 return nil, gensupport.WrapError(err)
3747 }
3748 ret := &Policy{
3749 ServerResponse: googleapi.ServerResponse{
3750 Header: res.Header,
3751 HTTPStatusCode: res.StatusCode,
3752 },
3753 }
3754 target := &ret
3755 if err := gensupport.DecodeResponse(target, res); err != nil {
3756 return nil, err
3757 }
3758 return ret, nil
3759 }
3760
3761 type ProjectsLocationsApisArtifactsTestIamPermissionsCall struct {
3762 s *Service
3763 resource string
3764 testiampermissionsrequest *TestIamPermissionsRequest
3765 urlParams_ gensupport.URLParams
3766 ctx_ context.Context
3767 header_ http.Header
3768 }
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780 func (r *ProjectsLocationsApisArtifactsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsApisArtifactsTestIamPermissionsCall {
3781 c := &ProjectsLocationsApisArtifactsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3782 c.resource = resource
3783 c.testiampermissionsrequest = testiampermissionsrequest
3784 return c
3785 }
3786
3787
3788
3789
3790 func (c *ProjectsLocationsApisArtifactsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisArtifactsTestIamPermissionsCall {
3791 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3792 return c
3793 }
3794
3795
3796 func (c *ProjectsLocationsApisArtifactsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsApisArtifactsTestIamPermissionsCall {
3797 c.ctx_ = ctx
3798 return c
3799 }
3800
3801
3802
3803 func (c *ProjectsLocationsApisArtifactsTestIamPermissionsCall) Header() http.Header {
3804 if c.header_ == nil {
3805 c.header_ = make(http.Header)
3806 }
3807 return c.header_
3808 }
3809
3810 func (c *ProjectsLocationsApisArtifactsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
3811 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3812 var body io.Reader = nil
3813 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
3814 if err != nil {
3815 return nil, err
3816 }
3817 c.urlParams_.Set("alt", alt)
3818 c.urlParams_.Set("prettyPrint", "false")
3819 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
3820 urls += "?" + c.urlParams_.Encode()
3821 req, err := http.NewRequest("POST", urls, body)
3822 if err != nil {
3823 return nil, err
3824 }
3825 req.Header = reqHeaders
3826 googleapi.Expand(req.URL, map[string]string{
3827 "resource": c.resource,
3828 })
3829 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3830 }
3831
3832
3833
3834
3835
3836
3837
3838 func (c *ProjectsLocationsApisArtifactsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
3839 gensupport.SetOptions(c.urlParams_, opts...)
3840 res, err := c.doRequest("json")
3841 if res != nil && res.StatusCode == http.StatusNotModified {
3842 if res.Body != nil {
3843 res.Body.Close()
3844 }
3845 return nil, gensupport.WrapError(&googleapi.Error{
3846 Code: res.StatusCode,
3847 Header: res.Header,
3848 })
3849 }
3850 if err != nil {
3851 return nil, err
3852 }
3853 defer googleapi.CloseBody(res)
3854 if err := googleapi.CheckResponse(res); err != nil {
3855 return nil, gensupport.WrapError(err)
3856 }
3857 ret := &TestIamPermissionsResponse{
3858 ServerResponse: googleapi.ServerResponse{
3859 Header: res.Header,
3860 HTTPStatusCode: res.StatusCode,
3861 },
3862 }
3863 target := &ret
3864 if err := gensupport.DecodeResponse(target, res); err != nil {
3865 return nil, err
3866 }
3867 return ret, nil
3868 }
3869
3870 type ProjectsLocationsApisDeploymentsCreateCall struct {
3871 s *Service
3872 parent string
3873 apideployment *ApiDeployment
3874 urlParams_ gensupport.URLParams
3875 ctx_ context.Context
3876 header_ http.Header
3877 }
3878
3879
3880
3881
3882
3883 func (r *ProjectsLocationsApisDeploymentsService) Create(parent string, apideployment *ApiDeployment) *ProjectsLocationsApisDeploymentsCreateCall {
3884 c := &ProjectsLocationsApisDeploymentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3885 c.parent = parent
3886 c.apideployment = apideployment
3887 return c
3888 }
3889
3890
3891
3892
3893
3894
3895 func (c *ProjectsLocationsApisDeploymentsCreateCall) ApiDeploymentId(apiDeploymentId string) *ProjectsLocationsApisDeploymentsCreateCall {
3896 c.urlParams_.Set("apiDeploymentId", apiDeploymentId)
3897 return c
3898 }
3899
3900
3901
3902
3903 func (c *ProjectsLocationsApisDeploymentsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsCreateCall {
3904 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3905 return c
3906 }
3907
3908
3909 func (c *ProjectsLocationsApisDeploymentsCreateCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsCreateCall {
3910 c.ctx_ = ctx
3911 return c
3912 }
3913
3914
3915
3916 func (c *ProjectsLocationsApisDeploymentsCreateCall) Header() http.Header {
3917 if c.header_ == nil {
3918 c.header_ = make(http.Header)
3919 }
3920 return c.header_
3921 }
3922
3923 func (c *ProjectsLocationsApisDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) {
3924 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3925 var body io.Reader = nil
3926 body, err := googleapi.WithoutDataWrapper.JSONReader(c.apideployment)
3927 if err != nil {
3928 return nil, err
3929 }
3930 c.urlParams_.Set("alt", alt)
3931 c.urlParams_.Set("prettyPrint", "false")
3932 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deployments")
3933 urls += "?" + c.urlParams_.Encode()
3934 req, err := http.NewRequest("POST", urls, body)
3935 if err != nil {
3936 return nil, err
3937 }
3938 req.Header = reqHeaders
3939 googleapi.Expand(req.URL, map[string]string{
3940 "parent": c.parent,
3941 })
3942 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3943 }
3944
3945
3946
3947
3948
3949
3950 func (c *ProjectsLocationsApisDeploymentsCreateCall) Do(opts ...googleapi.CallOption) (*ApiDeployment, error) {
3951 gensupport.SetOptions(c.urlParams_, opts...)
3952 res, err := c.doRequest("json")
3953 if res != nil && res.StatusCode == http.StatusNotModified {
3954 if res.Body != nil {
3955 res.Body.Close()
3956 }
3957 return nil, gensupport.WrapError(&googleapi.Error{
3958 Code: res.StatusCode,
3959 Header: res.Header,
3960 })
3961 }
3962 if err != nil {
3963 return nil, err
3964 }
3965 defer googleapi.CloseBody(res)
3966 if err := googleapi.CheckResponse(res); err != nil {
3967 return nil, gensupport.WrapError(err)
3968 }
3969 ret := &ApiDeployment{
3970 ServerResponse: googleapi.ServerResponse{
3971 Header: res.Header,
3972 HTTPStatusCode: res.StatusCode,
3973 },
3974 }
3975 target := &ret
3976 if err := gensupport.DecodeResponse(target, res); err != nil {
3977 return nil, err
3978 }
3979 return ret, nil
3980 }
3981
3982 type ProjectsLocationsApisDeploymentsDeleteCall struct {
3983 s *Service
3984 name string
3985 urlParams_ gensupport.URLParams
3986 ctx_ context.Context
3987 header_ http.Header
3988 }
3989
3990
3991
3992
3993
3994
3995 func (r *ProjectsLocationsApisDeploymentsService) Delete(name string) *ProjectsLocationsApisDeploymentsDeleteCall {
3996 c := &ProjectsLocationsApisDeploymentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3997 c.name = name
3998 return c
3999 }
4000
4001
4002
4003
4004 func (c *ProjectsLocationsApisDeploymentsDeleteCall) Force(force bool) *ProjectsLocationsApisDeploymentsDeleteCall {
4005 c.urlParams_.Set("force", fmt.Sprint(force))
4006 return c
4007 }
4008
4009
4010
4011
4012 func (c *ProjectsLocationsApisDeploymentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsDeleteCall {
4013 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4014 return c
4015 }
4016
4017
4018 func (c *ProjectsLocationsApisDeploymentsDeleteCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsDeleteCall {
4019 c.ctx_ = ctx
4020 return c
4021 }
4022
4023
4024
4025 func (c *ProjectsLocationsApisDeploymentsDeleteCall) Header() http.Header {
4026 if c.header_ == nil {
4027 c.header_ = make(http.Header)
4028 }
4029 return c.header_
4030 }
4031
4032 func (c *ProjectsLocationsApisDeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) {
4033 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4034 var body io.Reader = nil
4035 c.urlParams_.Set("alt", alt)
4036 c.urlParams_.Set("prettyPrint", "false")
4037 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4038 urls += "?" + c.urlParams_.Encode()
4039 req, err := http.NewRequest("DELETE", urls, body)
4040 if err != nil {
4041 return nil, err
4042 }
4043 req.Header = reqHeaders
4044 googleapi.Expand(req.URL, map[string]string{
4045 "name": c.name,
4046 })
4047 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4048 }
4049
4050
4051
4052
4053
4054
4055 func (c *ProjectsLocationsApisDeploymentsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
4056 gensupport.SetOptions(c.urlParams_, opts...)
4057 res, err := c.doRequest("json")
4058 if res != nil && res.StatusCode == http.StatusNotModified {
4059 if res.Body != nil {
4060 res.Body.Close()
4061 }
4062 return nil, gensupport.WrapError(&googleapi.Error{
4063 Code: res.StatusCode,
4064 Header: res.Header,
4065 })
4066 }
4067 if err != nil {
4068 return nil, err
4069 }
4070 defer googleapi.CloseBody(res)
4071 if err := googleapi.CheckResponse(res); err != nil {
4072 return nil, gensupport.WrapError(err)
4073 }
4074 ret := &Empty{
4075 ServerResponse: googleapi.ServerResponse{
4076 Header: res.Header,
4077 HTTPStatusCode: res.StatusCode,
4078 },
4079 }
4080 target := &ret
4081 if err := gensupport.DecodeResponse(target, res); err != nil {
4082 return nil, err
4083 }
4084 return ret, nil
4085 }
4086
4087 type ProjectsLocationsApisDeploymentsDeleteRevisionCall struct {
4088 s *Service
4089 name string
4090 urlParams_ gensupport.URLParams
4091 ctx_ context.Context
4092 header_ http.Header
4093 }
4094
4095
4096
4097
4098
4099
4100 func (r *ProjectsLocationsApisDeploymentsService) DeleteRevision(name string) *ProjectsLocationsApisDeploymentsDeleteRevisionCall {
4101 c := &ProjectsLocationsApisDeploymentsDeleteRevisionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4102 c.name = name
4103 return c
4104 }
4105
4106
4107
4108
4109 func (c *ProjectsLocationsApisDeploymentsDeleteRevisionCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsDeleteRevisionCall {
4110 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4111 return c
4112 }
4113
4114
4115 func (c *ProjectsLocationsApisDeploymentsDeleteRevisionCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsDeleteRevisionCall {
4116 c.ctx_ = ctx
4117 return c
4118 }
4119
4120
4121
4122 func (c *ProjectsLocationsApisDeploymentsDeleteRevisionCall) Header() http.Header {
4123 if c.header_ == nil {
4124 c.header_ = make(http.Header)
4125 }
4126 return c.header_
4127 }
4128
4129 func (c *ProjectsLocationsApisDeploymentsDeleteRevisionCall) doRequest(alt string) (*http.Response, error) {
4130 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4131 var body io.Reader = nil
4132 c.urlParams_.Set("alt", alt)
4133 c.urlParams_.Set("prettyPrint", "false")
4134 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:deleteRevision")
4135 urls += "?" + c.urlParams_.Encode()
4136 req, err := http.NewRequest("DELETE", urls, body)
4137 if err != nil {
4138 return nil, err
4139 }
4140 req.Header = reqHeaders
4141 googleapi.Expand(req.URL, map[string]string{
4142 "name": c.name,
4143 })
4144 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4145 }
4146
4147
4148
4149
4150
4151
4152 func (c *ProjectsLocationsApisDeploymentsDeleteRevisionCall) Do(opts ...googleapi.CallOption) (*ApiDeployment, error) {
4153 gensupport.SetOptions(c.urlParams_, opts...)
4154 res, err := c.doRequest("json")
4155 if res != nil && res.StatusCode == http.StatusNotModified {
4156 if res.Body != nil {
4157 res.Body.Close()
4158 }
4159 return nil, gensupport.WrapError(&googleapi.Error{
4160 Code: res.StatusCode,
4161 Header: res.Header,
4162 })
4163 }
4164 if err != nil {
4165 return nil, err
4166 }
4167 defer googleapi.CloseBody(res)
4168 if err := googleapi.CheckResponse(res); err != nil {
4169 return nil, gensupport.WrapError(err)
4170 }
4171 ret := &ApiDeployment{
4172 ServerResponse: googleapi.ServerResponse{
4173 Header: res.Header,
4174 HTTPStatusCode: res.StatusCode,
4175 },
4176 }
4177 target := &ret
4178 if err := gensupport.DecodeResponse(target, res); err != nil {
4179 return nil, err
4180 }
4181 return ret, nil
4182 }
4183
4184 type ProjectsLocationsApisDeploymentsGetCall struct {
4185 s *Service
4186 name string
4187 urlParams_ gensupport.URLParams
4188 ifNoneMatch_ string
4189 ctx_ context.Context
4190 header_ http.Header
4191 }
4192
4193
4194
4195
4196
4197 func (r *ProjectsLocationsApisDeploymentsService) Get(name string) *ProjectsLocationsApisDeploymentsGetCall {
4198 c := &ProjectsLocationsApisDeploymentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4199 c.name = name
4200 return c
4201 }
4202
4203
4204
4205
4206 func (c *ProjectsLocationsApisDeploymentsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsGetCall {
4207 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4208 return c
4209 }
4210
4211
4212
4213
4214 func (c *ProjectsLocationsApisDeploymentsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisDeploymentsGetCall {
4215 c.ifNoneMatch_ = entityTag
4216 return c
4217 }
4218
4219
4220 func (c *ProjectsLocationsApisDeploymentsGetCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsGetCall {
4221 c.ctx_ = ctx
4222 return c
4223 }
4224
4225
4226
4227 func (c *ProjectsLocationsApisDeploymentsGetCall) Header() http.Header {
4228 if c.header_ == nil {
4229 c.header_ = make(http.Header)
4230 }
4231 return c.header_
4232 }
4233
4234 func (c *ProjectsLocationsApisDeploymentsGetCall) doRequest(alt string) (*http.Response, error) {
4235 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4236 if c.ifNoneMatch_ != "" {
4237 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4238 }
4239 var body io.Reader = nil
4240 c.urlParams_.Set("alt", alt)
4241 c.urlParams_.Set("prettyPrint", "false")
4242 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4243 urls += "?" + c.urlParams_.Encode()
4244 req, err := http.NewRequest("GET", urls, body)
4245 if err != nil {
4246 return nil, err
4247 }
4248 req.Header = reqHeaders
4249 googleapi.Expand(req.URL, map[string]string{
4250 "name": c.name,
4251 })
4252 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4253 }
4254
4255
4256
4257
4258
4259
4260 func (c *ProjectsLocationsApisDeploymentsGetCall) Do(opts ...googleapi.CallOption) (*ApiDeployment, error) {
4261 gensupport.SetOptions(c.urlParams_, opts...)
4262 res, err := c.doRequest("json")
4263 if res != nil && res.StatusCode == http.StatusNotModified {
4264 if res.Body != nil {
4265 res.Body.Close()
4266 }
4267 return nil, gensupport.WrapError(&googleapi.Error{
4268 Code: res.StatusCode,
4269 Header: res.Header,
4270 })
4271 }
4272 if err != nil {
4273 return nil, err
4274 }
4275 defer googleapi.CloseBody(res)
4276 if err := googleapi.CheckResponse(res); err != nil {
4277 return nil, gensupport.WrapError(err)
4278 }
4279 ret := &ApiDeployment{
4280 ServerResponse: googleapi.ServerResponse{
4281 Header: res.Header,
4282 HTTPStatusCode: res.StatusCode,
4283 },
4284 }
4285 target := &ret
4286 if err := gensupport.DecodeResponse(target, res); err != nil {
4287 return nil, err
4288 }
4289 return ret, nil
4290 }
4291
4292 type ProjectsLocationsApisDeploymentsGetIamPolicyCall struct {
4293 s *Service
4294 resource string
4295 urlParams_ gensupport.URLParams
4296 ifNoneMatch_ string
4297 ctx_ context.Context
4298 header_ http.Header
4299 }
4300
4301
4302
4303
4304
4305
4306
4307 func (r *ProjectsLocationsApisDeploymentsService) GetIamPolicy(resource string) *ProjectsLocationsApisDeploymentsGetIamPolicyCall {
4308 c := &ProjectsLocationsApisDeploymentsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4309 c.resource = resource
4310 return c
4311 }
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325 func (c *ProjectsLocationsApisDeploymentsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsApisDeploymentsGetIamPolicyCall {
4326 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
4327 return c
4328 }
4329
4330
4331
4332
4333 func (c *ProjectsLocationsApisDeploymentsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsGetIamPolicyCall {
4334 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4335 return c
4336 }
4337
4338
4339
4340
4341 func (c *ProjectsLocationsApisDeploymentsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisDeploymentsGetIamPolicyCall {
4342 c.ifNoneMatch_ = entityTag
4343 return c
4344 }
4345
4346
4347 func (c *ProjectsLocationsApisDeploymentsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsGetIamPolicyCall {
4348 c.ctx_ = ctx
4349 return c
4350 }
4351
4352
4353
4354 func (c *ProjectsLocationsApisDeploymentsGetIamPolicyCall) Header() http.Header {
4355 if c.header_ == nil {
4356 c.header_ = make(http.Header)
4357 }
4358 return c.header_
4359 }
4360
4361 func (c *ProjectsLocationsApisDeploymentsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
4362 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4363 if c.ifNoneMatch_ != "" {
4364 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4365 }
4366 var body io.Reader = nil
4367 c.urlParams_.Set("alt", alt)
4368 c.urlParams_.Set("prettyPrint", "false")
4369 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
4370 urls += "?" + c.urlParams_.Encode()
4371 req, err := http.NewRequest("GET", urls, body)
4372 if err != nil {
4373 return nil, err
4374 }
4375 req.Header = reqHeaders
4376 googleapi.Expand(req.URL, map[string]string{
4377 "resource": c.resource,
4378 })
4379 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4380 }
4381
4382
4383
4384
4385
4386
4387 func (c *ProjectsLocationsApisDeploymentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
4388 gensupport.SetOptions(c.urlParams_, opts...)
4389 res, err := c.doRequest("json")
4390 if res != nil && res.StatusCode == http.StatusNotModified {
4391 if res.Body != nil {
4392 res.Body.Close()
4393 }
4394 return nil, gensupport.WrapError(&googleapi.Error{
4395 Code: res.StatusCode,
4396 Header: res.Header,
4397 })
4398 }
4399 if err != nil {
4400 return nil, err
4401 }
4402 defer googleapi.CloseBody(res)
4403 if err := googleapi.CheckResponse(res); err != nil {
4404 return nil, gensupport.WrapError(err)
4405 }
4406 ret := &Policy{
4407 ServerResponse: googleapi.ServerResponse{
4408 Header: res.Header,
4409 HTTPStatusCode: res.StatusCode,
4410 },
4411 }
4412 target := &ret
4413 if err := gensupport.DecodeResponse(target, res); err != nil {
4414 return nil, err
4415 }
4416 return ret, nil
4417 }
4418
4419 type ProjectsLocationsApisDeploymentsListCall struct {
4420 s *Service
4421 parent string
4422 urlParams_ gensupport.URLParams
4423 ifNoneMatch_ string
4424 ctx_ context.Context
4425 header_ http.Header
4426 }
4427
4428
4429
4430
4431
4432 func (r *ProjectsLocationsApisDeploymentsService) List(parent string) *ProjectsLocationsApisDeploymentsListCall {
4433 c := &ProjectsLocationsApisDeploymentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4434 c.parent = parent
4435 return c
4436 }
4437
4438
4439
4440
4441 func (c *ProjectsLocationsApisDeploymentsListCall) Filter(filter string) *ProjectsLocationsApisDeploymentsListCall {
4442 c.urlParams_.Set("filter", filter)
4443 return c
4444 }
4445
4446
4447
4448
4449 func (c *ProjectsLocationsApisDeploymentsListCall) OrderBy(orderBy string) *ProjectsLocationsApisDeploymentsListCall {
4450 c.urlParams_.Set("orderBy", orderBy)
4451 return c
4452 }
4453
4454
4455
4456
4457
4458 func (c *ProjectsLocationsApisDeploymentsListCall) PageSize(pageSize int64) *ProjectsLocationsApisDeploymentsListCall {
4459 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4460 return c
4461 }
4462
4463
4464
4465
4466
4467 func (c *ProjectsLocationsApisDeploymentsListCall) PageToken(pageToken string) *ProjectsLocationsApisDeploymentsListCall {
4468 c.urlParams_.Set("pageToken", pageToken)
4469 return c
4470 }
4471
4472
4473
4474
4475 func (c *ProjectsLocationsApisDeploymentsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsListCall {
4476 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4477 return c
4478 }
4479
4480
4481
4482
4483 func (c *ProjectsLocationsApisDeploymentsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisDeploymentsListCall {
4484 c.ifNoneMatch_ = entityTag
4485 return c
4486 }
4487
4488
4489 func (c *ProjectsLocationsApisDeploymentsListCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsListCall {
4490 c.ctx_ = ctx
4491 return c
4492 }
4493
4494
4495
4496 func (c *ProjectsLocationsApisDeploymentsListCall) Header() http.Header {
4497 if c.header_ == nil {
4498 c.header_ = make(http.Header)
4499 }
4500 return c.header_
4501 }
4502
4503 func (c *ProjectsLocationsApisDeploymentsListCall) doRequest(alt string) (*http.Response, error) {
4504 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4505 if c.ifNoneMatch_ != "" {
4506 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4507 }
4508 var body io.Reader = nil
4509 c.urlParams_.Set("alt", alt)
4510 c.urlParams_.Set("prettyPrint", "false")
4511 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deployments")
4512 urls += "?" + c.urlParams_.Encode()
4513 req, err := http.NewRequest("GET", urls, body)
4514 if err != nil {
4515 return nil, err
4516 }
4517 req.Header = reqHeaders
4518 googleapi.Expand(req.URL, map[string]string{
4519 "parent": c.parent,
4520 })
4521 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4522 }
4523
4524
4525
4526
4527
4528
4529
4530 func (c *ProjectsLocationsApisDeploymentsListCall) Do(opts ...googleapi.CallOption) (*ListApiDeploymentsResponse, error) {
4531 gensupport.SetOptions(c.urlParams_, opts...)
4532 res, err := c.doRequest("json")
4533 if res != nil && res.StatusCode == http.StatusNotModified {
4534 if res.Body != nil {
4535 res.Body.Close()
4536 }
4537 return nil, gensupport.WrapError(&googleapi.Error{
4538 Code: res.StatusCode,
4539 Header: res.Header,
4540 })
4541 }
4542 if err != nil {
4543 return nil, err
4544 }
4545 defer googleapi.CloseBody(res)
4546 if err := googleapi.CheckResponse(res); err != nil {
4547 return nil, gensupport.WrapError(err)
4548 }
4549 ret := &ListApiDeploymentsResponse{
4550 ServerResponse: googleapi.ServerResponse{
4551 Header: res.Header,
4552 HTTPStatusCode: res.StatusCode,
4553 },
4554 }
4555 target := &ret
4556 if err := gensupport.DecodeResponse(target, res); err != nil {
4557 return nil, err
4558 }
4559 return ret, nil
4560 }
4561
4562
4563
4564
4565 func (c *ProjectsLocationsApisDeploymentsListCall) Pages(ctx context.Context, f func(*ListApiDeploymentsResponse) error) error {
4566 c.ctx_ = ctx
4567 defer c.PageToken(c.urlParams_.Get("pageToken"))
4568 for {
4569 x, err := c.Do()
4570 if err != nil {
4571 return err
4572 }
4573 if err := f(x); err != nil {
4574 return err
4575 }
4576 if x.NextPageToken == "" {
4577 return nil
4578 }
4579 c.PageToken(x.NextPageToken)
4580 }
4581 }
4582
4583 type ProjectsLocationsApisDeploymentsListRevisionsCall struct {
4584 s *Service
4585 name string
4586 urlParams_ gensupport.URLParams
4587 ifNoneMatch_ string
4588 ctx_ context.Context
4589 header_ http.Header
4590 }
4591
4592
4593
4594
4595
4596 func (r *ProjectsLocationsApisDeploymentsService) ListRevisions(name string) *ProjectsLocationsApisDeploymentsListRevisionsCall {
4597 c := &ProjectsLocationsApisDeploymentsListRevisionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4598 c.name = name
4599 return c
4600 }
4601
4602
4603
4604
4605 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) Filter(filter string) *ProjectsLocationsApisDeploymentsListRevisionsCall {
4606 c.urlParams_.Set("filter", filter)
4607 return c
4608 }
4609
4610
4611
4612 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) PageSize(pageSize int64) *ProjectsLocationsApisDeploymentsListRevisionsCall {
4613 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4614 return c
4615 }
4616
4617
4618
4619
4620 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) PageToken(pageToken string) *ProjectsLocationsApisDeploymentsListRevisionsCall {
4621 c.urlParams_.Set("pageToken", pageToken)
4622 return c
4623 }
4624
4625
4626
4627
4628 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsListRevisionsCall {
4629 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4630 return c
4631 }
4632
4633
4634
4635
4636 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisDeploymentsListRevisionsCall {
4637 c.ifNoneMatch_ = entityTag
4638 return c
4639 }
4640
4641
4642 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsListRevisionsCall {
4643 c.ctx_ = ctx
4644 return c
4645 }
4646
4647
4648
4649 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) Header() http.Header {
4650 if c.header_ == nil {
4651 c.header_ = make(http.Header)
4652 }
4653 return c.header_
4654 }
4655
4656 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) doRequest(alt string) (*http.Response, error) {
4657 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4658 if c.ifNoneMatch_ != "" {
4659 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4660 }
4661 var body io.Reader = nil
4662 c.urlParams_.Set("alt", alt)
4663 c.urlParams_.Set("prettyPrint", "false")
4664 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:listRevisions")
4665 urls += "?" + c.urlParams_.Encode()
4666 req, err := http.NewRequest("GET", urls, body)
4667 if err != nil {
4668 return nil, err
4669 }
4670 req.Header = reqHeaders
4671 googleapi.Expand(req.URL, map[string]string{
4672 "name": c.name,
4673 })
4674 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4675 }
4676
4677
4678
4679
4680
4681
4682
4683 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) Do(opts ...googleapi.CallOption) (*ListApiDeploymentRevisionsResponse, error) {
4684 gensupport.SetOptions(c.urlParams_, opts...)
4685 res, err := c.doRequest("json")
4686 if res != nil && res.StatusCode == http.StatusNotModified {
4687 if res.Body != nil {
4688 res.Body.Close()
4689 }
4690 return nil, gensupport.WrapError(&googleapi.Error{
4691 Code: res.StatusCode,
4692 Header: res.Header,
4693 })
4694 }
4695 if err != nil {
4696 return nil, err
4697 }
4698 defer googleapi.CloseBody(res)
4699 if err := googleapi.CheckResponse(res); err != nil {
4700 return nil, gensupport.WrapError(err)
4701 }
4702 ret := &ListApiDeploymentRevisionsResponse{
4703 ServerResponse: googleapi.ServerResponse{
4704 Header: res.Header,
4705 HTTPStatusCode: res.StatusCode,
4706 },
4707 }
4708 target := &ret
4709 if err := gensupport.DecodeResponse(target, res); err != nil {
4710 return nil, err
4711 }
4712 return ret, nil
4713 }
4714
4715
4716
4717
4718 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) Pages(ctx context.Context, f func(*ListApiDeploymentRevisionsResponse) error) error {
4719 c.ctx_ = ctx
4720 defer c.PageToken(c.urlParams_.Get("pageToken"))
4721 for {
4722 x, err := c.Do()
4723 if err != nil {
4724 return err
4725 }
4726 if err := f(x); err != nil {
4727 return err
4728 }
4729 if x.NextPageToken == "" {
4730 return nil
4731 }
4732 c.PageToken(x.NextPageToken)
4733 }
4734 }
4735
4736 type ProjectsLocationsApisDeploymentsPatchCall struct {
4737 s *Service
4738 name string
4739 apideployment *ApiDeployment
4740 urlParams_ gensupport.URLParams
4741 ctx_ context.Context
4742 header_ http.Header
4743 }
4744
4745
4746
4747
4748 func (r *ProjectsLocationsApisDeploymentsService) Patch(name string, apideployment *ApiDeployment) *ProjectsLocationsApisDeploymentsPatchCall {
4749 c := &ProjectsLocationsApisDeploymentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4750 c.name = name
4751 c.apideployment = apideployment
4752 return c
4753 }
4754
4755
4756
4757
4758 func (c *ProjectsLocationsApisDeploymentsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsApisDeploymentsPatchCall {
4759 c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing))
4760 return c
4761 }
4762
4763
4764
4765
4766
4767
4768 func (c *ProjectsLocationsApisDeploymentsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsApisDeploymentsPatchCall {
4769 c.urlParams_.Set("updateMask", updateMask)
4770 return c
4771 }
4772
4773
4774
4775
4776 func (c *ProjectsLocationsApisDeploymentsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsPatchCall {
4777 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4778 return c
4779 }
4780
4781
4782 func (c *ProjectsLocationsApisDeploymentsPatchCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsPatchCall {
4783 c.ctx_ = ctx
4784 return c
4785 }
4786
4787
4788
4789 func (c *ProjectsLocationsApisDeploymentsPatchCall) Header() http.Header {
4790 if c.header_ == nil {
4791 c.header_ = make(http.Header)
4792 }
4793 return c.header_
4794 }
4795
4796 func (c *ProjectsLocationsApisDeploymentsPatchCall) doRequest(alt string) (*http.Response, error) {
4797 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4798 var body io.Reader = nil
4799 body, err := googleapi.WithoutDataWrapper.JSONReader(c.apideployment)
4800 if err != nil {
4801 return nil, err
4802 }
4803 c.urlParams_.Set("alt", alt)
4804 c.urlParams_.Set("prettyPrint", "false")
4805 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4806 urls += "?" + c.urlParams_.Encode()
4807 req, err := http.NewRequest("PATCH", urls, body)
4808 if err != nil {
4809 return nil, err
4810 }
4811 req.Header = reqHeaders
4812 googleapi.Expand(req.URL, map[string]string{
4813 "name": c.name,
4814 })
4815 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4816 }
4817
4818
4819
4820
4821
4822
4823 func (c *ProjectsLocationsApisDeploymentsPatchCall) Do(opts ...googleapi.CallOption) (*ApiDeployment, error) {
4824 gensupport.SetOptions(c.urlParams_, opts...)
4825 res, err := c.doRequest("json")
4826 if res != nil && res.StatusCode == http.StatusNotModified {
4827 if res.Body != nil {
4828 res.Body.Close()
4829 }
4830 return nil, gensupport.WrapError(&googleapi.Error{
4831 Code: res.StatusCode,
4832 Header: res.Header,
4833 })
4834 }
4835 if err != nil {
4836 return nil, err
4837 }
4838 defer googleapi.CloseBody(res)
4839 if err := googleapi.CheckResponse(res); err != nil {
4840 return nil, gensupport.WrapError(err)
4841 }
4842 ret := &ApiDeployment{
4843 ServerResponse: googleapi.ServerResponse{
4844 Header: res.Header,
4845 HTTPStatusCode: res.StatusCode,
4846 },
4847 }
4848 target := &ret
4849 if err := gensupport.DecodeResponse(target, res); err != nil {
4850 return nil, err
4851 }
4852 return ret, nil
4853 }
4854
4855 type ProjectsLocationsApisDeploymentsRollbackCall struct {
4856 s *Service
4857 name string
4858 rollbackapideploymentrequest *RollbackApiDeploymentRequest
4859 urlParams_ gensupport.URLParams
4860 ctx_ context.Context
4861 header_ http.Header
4862 }
4863
4864
4865
4866
4867
4868 func (r *ProjectsLocationsApisDeploymentsService) Rollback(name string, rollbackapideploymentrequest *RollbackApiDeploymentRequest) *ProjectsLocationsApisDeploymentsRollbackCall {
4869 c := &ProjectsLocationsApisDeploymentsRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4870 c.name = name
4871 c.rollbackapideploymentrequest = rollbackapideploymentrequest
4872 return c
4873 }
4874
4875
4876
4877
4878 func (c *ProjectsLocationsApisDeploymentsRollbackCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsRollbackCall {
4879 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4880 return c
4881 }
4882
4883
4884 func (c *ProjectsLocationsApisDeploymentsRollbackCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsRollbackCall {
4885 c.ctx_ = ctx
4886 return c
4887 }
4888
4889
4890
4891 func (c *ProjectsLocationsApisDeploymentsRollbackCall) Header() http.Header {
4892 if c.header_ == nil {
4893 c.header_ = make(http.Header)
4894 }
4895 return c.header_
4896 }
4897
4898 func (c *ProjectsLocationsApisDeploymentsRollbackCall) doRequest(alt string) (*http.Response, error) {
4899 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4900 var body io.Reader = nil
4901 body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackapideploymentrequest)
4902 if err != nil {
4903 return nil, err
4904 }
4905 c.urlParams_.Set("alt", alt)
4906 c.urlParams_.Set("prettyPrint", "false")
4907 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:rollback")
4908 urls += "?" + c.urlParams_.Encode()
4909 req, err := http.NewRequest("POST", urls, body)
4910 if err != nil {
4911 return nil, err
4912 }
4913 req.Header = reqHeaders
4914 googleapi.Expand(req.URL, map[string]string{
4915 "name": c.name,
4916 })
4917 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4918 }
4919
4920
4921
4922
4923
4924
4925 func (c *ProjectsLocationsApisDeploymentsRollbackCall) Do(opts ...googleapi.CallOption) (*ApiDeployment, error) {
4926 gensupport.SetOptions(c.urlParams_, opts...)
4927 res, err := c.doRequest("json")
4928 if res != nil && res.StatusCode == http.StatusNotModified {
4929 if res.Body != nil {
4930 res.Body.Close()
4931 }
4932 return nil, gensupport.WrapError(&googleapi.Error{
4933 Code: res.StatusCode,
4934 Header: res.Header,
4935 })
4936 }
4937 if err != nil {
4938 return nil, err
4939 }
4940 defer googleapi.CloseBody(res)
4941 if err := googleapi.CheckResponse(res); err != nil {
4942 return nil, gensupport.WrapError(err)
4943 }
4944 ret := &ApiDeployment{
4945 ServerResponse: googleapi.ServerResponse{
4946 Header: res.Header,
4947 HTTPStatusCode: res.StatusCode,
4948 },
4949 }
4950 target := &ret
4951 if err := gensupport.DecodeResponse(target, res); err != nil {
4952 return nil, err
4953 }
4954 return ret, nil
4955 }
4956
4957 type ProjectsLocationsApisDeploymentsSetIamPolicyCall struct {
4958 s *Service
4959 resource string
4960 setiampolicyrequest *SetIamPolicyRequest
4961 urlParams_ gensupport.URLParams
4962 ctx_ context.Context
4963 header_ http.Header
4964 }
4965
4966
4967
4968
4969
4970
4971
4972
4973 func (r *ProjectsLocationsApisDeploymentsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsApisDeploymentsSetIamPolicyCall {
4974 c := &ProjectsLocationsApisDeploymentsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4975 c.resource = resource
4976 c.setiampolicyrequest = setiampolicyrequest
4977 return c
4978 }
4979
4980
4981
4982
4983 func (c *ProjectsLocationsApisDeploymentsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsSetIamPolicyCall {
4984 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4985 return c
4986 }
4987
4988
4989 func (c *ProjectsLocationsApisDeploymentsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsSetIamPolicyCall {
4990 c.ctx_ = ctx
4991 return c
4992 }
4993
4994
4995
4996 func (c *ProjectsLocationsApisDeploymentsSetIamPolicyCall) Header() http.Header {
4997 if c.header_ == nil {
4998 c.header_ = make(http.Header)
4999 }
5000 return c.header_
5001 }
5002
5003 func (c *ProjectsLocationsApisDeploymentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
5004 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5005 var body io.Reader = nil
5006 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
5007 if err != nil {
5008 return nil, err
5009 }
5010 c.urlParams_.Set("alt", alt)
5011 c.urlParams_.Set("prettyPrint", "false")
5012 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
5013 urls += "?" + c.urlParams_.Encode()
5014 req, err := http.NewRequest("POST", urls, body)
5015 if err != nil {
5016 return nil, err
5017 }
5018 req.Header = reqHeaders
5019 googleapi.Expand(req.URL, map[string]string{
5020 "resource": c.resource,
5021 })
5022 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5023 }
5024
5025
5026
5027
5028
5029
5030 func (c *ProjectsLocationsApisDeploymentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
5031 gensupport.SetOptions(c.urlParams_, opts...)
5032 res, err := c.doRequest("json")
5033 if res != nil && res.StatusCode == http.StatusNotModified {
5034 if res.Body != nil {
5035 res.Body.Close()
5036 }
5037 return nil, gensupport.WrapError(&googleapi.Error{
5038 Code: res.StatusCode,
5039 Header: res.Header,
5040 })
5041 }
5042 if err != nil {
5043 return nil, err
5044 }
5045 defer googleapi.CloseBody(res)
5046 if err := googleapi.CheckResponse(res); err != nil {
5047 return nil, gensupport.WrapError(err)
5048 }
5049 ret := &Policy{
5050 ServerResponse: googleapi.ServerResponse{
5051 Header: res.Header,
5052 HTTPStatusCode: res.StatusCode,
5053 },
5054 }
5055 target := &ret
5056 if err := gensupport.DecodeResponse(target, res); err != nil {
5057 return nil, err
5058 }
5059 return ret, nil
5060 }
5061
5062 type ProjectsLocationsApisDeploymentsTagRevisionCall struct {
5063 s *Service
5064 name string
5065 tagapideploymentrevisionrequest *TagApiDeploymentRevisionRequest
5066 urlParams_ gensupport.URLParams
5067 ctx_ context.Context
5068 header_ http.Header
5069 }
5070
5071
5072
5073
5074
5075
5076 func (r *ProjectsLocationsApisDeploymentsService) TagRevision(name string, tagapideploymentrevisionrequest *TagApiDeploymentRevisionRequest) *ProjectsLocationsApisDeploymentsTagRevisionCall {
5077 c := &ProjectsLocationsApisDeploymentsTagRevisionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5078 c.name = name
5079 c.tagapideploymentrevisionrequest = tagapideploymentrevisionrequest
5080 return c
5081 }
5082
5083
5084
5085
5086 func (c *ProjectsLocationsApisDeploymentsTagRevisionCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsTagRevisionCall {
5087 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5088 return c
5089 }
5090
5091
5092 func (c *ProjectsLocationsApisDeploymentsTagRevisionCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsTagRevisionCall {
5093 c.ctx_ = ctx
5094 return c
5095 }
5096
5097
5098
5099 func (c *ProjectsLocationsApisDeploymentsTagRevisionCall) Header() http.Header {
5100 if c.header_ == nil {
5101 c.header_ = make(http.Header)
5102 }
5103 return c.header_
5104 }
5105
5106 func (c *ProjectsLocationsApisDeploymentsTagRevisionCall) doRequest(alt string) (*http.Response, error) {
5107 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5108 var body io.Reader = nil
5109 body, err := googleapi.WithoutDataWrapper.JSONReader(c.tagapideploymentrevisionrequest)
5110 if err != nil {
5111 return nil, err
5112 }
5113 c.urlParams_.Set("alt", alt)
5114 c.urlParams_.Set("prettyPrint", "false")
5115 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:tagRevision")
5116 urls += "?" + c.urlParams_.Encode()
5117 req, err := http.NewRequest("POST", urls, body)
5118 if err != nil {
5119 return nil, err
5120 }
5121 req.Header = reqHeaders
5122 googleapi.Expand(req.URL, map[string]string{
5123 "name": c.name,
5124 })
5125 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5126 }
5127
5128
5129
5130
5131
5132
5133 func (c *ProjectsLocationsApisDeploymentsTagRevisionCall) Do(opts ...googleapi.CallOption) (*ApiDeployment, error) {
5134 gensupport.SetOptions(c.urlParams_, opts...)
5135 res, err := c.doRequest("json")
5136 if res != nil && res.StatusCode == http.StatusNotModified {
5137 if res.Body != nil {
5138 res.Body.Close()
5139 }
5140 return nil, gensupport.WrapError(&googleapi.Error{
5141 Code: res.StatusCode,
5142 Header: res.Header,
5143 })
5144 }
5145 if err != nil {
5146 return nil, err
5147 }
5148 defer googleapi.CloseBody(res)
5149 if err := googleapi.CheckResponse(res); err != nil {
5150 return nil, gensupport.WrapError(err)
5151 }
5152 ret := &ApiDeployment{
5153 ServerResponse: googleapi.ServerResponse{
5154 Header: res.Header,
5155 HTTPStatusCode: res.StatusCode,
5156 },
5157 }
5158 target := &ret
5159 if err := gensupport.DecodeResponse(target, res); err != nil {
5160 return nil, err
5161 }
5162 return ret, nil
5163 }
5164
5165 type ProjectsLocationsApisDeploymentsTestIamPermissionsCall struct {
5166 s *Service
5167 resource string
5168 testiampermissionsrequest *TestIamPermissionsRequest
5169 urlParams_ gensupport.URLParams
5170 ctx_ context.Context
5171 header_ http.Header
5172 }
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184 func (r *ProjectsLocationsApisDeploymentsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsApisDeploymentsTestIamPermissionsCall {
5185 c := &ProjectsLocationsApisDeploymentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5186 c.resource = resource
5187 c.testiampermissionsrequest = testiampermissionsrequest
5188 return c
5189 }
5190
5191
5192
5193
5194 func (c *ProjectsLocationsApisDeploymentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsTestIamPermissionsCall {
5195 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5196 return c
5197 }
5198
5199
5200 func (c *ProjectsLocationsApisDeploymentsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsTestIamPermissionsCall {
5201 c.ctx_ = ctx
5202 return c
5203 }
5204
5205
5206
5207 func (c *ProjectsLocationsApisDeploymentsTestIamPermissionsCall) Header() http.Header {
5208 if c.header_ == nil {
5209 c.header_ = make(http.Header)
5210 }
5211 return c.header_
5212 }
5213
5214 func (c *ProjectsLocationsApisDeploymentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
5215 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5216 var body io.Reader = nil
5217 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
5218 if err != nil {
5219 return nil, err
5220 }
5221 c.urlParams_.Set("alt", alt)
5222 c.urlParams_.Set("prettyPrint", "false")
5223 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
5224 urls += "?" + c.urlParams_.Encode()
5225 req, err := http.NewRequest("POST", urls, body)
5226 if err != nil {
5227 return nil, err
5228 }
5229 req.Header = reqHeaders
5230 googleapi.Expand(req.URL, map[string]string{
5231 "resource": c.resource,
5232 })
5233 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5234 }
5235
5236
5237
5238
5239
5240
5241
5242 func (c *ProjectsLocationsApisDeploymentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
5243 gensupport.SetOptions(c.urlParams_, opts...)
5244 res, err := c.doRequest("json")
5245 if res != nil && res.StatusCode == http.StatusNotModified {
5246 if res.Body != nil {
5247 res.Body.Close()
5248 }
5249 return nil, gensupport.WrapError(&googleapi.Error{
5250 Code: res.StatusCode,
5251 Header: res.Header,
5252 })
5253 }
5254 if err != nil {
5255 return nil, err
5256 }
5257 defer googleapi.CloseBody(res)
5258 if err := googleapi.CheckResponse(res); err != nil {
5259 return nil, gensupport.WrapError(err)
5260 }
5261 ret := &TestIamPermissionsResponse{
5262 ServerResponse: googleapi.ServerResponse{
5263 Header: res.Header,
5264 HTTPStatusCode: res.StatusCode,
5265 },
5266 }
5267 target := &ret
5268 if err := gensupport.DecodeResponse(target, res); err != nil {
5269 return nil, err
5270 }
5271 return ret, nil
5272 }
5273
5274 type ProjectsLocationsApisDeploymentsArtifactsCreateCall struct {
5275 s *Service
5276 parent string
5277 artifact *Artifact
5278 urlParams_ gensupport.URLParams
5279 ctx_ context.Context
5280 header_ http.Header
5281 }
5282
5283
5284
5285
5286
5287 func (r *ProjectsLocationsApisDeploymentsArtifactsService) Create(parent string, artifact *Artifact) *ProjectsLocationsApisDeploymentsArtifactsCreateCall {
5288 c := &ProjectsLocationsApisDeploymentsArtifactsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5289 c.parent = parent
5290 c.artifact = artifact
5291 return c
5292 }
5293
5294
5295
5296
5297
5298 func (c *ProjectsLocationsApisDeploymentsArtifactsCreateCall) ArtifactId(artifactId string) *ProjectsLocationsApisDeploymentsArtifactsCreateCall {
5299 c.urlParams_.Set("artifactId", artifactId)
5300 return c
5301 }
5302
5303
5304
5305
5306 func (c *ProjectsLocationsApisDeploymentsArtifactsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsArtifactsCreateCall {
5307 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5308 return c
5309 }
5310
5311
5312 func (c *ProjectsLocationsApisDeploymentsArtifactsCreateCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsArtifactsCreateCall {
5313 c.ctx_ = ctx
5314 return c
5315 }
5316
5317
5318
5319 func (c *ProjectsLocationsApisDeploymentsArtifactsCreateCall) Header() http.Header {
5320 if c.header_ == nil {
5321 c.header_ = make(http.Header)
5322 }
5323 return c.header_
5324 }
5325
5326 func (c *ProjectsLocationsApisDeploymentsArtifactsCreateCall) doRequest(alt string) (*http.Response, error) {
5327 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5328 var body io.Reader = nil
5329 body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact)
5330 if err != nil {
5331 return nil, err
5332 }
5333 c.urlParams_.Set("alt", alt)
5334 c.urlParams_.Set("prettyPrint", "false")
5335 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
5336 urls += "?" + c.urlParams_.Encode()
5337 req, err := http.NewRequest("POST", urls, body)
5338 if err != nil {
5339 return nil, err
5340 }
5341 req.Header = reqHeaders
5342 googleapi.Expand(req.URL, map[string]string{
5343 "parent": c.parent,
5344 })
5345 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5346 }
5347
5348
5349
5350
5351
5352
5353 func (c *ProjectsLocationsApisDeploymentsArtifactsCreateCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
5354 gensupport.SetOptions(c.urlParams_, opts...)
5355 res, err := c.doRequest("json")
5356 if res != nil && res.StatusCode == http.StatusNotModified {
5357 if res.Body != nil {
5358 res.Body.Close()
5359 }
5360 return nil, gensupport.WrapError(&googleapi.Error{
5361 Code: res.StatusCode,
5362 Header: res.Header,
5363 })
5364 }
5365 if err != nil {
5366 return nil, err
5367 }
5368 defer googleapi.CloseBody(res)
5369 if err := googleapi.CheckResponse(res); err != nil {
5370 return nil, gensupport.WrapError(err)
5371 }
5372 ret := &Artifact{
5373 ServerResponse: googleapi.ServerResponse{
5374 Header: res.Header,
5375 HTTPStatusCode: res.StatusCode,
5376 },
5377 }
5378 target := &ret
5379 if err := gensupport.DecodeResponse(target, res); err != nil {
5380 return nil, err
5381 }
5382 return ret, nil
5383 }
5384
5385 type ProjectsLocationsApisDeploymentsArtifactsDeleteCall struct {
5386 s *Service
5387 name string
5388 urlParams_ gensupport.URLParams
5389 ctx_ context.Context
5390 header_ http.Header
5391 }
5392
5393
5394
5395
5396 func (r *ProjectsLocationsApisDeploymentsArtifactsService) Delete(name string) *ProjectsLocationsApisDeploymentsArtifactsDeleteCall {
5397 c := &ProjectsLocationsApisDeploymentsArtifactsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5398 c.name = name
5399 return c
5400 }
5401
5402
5403
5404
5405 func (c *ProjectsLocationsApisDeploymentsArtifactsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsArtifactsDeleteCall {
5406 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5407 return c
5408 }
5409
5410
5411 func (c *ProjectsLocationsApisDeploymentsArtifactsDeleteCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsArtifactsDeleteCall {
5412 c.ctx_ = ctx
5413 return c
5414 }
5415
5416
5417
5418 func (c *ProjectsLocationsApisDeploymentsArtifactsDeleteCall) Header() http.Header {
5419 if c.header_ == nil {
5420 c.header_ = make(http.Header)
5421 }
5422 return c.header_
5423 }
5424
5425 func (c *ProjectsLocationsApisDeploymentsArtifactsDeleteCall) doRequest(alt string) (*http.Response, error) {
5426 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5427 var body io.Reader = nil
5428 c.urlParams_.Set("alt", alt)
5429 c.urlParams_.Set("prettyPrint", "false")
5430 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5431 urls += "?" + c.urlParams_.Encode()
5432 req, err := http.NewRequest("DELETE", urls, body)
5433 if err != nil {
5434 return nil, err
5435 }
5436 req.Header = reqHeaders
5437 googleapi.Expand(req.URL, map[string]string{
5438 "name": c.name,
5439 })
5440 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5441 }
5442
5443
5444
5445
5446
5447
5448 func (c *ProjectsLocationsApisDeploymentsArtifactsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
5449 gensupport.SetOptions(c.urlParams_, opts...)
5450 res, err := c.doRequest("json")
5451 if res != nil && res.StatusCode == http.StatusNotModified {
5452 if res.Body != nil {
5453 res.Body.Close()
5454 }
5455 return nil, gensupport.WrapError(&googleapi.Error{
5456 Code: res.StatusCode,
5457 Header: res.Header,
5458 })
5459 }
5460 if err != nil {
5461 return nil, err
5462 }
5463 defer googleapi.CloseBody(res)
5464 if err := googleapi.CheckResponse(res); err != nil {
5465 return nil, gensupport.WrapError(err)
5466 }
5467 ret := &Empty{
5468 ServerResponse: googleapi.ServerResponse{
5469 Header: res.Header,
5470 HTTPStatusCode: res.StatusCode,
5471 },
5472 }
5473 target := &ret
5474 if err := gensupport.DecodeResponse(target, res); err != nil {
5475 return nil, err
5476 }
5477 return ret, nil
5478 }
5479
5480 type ProjectsLocationsApisDeploymentsArtifactsGetCall struct {
5481 s *Service
5482 name string
5483 urlParams_ gensupport.URLParams
5484 ifNoneMatch_ string
5485 ctx_ context.Context
5486 header_ http.Header
5487 }
5488
5489
5490
5491
5492 func (r *ProjectsLocationsApisDeploymentsArtifactsService) Get(name string) *ProjectsLocationsApisDeploymentsArtifactsGetCall {
5493 c := &ProjectsLocationsApisDeploymentsArtifactsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5494 c.name = name
5495 return c
5496 }
5497
5498
5499
5500
5501 func (c *ProjectsLocationsApisDeploymentsArtifactsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsArtifactsGetCall {
5502 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5503 return c
5504 }
5505
5506
5507
5508
5509 func (c *ProjectsLocationsApisDeploymentsArtifactsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisDeploymentsArtifactsGetCall {
5510 c.ifNoneMatch_ = entityTag
5511 return c
5512 }
5513
5514
5515 func (c *ProjectsLocationsApisDeploymentsArtifactsGetCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsArtifactsGetCall {
5516 c.ctx_ = ctx
5517 return c
5518 }
5519
5520
5521
5522 func (c *ProjectsLocationsApisDeploymentsArtifactsGetCall) Header() http.Header {
5523 if c.header_ == nil {
5524 c.header_ = make(http.Header)
5525 }
5526 return c.header_
5527 }
5528
5529 func (c *ProjectsLocationsApisDeploymentsArtifactsGetCall) doRequest(alt string) (*http.Response, error) {
5530 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5531 if c.ifNoneMatch_ != "" {
5532 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5533 }
5534 var body io.Reader = nil
5535 c.urlParams_.Set("alt", alt)
5536 c.urlParams_.Set("prettyPrint", "false")
5537 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5538 urls += "?" + c.urlParams_.Encode()
5539 req, err := http.NewRequest("GET", urls, body)
5540 if err != nil {
5541 return nil, err
5542 }
5543 req.Header = reqHeaders
5544 googleapi.Expand(req.URL, map[string]string{
5545 "name": c.name,
5546 })
5547 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5548 }
5549
5550
5551
5552
5553
5554
5555 func (c *ProjectsLocationsApisDeploymentsArtifactsGetCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
5556 gensupport.SetOptions(c.urlParams_, opts...)
5557 res, err := c.doRequest("json")
5558 if res != nil && res.StatusCode == http.StatusNotModified {
5559 if res.Body != nil {
5560 res.Body.Close()
5561 }
5562 return nil, gensupport.WrapError(&googleapi.Error{
5563 Code: res.StatusCode,
5564 Header: res.Header,
5565 })
5566 }
5567 if err != nil {
5568 return nil, err
5569 }
5570 defer googleapi.CloseBody(res)
5571 if err := googleapi.CheckResponse(res); err != nil {
5572 return nil, gensupport.WrapError(err)
5573 }
5574 ret := &Artifact{
5575 ServerResponse: googleapi.ServerResponse{
5576 Header: res.Header,
5577 HTTPStatusCode: res.StatusCode,
5578 },
5579 }
5580 target := &ret
5581 if err := gensupport.DecodeResponse(target, res); err != nil {
5582 return nil, err
5583 }
5584 return ret, nil
5585 }
5586
5587 type ProjectsLocationsApisDeploymentsArtifactsGetContentsCall struct {
5588 s *Service
5589 name string
5590 urlParams_ gensupport.URLParams
5591 ifNoneMatch_ string
5592 ctx_ context.Context
5593 header_ http.Header
5594 }
5595
5596
5597
5598
5599
5600
5601
5602
5603 func (r *ProjectsLocationsApisDeploymentsArtifactsService) GetContents(name string) *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall {
5604 c := &ProjectsLocationsApisDeploymentsArtifactsGetContentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5605 c.name = name
5606 return c
5607 }
5608
5609
5610
5611
5612 func (c *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall {
5613 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5614 return c
5615 }
5616
5617
5618
5619
5620 func (c *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall {
5621 c.ifNoneMatch_ = entityTag
5622 return c
5623 }
5624
5625
5626 func (c *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall {
5627 c.ctx_ = ctx
5628 return c
5629 }
5630
5631
5632
5633 func (c *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall) Header() http.Header {
5634 if c.header_ == nil {
5635 c.header_ = make(http.Header)
5636 }
5637 return c.header_
5638 }
5639
5640 func (c *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall) doRequest(alt string) (*http.Response, error) {
5641 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5642 if c.ifNoneMatch_ != "" {
5643 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5644 }
5645 var body io.Reader = nil
5646 c.urlParams_.Set("alt", alt)
5647 c.urlParams_.Set("prettyPrint", "false")
5648 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getContents")
5649 urls += "?" + c.urlParams_.Encode()
5650 req, err := http.NewRequest("GET", urls, body)
5651 if err != nil {
5652 return nil, err
5653 }
5654 req.Header = reqHeaders
5655 googleapi.Expand(req.URL, map[string]string{
5656 "name": c.name,
5657 })
5658 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5659 }
5660
5661
5662
5663
5664
5665
5666 func (c *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
5667 gensupport.SetOptions(c.urlParams_, opts...)
5668 res, err := c.doRequest("json")
5669 if res != nil && res.StatusCode == http.StatusNotModified {
5670 if res.Body != nil {
5671 res.Body.Close()
5672 }
5673 return nil, gensupport.WrapError(&googleapi.Error{
5674 Code: res.StatusCode,
5675 Header: res.Header,
5676 })
5677 }
5678 if err != nil {
5679 return nil, err
5680 }
5681 defer googleapi.CloseBody(res)
5682 if err := googleapi.CheckResponse(res); err != nil {
5683 return nil, gensupport.WrapError(err)
5684 }
5685 ret := &HttpBody{
5686 ServerResponse: googleapi.ServerResponse{
5687 Header: res.Header,
5688 HTTPStatusCode: res.StatusCode,
5689 },
5690 }
5691 target := &ret
5692 if err := gensupport.DecodeResponse(target, res); err != nil {
5693 return nil, err
5694 }
5695 return ret, nil
5696 }
5697
5698 type ProjectsLocationsApisDeploymentsArtifactsListCall struct {
5699 s *Service
5700 parent string
5701 urlParams_ gensupport.URLParams
5702 ifNoneMatch_ string
5703 ctx_ context.Context
5704 header_ http.Header
5705 }
5706
5707
5708
5709
5710
5711 func (r *ProjectsLocationsApisDeploymentsArtifactsService) List(parent string) *ProjectsLocationsApisDeploymentsArtifactsListCall {
5712 c := &ProjectsLocationsApisDeploymentsArtifactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5713 c.parent = parent
5714 return c
5715 }
5716
5717
5718
5719
5720 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) Filter(filter string) *ProjectsLocationsApisDeploymentsArtifactsListCall {
5721 c.urlParams_.Set("filter", filter)
5722 return c
5723 }
5724
5725
5726
5727
5728 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) OrderBy(orderBy string) *ProjectsLocationsApisDeploymentsArtifactsListCall {
5729 c.urlParams_.Set("orderBy", orderBy)
5730 return c
5731 }
5732
5733
5734
5735
5736
5737 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) PageSize(pageSize int64) *ProjectsLocationsApisDeploymentsArtifactsListCall {
5738 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5739 return c
5740 }
5741
5742
5743
5744
5745
5746 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) PageToken(pageToken string) *ProjectsLocationsApisDeploymentsArtifactsListCall {
5747 c.urlParams_.Set("pageToken", pageToken)
5748 return c
5749 }
5750
5751
5752
5753
5754 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsArtifactsListCall {
5755 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5756 return c
5757 }
5758
5759
5760
5761
5762 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisDeploymentsArtifactsListCall {
5763 c.ifNoneMatch_ = entityTag
5764 return c
5765 }
5766
5767
5768 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsArtifactsListCall {
5769 c.ctx_ = ctx
5770 return c
5771 }
5772
5773
5774
5775 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) Header() http.Header {
5776 if c.header_ == nil {
5777 c.header_ = make(http.Header)
5778 }
5779 return c.header_
5780 }
5781
5782 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) doRequest(alt string) (*http.Response, error) {
5783 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5784 if c.ifNoneMatch_ != "" {
5785 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5786 }
5787 var body io.Reader = nil
5788 c.urlParams_.Set("alt", alt)
5789 c.urlParams_.Set("prettyPrint", "false")
5790 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
5791 urls += "?" + c.urlParams_.Encode()
5792 req, err := http.NewRequest("GET", urls, body)
5793 if err != nil {
5794 return nil, err
5795 }
5796 req.Header = reqHeaders
5797 googleapi.Expand(req.URL, map[string]string{
5798 "parent": c.parent,
5799 })
5800 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5801 }
5802
5803
5804
5805
5806
5807
5808
5809 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) Do(opts ...googleapi.CallOption) (*ListArtifactsResponse, error) {
5810 gensupport.SetOptions(c.urlParams_, opts...)
5811 res, err := c.doRequest("json")
5812 if res != nil && res.StatusCode == http.StatusNotModified {
5813 if res.Body != nil {
5814 res.Body.Close()
5815 }
5816 return nil, gensupport.WrapError(&googleapi.Error{
5817 Code: res.StatusCode,
5818 Header: res.Header,
5819 })
5820 }
5821 if err != nil {
5822 return nil, err
5823 }
5824 defer googleapi.CloseBody(res)
5825 if err := googleapi.CheckResponse(res); err != nil {
5826 return nil, gensupport.WrapError(err)
5827 }
5828 ret := &ListArtifactsResponse{
5829 ServerResponse: googleapi.ServerResponse{
5830 Header: res.Header,
5831 HTTPStatusCode: res.StatusCode,
5832 },
5833 }
5834 target := &ret
5835 if err := gensupport.DecodeResponse(target, res); err != nil {
5836 return nil, err
5837 }
5838 return ret, nil
5839 }
5840
5841
5842
5843
5844 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) Pages(ctx context.Context, f func(*ListArtifactsResponse) error) error {
5845 c.ctx_ = ctx
5846 defer c.PageToken(c.urlParams_.Get("pageToken"))
5847 for {
5848 x, err := c.Do()
5849 if err != nil {
5850 return err
5851 }
5852 if err := f(x); err != nil {
5853 return err
5854 }
5855 if x.NextPageToken == "" {
5856 return nil
5857 }
5858 c.PageToken(x.NextPageToken)
5859 }
5860 }
5861
5862 type ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall struct {
5863 s *Service
5864 name string
5865 artifact *Artifact
5866 urlParams_ gensupport.URLParams
5867 ctx_ context.Context
5868 header_ http.Header
5869 }
5870
5871
5872
5873
5874 func (r *ProjectsLocationsApisDeploymentsArtifactsService) ReplaceArtifact(name string, artifact *Artifact) *ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall {
5875 c := &ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5876 c.name = name
5877 c.artifact = artifact
5878 return c
5879 }
5880
5881
5882
5883
5884 func (c *ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall {
5885 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5886 return c
5887 }
5888
5889
5890 func (c *ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall {
5891 c.ctx_ = ctx
5892 return c
5893 }
5894
5895
5896
5897 func (c *ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall) Header() http.Header {
5898 if c.header_ == nil {
5899 c.header_ = make(http.Header)
5900 }
5901 return c.header_
5902 }
5903
5904 func (c *ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall) doRequest(alt string) (*http.Response, error) {
5905 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5906 var body io.Reader = nil
5907 body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact)
5908 if err != nil {
5909 return nil, err
5910 }
5911 c.urlParams_.Set("alt", alt)
5912 c.urlParams_.Set("prettyPrint", "false")
5913 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5914 urls += "?" + c.urlParams_.Encode()
5915 req, err := http.NewRequest("PUT", urls, body)
5916 if err != nil {
5917 return nil, err
5918 }
5919 req.Header = reqHeaders
5920 googleapi.Expand(req.URL, map[string]string{
5921 "name": c.name,
5922 })
5923 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5924 }
5925
5926
5927
5928
5929
5930
5931 func (c *ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
5932 gensupport.SetOptions(c.urlParams_, opts...)
5933 res, err := c.doRequest("json")
5934 if res != nil && res.StatusCode == http.StatusNotModified {
5935 if res.Body != nil {
5936 res.Body.Close()
5937 }
5938 return nil, gensupport.WrapError(&googleapi.Error{
5939 Code: res.StatusCode,
5940 Header: res.Header,
5941 })
5942 }
5943 if err != nil {
5944 return nil, err
5945 }
5946 defer googleapi.CloseBody(res)
5947 if err := googleapi.CheckResponse(res); err != nil {
5948 return nil, gensupport.WrapError(err)
5949 }
5950 ret := &Artifact{
5951 ServerResponse: googleapi.ServerResponse{
5952 Header: res.Header,
5953 HTTPStatusCode: res.StatusCode,
5954 },
5955 }
5956 target := &ret
5957 if err := gensupport.DecodeResponse(target, res); err != nil {
5958 return nil, err
5959 }
5960 return ret, nil
5961 }
5962
5963 type ProjectsLocationsApisVersionsCreateCall struct {
5964 s *Service
5965 parent string
5966 apiversion *ApiVersion
5967 urlParams_ gensupport.URLParams
5968 ctx_ context.Context
5969 header_ http.Header
5970 }
5971
5972
5973
5974
5975
5976 func (r *ProjectsLocationsApisVersionsService) Create(parent string, apiversion *ApiVersion) *ProjectsLocationsApisVersionsCreateCall {
5977 c := &ProjectsLocationsApisVersionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5978 c.parent = parent
5979 c.apiversion = apiversion
5980 return c
5981 }
5982
5983
5984
5985
5986
5987 func (c *ProjectsLocationsApisVersionsCreateCall) ApiVersionId(apiVersionId string) *ProjectsLocationsApisVersionsCreateCall {
5988 c.urlParams_.Set("apiVersionId", apiVersionId)
5989 return c
5990 }
5991
5992
5993
5994
5995 func (c *ProjectsLocationsApisVersionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsCreateCall {
5996 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5997 return c
5998 }
5999
6000
6001 func (c *ProjectsLocationsApisVersionsCreateCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsCreateCall {
6002 c.ctx_ = ctx
6003 return c
6004 }
6005
6006
6007
6008 func (c *ProjectsLocationsApisVersionsCreateCall) Header() http.Header {
6009 if c.header_ == nil {
6010 c.header_ = make(http.Header)
6011 }
6012 return c.header_
6013 }
6014
6015 func (c *ProjectsLocationsApisVersionsCreateCall) doRequest(alt string) (*http.Response, error) {
6016 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6017 var body io.Reader = nil
6018 body, err := googleapi.WithoutDataWrapper.JSONReader(c.apiversion)
6019 if err != nil {
6020 return nil, err
6021 }
6022 c.urlParams_.Set("alt", alt)
6023 c.urlParams_.Set("prettyPrint", "false")
6024 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions")
6025 urls += "?" + c.urlParams_.Encode()
6026 req, err := http.NewRequest("POST", urls, body)
6027 if err != nil {
6028 return nil, err
6029 }
6030 req.Header = reqHeaders
6031 googleapi.Expand(req.URL, map[string]string{
6032 "parent": c.parent,
6033 })
6034 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6035 }
6036
6037
6038
6039
6040
6041
6042 func (c *ProjectsLocationsApisVersionsCreateCall) Do(opts ...googleapi.CallOption) (*ApiVersion, error) {
6043 gensupport.SetOptions(c.urlParams_, opts...)
6044 res, err := c.doRequest("json")
6045 if res != nil && res.StatusCode == http.StatusNotModified {
6046 if res.Body != nil {
6047 res.Body.Close()
6048 }
6049 return nil, gensupport.WrapError(&googleapi.Error{
6050 Code: res.StatusCode,
6051 Header: res.Header,
6052 })
6053 }
6054 if err != nil {
6055 return nil, err
6056 }
6057 defer googleapi.CloseBody(res)
6058 if err := googleapi.CheckResponse(res); err != nil {
6059 return nil, gensupport.WrapError(err)
6060 }
6061 ret := &ApiVersion{
6062 ServerResponse: googleapi.ServerResponse{
6063 Header: res.Header,
6064 HTTPStatusCode: res.StatusCode,
6065 },
6066 }
6067 target := &ret
6068 if err := gensupport.DecodeResponse(target, res); err != nil {
6069 return nil, err
6070 }
6071 return ret, nil
6072 }
6073
6074 type ProjectsLocationsApisVersionsDeleteCall struct {
6075 s *Service
6076 name string
6077 urlParams_ gensupport.URLParams
6078 ctx_ context.Context
6079 header_ http.Header
6080 }
6081
6082
6083
6084
6085
6086 func (r *ProjectsLocationsApisVersionsService) Delete(name string) *ProjectsLocationsApisVersionsDeleteCall {
6087 c := &ProjectsLocationsApisVersionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6088 c.name = name
6089 return c
6090 }
6091
6092
6093
6094
6095 func (c *ProjectsLocationsApisVersionsDeleteCall) Force(force bool) *ProjectsLocationsApisVersionsDeleteCall {
6096 c.urlParams_.Set("force", fmt.Sprint(force))
6097 return c
6098 }
6099
6100
6101
6102
6103 func (c *ProjectsLocationsApisVersionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsDeleteCall {
6104 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6105 return c
6106 }
6107
6108
6109 func (c *ProjectsLocationsApisVersionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsDeleteCall {
6110 c.ctx_ = ctx
6111 return c
6112 }
6113
6114
6115
6116 func (c *ProjectsLocationsApisVersionsDeleteCall) Header() http.Header {
6117 if c.header_ == nil {
6118 c.header_ = make(http.Header)
6119 }
6120 return c.header_
6121 }
6122
6123 func (c *ProjectsLocationsApisVersionsDeleteCall) doRequest(alt string) (*http.Response, error) {
6124 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6125 var body io.Reader = nil
6126 c.urlParams_.Set("alt", alt)
6127 c.urlParams_.Set("prettyPrint", "false")
6128 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
6129 urls += "?" + c.urlParams_.Encode()
6130 req, err := http.NewRequest("DELETE", urls, body)
6131 if err != nil {
6132 return nil, err
6133 }
6134 req.Header = reqHeaders
6135 googleapi.Expand(req.URL, map[string]string{
6136 "name": c.name,
6137 })
6138 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6139 }
6140
6141
6142
6143
6144
6145
6146 func (c *ProjectsLocationsApisVersionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
6147 gensupport.SetOptions(c.urlParams_, opts...)
6148 res, err := c.doRequest("json")
6149 if res != nil && res.StatusCode == http.StatusNotModified {
6150 if res.Body != nil {
6151 res.Body.Close()
6152 }
6153 return nil, gensupport.WrapError(&googleapi.Error{
6154 Code: res.StatusCode,
6155 Header: res.Header,
6156 })
6157 }
6158 if err != nil {
6159 return nil, err
6160 }
6161 defer googleapi.CloseBody(res)
6162 if err := googleapi.CheckResponse(res); err != nil {
6163 return nil, gensupport.WrapError(err)
6164 }
6165 ret := &Empty{
6166 ServerResponse: googleapi.ServerResponse{
6167 Header: res.Header,
6168 HTTPStatusCode: res.StatusCode,
6169 },
6170 }
6171 target := &ret
6172 if err := gensupport.DecodeResponse(target, res); err != nil {
6173 return nil, err
6174 }
6175 return ret, nil
6176 }
6177
6178 type ProjectsLocationsApisVersionsGetCall struct {
6179 s *Service
6180 name string
6181 urlParams_ gensupport.URLParams
6182 ifNoneMatch_ string
6183 ctx_ context.Context
6184 header_ http.Header
6185 }
6186
6187
6188
6189
6190
6191 func (r *ProjectsLocationsApisVersionsService) Get(name string) *ProjectsLocationsApisVersionsGetCall {
6192 c := &ProjectsLocationsApisVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6193 c.name = name
6194 return c
6195 }
6196
6197
6198
6199
6200 func (c *ProjectsLocationsApisVersionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsGetCall {
6201 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6202 return c
6203 }
6204
6205
6206
6207
6208 func (c *ProjectsLocationsApisVersionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsGetCall {
6209 c.ifNoneMatch_ = entityTag
6210 return c
6211 }
6212
6213
6214 func (c *ProjectsLocationsApisVersionsGetCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsGetCall {
6215 c.ctx_ = ctx
6216 return c
6217 }
6218
6219
6220
6221 func (c *ProjectsLocationsApisVersionsGetCall) Header() http.Header {
6222 if c.header_ == nil {
6223 c.header_ = make(http.Header)
6224 }
6225 return c.header_
6226 }
6227
6228 func (c *ProjectsLocationsApisVersionsGetCall) doRequest(alt string) (*http.Response, error) {
6229 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6230 if c.ifNoneMatch_ != "" {
6231 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6232 }
6233 var body io.Reader = nil
6234 c.urlParams_.Set("alt", alt)
6235 c.urlParams_.Set("prettyPrint", "false")
6236 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
6237 urls += "?" + c.urlParams_.Encode()
6238 req, err := http.NewRequest("GET", urls, body)
6239 if err != nil {
6240 return nil, err
6241 }
6242 req.Header = reqHeaders
6243 googleapi.Expand(req.URL, map[string]string{
6244 "name": c.name,
6245 })
6246 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6247 }
6248
6249
6250
6251
6252
6253
6254 func (c *ProjectsLocationsApisVersionsGetCall) Do(opts ...googleapi.CallOption) (*ApiVersion, error) {
6255 gensupport.SetOptions(c.urlParams_, opts...)
6256 res, err := c.doRequest("json")
6257 if res != nil && res.StatusCode == http.StatusNotModified {
6258 if res.Body != nil {
6259 res.Body.Close()
6260 }
6261 return nil, gensupport.WrapError(&googleapi.Error{
6262 Code: res.StatusCode,
6263 Header: res.Header,
6264 })
6265 }
6266 if err != nil {
6267 return nil, err
6268 }
6269 defer googleapi.CloseBody(res)
6270 if err := googleapi.CheckResponse(res); err != nil {
6271 return nil, gensupport.WrapError(err)
6272 }
6273 ret := &ApiVersion{
6274 ServerResponse: googleapi.ServerResponse{
6275 Header: res.Header,
6276 HTTPStatusCode: res.StatusCode,
6277 },
6278 }
6279 target := &ret
6280 if err := gensupport.DecodeResponse(target, res); err != nil {
6281 return nil, err
6282 }
6283 return ret, nil
6284 }
6285
6286 type ProjectsLocationsApisVersionsGetIamPolicyCall struct {
6287 s *Service
6288 resource string
6289 urlParams_ gensupport.URLParams
6290 ifNoneMatch_ string
6291 ctx_ context.Context
6292 header_ http.Header
6293 }
6294
6295
6296
6297
6298
6299
6300
6301 func (r *ProjectsLocationsApisVersionsService) GetIamPolicy(resource string) *ProjectsLocationsApisVersionsGetIamPolicyCall {
6302 c := &ProjectsLocationsApisVersionsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6303 c.resource = resource
6304 return c
6305 }
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319 func (c *ProjectsLocationsApisVersionsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsApisVersionsGetIamPolicyCall {
6320 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
6321 return c
6322 }
6323
6324
6325
6326
6327 func (c *ProjectsLocationsApisVersionsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsGetIamPolicyCall {
6328 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6329 return c
6330 }
6331
6332
6333
6334
6335 func (c *ProjectsLocationsApisVersionsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsGetIamPolicyCall {
6336 c.ifNoneMatch_ = entityTag
6337 return c
6338 }
6339
6340
6341 func (c *ProjectsLocationsApisVersionsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsGetIamPolicyCall {
6342 c.ctx_ = ctx
6343 return c
6344 }
6345
6346
6347
6348 func (c *ProjectsLocationsApisVersionsGetIamPolicyCall) Header() http.Header {
6349 if c.header_ == nil {
6350 c.header_ = make(http.Header)
6351 }
6352 return c.header_
6353 }
6354
6355 func (c *ProjectsLocationsApisVersionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
6356 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6357 if c.ifNoneMatch_ != "" {
6358 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6359 }
6360 var body io.Reader = nil
6361 c.urlParams_.Set("alt", alt)
6362 c.urlParams_.Set("prettyPrint", "false")
6363 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
6364 urls += "?" + c.urlParams_.Encode()
6365 req, err := http.NewRequest("GET", urls, body)
6366 if err != nil {
6367 return nil, err
6368 }
6369 req.Header = reqHeaders
6370 googleapi.Expand(req.URL, map[string]string{
6371 "resource": c.resource,
6372 })
6373 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6374 }
6375
6376
6377
6378
6379
6380
6381 func (c *ProjectsLocationsApisVersionsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
6382 gensupport.SetOptions(c.urlParams_, opts...)
6383 res, err := c.doRequest("json")
6384 if res != nil && res.StatusCode == http.StatusNotModified {
6385 if res.Body != nil {
6386 res.Body.Close()
6387 }
6388 return nil, gensupport.WrapError(&googleapi.Error{
6389 Code: res.StatusCode,
6390 Header: res.Header,
6391 })
6392 }
6393 if err != nil {
6394 return nil, err
6395 }
6396 defer googleapi.CloseBody(res)
6397 if err := googleapi.CheckResponse(res); err != nil {
6398 return nil, gensupport.WrapError(err)
6399 }
6400 ret := &Policy{
6401 ServerResponse: googleapi.ServerResponse{
6402 Header: res.Header,
6403 HTTPStatusCode: res.StatusCode,
6404 },
6405 }
6406 target := &ret
6407 if err := gensupport.DecodeResponse(target, res); err != nil {
6408 return nil, err
6409 }
6410 return ret, nil
6411 }
6412
6413 type ProjectsLocationsApisVersionsListCall struct {
6414 s *Service
6415 parent string
6416 urlParams_ gensupport.URLParams
6417 ifNoneMatch_ string
6418 ctx_ context.Context
6419 header_ http.Header
6420 }
6421
6422
6423
6424
6425
6426 func (r *ProjectsLocationsApisVersionsService) List(parent string) *ProjectsLocationsApisVersionsListCall {
6427 c := &ProjectsLocationsApisVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6428 c.parent = parent
6429 return c
6430 }
6431
6432
6433
6434
6435 func (c *ProjectsLocationsApisVersionsListCall) Filter(filter string) *ProjectsLocationsApisVersionsListCall {
6436 c.urlParams_.Set("filter", filter)
6437 return c
6438 }
6439
6440
6441
6442
6443 func (c *ProjectsLocationsApisVersionsListCall) OrderBy(orderBy string) *ProjectsLocationsApisVersionsListCall {
6444 c.urlParams_.Set("orderBy", orderBy)
6445 return c
6446 }
6447
6448
6449
6450
6451
6452 func (c *ProjectsLocationsApisVersionsListCall) PageSize(pageSize int64) *ProjectsLocationsApisVersionsListCall {
6453 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6454 return c
6455 }
6456
6457
6458
6459
6460
6461 func (c *ProjectsLocationsApisVersionsListCall) PageToken(pageToken string) *ProjectsLocationsApisVersionsListCall {
6462 c.urlParams_.Set("pageToken", pageToken)
6463 return c
6464 }
6465
6466
6467
6468
6469 func (c *ProjectsLocationsApisVersionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsListCall {
6470 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6471 return c
6472 }
6473
6474
6475
6476
6477 func (c *ProjectsLocationsApisVersionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsListCall {
6478 c.ifNoneMatch_ = entityTag
6479 return c
6480 }
6481
6482
6483 func (c *ProjectsLocationsApisVersionsListCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsListCall {
6484 c.ctx_ = ctx
6485 return c
6486 }
6487
6488
6489
6490 func (c *ProjectsLocationsApisVersionsListCall) Header() http.Header {
6491 if c.header_ == nil {
6492 c.header_ = make(http.Header)
6493 }
6494 return c.header_
6495 }
6496
6497 func (c *ProjectsLocationsApisVersionsListCall) doRequest(alt string) (*http.Response, error) {
6498 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6499 if c.ifNoneMatch_ != "" {
6500 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6501 }
6502 var body io.Reader = nil
6503 c.urlParams_.Set("alt", alt)
6504 c.urlParams_.Set("prettyPrint", "false")
6505 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions")
6506 urls += "?" + c.urlParams_.Encode()
6507 req, err := http.NewRequest("GET", urls, body)
6508 if err != nil {
6509 return nil, err
6510 }
6511 req.Header = reqHeaders
6512 googleapi.Expand(req.URL, map[string]string{
6513 "parent": c.parent,
6514 })
6515 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6516 }
6517
6518
6519
6520
6521
6522
6523
6524 func (c *ProjectsLocationsApisVersionsListCall) Do(opts ...googleapi.CallOption) (*ListApiVersionsResponse, error) {
6525 gensupport.SetOptions(c.urlParams_, opts...)
6526 res, err := c.doRequest("json")
6527 if res != nil && res.StatusCode == http.StatusNotModified {
6528 if res.Body != nil {
6529 res.Body.Close()
6530 }
6531 return nil, gensupport.WrapError(&googleapi.Error{
6532 Code: res.StatusCode,
6533 Header: res.Header,
6534 })
6535 }
6536 if err != nil {
6537 return nil, err
6538 }
6539 defer googleapi.CloseBody(res)
6540 if err := googleapi.CheckResponse(res); err != nil {
6541 return nil, gensupport.WrapError(err)
6542 }
6543 ret := &ListApiVersionsResponse{
6544 ServerResponse: googleapi.ServerResponse{
6545 Header: res.Header,
6546 HTTPStatusCode: res.StatusCode,
6547 },
6548 }
6549 target := &ret
6550 if err := gensupport.DecodeResponse(target, res); err != nil {
6551 return nil, err
6552 }
6553 return ret, nil
6554 }
6555
6556
6557
6558
6559 func (c *ProjectsLocationsApisVersionsListCall) Pages(ctx context.Context, f func(*ListApiVersionsResponse) error) error {
6560 c.ctx_ = ctx
6561 defer c.PageToken(c.urlParams_.Get("pageToken"))
6562 for {
6563 x, err := c.Do()
6564 if err != nil {
6565 return err
6566 }
6567 if err := f(x); err != nil {
6568 return err
6569 }
6570 if x.NextPageToken == "" {
6571 return nil
6572 }
6573 c.PageToken(x.NextPageToken)
6574 }
6575 }
6576
6577 type ProjectsLocationsApisVersionsPatchCall struct {
6578 s *Service
6579 name string
6580 apiversion *ApiVersion
6581 urlParams_ gensupport.URLParams
6582 ctx_ context.Context
6583 header_ http.Header
6584 }
6585
6586
6587
6588
6589 func (r *ProjectsLocationsApisVersionsService) Patch(name string, apiversion *ApiVersion) *ProjectsLocationsApisVersionsPatchCall {
6590 c := &ProjectsLocationsApisVersionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6591 c.name = name
6592 c.apiversion = apiversion
6593 return c
6594 }
6595
6596
6597
6598
6599 func (c *ProjectsLocationsApisVersionsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsApisVersionsPatchCall {
6600 c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing))
6601 return c
6602 }
6603
6604
6605
6606
6607
6608
6609 func (c *ProjectsLocationsApisVersionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsApisVersionsPatchCall {
6610 c.urlParams_.Set("updateMask", updateMask)
6611 return c
6612 }
6613
6614
6615
6616
6617 func (c *ProjectsLocationsApisVersionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsPatchCall {
6618 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6619 return c
6620 }
6621
6622
6623 func (c *ProjectsLocationsApisVersionsPatchCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsPatchCall {
6624 c.ctx_ = ctx
6625 return c
6626 }
6627
6628
6629
6630 func (c *ProjectsLocationsApisVersionsPatchCall) Header() http.Header {
6631 if c.header_ == nil {
6632 c.header_ = make(http.Header)
6633 }
6634 return c.header_
6635 }
6636
6637 func (c *ProjectsLocationsApisVersionsPatchCall) doRequest(alt string) (*http.Response, error) {
6638 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6639 var body io.Reader = nil
6640 body, err := googleapi.WithoutDataWrapper.JSONReader(c.apiversion)
6641 if err != nil {
6642 return nil, err
6643 }
6644 c.urlParams_.Set("alt", alt)
6645 c.urlParams_.Set("prettyPrint", "false")
6646 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
6647 urls += "?" + c.urlParams_.Encode()
6648 req, err := http.NewRequest("PATCH", urls, body)
6649 if err != nil {
6650 return nil, err
6651 }
6652 req.Header = reqHeaders
6653 googleapi.Expand(req.URL, map[string]string{
6654 "name": c.name,
6655 })
6656 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6657 }
6658
6659
6660
6661
6662
6663
6664 func (c *ProjectsLocationsApisVersionsPatchCall) Do(opts ...googleapi.CallOption) (*ApiVersion, error) {
6665 gensupport.SetOptions(c.urlParams_, opts...)
6666 res, err := c.doRequest("json")
6667 if res != nil && res.StatusCode == http.StatusNotModified {
6668 if res.Body != nil {
6669 res.Body.Close()
6670 }
6671 return nil, gensupport.WrapError(&googleapi.Error{
6672 Code: res.StatusCode,
6673 Header: res.Header,
6674 })
6675 }
6676 if err != nil {
6677 return nil, err
6678 }
6679 defer googleapi.CloseBody(res)
6680 if err := googleapi.CheckResponse(res); err != nil {
6681 return nil, gensupport.WrapError(err)
6682 }
6683 ret := &ApiVersion{
6684 ServerResponse: googleapi.ServerResponse{
6685 Header: res.Header,
6686 HTTPStatusCode: res.StatusCode,
6687 },
6688 }
6689 target := &ret
6690 if err := gensupport.DecodeResponse(target, res); err != nil {
6691 return nil, err
6692 }
6693 return ret, nil
6694 }
6695
6696 type ProjectsLocationsApisVersionsSetIamPolicyCall struct {
6697 s *Service
6698 resource string
6699 setiampolicyrequest *SetIamPolicyRequest
6700 urlParams_ gensupport.URLParams
6701 ctx_ context.Context
6702 header_ http.Header
6703 }
6704
6705
6706
6707
6708
6709
6710
6711
6712 func (r *ProjectsLocationsApisVersionsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsApisVersionsSetIamPolicyCall {
6713 c := &ProjectsLocationsApisVersionsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6714 c.resource = resource
6715 c.setiampolicyrequest = setiampolicyrequest
6716 return c
6717 }
6718
6719
6720
6721
6722 func (c *ProjectsLocationsApisVersionsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSetIamPolicyCall {
6723 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6724 return c
6725 }
6726
6727
6728 func (c *ProjectsLocationsApisVersionsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSetIamPolicyCall {
6729 c.ctx_ = ctx
6730 return c
6731 }
6732
6733
6734
6735 func (c *ProjectsLocationsApisVersionsSetIamPolicyCall) Header() http.Header {
6736 if c.header_ == nil {
6737 c.header_ = make(http.Header)
6738 }
6739 return c.header_
6740 }
6741
6742 func (c *ProjectsLocationsApisVersionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
6743 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6744 var body io.Reader = nil
6745 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
6746 if err != nil {
6747 return nil, err
6748 }
6749 c.urlParams_.Set("alt", alt)
6750 c.urlParams_.Set("prettyPrint", "false")
6751 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
6752 urls += "?" + c.urlParams_.Encode()
6753 req, err := http.NewRequest("POST", urls, body)
6754 if err != nil {
6755 return nil, err
6756 }
6757 req.Header = reqHeaders
6758 googleapi.Expand(req.URL, map[string]string{
6759 "resource": c.resource,
6760 })
6761 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6762 }
6763
6764
6765
6766
6767
6768
6769 func (c *ProjectsLocationsApisVersionsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
6770 gensupport.SetOptions(c.urlParams_, opts...)
6771 res, err := c.doRequest("json")
6772 if res != nil && res.StatusCode == http.StatusNotModified {
6773 if res.Body != nil {
6774 res.Body.Close()
6775 }
6776 return nil, gensupport.WrapError(&googleapi.Error{
6777 Code: res.StatusCode,
6778 Header: res.Header,
6779 })
6780 }
6781 if err != nil {
6782 return nil, err
6783 }
6784 defer googleapi.CloseBody(res)
6785 if err := googleapi.CheckResponse(res); err != nil {
6786 return nil, gensupport.WrapError(err)
6787 }
6788 ret := &Policy{
6789 ServerResponse: googleapi.ServerResponse{
6790 Header: res.Header,
6791 HTTPStatusCode: res.StatusCode,
6792 },
6793 }
6794 target := &ret
6795 if err := gensupport.DecodeResponse(target, res); err != nil {
6796 return nil, err
6797 }
6798 return ret, nil
6799 }
6800
6801 type ProjectsLocationsApisVersionsTestIamPermissionsCall struct {
6802 s *Service
6803 resource string
6804 testiampermissionsrequest *TestIamPermissionsRequest
6805 urlParams_ gensupport.URLParams
6806 ctx_ context.Context
6807 header_ http.Header
6808 }
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820 func (r *ProjectsLocationsApisVersionsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsApisVersionsTestIamPermissionsCall {
6821 c := &ProjectsLocationsApisVersionsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6822 c.resource = resource
6823 c.testiampermissionsrequest = testiampermissionsrequest
6824 return c
6825 }
6826
6827
6828
6829
6830 func (c *ProjectsLocationsApisVersionsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsTestIamPermissionsCall {
6831 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6832 return c
6833 }
6834
6835
6836 func (c *ProjectsLocationsApisVersionsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsTestIamPermissionsCall {
6837 c.ctx_ = ctx
6838 return c
6839 }
6840
6841
6842
6843 func (c *ProjectsLocationsApisVersionsTestIamPermissionsCall) Header() http.Header {
6844 if c.header_ == nil {
6845 c.header_ = make(http.Header)
6846 }
6847 return c.header_
6848 }
6849
6850 func (c *ProjectsLocationsApisVersionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
6851 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6852 var body io.Reader = nil
6853 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
6854 if err != nil {
6855 return nil, err
6856 }
6857 c.urlParams_.Set("alt", alt)
6858 c.urlParams_.Set("prettyPrint", "false")
6859 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
6860 urls += "?" + c.urlParams_.Encode()
6861 req, err := http.NewRequest("POST", urls, body)
6862 if err != nil {
6863 return nil, err
6864 }
6865 req.Header = reqHeaders
6866 googleapi.Expand(req.URL, map[string]string{
6867 "resource": c.resource,
6868 })
6869 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6870 }
6871
6872
6873
6874
6875
6876
6877
6878 func (c *ProjectsLocationsApisVersionsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
6879 gensupport.SetOptions(c.urlParams_, opts...)
6880 res, err := c.doRequest("json")
6881 if res != nil && res.StatusCode == http.StatusNotModified {
6882 if res.Body != nil {
6883 res.Body.Close()
6884 }
6885 return nil, gensupport.WrapError(&googleapi.Error{
6886 Code: res.StatusCode,
6887 Header: res.Header,
6888 })
6889 }
6890 if err != nil {
6891 return nil, err
6892 }
6893 defer googleapi.CloseBody(res)
6894 if err := googleapi.CheckResponse(res); err != nil {
6895 return nil, gensupport.WrapError(err)
6896 }
6897 ret := &TestIamPermissionsResponse{
6898 ServerResponse: googleapi.ServerResponse{
6899 Header: res.Header,
6900 HTTPStatusCode: res.StatusCode,
6901 },
6902 }
6903 target := &ret
6904 if err := gensupport.DecodeResponse(target, res); err != nil {
6905 return nil, err
6906 }
6907 return ret, nil
6908 }
6909
6910 type ProjectsLocationsApisVersionsArtifactsCreateCall struct {
6911 s *Service
6912 parent string
6913 artifact *Artifact
6914 urlParams_ gensupport.URLParams
6915 ctx_ context.Context
6916 header_ http.Header
6917 }
6918
6919
6920
6921
6922
6923 func (r *ProjectsLocationsApisVersionsArtifactsService) Create(parent string, artifact *Artifact) *ProjectsLocationsApisVersionsArtifactsCreateCall {
6924 c := &ProjectsLocationsApisVersionsArtifactsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6925 c.parent = parent
6926 c.artifact = artifact
6927 return c
6928 }
6929
6930
6931
6932
6933
6934 func (c *ProjectsLocationsApisVersionsArtifactsCreateCall) ArtifactId(artifactId string) *ProjectsLocationsApisVersionsArtifactsCreateCall {
6935 c.urlParams_.Set("artifactId", artifactId)
6936 return c
6937 }
6938
6939
6940
6941
6942 func (c *ProjectsLocationsApisVersionsArtifactsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsArtifactsCreateCall {
6943 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6944 return c
6945 }
6946
6947
6948 func (c *ProjectsLocationsApisVersionsArtifactsCreateCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsArtifactsCreateCall {
6949 c.ctx_ = ctx
6950 return c
6951 }
6952
6953
6954
6955 func (c *ProjectsLocationsApisVersionsArtifactsCreateCall) Header() http.Header {
6956 if c.header_ == nil {
6957 c.header_ = make(http.Header)
6958 }
6959 return c.header_
6960 }
6961
6962 func (c *ProjectsLocationsApisVersionsArtifactsCreateCall) doRequest(alt string) (*http.Response, error) {
6963 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6964 var body io.Reader = nil
6965 body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact)
6966 if err != nil {
6967 return nil, err
6968 }
6969 c.urlParams_.Set("alt", alt)
6970 c.urlParams_.Set("prettyPrint", "false")
6971 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
6972 urls += "?" + c.urlParams_.Encode()
6973 req, err := http.NewRequest("POST", urls, body)
6974 if err != nil {
6975 return nil, err
6976 }
6977 req.Header = reqHeaders
6978 googleapi.Expand(req.URL, map[string]string{
6979 "parent": c.parent,
6980 })
6981 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6982 }
6983
6984
6985
6986
6987
6988
6989 func (c *ProjectsLocationsApisVersionsArtifactsCreateCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
6990 gensupport.SetOptions(c.urlParams_, opts...)
6991 res, err := c.doRequest("json")
6992 if res != nil && res.StatusCode == http.StatusNotModified {
6993 if res.Body != nil {
6994 res.Body.Close()
6995 }
6996 return nil, gensupport.WrapError(&googleapi.Error{
6997 Code: res.StatusCode,
6998 Header: res.Header,
6999 })
7000 }
7001 if err != nil {
7002 return nil, err
7003 }
7004 defer googleapi.CloseBody(res)
7005 if err := googleapi.CheckResponse(res); err != nil {
7006 return nil, gensupport.WrapError(err)
7007 }
7008 ret := &Artifact{
7009 ServerResponse: googleapi.ServerResponse{
7010 Header: res.Header,
7011 HTTPStatusCode: res.StatusCode,
7012 },
7013 }
7014 target := &ret
7015 if err := gensupport.DecodeResponse(target, res); err != nil {
7016 return nil, err
7017 }
7018 return ret, nil
7019 }
7020
7021 type ProjectsLocationsApisVersionsArtifactsDeleteCall struct {
7022 s *Service
7023 name string
7024 urlParams_ gensupport.URLParams
7025 ctx_ context.Context
7026 header_ http.Header
7027 }
7028
7029
7030
7031
7032 func (r *ProjectsLocationsApisVersionsArtifactsService) Delete(name string) *ProjectsLocationsApisVersionsArtifactsDeleteCall {
7033 c := &ProjectsLocationsApisVersionsArtifactsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7034 c.name = name
7035 return c
7036 }
7037
7038
7039
7040
7041 func (c *ProjectsLocationsApisVersionsArtifactsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsArtifactsDeleteCall {
7042 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7043 return c
7044 }
7045
7046
7047 func (c *ProjectsLocationsApisVersionsArtifactsDeleteCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsArtifactsDeleteCall {
7048 c.ctx_ = ctx
7049 return c
7050 }
7051
7052
7053
7054 func (c *ProjectsLocationsApisVersionsArtifactsDeleteCall) Header() http.Header {
7055 if c.header_ == nil {
7056 c.header_ = make(http.Header)
7057 }
7058 return c.header_
7059 }
7060
7061 func (c *ProjectsLocationsApisVersionsArtifactsDeleteCall) doRequest(alt string) (*http.Response, error) {
7062 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7063 var body io.Reader = nil
7064 c.urlParams_.Set("alt", alt)
7065 c.urlParams_.Set("prettyPrint", "false")
7066 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7067 urls += "?" + c.urlParams_.Encode()
7068 req, err := http.NewRequest("DELETE", urls, body)
7069 if err != nil {
7070 return nil, err
7071 }
7072 req.Header = reqHeaders
7073 googleapi.Expand(req.URL, map[string]string{
7074 "name": c.name,
7075 })
7076 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7077 }
7078
7079
7080
7081
7082
7083
7084 func (c *ProjectsLocationsApisVersionsArtifactsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
7085 gensupport.SetOptions(c.urlParams_, opts...)
7086 res, err := c.doRequest("json")
7087 if res != nil && res.StatusCode == http.StatusNotModified {
7088 if res.Body != nil {
7089 res.Body.Close()
7090 }
7091 return nil, gensupport.WrapError(&googleapi.Error{
7092 Code: res.StatusCode,
7093 Header: res.Header,
7094 })
7095 }
7096 if err != nil {
7097 return nil, err
7098 }
7099 defer googleapi.CloseBody(res)
7100 if err := googleapi.CheckResponse(res); err != nil {
7101 return nil, gensupport.WrapError(err)
7102 }
7103 ret := &Empty{
7104 ServerResponse: googleapi.ServerResponse{
7105 Header: res.Header,
7106 HTTPStatusCode: res.StatusCode,
7107 },
7108 }
7109 target := &ret
7110 if err := gensupport.DecodeResponse(target, res); err != nil {
7111 return nil, err
7112 }
7113 return ret, nil
7114 }
7115
7116 type ProjectsLocationsApisVersionsArtifactsGetCall struct {
7117 s *Service
7118 name string
7119 urlParams_ gensupport.URLParams
7120 ifNoneMatch_ string
7121 ctx_ context.Context
7122 header_ http.Header
7123 }
7124
7125
7126
7127
7128 func (r *ProjectsLocationsApisVersionsArtifactsService) Get(name string) *ProjectsLocationsApisVersionsArtifactsGetCall {
7129 c := &ProjectsLocationsApisVersionsArtifactsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7130 c.name = name
7131 return c
7132 }
7133
7134
7135
7136
7137 func (c *ProjectsLocationsApisVersionsArtifactsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsArtifactsGetCall {
7138 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7139 return c
7140 }
7141
7142
7143
7144
7145 func (c *ProjectsLocationsApisVersionsArtifactsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsArtifactsGetCall {
7146 c.ifNoneMatch_ = entityTag
7147 return c
7148 }
7149
7150
7151 func (c *ProjectsLocationsApisVersionsArtifactsGetCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsArtifactsGetCall {
7152 c.ctx_ = ctx
7153 return c
7154 }
7155
7156
7157
7158 func (c *ProjectsLocationsApisVersionsArtifactsGetCall) Header() http.Header {
7159 if c.header_ == nil {
7160 c.header_ = make(http.Header)
7161 }
7162 return c.header_
7163 }
7164
7165 func (c *ProjectsLocationsApisVersionsArtifactsGetCall) doRequest(alt string) (*http.Response, error) {
7166 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7167 if c.ifNoneMatch_ != "" {
7168 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7169 }
7170 var body io.Reader = nil
7171 c.urlParams_.Set("alt", alt)
7172 c.urlParams_.Set("prettyPrint", "false")
7173 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7174 urls += "?" + c.urlParams_.Encode()
7175 req, err := http.NewRequest("GET", urls, body)
7176 if err != nil {
7177 return nil, err
7178 }
7179 req.Header = reqHeaders
7180 googleapi.Expand(req.URL, map[string]string{
7181 "name": c.name,
7182 })
7183 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7184 }
7185
7186
7187
7188
7189
7190
7191 func (c *ProjectsLocationsApisVersionsArtifactsGetCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
7192 gensupport.SetOptions(c.urlParams_, opts...)
7193 res, err := c.doRequest("json")
7194 if res != nil && res.StatusCode == http.StatusNotModified {
7195 if res.Body != nil {
7196 res.Body.Close()
7197 }
7198 return nil, gensupport.WrapError(&googleapi.Error{
7199 Code: res.StatusCode,
7200 Header: res.Header,
7201 })
7202 }
7203 if err != nil {
7204 return nil, err
7205 }
7206 defer googleapi.CloseBody(res)
7207 if err := googleapi.CheckResponse(res); err != nil {
7208 return nil, gensupport.WrapError(err)
7209 }
7210 ret := &Artifact{
7211 ServerResponse: googleapi.ServerResponse{
7212 Header: res.Header,
7213 HTTPStatusCode: res.StatusCode,
7214 },
7215 }
7216 target := &ret
7217 if err := gensupport.DecodeResponse(target, res); err != nil {
7218 return nil, err
7219 }
7220 return ret, nil
7221 }
7222
7223 type ProjectsLocationsApisVersionsArtifactsGetContentsCall struct {
7224 s *Service
7225 name string
7226 urlParams_ gensupport.URLParams
7227 ifNoneMatch_ string
7228 ctx_ context.Context
7229 header_ http.Header
7230 }
7231
7232
7233
7234
7235
7236
7237
7238
7239 func (r *ProjectsLocationsApisVersionsArtifactsService) GetContents(name string) *ProjectsLocationsApisVersionsArtifactsGetContentsCall {
7240 c := &ProjectsLocationsApisVersionsArtifactsGetContentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7241 c.name = name
7242 return c
7243 }
7244
7245
7246
7247
7248 func (c *ProjectsLocationsApisVersionsArtifactsGetContentsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsArtifactsGetContentsCall {
7249 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7250 return c
7251 }
7252
7253
7254
7255
7256 func (c *ProjectsLocationsApisVersionsArtifactsGetContentsCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsArtifactsGetContentsCall {
7257 c.ifNoneMatch_ = entityTag
7258 return c
7259 }
7260
7261
7262 func (c *ProjectsLocationsApisVersionsArtifactsGetContentsCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsArtifactsGetContentsCall {
7263 c.ctx_ = ctx
7264 return c
7265 }
7266
7267
7268
7269 func (c *ProjectsLocationsApisVersionsArtifactsGetContentsCall) Header() http.Header {
7270 if c.header_ == nil {
7271 c.header_ = make(http.Header)
7272 }
7273 return c.header_
7274 }
7275
7276 func (c *ProjectsLocationsApisVersionsArtifactsGetContentsCall) doRequest(alt string) (*http.Response, error) {
7277 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7278 if c.ifNoneMatch_ != "" {
7279 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7280 }
7281 var body io.Reader = nil
7282 c.urlParams_.Set("alt", alt)
7283 c.urlParams_.Set("prettyPrint", "false")
7284 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getContents")
7285 urls += "?" + c.urlParams_.Encode()
7286 req, err := http.NewRequest("GET", urls, body)
7287 if err != nil {
7288 return nil, err
7289 }
7290 req.Header = reqHeaders
7291 googleapi.Expand(req.URL, map[string]string{
7292 "name": c.name,
7293 })
7294 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7295 }
7296
7297
7298
7299
7300
7301
7302 func (c *ProjectsLocationsApisVersionsArtifactsGetContentsCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
7303 gensupport.SetOptions(c.urlParams_, opts...)
7304 res, err := c.doRequest("json")
7305 if res != nil && res.StatusCode == http.StatusNotModified {
7306 if res.Body != nil {
7307 res.Body.Close()
7308 }
7309 return nil, gensupport.WrapError(&googleapi.Error{
7310 Code: res.StatusCode,
7311 Header: res.Header,
7312 })
7313 }
7314 if err != nil {
7315 return nil, err
7316 }
7317 defer googleapi.CloseBody(res)
7318 if err := googleapi.CheckResponse(res); err != nil {
7319 return nil, gensupport.WrapError(err)
7320 }
7321 ret := &HttpBody{
7322 ServerResponse: googleapi.ServerResponse{
7323 Header: res.Header,
7324 HTTPStatusCode: res.StatusCode,
7325 },
7326 }
7327 target := &ret
7328 if err := gensupport.DecodeResponse(target, res); err != nil {
7329 return nil, err
7330 }
7331 return ret, nil
7332 }
7333
7334 type ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall struct {
7335 s *Service
7336 resource string
7337 urlParams_ gensupport.URLParams
7338 ifNoneMatch_ string
7339 ctx_ context.Context
7340 header_ http.Header
7341 }
7342
7343
7344
7345
7346
7347
7348
7349 func (r *ProjectsLocationsApisVersionsArtifactsService) GetIamPolicy(resource string) *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall {
7350 c := &ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7351 c.resource = resource
7352 return c
7353 }
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367 func (c *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall {
7368 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
7369 return c
7370 }
7371
7372
7373
7374
7375 func (c *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall {
7376 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7377 return c
7378 }
7379
7380
7381
7382
7383 func (c *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall {
7384 c.ifNoneMatch_ = entityTag
7385 return c
7386 }
7387
7388
7389 func (c *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall {
7390 c.ctx_ = ctx
7391 return c
7392 }
7393
7394
7395
7396 func (c *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall) Header() http.Header {
7397 if c.header_ == nil {
7398 c.header_ = make(http.Header)
7399 }
7400 return c.header_
7401 }
7402
7403 func (c *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
7404 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7405 if c.ifNoneMatch_ != "" {
7406 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7407 }
7408 var body io.Reader = nil
7409 c.urlParams_.Set("alt", alt)
7410 c.urlParams_.Set("prettyPrint", "false")
7411 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
7412 urls += "?" + c.urlParams_.Encode()
7413 req, err := http.NewRequest("GET", urls, body)
7414 if err != nil {
7415 return nil, err
7416 }
7417 req.Header = reqHeaders
7418 googleapi.Expand(req.URL, map[string]string{
7419 "resource": c.resource,
7420 })
7421 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7422 }
7423
7424
7425
7426
7427
7428
7429 func (c *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
7430 gensupport.SetOptions(c.urlParams_, opts...)
7431 res, err := c.doRequest("json")
7432 if res != nil && res.StatusCode == http.StatusNotModified {
7433 if res.Body != nil {
7434 res.Body.Close()
7435 }
7436 return nil, gensupport.WrapError(&googleapi.Error{
7437 Code: res.StatusCode,
7438 Header: res.Header,
7439 })
7440 }
7441 if err != nil {
7442 return nil, err
7443 }
7444 defer googleapi.CloseBody(res)
7445 if err := googleapi.CheckResponse(res); err != nil {
7446 return nil, gensupport.WrapError(err)
7447 }
7448 ret := &Policy{
7449 ServerResponse: googleapi.ServerResponse{
7450 Header: res.Header,
7451 HTTPStatusCode: res.StatusCode,
7452 },
7453 }
7454 target := &ret
7455 if err := gensupport.DecodeResponse(target, res); err != nil {
7456 return nil, err
7457 }
7458 return ret, nil
7459 }
7460
7461 type ProjectsLocationsApisVersionsArtifactsListCall struct {
7462 s *Service
7463 parent string
7464 urlParams_ gensupport.URLParams
7465 ifNoneMatch_ string
7466 ctx_ context.Context
7467 header_ http.Header
7468 }
7469
7470
7471
7472
7473
7474 func (r *ProjectsLocationsApisVersionsArtifactsService) List(parent string) *ProjectsLocationsApisVersionsArtifactsListCall {
7475 c := &ProjectsLocationsApisVersionsArtifactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7476 c.parent = parent
7477 return c
7478 }
7479
7480
7481
7482
7483 func (c *ProjectsLocationsApisVersionsArtifactsListCall) Filter(filter string) *ProjectsLocationsApisVersionsArtifactsListCall {
7484 c.urlParams_.Set("filter", filter)
7485 return c
7486 }
7487
7488
7489
7490
7491 func (c *ProjectsLocationsApisVersionsArtifactsListCall) OrderBy(orderBy string) *ProjectsLocationsApisVersionsArtifactsListCall {
7492 c.urlParams_.Set("orderBy", orderBy)
7493 return c
7494 }
7495
7496
7497
7498
7499
7500 func (c *ProjectsLocationsApisVersionsArtifactsListCall) PageSize(pageSize int64) *ProjectsLocationsApisVersionsArtifactsListCall {
7501 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7502 return c
7503 }
7504
7505
7506
7507
7508
7509 func (c *ProjectsLocationsApisVersionsArtifactsListCall) PageToken(pageToken string) *ProjectsLocationsApisVersionsArtifactsListCall {
7510 c.urlParams_.Set("pageToken", pageToken)
7511 return c
7512 }
7513
7514
7515
7516
7517 func (c *ProjectsLocationsApisVersionsArtifactsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsArtifactsListCall {
7518 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7519 return c
7520 }
7521
7522
7523
7524
7525 func (c *ProjectsLocationsApisVersionsArtifactsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsArtifactsListCall {
7526 c.ifNoneMatch_ = entityTag
7527 return c
7528 }
7529
7530
7531 func (c *ProjectsLocationsApisVersionsArtifactsListCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsArtifactsListCall {
7532 c.ctx_ = ctx
7533 return c
7534 }
7535
7536
7537
7538 func (c *ProjectsLocationsApisVersionsArtifactsListCall) Header() http.Header {
7539 if c.header_ == nil {
7540 c.header_ = make(http.Header)
7541 }
7542 return c.header_
7543 }
7544
7545 func (c *ProjectsLocationsApisVersionsArtifactsListCall) doRequest(alt string) (*http.Response, error) {
7546 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7547 if c.ifNoneMatch_ != "" {
7548 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7549 }
7550 var body io.Reader = nil
7551 c.urlParams_.Set("alt", alt)
7552 c.urlParams_.Set("prettyPrint", "false")
7553 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
7554 urls += "?" + c.urlParams_.Encode()
7555 req, err := http.NewRequest("GET", urls, body)
7556 if err != nil {
7557 return nil, err
7558 }
7559 req.Header = reqHeaders
7560 googleapi.Expand(req.URL, map[string]string{
7561 "parent": c.parent,
7562 })
7563 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7564 }
7565
7566
7567
7568
7569
7570
7571
7572 func (c *ProjectsLocationsApisVersionsArtifactsListCall) Do(opts ...googleapi.CallOption) (*ListArtifactsResponse, error) {
7573 gensupport.SetOptions(c.urlParams_, opts...)
7574 res, err := c.doRequest("json")
7575 if res != nil && res.StatusCode == http.StatusNotModified {
7576 if res.Body != nil {
7577 res.Body.Close()
7578 }
7579 return nil, gensupport.WrapError(&googleapi.Error{
7580 Code: res.StatusCode,
7581 Header: res.Header,
7582 })
7583 }
7584 if err != nil {
7585 return nil, err
7586 }
7587 defer googleapi.CloseBody(res)
7588 if err := googleapi.CheckResponse(res); err != nil {
7589 return nil, gensupport.WrapError(err)
7590 }
7591 ret := &ListArtifactsResponse{
7592 ServerResponse: googleapi.ServerResponse{
7593 Header: res.Header,
7594 HTTPStatusCode: res.StatusCode,
7595 },
7596 }
7597 target := &ret
7598 if err := gensupport.DecodeResponse(target, res); err != nil {
7599 return nil, err
7600 }
7601 return ret, nil
7602 }
7603
7604
7605
7606
7607 func (c *ProjectsLocationsApisVersionsArtifactsListCall) Pages(ctx context.Context, f func(*ListArtifactsResponse) error) error {
7608 c.ctx_ = ctx
7609 defer c.PageToken(c.urlParams_.Get("pageToken"))
7610 for {
7611 x, err := c.Do()
7612 if err != nil {
7613 return err
7614 }
7615 if err := f(x); err != nil {
7616 return err
7617 }
7618 if x.NextPageToken == "" {
7619 return nil
7620 }
7621 c.PageToken(x.NextPageToken)
7622 }
7623 }
7624
7625 type ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall struct {
7626 s *Service
7627 name string
7628 artifact *Artifact
7629 urlParams_ gensupport.URLParams
7630 ctx_ context.Context
7631 header_ http.Header
7632 }
7633
7634
7635
7636
7637 func (r *ProjectsLocationsApisVersionsArtifactsService) ReplaceArtifact(name string, artifact *Artifact) *ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall {
7638 c := &ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7639 c.name = name
7640 c.artifact = artifact
7641 return c
7642 }
7643
7644
7645
7646
7647 func (c *ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall {
7648 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7649 return c
7650 }
7651
7652
7653 func (c *ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall {
7654 c.ctx_ = ctx
7655 return c
7656 }
7657
7658
7659
7660 func (c *ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall) Header() http.Header {
7661 if c.header_ == nil {
7662 c.header_ = make(http.Header)
7663 }
7664 return c.header_
7665 }
7666
7667 func (c *ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall) doRequest(alt string) (*http.Response, error) {
7668 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7669 var body io.Reader = nil
7670 body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact)
7671 if err != nil {
7672 return nil, err
7673 }
7674 c.urlParams_.Set("alt", alt)
7675 c.urlParams_.Set("prettyPrint", "false")
7676 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7677 urls += "?" + c.urlParams_.Encode()
7678 req, err := http.NewRequest("PUT", urls, body)
7679 if err != nil {
7680 return nil, err
7681 }
7682 req.Header = reqHeaders
7683 googleapi.Expand(req.URL, map[string]string{
7684 "name": c.name,
7685 })
7686 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7687 }
7688
7689
7690
7691
7692
7693
7694 func (c *ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
7695 gensupport.SetOptions(c.urlParams_, opts...)
7696 res, err := c.doRequest("json")
7697 if res != nil && res.StatusCode == http.StatusNotModified {
7698 if res.Body != nil {
7699 res.Body.Close()
7700 }
7701 return nil, gensupport.WrapError(&googleapi.Error{
7702 Code: res.StatusCode,
7703 Header: res.Header,
7704 })
7705 }
7706 if err != nil {
7707 return nil, err
7708 }
7709 defer googleapi.CloseBody(res)
7710 if err := googleapi.CheckResponse(res); err != nil {
7711 return nil, gensupport.WrapError(err)
7712 }
7713 ret := &Artifact{
7714 ServerResponse: googleapi.ServerResponse{
7715 Header: res.Header,
7716 HTTPStatusCode: res.StatusCode,
7717 },
7718 }
7719 target := &ret
7720 if err := gensupport.DecodeResponse(target, res); err != nil {
7721 return nil, err
7722 }
7723 return ret, nil
7724 }
7725
7726 type ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall struct {
7727 s *Service
7728 resource string
7729 setiampolicyrequest *SetIamPolicyRequest
7730 urlParams_ gensupport.URLParams
7731 ctx_ context.Context
7732 header_ http.Header
7733 }
7734
7735
7736
7737
7738
7739
7740
7741
7742 func (r *ProjectsLocationsApisVersionsArtifactsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall {
7743 c := &ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7744 c.resource = resource
7745 c.setiampolicyrequest = setiampolicyrequest
7746 return c
7747 }
7748
7749
7750
7751
7752 func (c *ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall {
7753 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7754 return c
7755 }
7756
7757
7758 func (c *ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall {
7759 c.ctx_ = ctx
7760 return c
7761 }
7762
7763
7764
7765 func (c *ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall) Header() http.Header {
7766 if c.header_ == nil {
7767 c.header_ = make(http.Header)
7768 }
7769 return c.header_
7770 }
7771
7772 func (c *ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
7773 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7774 var body io.Reader = nil
7775 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
7776 if err != nil {
7777 return nil, err
7778 }
7779 c.urlParams_.Set("alt", alt)
7780 c.urlParams_.Set("prettyPrint", "false")
7781 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
7782 urls += "?" + c.urlParams_.Encode()
7783 req, err := http.NewRequest("POST", urls, body)
7784 if err != nil {
7785 return nil, err
7786 }
7787 req.Header = reqHeaders
7788 googleapi.Expand(req.URL, map[string]string{
7789 "resource": c.resource,
7790 })
7791 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7792 }
7793
7794
7795
7796
7797
7798
7799 func (c *ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
7800 gensupport.SetOptions(c.urlParams_, opts...)
7801 res, err := c.doRequest("json")
7802 if res != nil && res.StatusCode == http.StatusNotModified {
7803 if res.Body != nil {
7804 res.Body.Close()
7805 }
7806 return nil, gensupport.WrapError(&googleapi.Error{
7807 Code: res.StatusCode,
7808 Header: res.Header,
7809 })
7810 }
7811 if err != nil {
7812 return nil, err
7813 }
7814 defer googleapi.CloseBody(res)
7815 if err := googleapi.CheckResponse(res); err != nil {
7816 return nil, gensupport.WrapError(err)
7817 }
7818 ret := &Policy{
7819 ServerResponse: googleapi.ServerResponse{
7820 Header: res.Header,
7821 HTTPStatusCode: res.StatusCode,
7822 },
7823 }
7824 target := &ret
7825 if err := gensupport.DecodeResponse(target, res); err != nil {
7826 return nil, err
7827 }
7828 return ret, nil
7829 }
7830
7831 type ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall struct {
7832 s *Service
7833 resource string
7834 testiampermissionsrequest *TestIamPermissionsRequest
7835 urlParams_ gensupport.URLParams
7836 ctx_ context.Context
7837 header_ http.Header
7838 }
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850 func (r *ProjectsLocationsApisVersionsArtifactsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall {
7851 c := &ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7852 c.resource = resource
7853 c.testiampermissionsrequest = testiampermissionsrequest
7854 return c
7855 }
7856
7857
7858
7859
7860 func (c *ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall {
7861 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7862 return c
7863 }
7864
7865
7866 func (c *ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall {
7867 c.ctx_ = ctx
7868 return c
7869 }
7870
7871
7872
7873 func (c *ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall) Header() http.Header {
7874 if c.header_ == nil {
7875 c.header_ = make(http.Header)
7876 }
7877 return c.header_
7878 }
7879
7880 func (c *ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
7881 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7882 var body io.Reader = nil
7883 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
7884 if err != nil {
7885 return nil, err
7886 }
7887 c.urlParams_.Set("alt", alt)
7888 c.urlParams_.Set("prettyPrint", "false")
7889 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
7890 urls += "?" + c.urlParams_.Encode()
7891 req, err := http.NewRequest("POST", urls, body)
7892 if err != nil {
7893 return nil, err
7894 }
7895 req.Header = reqHeaders
7896 googleapi.Expand(req.URL, map[string]string{
7897 "resource": c.resource,
7898 })
7899 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7900 }
7901
7902
7903
7904
7905
7906
7907
7908 func (c *ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
7909 gensupport.SetOptions(c.urlParams_, opts...)
7910 res, err := c.doRequest("json")
7911 if res != nil && res.StatusCode == http.StatusNotModified {
7912 if res.Body != nil {
7913 res.Body.Close()
7914 }
7915 return nil, gensupport.WrapError(&googleapi.Error{
7916 Code: res.StatusCode,
7917 Header: res.Header,
7918 })
7919 }
7920 if err != nil {
7921 return nil, err
7922 }
7923 defer googleapi.CloseBody(res)
7924 if err := googleapi.CheckResponse(res); err != nil {
7925 return nil, gensupport.WrapError(err)
7926 }
7927 ret := &TestIamPermissionsResponse{
7928 ServerResponse: googleapi.ServerResponse{
7929 Header: res.Header,
7930 HTTPStatusCode: res.StatusCode,
7931 },
7932 }
7933 target := &ret
7934 if err := gensupport.DecodeResponse(target, res); err != nil {
7935 return nil, err
7936 }
7937 return ret, nil
7938 }
7939
7940 type ProjectsLocationsApisVersionsSpecsCreateCall struct {
7941 s *Service
7942 parent string
7943 apispec *ApiSpec
7944 urlParams_ gensupport.URLParams
7945 ctx_ context.Context
7946 header_ http.Header
7947 }
7948
7949
7950
7951
7952
7953 func (r *ProjectsLocationsApisVersionsSpecsService) Create(parent string, apispec *ApiSpec) *ProjectsLocationsApisVersionsSpecsCreateCall {
7954 c := &ProjectsLocationsApisVersionsSpecsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7955 c.parent = parent
7956 c.apispec = apispec
7957 return c
7958 }
7959
7960
7961
7962
7963
7964 func (c *ProjectsLocationsApisVersionsSpecsCreateCall) ApiSpecId(apiSpecId string) *ProjectsLocationsApisVersionsSpecsCreateCall {
7965 c.urlParams_.Set("apiSpecId", apiSpecId)
7966 return c
7967 }
7968
7969
7970
7971
7972 func (c *ProjectsLocationsApisVersionsSpecsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsCreateCall {
7973 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7974 return c
7975 }
7976
7977
7978 func (c *ProjectsLocationsApisVersionsSpecsCreateCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsCreateCall {
7979 c.ctx_ = ctx
7980 return c
7981 }
7982
7983
7984
7985 func (c *ProjectsLocationsApisVersionsSpecsCreateCall) Header() http.Header {
7986 if c.header_ == nil {
7987 c.header_ = make(http.Header)
7988 }
7989 return c.header_
7990 }
7991
7992 func (c *ProjectsLocationsApisVersionsSpecsCreateCall) doRequest(alt string) (*http.Response, error) {
7993 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7994 var body io.Reader = nil
7995 body, err := googleapi.WithoutDataWrapper.JSONReader(c.apispec)
7996 if err != nil {
7997 return nil, err
7998 }
7999 c.urlParams_.Set("alt", alt)
8000 c.urlParams_.Set("prettyPrint", "false")
8001 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/specs")
8002 urls += "?" + c.urlParams_.Encode()
8003 req, err := http.NewRequest("POST", urls, body)
8004 if err != nil {
8005 return nil, err
8006 }
8007 req.Header = reqHeaders
8008 googleapi.Expand(req.URL, map[string]string{
8009 "parent": c.parent,
8010 })
8011 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8012 }
8013
8014
8015
8016
8017
8018
8019 func (c *ProjectsLocationsApisVersionsSpecsCreateCall) Do(opts ...googleapi.CallOption) (*ApiSpec, error) {
8020 gensupport.SetOptions(c.urlParams_, opts...)
8021 res, err := c.doRequest("json")
8022 if res != nil && res.StatusCode == http.StatusNotModified {
8023 if res.Body != nil {
8024 res.Body.Close()
8025 }
8026 return nil, gensupport.WrapError(&googleapi.Error{
8027 Code: res.StatusCode,
8028 Header: res.Header,
8029 })
8030 }
8031 if err != nil {
8032 return nil, err
8033 }
8034 defer googleapi.CloseBody(res)
8035 if err := googleapi.CheckResponse(res); err != nil {
8036 return nil, gensupport.WrapError(err)
8037 }
8038 ret := &ApiSpec{
8039 ServerResponse: googleapi.ServerResponse{
8040 Header: res.Header,
8041 HTTPStatusCode: res.StatusCode,
8042 },
8043 }
8044 target := &ret
8045 if err := gensupport.DecodeResponse(target, res); err != nil {
8046 return nil, err
8047 }
8048 return ret, nil
8049 }
8050
8051 type ProjectsLocationsApisVersionsSpecsDeleteCall struct {
8052 s *Service
8053 name string
8054 urlParams_ gensupport.URLParams
8055 ctx_ context.Context
8056 header_ http.Header
8057 }
8058
8059
8060
8061
8062
8063
8064 func (r *ProjectsLocationsApisVersionsSpecsService) Delete(name string) *ProjectsLocationsApisVersionsSpecsDeleteCall {
8065 c := &ProjectsLocationsApisVersionsSpecsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8066 c.name = name
8067 return c
8068 }
8069
8070
8071
8072
8073 func (c *ProjectsLocationsApisVersionsSpecsDeleteCall) Force(force bool) *ProjectsLocationsApisVersionsSpecsDeleteCall {
8074 c.urlParams_.Set("force", fmt.Sprint(force))
8075 return c
8076 }
8077
8078
8079
8080
8081 func (c *ProjectsLocationsApisVersionsSpecsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsDeleteCall {
8082 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8083 return c
8084 }
8085
8086
8087 func (c *ProjectsLocationsApisVersionsSpecsDeleteCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsDeleteCall {
8088 c.ctx_ = ctx
8089 return c
8090 }
8091
8092
8093
8094 func (c *ProjectsLocationsApisVersionsSpecsDeleteCall) Header() http.Header {
8095 if c.header_ == nil {
8096 c.header_ = make(http.Header)
8097 }
8098 return c.header_
8099 }
8100
8101 func (c *ProjectsLocationsApisVersionsSpecsDeleteCall) doRequest(alt string) (*http.Response, error) {
8102 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8103 var body io.Reader = nil
8104 c.urlParams_.Set("alt", alt)
8105 c.urlParams_.Set("prettyPrint", "false")
8106 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
8107 urls += "?" + c.urlParams_.Encode()
8108 req, err := http.NewRequest("DELETE", urls, body)
8109 if err != nil {
8110 return nil, err
8111 }
8112 req.Header = reqHeaders
8113 googleapi.Expand(req.URL, map[string]string{
8114 "name": c.name,
8115 })
8116 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8117 }
8118
8119
8120
8121
8122
8123
8124 func (c *ProjectsLocationsApisVersionsSpecsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
8125 gensupport.SetOptions(c.urlParams_, opts...)
8126 res, err := c.doRequest("json")
8127 if res != nil && res.StatusCode == http.StatusNotModified {
8128 if res.Body != nil {
8129 res.Body.Close()
8130 }
8131 return nil, gensupport.WrapError(&googleapi.Error{
8132 Code: res.StatusCode,
8133 Header: res.Header,
8134 })
8135 }
8136 if err != nil {
8137 return nil, err
8138 }
8139 defer googleapi.CloseBody(res)
8140 if err := googleapi.CheckResponse(res); err != nil {
8141 return nil, gensupport.WrapError(err)
8142 }
8143 ret := &Empty{
8144 ServerResponse: googleapi.ServerResponse{
8145 Header: res.Header,
8146 HTTPStatusCode: res.StatusCode,
8147 },
8148 }
8149 target := &ret
8150 if err := gensupport.DecodeResponse(target, res); err != nil {
8151 return nil, err
8152 }
8153 return ret, nil
8154 }
8155
8156 type ProjectsLocationsApisVersionsSpecsDeleteRevisionCall struct {
8157 s *Service
8158 name string
8159 urlParams_ gensupport.URLParams
8160 ctx_ context.Context
8161 header_ http.Header
8162 }
8163
8164
8165
8166
8167
8168
8169
8170 func (r *ProjectsLocationsApisVersionsSpecsService) DeleteRevision(name string) *ProjectsLocationsApisVersionsSpecsDeleteRevisionCall {
8171 c := &ProjectsLocationsApisVersionsSpecsDeleteRevisionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8172 c.name = name
8173 return c
8174 }
8175
8176
8177
8178
8179 func (c *ProjectsLocationsApisVersionsSpecsDeleteRevisionCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsDeleteRevisionCall {
8180 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8181 return c
8182 }
8183
8184
8185 func (c *ProjectsLocationsApisVersionsSpecsDeleteRevisionCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsDeleteRevisionCall {
8186 c.ctx_ = ctx
8187 return c
8188 }
8189
8190
8191
8192 func (c *ProjectsLocationsApisVersionsSpecsDeleteRevisionCall) Header() http.Header {
8193 if c.header_ == nil {
8194 c.header_ = make(http.Header)
8195 }
8196 return c.header_
8197 }
8198
8199 func (c *ProjectsLocationsApisVersionsSpecsDeleteRevisionCall) doRequest(alt string) (*http.Response, error) {
8200 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8201 var body io.Reader = nil
8202 c.urlParams_.Set("alt", alt)
8203 c.urlParams_.Set("prettyPrint", "false")
8204 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:deleteRevision")
8205 urls += "?" + c.urlParams_.Encode()
8206 req, err := http.NewRequest("DELETE", urls, body)
8207 if err != nil {
8208 return nil, err
8209 }
8210 req.Header = reqHeaders
8211 googleapi.Expand(req.URL, map[string]string{
8212 "name": c.name,
8213 })
8214 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8215 }
8216
8217
8218
8219
8220
8221
8222 func (c *ProjectsLocationsApisVersionsSpecsDeleteRevisionCall) Do(opts ...googleapi.CallOption) (*ApiSpec, error) {
8223 gensupport.SetOptions(c.urlParams_, opts...)
8224 res, err := c.doRequest("json")
8225 if res != nil && res.StatusCode == http.StatusNotModified {
8226 if res.Body != nil {
8227 res.Body.Close()
8228 }
8229 return nil, gensupport.WrapError(&googleapi.Error{
8230 Code: res.StatusCode,
8231 Header: res.Header,
8232 })
8233 }
8234 if err != nil {
8235 return nil, err
8236 }
8237 defer googleapi.CloseBody(res)
8238 if err := googleapi.CheckResponse(res); err != nil {
8239 return nil, gensupport.WrapError(err)
8240 }
8241 ret := &ApiSpec{
8242 ServerResponse: googleapi.ServerResponse{
8243 Header: res.Header,
8244 HTTPStatusCode: res.StatusCode,
8245 },
8246 }
8247 target := &ret
8248 if err := gensupport.DecodeResponse(target, res); err != nil {
8249 return nil, err
8250 }
8251 return ret, nil
8252 }
8253
8254 type ProjectsLocationsApisVersionsSpecsGetCall struct {
8255 s *Service
8256 name string
8257 urlParams_ gensupport.URLParams
8258 ifNoneMatch_ string
8259 ctx_ context.Context
8260 header_ http.Header
8261 }
8262
8263
8264
8265
8266
8267 func (r *ProjectsLocationsApisVersionsSpecsService) Get(name string) *ProjectsLocationsApisVersionsSpecsGetCall {
8268 c := &ProjectsLocationsApisVersionsSpecsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8269 c.name = name
8270 return c
8271 }
8272
8273
8274
8275
8276 func (c *ProjectsLocationsApisVersionsSpecsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsGetCall {
8277 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8278 return c
8279 }
8280
8281
8282
8283
8284 func (c *ProjectsLocationsApisVersionsSpecsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsSpecsGetCall {
8285 c.ifNoneMatch_ = entityTag
8286 return c
8287 }
8288
8289
8290 func (c *ProjectsLocationsApisVersionsSpecsGetCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsGetCall {
8291 c.ctx_ = ctx
8292 return c
8293 }
8294
8295
8296
8297 func (c *ProjectsLocationsApisVersionsSpecsGetCall) Header() http.Header {
8298 if c.header_ == nil {
8299 c.header_ = make(http.Header)
8300 }
8301 return c.header_
8302 }
8303
8304 func (c *ProjectsLocationsApisVersionsSpecsGetCall) doRequest(alt string) (*http.Response, error) {
8305 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8306 if c.ifNoneMatch_ != "" {
8307 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8308 }
8309 var body io.Reader = nil
8310 c.urlParams_.Set("alt", alt)
8311 c.urlParams_.Set("prettyPrint", "false")
8312 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
8313 urls += "?" + c.urlParams_.Encode()
8314 req, err := http.NewRequest("GET", urls, body)
8315 if err != nil {
8316 return nil, err
8317 }
8318 req.Header = reqHeaders
8319 googleapi.Expand(req.URL, map[string]string{
8320 "name": c.name,
8321 })
8322 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8323 }
8324
8325
8326
8327
8328
8329
8330 func (c *ProjectsLocationsApisVersionsSpecsGetCall) Do(opts ...googleapi.CallOption) (*ApiSpec, error) {
8331 gensupport.SetOptions(c.urlParams_, opts...)
8332 res, err := c.doRequest("json")
8333 if res != nil && res.StatusCode == http.StatusNotModified {
8334 if res.Body != nil {
8335 res.Body.Close()
8336 }
8337 return nil, gensupport.WrapError(&googleapi.Error{
8338 Code: res.StatusCode,
8339 Header: res.Header,
8340 })
8341 }
8342 if err != nil {
8343 return nil, err
8344 }
8345 defer googleapi.CloseBody(res)
8346 if err := googleapi.CheckResponse(res); err != nil {
8347 return nil, gensupport.WrapError(err)
8348 }
8349 ret := &ApiSpec{
8350 ServerResponse: googleapi.ServerResponse{
8351 Header: res.Header,
8352 HTTPStatusCode: res.StatusCode,
8353 },
8354 }
8355 target := &ret
8356 if err := gensupport.DecodeResponse(target, res); err != nil {
8357 return nil, err
8358 }
8359 return ret, nil
8360 }
8361
8362 type ProjectsLocationsApisVersionsSpecsGetContentsCall struct {
8363 s *Service
8364 name string
8365 urlParams_ gensupport.URLParams
8366 ifNoneMatch_ string
8367 ctx_ context.Context
8368 header_ http.Header
8369 }
8370
8371
8372
8373
8374
8375
8376
8377
8378 func (r *ProjectsLocationsApisVersionsSpecsService) GetContents(name string) *ProjectsLocationsApisVersionsSpecsGetContentsCall {
8379 c := &ProjectsLocationsApisVersionsSpecsGetContentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8380 c.name = name
8381 return c
8382 }
8383
8384
8385
8386
8387 func (c *ProjectsLocationsApisVersionsSpecsGetContentsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsGetContentsCall {
8388 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8389 return c
8390 }
8391
8392
8393
8394
8395 func (c *ProjectsLocationsApisVersionsSpecsGetContentsCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsSpecsGetContentsCall {
8396 c.ifNoneMatch_ = entityTag
8397 return c
8398 }
8399
8400
8401 func (c *ProjectsLocationsApisVersionsSpecsGetContentsCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsGetContentsCall {
8402 c.ctx_ = ctx
8403 return c
8404 }
8405
8406
8407
8408 func (c *ProjectsLocationsApisVersionsSpecsGetContentsCall) Header() http.Header {
8409 if c.header_ == nil {
8410 c.header_ = make(http.Header)
8411 }
8412 return c.header_
8413 }
8414
8415 func (c *ProjectsLocationsApisVersionsSpecsGetContentsCall) doRequest(alt string) (*http.Response, error) {
8416 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8417 if c.ifNoneMatch_ != "" {
8418 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8419 }
8420 var body io.Reader = nil
8421 c.urlParams_.Set("alt", alt)
8422 c.urlParams_.Set("prettyPrint", "false")
8423 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getContents")
8424 urls += "?" + c.urlParams_.Encode()
8425 req, err := http.NewRequest("GET", urls, body)
8426 if err != nil {
8427 return nil, err
8428 }
8429 req.Header = reqHeaders
8430 googleapi.Expand(req.URL, map[string]string{
8431 "name": c.name,
8432 })
8433 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8434 }
8435
8436
8437
8438
8439
8440
8441 func (c *ProjectsLocationsApisVersionsSpecsGetContentsCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
8442 gensupport.SetOptions(c.urlParams_, opts...)
8443 res, err := c.doRequest("json")
8444 if res != nil && res.StatusCode == http.StatusNotModified {
8445 if res.Body != nil {
8446 res.Body.Close()
8447 }
8448 return nil, gensupport.WrapError(&googleapi.Error{
8449 Code: res.StatusCode,
8450 Header: res.Header,
8451 })
8452 }
8453 if err != nil {
8454 return nil, err
8455 }
8456 defer googleapi.CloseBody(res)
8457 if err := googleapi.CheckResponse(res); err != nil {
8458 return nil, gensupport.WrapError(err)
8459 }
8460 ret := &HttpBody{
8461 ServerResponse: googleapi.ServerResponse{
8462 Header: res.Header,
8463 HTTPStatusCode: res.StatusCode,
8464 },
8465 }
8466 target := &ret
8467 if err := gensupport.DecodeResponse(target, res); err != nil {
8468 return nil, err
8469 }
8470 return ret, nil
8471 }
8472
8473 type ProjectsLocationsApisVersionsSpecsGetIamPolicyCall struct {
8474 s *Service
8475 resource string
8476 urlParams_ gensupport.URLParams
8477 ifNoneMatch_ string
8478 ctx_ context.Context
8479 header_ http.Header
8480 }
8481
8482
8483
8484
8485
8486
8487
8488 func (r *ProjectsLocationsApisVersionsSpecsService) GetIamPolicy(resource string) *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall {
8489 c := &ProjectsLocationsApisVersionsSpecsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8490 c.resource = resource
8491 return c
8492 }
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506 func (c *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall {
8507 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
8508 return c
8509 }
8510
8511
8512
8513
8514 func (c *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall {
8515 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8516 return c
8517 }
8518
8519
8520
8521
8522 func (c *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall {
8523 c.ifNoneMatch_ = entityTag
8524 return c
8525 }
8526
8527
8528 func (c *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall {
8529 c.ctx_ = ctx
8530 return c
8531 }
8532
8533
8534
8535 func (c *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall) Header() http.Header {
8536 if c.header_ == nil {
8537 c.header_ = make(http.Header)
8538 }
8539 return c.header_
8540 }
8541
8542 func (c *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
8543 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8544 if c.ifNoneMatch_ != "" {
8545 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8546 }
8547 var body io.Reader = nil
8548 c.urlParams_.Set("alt", alt)
8549 c.urlParams_.Set("prettyPrint", "false")
8550 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
8551 urls += "?" + c.urlParams_.Encode()
8552 req, err := http.NewRequest("GET", urls, body)
8553 if err != nil {
8554 return nil, err
8555 }
8556 req.Header = reqHeaders
8557 googleapi.Expand(req.URL, map[string]string{
8558 "resource": c.resource,
8559 })
8560 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8561 }
8562
8563
8564
8565
8566
8567
8568 func (c *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
8569 gensupport.SetOptions(c.urlParams_, opts...)
8570 res, err := c.doRequest("json")
8571 if res != nil && res.StatusCode == http.StatusNotModified {
8572 if res.Body != nil {
8573 res.Body.Close()
8574 }
8575 return nil, gensupport.WrapError(&googleapi.Error{
8576 Code: res.StatusCode,
8577 Header: res.Header,
8578 })
8579 }
8580 if err != nil {
8581 return nil, err
8582 }
8583 defer googleapi.CloseBody(res)
8584 if err := googleapi.CheckResponse(res); err != nil {
8585 return nil, gensupport.WrapError(err)
8586 }
8587 ret := &Policy{
8588 ServerResponse: googleapi.ServerResponse{
8589 Header: res.Header,
8590 HTTPStatusCode: res.StatusCode,
8591 },
8592 }
8593 target := &ret
8594 if err := gensupport.DecodeResponse(target, res); err != nil {
8595 return nil, err
8596 }
8597 return ret, nil
8598 }
8599
8600 type ProjectsLocationsApisVersionsSpecsListCall struct {
8601 s *Service
8602 parent string
8603 urlParams_ gensupport.URLParams
8604 ifNoneMatch_ string
8605 ctx_ context.Context
8606 header_ http.Header
8607 }
8608
8609
8610
8611
8612
8613 func (r *ProjectsLocationsApisVersionsSpecsService) List(parent string) *ProjectsLocationsApisVersionsSpecsListCall {
8614 c := &ProjectsLocationsApisVersionsSpecsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8615 c.parent = parent
8616 return c
8617 }
8618
8619
8620
8621
8622 func (c *ProjectsLocationsApisVersionsSpecsListCall) Filter(filter string) *ProjectsLocationsApisVersionsSpecsListCall {
8623 c.urlParams_.Set("filter", filter)
8624 return c
8625 }
8626
8627
8628
8629
8630 func (c *ProjectsLocationsApisVersionsSpecsListCall) OrderBy(orderBy string) *ProjectsLocationsApisVersionsSpecsListCall {
8631 c.urlParams_.Set("orderBy", orderBy)
8632 return c
8633 }
8634
8635
8636
8637
8638
8639 func (c *ProjectsLocationsApisVersionsSpecsListCall) PageSize(pageSize int64) *ProjectsLocationsApisVersionsSpecsListCall {
8640 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8641 return c
8642 }
8643
8644
8645
8646
8647
8648 func (c *ProjectsLocationsApisVersionsSpecsListCall) PageToken(pageToken string) *ProjectsLocationsApisVersionsSpecsListCall {
8649 c.urlParams_.Set("pageToken", pageToken)
8650 return c
8651 }
8652
8653
8654
8655
8656 func (c *ProjectsLocationsApisVersionsSpecsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsListCall {
8657 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8658 return c
8659 }
8660
8661
8662
8663
8664 func (c *ProjectsLocationsApisVersionsSpecsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsSpecsListCall {
8665 c.ifNoneMatch_ = entityTag
8666 return c
8667 }
8668
8669
8670 func (c *ProjectsLocationsApisVersionsSpecsListCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsListCall {
8671 c.ctx_ = ctx
8672 return c
8673 }
8674
8675
8676
8677 func (c *ProjectsLocationsApisVersionsSpecsListCall) Header() http.Header {
8678 if c.header_ == nil {
8679 c.header_ = make(http.Header)
8680 }
8681 return c.header_
8682 }
8683
8684 func (c *ProjectsLocationsApisVersionsSpecsListCall) doRequest(alt string) (*http.Response, error) {
8685 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8686 if c.ifNoneMatch_ != "" {
8687 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8688 }
8689 var body io.Reader = nil
8690 c.urlParams_.Set("alt", alt)
8691 c.urlParams_.Set("prettyPrint", "false")
8692 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/specs")
8693 urls += "?" + c.urlParams_.Encode()
8694 req, err := http.NewRequest("GET", urls, body)
8695 if err != nil {
8696 return nil, err
8697 }
8698 req.Header = reqHeaders
8699 googleapi.Expand(req.URL, map[string]string{
8700 "parent": c.parent,
8701 })
8702 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8703 }
8704
8705
8706
8707
8708
8709
8710
8711 func (c *ProjectsLocationsApisVersionsSpecsListCall) Do(opts ...googleapi.CallOption) (*ListApiSpecsResponse, error) {
8712 gensupport.SetOptions(c.urlParams_, opts...)
8713 res, err := c.doRequest("json")
8714 if res != nil && res.StatusCode == http.StatusNotModified {
8715 if res.Body != nil {
8716 res.Body.Close()
8717 }
8718 return nil, gensupport.WrapError(&googleapi.Error{
8719 Code: res.StatusCode,
8720 Header: res.Header,
8721 })
8722 }
8723 if err != nil {
8724 return nil, err
8725 }
8726 defer googleapi.CloseBody(res)
8727 if err := googleapi.CheckResponse(res); err != nil {
8728 return nil, gensupport.WrapError(err)
8729 }
8730 ret := &ListApiSpecsResponse{
8731 ServerResponse: googleapi.ServerResponse{
8732 Header: res.Header,
8733 HTTPStatusCode: res.StatusCode,
8734 },
8735 }
8736 target := &ret
8737 if err := gensupport.DecodeResponse(target, res); err != nil {
8738 return nil, err
8739 }
8740 return ret, nil
8741 }
8742
8743
8744
8745
8746 func (c *ProjectsLocationsApisVersionsSpecsListCall) Pages(ctx context.Context, f func(*ListApiSpecsResponse) error) error {
8747 c.ctx_ = ctx
8748 defer c.PageToken(c.urlParams_.Get("pageToken"))
8749 for {
8750 x, err := c.Do()
8751 if err != nil {
8752 return err
8753 }
8754 if err := f(x); err != nil {
8755 return err
8756 }
8757 if x.NextPageToken == "" {
8758 return nil
8759 }
8760 c.PageToken(x.NextPageToken)
8761 }
8762 }
8763
8764 type ProjectsLocationsApisVersionsSpecsListRevisionsCall struct {
8765 s *Service
8766 name string
8767 urlParams_ gensupport.URLParams
8768 ifNoneMatch_ string
8769 ctx_ context.Context
8770 header_ http.Header
8771 }
8772
8773
8774
8775
8776
8777 func (r *ProjectsLocationsApisVersionsSpecsService) ListRevisions(name string) *ProjectsLocationsApisVersionsSpecsListRevisionsCall {
8778 c := &ProjectsLocationsApisVersionsSpecsListRevisionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8779 c.name = name
8780 return c
8781 }
8782
8783
8784
8785
8786 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) Filter(filter string) *ProjectsLocationsApisVersionsSpecsListRevisionsCall {
8787 c.urlParams_.Set("filter", filter)
8788 return c
8789 }
8790
8791
8792
8793 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) PageSize(pageSize int64) *ProjectsLocationsApisVersionsSpecsListRevisionsCall {
8794 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8795 return c
8796 }
8797
8798
8799
8800
8801 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) PageToken(pageToken string) *ProjectsLocationsApisVersionsSpecsListRevisionsCall {
8802 c.urlParams_.Set("pageToken", pageToken)
8803 return c
8804 }
8805
8806
8807
8808
8809 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsListRevisionsCall {
8810 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8811 return c
8812 }
8813
8814
8815
8816
8817 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsSpecsListRevisionsCall {
8818 c.ifNoneMatch_ = entityTag
8819 return c
8820 }
8821
8822
8823 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsListRevisionsCall {
8824 c.ctx_ = ctx
8825 return c
8826 }
8827
8828
8829
8830 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) Header() http.Header {
8831 if c.header_ == nil {
8832 c.header_ = make(http.Header)
8833 }
8834 return c.header_
8835 }
8836
8837 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) doRequest(alt string) (*http.Response, error) {
8838 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8839 if c.ifNoneMatch_ != "" {
8840 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8841 }
8842 var body io.Reader = nil
8843 c.urlParams_.Set("alt", alt)
8844 c.urlParams_.Set("prettyPrint", "false")
8845 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:listRevisions")
8846 urls += "?" + c.urlParams_.Encode()
8847 req, err := http.NewRequest("GET", urls, body)
8848 if err != nil {
8849 return nil, err
8850 }
8851 req.Header = reqHeaders
8852 googleapi.Expand(req.URL, map[string]string{
8853 "name": c.name,
8854 })
8855 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8856 }
8857
8858
8859
8860
8861
8862
8863
8864 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) Do(opts ...googleapi.CallOption) (*ListApiSpecRevisionsResponse, error) {
8865 gensupport.SetOptions(c.urlParams_, opts...)
8866 res, err := c.doRequest("json")
8867 if res != nil && res.StatusCode == http.StatusNotModified {
8868 if res.Body != nil {
8869 res.Body.Close()
8870 }
8871 return nil, gensupport.WrapError(&googleapi.Error{
8872 Code: res.StatusCode,
8873 Header: res.Header,
8874 })
8875 }
8876 if err != nil {
8877 return nil, err
8878 }
8879 defer googleapi.CloseBody(res)
8880 if err := googleapi.CheckResponse(res); err != nil {
8881 return nil, gensupport.WrapError(err)
8882 }
8883 ret := &ListApiSpecRevisionsResponse{
8884 ServerResponse: googleapi.ServerResponse{
8885 Header: res.Header,
8886 HTTPStatusCode: res.StatusCode,
8887 },
8888 }
8889 target := &ret
8890 if err := gensupport.DecodeResponse(target, res); err != nil {
8891 return nil, err
8892 }
8893 return ret, nil
8894 }
8895
8896
8897
8898
8899 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) Pages(ctx context.Context, f func(*ListApiSpecRevisionsResponse) error) error {
8900 c.ctx_ = ctx
8901 defer c.PageToken(c.urlParams_.Get("pageToken"))
8902 for {
8903 x, err := c.Do()
8904 if err != nil {
8905 return err
8906 }
8907 if err := f(x); err != nil {
8908 return err
8909 }
8910 if x.NextPageToken == "" {
8911 return nil
8912 }
8913 c.PageToken(x.NextPageToken)
8914 }
8915 }
8916
8917 type ProjectsLocationsApisVersionsSpecsPatchCall struct {
8918 s *Service
8919 name string
8920 apispec *ApiSpec
8921 urlParams_ gensupport.URLParams
8922 ctx_ context.Context
8923 header_ http.Header
8924 }
8925
8926
8927
8928
8929 func (r *ProjectsLocationsApisVersionsSpecsService) Patch(name string, apispec *ApiSpec) *ProjectsLocationsApisVersionsSpecsPatchCall {
8930 c := &ProjectsLocationsApisVersionsSpecsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8931 c.name = name
8932 c.apispec = apispec
8933 return c
8934 }
8935
8936
8937
8938
8939 func (c *ProjectsLocationsApisVersionsSpecsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsApisVersionsSpecsPatchCall {
8940 c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing))
8941 return c
8942 }
8943
8944
8945
8946
8947
8948
8949 func (c *ProjectsLocationsApisVersionsSpecsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsApisVersionsSpecsPatchCall {
8950 c.urlParams_.Set("updateMask", updateMask)
8951 return c
8952 }
8953
8954
8955
8956
8957 func (c *ProjectsLocationsApisVersionsSpecsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsPatchCall {
8958 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8959 return c
8960 }
8961
8962
8963 func (c *ProjectsLocationsApisVersionsSpecsPatchCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsPatchCall {
8964 c.ctx_ = ctx
8965 return c
8966 }
8967
8968
8969
8970 func (c *ProjectsLocationsApisVersionsSpecsPatchCall) Header() http.Header {
8971 if c.header_ == nil {
8972 c.header_ = make(http.Header)
8973 }
8974 return c.header_
8975 }
8976
8977 func (c *ProjectsLocationsApisVersionsSpecsPatchCall) doRequest(alt string) (*http.Response, error) {
8978 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8979 var body io.Reader = nil
8980 body, err := googleapi.WithoutDataWrapper.JSONReader(c.apispec)
8981 if err != nil {
8982 return nil, err
8983 }
8984 c.urlParams_.Set("alt", alt)
8985 c.urlParams_.Set("prettyPrint", "false")
8986 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
8987 urls += "?" + c.urlParams_.Encode()
8988 req, err := http.NewRequest("PATCH", urls, body)
8989 if err != nil {
8990 return nil, err
8991 }
8992 req.Header = reqHeaders
8993 googleapi.Expand(req.URL, map[string]string{
8994 "name": c.name,
8995 })
8996 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8997 }
8998
8999
9000
9001
9002
9003
9004 func (c *ProjectsLocationsApisVersionsSpecsPatchCall) Do(opts ...googleapi.CallOption) (*ApiSpec, error) {
9005 gensupport.SetOptions(c.urlParams_, opts...)
9006 res, err := c.doRequest("json")
9007 if res != nil && res.StatusCode == http.StatusNotModified {
9008 if res.Body != nil {
9009 res.Body.Close()
9010 }
9011 return nil, gensupport.WrapError(&googleapi.Error{
9012 Code: res.StatusCode,
9013 Header: res.Header,
9014 })
9015 }
9016 if err != nil {
9017 return nil, err
9018 }
9019 defer googleapi.CloseBody(res)
9020 if err := googleapi.CheckResponse(res); err != nil {
9021 return nil, gensupport.WrapError(err)
9022 }
9023 ret := &ApiSpec{
9024 ServerResponse: googleapi.ServerResponse{
9025 Header: res.Header,
9026 HTTPStatusCode: res.StatusCode,
9027 },
9028 }
9029 target := &ret
9030 if err := gensupport.DecodeResponse(target, res); err != nil {
9031 return nil, err
9032 }
9033 return ret, nil
9034 }
9035
9036 type ProjectsLocationsApisVersionsSpecsRollbackCall struct {
9037 s *Service
9038 name string
9039 rollbackapispecrequest *RollbackApiSpecRequest
9040 urlParams_ gensupport.URLParams
9041 ctx_ context.Context
9042 header_ http.Header
9043 }
9044
9045
9046
9047
9048
9049 func (r *ProjectsLocationsApisVersionsSpecsService) Rollback(name string, rollbackapispecrequest *RollbackApiSpecRequest) *ProjectsLocationsApisVersionsSpecsRollbackCall {
9050 c := &ProjectsLocationsApisVersionsSpecsRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9051 c.name = name
9052 c.rollbackapispecrequest = rollbackapispecrequest
9053 return c
9054 }
9055
9056
9057
9058
9059 func (c *ProjectsLocationsApisVersionsSpecsRollbackCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsRollbackCall {
9060 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9061 return c
9062 }
9063
9064
9065 func (c *ProjectsLocationsApisVersionsSpecsRollbackCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsRollbackCall {
9066 c.ctx_ = ctx
9067 return c
9068 }
9069
9070
9071
9072 func (c *ProjectsLocationsApisVersionsSpecsRollbackCall) Header() http.Header {
9073 if c.header_ == nil {
9074 c.header_ = make(http.Header)
9075 }
9076 return c.header_
9077 }
9078
9079 func (c *ProjectsLocationsApisVersionsSpecsRollbackCall) doRequest(alt string) (*http.Response, error) {
9080 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9081 var body io.Reader = nil
9082 body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackapispecrequest)
9083 if err != nil {
9084 return nil, err
9085 }
9086 c.urlParams_.Set("alt", alt)
9087 c.urlParams_.Set("prettyPrint", "false")
9088 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:rollback")
9089 urls += "?" + c.urlParams_.Encode()
9090 req, err := http.NewRequest("POST", urls, body)
9091 if err != nil {
9092 return nil, err
9093 }
9094 req.Header = reqHeaders
9095 googleapi.Expand(req.URL, map[string]string{
9096 "name": c.name,
9097 })
9098 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9099 }
9100
9101
9102
9103
9104
9105
9106 func (c *ProjectsLocationsApisVersionsSpecsRollbackCall) Do(opts ...googleapi.CallOption) (*ApiSpec, error) {
9107 gensupport.SetOptions(c.urlParams_, opts...)
9108 res, err := c.doRequest("json")
9109 if res != nil && res.StatusCode == http.StatusNotModified {
9110 if res.Body != nil {
9111 res.Body.Close()
9112 }
9113 return nil, gensupport.WrapError(&googleapi.Error{
9114 Code: res.StatusCode,
9115 Header: res.Header,
9116 })
9117 }
9118 if err != nil {
9119 return nil, err
9120 }
9121 defer googleapi.CloseBody(res)
9122 if err := googleapi.CheckResponse(res); err != nil {
9123 return nil, gensupport.WrapError(err)
9124 }
9125 ret := &ApiSpec{
9126 ServerResponse: googleapi.ServerResponse{
9127 Header: res.Header,
9128 HTTPStatusCode: res.StatusCode,
9129 },
9130 }
9131 target := &ret
9132 if err := gensupport.DecodeResponse(target, res); err != nil {
9133 return nil, err
9134 }
9135 return ret, nil
9136 }
9137
9138 type ProjectsLocationsApisVersionsSpecsSetIamPolicyCall struct {
9139 s *Service
9140 resource string
9141 setiampolicyrequest *SetIamPolicyRequest
9142 urlParams_ gensupport.URLParams
9143 ctx_ context.Context
9144 header_ http.Header
9145 }
9146
9147
9148
9149
9150
9151
9152
9153
9154 func (r *ProjectsLocationsApisVersionsSpecsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsApisVersionsSpecsSetIamPolicyCall {
9155 c := &ProjectsLocationsApisVersionsSpecsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9156 c.resource = resource
9157 c.setiampolicyrequest = setiampolicyrequest
9158 return c
9159 }
9160
9161
9162
9163
9164 func (c *ProjectsLocationsApisVersionsSpecsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsSetIamPolicyCall {
9165 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9166 return c
9167 }
9168
9169
9170 func (c *ProjectsLocationsApisVersionsSpecsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsSetIamPolicyCall {
9171 c.ctx_ = ctx
9172 return c
9173 }
9174
9175
9176
9177 func (c *ProjectsLocationsApisVersionsSpecsSetIamPolicyCall) Header() http.Header {
9178 if c.header_ == nil {
9179 c.header_ = make(http.Header)
9180 }
9181 return c.header_
9182 }
9183
9184 func (c *ProjectsLocationsApisVersionsSpecsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
9185 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9186 var body io.Reader = nil
9187 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
9188 if err != nil {
9189 return nil, err
9190 }
9191 c.urlParams_.Set("alt", alt)
9192 c.urlParams_.Set("prettyPrint", "false")
9193 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
9194 urls += "?" + c.urlParams_.Encode()
9195 req, err := http.NewRequest("POST", urls, body)
9196 if err != nil {
9197 return nil, err
9198 }
9199 req.Header = reqHeaders
9200 googleapi.Expand(req.URL, map[string]string{
9201 "resource": c.resource,
9202 })
9203 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9204 }
9205
9206
9207
9208
9209
9210
9211 func (c *ProjectsLocationsApisVersionsSpecsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
9212 gensupport.SetOptions(c.urlParams_, opts...)
9213 res, err := c.doRequest("json")
9214 if res != nil && res.StatusCode == http.StatusNotModified {
9215 if res.Body != nil {
9216 res.Body.Close()
9217 }
9218 return nil, gensupport.WrapError(&googleapi.Error{
9219 Code: res.StatusCode,
9220 Header: res.Header,
9221 })
9222 }
9223 if err != nil {
9224 return nil, err
9225 }
9226 defer googleapi.CloseBody(res)
9227 if err := googleapi.CheckResponse(res); err != nil {
9228 return nil, gensupport.WrapError(err)
9229 }
9230 ret := &Policy{
9231 ServerResponse: googleapi.ServerResponse{
9232 Header: res.Header,
9233 HTTPStatusCode: res.StatusCode,
9234 },
9235 }
9236 target := &ret
9237 if err := gensupport.DecodeResponse(target, res); err != nil {
9238 return nil, err
9239 }
9240 return ret, nil
9241 }
9242
9243 type ProjectsLocationsApisVersionsSpecsTagRevisionCall struct {
9244 s *Service
9245 name string
9246 tagapispecrevisionrequest *TagApiSpecRevisionRequest
9247 urlParams_ gensupport.URLParams
9248 ctx_ context.Context
9249 header_ http.Header
9250 }
9251
9252
9253
9254
9255
9256 func (r *ProjectsLocationsApisVersionsSpecsService) TagRevision(name string, tagapispecrevisionrequest *TagApiSpecRevisionRequest) *ProjectsLocationsApisVersionsSpecsTagRevisionCall {
9257 c := &ProjectsLocationsApisVersionsSpecsTagRevisionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9258 c.name = name
9259 c.tagapispecrevisionrequest = tagapispecrevisionrequest
9260 return c
9261 }
9262
9263
9264
9265
9266 func (c *ProjectsLocationsApisVersionsSpecsTagRevisionCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsTagRevisionCall {
9267 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9268 return c
9269 }
9270
9271
9272 func (c *ProjectsLocationsApisVersionsSpecsTagRevisionCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsTagRevisionCall {
9273 c.ctx_ = ctx
9274 return c
9275 }
9276
9277
9278
9279 func (c *ProjectsLocationsApisVersionsSpecsTagRevisionCall) Header() http.Header {
9280 if c.header_ == nil {
9281 c.header_ = make(http.Header)
9282 }
9283 return c.header_
9284 }
9285
9286 func (c *ProjectsLocationsApisVersionsSpecsTagRevisionCall) doRequest(alt string) (*http.Response, error) {
9287 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9288 var body io.Reader = nil
9289 body, err := googleapi.WithoutDataWrapper.JSONReader(c.tagapispecrevisionrequest)
9290 if err != nil {
9291 return nil, err
9292 }
9293 c.urlParams_.Set("alt", alt)
9294 c.urlParams_.Set("prettyPrint", "false")
9295 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:tagRevision")
9296 urls += "?" + c.urlParams_.Encode()
9297 req, err := http.NewRequest("POST", urls, body)
9298 if err != nil {
9299 return nil, err
9300 }
9301 req.Header = reqHeaders
9302 googleapi.Expand(req.URL, map[string]string{
9303 "name": c.name,
9304 })
9305 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9306 }
9307
9308
9309
9310
9311
9312
9313 func (c *ProjectsLocationsApisVersionsSpecsTagRevisionCall) Do(opts ...googleapi.CallOption) (*ApiSpec, error) {
9314 gensupport.SetOptions(c.urlParams_, opts...)
9315 res, err := c.doRequest("json")
9316 if res != nil && res.StatusCode == http.StatusNotModified {
9317 if res.Body != nil {
9318 res.Body.Close()
9319 }
9320 return nil, gensupport.WrapError(&googleapi.Error{
9321 Code: res.StatusCode,
9322 Header: res.Header,
9323 })
9324 }
9325 if err != nil {
9326 return nil, err
9327 }
9328 defer googleapi.CloseBody(res)
9329 if err := googleapi.CheckResponse(res); err != nil {
9330 return nil, gensupport.WrapError(err)
9331 }
9332 ret := &ApiSpec{
9333 ServerResponse: googleapi.ServerResponse{
9334 Header: res.Header,
9335 HTTPStatusCode: res.StatusCode,
9336 },
9337 }
9338 target := &ret
9339 if err := gensupport.DecodeResponse(target, res); err != nil {
9340 return nil, err
9341 }
9342 return ret, nil
9343 }
9344
9345 type ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall struct {
9346 s *Service
9347 resource string
9348 testiampermissionsrequest *TestIamPermissionsRequest
9349 urlParams_ gensupport.URLParams
9350 ctx_ context.Context
9351 header_ http.Header
9352 }
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364 func (r *ProjectsLocationsApisVersionsSpecsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall {
9365 c := &ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9366 c.resource = resource
9367 c.testiampermissionsrequest = testiampermissionsrequest
9368 return c
9369 }
9370
9371
9372
9373
9374 func (c *ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall {
9375 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9376 return c
9377 }
9378
9379
9380 func (c *ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall {
9381 c.ctx_ = ctx
9382 return c
9383 }
9384
9385
9386
9387 func (c *ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall) Header() http.Header {
9388 if c.header_ == nil {
9389 c.header_ = make(http.Header)
9390 }
9391 return c.header_
9392 }
9393
9394 func (c *ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
9395 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9396 var body io.Reader = nil
9397 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
9398 if err != nil {
9399 return nil, err
9400 }
9401 c.urlParams_.Set("alt", alt)
9402 c.urlParams_.Set("prettyPrint", "false")
9403 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
9404 urls += "?" + c.urlParams_.Encode()
9405 req, err := http.NewRequest("POST", urls, body)
9406 if err != nil {
9407 return nil, err
9408 }
9409 req.Header = reqHeaders
9410 googleapi.Expand(req.URL, map[string]string{
9411 "resource": c.resource,
9412 })
9413 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9414 }
9415
9416
9417
9418
9419
9420
9421
9422 func (c *ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
9423 gensupport.SetOptions(c.urlParams_, opts...)
9424 res, err := c.doRequest("json")
9425 if res != nil && res.StatusCode == http.StatusNotModified {
9426 if res.Body != nil {
9427 res.Body.Close()
9428 }
9429 return nil, gensupport.WrapError(&googleapi.Error{
9430 Code: res.StatusCode,
9431 Header: res.Header,
9432 })
9433 }
9434 if err != nil {
9435 return nil, err
9436 }
9437 defer googleapi.CloseBody(res)
9438 if err := googleapi.CheckResponse(res); err != nil {
9439 return nil, gensupport.WrapError(err)
9440 }
9441 ret := &TestIamPermissionsResponse{
9442 ServerResponse: googleapi.ServerResponse{
9443 Header: res.Header,
9444 HTTPStatusCode: res.StatusCode,
9445 },
9446 }
9447 target := &ret
9448 if err := gensupport.DecodeResponse(target, res); err != nil {
9449 return nil, err
9450 }
9451 return ret, nil
9452 }
9453
9454 type ProjectsLocationsApisVersionsSpecsArtifactsCreateCall struct {
9455 s *Service
9456 parent string
9457 artifact *Artifact
9458 urlParams_ gensupport.URLParams
9459 ctx_ context.Context
9460 header_ http.Header
9461 }
9462
9463
9464
9465
9466
9467 func (r *ProjectsLocationsApisVersionsSpecsArtifactsService) Create(parent string, artifact *Artifact) *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall {
9468 c := &ProjectsLocationsApisVersionsSpecsArtifactsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9469 c.parent = parent
9470 c.artifact = artifact
9471 return c
9472 }
9473
9474
9475
9476
9477
9478 func (c *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall) ArtifactId(artifactId string) *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall {
9479 c.urlParams_.Set("artifactId", artifactId)
9480 return c
9481 }
9482
9483
9484
9485
9486 func (c *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall {
9487 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9488 return c
9489 }
9490
9491
9492 func (c *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall {
9493 c.ctx_ = ctx
9494 return c
9495 }
9496
9497
9498
9499 func (c *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall) Header() http.Header {
9500 if c.header_ == nil {
9501 c.header_ = make(http.Header)
9502 }
9503 return c.header_
9504 }
9505
9506 func (c *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall) doRequest(alt string) (*http.Response, error) {
9507 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9508 var body io.Reader = nil
9509 body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact)
9510 if err != nil {
9511 return nil, err
9512 }
9513 c.urlParams_.Set("alt", alt)
9514 c.urlParams_.Set("prettyPrint", "false")
9515 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
9516 urls += "?" + c.urlParams_.Encode()
9517 req, err := http.NewRequest("POST", urls, body)
9518 if err != nil {
9519 return nil, err
9520 }
9521 req.Header = reqHeaders
9522 googleapi.Expand(req.URL, map[string]string{
9523 "parent": c.parent,
9524 })
9525 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9526 }
9527
9528
9529
9530
9531
9532
9533 func (c *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
9534 gensupport.SetOptions(c.urlParams_, opts...)
9535 res, err := c.doRequest("json")
9536 if res != nil && res.StatusCode == http.StatusNotModified {
9537 if res.Body != nil {
9538 res.Body.Close()
9539 }
9540 return nil, gensupport.WrapError(&googleapi.Error{
9541 Code: res.StatusCode,
9542 Header: res.Header,
9543 })
9544 }
9545 if err != nil {
9546 return nil, err
9547 }
9548 defer googleapi.CloseBody(res)
9549 if err := googleapi.CheckResponse(res); err != nil {
9550 return nil, gensupport.WrapError(err)
9551 }
9552 ret := &Artifact{
9553 ServerResponse: googleapi.ServerResponse{
9554 Header: res.Header,
9555 HTTPStatusCode: res.StatusCode,
9556 },
9557 }
9558 target := &ret
9559 if err := gensupport.DecodeResponse(target, res); err != nil {
9560 return nil, err
9561 }
9562 return ret, nil
9563 }
9564
9565 type ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall struct {
9566 s *Service
9567 name string
9568 urlParams_ gensupport.URLParams
9569 ctx_ context.Context
9570 header_ http.Header
9571 }
9572
9573
9574
9575
9576 func (r *ProjectsLocationsApisVersionsSpecsArtifactsService) Delete(name string) *ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall {
9577 c := &ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9578 c.name = name
9579 return c
9580 }
9581
9582
9583
9584
9585 func (c *ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall {
9586 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9587 return c
9588 }
9589
9590
9591 func (c *ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall {
9592 c.ctx_ = ctx
9593 return c
9594 }
9595
9596
9597
9598 func (c *ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall) Header() http.Header {
9599 if c.header_ == nil {
9600 c.header_ = make(http.Header)
9601 }
9602 return c.header_
9603 }
9604
9605 func (c *ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall) doRequest(alt string) (*http.Response, error) {
9606 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9607 var body io.Reader = nil
9608 c.urlParams_.Set("alt", alt)
9609 c.urlParams_.Set("prettyPrint", "false")
9610 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
9611 urls += "?" + c.urlParams_.Encode()
9612 req, err := http.NewRequest("DELETE", urls, body)
9613 if err != nil {
9614 return nil, err
9615 }
9616 req.Header = reqHeaders
9617 googleapi.Expand(req.URL, map[string]string{
9618 "name": c.name,
9619 })
9620 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9621 }
9622
9623
9624
9625
9626
9627
9628 func (c *ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
9629 gensupport.SetOptions(c.urlParams_, opts...)
9630 res, err := c.doRequest("json")
9631 if res != nil && res.StatusCode == http.StatusNotModified {
9632 if res.Body != nil {
9633 res.Body.Close()
9634 }
9635 return nil, gensupport.WrapError(&googleapi.Error{
9636 Code: res.StatusCode,
9637 Header: res.Header,
9638 })
9639 }
9640 if err != nil {
9641 return nil, err
9642 }
9643 defer googleapi.CloseBody(res)
9644 if err := googleapi.CheckResponse(res); err != nil {
9645 return nil, gensupport.WrapError(err)
9646 }
9647 ret := &Empty{
9648 ServerResponse: googleapi.ServerResponse{
9649 Header: res.Header,
9650 HTTPStatusCode: res.StatusCode,
9651 },
9652 }
9653 target := &ret
9654 if err := gensupport.DecodeResponse(target, res); err != nil {
9655 return nil, err
9656 }
9657 return ret, nil
9658 }
9659
9660 type ProjectsLocationsApisVersionsSpecsArtifactsGetCall struct {
9661 s *Service
9662 name string
9663 urlParams_ gensupport.URLParams
9664 ifNoneMatch_ string
9665 ctx_ context.Context
9666 header_ http.Header
9667 }
9668
9669
9670
9671
9672 func (r *ProjectsLocationsApisVersionsSpecsArtifactsService) Get(name string) *ProjectsLocationsApisVersionsSpecsArtifactsGetCall {
9673 c := &ProjectsLocationsApisVersionsSpecsArtifactsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9674 c.name = name
9675 return c
9676 }
9677
9678
9679
9680
9681 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsArtifactsGetCall {
9682 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9683 return c
9684 }
9685
9686
9687
9688
9689 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsSpecsArtifactsGetCall {
9690 c.ifNoneMatch_ = entityTag
9691 return c
9692 }
9693
9694
9695 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsArtifactsGetCall {
9696 c.ctx_ = ctx
9697 return c
9698 }
9699
9700
9701
9702 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetCall) Header() http.Header {
9703 if c.header_ == nil {
9704 c.header_ = make(http.Header)
9705 }
9706 return c.header_
9707 }
9708
9709 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetCall) doRequest(alt string) (*http.Response, error) {
9710 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9711 if c.ifNoneMatch_ != "" {
9712 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9713 }
9714 var body io.Reader = nil
9715 c.urlParams_.Set("alt", alt)
9716 c.urlParams_.Set("prettyPrint", "false")
9717 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
9718 urls += "?" + c.urlParams_.Encode()
9719 req, err := http.NewRequest("GET", urls, body)
9720 if err != nil {
9721 return nil, err
9722 }
9723 req.Header = reqHeaders
9724 googleapi.Expand(req.URL, map[string]string{
9725 "name": c.name,
9726 })
9727 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9728 }
9729
9730
9731
9732
9733
9734
9735 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
9736 gensupport.SetOptions(c.urlParams_, opts...)
9737 res, err := c.doRequest("json")
9738 if res != nil && res.StatusCode == http.StatusNotModified {
9739 if res.Body != nil {
9740 res.Body.Close()
9741 }
9742 return nil, gensupport.WrapError(&googleapi.Error{
9743 Code: res.StatusCode,
9744 Header: res.Header,
9745 })
9746 }
9747 if err != nil {
9748 return nil, err
9749 }
9750 defer googleapi.CloseBody(res)
9751 if err := googleapi.CheckResponse(res); err != nil {
9752 return nil, gensupport.WrapError(err)
9753 }
9754 ret := &Artifact{
9755 ServerResponse: googleapi.ServerResponse{
9756 Header: res.Header,
9757 HTTPStatusCode: res.StatusCode,
9758 },
9759 }
9760 target := &ret
9761 if err := gensupport.DecodeResponse(target, res); err != nil {
9762 return nil, err
9763 }
9764 return ret, nil
9765 }
9766
9767 type ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall struct {
9768 s *Service
9769 name string
9770 urlParams_ gensupport.URLParams
9771 ifNoneMatch_ string
9772 ctx_ context.Context
9773 header_ http.Header
9774 }
9775
9776
9777
9778
9779
9780
9781
9782
9783 func (r *ProjectsLocationsApisVersionsSpecsArtifactsService) GetContents(name string) *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall {
9784 c := &ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9785 c.name = name
9786 return c
9787 }
9788
9789
9790
9791
9792 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall {
9793 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9794 return c
9795 }
9796
9797
9798
9799
9800 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall {
9801 c.ifNoneMatch_ = entityTag
9802 return c
9803 }
9804
9805
9806 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall {
9807 c.ctx_ = ctx
9808 return c
9809 }
9810
9811
9812
9813 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall) Header() http.Header {
9814 if c.header_ == nil {
9815 c.header_ = make(http.Header)
9816 }
9817 return c.header_
9818 }
9819
9820 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall) doRequest(alt string) (*http.Response, error) {
9821 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9822 if c.ifNoneMatch_ != "" {
9823 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9824 }
9825 var body io.Reader = nil
9826 c.urlParams_.Set("alt", alt)
9827 c.urlParams_.Set("prettyPrint", "false")
9828 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getContents")
9829 urls += "?" + c.urlParams_.Encode()
9830 req, err := http.NewRequest("GET", urls, body)
9831 if err != nil {
9832 return nil, err
9833 }
9834 req.Header = reqHeaders
9835 googleapi.Expand(req.URL, map[string]string{
9836 "name": c.name,
9837 })
9838 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9839 }
9840
9841
9842
9843
9844
9845
9846 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
9847 gensupport.SetOptions(c.urlParams_, opts...)
9848 res, err := c.doRequest("json")
9849 if res != nil && res.StatusCode == http.StatusNotModified {
9850 if res.Body != nil {
9851 res.Body.Close()
9852 }
9853 return nil, gensupport.WrapError(&googleapi.Error{
9854 Code: res.StatusCode,
9855 Header: res.Header,
9856 })
9857 }
9858 if err != nil {
9859 return nil, err
9860 }
9861 defer googleapi.CloseBody(res)
9862 if err := googleapi.CheckResponse(res); err != nil {
9863 return nil, gensupport.WrapError(err)
9864 }
9865 ret := &HttpBody{
9866 ServerResponse: googleapi.ServerResponse{
9867 Header: res.Header,
9868 HTTPStatusCode: res.StatusCode,
9869 },
9870 }
9871 target := &ret
9872 if err := gensupport.DecodeResponse(target, res); err != nil {
9873 return nil, err
9874 }
9875 return ret, nil
9876 }
9877
9878 type ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall struct {
9879 s *Service
9880 resource string
9881 urlParams_ gensupport.URLParams
9882 ifNoneMatch_ string
9883 ctx_ context.Context
9884 header_ http.Header
9885 }
9886
9887
9888
9889
9890
9891
9892
9893 func (r *ProjectsLocationsApisVersionsSpecsArtifactsService) GetIamPolicy(resource string) *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall {
9894 c := &ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9895 c.resource = resource
9896 return c
9897 }
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall {
9912 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
9913 return c
9914 }
9915
9916
9917
9918
9919 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall {
9920 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9921 return c
9922 }
9923
9924
9925
9926
9927 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall {
9928 c.ifNoneMatch_ = entityTag
9929 return c
9930 }
9931
9932
9933 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall {
9934 c.ctx_ = ctx
9935 return c
9936 }
9937
9938
9939
9940 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall) Header() http.Header {
9941 if c.header_ == nil {
9942 c.header_ = make(http.Header)
9943 }
9944 return c.header_
9945 }
9946
9947 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
9948 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9949 if c.ifNoneMatch_ != "" {
9950 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9951 }
9952 var body io.Reader = nil
9953 c.urlParams_.Set("alt", alt)
9954 c.urlParams_.Set("prettyPrint", "false")
9955 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
9956 urls += "?" + c.urlParams_.Encode()
9957 req, err := http.NewRequest("GET", urls, body)
9958 if err != nil {
9959 return nil, err
9960 }
9961 req.Header = reqHeaders
9962 googleapi.Expand(req.URL, map[string]string{
9963 "resource": c.resource,
9964 })
9965 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9966 }
9967
9968
9969
9970
9971
9972
9973 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
9974 gensupport.SetOptions(c.urlParams_, opts...)
9975 res, err := c.doRequest("json")
9976 if res != nil && res.StatusCode == http.StatusNotModified {
9977 if res.Body != nil {
9978 res.Body.Close()
9979 }
9980 return nil, gensupport.WrapError(&googleapi.Error{
9981 Code: res.StatusCode,
9982 Header: res.Header,
9983 })
9984 }
9985 if err != nil {
9986 return nil, err
9987 }
9988 defer googleapi.CloseBody(res)
9989 if err := googleapi.CheckResponse(res); err != nil {
9990 return nil, gensupport.WrapError(err)
9991 }
9992 ret := &Policy{
9993 ServerResponse: googleapi.ServerResponse{
9994 Header: res.Header,
9995 HTTPStatusCode: res.StatusCode,
9996 },
9997 }
9998 target := &ret
9999 if err := gensupport.DecodeResponse(target, res); err != nil {
10000 return nil, err
10001 }
10002 return ret, nil
10003 }
10004
10005 type ProjectsLocationsApisVersionsSpecsArtifactsListCall struct {
10006 s *Service
10007 parent string
10008 urlParams_ gensupport.URLParams
10009 ifNoneMatch_ string
10010 ctx_ context.Context
10011 header_ http.Header
10012 }
10013
10014
10015
10016
10017
10018 func (r *ProjectsLocationsApisVersionsSpecsArtifactsService) List(parent string) *ProjectsLocationsApisVersionsSpecsArtifactsListCall {
10019 c := &ProjectsLocationsApisVersionsSpecsArtifactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10020 c.parent = parent
10021 return c
10022 }
10023
10024
10025
10026
10027 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) Filter(filter string) *ProjectsLocationsApisVersionsSpecsArtifactsListCall {
10028 c.urlParams_.Set("filter", filter)
10029 return c
10030 }
10031
10032
10033
10034
10035 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) OrderBy(orderBy string) *ProjectsLocationsApisVersionsSpecsArtifactsListCall {
10036 c.urlParams_.Set("orderBy", orderBy)
10037 return c
10038 }
10039
10040
10041
10042
10043
10044 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) PageSize(pageSize int64) *ProjectsLocationsApisVersionsSpecsArtifactsListCall {
10045 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
10046 return c
10047 }
10048
10049
10050
10051
10052
10053 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) PageToken(pageToken string) *ProjectsLocationsApisVersionsSpecsArtifactsListCall {
10054 c.urlParams_.Set("pageToken", pageToken)
10055 return c
10056 }
10057
10058
10059
10060
10061 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsArtifactsListCall {
10062 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10063 return c
10064 }
10065
10066
10067
10068
10069 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsSpecsArtifactsListCall {
10070 c.ifNoneMatch_ = entityTag
10071 return c
10072 }
10073
10074
10075 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsArtifactsListCall {
10076 c.ctx_ = ctx
10077 return c
10078 }
10079
10080
10081
10082 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) Header() http.Header {
10083 if c.header_ == nil {
10084 c.header_ = make(http.Header)
10085 }
10086 return c.header_
10087 }
10088
10089 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) doRequest(alt string) (*http.Response, error) {
10090 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10091 if c.ifNoneMatch_ != "" {
10092 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10093 }
10094 var body io.Reader = nil
10095 c.urlParams_.Set("alt", alt)
10096 c.urlParams_.Set("prettyPrint", "false")
10097 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
10098 urls += "?" + c.urlParams_.Encode()
10099 req, err := http.NewRequest("GET", urls, body)
10100 if err != nil {
10101 return nil, err
10102 }
10103 req.Header = reqHeaders
10104 googleapi.Expand(req.URL, map[string]string{
10105 "parent": c.parent,
10106 })
10107 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10108 }
10109
10110
10111
10112
10113
10114
10115
10116 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) Do(opts ...googleapi.CallOption) (*ListArtifactsResponse, error) {
10117 gensupport.SetOptions(c.urlParams_, opts...)
10118 res, err := c.doRequest("json")
10119 if res != nil && res.StatusCode == http.StatusNotModified {
10120 if res.Body != nil {
10121 res.Body.Close()
10122 }
10123 return nil, gensupport.WrapError(&googleapi.Error{
10124 Code: res.StatusCode,
10125 Header: res.Header,
10126 })
10127 }
10128 if err != nil {
10129 return nil, err
10130 }
10131 defer googleapi.CloseBody(res)
10132 if err := googleapi.CheckResponse(res); err != nil {
10133 return nil, gensupport.WrapError(err)
10134 }
10135 ret := &ListArtifactsResponse{
10136 ServerResponse: googleapi.ServerResponse{
10137 Header: res.Header,
10138 HTTPStatusCode: res.StatusCode,
10139 },
10140 }
10141 target := &ret
10142 if err := gensupport.DecodeResponse(target, res); err != nil {
10143 return nil, err
10144 }
10145 return ret, nil
10146 }
10147
10148
10149
10150
10151 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) Pages(ctx context.Context, f func(*ListArtifactsResponse) error) error {
10152 c.ctx_ = ctx
10153 defer c.PageToken(c.urlParams_.Get("pageToken"))
10154 for {
10155 x, err := c.Do()
10156 if err != nil {
10157 return err
10158 }
10159 if err := f(x); err != nil {
10160 return err
10161 }
10162 if x.NextPageToken == "" {
10163 return nil
10164 }
10165 c.PageToken(x.NextPageToken)
10166 }
10167 }
10168
10169 type ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall struct {
10170 s *Service
10171 name string
10172 artifact *Artifact
10173 urlParams_ gensupport.URLParams
10174 ctx_ context.Context
10175 header_ http.Header
10176 }
10177
10178
10179
10180
10181 func (r *ProjectsLocationsApisVersionsSpecsArtifactsService) ReplaceArtifact(name string, artifact *Artifact) *ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall {
10182 c := &ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10183 c.name = name
10184 c.artifact = artifact
10185 return c
10186 }
10187
10188
10189
10190
10191 func (c *ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall {
10192 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10193 return c
10194 }
10195
10196
10197 func (c *ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall {
10198 c.ctx_ = ctx
10199 return c
10200 }
10201
10202
10203
10204 func (c *ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall) Header() http.Header {
10205 if c.header_ == nil {
10206 c.header_ = make(http.Header)
10207 }
10208 return c.header_
10209 }
10210
10211 func (c *ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall) doRequest(alt string) (*http.Response, error) {
10212 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10213 var body io.Reader = nil
10214 body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact)
10215 if err != nil {
10216 return nil, err
10217 }
10218 c.urlParams_.Set("alt", alt)
10219 c.urlParams_.Set("prettyPrint", "false")
10220 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
10221 urls += "?" + c.urlParams_.Encode()
10222 req, err := http.NewRequest("PUT", urls, body)
10223 if err != nil {
10224 return nil, err
10225 }
10226 req.Header = reqHeaders
10227 googleapi.Expand(req.URL, map[string]string{
10228 "name": c.name,
10229 })
10230 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10231 }
10232
10233
10234
10235
10236
10237
10238 func (c *ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
10239 gensupport.SetOptions(c.urlParams_, opts...)
10240 res, err := c.doRequest("json")
10241 if res != nil && res.StatusCode == http.StatusNotModified {
10242 if res.Body != nil {
10243 res.Body.Close()
10244 }
10245 return nil, gensupport.WrapError(&googleapi.Error{
10246 Code: res.StatusCode,
10247 Header: res.Header,
10248 })
10249 }
10250 if err != nil {
10251 return nil, err
10252 }
10253 defer googleapi.CloseBody(res)
10254 if err := googleapi.CheckResponse(res); err != nil {
10255 return nil, gensupport.WrapError(err)
10256 }
10257 ret := &Artifact{
10258 ServerResponse: googleapi.ServerResponse{
10259 Header: res.Header,
10260 HTTPStatusCode: res.StatusCode,
10261 },
10262 }
10263 target := &ret
10264 if err := gensupport.DecodeResponse(target, res); err != nil {
10265 return nil, err
10266 }
10267 return ret, nil
10268 }
10269
10270 type ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall struct {
10271 s *Service
10272 resource string
10273 setiampolicyrequest *SetIamPolicyRequest
10274 urlParams_ gensupport.URLParams
10275 ctx_ context.Context
10276 header_ http.Header
10277 }
10278
10279
10280
10281
10282
10283
10284
10285
10286 func (r *ProjectsLocationsApisVersionsSpecsArtifactsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall {
10287 c := &ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10288 c.resource = resource
10289 c.setiampolicyrequest = setiampolicyrequest
10290 return c
10291 }
10292
10293
10294
10295
10296 func (c *ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall {
10297 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10298 return c
10299 }
10300
10301
10302 func (c *ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall {
10303 c.ctx_ = ctx
10304 return c
10305 }
10306
10307
10308
10309 func (c *ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall) Header() http.Header {
10310 if c.header_ == nil {
10311 c.header_ = make(http.Header)
10312 }
10313 return c.header_
10314 }
10315
10316 func (c *ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
10317 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10318 var body io.Reader = nil
10319 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
10320 if err != nil {
10321 return nil, err
10322 }
10323 c.urlParams_.Set("alt", alt)
10324 c.urlParams_.Set("prettyPrint", "false")
10325 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
10326 urls += "?" + c.urlParams_.Encode()
10327 req, err := http.NewRequest("POST", urls, body)
10328 if err != nil {
10329 return nil, err
10330 }
10331 req.Header = reqHeaders
10332 googleapi.Expand(req.URL, map[string]string{
10333 "resource": c.resource,
10334 })
10335 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10336 }
10337
10338
10339
10340
10341
10342
10343 func (c *ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
10344 gensupport.SetOptions(c.urlParams_, opts...)
10345 res, err := c.doRequest("json")
10346 if res != nil && res.StatusCode == http.StatusNotModified {
10347 if res.Body != nil {
10348 res.Body.Close()
10349 }
10350 return nil, gensupport.WrapError(&googleapi.Error{
10351 Code: res.StatusCode,
10352 Header: res.Header,
10353 })
10354 }
10355 if err != nil {
10356 return nil, err
10357 }
10358 defer googleapi.CloseBody(res)
10359 if err := googleapi.CheckResponse(res); err != nil {
10360 return nil, gensupport.WrapError(err)
10361 }
10362 ret := &Policy{
10363 ServerResponse: googleapi.ServerResponse{
10364 Header: res.Header,
10365 HTTPStatusCode: res.StatusCode,
10366 },
10367 }
10368 target := &ret
10369 if err := gensupport.DecodeResponse(target, res); err != nil {
10370 return nil, err
10371 }
10372 return ret, nil
10373 }
10374
10375 type ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall struct {
10376 s *Service
10377 resource string
10378 testiampermissionsrequest *TestIamPermissionsRequest
10379 urlParams_ gensupport.URLParams
10380 ctx_ context.Context
10381 header_ http.Header
10382 }
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394 func (r *ProjectsLocationsApisVersionsSpecsArtifactsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall {
10395 c := &ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10396 c.resource = resource
10397 c.testiampermissionsrequest = testiampermissionsrequest
10398 return c
10399 }
10400
10401
10402
10403
10404 func (c *ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall {
10405 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10406 return c
10407 }
10408
10409
10410 func (c *ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall {
10411 c.ctx_ = ctx
10412 return c
10413 }
10414
10415
10416
10417 func (c *ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall) Header() http.Header {
10418 if c.header_ == nil {
10419 c.header_ = make(http.Header)
10420 }
10421 return c.header_
10422 }
10423
10424 func (c *ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
10425 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10426 var body io.Reader = nil
10427 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
10428 if err != nil {
10429 return nil, err
10430 }
10431 c.urlParams_.Set("alt", alt)
10432 c.urlParams_.Set("prettyPrint", "false")
10433 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
10434 urls += "?" + c.urlParams_.Encode()
10435 req, err := http.NewRequest("POST", urls, body)
10436 if err != nil {
10437 return nil, err
10438 }
10439 req.Header = reqHeaders
10440 googleapi.Expand(req.URL, map[string]string{
10441 "resource": c.resource,
10442 })
10443 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10444 }
10445
10446
10447
10448
10449
10450
10451
10452 func (c *ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
10453 gensupport.SetOptions(c.urlParams_, opts...)
10454 res, err := c.doRequest("json")
10455 if res != nil && res.StatusCode == http.StatusNotModified {
10456 if res.Body != nil {
10457 res.Body.Close()
10458 }
10459 return nil, gensupport.WrapError(&googleapi.Error{
10460 Code: res.StatusCode,
10461 Header: res.Header,
10462 })
10463 }
10464 if err != nil {
10465 return nil, err
10466 }
10467 defer googleapi.CloseBody(res)
10468 if err := googleapi.CheckResponse(res); err != nil {
10469 return nil, gensupport.WrapError(err)
10470 }
10471 ret := &TestIamPermissionsResponse{
10472 ServerResponse: googleapi.ServerResponse{
10473 Header: res.Header,
10474 HTTPStatusCode: res.StatusCode,
10475 },
10476 }
10477 target := &ret
10478 if err := gensupport.DecodeResponse(target, res); err != nil {
10479 return nil, err
10480 }
10481 return ret, nil
10482 }
10483
10484 type ProjectsLocationsArtifactsCreateCall struct {
10485 s *Service
10486 parent string
10487 artifact *Artifact
10488 urlParams_ gensupport.URLParams
10489 ctx_ context.Context
10490 header_ http.Header
10491 }
10492
10493
10494
10495
10496
10497 func (r *ProjectsLocationsArtifactsService) Create(parent string, artifact *Artifact) *ProjectsLocationsArtifactsCreateCall {
10498 c := &ProjectsLocationsArtifactsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10499 c.parent = parent
10500 c.artifact = artifact
10501 return c
10502 }
10503
10504
10505
10506
10507
10508 func (c *ProjectsLocationsArtifactsCreateCall) ArtifactId(artifactId string) *ProjectsLocationsArtifactsCreateCall {
10509 c.urlParams_.Set("artifactId", artifactId)
10510 return c
10511 }
10512
10513
10514
10515
10516 func (c *ProjectsLocationsArtifactsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsArtifactsCreateCall {
10517 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10518 return c
10519 }
10520
10521
10522 func (c *ProjectsLocationsArtifactsCreateCall) Context(ctx context.Context) *ProjectsLocationsArtifactsCreateCall {
10523 c.ctx_ = ctx
10524 return c
10525 }
10526
10527
10528
10529 func (c *ProjectsLocationsArtifactsCreateCall) Header() http.Header {
10530 if c.header_ == nil {
10531 c.header_ = make(http.Header)
10532 }
10533 return c.header_
10534 }
10535
10536 func (c *ProjectsLocationsArtifactsCreateCall) doRequest(alt string) (*http.Response, error) {
10537 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10538 var body io.Reader = nil
10539 body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact)
10540 if err != nil {
10541 return nil, err
10542 }
10543 c.urlParams_.Set("alt", alt)
10544 c.urlParams_.Set("prettyPrint", "false")
10545 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
10546 urls += "?" + c.urlParams_.Encode()
10547 req, err := http.NewRequest("POST", urls, body)
10548 if err != nil {
10549 return nil, err
10550 }
10551 req.Header = reqHeaders
10552 googleapi.Expand(req.URL, map[string]string{
10553 "parent": c.parent,
10554 })
10555 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10556 }
10557
10558
10559
10560
10561
10562
10563 func (c *ProjectsLocationsArtifactsCreateCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
10564 gensupport.SetOptions(c.urlParams_, opts...)
10565 res, err := c.doRequest("json")
10566 if res != nil && res.StatusCode == http.StatusNotModified {
10567 if res.Body != nil {
10568 res.Body.Close()
10569 }
10570 return nil, gensupport.WrapError(&googleapi.Error{
10571 Code: res.StatusCode,
10572 Header: res.Header,
10573 })
10574 }
10575 if err != nil {
10576 return nil, err
10577 }
10578 defer googleapi.CloseBody(res)
10579 if err := googleapi.CheckResponse(res); err != nil {
10580 return nil, gensupport.WrapError(err)
10581 }
10582 ret := &Artifact{
10583 ServerResponse: googleapi.ServerResponse{
10584 Header: res.Header,
10585 HTTPStatusCode: res.StatusCode,
10586 },
10587 }
10588 target := &ret
10589 if err := gensupport.DecodeResponse(target, res); err != nil {
10590 return nil, err
10591 }
10592 return ret, nil
10593 }
10594
10595 type ProjectsLocationsArtifactsDeleteCall struct {
10596 s *Service
10597 name string
10598 urlParams_ gensupport.URLParams
10599 ctx_ context.Context
10600 header_ http.Header
10601 }
10602
10603
10604
10605
10606 func (r *ProjectsLocationsArtifactsService) Delete(name string) *ProjectsLocationsArtifactsDeleteCall {
10607 c := &ProjectsLocationsArtifactsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10608 c.name = name
10609 return c
10610 }
10611
10612
10613
10614
10615 func (c *ProjectsLocationsArtifactsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsArtifactsDeleteCall {
10616 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10617 return c
10618 }
10619
10620
10621 func (c *ProjectsLocationsArtifactsDeleteCall) Context(ctx context.Context) *ProjectsLocationsArtifactsDeleteCall {
10622 c.ctx_ = ctx
10623 return c
10624 }
10625
10626
10627
10628 func (c *ProjectsLocationsArtifactsDeleteCall) Header() http.Header {
10629 if c.header_ == nil {
10630 c.header_ = make(http.Header)
10631 }
10632 return c.header_
10633 }
10634
10635 func (c *ProjectsLocationsArtifactsDeleteCall) doRequest(alt string) (*http.Response, error) {
10636 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10637 var body io.Reader = nil
10638 c.urlParams_.Set("alt", alt)
10639 c.urlParams_.Set("prettyPrint", "false")
10640 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
10641 urls += "?" + c.urlParams_.Encode()
10642 req, err := http.NewRequest("DELETE", urls, body)
10643 if err != nil {
10644 return nil, err
10645 }
10646 req.Header = reqHeaders
10647 googleapi.Expand(req.URL, map[string]string{
10648 "name": c.name,
10649 })
10650 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10651 }
10652
10653
10654
10655
10656
10657
10658 func (c *ProjectsLocationsArtifactsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
10659 gensupport.SetOptions(c.urlParams_, opts...)
10660 res, err := c.doRequest("json")
10661 if res != nil && res.StatusCode == http.StatusNotModified {
10662 if res.Body != nil {
10663 res.Body.Close()
10664 }
10665 return nil, gensupport.WrapError(&googleapi.Error{
10666 Code: res.StatusCode,
10667 Header: res.Header,
10668 })
10669 }
10670 if err != nil {
10671 return nil, err
10672 }
10673 defer googleapi.CloseBody(res)
10674 if err := googleapi.CheckResponse(res); err != nil {
10675 return nil, gensupport.WrapError(err)
10676 }
10677 ret := &Empty{
10678 ServerResponse: googleapi.ServerResponse{
10679 Header: res.Header,
10680 HTTPStatusCode: res.StatusCode,
10681 },
10682 }
10683 target := &ret
10684 if err := gensupport.DecodeResponse(target, res); err != nil {
10685 return nil, err
10686 }
10687 return ret, nil
10688 }
10689
10690 type ProjectsLocationsArtifactsGetCall struct {
10691 s *Service
10692 name string
10693 urlParams_ gensupport.URLParams
10694 ifNoneMatch_ string
10695 ctx_ context.Context
10696 header_ http.Header
10697 }
10698
10699
10700
10701
10702 func (r *ProjectsLocationsArtifactsService) Get(name string) *ProjectsLocationsArtifactsGetCall {
10703 c := &ProjectsLocationsArtifactsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10704 c.name = name
10705 return c
10706 }
10707
10708
10709
10710
10711 func (c *ProjectsLocationsArtifactsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsArtifactsGetCall {
10712 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10713 return c
10714 }
10715
10716
10717
10718
10719 func (c *ProjectsLocationsArtifactsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsArtifactsGetCall {
10720 c.ifNoneMatch_ = entityTag
10721 return c
10722 }
10723
10724
10725 func (c *ProjectsLocationsArtifactsGetCall) Context(ctx context.Context) *ProjectsLocationsArtifactsGetCall {
10726 c.ctx_ = ctx
10727 return c
10728 }
10729
10730
10731
10732 func (c *ProjectsLocationsArtifactsGetCall) Header() http.Header {
10733 if c.header_ == nil {
10734 c.header_ = make(http.Header)
10735 }
10736 return c.header_
10737 }
10738
10739 func (c *ProjectsLocationsArtifactsGetCall) doRequest(alt string) (*http.Response, error) {
10740 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10741 if c.ifNoneMatch_ != "" {
10742 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10743 }
10744 var body io.Reader = nil
10745 c.urlParams_.Set("alt", alt)
10746 c.urlParams_.Set("prettyPrint", "false")
10747 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
10748 urls += "?" + c.urlParams_.Encode()
10749 req, err := http.NewRequest("GET", urls, body)
10750 if err != nil {
10751 return nil, err
10752 }
10753 req.Header = reqHeaders
10754 googleapi.Expand(req.URL, map[string]string{
10755 "name": c.name,
10756 })
10757 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10758 }
10759
10760
10761
10762
10763
10764
10765 func (c *ProjectsLocationsArtifactsGetCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
10766 gensupport.SetOptions(c.urlParams_, opts...)
10767 res, err := c.doRequest("json")
10768 if res != nil && res.StatusCode == http.StatusNotModified {
10769 if res.Body != nil {
10770 res.Body.Close()
10771 }
10772 return nil, gensupport.WrapError(&googleapi.Error{
10773 Code: res.StatusCode,
10774 Header: res.Header,
10775 })
10776 }
10777 if err != nil {
10778 return nil, err
10779 }
10780 defer googleapi.CloseBody(res)
10781 if err := googleapi.CheckResponse(res); err != nil {
10782 return nil, gensupport.WrapError(err)
10783 }
10784 ret := &Artifact{
10785 ServerResponse: googleapi.ServerResponse{
10786 Header: res.Header,
10787 HTTPStatusCode: res.StatusCode,
10788 },
10789 }
10790 target := &ret
10791 if err := gensupport.DecodeResponse(target, res); err != nil {
10792 return nil, err
10793 }
10794 return ret, nil
10795 }
10796
10797 type ProjectsLocationsArtifactsGetContentsCall struct {
10798 s *Service
10799 name string
10800 urlParams_ gensupport.URLParams
10801 ifNoneMatch_ string
10802 ctx_ context.Context
10803 header_ http.Header
10804 }
10805
10806
10807
10808
10809
10810
10811
10812
10813 func (r *ProjectsLocationsArtifactsService) GetContents(name string) *ProjectsLocationsArtifactsGetContentsCall {
10814 c := &ProjectsLocationsArtifactsGetContentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10815 c.name = name
10816 return c
10817 }
10818
10819
10820
10821
10822 func (c *ProjectsLocationsArtifactsGetContentsCall) Fields(s ...googleapi.Field) *ProjectsLocationsArtifactsGetContentsCall {
10823 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10824 return c
10825 }
10826
10827
10828
10829
10830 func (c *ProjectsLocationsArtifactsGetContentsCall) IfNoneMatch(entityTag string) *ProjectsLocationsArtifactsGetContentsCall {
10831 c.ifNoneMatch_ = entityTag
10832 return c
10833 }
10834
10835
10836 func (c *ProjectsLocationsArtifactsGetContentsCall) Context(ctx context.Context) *ProjectsLocationsArtifactsGetContentsCall {
10837 c.ctx_ = ctx
10838 return c
10839 }
10840
10841
10842
10843 func (c *ProjectsLocationsArtifactsGetContentsCall) Header() http.Header {
10844 if c.header_ == nil {
10845 c.header_ = make(http.Header)
10846 }
10847 return c.header_
10848 }
10849
10850 func (c *ProjectsLocationsArtifactsGetContentsCall) doRequest(alt string) (*http.Response, error) {
10851 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10852 if c.ifNoneMatch_ != "" {
10853 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10854 }
10855 var body io.Reader = nil
10856 c.urlParams_.Set("alt", alt)
10857 c.urlParams_.Set("prettyPrint", "false")
10858 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getContents")
10859 urls += "?" + c.urlParams_.Encode()
10860 req, err := http.NewRequest("GET", urls, body)
10861 if err != nil {
10862 return nil, err
10863 }
10864 req.Header = reqHeaders
10865 googleapi.Expand(req.URL, map[string]string{
10866 "name": c.name,
10867 })
10868 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10869 }
10870
10871
10872
10873
10874
10875
10876 func (c *ProjectsLocationsArtifactsGetContentsCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
10877 gensupport.SetOptions(c.urlParams_, opts...)
10878 res, err := c.doRequest("json")
10879 if res != nil && res.StatusCode == http.StatusNotModified {
10880 if res.Body != nil {
10881 res.Body.Close()
10882 }
10883 return nil, gensupport.WrapError(&googleapi.Error{
10884 Code: res.StatusCode,
10885 Header: res.Header,
10886 })
10887 }
10888 if err != nil {
10889 return nil, err
10890 }
10891 defer googleapi.CloseBody(res)
10892 if err := googleapi.CheckResponse(res); err != nil {
10893 return nil, gensupport.WrapError(err)
10894 }
10895 ret := &HttpBody{
10896 ServerResponse: googleapi.ServerResponse{
10897 Header: res.Header,
10898 HTTPStatusCode: res.StatusCode,
10899 },
10900 }
10901 target := &ret
10902 if err := gensupport.DecodeResponse(target, res); err != nil {
10903 return nil, err
10904 }
10905 return ret, nil
10906 }
10907
10908 type ProjectsLocationsArtifactsGetIamPolicyCall struct {
10909 s *Service
10910 resource string
10911 urlParams_ gensupport.URLParams
10912 ifNoneMatch_ string
10913 ctx_ context.Context
10914 header_ http.Header
10915 }
10916
10917
10918
10919
10920
10921
10922
10923 func (r *ProjectsLocationsArtifactsService) GetIamPolicy(resource string) *ProjectsLocationsArtifactsGetIamPolicyCall {
10924 c := &ProjectsLocationsArtifactsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10925 c.resource = resource
10926 return c
10927 }
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941 func (c *ProjectsLocationsArtifactsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsArtifactsGetIamPolicyCall {
10942 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
10943 return c
10944 }
10945
10946
10947
10948
10949 func (c *ProjectsLocationsArtifactsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsArtifactsGetIamPolicyCall {
10950 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10951 return c
10952 }
10953
10954
10955
10956
10957 func (c *ProjectsLocationsArtifactsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsArtifactsGetIamPolicyCall {
10958 c.ifNoneMatch_ = entityTag
10959 return c
10960 }
10961
10962
10963 func (c *ProjectsLocationsArtifactsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsArtifactsGetIamPolicyCall {
10964 c.ctx_ = ctx
10965 return c
10966 }
10967
10968
10969
10970 func (c *ProjectsLocationsArtifactsGetIamPolicyCall) Header() http.Header {
10971 if c.header_ == nil {
10972 c.header_ = make(http.Header)
10973 }
10974 return c.header_
10975 }
10976
10977 func (c *ProjectsLocationsArtifactsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
10978 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10979 if c.ifNoneMatch_ != "" {
10980 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10981 }
10982 var body io.Reader = nil
10983 c.urlParams_.Set("alt", alt)
10984 c.urlParams_.Set("prettyPrint", "false")
10985 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
10986 urls += "?" + c.urlParams_.Encode()
10987 req, err := http.NewRequest("GET", urls, body)
10988 if err != nil {
10989 return nil, err
10990 }
10991 req.Header = reqHeaders
10992 googleapi.Expand(req.URL, map[string]string{
10993 "resource": c.resource,
10994 })
10995 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10996 }
10997
10998
10999
11000
11001
11002
11003 func (c *ProjectsLocationsArtifactsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
11004 gensupport.SetOptions(c.urlParams_, opts...)
11005 res, err := c.doRequest("json")
11006 if res != nil && res.StatusCode == http.StatusNotModified {
11007 if res.Body != nil {
11008 res.Body.Close()
11009 }
11010 return nil, gensupport.WrapError(&googleapi.Error{
11011 Code: res.StatusCode,
11012 Header: res.Header,
11013 })
11014 }
11015 if err != nil {
11016 return nil, err
11017 }
11018 defer googleapi.CloseBody(res)
11019 if err := googleapi.CheckResponse(res); err != nil {
11020 return nil, gensupport.WrapError(err)
11021 }
11022 ret := &Policy{
11023 ServerResponse: googleapi.ServerResponse{
11024 Header: res.Header,
11025 HTTPStatusCode: res.StatusCode,
11026 },
11027 }
11028 target := &ret
11029 if err := gensupport.DecodeResponse(target, res); err != nil {
11030 return nil, err
11031 }
11032 return ret, nil
11033 }
11034
11035 type ProjectsLocationsArtifactsListCall struct {
11036 s *Service
11037 parent string
11038 urlParams_ gensupport.URLParams
11039 ifNoneMatch_ string
11040 ctx_ context.Context
11041 header_ http.Header
11042 }
11043
11044
11045
11046
11047
11048 func (r *ProjectsLocationsArtifactsService) List(parent string) *ProjectsLocationsArtifactsListCall {
11049 c := &ProjectsLocationsArtifactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11050 c.parent = parent
11051 return c
11052 }
11053
11054
11055
11056
11057 func (c *ProjectsLocationsArtifactsListCall) Filter(filter string) *ProjectsLocationsArtifactsListCall {
11058 c.urlParams_.Set("filter", filter)
11059 return c
11060 }
11061
11062
11063
11064
11065 func (c *ProjectsLocationsArtifactsListCall) OrderBy(orderBy string) *ProjectsLocationsArtifactsListCall {
11066 c.urlParams_.Set("orderBy", orderBy)
11067 return c
11068 }
11069
11070
11071
11072
11073
11074 func (c *ProjectsLocationsArtifactsListCall) PageSize(pageSize int64) *ProjectsLocationsArtifactsListCall {
11075 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
11076 return c
11077 }
11078
11079
11080
11081
11082
11083 func (c *ProjectsLocationsArtifactsListCall) PageToken(pageToken string) *ProjectsLocationsArtifactsListCall {
11084 c.urlParams_.Set("pageToken", pageToken)
11085 return c
11086 }
11087
11088
11089
11090
11091 func (c *ProjectsLocationsArtifactsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsArtifactsListCall {
11092 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11093 return c
11094 }
11095
11096
11097
11098
11099 func (c *ProjectsLocationsArtifactsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsArtifactsListCall {
11100 c.ifNoneMatch_ = entityTag
11101 return c
11102 }
11103
11104
11105 func (c *ProjectsLocationsArtifactsListCall) Context(ctx context.Context) *ProjectsLocationsArtifactsListCall {
11106 c.ctx_ = ctx
11107 return c
11108 }
11109
11110
11111
11112 func (c *ProjectsLocationsArtifactsListCall) Header() http.Header {
11113 if c.header_ == nil {
11114 c.header_ = make(http.Header)
11115 }
11116 return c.header_
11117 }
11118
11119 func (c *ProjectsLocationsArtifactsListCall) doRequest(alt string) (*http.Response, error) {
11120 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11121 if c.ifNoneMatch_ != "" {
11122 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11123 }
11124 var body io.Reader = nil
11125 c.urlParams_.Set("alt", alt)
11126 c.urlParams_.Set("prettyPrint", "false")
11127 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
11128 urls += "?" + c.urlParams_.Encode()
11129 req, err := http.NewRequest("GET", urls, body)
11130 if err != nil {
11131 return nil, err
11132 }
11133 req.Header = reqHeaders
11134 googleapi.Expand(req.URL, map[string]string{
11135 "parent": c.parent,
11136 })
11137 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11138 }
11139
11140
11141
11142
11143
11144
11145
11146 func (c *ProjectsLocationsArtifactsListCall) Do(opts ...googleapi.CallOption) (*ListArtifactsResponse, error) {
11147 gensupport.SetOptions(c.urlParams_, opts...)
11148 res, err := c.doRequest("json")
11149 if res != nil && res.StatusCode == http.StatusNotModified {
11150 if res.Body != nil {
11151 res.Body.Close()
11152 }
11153 return nil, gensupport.WrapError(&googleapi.Error{
11154 Code: res.StatusCode,
11155 Header: res.Header,
11156 })
11157 }
11158 if err != nil {
11159 return nil, err
11160 }
11161 defer googleapi.CloseBody(res)
11162 if err := googleapi.CheckResponse(res); err != nil {
11163 return nil, gensupport.WrapError(err)
11164 }
11165 ret := &ListArtifactsResponse{
11166 ServerResponse: googleapi.ServerResponse{
11167 Header: res.Header,
11168 HTTPStatusCode: res.StatusCode,
11169 },
11170 }
11171 target := &ret
11172 if err := gensupport.DecodeResponse(target, res); err != nil {
11173 return nil, err
11174 }
11175 return ret, nil
11176 }
11177
11178
11179
11180
11181 func (c *ProjectsLocationsArtifactsListCall) Pages(ctx context.Context, f func(*ListArtifactsResponse) error) error {
11182 c.ctx_ = ctx
11183 defer c.PageToken(c.urlParams_.Get("pageToken"))
11184 for {
11185 x, err := c.Do()
11186 if err != nil {
11187 return err
11188 }
11189 if err := f(x); err != nil {
11190 return err
11191 }
11192 if x.NextPageToken == "" {
11193 return nil
11194 }
11195 c.PageToken(x.NextPageToken)
11196 }
11197 }
11198
11199 type ProjectsLocationsArtifactsReplaceArtifactCall struct {
11200 s *Service
11201 name string
11202 artifact *Artifact
11203 urlParams_ gensupport.URLParams
11204 ctx_ context.Context
11205 header_ http.Header
11206 }
11207
11208
11209
11210
11211 func (r *ProjectsLocationsArtifactsService) ReplaceArtifact(name string, artifact *Artifact) *ProjectsLocationsArtifactsReplaceArtifactCall {
11212 c := &ProjectsLocationsArtifactsReplaceArtifactCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11213 c.name = name
11214 c.artifact = artifact
11215 return c
11216 }
11217
11218
11219
11220
11221 func (c *ProjectsLocationsArtifactsReplaceArtifactCall) Fields(s ...googleapi.Field) *ProjectsLocationsArtifactsReplaceArtifactCall {
11222 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11223 return c
11224 }
11225
11226
11227 func (c *ProjectsLocationsArtifactsReplaceArtifactCall) Context(ctx context.Context) *ProjectsLocationsArtifactsReplaceArtifactCall {
11228 c.ctx_ = ctx
11229 return c
11230 }
11231
11232
11233
11234 func (c *ProjectsLocationsArtifactsReplaceArtifactCall) Header() http.Header {
11235 if c.header_ == nil {
11236 c.header_ = make(http.Header)
11237 }
11238 return c.header_
11239 }
11240
11241 func (c *ProjectsLocationsArtifactsReplaceArtifactCall) doRequest(alt string) (*http.Response, error) {
11242 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11243 var body io.Reader = nil
11244 body, err := googleapi.WithoutDataWrapper.JSONReader(c.artifact)
11245 if err != nil {
11246 return nil, err
11247 }
11248 c.urlParams_.Set("alt", alt)
11249 c.urlParams_.Set("prettyPrint", "false")
11250 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
11251 urls += "?" + c.urlParams_.Encode()
11252 req, err := http.NewRequest("PUT", urls, body)
11253 if err != nil {
11254 return nil, err
11255 }
11256 req.Header = reqHeaders
11257 googleapi.Expand(req.URL, map[string]string{
11258 "name": c.name,
11259 })
11260 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11261 }
11262
11263
11264
11265
11266
11267
11268 func (c *ProjectsLocationsArtifactsReplaceArtifactCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
11269 gensupport.SetOptions(c.urlParams_, opts...)
11270 res, err := c.doRequest("json")
11271 if res != nil && res.StatusCode == http.StatusNotModified {
11272 if res.Body != nil {
11273 res.Body.Close()
11274 }
11275 return nil, gensupport.WrapError(&googleapi.Error{
11276 Code: res.StatusCode,
11277 Header: res.Header,
11278 })
11279 }
11280 if err != nil {
11281 return nil, err
11282 }
11283 defer googleapi.CloseBody(res)
11284 if err := googleapi.CheckResponse(res); err != nil {
11285 return nil, gensupport.WrapError(err)
11286 }
11287 ret := &Artifact{
11288 ServerResponse: googleapi.ServerResponse{
11289 Header: res.Header,
11290 HTTPStatusCode: res.StatusCode,
11291 },
11292 }
11293 target := &ret
11294 if err := gensupport.DecodeResponse(target, res); err != nil {
11295 return nil, err
11296 }
11297 return ret, nil
11298 }
11299
11300 type ProjectsLocationsArtifactsSetIamPolicyCall struct {
11301 s *Service
11302 resource string
11303 setiampolicyrequest *SetIamPolicyRequest
11304 urlParams_ gensupport.URLParams
11305 ctx_ context.Context
11306 header_ http.Header
11307 }
11308
11309
11310
11311
11312
11313
11314
11315
11316 func (r *ProjectsLocationsArtifactsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsArtifactsSetIamPolicyCall {
11317 c := &ProjectsLocationsArtifactsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11318 c.resource = resource
11319 c.setiampolicyrequest = setiampolicyrequest
11320 return c
11321 }
11322
11323
11324
11325
11326 func (c *ProjectsLocationsArtifactsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsArtifactsSetIamPolicyCall {
11327 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11328 return c
11329 }
11330
11331
11332 func (c *ProjectsLocationsArtifactsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsArtifactsSetIamPolicyCall {
11333 c.ctx_ = ctx
11334 return c
11335 }
11336
11337
11338
11339 func (c *ProjectsLocationsArtifactsSetIamPolicyCall) Header() http.Header {
11340 if c.header_ == nil {
11341 c.header_ = make(http.Header)
11342 }
11343 return c.header_
11344 }
11345
11346 func (c *ProjectsLocationsArtifactsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
11347 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11348 var body io.Reader = nil
11349 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
11350 if err != nil {
11351 return nil, err
11352 }
11353 c.urlParams_.Set("alt", alt)
11354 c.urlParams_.Set("prettyPrint", "false")
11355 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
11356 urls += "?" + c.urlParams_.Encode()
11357 req, err := http.NewRequest("POST", urls, body)
11358 if err != nil {
11359 return nil, err
11360 }
11361 req.Header = reqHeaders
11362 googleapi.Expand(req.URL, map[string]string{
11363 "resource": c.resource,
11364 })
11365 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11366 }
11367
11368
11369
11370
11371
11372
11373 func (c *ProjectsLocationsArtifactsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
11374 gensupport.SetOptions(c.urlParams_, opts...)
11375 res, err := c.doRequest("json")
11376 if res != nil && res.StatusCode == http.StatusNotModified {
11377 if res.Body != nil {
11378 res.Body.Close()
11379 }
11380 return nil, gensupport.WrapError(&googleapi.Error{
11381 Code: res.StatusCode,
11382 Header: res.Header,
11383 })
11384 }
11385 if err != nil {
11386 return nil, err
11387 }
11388 defer googleapi.CloseBody(res)
11389 if err := googleapi.CheckResponse(res); err != nil {
11390 return nil, gensupport.WrapError(err)
11391 }
11392 ret := &Policy{
11393 ServerResponse: googleapi.ServerResponse{
11394 Header: res.Header,
11395 HTTPStatusCode: res.StatusCode,
11396 },
11397 }
11398 target := &ret
11399 if err := gensupport.DecodeResponse(target, res); err != nil {
11400 return nil, err
11401 }
11402 return ret, nil
11403 }
11404
11405 type ProjectsLocationsArtifactsTestIamPermissionsCall struct {
11406 s *Service
11407 resource string
11408 testiampermissionsrequest *TestIamPermissionsRequest
11409 urlParams_ gensupport.URLParams
11410 ctx_ context.Context
11411 header_ http.Header
11412 }
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424 func (r *ProjectsLocationsArtifactsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsArtifactsTestIamPermissionsCall {
11425 c := &ProjectsLocationsArtifactsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11426 c.resource = resource
11427 c.testiampermissionsrequest = testiampermissionsrequest
11428 return c
11429 }
11430
11431
11432
11433
11434 func (c *ProjectsLocationsArtifactsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsArtifactsTestIamPermissionsCall {
11435 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11436 return c
11437 }
11438
11439
11440 func (c *ProjectsLocationsArtifactsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsArtifactsTestIamPermissionsCall {
11441 c.ctx_ = ctx
11442 return c
11443 }
11444
11445
11446
11447 func (c *ProjectsLocationsArtifactsTestIamPermissionsCall) Header() http.Header {
11448 if c.header_ == nil {
11449 c.header_ = make(http.Header)
11450 }
11451 return c.header_
11452 }
11453
11454 func (c *ProjectsLocationsArtifactsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
11455 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11456 var body io.Reader = nil
11457 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
11458 if err != nil {
11459 return nil, err
11460 }
11461 c.urlParams_.Set("alt", alt)
11462 c.urlParams_.Set("prettyPrint", "false")
11463 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
11464 urls += "?" + c.urlParams_.Encode()
11465 req, err := http.NewRequest("POST", urls, body)
11466 if err != nil {
11467 return nil, err
11468 }
11469 req.Header = reqHeaders
11470 googleapi.Expand(req.URL, map[string]string{
11471 "resource": c.resource,
11472 })
11473 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11474 }
11475
11476
11477
11478
11479
11480
11481
11482 func (c *ProjectsLocationsArtifactsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
11483 gensupport.SetOptions(c.urlParams_, opts...)
11484 res, err := c.doRequest("json")
11485 if res != nil && res.StatusCode == http.StatusNotModified {
11486 if res.Body != nil {
11487 res.Body.Close()
11488 }
11489 return nil, gensupport.WrapError(&googleapi.Error{
11490 Code: res.StatusCode,
11491 Header: res.Header,
11492 })
11493 }
11494 if err != nil {
11495 return nil, err
11496 }
11497 defer googleapi.CloseBody(res)
11498 if err := googleapi.CheckResponse(res); err != nil {
11499 return nil, gensupport.WrapError(err)
11500 }
11501 ret := &TestIamPermissionsResponse{
11502 ServerResponse: googleapi.ServerResponse{
11503 Header: res.Header,
11504 HTTPStatusCode: res.StatusCode,
11505 },
11506 }
11507 target := &ret
11508 if err := gensupport.DecodeResponse(target, res); err != nil {
11509 return nil, err
11510 }
11511 return ret, nil
11512 }
11513
11514 type ProjectsLocationsDocumentsGetIamPolicyCall struct {
11515 s *Service
11516 resource string
11517 urlParams_ gensupport.URLParams
11518 ifNoneMatch_ string
11519 ctx_ context.Context
11520 header_ http.Header
11521 }
11522
11523
11524
11525
11526
11527
11528
11529 func (r *ProjectsLocationsDocumentsService) GetIamPolicy(resource string) *ProjectsLocationsDocumentsGetIamPolicyCall {
11530 c := &ProjectsLocationsDocumentsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11531 c.resource = resource
11532 return c
11533 }
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547 func (c *ProjectsLocationsDocumentsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsDocumentsGetIamPolicyCall {
11548 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
11549 return c
11550 }
11551
11552
11553
11554
11555 func (c *ProjectsLocationsDocumentsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsDocumentsGetIamPolicyCall {
11556 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11557 return c
11558 }
11559
11560
11561
11562
11563 func (c *ProjectsLocationsDocumentsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsDocumentsGetIamPolicyCall {
11564 c.ifNoneMatch_ = entityTag
11565 return c
11566 }
11567
11568
11569 func (c *ProjectsLocationsDocumentsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsDocumentsGetIamPolicyCall {
11570 c.ctx_ = ctx
11571 return c
11572 }
11573
11574
11575
11576 func (c *ProjectsLocationsDocumentsGetIamPolicyCall) Header() http.Header {
11577 if c.header_ == nil {
11578 c.header_ = make(http.Header)
11579 }
11580 return c.header_
11581 }
11582
11583 func (c *ProjectsLocationsDocumentsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
11584 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11585 if c.ifNoneMatch_ != "" {
11586 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11587 }
11588 var body io.Reader = nil
11589 c.urlParams_.Set("alt", alt)
11590 c.urlParams_.Set("prettyPrint", "false")
11591 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
11592 urls += "?" + c.urlParams_.Encode()
11593 req, err := http.NewRequest("GET", urls, body)
11594 if err != nil {
11595 return nil, err
11596 }
11597 req.Header = reqHeaders
11598 googleapi.Expand(req.URL, map[string]string{
11599 "resource": c.resource,
11600 })
11601 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11602 }
11603
11604
11605
11606
11607
11608
11609 func (c *ProjectsLocationsDocumentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
11610 gensupport.SetOptions(c.urlParams_, opts...)
11611 res, err := c.doRequest("json")
11612 if res != nil && res.StatusCode == http.StatusNotModified {
11613 if res.Body != nil {
11614 res.Body.Close()
11615 }
11616 return nil, gensupport.WrapError(&googleapi.Error{
11617 Code: res.StatusCode,
11618 Header: res.Header,
11619 })
11620 }
11621 if err != nil {
11622 return nil, err
11623 }
11624 defer googleapi.CloseBody(res)
11625 if err := googleapi.CheckResponse(res); err != nil {
11626 return nil, gensupport.WrapError(err)
11627 }
11628 ret := &Policy{
11629 ServerResponse: googleapi.ServerResponse{
11630 Header: res.Header,
11631 HTTPStatusCode: res.StatusCode,
11632 },
11633 }
11634 target := &ret
11635 if err := gensupport.DecodeResponse(target, res); err != nil {
11636 return nil, err
11637 }
11638 return ret, nil
11639 }
11640
11641 type ProjectsLocationsDocumentsSetIamPolicyCall struct {
11642 s *Service
11643 resource string
11644 setiampolicyrequest *SetIamPolicyRequest
11645 urlParams_ gensupport.URLParams
11646 ctx_ context.Context
11647 header_ http.Header
11648 }
11649
11650
11651
11652
11653
11654
11655
11656
11657 func (r *ProjectsLocationsDocumentsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsDocumentsSetIamPolicyCall {
11658 c := &ProjectsLocationsDocumentsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11659 c.resource = resource
11660 c.setiampolicyrequest = setiampolicyrequest
11661 return c
11662 }
11663
11664
11665
11666
11667 func (c *ProjectsLocationsDocumentsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsDocumentsSetIamPolicyCall {
11668 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11669 return c
11670 }
11671
11672
11673 func (c *ProjectsLocationsDocumentsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsDocumentsSetIamPolicyCall {
11674 c.ctx_ = ctx
11675 return c
11676 }
11677
11678
11679
11680 func (c *ProjectsLocationsDocumentsSetIamPolicyCall) Header() http.Header {
11681 if c.header_ == nil {
11682 c.header_ = make(http.Header)
11683 }
11684 return c.header_
11685 }
11686
11687 func (c *ProjectsLocationsDocumentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
11688 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11689 var body io.Reader = nil
11690 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
11691 if err != nil {
11692 return nil, err
11693 }
11694 c.urlParams_.Set("alt", alt)
11695 c.urlParams_.Set("prettyPrint", "false")
11696 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
11697 urls += "?" + c.urlParams_.Encode()
11698 req, err := http.NewRequest("POST", urls, body)
11699 if err != nil {
11700 return nil, err
11701 }
11702 req.Header = reqHeaders
11703 googleapi.Expand(req.URL, map[string]string{
11704 "resource": c.resource,
11705 })
11706 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11707 }
11708
11709
11710
11711
11712
11713
11714 func (c *ProjectsLocationsDocumentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
11715 gensupport.SetOptions(c.urlParams_, opts...)
11716 res, err := c.doRequest("json")
11717 if res != nil && res.StatusCode == http.StatusNotModified {
11718 if res.Body != nil {
11719 res.Body.Close()
11720 }
11721 return nil, gensupport.WrapError(&googleapi.Error{
11722 Code: res.StatusCode,
11723 Header: res.Header,
11724 })
11725 }
11726 if err != nil {
11727 return nil, err
11728 }
11729 defer googleapi.CloseBody(res)
11730 if err := googleapi.CheckResponse(res); err != nil {
11731 return nil, gensupport.WrapError(err)
11732 }
11733 ret := &Policy{
11734 ServerResponse: googleapi.ServerResponse{
11735 Header: res.Header,
11736 HTTPStatusCode: res.StatusCode,
11737 },
11738 }
11739 target := &ret
11740 if err := gensupport.DecodeResponse(target, res); err != nil {
11741 return nil, err
11742 }
11743 return ret, nil
11744 }
11745
11746 type ProjectsLocationsDocumentsTestIamPermissionsCall struct {
11747 s *Service
11748 resource string
11749 testiampermissionsrequest *TestIamPermissionsRequest
11750 urlParams_ gensupport.URLParams
11751 ctx_ context.Context
11752 header_ http.Header
11753 }
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765 func (r *ProjectsLocationsDocumentsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsDocumentsTestIamPermissionsCall {
11766 c := &ProjectsLocationsDocumentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11767 c.resource = resource
11768 c.testiampermissionsrequest = testiampermissionsrequest
11769 return c
11770 }
11771
11772
11773
11774
11775 func (c *ProjectsLocationsDocumentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsDocumentsTestIamPermissionsCall {
11776 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11777 return c
11778 }
11779
11780
11781 func (c *ProjectsLocationsDocumentsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsDocumentsTestIamPermissionsCall {
11782 c.ctx_ = ctx
11783 return c
11784 }
11785
11786
11787
11788 func (c *ProjectsLocationsDocumentsTestIamPermissionsCall) Header() http.Header {
11789 if c.header_ == nil {
11790 c.header_ = make(http.Header)
11791 }
11792 return c.header_
11793 }
11794
11795 func (c *ProjectsLocationsDocumentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
11796 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11797 var body io.Reader = nil
11798 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
11799 if err != nil {
11800 return nil, err
11801 }
11802 c.urlParams_.Set("alt", alt)
11803 c.urlParams_.Set("prettyPrint", "false")
11804 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
11805 urls += "?" + c.urlParams_.Encode()
11806 req, err := http.NewRequest("POST", urls, body)
11807 if err != nil {
11808 return nil, err
11809 }
11810 req.Header = reqHeaders
11811 googleapi.Expand(req.URL, map[string]string{
11812 "resource": c.resource,
11813 })
11814 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11815 }
11816
11817
11818
11819
11820
11821
11822
11823 func (c *ProjectsLocationsDocumentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
11824 gensupport.SetOptions(c.urlParams_, opts...)
11825 res, err := c.doRequest("json")
11826 if res != nil && res.StatusCode == http.StatusNotModified {
11827 if res.Body != nil {
11828 res.Body.Close()
11829 }
11830 return nil, gensupport.WrapError(&googleapi.Error{
11831 Code: res.StatusCode,
11832 Header: res.Header,
11833 })
11834 }
11835 if err != nil {
11836 return nil, err
11837 }
11838 defer googleapi.CloseBody(res)
11839 if err := googleapi.CheckResponse(res); err != nil {
11840 return nil, gensupport.WrapError(err)
11841 }
11842 ret := &TestIamPermissionsResponse{
11843 ServerResponse: googleapi.ServerResponse{
11844 Header: res.Header,
11845 HTTPStatusCode: res.StatusCode,
11846 },
11847 }
11848 target := &ret
11849 if err := gensupport.DecodeResponse(target, res); err != nil {
11850 return nil, err
11851 }
11852 return ret, nil
11853 }
11854
11855 type ProjectsLocationsInstancesCreateCall struct {
11856 s *Service
11857 parent string
11858 instance *Instance
11859 urlParams_ gensupport.URLParams
11860 ctx_ context.Context
11861 header_ http.Header
11862 }
11863
11864
11865
11866
11867
11868 func (r *ProjectsLocationsInstancesService) Create(parent string, instance *Instance) *ProjectsLocationsInstancesCreateCall {
11869 c := &ProjectsLocationsInstancesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11870 c.parent = parent
11871 c.instance = instance
11872 return c
11873 }
11874
11875
11876
11877 func (c *ProjectsLocationsInstancesCreateCall) InstanceId(instanceId string) *ProjectsLocationsInstancesCreateCall {
11878 c.urlParams_.Set("instanceId", instanceId)
11879 return c
11880 }
11881
11882
11883
11884
11885 func (c *ProjectsLocationsInstancesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesCreateCall {
11886 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11887 return c
11888 }
11889
11890
11891 func (c *ProjectsLocationsInstancesCreateCall) Context(ctx context.Context) *ProjectsLocationsInstancesCreateCall {
11892 c.ctx_ = ctx
11893 return c
11894 }
11895
11896
11897
11898 func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header {
11899 if c.header_ == nil {
11900 c.header_ = make(http.Header)
11901 }
11902 return c.header_
11903 }
11904
11905 func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) {
11906 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11907 var body io.Reader = nil
11908 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
11909 if err != nil {
11910 return nil, err
11911 }
11912 c.urlParams_.Set("alt", alt)
11913 c.urlParams_.Set("prettyPrint", "false")
11914 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances")
11915 urls += "?" + c.urlParams_.Encode()
11916 req, err := http.NewRequest("POST", urls, body)
11917 if err != nil {
11918 return nil, err
11919 }
11920 req.Header = reqHeaders
11921 googleapi.Expand(req.URL, map[string]string{
11922 "parent": c.parent,
11923 })
11924 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11925 }
11926
11927
11928
11929
11930
11931
11932 func (c *ProjectsLocationsInstancesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
11933 gensupport.SetOptions(c.urlParams_, opts...)
11934 res, err := c.doRequest("json")
11935 if res != nil && res.StatusCode == http.StatusNotModified {
11936 if res.Body != nil {
11937 res.Body.Close()
11938 }
11939 return nil, gensupport.WrapError(&googleapi.Error{
11940 Code: res.StatusCode,
11941 Header: res.Header,
11942 })
11943 }
11944 if err != nil {
11945 return nil, err
11946 }
11947 defer googleapi.CloseBody(res)
11948 if err := googleapi.CheckResponse(res); err != nil {
11949 return nil, gensupport.WrapError(err)
11950 }
11951 ret := &Operation{
11952 ServerResponse: googleapi.ServerResponse{
11953 Header: res.Header,
11954 HTTPStatusCode: res.StatusCode,
11955 },
11956 }
11957 target := &ret
11958 if err := gensupport.DecodeResponse(target, res); err != nil {
11959 return nil, err
11960 }
11961 return ret, nil
11962 }
11963
11964 type ProjectsLocationsInstancesDeleteCall struct {
11965 s *Service
11966 name string
11967 urlParams_ gensupport.URLParams
11968 ctx_ context.Context
11969 header_ http.Header
11970 }
11971
11972
11973
11974
11975
11976 func (r *ProjectsLocationsInstancesService) Delete(name string) *ProjectsLocationsInstancesDeleteCall {
11977 c := &ProjectsLocationsInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11978 c.name = name
11979 return c
11980 }
11981
11982
11983
11984
11985 func (c *ProjectsLocationsInstancesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesDeleteCall {
11986 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11987 return c
11988 }
11989
11990
11991 func (c *ProjectsLocationsInstancesDeleteCall) Context(ctx context.Context) *ProjectsLocationsInstancesDeleteCall {
11992 c.ctx_ = ctx
11993 return c
11994 }
11995
11996
11997
11998 func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header {
11999 if c.header_ == nil {
12000 c.header_ = make(http.Header)
12001 }
12002 return c.header_
12003 }
12004
12005 func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
12006 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12007 var body io.Reader = nil
12008 c.urlParams_.Set("alt", alt)
12009 c.urlParams_.Set("prettyPrint", "false")
12010 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
12011 urls += "?" + c.urlParams_.Encode()
12012 req, err := http.NewRequest("DELETE", urls, body)
12013 if err != nil {
12014 return nil, err
12015 }
12016 req.Header = reqHeaders
12017 googleapi.Expand(req.URL, map[string]string{
12018 "name": c.name,
12019 })
12020 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12021 }
12022
12023
12024
12025
12026
12027
12028 func (c *ProjectsLocationsInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
12029 gensupport.SetOptions(c.urlParams_, opts...)
12030 res, err := c.doRequest("json")
12031 if res != nil && res.StatusCode == http.StatusNotModified {
12032 if res.Body != nil {
12033 res.Body.Close()
12034 }
12035 return nil, gensupport.WrapError(&googleapi.Error{
12036 Code: res.StatusCode,
12037 Header: res.Header,
12038 })
12039 }
12040 if err != nil {
12041 return nil, err
12042 }
12043 defer googleapi.CloseBody(res)
12044 if err := googleapi.CheckResponse(res); err != nil {
12045 return nil, gensupport.WrapError(err)
12046 }
12047 ret := &Operation{
12048 ServerResponse: googleapi.ServerResponse{
12049 Header: res.Header,
12050 HTTPStatusCode: res.StatusCode,
12051 },
12052 }
12053 target := &ret
12054 if err := gensupport.DecodeResponse(target, res); err != nil {
12055 return nil, err
12056 }
12057 return ret, nil
12058 }
12059
12060 type ProjectsLocationsInstancesGetCall struct {
12061 s *Service
12062 name string
12063 urlParams_ gensupport.URLParams
12064 ifNoneMatch_ string
12065 ctx_ context.Context
12066 header_ http.Header
12067 }
12068
12069
12070
12071
12072
12073 func (r *ProjectsLocationsInstancesService) Get(name string) *ProjectsLocationsInstancesGetCall {
12074 c := &ProjectsLocationsInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12075 c.name = name
12076 return c
12077 }
12078
12079
12080
12081
12082 func (c *ProjectsLocationsInstancesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetCall {
12083 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12084 return c
12085 }
12086
12087
12088
12089
12090 func (c *ProjectsLocationsInstancesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetCall {
12091 c.ifNoneMatch_ = entityTag
12092 return c
12093 }
12094
12095
12096 func (c *ProjectsLocationsInstancesGetCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetCall {
12097 c.ctx_ = ctx
12098 return c
12099 }
12100
12101
12102
12103 func (c *ProjectsLocationsInstancesGetCall) Header() http.Header {
12104 if c.header_ == nil {
12105 c.header_ = make(http.Header)
12106 }
12107 return c.header_
12108 }
12109
12110 func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Response, error) {
12111 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12112 if c.ifNoneMatch_ != "" {
12113 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12114 }
12115 var body io.Reader = nil
12116 c.urlParams_.Set("alt", alt)
12117 c.urlParams_.Set("prettyPrint", "false")
12118 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
12119 urls += "?" + c.urlParams_.Encode()
12120 req, err := http.NewRequest("GET", urls, body)
12121 if err != nil {
12122 return nil, err
12123 }
12124 req.Header = reqHeaders
12125 googleapi.Expand(req.URL, map[string]string{
12126 "name": c.name,
12127 })
12128 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12129 }
12130
12131
12132
12133
12134
12135
12136 func (c *ProjectsLocationsInstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
12137 gensupport.SetOptions(c.urlParams_, opts...)
12138 res, err := c.doRequest("json")
12139 if res != nil && res.StatusCode == http.StatusNotModified {
12140 if res.Body != nil {
12141 res.Body.Close()
12142 }
12143 return nil, gensupport.WrapError(&googleapi.Error{
12144 Code: res.StatusCode,
12145 Header: res.Header,
12146 })
12147 }
12148 if err != nil {
12149 return nil, err
12150 }
12151 defer googleapi.CloseBody(res)
12152 if err := googleapi.CheckResponse(res); err != nil {
12153 return nil, gensupport.WrapError(err)
12154 }
12155 ret := &Instance{
12156 ServerResponse: googleapi.ServerResponse{
12157 Header: res.Header,
12158 HTTPStatusCode: res.StatusCode,
12159 },
12160 }
12161 target := &ret
12162 if err := gensupport.DecodeResponse(target, res); err != nil {
12163 return nil, err
12164 }
12165 return ret, nil
12166 }
12167
12168 type ProjectsLocationsInstancesGetIamPolicyCall struct {
12169 s *Service
12170 resource string
12171 urlParams_ gensupport.URLParams
12172 ifNoneMatch_ string
12173 ctx_ context.Context
12174 header_ http.Header
12175 }
12176
12177
12178
12179
12180
12181
12182
12183 func (r *ProjectsLocationsInstancesService) GetIamPolicy(resource string) *ProjectsLocationsInstancesGetIamPolicyCall {
12184 c := &ProjectsLocationsInstancesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12185 c.resource = resource
12186 return c
12187 }
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201 func (c *ProjectsLocationsInstancesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsInstancesGetIamPolicyCall {
12202 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
12203 return c
12204 }
12205
12206
12207
12208
12209 func (c *ProjectsLocationsInstancesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetIamPolicyCall {
12210 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12211 return c
12212 }
12213
12214
12215
12216
12217 func (c *ProjectsLocationsInstancesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetIamPolicyCall {
12218 c.ifNoneMatch_ = entityTag
12219 return c
12220 }
12221
12222
12223 func (c *ProjectsLocationsInstancesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetIamPolicyCall {
12224 c.ctx_ = ctx
12225 return c
12226 }
12227
12228
12229
12230 func (c *ProjectsLocationsInstancesGetIamPolicyCall) Header() http.Header {
12231 if c.header_ == nil {
12232 c.header_ = make(http.Header)
12233 }
12234 return c.header_
12235 }
12236
12237 func (c *ProjectsLocationsInstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
12238 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12239 if c.ifNoneMatch_ != "" {
12240 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12241 }
12242 var body io.Reader = nil
12243 c.urlParams_.Set("alt", alt)
12244 c.urlParams_.Set("prettyPrint", "false")
12245 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
12246 urls += "?" + c.urlParams_.Encode()
12247 req, err := http.NewRequest("GET", urls, body)
12248 if err != nil {
12249 return nil, err
12250 }
12251 req.Header = reqHeaders
12252 googleapi.Expand(req.URL, map[string]string{
12253 "resource": c.resource,
12254 })
12255 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12256 }
12257
12258
12259
12260
12261
12262
12263 func (c *ProjectsLocationsInstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
12264 gensupport.SetOptions(c.urlParams_, opts...)
12265 res, err := c.doRequest("json")
12266 if res != nil && res.StatusCode == http.StatusNotModified {
12267 if res.Body != nil {
12268 res.Body.Close()
12269 }
12270 return nil, gensupport.WrapError(&googleapi.Error{
12271 Code: res.StatusCode,
12272 Header: res.Header,
12273 })
12274 }
12275 if err != nil {
12276 return nil, err
12277 }
12278 defer googleapi.CloseBody(res)
12279 if err := googleapi.CheckResponse(res); err != nil {
12280 return nil, gensupport.WrapError(err)
12281 }
12282 ret := &Policy{
12283 ServerResponse: googleapi.ServerResponse{
12284 Header: res.Header,
12285 HTTPStatusCode: res.StatusCode,
12286 },
12287 }
12288 target := &ret
12289 if err := gensupport.DecodeResponse(target, res); err != nil {
12290 return nil, err
12291 }
12292 return ret, nil
12293 }
12294
12295 type ProjectsLocationsInstancesSetIamPolicyCall struct {
12296 s *Service
12297 resource string
12298 setiampolicyrequest *SetIamPolicyRequest
12299 urlParams_ gensupport.URLParams
12300 ctx_ context.Context
12301 header_ http.Header
12302 }
12303
12304
12305
12306
12307
12308
12309
12310
12311 func (r *ProjectsLocationsInstancesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsInstancesSetIamPolicyCall {
12312 c := &ProjectsLocationsInstancesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12313 c.resource = resource
12314 c.setiampolicyrequest = setiampolicyrequest
12315 return c
12316 }
12317
12318
12319
12320
12321 func (c *ProjectsLocationsInstancesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesSetIamPolicyCall {
12322 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12323 return c
12324 }
12325
12326
12327 func (c *ProjectsLocationsInstancesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsInstancesSetIamPolicyCall {
12328 c.ctx_ = ctx
12329 return c
12330 }
12331
12332
12333
12334 func (c *ProjectsLocationsInstancesSetIamPolicyCall) Header() http.Header {
12335 if c.header_ == nil {
12336 c.header_ = make(http.Header)
12337 }
12338 return c.header_
12339 }
12340
12341 func (c *ProjectsLocationsInstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
12342 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
12343 var body io.Reader = nil
12344 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
12345 if err != nil {
12346 return nil, err
12347 }
12348 c.urlParams_.Set("alt", alt)
12349 c.urlParams_.Set("prettyPrint", "false")
12350 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
12351 urls += "?" + c.urlParams_.Encode()
12352 req, err := http.NewRequest("POST", urls, body)
12353 if err != nil {
12354 return nil, err
12355 }
12356 req.Header = reqHeaders
12357 googleapi.Expand(req.URL, map[string]string{
12358 "resource": c.resource,
12359 })
12360 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12361 }
12362
12363
12364
12365
12366
12367
12368 func (c *ProjectsLocationsInstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
12369 gensupport.SetOptions(c.urlParams_, opts...)
12370 res, err := c.doRequest("json")
12371 if res != nil && res.StatusCode == http.StatusNotModified {
12372 if res.Body != nil {
12373 res.Body.Close()
12374 }
12375 return nil, gensupport.WrapError(&googleapi.Error{
12376 Code: res.StatusCode,
12377 Header: res.Header,
12378 })
12379 }
12380 if err != nil {
12381 return nil, err
12382 }
12383 defer googleapi.CloseBody(res)
12384 if err := googleapi.CheckResponse(res); err != nil {
12385 return nil, gensupport.WrapError(err)
12386 }
12387 ret := &Policy{
12388 ServerResponse: googleapi.ServerResponse{
12389 Header: res.Header,
12390 HTTPStatusCode: res.StatusCode,
12391 },
12392 }
12393 target := &ret
12394 if err := gensupport.DecodeResponse(target, res); err != nil {
12395 return nil, err
12396 }
12397 return ret, nil
12398 }
12399
12400 type ProjectsLocationsInstancesTestIamPermissionsCall struct {
12401 s *Service
12402 resource string
12403 testiampermissionsrequest *TestIamPermissionsRequest
12404 urlParams_ gensupport.URLParams
12405 ctx_ context.Context
12406 header_ http.Header
12407 }
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419 func (r *ProjectsLocationsInstancesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsInstancesTestIamPermissionsCall {
12420 c := &ProjectsLocationsInstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12421 c.resource = resource
12422 c.testiampermissionsrequest = testiampermissionsrequest
12423 return c
12424 }
12425
12426
12427
12428
12429 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesTestIamPermissionsCall {
12430 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12431 return c
12432 }
12433
12434
12435 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsInstancesTestIamPermissionsCall {
12436 c.ctx_ = ctx
12437 return c
12438 }
12439
12440
12441
12442 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Header() http.Header {
12443 if c.header_ == nil {
12444 c.header_ = make(http.Header)
12445 }
12446 return c.header_
12447 }
12448
12449 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
12450 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
12451 var body io.Reader = nil
12452 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
12453 if err != nil {
12454 return nil, err
12455 }
12456 c.urlParams_.Set("alt", alt)
12457 c.urlParams_.Set("prettyPrint", "false")
12458 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
12459 urls += "?" + c.urlParams_.Encode()
12460 req, err := http.NewRequest("POST", urls, body)
12461 if err != nil {
12462 return nil, err
12463 }
12464 req.Header = reqHeaders
12465 googleapi.Expand(req.URL, map[string]string{
12466 "resource": c.resource,
12467 })
12468 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12469 }
12470
12471
12472
12473
12474
12475
12476
12477 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
12478 gensupport.SetOptions(c.urlParams_, opts...)
12479 res, err := c.doRequest("json")
12480 if res != nil && res.StatusCode == http.StatusNotModified {
12481 if res.Body != nil {
12482 res.Body.Close()
12483 }
12484 return nil, gensupport.WrapError(&googleapi.Error{
12485 Code: res.StatusCode,
12486 Header: res.Header,
12487 })
12488 }
12489 if err != nil {
12490 return nil, err
12491 }
12492 defer googleapi.CloseBody(res)
12493 if err := googleapi.CheckResponse(res); err != nil {
12494 return nil, gensupport.WrapError(err)
12495 }
12496 ret := &TestIamPermissionsResponse{
12497 ServerResponse: googleapi.ServerResponse{
12498 Header: res.Header,
12499 HTTPStatusCode: res.StatusCode,
12500 },
12501 }
12502 target := &ret
12503 if err := gensupport.DecodeResponse(target, res); err != nil {
12504 return nil, err
12505 }
12506 return ret, nil
12507 }
12508
12509 type ProjectsLocationsOperationsCancelCall struct {
12510 s *Service
12511 name string
12512 canceloperationrequest *CancelOperationRequest
12513 urlParams_ gensupport.URLParams
12514 ctx_ context.Context
12515 header_ http.Header
12516 }
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529 func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
12530 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12531 c.name = name
12532 c.canceloperationrequest = canceloperationrequest
12533 return c
12534 }
12535
12536
12537
12538
12539 func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
12540 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12541 return c
12542 }
12543
12544
12545 func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
12546 c.ctx_ = ctx
12547 return c
12548 }
12549
12550
12551
12552 func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
12553 if c.header_ == nil {
12554 c.header_ = make(http.Header)
12555 }
12556 return c.header_
12557 }
12558
12559 func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
12560 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
12561 var body io.Reader = nil
12562 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
12563 if err != nil {
12564 return nil, err
12565 }
12566 c.urlParams_.Set("alt", alt)
12567 c.urlParams_.Set("prettyPrint", "false")
12568 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
12569 urls += "?" + c.urlParams_.Encode()
12570 req, err := http.NewRequest("POST", urls, body)
12571 if err != nil {
12572 return nil, err
12573 }
12574 req.Header = reqHeaders
12575 googleapi.Expand(req.URL, map[string]string{
12576 "name": c.name,
12577 })
12578 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12579 }
12580
12581
12582
12583
12584
12585
12586 func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
12587 gensupport.SetOptions(c.urlParams_, opts...)
12588 res, err := c.doRequest("json")
12589 if res != nil && res.StatusCode == http.StatusNotModified {
12590 if res.Body != nil {
12591 res.Body.Close()
12592 }
12593 return nil, gensupport.WrapError(&googleapi.Error{
12594 Code: res.StatusCode,
12595 Header: res.Header,
12596 })
12597 }
12598 if err != nil {
12599 return nil, err
12600 }
12601 defer googleapi.CloseBody(res)
12602 if err := googleapi.CheckResponse(res); err != nil {
12603 return nil, gensupport.WrapError(err)
12604 }
12605 ret := &Empty{
12606 ServerResponse: googleapi.ServerResponse{
12607 Header: res.Header,
12608 HTTPStatusCode: res.StatusCode,
12609 },
12610 }
12611 target := &ret
12612 if err := gensupport.DecodeResponse(target, res); err != nil {
12613 return nil, err
12614 }
12615 return ret, nil
12616 }
12617
12618 type ProjectsLocationsOperationsDeleteCall struct {
12619 s *Service
12620 name string
12621 urlParams_ gensupport.URLParams
12622 ctx_ context.Context
12623 header_ http.Header
12624 }
12625
12626
12627
12628
12629
12630
12631
12632 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
12633 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12634 c.name = name
12635 return c
12636 }
12637
12638
12639
12640
12641 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
12642 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12643 return c
12644 }
12645
12646
12647 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
12648 c.ctx_ = ctx
12649 return c
12650 }
12651
12652
12653
12654 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
12655 if c.header_ == nil {
12656 c.header_ = make(http.Header)
12657 }
12658 return c.header_
12659 }
12660
12661 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
12662 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12663 var body io.Reader = nil
12664 c.urlParams_.Set("alt", alt)
12665 c.urlParams_.Set("prettyPrint", "false")
12666 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
12667 urls += "?" + c.urlParams_.Encode()
12668 req, err := http.NewRequest("DELETE", urls, body)
12669 if err != nil {
12670 return nil, err
12671 }
12672 req.Header = reqHeaders
12673 googleapi.Expand(req.URL, map[string]string{
12674 "name": c.name,
12675 })
12676 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12677 }
12678
12679
12680
12681
12682
12683
12684 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
12685 gensupport.SetOptions(c.urlParams_, opts...)
12686 res, err := c.doRequest("json")
12687 if res != nil && res.StatusCode == http.StatusNotModified {
12688 if res.Body != nil {
12689 res.Body.Close()
12690 }
12691 return nil, gensupport.WrapError(&googleapi.Error{
12692 Code: res.StatusCode,
12693 Header: res.Header,
12694 })
12695 }
12696 if err != nil {
12697 return nil, err
12698 }
12699 defer googleapi.CloseBody(res)
12700 if err := googleapi.CheckResponse(res); err != nil {
12701 return nil, gensupport.WrapError(err)
12702 }
12703 ret := &Empty{
12704 ServerResponse: googleapi.ServerResponse{
12705 Header: res.Header,
12706 HTTPStatusCode: res.StatusCode,
12707 },
12708 }
12709 target := &ret
12710 if err := gensupport.DecodeResponse(target, res); err != nil {
12711 return nil, err
12712 }
12713 return ret, nil
12714 }
12715
12716 type ProjectsLocationsOperationsGetCall struct {
12717 s *Service
12718 name string
12719 urlParams_ gensupport.URLParams
12720 ifNoneMatch_ string
12721 ctx_ context.Context
12722 header_ http.Header
12723 }
12724
12725
12726
12727
12728
12729
12730 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
12731 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12732 c.name = name
12733 return c
12734 }
12735
12736
12737
12738
12739 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
12740 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12741 return c
12742 }
12743
12744
12745
12746
12747 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
12748 c.ifNoneMatch_ = entityTag
12749 return c
12750 }
12751
12752
12753 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
12754 c.ctx_ = ctx
12755 return c
12756 }
12757
12758
12759
12760 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
12761 if c.header_ == nil {
12762 c.header_ = make(http.Header)
12763 }
12764 return c.header_
12765 }
12766
12767 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
12768 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12769 if c.ifNoneMatch_ != "" {
12770 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12771 }
12772 var body io.Reader = nil
12773 c.urlParams_.Set("alt", alt)
12774 c.urlParams_.Set("prettyPrint", "false")
12775 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
12776 urls += "?" + c.urlParams_.Encode()
12777 req, err := http.NewRequest("GET", urls, body)
12778 if err != nil {
12779 return nil, err
12780 }
12781 req.Header = reqHeaders
12782 googleapi.Expand(req.URL, map[string]string{
12783 "name": c.name,
12784 })
12785 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12786 }
12787
12788
12789
12790
12791
12792
12793 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
12794 gensupport.SetOptions(c.urlParams_, opts...)
12795 res, err := c.doRequest("json")
12796 if res != nil && res.StatusCode == http.StatusNotModified {
12797 if res.Body != nil {
12798 res.Body.Close()
12799 }
12800 return nil, gensupport.WrapError(&googleapi.Error{
12801 Code: res.StatusCode,
12802 Header: res.Header,
12803 })
12804 }
12805 if err != nil {
12806 return nil, err
12807 }
12808 defer googleapi.CloseBody(res)
12809 if err := googleapi.CheckResponse(res); err != nil {
12810 return nil, gensupport.WrapError(err)
12811 }
12812 ret := &Operation{
12813 ServerResponse: googleapi.ServerResponse{
12814 Header: res.Header,
12815 HTTPStatusCode: res.StatusCode,
12816 },
12817 }
12818 target := &ret
12819 if err := gensupport.DecodeResponse(target, res); err != nil {
12820 return nil, err
12821 }
12822 return ret, nil
12823 }
12824
12825 type ProjectsLocationsOperationsListCall struct {
12826 s *Service
12827 name string
12828 urlParams_ gensupport.URLParams
12829 ifNoneMatch_ string
12830 ctx_ context.Context
12831 header_ http.Header
12832 }
12833
12834
12835
12836
12837
12838 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
12839 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12840 c.name = name
12841 return c
12842 }
12843
12844
12845 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
12846 c.urlParams_.Set("filter", filter)
12847 return c
12848 }
12849
12850
12851
12852 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
12853 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
12854 return c
12855 }
12856
12857
12858
12859 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
12860 c.urlParams_.Set("pageToken", pageToken)
12861 return c
12862 }
12863
12864
12865
12866
12867 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
12868 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12869 return c
12870 }
12871
12872
12873
12874
12875 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
12876 c.ifNoneMatch_ = entityTag
12877 return c
12878 }
12879
12880
12881 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
12882 c.ctx_ = ctx
12883 return c
12884 }
12885
12886
12887
12888 func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
12889 if c.header_ == nil {
12890 c.header_ = make(http.Header)
12891 }
12892 return c.header_
12893 }
12894
12895 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
12896 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12897 if c.ifNoneMatch_ != "" {
12898 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12899 }
12900 var body io.Reader = nil
12901 c.urlParams_.Set("alt", alt)
12902 c.urlParams_.Set("prettyPrint", "false")
12903 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
12904 urls += "?" + c.urlParams_.Encode()
12905 req, err := http.NewRequest("GET", urls, body)
12906 if err != nil {
12907 return nil, err
12908 }
12909 req.Header = reqHeaders
12910 googleapi.Expand(req.URL, map[string]string{
12911 "name": c.name,
12912 })
12913 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12914 }
12915
12916
12917
12918
12919
12920
12921
12922 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
12923 gensupport.SetOptions(c.urlParams_, opts...)
12924 res, err := c.doRequest("json")
12925 if res != nil && res.StatusCode == http.StatusNotModified {
12926 if res.Body != nil {
12927 res.Body.Close()
12928 }
12929 return nil, gensupport.WrapError(&googleapi.Error{
12930 Code: res.StatusCode,
12931 Header: res.Header,
12932 })
12933 }
12934 if err != nil {
12935 return nil, err
12936 }
12937 defer googleapi.CloseBody(res)
12938 if err := googleapi.CheckResponse(res); err != nil {
12939 return nil, gensupport.WrapError(err)
12940 }
12941 ret := &ListOperationsResponse{
12942 ServerResponse: googleapi.ServerResponse{
12943 Header: res.Header,
12944 HTTPStatusCode: res.StatusCode,
12945 },
12946 }
12947 target := &ret
12948 if err := gensupport.DecodeResponse(target, res); err != nil {
12949 return nil, err
12950 }
12951 return ret, nil
12952 }
12953
12954
12955
12956
12957 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
12958 c.ctx_ = ctx
12959 defer c.PageToken(c.urlParams_.Get("pageToken"))
12960 for {
12961 x, err := c.Do()
12962 if err != nil {
12963 return err
12964 }
12965 if err := f(x); err != nil {
12966 return err
12967 }
12968 if x.NextPageToken == "" {
12969 return nil
12970 }
12971 c.PageToken(x.NextPageToken)
12972 }
12973 }
12974
12975 type ProjectsLocationsRuntimeGetIamPolicyCall struct {
12976 s *Service
12977 resource string
12978 urlParams_ gensupport.URLParams
12979 ifNoneMatch_ string
12980 ctx_ context.Context
12981 header_ http.Header
12982 }
12983
12984
12985
12986
12987
12988
12989
12990 func (r *ProjectsLocationsRuntimeService) GetIamPolicy(resource string) *ProjectsLocationsRuntimeGetIamPolicyCall {
12991 c := &ProjectsLocationsRuntimeGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12992 c.resource = resource
12993 return c
12994 }
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008 func (c *ProjectsLocationsRuntimeGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsRuntimeGetIamPolicyCall {
13009 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
13010 return c
13011 }
13012
13013
13014
13015
13016 func (c *ProjectsLocationsRuntimeGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsRuntimeGetIamPolicyCall {
13017 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13018 return c
13019 }
13020
13021
13022
13023
13024 func (c *ProjectsLocationsRuntimeGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsRuntimeGetIamPolicyCall {
13025 c.ifNoneMatch_ = entityTag
13026 return c
13027 }
13028
13029
13030 func (c *ProjectsLocationsRuntimeGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsRuntimeGetIamPolicyCall {
13031 c.ctx_ = ctx
13032 return c
13033 }
13034
13035
13036
13037 func (c *ProjectsLocationsRuntimeGetIamPolicyCall) Header() http.Header {
13038 if c.header_ == nil {
13039 c.header_ = make(http.Header)
13040 }
13041 return c.header_
13042 }
13043
13044 func (c *ProjectsLocationsRuntimeGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
13045 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
13046 if c.ifNoneMatch_ != "" {
13047 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13048 }
13049 var body io.Reader = nil
13050 c.urlParams_.Set("alt", alt)
13051 c.urlParams_.Set("prettyPrint", "false")
13052 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
13053 urls += "?" + c.urlParams_.Encode()
13054 req, err := http.NewRequest("GET", urls, body)
13055 if err != nil {
13056 return nil, err
13057 }
13058 req.Header = reqHeaders
13059 googleapi.Expand(req.URL, map[string]string{
13060 "resource": c.resource,
13061 })
13062 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13063 }
13064
13065
13066
13067
13068
13069
13070 func (c *ProjectsLocationsRuntimeGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
13071 gensupport.SetOptions(c.urlParams_, opts...)
13072 res, err := c.doRequest("json")
13073 if res != nil && res.StatusCode == http.StatusNotModified {
13074 if res.Body != nil {
13075 res.Body.Close()
13076 }
13077 return nil, gensupport.WrapError(&googleapi.Error{
13078 Code: res.StatusCode,
13079 Header: res.Header,
13080 })
13081 }
13082 if err != nil {
13083 return nil, err
13084 }
13085 defer googleapi.CloseBody(res)
13086 if err := googleapi.CheckResponse(res); err != nil {
13087 return nil, gensupport.WrapError(err)
13088 }
13089 ret := &Policy{
13090 ServerResponse: googleapi.ServerResponse{
13091 Header: res.Header,
13092 HTTPStatusCode: res.StatusCode,
13093 },
13094 }
13095 target := &ret
13096 if err := gensupport.DecodeResponse(target, res); err != nil {
13097 return nil, err
13098 }
13099 return ret, nil
13100 }
13101
13102 type ProjectsLocationsRuntimeSetIamPolicyCall struct {
13103 s *Service
13104 resource string
13105 setiampolicyrequest *SetIamPolicyRequest
13106 urlParams_ gensupport.URLParams
13107 ctx_ context.Context
13108 header_ http.Header
13109 }
13110
13111
13112
13113
13114
13115
13116
13117
13118 func (r *ProjectsLocationsRuntimeService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsRuntimeSetIamPolicyCall {
13119 c := &ProjectsLocationsRuntimeSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13120 c.resource = resource
13121 c.setiampolicyrequest = setiampolicyrequest
13122 return c
13123 }
13124
13125
13126
13127
13128 func (c *ProjectsLocationsRuntimeSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsRuntimeSetIamPolicyCall {
13129 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13130 return c
13131 }
13132
13133
13134 func (c *ProjectsLocationsRuntimeSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsRuntimeSetIamPolicyCall {
13135 c.ctx_ = ctx
13136 return c
13137 }
13138
13139
13140
13141 func (c *ProjectsLocationsRuntimeSetIamPolicyCall) Header() http.Header {
13142 if c.header_ == nil {
13143 c.header_ = make(http.Header)
13144 }
13145 return c.header_
13146 }
13147
13148 func (c *ProjectsLocationsRuntimeSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
13149 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
13150 var body io.Reader = nil
13151 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
13152 if err != nil {
13153 return nil, err
13154 }
13155 c.urlParams_.Set("alt", alt)
13156 c.urlParams_.Set("prettyPrint", "false")
13157 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
13158 urls += "?" + c.urlParams_.Encode()
13159 req, err := http.NewRequest("POST", urls, body)
13160 if err != nil {
13161 return nil, err
13162 }
13163 req.Header = reqHeaders
13164 googleapi.Expand(req.URL, map[string]string{
13165 "resource": c.resource,
13166 })
13167 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13168 }
13169
13170
13171
13172
13173
13174
13175 func (c *ProjectsLocationsRuntimeSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
13176 gensupport.SetOptions(c.urlParams_, opts...)
13177 res, err := c.doRequest("json")
13178 if res != nil && res.StatusCode == http.StatusNotModified {
13179 if res.Body != nil {
13180 res.Body.Close()
13181 }
13182 return nil, gensupport.WrapError(&googleapi.Error{
13183 Code: res.StatusCode,
13184 Header: res.Header,
13185 })
13186 }
13187 if err != nil {
13188 return nil, err
13189 }
13190 defer googleapi.CloseBody(res)
13191 if err := googleapi.CheckResponse(res); err != nil {
13192 return nil, gensupport.WrapError(err)
13193 }
13194 ret := &Policy{
13195 ServerResponse: googleapi.ServerResponse{
13196 Header: res.Header,
13197 HTTPStatusCode: res.StatusCode,
13198 },
13199 }
13200 target := &ret
13201 if err := gensupport.DecodeResponse(target, res); err != nil {
13202 return nil, err
13203 }
13204 return ret, nil
13205 }
13206
13207 type ProjectsLocationsRuntimeTestIamPermissionsCall struct {
13208 s *Service
13209 resource string
13210 testiampermissionsrequest *TestIamPermissionsRequest
13211 urlParams_ gensupport.URLParams
13212 ctx_ context.Context
13213 header_ http.Header
13214 }
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226 func (r *ProjectsLocationsRuntimeService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsRuntimeTestIamPermissionsCall {
13227 c := &ProjectsLocationsRuntimeTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13228 c.resource = resource
13229 c.testiampermissionsrequest = testiampermissionsrequest
13230 return c
13231 }
13232
13233
13234
13235
13236 func (c *ProjectsLocationsRuntimeTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsRuntimeTestIamPermissionsCall {
13237 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13238 return c
13239 }
13240
13241
13242 func (c *ProjectsLocationsRuntimeTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsRuntimeTestIamPermissionsCall {
13243 c.ctx_ = ctx
13244 return c
13245 }
13246
13247
13248
13249 func (c *ProjectsLocationsRuntimeTestIamPermissionsCall) Header() http.Header {
13250 if c.header_ == nil {
13251 c.header_ = make(http.Header)
13252 }
13253 return c.header_
13254 }
13255
13256 func (c *ProjectsLocationsRuntimeTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
13257 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
13258 var body io.Reader = nil
13259 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
13260 if err != nil {
13261 return nil, err
13262 }
13263 c.urlParams_.Set("alt", alt)
13264 c.urlParams_.Set("prettyPrint", "false")
13265 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
13266 urls += "?" + c.urlParams_.Encode()
13267 req, err := http.NewRequest("POST", urls, body)
13268 if err != nil {
13269 return nil, err
13270 }
13271 req.Header = reqHeaders
13272 googleapi.Expand(req.URL, map[string]string{
13273 "resource": c.resource,
13274 })
13275 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13276 }
13277
13278
13279
13280
13281
13282
13283
13284 func (c *ProjectsLocationsRuntimeTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
13285 gensupport.SetOptions(c.urlParams_, opts...)
13286 res, err := c.doRequest("json")
13287 if res != nil && res.StatusCode == http.StatusNotModified {
13288 if res.Body != nil {
13289 res.Body.Close()
13290 }
13291 return nil, gensupport.WrapError(&googleapi.Error{
13292 Code: res.StatusCode,
13293 Header: res.Header,
13294 })
13295 }
13296 if err != nil {
13297 return nil, err
13298 }
13299 defer googleapi.CloseBody(res)
13300 if err := googleapi.CheckResponse(res); err != nil {
13301 return nil, gensupport.WrapError(err)
13302 }
13303 ret := &TestIamPermissionsResponse{
13304 ServerResponse: googleapi.ServerResponse{
13305 Header: res.Header,
13306 HTTPStatusCode: res.StatusCode,
13307 },
13308 }
13309 target := &ret
13310 if err := gensupport.DecodeResponse(target, res); err != nil {
13311 return nil, err
13312 }
13313 return ret, nil
13314 }
13315
View as plain text