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 connectors
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 = "connectors:v2"
90 const apiName = "connectors"
91 const apiVersion = "v2"
92 const basePath = "https://connectors.googleapis.com/"
93 const basePathTemplate = "https://connectors.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://connectors.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.Connections = NewProjectsLocationsConnectionsService(s)
172 return rs
173 }
174
175 type ProjectsLocationsService struct {
176 s *Service
177
178 Connections *ProjectsLocationsConnectionsService
179 }
180
181 func NewProjectsLocationsConnectionsService(s *Service) *ProjectsLocationsConnectionsService {
182 rs := &ProjectsLocationsConnectionsService{s: s}
183 rs.Actions = NewProjectsLocationsConnectionsActionsService(s)
184 rs.EntityTypes = NewProjectsLocationsConnectionsEntityTypesService(s)
185 return rs
186 }
187
188 type ProjectsLocationsConnectionsService struct {
189 s *Service
190
191 Actions *ProjectsLocationsConnectionsActionsService
192
193 EntityTypes *ProjectsLocationsConnectionsEntityTypesService
194 }
195
196 func NewProjectsLocationsConnectionsActionsService(s *Service) *ProjectsLocationsConnectionsActionsService {
197 rs := &ProjectsLocationsConnectionsActionsService{s: s}
198 return rs
199 }
200
201 type ProjectsLocationsConnectionsActionsService struct {
202 s *Service
203 }
204
205 func NewProjectsLocationsConnectionsEntityTypesService(s *Service) *ProjectsLocationsConnectionsEntityTypesService {
206 rs := &ProjectsLocationsConnectionsEntityTypesService{s: s}
207 rs.Entities = NewProjectsLocationsConnectionsEntityTypesEntitiesService(s)
208 return rs
209 }
210
211 type ProjectsLocationsConnectionsEntityTypesService struct {
212 s *Service
213
214 Entities *ProjectsLocationsConnectionsEntityTypesEntitiesService
215 }
216
217 func NewProjectsLocationsConnectionsEntityTypesEntitiesService(s *Service) *ProjectsLocationsConnectionsEntityTypesEntitiesService {
218 rs := &ProjectsLocationsConnectionsEntityTypesEntitiesService{s: s}
219 return rs
220 }
221
222 type ProjectsLocationsConnectionsEntityTypesEntitiesService struct {
223 s *Service
224 }
225
226
227
228 type AccessCredentials struct {
229
230 AccessToken string `json:"accessToken,omitempty"`
231
232 ExpiresIn string `json:"expiresIn,omitempty"`
233
234 RefreshToken string `json:"refreshToken,omitempty"`
235
236
237
238
239
240 ForceSendFields []string `json:"-"`
241
242
243
244
245 NullFields []string `json:"-"`
246 }
247
248 func (s *AccessCredentials) MarshalJSON() ([]byte, error) {
249 type NoMethod AccessCredentials
250 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
251 }
252
253
254
255 type Action struct {
256
257 Description string `json:"description,omitempty"`
258
259 DisplayName string `json:"displayName,omitempty"`
260
261 InputJsonSchema *JsonSchema `json:"inputJsonSchema,omitempty"`
262
263 InputParameters []*InputParameter `json:"inputParameters,omitempty"`
264
265 Name string `json:"name,omitempty"`
266
267 ResultJsonSchema *JsonSchema `json:"resultJsonSchema,omitempty"`
268
269 ResultMetadata []*ResultMetadata `json:"resultMetadata,omitempty"`
270
271
272 googleapi.ServerResponse `json:"-"`
273
274
275
276
277
278 ForceSendFields []string `json:"-"`
279
280
281
282
283 NullFields []string `json:"-"`
284 }
285
286 func (s *Action) MarshalJSON() ([]byte, error) {
287 type NoMethod Action
288 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
289 }
290
291
292
293 type CheckReadinessResponse struct {
294 Status string `json:"status,omitempty"`
295
296
297 googleapi.ServerResponse `json:"-"`
298
299
300
301
302
303 ForceSendFields []string `json:"-"`
304
305
306
307
308 NullFields []string `json:"-"`
309 }
310
311 func (s *CheckReadinessResponse) MarshalJSON() ([]byte, error) {
312 type NoMethod CheckReadinessResponse
313 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
314 }
315
316
317 type CheckStatusResponse struct {
318
319
320 Description string `json:"description,omitempty"`
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335 State string `json:"state,omitempty"`
336
337
338 googleapi.ServerResponse `json:"-"`
339
340
341
342
343
344 ForceSendFields []string `json:"-"`
345
346
347
348
349 NullFields []string `json:"-"`
350 }
351
352 func (s *CheckStatusResponse) MarshalJSON() ([]byte, error) {
353 type NoMethod CheckStatusResponse
354 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
355 }
356
357
358 type DailyCycle struct {
359
360 Duration string `json:"duration,omitempty"`
361
362 StartTime *TimeOfDay `json:"startTime,omitempty"`
363
364
365
366
367
368 ForceSendFields []string `json:"-"`
369
370
371
372
373 NullFields []string `json:"-"`
374 }
375
376 func (s *DailyCycle) MarshalJSON() ([]byte, error) {
377 type NoMethod DailyCycle
378 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
379 }
380
381
382
383
384
385
386
387
388
389
390 type Date struct {
391
392
393
394 Day int64 `json:"day,omitempty"`
395
396
397 Month int64 `json:"month,omitempty"`
398
399
400 Year int64 `json:"year,omitempty"`
401
402
403
404
405
406 ForceSendFields []string `json:"-"`
407
408
409
410
411 NullFields []string `json:"-"`
412 }
413
414 func (s *Date) MarshalJSON() ([]byte, error) {
415 type NoMethod Date
416 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
417 }
418
419
420
421
422 type DenyMaintenancePeriod struct {
423
424
425
426
427 EndDate *Date `json:"endDate,omitempty"`
428
429
430
431
432 StartDate *Date `json:"startDate,omitempty"`
433
434
435 Time *TimeOfDay `json:"time,omitempty"`
436
437
438
439
440
441 ForceSendFields []string `json:"-"`
442
443
444
445
446 NullFields []string `json:"-"`
447 }
448
449 func (s *DenyMaintenancePeriod) MarshalJSON() ([]byte, error) {
450 type NoMethod DenyMaintenancePeriod
451 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
452 }
453
454
455
456
457
458 type Empty struct {
459
460 googleapi.ServerResponse `json:"-"`
461 }
462
463
464 type Entity struct {
465
466
467 Fields googleapi.RawMessage `json:"fields,omitempty"`
468
469
470
471 Name string `json:"name,omitempty"`
472
473
474 googleapi.ServerResponse `json:"-"`
475
476
477
478
479
480 ForceSendFields []string `json:"-"`
481
482
483
484
485 NullFields []string `json:"-"`
486 }
487
488 func (s *Entity) MarshalJSON() ([]byte, error) {
489 type NoMethod Entity
490 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
491 }
492
493
494
495 type EntityType struct {
496
497
498 Fields []*Field `json:"fields,omitempty"`
499
500 JsonSchema *JsonSchema `json:"jsonSchema,omitempty"`
501
502 Name string `json:"name,omitempty"`
503
504
505
506
507
508
509
510 Operations []string `json:"operations,omitempty"`
511
512
513 googleapi.ServerResponse `json:"-"`
514
515
516
517
518
519 ForceSendFields []string `json:"-"`
520
521
522
523
524 NullFields []string `json:"-"`
525 }
526
527 func (s *EntityType) MarshalJSON() ([]byte, error) {
528 type NoMethod EntityType
529 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
530 }
531
532
533
534 type ExchangeAuthCodeRequest struct {
535 }
536
537
538
539 type ExchangeAuthCodeResponse struct {
540 AccessCredentials *AccessCredentials `json:"accessCredentials,omitempty"`
541
542
543 googleapi.ServerResponse `json:"-"`
544
545
546
547
548
549 ForceSendFields []string `json:"-"`
550
551
552
553
554 NullFields []string `json:"-"`
555 }
556
557 func (s *ExchangeAuthCodeResponse) MarshalJSON() ([]byte, error) {
558 type NoMethod ExchangeAuthCodeResponse
559 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
560 }
561
562
563 type ExecuteActionRequest struct {
564
565
566 Parameters googleapi.RawMessage `json:"parameters,omitempty"`
567
568
569
570
571
572 ForceSendFields []string `json:"-"`
573
574
575
576
577 NullFields []string `json:"-"`
578 }
579
580 func (s *ExecuteActionRequest) MarshalJSON() ([]byte, error) {
581 type NoMethod ExecuteActionRequest
582 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
583 }
584
585
586 type ExecuteActionResponse struct {
587
588
589
590
591
592
593 Results []googleapi.RawMessage `json:"results,omitempty"`
594
595
596 googleapi.ServerResponse `json:"-"`
597
598
599
600
601
602 ForceSendFields []string `json:"-"`
603
604
605
606
607 NullFields []string `json:"-"`
608 }
609
610 func (s *ExecuteActionResponse) MarshalJSON() ([]byte, error) {
611 type NoMethod ExecuteActionResponse
612 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
613 }
614
615
616
617 type ExecuteSqlQueryRequest struct {
618
619
620
621 Query *Query `json:"query,omitempty"`
622
623
624
625
626
627 ForceSendFields []string `json:"-"`
628
629
630
631
632 NullFields []string `json:"-"`
633 }
634
635 func (s *ExecuteSqlQueryRequest) MarshalJSON() ([]byte, error) {
636 type NoMethod ExecuteSqlQueryRequest
637 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
638 }
639
640
641
642 type ExecuteSqlQueryResponse struct {
643
644
645
646
647
648 Results []googleapi.RawMessage `json:"results,omitempty"`
649
650
651 googleapi.ServerResponse `json:"-"`
652
653
654
655
656
657 ForceSendFields []string `json:"-"`
658
659
660
661
662 NullFields []string `json:"-"`
663 }
664
665 func (s *ExecuteSqlQueryResponse) MarshalJSON() ([]byte, error) {
666 type NoMethod ExecuteSqlQueryResponse
667 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
668 }
669
670
671 type Field struct {
672
673
674
675 AdditionalDetails googleapi.RawMessage `json:"additionalDetails,omitempty"`
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
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 DataType string `json:"dataType,omitempty"`
725
726
727 DefaultValue interface{} `json:"defaultValue,omitempty"`
728
729 Description string `json:"description,omitempty"`
730
731
732 JsonSchema *JsonSchema `json:"jsonSchema,omitempty"`
733
734
735 Key bool `json:"key,omitempty"`
736
737 Name string `json:"name,omitempty"`
738
739 Nullable bool `json:"nullable,omitempty"`
740
741
742 Reference *Reference `json:"reference,omitempty"`
743
744
745
746
747
748 ForceSendFields []string `json:"-"`
749
750
751
752
753 NullFields []string `json:"-"`
754 }
755
756 func (s *Field) MarshalJSON() ([]byte, error) {
757 type NoMethod Field
758 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
759 }
760
761
762
763 type InputParameter struct {
764
765
766
767 AdditionalDetails googleapi.RawMessage `json:"additionalDetails,omitempty"`
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816 DataType string `json:"dataType,omitempty"`
817
818
819 DefaultValue interface{} `json:"defaultValue,omitempty"`
820
821 Description string `json:"description,omitempty"`
822
823
824 JsonSchema *JsonSchema `json:"jsonSchema,omitempty"`
825
826 Name string `json:"name,omitempty"`
827
828 Nullable bool `json:"nullable,omitempty"`
829
830
831
832
833
834 ForceSendFields []string `json:"-"`
835
836
837
838
839 NullFields []string `json:"-"`
840 }
841
842 func (s *InputParameter) MarshalJSON() ([]byte, error) {
843 type NoMethod InputParameter
844 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
845 }
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866 type Instance struct {
867
868
869
870
871
872
873 ConsumerDefinedName string `json:"consumerDefinedName,omitempty"`
874
875 CreateTime string `json:"createTime,omitempty"`
876
877
878
879
880
881
882 InstanceType string `json:"instanceType,omitempty"`
883
884
885
886 Labels map[string]string `json:"labels,omitempty"`
887
888
889
890
891
892 MaintenancePolicyNames map[string]string `json:"maintenancePolicyNames,omitempty"`
893
894
895
896 MaintenanceSchedules map[string]MaintenanceSchedule `json:"maintenanceSchedules,omitempty"`
897
898
899 MaintenanceSettings *MaintenanceSettings `json:"maintenanceSettings,omitempty"`
900
901
902
903
904
905
906 Name string `json:"name,omitempty"`
907
908
909
910
911 NotificationParameters map[string]NotificationParameter `json:"notificationParameters,omitempty"`
912
913
914
915 ProducerMetadata map[string]string `json:"producerMetadata,omitempty"`
916
917
918
919 ProvisionedResources []*ProvisionedResource `json:"provisionedResources,omitempty"`
920
921
922
923
924 SlmInstanceTemplate string `json:"slmInstanceTemplate,omitempty"`
925
926
927
928 SloMetadata *SloMetadata `json:"sloMetadata,omitempty"`
929
930
931 SoftwareVersions map[string]string `json:"softwareVersions,omitempty"`
932
933
934
935
936
937
938
939
940
941
942
943 State string `json:"state,omitempty"`
944
945
946 TenantProjectId string `json:"tenantProjectId,omitempty"`
947
948 UpdateTime string `json:"updateTime,omitempty"`
949
950
951
952
953
954 ForceSendFields []string `json:"-"`
955
956
957
958
959 NullFields []string `json:"-"`
960 }
961
962 func (s *Instance) MarshalJSON() ([]byte, error) {
963 type NoMethod Instance
964 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
965 }
966
967
968 type JsonSchema struct {
969
970
971 AdditionalDetails googleapi.RawMessage `json:"additionalDetails,omitempty"`
972
973 Default interface{} `json:"default,omitempty"`
974
975 Description string `json:"description,omitempty"`
976
977
978 Enum []interface{} `json:"enum,omitempty"`
979
980
981 Format string `json:"format,omitempty"`
982
983
984 Items *JsonSchema `json:"items,omitempty"`
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033 JdbcType string `json:"jdbcType,omitempty"`
1034
1035
1036
1037 Properties map[string]JsonSchema `json:"properties,omitempty"`
1038
1039 Required []string `json:"required,omitempty"`
1040
1041 Type []string `json:"type,omitempty"`
1042
1043
1044
1045
1046
1047 ForceSendFields []string `json:"-"`
1048
1049
1050
1051
1052 NullFields []string `json:"-"`
1053 }
1054
1055 func (s *JsonSchema) MarshalJSON() ([]byte, error) {
1056 type NoMethod JsonSchema
1057 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1058 }
1059
1060
1061 type ListActionsResponse struct {
1062
1063 Actions []*Action `json:"actions,omitempty"`
1064
1065 NextPageToken string `json:"nextPageToken,omitempty"`
1066
1067
1068 UnsupportedActionNames []string `json:"unsupportedActionNames,omitempty"`
1069
1070
1071 googleapi.ServerResponse `json:"-"`
1072
1073
1074
1075
1076
1077 ForceSendFields []string `json:"-"`
1078
1079
1080
1081
1082 NullFields []string `json:"-"`
1083 }
1084
1085 func (s *ListActionsResponse) MarshalJSON() ([]byte, error) {
1086 type NoMethod ListActionsResponse
1087 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1088 }
1089
1090
1091 type ListEntitiesResponse struct {
1092
1093 Entities []*Entity `json:"entities,omitempty"`
1094
1095 NextPageToken string `json:"nextPageToken,omitempty"`
1096
1097
1098 googleapi.ServerResponse `json:"-"`
1099
1100
1101
1102
1103
1104 ForceSendFields []string `json:"-"`
1105
1106
1107
1108
1109 NullFields []string `json:"-"`
1110 }
1111
1112 func (s *ListEntitiesResponse) MarshalJSON() ([]byte, error) {
1113 type NoMethod ListEntitiesResponse
1114 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1115 }
1116
1117
1118 type ListEntityTypesResponse struct {
1119
1120 NextPageToken string `json:"nextPageToken,omitempty"`
1121
1122 Types []*EntityType `json:"types,omitempty"`
1123
1124
1125 UnsupportedTypeNames []string `json:"unsupportedTypeNames,omitempty"`
1126
1127
1128 googleapi.ServerResponse `json:"-"`
1129
1130
1131
1132
1133
1134 ForceSendFields []string `json:"-"`
1135
1136
1137
1138
1139 NullFields []string `json:"-"`
1140 }
1141
1142 func (s *ListEntityTypesResponse) MarshalJSON() ([]byte, error) {
1143 type NoMethod ListEntityTypesResponse
1144 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1145 }
1146
1147
1148 type MaintenancePolicy struct {
1149
1150 CreateTime string `json:"createTime,omitempty"`
1151
1152
1153 Description string `json:"description,omitempty"`
1154
1155
1156
1157 Labels map[string]string `json:"labels,omitempty"`
1158
1159
1160
1161
1162
1163
1164 Name string `json:"name,omitempty"`
1165
1166
1167
1168
1169
1170
1171
1172 State string `json:"state,omitempty"`
1173
1174 UpdatePolicy *UpdatePolicy `json:"updatePolicy,omitempty"`
1175
1176 UpdateTime string `json:"updateTime,omitempty"`
1177
1178
1179
1180
1181
1182 ForceSendFields []string `json:"-"`
1183
1184
1185
1186
1187 NullFields []string `json:"-"`
1188 }
1189
1190 func (s *MaintenancePolicy) MarshalJSON() ([]byte, error) {
1191 type NoMethod MaintenancePolicy
1192 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1193 }
1194
1195
1196
1197
1198 type MaintenanceSchedule struct {
1199
1200
1201
1202 CanReschedule bool `json:"canReschedule,omitempty"`
1203
1204 EndTime string `json:"endTime,omitempty"`
1205
1206
1207
1208 RolloutManagementPolicy string `json:"rolloutManagementPolicy,omitempty"`
1209
1210
1211
1212
1213 ScheduleDeadlineTime string `json:"scheduleDeadlineTime,omitempty"`
1214
1215 StartTime string `json:"startTime,omitempty"`
1216
1217
1218
1219
1220
1221 ForceSendFields []string `json:"-"`
1222
1223
1224
1225
1226 NullFields []string `json:"-"`
1227 }
1228
1229 func (s *MaintenanceSchedule) MarshalJSON() ([]byte, error) {
1230 type NoMethod MaintenanceSchedule
1231 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1232 }
1233
1234
1235
1236
1237 type MaintenanceSettings struct {
1238
1239
1240
1241 Exclude bool `json:"exclude,omitempty"`
1242
1243
1244 IsRollback bool `json:"isRollback,omitempty"`
1245
1246
1247
1248
1249
1250
1251 MaintenancePolicies map[string]MaintenancePolicy `json:"maintenancePolicies,omitempty"`
1252
1253
1254
1255
1256
1257 ForceSendFields []string `json:"-"`
1258
1259
1260
1261
1262 NullFields []string `json:"-"`
1263 }
1264
1265 func (s *MaintenanceSettings) MarshalJSON() ([]byte, error) {
1266 type NoMethod MaintenanceSettings
1267 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1268 }
1269
1270
1271 type MaintenanceWindow struct {
1272
1273 DailyCycle *DailyCycle `json:"dailyCycle,omitempty"`
1274
1275 WeeklyCycle *WeeklyCycle `json:"weeklyCycle,omitempty"`
1276
1277
1278
1279
1280
1281 ForceSendFields []string `json:"-"`
1282
1283
1284
1285
1286 NullFields []string `json:"-"`
1287 }
1288
1289 func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) {
1290 type NoMethod MaintenanceWindow
1291 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1292 }
1293
1294
1295
1296
1297
1298 type NodeSloMetadata struct {
1299
1300 Location string `json:"location,omitempty"`
1301
1302
1303 NodeId string `json:"nodeId,omitempty"`
1304
1305
1306 PerSliEligibility *PerSliSloEligibility `json:"perSliEligibility,omitempty"`
1307
1308
1309
1310
1311
1312 ForceSendFields []string `json:"-"`
1313
1314
1315
1316
1317 NullFields []string `json:"-"`
1318 }
1319
1320 func (s *NodeSloMetadata) MarshalJSON() ([]byte, error) {
1321 type NoMethod NodeSloMetadata
1322 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1323 }
1324
1325
1326 type NotificationParameter struct {
1327
1328
1329 Values []string `json:"values,omitempty"`
1330
1331
1332
1333
1334
1335 ForceSendFields []string `json:"-"`
1336
1337
1338
1339
1340 NullFields []string `json:"-"`
1341 }
1342
1343 func (s *NotificationParameter) MarshalJSON() ([]byte, error) {
1344 type NoMethod NotificationParameter
1345 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1346 }
1347
1348
1349
1350 type PerSliSloEligibility struct {
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363 Eligibilities map[string]SloEligibility `json:"eligibilities,omitempty"`
1364
1365
1366
1367
1368
1369 ForceSendFields []string `json:"-"`
1370
1371
1372
1373
1374 NullFields []string `json:"-"`
1375 }
1376
1377 func (s *PerSliSloEligibility) MarshalJSON() ([]byte, error) {
1378 type NoMethod PerSliSloEligibility
1379 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1380 }
1381
1382
1383 type ProvisionedResource struct {
1384
1385
1386
1387
1388
1389
1390 ResourceType string `json:"resourceType,omitempty"`
1391
1392
1393 ResourceUrl string `json:"resourceUrl,omitempty"`
1394
1395
1396
1397
1398
1399 ForceSendFields []string `json:"-"`
1400
1401
1402
1403
1404 NullFields []string `json:"-"`
1405 }
1406
1407 func (s *ProvisionedResource) MarshalJSON() ([]byte, error) {
1408 type NoMethod ProvisionedResource
1409 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1410 }
1411
1412
1413
1414
1415 type Query struct {
1416
1417
1418 MaxRows int64 `json:"maxRows,omitempty,string"`
1419
1420 Query string `json:"query,omitempty"`
1421
1422
1423 QueryParameters []*QueryParameter `json:"queryParameters,omitempty"`
1424
1425
1426 Timeout int64 `json:"timeout,omitempty,string"`
1427
1428
1429
1430
1431
1432 ForceSendFields []string `json:"-"`
1433
1434
1435
1436
1437 NullFields []string `json:"-"`
1438 }
1439
1440 func (s *Query) MarshalJSON() ([]byte, error) {
1441 type NoMethod Query
1442 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1443 }
1444
1445
1446 type QueryParameter struct {
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493 DataType string `json:"dataType,omitempty"`
1494 Value interface{} `json:"value,omitempty"`
1495
1496
1497
1498
1499
1500 ForceSendFields []string `json:"-"`
1501
1502
1503
1504
1505 NullFields []string `json:"-"`
1506 }
1507
1508 func (s *QueryParameter) MarshalJSON() ([]byte, error) {
1509 type NoMethod QueryParameter
1510 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1511 }
1512
1513 type Reference struct {
1514
1515 Name string `json:"name,omitempty"`
1516
1517 Type string `json:"type,omitempty"`
1518
1519
1520
1521
1522
1523 ForceSendFields []string `json:"-"`
1524
1525
1526
1527
1528 NullFields []string `json:"-"`
1529 }
1530
1531 func (s *Reference) MarshalJSON() ([]byte, error) {
1532 type NoMethod Reference
1533 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1534 }
1535
1536
1537
1538 type RefreshAccessTokenRequest struct {
1539 }
1540
1541
1542
1543 type RefreshAccessTokenResponse struct {
1544 AccessCredentials *AccessCredentials `json:"accessCredentials,omitempty"`
1545
1546
1547 googleapi.ServerResponse `json:"-"`
1548
1549
1550
1551
1552
1553 ForceSendFields []string `json:"-"`
1554
1555
1556
1557
1558 NullFields []string `json:"-"`
1559 }
1560
1561 func (s *RefreshAccessTokenResponse) MarshalJSON() ([]byte, error) {
1562 type NoMethod RefreshAccessTokenResponse
1563 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1564 }
1565
1566
1567
1568 type ResultMetadata struct {
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617 DataType string `json:"dataType,omitempty"`
1618
1619 Description string `json:"description,omitempty"`
1620
1621
1622 JsonSchema *JsonSchema `json:"jsonSchema,omitempty"`
1623
1624 Name string `json:"name,omitempty"`
1625
1626
1627
1628
1629
1630 ForceSendFields []string `json:"-"`
1631
1632
1633
1634
1635 NullFields []string `json:"-"`
1636 }
1637
1638 func (s *ResultMetadata) MarshalJSON() ([]byte, error) {
1639 type NoMethod ResultMetadata
1640 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1641 }
1642
1643
1644 type Schedule struct {
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656 Day string `json:"day,omitempty"`
1657
1658 Duration string `json:"duration,omitempty"`
1659
1660 StartTime *TimeOfDay `json:"startTime,omitempty"`
1661
1662
1663
1664
1665
1666 ForceSendFields []string `json:"-"`
1667
1668
1669
1670
1671 NullFields []string `json:"-"`
1672 }
1673
1674 func (s *Schedule) MarshalJSON() ([]byte, error) {
1675 type NoMethod Schedule
1676 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1677 }
1678
1679
1680
1681
1682 type SloEligibility struct {
1683
1684 Eligible bool `json:"eligible,omitempty"`
1685
1686
1687
1688 Reason string `json:"reason,omitempty"`
1689
1690
1691
1692
1693
1694 ForceSendFields []string `json:"-"`
1695
1696
1697
1698
1699 NullFields []string `json:"-"`
1700 }
1701
1702 func (s *SloEligibility) MarshalJSON() ([]byte, error) {
1703 type NoMethod SloEligibility
1704 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1705 }
1706
1707
1708
1709 type SloMetadata struct {
1710
1711
1712
1713
1714 Nodes []*NodeSloMetadata `json:"nodes,omitempty"`
1715
1716
1717 PerSliEligibility *PerSliSloEligibility `json:"perSliEligibility,omitempty"`
1718
1719
1720
1721 Tier string `json:"tier,omitempty"`
1722
1723
1724
1725
1726
1727 ForceSendFields []string `json:"-"`
1728
1729
1730
1731
1732 NullFields []string `json:"-"`
1733 }
1734
1735 func (s *SloMetadata) MarshalJSON() ([]byte, error) {
1736 type NoMethod SloMetadata
1737 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1738 }
1739
1740
1741
1742
1743 type TimeOfDay struct {
1744
1745
1746
1747 Hours int64 `json:"hours,omitempty"`
1748
1749 Minutes int64 `json:"minutes,omitempty"`
1750
1751 Nanos int64 `json:"nanos,omitempty"`
1752
1753
1754 Seconds int64 `json:"seconds,omitempty"`
1755
1756
1757
1758
1759
1760 ForceSendFields []string `json:"-"`
1761
1762
1763
1764
1765 NullFields []string `json:"-"`
1766 }
1767
1768 func (s *TimeOfDay) MarshalJSON() ([]byte, error) {
1769 type NoMethod TimeOfDay
1770 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1771 }
1772
1773
1774
1775 type UpdateEntitiesWithConditionsResponse struct {
1776
1777 Response googleapi.RawMessage `json:"response,omitempty"`
1778
1779
1780 googleapi.ServerResponse `json:"-"`
1781
1782
1783
1784
1785
1786 ForceSendFields []string `json:"-"`
1787
1788
1789
1790
1791 NullFields []string `json:"-"`
1792 }
1793
1794 func (s *UpdateEntitiesWithConditionsResponse) MarshalJSON() ([]byte, error) {
1795 type NoMethod UpdateEntitiesWithConditionsResponse
1796 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1797 }
1798
1799
1800 type UpdatePolicy struct {
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820 Channel string `json:"channel,omitempty"`
1821
1822
1823
1824
1825 DenyMaintenancePeriods []*DenyMaintenancePeriod `json:"denyMaintenancePeriods,omitempty"`
1826
1827
1828 Window *MaintenanceWindow `json:"window,omitempty"`
1829
1830
1831
1832
1833
1834 ForceSendFields []string `json:"-"`
1835
1836
1837
1838
1839 NullFields []string `json:"-"`
1840 }
1841
1842 func (s *UpdatePolicy) MarshalJSON() ([]byte, error) {
1843 type NoMethod UpdatePolicy
1844 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1845 }
1846
1847
1848 type WeeklyCycle struct {
1849
1850 Schedule []*Schedule `json:"schedule,omitempty"`
1851
1852
1853
1854
1855
1856 ForceSendFields []string `json:"-"`
1857
1858
1859
1860
1861 NullFields []string `json:"-"`
1862 }
1863
1864 func (s *WeeklyCycle) MarshalJSON() ([]byte, error) {
1865 type NoMethod WeeklyCycle
1866 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1867 }
1868
1869 type ProjectsLocationsConnectionsCheckReadinessCall struct {
1870 s *Service
1871 name string
1872 urlParams_ gensupport.URLParams
1873 ifNoneMatch_ string
1874 ctx_ context.Context
1875 header_ http.Header
1876 }
1877
1878
1879
1880
1881
1882 func (r *ProjectsLocationsConnectionsService) CheckReadiness(name string) *ProjectsLocationsConnectionsCheckReadinessCall {
1883 c := &ProjectsLocationsConnectionsCheckReadinessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1884 c.name = name
1885 return c
1886 }
1887
1888
1889
1890
1891 func (c *ProjectsLocationsConnectionsCheckReadinessCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsCheckReadinessCall {
1892 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1893 return c
1894 }
1895
1896
1897
1898
1899 func (c *ProjectsLocationsConnectionsCheckReadinessCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionsCheckReadinessCall {
1900 c.ifNoneMatch_ = entityTag
1901 return c
1902 }
1903
1904
1905 func (c *ProjectsLocationsConnectionsCheckReadinessCall) Context(ctx context.Context) *ProjectsLocationsConnectionsCheckReadinessCall {
1906 c.ctx_ = ctx
1907 return c
1908 }
1909
1910
1911
1912 func (c *ProjectsLocationsConnectionsCheckReadinessCall) Header() http.Header {
1913 if c.header_ == nil {
1914 c.header_ = make(http.Header)
1915 }
1916 return c.header_
1917 }
1918
1919 func (c *ProjectsLocationsConnectionsCheckReadinessCall) doRequest(alt string) (*http.Response, error) {
1920 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1921 if c.ifNoneMatch_ != "" {
1922 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1923 }
1924 var body io.Reader = nil
1925 c.urlParams_.Set("alt", alt)
1926 c.urlParams_.Set("prettyPrint", "false")
1927 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:checkReadiness")
1928 urls += "?" + c.urlParams_.Encode()
1929 req, err := http.NewRequest("GET", urls, body)
1930 if err != nil {
1931 return nil, err
1932 }
1933 req.Header = reqHeaders
1934 googleapi.Expand(req.URL, map[string]string{
1935 "name": c.name,
1936 })
1937 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1938 }
1939
1940
1941
1942
1943
1944
1945
1946 func (c *ProjectsLocationsConnectionsCheckReadinessCall) Do(opts ...googleapi.CallOption) (*CheckReadinessResponse, error) {
1947 gensupport.SetOptions(c.urlParams_, opts...)
1948 res, err := c.doRequest("json")
1949 if res != nil && res.StatusCode == http.StatusNotModified {
1950 if res.Body != nil {
1951 res.Body.Close()
1952 }
1953 return nil, gensupport.WrapError(&googleapi.Error{
1954 Code: res.StatusCode,
1955 Header: res.Header,
1956 })
1957 }
1958 if err != nil {
1959 return nil, err
1960 }
1961 defer googleapi.CloseBody(res)
1962 if err := googleapi.CheckResponse(res); err != nil {
1963 return nil, gensupport.WrapError(err)
1964 }
1965 ret := &CheckReadinessResponse{
1966 ServerResponse: googleapi.ServerResponse{
1967 Header: res.Header,
1968 HTTPStatusCode: res.StatusCode,
1969 },
1970 }
1971 target := &ret
1972 if err := gensupport.DecodeResponse(target, res); err != nil {
1973 return nil, err
1974 }
1975 return ret, nil
1976 }
1977
1978 type ProjectsLocationsConnectionsCheckStatusCall struct {
1979 s *Service
1980 name string
1981 urlParams_ gensupport.URLParams
1982 ifNoneMatch_ string
1983 ctx_ context.Context
1984 header_ http.Header
1985 }
1986
1987
1988
1989
1990
1991
1992
1993
1994 func (r *ProjectsLocationsConnectionsService) CheckStatus(name string) *ProjectsLocationsConnectionsCheckStatusCall {
1995 c := &ProjectsLocationsConnectionsCheckStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1996 c.name = name
1997 return c
1998 }
1999
2000
2001
2002
2003 func (c *ProjectsLocationsConnectionsCheckStatusCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsCheckStatusCall {
2004 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2005 return c
2006 }
2007
2008
2009
2010
2011 func (c *ProjectsLocationsConnectionsCheckStatusCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionsCheckStatusCall {
2012 c.ifNoneMatch_ = entityTag
2013 return c
2014 }
2015
2016
2017 func (c *ProjectsLocationsConnectionsCheckStatusCall) Context(ctx context.Context) *ProjectsLocationsConnectionsCheckStatusCall {
2018 c.ctx_ = ctx
2019 return c
2020 }
2021
2022
2023
2024 func (c *ProjectsLocationsConnectionsCheckStatusCall) Header() http.Header {
2025 if c.header_ == nil {
2026 c.header_ = make(http.Header)
2027 }
2028 return c.header_
2029 }
2030
2031 func (c *ProjectsLocationsConnectionsCheckStatusCall) doRequest(alt string) (*http.Response, error) {
2032 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2033 if c.ifNoneMatch_ != "" {
2034 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2035 }
2036 var body io.Reader = nil
2037 c.urlParams_.Set("alt", alt)
2038 c.urlParams_.Set("prettyPrint", "false")
2039 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:checkStatus")
2040 urls += "?" + c.urlParams_.Encode()
2041 req, err := http.NewRequest("GET", urls, body)
2042 if err != nil {
2043 return nil, err
2044 }
2045 req.Header = reqHeaders
2046 googleapi.Expand(req.URL, map[string]string{
2047 "name": c.name,
2048 })
2049 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2050 }
2051
2052
2053
2054
2055
2056
2057
2058 func (c *ProjectsLocationsConnectionsCheckStatusCall) Do(opts ...googleapi.CallOption) (*CheckStatusResponse, error) {
2059 gensupport.SetOptions(c.urlParams_, opts...)
2060 res, err := c.doRequest("json")
2061 if res != nil && res.StatusCode == http.StatusNotModified {
2062 if res.Body != nil {
2063 res.Body.Close()
2064 }
2065 return nil, gensupport.WrapError(&googleapi.Error{
2066 Code: res.StatusCode,
2067 Header: res.Header,
2068 })
2069 }
2070 if err != nil {
2071 return nil, err
2072 }
2073 defer googleapi.CloseBody(res)
2074 if err := googleapi.CheckResponse(res); err != nil {
2075 return nil, gensupport.WrapError(err)
2076 }
2077 ret := &CheckStatusResponse{
2078 ServerResponse: googleapi.ServerResponse{
2079 Header: res.Header,
2080 HTTPStatusCode: res.StatusCode,
2081 },
2082 }
2083 target := &ret
2084 if err := gensupport.DecodeResponse(target, res); err != nil {
2085 return nil, err
2086 }
2087 return ret, nil
2088 }
2089
2090 type ProjectsLocationsConnectionsExchangeAuthCodeCall struct {
2091 s *Service
2092 name string
2093 exchangeauthcoderequest *ExchangeAuthCodeRequest
2094 urlParams_ gensupport.URLParams
2095 ctx_ context.Context
2096 header_ http.Header
2097 }
2098
2099
2100
2101
2102
2103 func (r *ProjectsLocationsConnectionsService) ExchangeAuthCode(name string, exchangeauthcoderequest *ExchangeAuthCodeRequest) *ProjectsLocationsConnectionsExchangeAuthCodeCall {
2104 c := &ProjectsLocationsConnectionsExchangeAuthCodeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2105 c.name = name
2106 c.exchangeauthcoderequest = exchangeauthcoderequest
2107 return c
2108 }
2109
2110
2111
2112
2113 func (c *ProjectsLocationsConnectionsExchangeAuthCodeCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsExchangeAuthCodeCall {
2114 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2115 return c
2116 }
2117
2118
2119 func (c *ProjectsLocationsConnectionsExchangeAuthCodeCall) Context(ctx context.Context) *ProjectsLocationsConnectionsExchangeAuthCodeCall {
2120 c.ctx_ = ctx
2121 return c
2122 }
2123
2124
2125
2126 func (c *ProjectsLocationsConnectionsExchangeAuthCodeCall) Header() http.Header {
2127 if c.header_ == nil {
2128 c.header_ = make(http.Header)
2129 }
2130 return c.header_
2131 }
2132
2133 func (c *ProjectsLocationsConnectionsExchangeAuthCodeCall) doRequest(alt string) (*http.Response, error) {
2134 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2135 var body io.Reader = nil
2136 body, err := googleapi.WithoutDataWrapper.JSONReader(c.exchangeauthcoderequest)
2137 if err != nil {
2138 return nil, err
2139 }
2140 c.urlParams_.Set("alt", alt)
2141 c.urlParams_.Set("prettyPrint", "false")
2142 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:exchangeAuthCode")
2143 urls += "?" + c.urlParams_.Encode()
2144 req, err := http.NewRequest("POST", urls, body)
2145 if err != nil {
2146 return nil, err
2147 }
2148 req.Header = reqHeaders
2149 googleapi.Expand(req.URL, map[string]string{
2150 "name": c.name,
2151 })
2152 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2153 }
2154
2155
2156
2157
2158
2159
2160
2161 func (c *ProjectsLocationsConnectionsExchangeAuthCodeCall) Do(opts ...googleapi.CallOption) (*ExchangeAuthCodeResponse, error) {
2162 gensupport.SetOptions(c.urlParams_, opts...)
2163 res, err := c.doRequest("json")
2164 if res != nil && res.StatusCode == http.StatusNotModified {
2165 if res.Body != nil {
2166 res.Body.Close()
2167 }
2168 return nil, gensupport.WrapError(&googleapi.Error{
2169 Code: res.StatusCode,
2170 Header: res.Header,
2171 })
2172 }
2173 if err != nil {
2174 return nil, err
2175 }
2176 defer googleapi.CloseBody(res)
2177 if err := googleapi.CheckResponse(res); err != nil {
2178 return nil, gensupport.WrapError(err)
2179 }
2180 ret := &ExchangeAuthCodeResponse{
2181 ServerResponse: googleapi.ServerResponse{
2182 Header: res.Header,
2183 HTTPStatusCode: res.StatusCode,
2184 },
2185 }
2186 target := &ret
2187 if err := gensupport.DecodeResponse(target, res); err != nil {
2188 return nil, err
2189 }
2190 return ret, nil
2191 }
2192
2193 type ProjectsLocationsConnectionsExecuteSqlQueryCall struct {
2194 s *Service
2195 connection string
2196 executesqlqueryrequest *ExecuteSqlQueryRequest
2197 urlParams_ gensupport.URLParams
2198 ctx_ context.Context
2199 header_ http.Header
2200 }
2201
2202
2203
2204
2205
2206
2207
2208
2209 func (r *ProjectsLocationsConnectionsService) ExecuteSqlQuery(connection string, executesqlqueryrequest *ExecuteSqlQueryRequest) *ProjectsLocationsConnectionsExecuteSqlQueryCall {
2210 c := &ProjectsLocationsConnectionsExecuteSqlQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2211 c.connection = connection
2212 c.executesqlqueryrequest = executesqlqueryrequest
2213 return c
2214 }
2215
2216
2217
2218
2219 func (c *ProjectsLocationsConnectionsExecuteSqlQueryCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsExecuteSqlQueryCall {
2220 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2221 return c
2222 }
2223
2224
2225 func (c *ProjectsLocationsConnectionsExecuteSqlQueryCall) Context(ctx context.Context) *ProjectsLocationsConnectionsExecuteSqlQueryCall {
2226 c.ctx_ = ctx
2227 return c
2228 }
2229
2230
2231
2232 func (c *ProjectsLocationsConnectionsExecuteSqlQueryCall) Header() http.Header {
2233 if c.header_ == nil {
2234 c.header_ = make(http.Header)
2235 }
2236 return c.header_
2237 }
2238
2239 func (c *ProjectsLocationsConnectionsExecuteSqlQueryCall) doRequest(alt string) (*http.Response, error) {
2240 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2241 var body io.Reader = nil
2242 body, err := googleapi.WithoutDataWrapper.JSONReader(c.executesqlqueryrequest)
2243 if err != nil {
2244 return nil, err
2245 }
2246 c.urlParams_.Set("alt", alt)
2247 c.urlParams_.Set("prettyPrint", "false")
2248 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+connection}:executeSqlQuery")
2249 urls += "?" + c.urlParams_.Encode()
2250 req, err := http.NewRequest("POST", urls, body)
2251 if err != nil {
2252 return nil, err
2253 }
2254 req.Header = reqHeaders
2255 googleapi.Expand(req.URL, map[string]string{
2256 "connection": c.connection,
2257 })
2258 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2259 }
2260
2261
2262
2263
2264
2265
2266
2267 func (c *ProjectsLocationsConnectionsExecuteSqlQueryCall) Do(opts ...googleapi.CallOption) (*ExecuteSqlQueryResponse, error) {
2268 gensupport.SetOptions(c.urlParams_, opts...)
2269 res, err := c.doRequest("json")
2270 if res != nil && res.StatusCode == http.StatusNotModified {
2271 if res.Body != nil {
2272 res.Body.Close()
2273 }
2274 return nil, gensupport.WrapError(&googleapi.Error{
2275 Code: res.StatusCode,
2276 Header: res.Header,
2277 })
2278 }
2279 if err != nil {
2280 return nil, err
2281 }
2282 defer googleapi.CloseBody(res)
2283 if err := googleapi.CheckResponse(res); err != nil {
2284 return nil, gensupport.WrapError(err)
2285 }
2286 ret := &ExecuteSqlQueryResponse{
2287 ServerResponse: googleapi.ServerResponse{
2288 Header: res.Header,
2289 HTTPStatusCode: res.StatusCode,
2290 },
2291 }
2292 target := &ret
2293 if err := gensupport.DecodeResponse(target, res); err != nil {
2294 return nil, err
2295 }
2296 return ret, nil
2297 }
2298
2299 type ProjectsLocationsConnectionsRefreshAccessTokenCall struct {
2300 s *Service
2301 name string
2302 refreshaccesstokenrequest *RefreshAccessTokenRequest
2303 urlParams_ gensupport.URLParams
2304 ctx_ context.Context
2305 header_ http.Header
2306 }
2307
2308
2309
2310
2311
2312
2313 func (r *ProjectsLocationsConnectionsService) RefreshAccessToken(name string, refreshaccesstokenrequest *RefreshAccessTokenRequest) *ProjectsLocationsConnectionsRefreshAccessTokenCall {
2314 c := &ProjectsLocationsConnectionsRefreshAccessTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2315 c.name = name
2316 c.refreshaccesstokenrequest = refreshaccesstokenrequest
2317 return c
2318 }
2319
2320
2321
2322
2323 func (c *ProjectsLocationsConnectionsRefreshAccessTokenCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsRefreshAccessTokenCall {
2324 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2325 return c
2326 }
2327
2328
2329 func (c *ProjectsLocationsConnectionsRefreshAccessTokenCall) Context(ctx context.Context) *ProjectsLocationsConnectionsRefreshAccessTokenCall {
2330 c.ctx_ = ctx
2331 return c
2332 }
2333
2334
2335
2336 func (c *ProjectsLocationsConnectionsRefreshAccessTokenCall) Header() http.Header {
2337 if c.header_ == nil {
2338 c.header_ = make(http.Header)
2339 }
2340 return c.header_
2341 }
2342
2343 func (c *ProjectsLocationsConnectionsRefreshAccessTokenCall) doRequest(alt string) (*http.Response, error) {
2344 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2345 var body io.Reader = nil
2346 body, err := googleapi.WithoutDataWrapper.JSONReader(c.refreshaccesstokenrequest)
2347 if err != nil {
2348 return nil, err
2349 }
2350 c.urlParams_.Set("alt", alt)
2351 c.urlParams_.Set("prettyPrint", "false")
2352 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:refreshAccessToken")
2353 urls += "?" + c.urlParams_.Encode()
2354 req, err := http.NewRequest("POST", urls, body)
2355 if err != nil {
2356 return nil, err
2357 }
2358 req.Header = reqHeaders
2359 googleapi.Expand(req.URL, map[string]string{
2360 "name": c.name,
2361 })
2362 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2363 }
2364
2365
2366
2367
2368
2369
2370
2371 func (c *ProjectsLocationsConnectionsRefreshAccessTokenCall) Do(opts ...googleapi.CallOption) (*RefreshAccessTokenResponse, error) {
2372 gensupport.SetOptions(c.urlParams_, opts...)
2373 res, err := c.doRequest("json")
2374 if res != nil && res.StatusCode == http.StatusNotModified {
2375 if res.Body != nil {
2376 res.Body.Close()
2377 }
2378 return nil, gensupport.WrapError(&googleapi.Error{
2379 Code: res.StatusCode,
2380 Header: res.Header,
2381 })
2382 }
2383 if err != nil {
2384 return nil, err
2385 }
2386 defer googleapi.CloseBody(res)
2387 if err := googleapi.CheckResponse(res); err != nil {
2388 return nil, gensupport.WrapError(err)
2389 }
2390 ret := &RefreshAccessTokenResponse{
2391 ServerResponse: googleapi.ServerResponse{
2392 Header: res.Header,
2393 HTTPStatusCode: res.StatusCode,
2394 },
2395 }
2396 target := &ret
2397 if err := gensupport.DecodeResponse(target, res); err != nil {
2398 return nil, err
2399 }
2400 return ret, nil
2401 }
2402
2403 type ProjectsLocationsConnectionsActionsExecuteCall struct {
2404 s *Service
2405 name string
2406 executeactionrequest *ExecuteActionRequest
2407 urlParams_ gensupport.URLParams
2408 ctx_ context.Context
2409 header_ http.Header
2410 }
2411
2412
2413
2414
2415
2416
2417
2418
2419 func (r *ProjectsLocationsConnectionsActionsService) Execute(name string, executeactionrequest *ExecuteActionRequest) *ProjectsLocationsConnectionsActionsExecuteCall {
2420 c := &ProjectsLocationsConnectionsActionsExecuteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2421 c.name = name
2422 c.executeactionrequest = executeactionrequest
2423 return c
2424 }
2425
2426
2427
2428
2429 func (c *ProjectsLocationsConnectionsActionsExecuteCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsActionsExecuteCall {
2430 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2431 return c
2432 }
2433
2434
2435 func (c *ProjectsLocationsConnectionsActionsExecuteCall) Context(ctx context.Context) *ProjectsLocationsConnectionsActionsExecuteCall {
2436 c.ctx_ = ctx
2437 return c
2438 }
2439
2440
2441
2442 func (c *ProjectsLocationsConnectionsActionsExecuteCall) Header() http.Header {
2443 if c.header_ == nil {
2444 c.header_ = make(http.Header)
2445 }
2446 return c.header_
2447 }
2448
2449 func (c *ProjectsLocationsConnectionsActionsExecuteCall) doRequest(alt string) (*http.Response, error) {
2450 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2451 var body io.Reader = nil
2452 body, err := googleapi.WithoutDataWrapper.JSONReader(c.executeactionrequest)
2453 if err != nil {
2454 return nil, err
2455 }
2456 c.urlParams_.Set("alt", alt)
2457 c.urlParams_.Set("prettyPrint", "false")
2458 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:execute")
2459 urls += "?" + c.urlParams_.Encode()
2460 req, err := http.NewRequest("POST", urls, body)
2461 if err != nil {
2462 return nil, err
2463 }
2464 req.Header = reqHeaders
2465 googleapi.Expand(req.URL, map[string]string{
2466 "name": c.name,
2467 })
2468 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2469 }
2470
2471
2472
2473
2474
2475
2476
2477 func (c *ProjectsLocationsConnectionsActionsExecuteCall) Do(opts ...googleapi.CallOption) (*ExecuteActionResponse, error) {
2478 gensupport.SetOptions(c.urlParams_, opts...)
2479 res, err := c.doRequest("json")
2480 if res != nil && res.StatusCode == http.StatusNotModified {
2481 if res.Body != nil {
2482 res.Body.Close()
2483 }
2484 return nil, gensupport.WrapError(&googleapi.Error{
2485 Code: res.StatusCode,
2486 Header: res.Header,
2487 })
2488 }
2489 if err != nil {
2490 return nil, err
2491 }
2492 defer googleapi.CloseBody(res)
2493 if err := googleapi.CheckResponse(res); err != nil {
2494 return nil, gensupport.WrapError(err)
2495 }
2496 ret := &ExecuteActionResponse{
2497 ServerResponse: googleapi.ServerResponse{
2498 Header: res.Header,
2499 HTTPStatusCode: res.StatusCode,
2500 },
2501 }
2502 target := &ret
2503 if err := gensupport.DecodeResponse(target, res); err != nil {
2504 return nil, err
2505 }
2506 return ret, nil
2507 }
2508
2509 type ProjectsLocationsConnectionsActionsGetCall struct {
2510 s *Service
2511 name string
2512 urlParams_ gensupport.URLParams
2513 ifNoneMatch_ string
2514 ctx_ context.Context
2515 header_ http.Header
2516 }
2517
2518
2519
2520
2521
2522
2523 func (r *ProjectsLocationsConnectionsActionsService) Get(name string) *ProjectsLocationsConnectionsActionsGetCall {
2524 c := &ProjectsLocationsConnectionsActionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2525 c.name = name
2526 return c
2527 }
2528
2529
2530
2531
2532 func (c *ProjectsLocationsConnectionsActionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsActionsGetCall {
2533 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2534 return c
2535 }
2536
2537
2538
2539
2540 func (c *ProjectsLocationsConnectionsActionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionsActionsGetCall {
2541 c.ifNoneMatch_ = entityTag
2542 return c
2543 }
2544
2545
2546 func (c *ProjectsLocationsConnectionsActionsGetCall) Context(ctx context.Context) *ProjectsLocationsConnectionsActionsGetCall {
2547 c.ctx_ = ctx
2548 return c
2549 }
2550
2551
2552
2553 func (c *ProjectsLocationsConnectionsActionsGetCall) Header() http.Header {
2554 if c.header_ == nil {
2555 c.header_ = make(http.Header)
2556 }
2557 return c.header_
2558 }
2559
2560 func (c *ProjectsLocationsConnectionsActionsGetCall) doRequest(alt string) (*http.Response, error) {
2561 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2562 if c.ifNoneMatch_ != "" {
2563 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2564 }
2565 var body io.Reader = nil
2566 c.urlParams_.Set("alt", alt)
2567 c.urlParams_.Set("prettyPrint", "false")
2568 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
2569 urls += "?" + c.urlParams_.Encode()
2570 req, err := http.NewRequest("GET", urls, body)
2571 if err != nil {
2572 return nil, err
2573 }
2574 req.Header = reqHeaders
2575 googleapi.Expand(req.URL, map[string]string{
2576 "name": c.name,
2577 })
2578 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2579 }
2580
2581
2582
2583
2584
2585
2586 func (c *ProjectsLocationsConnectionsActionsGetCall) Do(opts ...googleapi.CallOption) (*Action, error) {
2587 gensupport.SetOptions(c.urlParams_, opts...)
2588 res, err := c.doRequest("json")
2589 if res != nil && res.StatusCode == http.StatusNotModified {
2590 if res.Body != nil {
2591 res.Body.Close()
2592 }
2593 return nil, gensupport.WrapError(&googleapi.Error{
2594 Code: res.StatusCode,
2595 Header: res.Header,
2596 })
2597 }
2598 if err != nil {
2599 return nil, err
2600 }
2601 defer googleapi.CloseBody(res)
2602 if err := googleapi.CheckResponse(res); err != nil {
2603 return nil, gensupport.WrapError(err)
2604 }
2605 ret := &Action{
2606 ServerResponse: googleapi.ServerResponse{
2607 Header: res.Header,
2608 HTTPStatusCode: res.StatusCode,
2609 },
2610 }
2611 target := &ret
2612 if err := gensupport.DecodeResponse(target, res); err != nil {
2613 return nil, err
2614 }
2615 return ret, nil
2616 }
2617
2618 type ProjectsLocationsConnectionsActionsListCall struct {
2619 s *Service
2620 parent string
2621 urlParams_ gensupport.URLParams
2622 ifNoneMatch_ string
2623 ctx_ context.Context
2624 header_ http.Header
2625 }
2626
2627
2628
2629
2630
2631 func (r *ProjectsLocationsConnectionsActionsService) List(parent string) *ProjectsLocationsConnectionsActionsListCall {
2632 c := &ProjectsLocationsConnectionsActionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2633 c.parent = parent
2634 return c
2635 }
2636
2637
2638
2639 func (c *ProjectsLocationsConnectionsActionsListCall) PageSize(pageSize int64) *ProjectsLocationsConnectionsActionsListCall {
2640 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2641 return c
2642 }
2643
2644
2645
2646
2647 func (c *ProjectsLocationsConnectionsActionsListCall) PageToken(pageToken string) *ProjectsLocationsConnectionsActionsListCall {
2648 c.urlParams_.Set("pageToken", pageToken)
2649 return c
2650 }
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663 func (c *ProjectsLocationsConnectionsActionsListCall) View(view string) *ProjectsLocationsConnectionsActionsListCall {
2664 c.urlParams_.Set("view", view)
2665 return c
2666 }
2667
2668
2669
2670
2671 func (c *ProjectsLocationsConnectionsActionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsActionsListCall {
2672 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2673 return c
2674 }
2675
2676
2677
2678
2679 func (c *ProjectsLocationsConnectionsActionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionsActionsListCall {
2680 c.ifNoneMatch_ = entityTag
2681 return c
2682 }
2683
2684
2685 func (c *ProjectsLocationsConnectionsActionsListCall) Context(ctx context.Context) *ProjectsLocationsConnectionsActionsListCall {
2686 c.ctx_ = ctx
2687 return c
2688 }
2689
2690
2691
2692 func (c *ProjectsLocationsConnectionsActionsListCall) Header() http.Header {
2693 if c.header_ == nil {
2694 c.header_ = make(http.Header)
2695 }
2696 return c.header_
2697 }
2698
2699 func (c *ProjectsLocationsConnectionsActionsListCall) doRequest(alt string) (*http.Response, error) {
2700 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2701 if c.ifNoneMatch_ != "" {
2702 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2703 }
2704 var body io.Reader = nil
2705 c.urlParams_.Set("alt", alt)
2706 c.urlParams_.Set("prettyPrint", "false")
2707 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/actions")
2708 urls += "?" + c.urlParams_.Encode()
2709 req, err := http.NewRequest("GET", urls, body)
2710 if err != nil {
2711 return nil, err
2712 }
2713 req.Header = reqHeaders
2714 googleapi.Expand(req.URL, map[string]string{
2715 "parent": c.parent,
2716 })
2717 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2718 }
2719
2720
2721
2722
2723
2724
2725
2726 func (c *ProjectsLocationsConnectionsActionsListCall) Do(opts ...googleapi.CallOption) (*ListActionsResponse, error) {
2727 gensupport.SetOptions(c.urlParams_, opts...)
2728 res, err := c.doRequest("json")
2729 if res != nil && res.StatusCode == http.StatusNotModified {
2730 if res.Body != nil {
2731 res.Body.Close()
2732 }
2733 return nil, gensupport.WrapError(&googleapi.Error{
2734 Code: res.StatusCode,
2735 Header: res.Header,
2736 })
2737 }
2738 if err != nil {
2739 return nil, err
2740 }
2741 defer googleapi.CloseBody(res)
2742 if err := googleapi.CheckResponse(res); err != nil {
2743 return nil, gensupport.WrapError(err)
2744 }
2745 ret := &ListActionsResponse{
2746 ServerResponse: googleapi.ServerResponse{
2747 Header: res.Header,
2748 HTTPStatusCode: res.StatusCode,
2749 },
2750 }
2751 target := &ret
2752 if err := gensupport.DecodeResponse(target, res); err != nil {
2753 return nil, err
2754 }
2755 return ret, nil
2756 }
2757
2758
2759
2760
2761 func (c *ProjectsLocationsConnectionsActionsListCall) Pages(ctx context.Context, f func(*ListActionsResponse) error) error {
2762 c.ctx_ = ctx
2763 defer c.PageToken(c.urlParams_.Get("pageToken"))
2764 for {
2765 x, err := c.Do()
2766 if err != nil {
2767 return err
2768 }
2769 if err := f(x); err != nil {
2770 return err
2771 }
2772 if x.NextPageToken == "" {
2773 return nil
2774 }
2775 c.PageToken(x.NextPageToken)
2776 }
2777 }
2778
2779 type ProjectsLocationsConnectionsEntityTypesGetCall struct {
2780 s *Service
2781 name string
2782 urlParams_ gensupport.URLParams
2783 ifNoneMatch_ string
2784 ctx_ context.Context
2785 header_ http.Header
2786 }
2787
2788
2789
2790
2791
2792
2793 func (r *ProjectsLocationsConnectionsEntityTypesService) Get(name string) *ProjectsLocationsConnectionsEntityTypesGetCall {
2794 c := &ProjectsLocationsConnectionsEntityTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2795 c.name = name
2796 return c
2797 }
2798
2799
2800
2801
2802 func (c *ProjectsLocationsConnectionsEntityTypesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsEntityTypesGetCall {
2803 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2804 return c
2805 }
2806
2807
2808
2809
2810 func (c *ProjectsLocationsConnectionsEntityTypesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionsEntityTypesGetCall {
2811 c.ifNoneMatch_ = entityTag
2812 return c
2813 }
2814
2815
2816 func (c *ProjectsLocationsConnectionsEntityTypesGetCall) Context(ctx context.Context) *ProjectsLocationsConnectionsEntityTypesGetCall {
2817 c.ctx_ = ctx
2818 return c
2819 }
2820
2821
2822
2823 func (c *ProjectsLocationsConnectionsEntityTypesGetCall) Header() http.Header {
2824 if c.header_ == nil {
2825 c.header_ = make(http.Header)
2826 }
2827 return c.header_
2828 }
2829
2830 func (c *ProjectsLocationsConnectionsEntityTypesGetCall) doRequest(alt string) (*http.Response, error) {
2831 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2832 if c.ifNoneMatch_ != "" {
2833 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2834 }
2835 var body io.Reader = nil
2836 c.urlParams_.Set("alt", alt)
2837 c.urlParams_.Set("prettyPrint", "false")
2838 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
2839 urls += "?" + c.urlParams_.Encode()
2840 req, err := http.NewRequest("GET", urls, body)
2841 if err != nil {
2842 return nil, err
2843 }
2844 req.Header = reqHeaders
2845 googleapi.Expand(req.URL, map[string]string{
2846 "name": c.name,
2847 })
2848 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2849 }
2850
2851
2852
2853
2854
2855
2856 func (c *ProjectsLocationsConnectionsEntityTypesGetCall) Do(opts ...googleapi.CallOption) (*EntityType, error) {
2857 gensupport.SetOptions(c.urlParams_, opts...)
2858 res, err := c.doRequest("json")
2859 if res != nil && res.StatusCode == http.StatusNotModified {
2860 if res.Body != nil {
2861 res.Body.Close()
2862 }
2863 return nil, gensupport.WrapError(&googleapi.Error{
2864 Code: res.StatusCode,
2865 Header: res.Header,
2866 })
2867 }
2868 if err != nil {
2869 return nil, err
2870 }
2871 defer googleapi.CloseBody(res)
2872 if err := googleapi.CheckResponse(res); err != nil {
2873 return nil, gensupport.WrapError(err)
2874 }
2875 ret := &EntityType{
2876 ServerResponse: googleapi.ServerResponse{
2877 Header: res.Header,
2878 HTTPStatusCode: res.StatusCode,
2879 },
2880 }
2881 target := &ret
2882 if err := gensupport.DecodeResponse(target, res); err != nil {
2883 return nil, err
2884 }
2885 return ret, nil
2886 }
2887
2888 type ProjectsLocationsConnectionsEntityTypesListCall struct {
2889 s *Service
2890 parent string
2891 urlParams_ gensupport.URLParams
2892 ifNoneMatch_ string
2893 ctx_ context.Context
2894 header_ http.Header
2895 }
2896
2897
2898
2899
2900
2901
2902 func (r *ProjectsLocationsConnectionsEntityTypesService) List(parent string) *ProjectsLocationsConnectionsEntityTypesListCall {
2903 c := &ProjectsLocationsConnectionsEntityTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2904 c.parent = parent
2905 return c
2906 }
2907
2908
2909
2910 func (c *ProjectsLocationsConnectionsEntityTypesListCall) PageSize(pageSize int64) *ProjectsLocationsConnectionsEntityTypesListCall {
2911 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2912 return c
2913 }
2914
2915
2916
2917
2918 func (c *ProjectsLocationsConnectionsEntityTypesListCall) PageToken(pageToken string) *ProjectsLocationsConnectionsEntityTypesListCall {
2919 c.urlParams_.Set("pageToken", pageToken)
2920 return c
2921 }
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934 func (c *ProjectsLocationsConnectionsEntityTypesListCall) View(view string) *ProjectsLocationsConnectionsEntityTypesListCall {
2935 c.urlParams_.Set("view", view)
2936 return c
2937 }
2938
2939
2940
2941
2942 func (c *ProjectsLocationsConnectionsEntityTypesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsEntityTypesListCall {
2943 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2944 return c
2945 }
2946
2947
2948
2949
2950 func (c *ProjectsLocationsConnectionsEntityTypesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionsEntityTypesListCall {
2951 c.ifNoneMatch_ = entityTag
2952 return c
2953 }
2954
2955
2956 func (c *ProjectsLocationsConnectionsEntityTypesListCall) Context(ctx context.Context) *ProjectsLocationsConnectionsEntityTypesListCall {
2957 c.ctx_ = ctx
2958 return c
2959 }
2960
2961
2962
2963 func (c *ProjectsLocationsConnectionsEntityTypesListCall) Header() http.Header {
2964 if c.header_ == nil {
2965 c.header_ = make(http.Header)
2966 }
2967 return c.header_
2968 }
2969
2970 func (c *ProjectsLocationsConnectionsEntityTypesListCall) doRequest(alt string) (*http.Response, error) {
2971 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2972 if c.ifNoneMatch_ != "" {
2973 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2974 }
2975 var body io.Reader = nil
2976 c.urlParams_.Set("alt", alt)
2977 c.urlParams_.Set("prettyPrint", "false")
2978 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes")
2979 urls += "?" + c.urlParams_.Encode()
2980 req, err := http.NewRequest("GET", urls, body)
2981 if err != nil {
2982 return nil, err
2983 }
2984 req.Header = reqHeaders
2985 googleapi.Expand(req.URL, map[string]string{
2986 "parent": c.parent,
2987 })
2988 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2989 }
2990
2991
2992
2993
2994
2995
2996
2997 func (c *ProjectsLocationsConnectionsEntityTypesListCall) Do(opts ...googleapi.CallOption) (*ListEntityTypesResponse, error) {
2998 gensupport.SetOptions(c.urlParams_, opts...)
2999 res, err := c.doRequest("json")
3000 if res != nil && res.StatusCode == http.StatusNotModified {
3001 if res.Body != nil {
3002 res.Body.Close()
3003 }
3004 return nil, gensupport.WrapError(&googleapi.Error{
3005 Code: res.StatusCode,
3006 Header: res.Header,
3007 })
3008 }
3009 if err != nil {
3010 return nil, err
3011 }
3012 defer googleapi.CloseBody(res)
3013 if err := googleapi.CheckResponse(res); err != nil {
3014 return nil, gensupport.WrapError(err)
3015 }
3016 ret := &ListEntityTypesResponse{
3017 ServerResponse: googleapi.ServerResponse{
3018 Header: res.Header,
3019 HTTPStatusCode: res.StatusCode,
3020 },
3021 }
3022 target := &ret
3023 if err := gensupport.DecodeResponse(target, res); err != nil {
3024 return nil, err
3025 }
3026 return ret, nil
3027 }
3028
3029
3030
3031
3032 func (c *ProjectsLocationsConnectionsEntityTypesListCall) Pages(ctx context.Context, f func(*ListEntityTypesResponse) error) error {
3033 c.ctx_ = ctx
3034 defer c.PageToken(c.urlParams_.Get("pageToken"))
3035 for {
3036 x, err := c.Do()
3037 if err != nil {
3038 return err
3039 }
3040 if err := f(x); err != nil {
3041 return err
3042 }
3043 if x.NextPageToken == "" {
3044 return nil
3045 }
3046 c.PageToken(x.NextPageToken)
3047 }
3048 }
3049
3050 type ProjectsLocationsConnectionsEntityTypesEntitiesCreateCall struct {
3051 s *Service
3052 parent string
3053 entity *Entity
3054 urlParams_ gensupport.URLParams
3055 ctx_ context.Context
3056 header_ http.Header
3057 }
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067 func (r *ProjectsLocationsConnectionsEntityTypesEntitiesService) Create(parent string, entity *Entity) *ProjectsLocationsConnectionsEntityTypesEntitiesCreateCall {
3068 c := &ProjectsLocationsConnectionsEntityTypesEntitiesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3069 c.parent = parent
3070 c.entity = entity
3071 return c
3072 }
3073
3074
3075
3076
3077 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsEntityTypesEntitiesCreateCall {
3078 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3079 return c
3080 }
3081
3082
3083 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesCreateCall) Context(ctx context.Context) *ProjectsLocationsConnectionsEntityTypesEntitiesCreateCall {
3084 c.ctx_ = ctx
3085 return c
3086 }
3087
3088
3089
3090 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesCreateCall) Header() http.Header {
3091 if c.header_ == nil {
3092 c.header_ = make(http.Header)
3093 }
3094 return c.header_
3095 }
3096
3097 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesCreateCall) doRequest(alt string) (*http.Response, error) {
3098 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3099 var body io.Reader = nil
3100 body, err := googleapi.WithoutDataWrapper.JSONReader(c.entity)
3101 if err != nil {
3102 return nil, err
3103 }
3104 c.urlParams_.Set("alt", alt)
3105 c.urlParams_.Set("prettyPrint", "false")
3106 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entities")
3107 urls += "?" + c.urlParams_.Encode()
3108 req, err := http.NewRequest("POST", urls, body)
3109 if err != nil {
3110 return nil, err
3111 }
3112 req.Header = reqHeaders
3113 googleapi.Expand(req.URL, map[string]string{
3114 "parent": c.parent,
3115 })
3116 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3117 }
3118
3119
3120
3121
3122
3123
3124 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesCreateCall) Do(opts ...googleapi.CallOption) (*Entity, error) {
3125 gensupport.SetOptions(c.urlParams_, opts...)
3126 res, err := c.doRequest("json")
3127 if res != nil && res.StatusCode == http.StatusNotModified {
3128 if res.Body != nil {
3129 res.Body.Close()
3130 }
3131 return nil, gensupport.WrapError(&googleapi.Error{
3132 Code: res.StatusCode,
3133 Header: res.Header,
3134 })
3135 }
3136 if err != nil {
3137 return nil, err
3138 }
3139 defer googleapi.CloseBody(res)
3140 if err := googleapi.CheckResponse(res); err != nil {
3141 return nil, gensupport.WrapError(err)
3142 }
3143 ret := &Entity{
3144 ServerResponse: googleapi.ServerResponse{
3145 Header: res.Header,
3146 HTTPStatusCode: res.StatusCode,
3147 },
3148 }
3149 target := &ret
3150 if err := gensupport.DecodeResponse(target, res); err != nil {
3151 return nil, err
3152 }
3153 return ret, nil
3154 }
3155
3156 type ProjectsLocationsConnectionsEntityTypesEntitiesDeleteCall struct {
3157 s *Service
3158 name string
3159 urlParams_ gensupport.URLParams
3160 ctx_ context.Context
3161 header_ http.Header
3162 }
3163
3164
3165
3166
3167
3168
3169
3170 func (r *ProjectsLocationsConnectionsEntityTypesEntitiesService) Delete(name string) *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteCall {
3171 c := &ProjectsLocationsConnectionsEntityTypesEntitiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3172 c.name = name
3173 return c
3174 }
3175
3176
3177
3178
3179 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteCall {
3180 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3181 return c
3182 }
3183
3184
3185 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteCall) Context(ctx context.Context) *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteCall {
3186 c.ctx_ = ctx
3187 return c
3188 }
3189
3190
3191
3192 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteCall) Header() http.Header {
3193 if c.header_ == nil {
3194 c.header_ = make(http.Header)
3195 }
3196 return c.header_
3197 }
3198
3199 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteCall) doRequest(alt string) (*http.Response, error) {
3200 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3201 var body io.Reader = nil
3202 c.urlParams_.Set("alt", alt)
3203 c.urlParams_.Set("prettyPrint", "false")
3204 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3205 urls += "?" + c.urlParams_.Encode()
3206 req, err := http.NewRequest("DELETE", urls, body)
3207 if err != nil {
3208 return nil, err
3209 }
3210 req.Header = reqHeaders
3211 googleapi.Expand(req.URL, map[string]string{
3212 "name": c.name,
3213 })
3214 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3215 }
3216
3217
3218
3219
3220
3221
3222 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3223 gensupport.SetOptions(c.urlParams_, opts...)
3224 res, err := c.doRequest("json")
3225 if res != nil && res.StatusCode == http.StatusNotModified {
3226 if res.Body != nil {
3227 res.Body.Close()
3228 }
3229 return nil, gensupport.WrapError(&googleapi.Error{
3230 Code: res.StatusCode,
3231 Header: res.Header,
3232 })
3233 }
3234 if err != nil {
3235 return nil, err
3236 }
3237 defer googleapi.CloseBody(res)
3238 if err := googleapi.CheckResponse(res); err != nil {
3239 return nil, gensupport.WrapError(err)
3240 }
3241 ret := &Empty{
3242 ServerResponse: googleapi.ServerResponse{
3243 Header: res.Header,
3244 HTTPStatusCode: res.StatusCode,
3245 },
3246 }
3247 target := &ret
3248 if err := gensupport.DecodeResponse(target, res); err != nil {
3249 return nil, err
3250 }
3251 return ret, nil
3252 }
3253
3254 type ProjectsLocationsConnectionsEntityTypesEntitiesDeleteEntitiesWithConditionsCall struct {
3255 s *Service
3256 entityType string
3257 urlParams_ gensupport.URLParams
3258 ctx_ context.Context
3259 header_ http.Header
3260 }
3261
3262
3263
3264
3265
3266
3267
3268 func (r *ProjectsLocationsConnectionsEntityTypesEntitiesService) DeleteEntitiesWithConditions(entityType string) *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteEntitiesWithConditionsCall {
3269 c := &ProjectsLocationsConnectionsEntityTypesEntitiesDeleteEntitiesWithConditionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3270 c.entityType = entityType
3271 return c
3272 }
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteEntitiesWithConditionsCall) Conditions(conditions string) *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteEntitiesWithConditionsCall {
3283 c.urlParams_.Set("conditions", conditions)
3284 return c
3285 }
3286
3287
3288
3289
3290 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteEntitiesWithConditionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteEntitiesWithConditionsCall {
3291 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3292 return c
3293 }
3294
3295
3296 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteEntitiesWithConditionsCall) Context(ctx context.Context) *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteEntitiesWithConditionsCall {
3297 c.ctx_ = ctx
3298 return c
3299 }
3300
3301
3302
3303 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteEntitiesWithConditionsCall) Header() http.Header {
3304 if c.header_ == nil {
3305 c.header_ = make(http.Header)
3306 }
3307 return c.header_
3308 }
3309
3310 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteEntitiesWithConditionsCall) doRequest(alt string) (*http.Response, error) {
3311 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3312 var body io.Reader = nil
3313 c.urlParams_.Set("alt", alt)
3314 c.urlParams_.Set("prettyPrint", "false")
3315 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+entityType}/entities:deleteEntitiesWithConditions")
3316 urls += "?" + c.urlParams_.Encode()
3317 req, err := http.NewRequest("POST", urls, body)
3318 if err != nil {
3319 return nil, err
3320 }
3321 req.Header = reqHeaders
3322 googleapi.Expand(req.URL, map[string]string{
3323 "entityType": c.entityType,
3324 })
3325 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3326 }
3327
3328
3329
3330
3331
3332
3333 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesDeleteEntitiesWithConditionsCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3334 gensupport.SetOptions(c.urlParams_, opts...)
3335 res, err := c.doRequest("json")
3336 if res != nil && res.StatusCode == http.StatusNotModified {
3337 if res.Body != nil {
3338 res.Body.Close()
3339 }
3340 return nil, gensupport.WrapError(&googleapi.Error{
3341 Code: res.StatusCode,
3342 Header: res.Header,
3343 })
3344 }
3345 if err != nil {
3346 return nil, err
3347 }
3348 defer googleapi.CloseBody(res)
3349 if err := googleapi.CheckResponse(res); err != nil {
3350 return nil, gensupport.WrapError(err)
3351 }
3352 ret := &Empty{
3353 ServerResponse: googleapi.ServerResponse{
3354 Header: res.Header,
3355 HTTPStatusCode: res.StatusCode,
3356 },
3357 }
3358 target := &ret
3359 if err := gensupport.DecodeResponse(target, res); err != nil {
3360 return nil, err
3361 }
3362 return ret, nil
3363 }
3364
3365 type ProjectsLocationsConnectionsEntityTypesEntitiesGetCall struct {
3366 s *Service
3367 name string
3368 urlParams_ gensupport.URLParams
3369 ifNoneMatch_ string
3370 ctx_ context.Context
3371 header_ http.Header
3372 }
3373
3374
3375
3376
3377
3378
3379
3380 func (r *ProjectsLocationsConnectionsEntityTypesEntitiesService) Get(name string) *ProjectsLocationsConnectionsEntityTypesEntitiesGetCall {
3381 c := &ProjectsLocationsConnectionsEntityTypesEntitiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3382 c.name = name
3383 return c
3384 }
3385
3386
3387
3388
3389 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsEntityTypesEntitiesGetCall {
3390 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3391 return c
3392 }
3393
3394
3395
3396
3397 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionsEntityTypesEntitiesGetCall {
3398 c.ifNoneMatch_ = entityTag
3399 return c
3400 }
3401
3402
3403 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesGetCall) Context(ctx context.Context) *ProjectsLocationsConnectionsEntityTypesEntitiesGetCall {
3404 c.ctx_ = ctx
3405 return c
3406 }
3407
3408
3409
3410 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesGetCall) Header() http.Header {
3411 if c.header_ == nil {
3412 c.header_ = make(http.Header)
3413 }
3414 return c.header_
3415 }
3416
3417 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesGetCall) doRequest(alt string) (*http.Response, error) {
3418 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3419 if c.ifNoneMatch_ != "" {
3420 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3421 }
3422 var body io.Reader = nil
3423 c.urlParams_.Set("alt", alt)
3424 c.urlParams_.Set("prettyPrint", "false")
3425 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3426 urls += "?" + c.urlParams_.Encode()
3427 req, err := http.NewRequest("GET", urls, body)
3428 if err != nil {
3429 return nil, err
3430 }
3431 req.Header = reqHeaders
3432 googleapi.Expand(req.URL, map[string]string{
3433 "name": c.name,
3434 })
3435 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3436 }
3437
3438
3439
3440
3441
3442
3443 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesGetCall) Do(opts ...googleapi.CallOption) (*Entity, error) {
3444 gensupport.SetOptions(c.urlParams_, opts...)
3445 res, err := c.doRequest("json")
3446 if res != nil && res.StatusCode == http.StatusNotModified {
3447 if res.Body != nil {
3448 res.Body.Close()
3449 }
3450 return nil, gensupport.WrapError(&googleapi.Error{
3451 Code: res.StatusCode,
3452 Header: res.Header,
3453 })
3454 }
3455 if err != nil {
3456 return nil, err
3457 }
3458 defer googleapi.CloseBody(res)
3459 if err := googleapi.CheckResponse(res); err != nil {
3460 return nil, gensupport.WrapError(err)
3461 }
3462 ret := &Entity{
3463 ServerResponse: googleapi.ServerResponse{
3464 Header: res.Header,
3465 HTTPStatusCode: res.StatusCode,
3466 },
3467 }
3468 target := &ret
3469 if err := gensupport.DecodeResponse(target, res); err != nil {
3470 return nil, err
3471 }
3472 return ret, nil
3473 }
3474
3475 type ProjectsLocationsConnectionsEntityTypesEntitiesListCall struct {
3476 s *Service
3477 parent string
3478 urlParams_ gensupport.URLParams
3479 ifNoneMatch_ string
3480 ctx_ context.Context
3481 header_ http.Header
3482 }
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498 func (r *ProjectsLocationsConnectionsEntityTypesEntitiesService) List(parent string) *ProjectsLocationsConnectionsEntityTypesEntitiesListCall {
3499 c := &ProjectsLocationsConnectionsEntityTypesEntitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3500 c.parent = parent
3501 return c
3502 }
3503
3504
3505
3506
3507
3508 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesListCall) Conditions(conditions string) *ProjectsLocationsConnectionsEntityTypesEntitiesListCall {
3509 c.urlParams_.Set("conditions", conditions)
3510 return c
3511 }
3512
3513
3514
3515 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesListCall) PageSize(pageSize int64) *ProjectsLocationsConnectionsEntityTypesEntitiesListCall {
3516 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3517 return c
3518 }
3519
3520
3521
3522 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesListCall) PageToken(pageToken string) *ProjectsLocationsConnectionsEntityTypesEntitiesListCall {
3523 c.urlParams_.Set("pageToken", pageToken)
3524 return c
3525 }
3526
3527
3528
3529 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesListCall) SortBy(sortBy ...string) *ProjectsLocationsConnectionsEntityTypesEntitiesListCall {
3530 c.urlParams_.SetMulti("sortBy", append([]string{}, sortBy...))
3531 return c
3532 }
3533
3534
3535
3536
3537 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsEntityTypesEntitiesListCall {
3538 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3539 return c
3540 }
3541
3542
3543
3544
3545 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionsEntityTypesEntitiesListCall {
3546 c.ifNoneMatch_ = entityTag
3547 return c
3548 }
3549
3550
3551 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesListCall) Context(ctx context.Context) *ProjectsLocationsConnectionsEntityTypesEntitiesListCall {
3552 c.ctx_ = ctx
3553 return c
3554 }
3555
3556
3557
3558 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesListCall) Header() http.Header {
3559 if c.header_ == nil {
3560 c.header_ = make(http.Header)
3561 }
3562 return c.header_
3563 }
3564
3565 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesListCall) doRequest(alt string) (*http.Response, error) {
3566 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3567 if c.ifNoneMatch_ != "" {
3568 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3569 }
3570 var body io.Reader = nil
3571 c.urlParams_.Set("alt", alt)
3572 c.urlParams_.Set("prettyPrint", "false")
3573 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entities")
3574 urls += "?" + c.urlParams_.Encode()
3575 req, err := http.NewRequest("GET", urls, body)
3576 if err != nil {
3577 return nil, err
3578 }
3579 req.Header = reqHeaders
3580 googleapi.Expand(req.URL, map[string]string{
3581 "parent": c.parent,
3582 })
3583 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3584 }
3585
3586
3587
3588
3589
3590
3591
3592 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesListCall) Do(opts ...googleapi.CallOption) (*ListEntitiesResponse, error) {
3593 gensupport.SetOptions(c.urlParams_, opts...)
3594 res, err := c.doRequest("json")
3595 if res != nil && res.StatusCode == http.StatusNotModified {
3596 if res.Body != nil {
3597 res.Body.Close()
3598 }
3599 return nil, gensupport.WrapError(&googleapi.Error{
3600 Code: res.StatusCode,
3601 Header: res.Header,
3602 })
3603 }
3604 if err != nil {
3605 return nil, err
3606 }
3607 defer googleapi.CloseBody(res)
3608 if err := googleapi.CheckResponse(res); err != nil {
3609 return nil, gensupport.WrapError(err)
3610 }
3611 ret := &ListEntitiesResponse{
3612 ServerResponse: googleapi.ServerResponse{
3613 Header: res.Header,
3614 HTTPStatusCode: res.StatusCode,
3615 },
3616 }
3617 target := &ret
3618 if err := gensupport.DecodeResponse(target, res); err != nil {
3619 return nil, err
3620 }
3621 return ret, nil
3622 }
3623
3624
3625
3626
3627 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesListCall) Pages(ctx context.Context, f func(*ListEntitiesResponse) error) error {
3628 c.ctx_ = ctx
3629 defer c.PageToken(c.urlParams_.Get("pageToken"))
3630 for {
3631 x, err := c.Do()
3632 if err != nil {
3633 return err
3634 }
3635 if err := f(x); err != nil {
3636 return err
3637 }
3638 if x.NextPageToken == "" {
3639 return nil
3640 }
3641 c.PageToken(x.NextPageToken)
3642 }
3643 }
3644
3645 type ProjectsLocationsConnectionsEntityTypesEntitiesPatchCall struct {
3646 s *Service
3647 name string
3648 entity *Entity
3649 urlParams_ gensupport.URLParams
3650 ctx_ context.Context
3651 header_ http.Header
3652 }
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663 func (r *ProjectsLocationsConnectionsEntityTypesEntitiesService) Patch(name string, entity *Entity) *ProjectsLocationsConnectionsEntityTypesEntitiesPatchCall {
3664 c := &ProjectsLocationsConnectionsEntityTypesEntitiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3665 c.name = name
3666 c.entity = entity
3667 return c
3668 }
3669
3670
3671
3672
3673 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsEntityTypesEntitiesPatchCall {
3674 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3675 return c
3676 }
3677
3678
3679 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesPatchCall) Context(ctx context.Context) *ProjectsLocationsConnectionsEntityTypesEntitiesPatchCall {
3680 c.ctx_ = ctx
3681 return c
3682 }
3683
3684
3685
3686 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesPatchCall) Header() http.Header {
3687 if c.header_ == nil {
3688 c.header_ = make(http.Header)
3689 }
3690 return c.header_
3691 }
3692
3693 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesPatchCall) doRequest(alt string) (*http.Response, error) {
3694 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3695 var body io.Reader = nil
3696 body, err := googleapi.WithoutDataWrapper.JSONReader(c.entity)
3697 if err != nil {
3698 return nil, err
3699 }
3700 c.urlParams_.Set("alt", alt)
3701 c.urlParams_.Set("prettyPrint", "false")
3702 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3703 urls += "?" + c.urlParams_.Encode()
3704 req, err := http.NewRequest("PATCH", urls, body)
3705 if err != nil {
3706 return nil, err
3707 }
3708 req.Header = reqHeaders
3709 googleapi.Expand(req.URL, map[string]string{
3710 "name": c.name,
3711 })
3712 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3713 }
3714
3715
3716
3717
3718
3719
3720 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesPatchCall) Do(opts ...googleapi.CallOption) (*Entity, error) {
3721 gensupport.SetOptions(c.urlParams_, opts...)
3722 res, err := c.doRequest("json")
3723 if res != nil && res.StatusCode == http.StatusNotModified {
3724 if res.Body != nil {
3725 res.Body.Close()
3726 }
3727 return nil, gensupport.WrapError(&googleapi.Error{
3728 Code: res.StatusCode,
3729 Header: res.Header,
3730 })
3731 }
3732 if err != nil {
3733 return nil, err
3734 }
3735 defer googleapi.CloseBody(res)
3736 if err := googleapi.CheckResponse(res); err != nil {
3737 return nil, gensupport.WrapError(err)
3738 }
3739 ret := &Entity{
3740 ServerResponse: googleapi.ServerResponse{
3741 Header: res.Header,
3742 HTTPStatusCode: res.StatusCode,
3743 },
3744 }
3745 target := &ret
3746 if err := gensupport.DecodeResponse(target, res); err != nil {
3747 return nil, err
3748 }
3749 return ret, nil
3750 }
3751
3752 type ProjectsLocationsConnectionsEntityTypesEntitiesUpdateEntitiesWithConditionsCall struct {
3753 s *Service
3754 entityType string
3755 entity *Entity
3756 urlParams_ gensupport.URLParams
3757 ctx_ context.Context
3758 header_ http.Header
3759 }
3760
3761
3762
3763
3764
3765
3766
3767 func (r *ProjectsLocationsConnectionsEntityTypesEntitiesService) UpdateEntitiesWithConditions(entityType string, entity *Entity) *ProjectsLocationsConnectionsEntityTypesEntitiesUpdateEntitiesWithConditionsCall {
3768 c := &ProjectsLocationsConnectionsEntityTypesEntitiesUpdateEntitiesWithConditionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3769 c.entityType = entityType
3770 c.entity = entity
3771 return c
3772 }
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesUpdateEntitiesWithConditionsCall) Conditions(conditions string) *ProjectsLocationsConnectionsEntityTypesEntitiesUpdateEntitiesWithConditionsCall {
3783 c.urlParams_.Set("conditions", conditions)
3784 return c
3785 }
3786
3787
3788
3789
3790 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesUpdateEntitiesWithConditionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsEntityTypesEntitiesUpdateEntitiesWithConditionsCall {
3791 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3792 return c
3793 }
3794
3795
3796 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesUpdateEntitiesWithConditionsCall) Context(ctx context.Context) *ProjectsLocationsConnectionsEntityTypesEntitiesUpdateEntitiesWithConditionsCall {
3797 c.ctx_ = ctx
3798 return c
3799 }
3800
3801
3802
3803 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesUpdateEntitiesWithConditionsCall) Header() http.Header {
3804 if c.header_ == nil {
3805 c.header_ = make(http.Header)
3806 }
3807 return c.header_
3808 }
3809
3810 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesUpdateEntitiesWithConditionsCall) 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.entity)
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, "v2/{+entityType}/entities:updateEntitiesWithConditions")
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 "entityType": c.entityType,
3828 })
3829 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3830 }
3831
3832
3833
3834
3835
3836
3837
3838 func (c *ProjectsLocationsConnectionsEntityTypesEntitiesUpdateEntitiesWithConditionsCall) Do(opts ...googleapi.CallOption) (*UpdateEntitiesWithConditionsResponse, 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 := &UpdateEntitiesWithConditionsResponse{
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
View as plain text