-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathproject.go
More file actions
1156 lines (1060 loc) · 74.9 KB
/
project.go
File metadata and controls
1156 lines (1060 loc) · 74.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
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
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
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
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by Aiven. DO NOT EDIT.
package project
import (
"context"
"encoding/json"
"fmt"
"net/url"
"time"
)
type Handler interface {
// ListProjectVpcPeeringConnectionTypes list VPC peering connection types for a project
// GET /v1/project/{project}/vpc-peering-connection-types
// https://api.aiven.io/doc/#tag/Project/operation/ListProjectVpcPeeringConnectionTypes
// Required roles or permissions: project:networking:read
ListProjectVpcPeeringConnectionTypes(ctx context.Context, project string) ([]VpcPeeringConnectionTypeOut, error)
// ProjectAlertsList list active alerts for a project
// GET /v1/project/{project}/alerts
// https://api.aiven.io/doc/#tag/Project/operation/ProjectAlertsList
// Required roles or permissions: developer, operator, read_only
ProjectAlertsList(ctx context.Context, project string) ([]AlertOut, error)
// ProjectCreate create a project
// POST /v1/project
// https://api.aiven.io/doc/#tag/Project/operation/ProjectCreate
ProjectCreate(ctx context.Context, in *ProjectCreateIn) (*ProjectCreateOut, error)
// ProjectDelete delete project
// DELETE /v1/project/{project}
// https://api.aiven.io/doc/#tag/Project/operation/ProjectDelete
// Required roles or permissions: organization:projects:write
ProjectDelete(ctx context.Context, project string) error
// ProjectGenerateSbomDownloadUrl generate SBOM for project
// GET /v1/project/{project}/generate-sbom-download-url/{file_format}
// https://api.aiven.io/doc/#tag/Project/operation/ProjectGenerateSbomDownloadUrl
// Required roles or permissions: developer, operator, read_only
ProjectGenerateSbomDownloadUrl(ctx context.Context, project string, fileFormat string) (string, error)
// ProjectGet get project details
// GET /v1/project/{project}
// https://api.aiven.io/doc/#tag/Project/operation/ProjectGet
// Required roles or permissions: project:services:read
ProjectGet(ctx context.Context, project string) (*ProjectGetOut, error)
// ProjectGetEventLogs get project event log entries
// GET /v1/project/{project}/events
// https://api.aiven.io/doc/#tag/Project/operation/ProjectGetEventLogs
// Required roles or permissions: project:audit_logs:read
ProjectGetEventLogs(ctx context.Context, project string) ([]EventOut, error)
// Deprecated: ProjectInvite send project membership invitation
// POST /v1/project/{project}/invite
// https://api.aiven.io/doc/#tag/Project/operation/ProjectInvite
ProjectInvite(ctx context.Context, project string, in *ProjectInviteIn) error
// Deprecated: ProjectInviteAccept confirm project invite
// POST /v1/project/{project}/invite/{invite_verification_code}
// https://api.aiven.io/doc/#tag/Project/operation/ProjectInviteAccept
ProjectInviteAccept(ctx context.Context, project string, inviteVerificationCode string) (*ProjectInviteAcceptOut, error)
// Deprecated: ProjectInviteDelete delete an invitation to a project
// DELETE /v1/project/{project}/invite/{invited_email}
// https://api.aiven.io/doc/#tag/Project/operation/ProjectInviteDelete
ProjectInviteDelete(ctx context.Context, project string, invitedEmail string) error
// ProjectKmsGetCA retrieve project CA certificate
// GET /v1/project/{project}/kms/ca
// https://api.aiven.io/doc/#tag/Project_Key_Management/operation/ProjectKmsGetCA
// Required roles or permissions: organization:projects:write
ProjectKmsGetCA(ctx context.Context, project string) (string, error)
// ProjectList list projects
// GET /v1/project
// https://api.aiven.io/doc/#tag/Project/operation/ProjectList
ProjectList(ctx context.Context) (*ProjectListOut, error)
// ProjectPrivatelinkAvailabilityList list Privatelink cloud availability and prices for a project
// GET /v1/project/{project}/privatelink-availability
// https://api.aiven.io/doc/#tag/Project/operation/ProjectPrivatelinkAvailabilityList
// Required roles or permissions: project:services:write
ProjectPrivatelinkAvailabilityList(ctx context.Context, project string) ([]PrivatelinkAvailabilityOut, error)
// ProjectServicePlanList list service plans
// GET /v1/project/{project}/service-types/{service_type}/plans
// https://api.aiven.io/doc/#tag/Project/operation/ProjectServicePlanList
// Required roles or permissions: developer, operator, read_only
ProjectServicePlanList(ctx context.Context, project string, serviceType string) ([]ServicePlanOut, error)
// ProjectServicePlanPriceGet get plan pricing
// GET /v1/project/{project}/pricing/service-types/{service_type}/plans/{service_plan}/clouds/{cloud}
// https://api.aiven.io/doc/#tag/Project/operation/ProjectServicePlanPriceGet
// Required roles or permissions: developer, operator, read_only
ProjectServicePlanPriceGet(ctx context.Context, project string, serviceType string, servicePlan string, cloud string) (*ProjectServicePlanPriceGetOut, error)
// ProjectServicePlanSpecsGet get service plan details
// GET /v1/project/{project}/service-types/{service_type}/plans/{service_plan}
// https://api.aiven.io/doc/#tag/Project/operation/ProjectServicePlanSpecsGet
// Required roles or permissions: developer, operator, read_only
ProjectServicePlanSpecsGet(ctx context.Context, project string, serviceType string, servicePlan string) (*ProjectServicePlanSpecsGetOut, error)
// ProjectServiceTypesGet get service type details
// GET /v1/project/{project}/service-types/{service_type}
// https://api.aiven.io/doc/#tag/Project/operation/ProjectServiceTypesGet
// Required roles or permissions: developer, operator, read_only
ProjectServiceTypesGet(ctx context.Context, project string, serviceType string) (*ProjectServiceTypesGetOut, error)
// ProjectServiceTypesList list service types
// GET /v1/project/{project}/service-types
// https://api.aiven.io/doc/#tag/Project/operation/ProjectServiceTypesList
// Required roles or permissions: project:services:read
ProjectServiceTypesList(ctx context.Context, project string) (*ProjectServiceTypesListOut, error)
// ProjectTagsList list all tags attached to this project
// GET /v1/project/{project}/tags
// https://api.aiven.io/doc/#tag/Project/operation/ProjectTagsList
// Required roles or permissions: developer, operator, read_only
ProjectTagsList(ctx context.Context, project string) (map[string]string, error)
// ProjectTagsReplace replace all project tags with a new set of tags, deleting old ones
// PUT /v1/project/{project}/tags
// https://api.aiven.io/doc/#tag/Project/operation/ProjectTagsReplace
ProjectTagsReplace(ctx context.Context, project string, in *ProjectTagsReplaceIn) error
// ProjectTagsUpdate update one or more tags, creating ones that don't exist, and deleting ones given NULL value
// PATCH /v1/project/{project}/tags
// https://api.aiven.io/doc/#tag/Project/operation/ProjectTagsUpdate
ProjectTagsUpdate(ctx context.Context, project string, in *ProjectTagsUpdateIn) error
// ProjectUpdate update project
// PUT /v1/project/{project}
// https://api.aiven.io/doc/#tag/Project/operation/ProjectUpdate
// Required roles or permissions: organization:projects:write
ProjectUpdate(ctx context.Context, project string, in *ProjectUpdateIn) (*ProjectUpdateOut, error)
// ProjectUserList list users with access to the project. May contain same user multiple times if they belong to multiple teams associated to the project
// GET /v1/project/{project}/users
// https://api.aiven.io/doc/#tag/Project/operation/ProjectUserList
// Required roles or permissions: developer, operator, read_only
ProjectUserList(ctx context.Context, project string) (*ProjectUserListOut, error)
// ProjectUserRemove remove user from the project
// DELETE /v1/project/{project}/user/{user_email}
// https://api.aiven.io/doc/#tag/Project/operation/ProjectUserRemove
ProjectUserRemove(ctx context.Context, project string, userEmail string) error
// ProjectUserUpdate update a project user
// PUT /v1/project/{project}/user/{user_email}
// https://api.aiven.io/doc/#tag/Project/operation/ProjectUserUpdate
ProjectUserUpdate(ctx context.Context, project string, userEmail string, in *ProjectUserUpdateIn) error
}
// doer http client
type doer interface {
Do(ctx context.Context, operationID, method, path string, in any, query ...[2]string) ([]byte, error)
}
func NewHandler(doer doer) ProjectHandler {
return ProjectHandler{doer}
}
type ProjectHandler struct {
doer doer
}
func (h *ProjectHandler) ListProjectVpcPeeringConnectionTypes(ctx context.Context, project string) ([]VpcPeeringConnectionTypeOut, error) {
path := fmt.Sprintf("/v1/project/%s/vpc-peering-connection-types", url.PathEscape(project))
b, err := h.doer.Do(ctx, "ListProjectVpcPeeringConnectionTypes", "GET", path, nil)
if err != nil {
return nil, err
}
out := new(listProjectVpcPeeringConnectionTypesOut)
err = json.Unmarshal(b, out)
if err != nil {
return nil, err
}
return out.VpcPeeringConnectionTypes, nil
}
func (h *ProjectHandler) ProjectAlertsList(ctx context.Context, project string) ([]AlertOut, error) {
path := fmt.Sprintf("/v1/project/%s/alerts", url.PathEscape(project))
b, err := h.doer.Do(ctx, "ProjectAlertsList", "GET", path, nil)
if err != nil {
return nil, err
}
out := new(projectAlertsListOut)
err = json.Unmarshal(b, out)
if err != nil {
return nil, err
}
return out.Alerts, nil
}
func (h *ProjectHandler) ProjectCreate(ctx context.Context, in *ProjectCreateIn) (*ProjectCreateOut, error) {
path := fmt.Sprintf("/v1/project")
b, err := h.doer.Do(ctx, "ProjectCreate", "POST", path, in)
if err != nil {
return nil, err
}
out := new(projectCreateOut)
err = json.Unmarshal(b, out)
if err != nil {
return nil, err
}
return &out.Project, nil
}
func (h *ProjectHandler) ProjectDelete(ctx context.Context, project string) error {
path := fmt.Sprintf("/v1/project/%s", url.PathEscape(project))
_, err := h.doer.Do(ctx, "ProjectDelete", "DELETE", path, nil)
return err
}
func (h *ProjectHandler) ProjectGenerateSbomDownloadUrl(ctx context.Context, project string, fileFormat string) (string, error) {
path := fmt.Sprintf("/v1/project/%s/generate-sbom-download-url/%s", url.PathEscape(project), url.PathEscape(fileFormat))
b, err := h.doer.Do(ctx, "ProjectGenerateSbomDownloadUrl", "GET", path, nil)
if err != nil {
return "", err
}
out := new(projectGenerateSbomDownloadUrlOut)
err = json.Unmarshal(b, out)
if err != nil {
return "", err
}
return out.DownloadUrl, nil
}
func (h *ProjectHandler) ProjectGet(ctx context.Context, project string) (*ProjectGetOut, error) {
path := fmt.Sprintf("/v1/project/%s", url.PathEscape(project))
b, err := h.doer.Do(ctx, "ProjectGet", "GET", path, nil)
if err != nil {
return nil, err
}
out := new(projectGetOut)
err = json.Unmarshal(b, out)
if err != nil {
return nil, err
}
return &out.Project, nil
}
func (h *ProjectHandler) ProjectGetEventLogs(ctx context.Context, project string) ([]EventOut, error) {
path := fmt.Sprintf("/v1/project/%s/events", url.PathEscape(project))
b, err := h.doer.Do(ctx, "ProjectGetEventLogs", "GET", path, nil)
if err != nil {
return nil, err
}
out := new(projectGetEventLogsOut)
err = json.Unmarshal(b, out)
if err != nil {
return nil, err
}
return out.Events, nil
}
func (h *ProjectHandler) ProjectInvite(ctx context.Context, project string, in *ProjectInviteIn) error {
path := fmt.Sprintf("/v1/project/%s/invite", url.PathEscape(project))
_, err := h.doer.Do(ctx, "ProjectInvite", "POST", path, in)
return err
}
func (h *ProjectHandler) ProjectInviteAccept(ctx context.Context, project string, inviteVerificationCode string) (*ProjectInviteAcceptOut, error) {
path := fmt.Sprintf("/v1/project/%s/invite/%s", url.PathEscape(project), url.PathEscape(inviteVerificationCode))
b, err := h.doer.Do(ctx, "ProjectInviteAccept", "POST", path, nil)
if err != nil {
return nil, err
}
out := new(projectInviteAcceptOut)
err = json.Unmarshal(b, out)
if err != nil {
return nil, err
}
return &out.InviteDetails, nil
}
func (h *ProjectHandler) ProjectInviteDelete(ctx context.Context, project string, invitedEmail string) error {
path := fmt.Sprintf("/v1/project/%s/invite/%s", url.PathEscape(project), url.PathEscape(invitedEmail))
_, err := h.doer.Do(ctx, "ProjectInviteDelete", "DELETE", path, nil)
return err
}
func (h *ProjectHandler) ProjectKmsGetCA(ctx context.Context, project string) (string, error) {
path := fmt.Sprintf("/v1/project/%s/kms/ca", url.PathEscape(project))
b, err := h.doer.Do(ctx, "ProjectKmsGetCA", "GET", path, nil)
if err != nil {
return "", err
}
out := new(projectKmsGetCaOut)
err = json.Unmarshal(b, out)
if err != nil {
return "", err
}
return out.Certificate, nil
}
func (h *ProjectHandler) ProjectList(ctx context.Context) (*ProjectListOut, error) {
path := fmt.Sprintf("/v1/project")
b, err := h.doer.Do(ctx, "ProjectList", "GET", path, nil)
if err != nil {
return nil, err
}
out := new(ProjectListOut)
err = json.Unmarshal(b, out)
if err != nil {
return nil, err
}
return out, nil
}
func (h *ProjectHandler) ProjectPrivatelinkAvailabilityList(ctx context.Context, project string) ([]PrivatelinkAvailabilityOut, error) {
path := fmt.Sprintf("/v1/project/%s/privatelink-availability", url.PathEscape(project))
b, err := h.doer.Do(ctx, "ProjectPrivatelinkAvailabilityList", "GET", path, nil)
if err != nil {
return nil, err
}
out := new(projectPrivatelinkAvailabilityListOut)
err = json.Unmarshal(b, out)
if err != nil {
return nil, err
}
return out.PrivatelinkAvailability, nil
}
func (h *ProjectHandler) ProjectServicePlanList(ctx context.Context, project string, serviceType string) ([]ServicePlanOut, error) {
path := fmt.Sprintf("/v1/project/%s/service-types/%s/plans", url.PathEscape(project), url.PathEscape(serviceType))
b, err := h.doer.Do(ctx, "ProjectServicePlanList", "GET", path, nil)
if err != nil {
return nil, err
}
out := new(projectServicePlanListOut)
err = json.Unmarshal(b, out)
if err != nil {
return nil, err
}
return out.ServicePlans, nil
}
func (h *ProjectHandler) ProjectServicePlanPriceGet(ctx context.Context, project string, serviceType string, servicePlan string, cloud string) (*ProjectServicePlanPriceGetOut, error) {
path := fmt.Sprintf("/v1/project/%s/pricing/service-types/%s/plans/%s/clouds/%s", url.PathEscape(project), url.PathEscape(serviceType), url.PathEscape(servicePlan), url.PathEscape(cloud))
b, err := h.doer.Do(ctx, "ProjectServicePlanPriceGet", "GET", path, nil)
if err != nil {
return nil, err
}
out := new(ProjectServicePlanPriceGetOut)
err = json.Unmarshal(b, out)
if err != nil {
return nil, err
}
return out, nil
}
func (h *ProjectHandler) ProjectServicePlanSpecsGet(ctx context.Context, project string, serviceType string, servicePlan string) (*ProjectServicePlanSpecsGetOut, error) {
path := fmt.Sprintf("/v1/project/%s/service-types/%s/plans/%s", url.PathEscape(project), url.PathEscape(serviceType), url.PathEscape(servicePlan))
b, err := h.doer.Do(ctx, "ProjectServicePlanSpecsGet", "GET", path, nil)
if err != nil {
return nil, err
}
out := new(ProjectServicePlanSpecsGetOut)
err = json.Unmarshal(b, out)
if err != nil {
return nil, err
}
return out, nil
}
func (h *ProjectHandler) ProjectServiceTypesGet(ctx context.Context, project string, serviceType string) (*ProjectServiceTypesGetOut, error) {
path := fmt.Sprintf("/v1/project/%s/service-types/%s", url.PathEscape(project), url.PathEscape(serviceType))
b, err := h.doer.Do(ctx, "ProjectServiceTypesGet", "GET", path, nil)
if err != nil {
return nil, err
}
out := new(ProjectServiceTypesGetOut)
err = json.Unmarshal(b, out)
if err != nil {
return nil, err
}
return out, nil
}
func (h *ProjectHandler) ProjectServiceTypesList(ctx context.Context, project string) (*ProjectServiceTypesListOut, error) {
path := fmt.Sprintf("/v1/project/%s/service-types", url.PathEscape(project))
b, err := h.doer.Do(ctx, "ProjectServiceTypesList", "GET", path, nil)
if err != nil {
return nil, err
}
out := new(ProjectServiceTypesListOut)
err = json.Unmarshal(b, out)
if err != nil {
return nil, err
}
return out, nil
}
func (h *ProjectHandler) ProjectTagsList(ctx context.Context, project string) (map[string]string, error) {
path := fmt.Sprintf("/v1/project/%s/tags", url.PathEscape(project))
b, err := h.doer.Do(ctx, "ProjectTagsList", "GET", path, nil)
if err != nil {
return nil, err
}
out := new(projectTagsListOut)
err = json.Unmarshal(b, out)
if err != nil {
return nil, err
}
return out.Tags, nil
}
func (h *ProjectHandler) ProjectTagsReplace(ctx context.Context, project string, in *ProjectTagsReplaceIn) error {
path := fmt.Sprintf("/v1/project/%s/tags", url.PathEscape(project))
_, err := h.doer.Do(ctx, "ProjectTagsReplace", "PUT", path, in)
return err
}
func (h *ProjectHandler) ProjectTagsUpdate(ctx context.Context, project string, in *ProjectTagsUpdateIn) error {
path := fmt.Sprintf("/v1/project/%s/tags", url.PathEscape(project))
_, err := h.doer.Do(ctx, "ProjectTagsUpdate", "PATCH", path, in)
return err
}
func (h *ProjectHandler) ProjectUpdate(ctx context.Context, project string, in *ProjectUpdateIn) (*ProjectUpdateOut, error) {
path := fmt.Sprintf("/v1/project/%s", url.PathEscape(project))
b, err := h.doer.Do(ctx, "ProjectUpdate", "PUT", path, in)
if err != nil {
return nil, err
}
out := new(projectUpdateOut)
err = json.Unmarshal(b, out)
if err != nil {
return nil, err
}
return &out.Project, nil
}
func (h *ProjectHandler) ProjectUserList(ctx context.Context, project string) (*ProjectUserListOut, error) {
path := fmt.Sprintf("/v1/project/%s/users", url.PathEscape(project))
b, err := h.doer.Do(ctx, "ProjectUserList", "GET", path, nil)
if err != nil {
return nil, err
}
out := new(ProjectUserListOut)
err = json.Unmarshal(b, out)
if err != nil {
return nil, err
}
return out, nil
}
func (h *ProjectHandler) ProjectUserRemove(ctx context.Context, project string, userEmail string) error {
path := fmt.Sprintf("/v1/project/%s/user/%s", url.PathEscape(project), url.PathEscape(userEmail))
_, err := h.doer.Do(ctx, "ProjectUserRemove", "DELETE", path, nil)
return err
}
func (h *ProjectHandler) ProjectUserUpdate(ctx context.Context, project string, userEmail string, in *ProjectUserUpdateIn) error {
path := fmt.Sprintf("/v1/project/%s/user/%s", url.PathEscape(project), url.PathEscape(userEmail))
_, err := h.doer.Do(ctx, "ProjectUserUpdate", "PUT", path, in)
return err
}
type AlertOut struct {
CreateTime time.Time `json:"create_time"` // Event creation timestamp (ISO 8601)
Event string `json:"event"` // Name of the alerting event
NodeName *string `json:"node_name,omitempty"` // Name of the service node
ProjectName string `json:"project_name"` // Project name
ServiceName *string `json:"service_name,omitempty"` // Service name
ServiceType *string `json:"service_type,omitempty"` // Service type code
Severity string `json:"severity"` // Severity of the event
}
// AlloydbomniOut Service type information
type AlloydbomniOut struct {
DefaultVersion *string `json:"default_version,omitempty"` // Default version of the service if no explicit version is defined
Description string `json:"description"` // Single line description of the service
LatestAvailableVersion *string `json:"latest_available_version,omitempty"` // Latest available version of the service
UserConfigSchema map[string]any `json:"user_config_schema"` // JSON-Schema for the 'user_config' properties
}
// BackupConfigOut Backup configuration for this service plan
type BackupConfigOut struct {
FrequentIntervalMinutes *int `json:"frequent_interval_minutes,omitempty"` // Interval of taking a frequent backup in service types supporting different backup schedules
FrequentOldestAgeMinutes *int `json:"frequent_oldest_age_minutes,omitempty"` // Maximum age of the oldest frequent backup in service types supporting different backup schedules
InfrequentIntervalMinutes *int `json:"infrequent_interval_minutes,omitempty"` // Interval of taking an infrequent backup in service types supporting different backup schedules
InfrequentOldestAgeMinutes *int `json:"infrequent_oldest_age_minutes,omitempty"` // Maximum age of the oldest infrequent backup in service types supporting different backup schedules
Interval int `json:"interval"` // The interval, in hours, at which backups are generated. For some services, like PostgreSQL, this is the interval at which full snapshots are taken and continuous incremental backup stream is maintained in addition to that.
MaxCount int `json:"max_count"` // Maximum number of backups to keep. Zero when no backups are created.
RecoveryMode RecoveryModeType `json:"recovery_mode"` // Mechanism how backups can be restored. 'basic' means a backup is restored as is so that the system is restored to the state it was when the backup was generated. 'pitr' means point-in-time-recovery, which allows restoring the system to any state since the first available full snapshot.
}
type BillingCurrencyType string
const (
BillingCurrencyTypeAud BillingCurrencyType = "AUD"
BillingCurrencyTypeCad BillingCurrencyType = "CAD"
BillingCurrencyTypeChf BillingCurrencyType = "CHF"
BillingCurrencyTypeDkk BillingCurrencyType = "DKK"
BillingCurrencyTypeEur BillingCurrencyType = "EUR"
BillingCurrencyTypeGbp BillingCurrencyType = "GBP"
BillingCurrencyTypeJpy BillingCurrencyType = "JPY"
BillingCurrencyTypeNok BillingCurrencyType = "NOK"
BillingCurrencyTypeNzd BillingCurrencyType = "NZD"
BillingCurrencyTypeSek BillingCurrencyType = "SEK"
BillingCurrencyTypeSgd BillingCurrencyType = "SGD"
BillingCurrencyTypeUsd BillingCurrencyType = "USD"
)
func BillingCurrencyTypeChoices() []string {
return []string{"AUD", "CAD", "CHF", "DKK", "EUR", "GBP", "JPY", "NOK", "NZD", "SEK", "SGD", "USD"}
}
type BillingEmailIn struct {
Email string `json:"email"` // User email address
}
type BillingEmailOut struct {
Email string `json:"email"` // User email address
}
// CardInfoOut Credit card assigned to the project
type CardInfoOut struct {
Brand string `json:"brand"`
CardId string `json:"card_id"` // Credit card ID
Country string `json:"country"`
CountryCode string `json:"country_code"` // Two letter ISO country code
ExpMonth int `json:"exp_month"` // Expiration month
ExpYear int `json:"exp_year"` // Expiration year
Last4 string `json:"last4"` // Credit card last four digits
Name string `json:"name"` // Name on the credit card
UserEmail string `json:"user_email"` // User email address
}
// CassandraOut Service type information
type CassandraOut struct {
DefaultVersion *string `json:"default_version,omitempty"` // Default version of the service if no explicit version is defined
Description string `json:"description"` // Single line description of the service
LatestAvailableVersion *string `json:"latest_available_version,omitempty"` // Latest available version of the service
UserConfigSchema map[string]any `json:"user_config_schema"` // JSON-Schema for the 'user_config' properties
}
// ClickhouseOut Service type information
type ClickhouseOut struct {
DefaultVersion *string `json:"default_version,omitempty"` // Default version of the service if no explicit version is defined
Description string `json:"description"` // Single line description of the service
LatestAvailableVersion *string `json:"latest_available_version,omitempty"` // Latest available version of the service
UserConfigSchema map[string]any `json:"user_config_schema"` // JSON-Schema for the 'user_config' properties
}
// DragonflyOut Service type information
type DragonflyOut struct {
DefaultVersion *string `json:"default_version,omitempty"` // Default version of the service if no explicit version is defined
Description string `json:"description"` // Single line description of the service
LatestAvailableVersion *string `json:"latest_available_version,omitempty"` // Latest available version of the service
UserConfigSchema map[string]any `json:"user_config_schema"` // JSON-Schema for the 'user_config' properties
}
// ElasticsearchOut Service EOL extension
type ElasticsearchOut struct {
EolDate string `json:"eol_date"` // Extended EOL date
Version string `json:"version"` // Service version
}
// EndOfLifeExtensionOut End of life extension information
type EndOfLifeExtensionOut struct {
Elasticsearch *ElasticsearchOut `json:"elasticsearch,omitempty"` // Service EOL extension
}
type EventOut struct {
Actor string `json:"actor"` // Initiator of the event
EventDesc string `json:"event_desc"` // Event description
EventType string `json:"event_type"` // Event type identifier
Id string `json:"id"` // Event identifier (unique across all projects)
ServiceName string `json:"service_name"` // Service name
Time string `json:"time"` // Timestamp in ISO 8601 format, always in UTC
}
// FlinkOut Service type information
type FlinkOut struct {
DefaultVersion *string `json:"default_version,omitempty"` // Default version of the service if no explicit version is defined
Description string `json:"description"` // Single line description of the service
LatestAvailableVersion *string `json:"latest_available_version,omitempty"` // Latest available version of the service
UserConfigSchema map[string]any `json:"user_config_schema"` // JSON-Schema for the 'user_config' properties
}
// GrafanaOut Service type information
type GrafanaOut struct {
DefaultVersion *string `json:"default_version,omitempty"` // Default version of the service if no explicit version is defined
Description string `json:"description"` // Single line description of the service
LatestAvailableVersion *string `json:"latest_available_version,omitempty"` // Latest available version of the service
UserConfigSchema map[string]any `json:"user_config_schema"` // JSON-Schema for the 'user_config' properties
}
type GroupUserOut struct {
MemberType MemberType `json:"member_type"` // Project member type
RealName string `json:"real_name"` // User real name
UserEmail string `json:"user_email"` // User email address
UserGroupId string `json:"user_group_id"` // User group ID
}
// InfluxdbOut Service type information
type InfluxdbOut struct {
DefaultVersion *string `json:"default_version,omitempty"` // Default version of the service if no explicit version is defined
Description string `json:"description"` // Single line description of the service
LatestAvailableVersion *string `json:"latest_available_version,omitempty"` // Latest available version of the service
UserConfigSchema map[string]any `json:"user_config_schema"` // JSON-Schema for the 'user_config' properties
}
type InvitationOut struct {
InviteTime time.Time `json:"invite_time"` // Timestamp in ISO 8601 format, always in UTC
InvitedUserEmail string `json:"invited_user_email"` // User email address
InvitingUserEmail string `json:"inviting_user_email"` // User email address
MemberType MemberType `json:"member_type"` // Project member type
}
// KafkaConnectOut Service type information
type KafkaConnectOut struct {
DefaultVersion *string `json:"default_version,omitempty"` // Default version of the service if no explicit version is defined
Description string `json:"description"` // Single line description of the service
LatestAvailableVersion *string `json:"latest_available_version,omitempty"` // Latest available version of the service
UserConfigSchema map[string]any `json:"user_config_schema"` // JSON-Schema for the 'user_config' properties
}
// KafkaMirrormakerOut Service type information
type KafkaMirrormakerOut struct {
DefaultVersion *string `json:"default_version,omitempty"` // Default version of the service if no explicit version is defined
Description string `json:"description"` // Single line description of the service
LatestAvailableVersion *string `json:"latest_available_version,omitempty"` // Latest available version of the service
UserConfigSchema map[string]any `json:"user_config_schema"` // JSON-Schema for the 'user_config' properties
}
// KafkaOut Service type information
type KafkaOut struct {
DefaultVersion *string `json:"default_version,omitempty"` // Default version of the service if no explicit version is defined
Description string `json:"description"` // Single line description of the service
LatestAvailableVersion *string `json:"latest_available_version,omitempty"` // Latest available version of the service
UserConfigSchema map[string]any `json:"user_config_schema"` // JSON-Schema for the 'user_config' properties
}
// M3AggregatorOut Service type information
type M3AggregatorOut struct {
DefaultVersion *string `json:"default_version,omitempty"` // Default version of the service if no explicit version is defined
Description string `json:"description"` // Single line description of the service
LatestAvailableVersion *string `json:"latest_available_version,omitempty"` // Latest available version of the service
UserConfigSchema map[string]any `json:"user_config_schema"` // JSON-Schema for the 'user_config' properties
}
// M3DbOut Service type information
type M3DbOut struct {
DefaultVersion *string `json:"default_version,omitempty"` // Default version of the service if no explicit version is defined
Description string `json:"description"` // Single line description of the service
LatestAvailableVersion *string `json:"latest_available_version,omitempty"` // Latest available version of the service
UserConfigSchema map[string]any `json:"user_config_schema"` // JSON-Schema for the 'user_config' properties
}
type MemberType string
const (
MemberTypeAdmin MemberType = "admin"
MemberTypeDeveloper MemberType = "developer"
MemberTypeOperator MemberType = "operator"
MemberTypeOrganizationAppUsersWrite MemberType = "organization:app_users:write"
MemberTypeOrganizationAuditLogsRead MemberType = "organization:audit_logs:read"
MemberTypeOrganizationBillingRead MemberType = "organization:billing:read"
MemberTypeOrganizationBillingWrite MemberType = "organization:billing:write"
MemberTypeOrganizationDomainsWrite MemberType = "organization:domains:write"
MemberTypeOrganizationGroupsWrite MemberType = "organization:groups:write"
MemberTypeOrganizationNetworkingRead MemberType = "organization:networking:read"
MemberTypeOrganizationNetworkingWrite MemberType = "organization:networking:write"
MemberTypeOrganizationProjectsWrite MemberType = "organization:projects:write"
MemberTypeOrganizationUsersWrite MemberType = "organization:users:write"
MemberTypeProjectAuditLogsRead MemberType = "project:audit_logs:read"
MemberTypeProjectIntegrationsRead MemberType = "project:integrations:read"
MemberTypeProjectIntegrationsWrite MemberType = "project:integrations:write"
MemberTypeProjectNetworkingRead MemberType = "project:networking:read"
MemberTypeProjectNetworkingWrite MemberType = "project:networking:write"
MemberTypeProjectPermissionsRead MemberType = "project:permissions:read"
MemberTypeProjectServicesRead MemberType = "project:services:read"
MemberTypeProjectServicesWrite MemberType = "project:services:write"
MemberTypeReadOnly MemberType = "read_only"
MemberTypeRoleOrganizationAdmin MemberType = "role:organization:admin"
MemberTypeRoleServicesMaintenance MemberType = "role:services:maintenance"
MemberTypeRoleServicesRecover MemberType = "role:services:recover"
MemberTypeServiceConfigurationWrite MemberType = "service:configuration:write"
MemberTypeServiceDataWrite MemberType = "service:data:write"
MemberTypeServiceLogsRead MemberType = "service:logs:read"
MemberTypeServiceSecretsRead MemberType = "service:secrets:read"
MemberTypeServiceUsersWrite MemberType = "service:users:write"
)
func MemberTypeChoices() []string {
return []string{"admin", "developer", "operator", "organization:app_users:write", "organization:audit_logs:read", "organization:billing:read", "organization:billing:write", "organization:domains:write", "organization:groups:write", "organization:networking:read", "organization:networking:write", "organization:projects:write", "organization:users:write", "project:audit_logs:read", "project:integrations:read", "project:integrations:write", "project:networking:read", "project:networking:write", "project:permissions:read", "project:services:read", "project:services:write", "read_only", "role:organization:admin", "role:services:maintenance", "role:services:recover", "service:configuration:write", "service:data:write", "service:logs:read", "service:secrets:read", "service:users:write"}
}
// MysqlOut Service type information
type MysqlOut struct {
DefaultVersion *string `json:"default_version,omitempty"` // Default version of the service if no explicit version is defined
Description string `json:"description"` // Single line description of the service
LatestAvailableVersion *string `json:"latest_available_version,omitempty"` // Latest available version of the service
UserConfigSchema map[string]any `json:"user_config_schema"` // JSON-Schema for the 'user_config' properties
}
// OpensearchOut Service type information
type OpensearchOut struct {
DefaultVersion *string `json:"default_version,omitempty"` // Default version of the service if no explicit version is defined
Description string `json:"description"` // Single line description of the service
LatestAvailableVersion *string `json:"latest_available_version,omitempty"` // Latest available version of the service
UserConfigSchema map[string]any `json:"user_config_schema"` // JSON-Schema for the 'user_config' properties
}
// PgOut Service type information
type PgOut struct {
DefaultVersion *string `json:"default_version,omitempty"` // Default version of the service if no explicit version is defined
Description string `json:"description"` // Single line description of the service
LatestAvailableVersion *string `json:"latest_available_version,omitempty"` // Latest available version of the service
UserConfigSchema map[string]any `json:"user_config_schema"` // JSON-Schema for the 'user_config' properties
}
type PrivatelinkAvailabilityOut struct {
CloudName string `json:"cloud_name"` // Target cloud
PriceUsd string `json:"price_usd"` // Hourly privatelink price in this cloud region
}
// ProjectCreateIn ProjectCreateRequestBody
type ProjectCreateIn struct {
AccountId *string `json:"account_id,omitempty"` // Account ID
AddAccountOwnersAdminAccess *bool `json:"add_account_owners_admin_access,omitempty"` // Deprecated: If account_id is set, grant account owner team admin access to the new project. This flag is ignored, and assumed true.
AddressLines *[]string `json:"address_lines,omitempty"` // Deprecated: Address lines
BasePort *int `json:"base_port,omitempty"` // New services in this project will use this value as a base when deriving their service port numbers. This allows new services to allocate predictable and specific service ports. If not provided during project creation a random base port is used.
BillingAddress *string `json:"billing_address,omitempty"` // DEPRECATED: use split address fields like company, address_lines, zip_code, city and state instead
BillingCurrency BillingCurrencyType `json:"billing_currency,omitempty"` // Deprecated: Billing currency
BillingEmails *[]BillingEmailIn `json:"billing_emails,omitempty"` // Deprecated: Billing emails
BillingExtraText *string `json:"billing_extra_text,omitempty"` // Deprecated: Extra text to be included in all project invoices
BillingGroupId *string `json:"billing_group_id,omitempty"` // Billing group ID
CardId *string `json:"card_id,omitempty"` // Deprecated: Credit card ID
City *string `json:"city,omitempty"` // Deprecated: Address city
Cloud *string `json:"cloud,omitempty"` // Target cloud
Company *string `json:"company,omitempty"` // Name of a company
CopyFromProject *string `json:"copy_from_project,omitempty"` // Project name from which to copy settings to the new project
CopyTags *bool `json:"copy_tags,omitempty"` // Copy tags from the source project. If request contains additional tags, the tags copied from source are updated with them.
CountryCode *string `json:"country_code,omitempty"` // Deprecated: Two letter country code for billing country
Project string `json:"project"` // Project name
State *string `json:"state,omitempty"` // Deprecated: Address state
Tags *map[string]string `json:"tags,omitempty"` // Set of resource tags
TechEmails *[]TechEmailIn `json:"tech_emails,omitempty"` // List of project tech email addresses
UseSourceProjectBillingGroup *bool `json:"use_source_project_billing_group,omitempty"` // If set to true, use the same billing group that is used in source project. If set to false, create a copy of the billing group used in the source project with the same information. If new project is not being copied from existing one this option has no effect
VatId *string `json:"vat_id,omitempty"` // Deprecated: EU VAT identification
ZipCode *string `json:"zip_code,omitempty"` // Deprecated: Address zip code
}
// ProjectCreateOut Project information
type ProjectCreateOut struct {
AccountId string `json:"account_id"` // Account ID
AccountName *string `json:"account_name,omitempty"` // Account name
AddressLines []string `json:"address_lines,omitempty"` // Address lines
AvailableCredits *string `json:"available_credits,omitempty"` // DEPRECATED: Available credits, in USD. Always 0.00, use billing group credits instead
BillingAddress string `json:"billing_address"` // DEPRECATED: use split address fields like company, address_lines, zip_code, city and state instead
BillingCurrency BillingCurrencyType `json:"billing_currency,omitempty"` // Billing currency
BillingEmails []BillingEmailOut `json:"billing_emails"` // List of project billing email addresses
BillingExtraText *string `json:"billing_extra_text,omitempty"` // Extra text to be included in all project invoices, e.g. purchase order or cost center number
BillingGroupId string `json:"billing_group_id"` // Billing group ID
BillingGroupName string `json:"billing_group_name"` // Billing group name
CardInfo *CardInfoOut `json:"card_info,omitempty"` // Credit card assigned to the project
City *string `json:"city,omitempty"` // Address city
Company *string `json:"company,omitempty"` // Name of a company
Country string `json:"country"` // Billing country
CountryCode string `json:"country_code"` // Two letter ISO country code
DefaultCloud string `json:"default_cloud"` // Default cloud to use when launching services
EndOfLifeExtension *EndOfLifeExtensionOut `json:"end_of_life_extension,omitempty"` // End of life extension information
EstimatedBalance string `json:"estimated_balance"` // Estimated balance, in USD
EstimatedBalanceLocal *string `json:"estimated_balance_local,omitempty"` // Estimated balance, in billing currency
Features map[string]any `json:"features,omitempty"` // Feature flags
OrganizationId string `json:"organization_id"` // Organization ID
PaymentMethod string `json:"payment_method"` // Payment method
ProjectName string `json:"project_name"` // Project name
State *string `json:"state,omitempty"` // Address state or province
Tags map[string]string `json:"tags,omitempty"` // Set of resource tags
TechEmails []TechEmailOut `json:"tech_emails,omitempty"` // List of project tech email addresses
TenantId *string `json:"tenant_id,omitempty"` // Tenant ID
TrialExpirationTime *time.Time `json:"trial_expiration_time,omitempty"` // Trial expiration time (ISO 8601)
VatId string `json:"vat_id"` // EU VAT Identification Number
ZipCode *string `json:"zip_code,omitempty"` // Address zip code
}
// ProjectGetOut Project information
type ProjectGetOut struct {
AccountId string `json:"account_id"` // Account ID
AccountName *string `json:"account_name,omitempty"` // Account name
AddressLines []string `json:"address_lines,omitempty"` // Address lines
AvailableCredits *string `json:"available_credits,omitempty"` // DEPRECATED: Available credits, in USD. Always 0.00, use billing group credits instead
BillingAddress string `json:"billing_address"` // DEPRECATED: use split address fields like company, address_lines, zip_code, city and state instead
BillingCurrency BillingCurrencyType `json:"billing_currency,omitempty"` // Billing currency
BillingEmails []BillingEmailOut `json:"billing_emails"` // List of project billing email addresses
BillingExtraText *string `json:"billing_extra_text,omitempty"` // Extra text to be included in all project invoices, e.g. purchase order or cost center number
BillingGroupId string `json:"billing_group_id"` // Billing group ID
BillingGroupName string `json:"billing_group_name"` // Billing group name
CardInfo *CardInfoOut `json:"card_info,omitempty"` // Credit card assigned to the project
City *string `json:"city,omitempty"` // Address city
Company *string `json:"company,omitempty"` // Name of a company
Country string `json:"country"` // Billing country
CountryCode string `json:"country_code"` // Two letter ISO country code
DefaultCloud string `json:"default_cloud"` // Default cloud to use when launching services
EndOfLifeExtension *EndOfLifeExtensionOut `json:"end_of_life_extension,omitempty"` // End of life extension information
EstimatedBalance string `json:"estimated_balance"` // Estimated balance, in USD
EstimatedBalanceLocal *string `json:"estimated_balance_local,omitempty"` // Estimated balance, in billing currency
Features map[string]any `json:"features,omitempty"` // Feature flags
OrganizationId string `json:"organization_id"` // Organization ID
PaymentMethod string `json:"payment_method"` // Payment method
ProjectName string `json:"project_name"` // Project name
State *string `json:"state,omitempty"` // Address state or province
Tags map[string]string `json:"tags,omitempty"` // Set of resource tags
TechEmails []TechEmailOut `json:"tech_emails,omitempty"` // List of project tech email addresses
TenantId *string `json:"tenant_id,omitempty"` // Tenant ID
TrialExpirationTime *time.Time `json:"trial_expiration_time,omitempty"` // Trial expiration time (ISO 8601)
VatId string `json:"vat_id"` // EU VAT Identification Number
ZipCode *string `json:"zip_code,omitempty"` // Address zip code
}
// ProjectInviteAcceptOut Details of verified invite
type ProjectInviteAcceptOut struct {
UserEmail string `json:"user_email"` // User email address
}
// ProjectInviteIn ProjectInviteRequestBody
type ProjectInviteIn struct {
MemberType MemberType `json:"member_type,omitempty"` // Project member type
UserEmail string `json:"user_email"` // User email address
}
// ProjectListOut ProjectListResponse
type ProjectListOut struct {
ProjectMembership map[string]ProjectMembershipType `json:"project_membership"` // Project membership and type of membership
ProjectMemberships map[string][]string `json:"project_memberships"` // List of project membership and type of membership
Projects []ProjectOut `json:"projects"` // List of projects
}
type ProjectMembershipType string
const (
ProjectMembershipTypeAdmin ProjectMembershipType = "admin"
ProjectMembershipTypeDeveloper ProjectMembershipType = "developer"
ProjectMembershipTypeOperator ProjectMembershipType = "operator"
ProjectMembershipTypeOrganizationAppUsersWrite ProjectMembershipType = "organization:app_users:write"
ProjectMembershipTypeOrganizationAuditLogsRead ProjectMembershipType = "organization:audit_logs:read"
ProjectMembershipTypeOrganizationBillingRead ProjectMembershipType = "organization:billing:read"
ProjectMembershipTypeOrganizationBillingWrite ProjectMembershipType = "organization:billing:write"
ProjectMembershipTypeOrganizationDomainsWrite ProjectMembershipType = "organization:domains:write"
ProjectMembershipTypeOrganizationGroupsWrite ProjectMembershipType = "organization:groups:write"
ProjectMembershipTypeOrganizationNetworkingRead ProjectMembershipType = "organization:networking:read"
ProjectMembershipTypeOrganizationNetworkingWrite ProjectMembershipType = "organization:networking:write"
ProjectMembershipTypeOrganizationProjectsWrite ProjectMembershipType = "organization:projects:write"
ProjectMembershipTypeOrganizationUsersWrite ProjectMembershipType = "organization:users:write"
ProjectMembershipTypeProjectAuditLogsRead ProjectMembershipType = "project:audit_logs:read"
ProjectMembershipTypeProjectIntegrationsRead ProjectMembershipType = "project:integrations:read"
ProjectMembershipTypeProjectIntegrationsWrite ProjectMembershipType = "project:integrations:write"
ProjectMembershipTypeProjectNetworkingRead ProjectMembershipType = "project:networking:read"
ProjectMembershipTypeProjectNetworkingWrite ProjectMembershipType = "project:networking:write"
ProjectMembershipTypeProjectPermissionsRead ProjectMembershipType = "project:permissions:read"
ProjectMembershipTypeProjectServicesRead ProjectMembershipType = "project:services:read"
ProjectMembershipTypeProjectServicesWrite ProjectMembershipType = "project:services:write"
ProjectMembershipTypeReadOnly ProjectMembershipType = "read_only"
ProjectMembershipTypeRoleOrganizationAdmin ProjectMembershipType = "role:organization:admin"
ProjectMembershipTypeRoleServicesMaintenance ProjectMembershipType = "role:services:maintenance"
ProjectMembershipTypeRoleServicesRecover ProjectMembershipType = "role:services:recover"
ProjectMembershipTypeServiceConfigurationWrite ProjectMembershipType = "service:configuration:write"
ProjectMembershipTypeServiceDataWrite ProjectMembershipType = "service:data:write"
ProjectMembershipTypeServiceLogsRead ProjectMembershipType = "service:logs:read"
ProjectMembershipTypeServiceSecretsRead ProjectMembershipType = "service:secrets:read"
ProjectMembershipTypeServiceUsersWrite ProjectMembershipType = "service:users:write"
)
func ProjectMembershipTypeChoices() []string {
return []string{"admin", "developer", "operator", "organization:app_users:write", "organization:audit_logs:read", "organization:billing:read", "organization:billing:write", "organization:domains:write", "organization:groups:write", "organization:networking:read", "organization:networking:write", "organization:projects:write", "organization:users:write", "project:audit_logs:read", "project:integrations:read", "project:integrations:write", "project:networking:read", "project:networking:write", "project:permissions:read", "project:services:read", "project:services:write", "read_only", "role:organization:admin", "role:services:maintenance", "role:services:recover", "service:configuration:write", "service:data:write", "service:logs:read", "service:secrets:read", "service:users:write"}
}
type ProjectOut struct {
AccountId string `json:"account_id"` // Account ID
AccountName *string `json:"account_name,omitempty"` // Account name
AddressLines []string `json:"address_lines,omitempty"` // Address lines
AvailableCredits *string `json:"available_credits,omitempty"` // DEPRECATED: Available credits, in USD. Always 0.00, use billing group credits instead
BillingAddress string `json:"billing_address"` // DEPRECATED: use split address fields like company, address_lines, zip_code, city and state instead
BillingCurrency BillingCurrencyType `json:"billing_currency,omitempty"` // Billing currency
BillingEmails []BillingEmailOut `json:"billing_emails"` // List of project billing email addresses
BillingExtraText *string `json:"billing_extra_text,omitempty"` // Extra text to be included in all project invoices, e.g. purchase order or cost center number
BillingGroupId string `json:"billing_group_id"` // Billing group ID
BillingGroupName string `json:"billing_group_name"` // Billing group name
CardInfo *CardInfoOut `json:"card_info,omitempty"` // Credit card assigned to the project
City *string `json:"city,omitempty"` // Address city
Company *string `json:"company,omitempty"` // Name of a company
Country string `json:"country"` // Billing country
CountryCode string `json:"country_code"` // Two letter ISO country code
DefaultCloud string `json:"default_cloud"` // Default cloud to use when launching services
EndOfLifeExtension *EndOfLifeExtensionOut `json:"end_of_life_extension,omitempty"` // End of life extension information
EstimatedBalance string `json:"estimated_balance"` // Estimated balance, in USD
EstimatedBalanceLocal *string `json:"estimated_balance_local,omitempty"` // Estimated balance, in billing currency
Features map[string]any `json:"features,omitempty"` // Feature flags
OrganizationId string `json:"organization_id"` // Organization ID
PaymentMethod string `json:"payment_method"` // Payment method
ProjectName string `json:"project_name"` // Project name
State *string `json:"state,omitempty"` // Address state or province
Tags map[string]string `json:"tags,omitempty"` // Set of resource tags
TechEmails []TechEmailOut `json:"tech_emails,omitempty"` // List of project tech email addresses
TenantId *string `json:"tenant_id,omitempty"` // Tenant ID
TrialExpirationTime *time.Time `json:"trial_expiration_time,omitempty"` // Trial expiration time (ISO 8601)
VatId string `json:"vat_id"` // EU VAT Identification Number
ZipCode *string `json:"zip_code,omitempty"` // Address zip code
}
// ProjectServicePlanPriceGetOut ProjectServicePlanPriceGetResponse
type ProjectServicePlanPriceGetOut struct {
BasePriceUsd string `json:"base_price_usd"` // Hourly service price in this region
CloudName string `json:"cloud_name"` // Target cloud
ExtraDiskPricePerGbUsd *string `json:"extra_disk_price_per_gb_usd,omitempty"` // Hourly additional disk space price per GiB in this region
ObjectStorageGbPriceUsd *string `json:"object_storage_gb_price_usd,omitempty"` // Hourly additional disk space price per GiB in this region
ServicePlan string `json:"service_plan"` // Subscription plan
ServiceType string `json:"service_type"` // Service type code
}
// ProjectServicePlanSpecsGetOut ProjectServicePlanSpecsGetResponse
type ProjectServicePlanSpecsGetOut struct {
BackupConfig BackupConfigOut `json:"backup_config"` // Backup configuration for this service plan
DiskSpaceCapMb *int `json:"disk_space_cap_mb,omitempty"` // Maximum amount of disk space possible for the plan in the given region
DiskSpaceMb int `json:"disk_space_mb"` // Combined amount of service disk space of all service nodes in megabytes
DiskSpaceStepMb *int `json:"disk_space_step_mb,omitempty"` // Disk space change step size
MaxMemoryPercent *int `json:"max_memory_percent,omitempty"` // Maximum amount of system memory as a percentage (0-100) the service can actually use after taking into account management overhead. This is relevant for memory bound services for which some service management operations require allocating proportional amount of memory on top the basic load.
NodeCount int `json:"node_count"` // Number of nodes in this service plan
ServicePlan string `json:"service_plan"` // Subscription plan
ServiceType string `json:"service_type"` // Service type code
ShardCount *int `json:"shard_count,omitempty"` // Number of shards in this service plan
}
// ProjectServiceTypesGetOut ProjectServiceTypesGetResponse
type ProjectServiceTypesGetOut struct {
DefaultVersion *string `json:"default_version,omitempty"` // Default version of the service if no explicit version is defined
Description string `json:"description"` // Single line description of the service
LatestAvailableVersion *string `json:"latest_available_version,omitempty"` // Latest available version of the service
UserConfigSchema map[string]any `json:"user_config_schema"` // JSON-Schema for the 'user_config' properties
}
// ProjectServiceTypesListElasticsearchOut Service type information
type ProjectServiceTypesListElasticsearchOut struct {
DefaultVersion *string `json:"default_version,omitempty"` // Default version of the service if no explicit version is defined
Description string `json:"description"` // Single line description of the service
LatestAvailableVersion *string `json:"latest_available_version,omitempty"` // Latest available version of the service
UserConfigSchema map[string]any `json:"user_config_schema"` // JSON-Schema for the 'user_config' properties
}
// ProjectServiceTypesListOut ProjectServiceTypesListResponse
type ProjectServiceTypesListOut struct {
Alloydbomni *AlloydbomniOut `json:"alloydbomni,omitempty"` // Service type information
Cassandra *CassandraOut `json:"cassandra,omitempty"` // Service type information
Clickhouse *ClickhouseOut `json:"clickhouse,omitempty"` // Service type information
Dragonfly *DragonflyOut `json:"dragonfly,omitempty"` // Service type information
Elasticsearch *ProjectServiceTypesListElasticsearchOut `json:"elasticsearch,omitempty"` // Service type information
Flink *FlinkOut `json:"flink,omitempty"` // Service type information
Grafana *GrafanaOut `json:"grafana,omitempty"` // Service type information
Influxdb *InfluxdbOut `json:"influxdb,omitempty"` // Service type information
Kafka *KafkaOut `json:"kafka,omitempty"` // Service type information
KafkaConnect *KafkaConnectOut `json:"kafka_connect,omitempty"` // Service type information
KafkaMirrormaker *KafkaMirrormakerOut `json:"kafka_mirrormaker,omitempty"` // Service type information
M3Aggregator *M3AggregatorOut `json:"m3aggregator,omitempty"` // Service type information
M3Db *M3DbOut `json:"m3db,omitempty"` // Service type information
Mysql *MysqlOut `json:"mysql,omitempty"` // Service type information
Opensearch *OpensearchOut `json:"opensearch,omitempty"` // Service type information
Pg *PgOut `json:"pg,omitempty"` // Service type information
Redis *RedisOut `json:"redis,omitempty"` // Service type information
Thanos *ThanosOut `json:"thanos,omitempty"` // Service type information
Valkey *ValkeyOut `json:"valkey,omitempty"` // Service type information
}
// ProjectTagsReplaceIn ProjectTagsReplaceRequestBody
type ProjectTagsReplaceIn struct {
Tags map[string]string `json:"tags"` // Set of resource tags
}
// ProjectTagsUpdateIn ProjectTagsUpdateRequestBody
type ProjectTagsUpdateIn struct {
Tags map[string]string `json:"tags"` // Set of resource tags
}
// ProjectUpdateIn ProjectUpdateRequestBody
type ProjectUpdateIn struct {
AccountId *string `json:"account_id,omitempty"` // Account ID
AddAccountOwnersAdminAccess *bool `json:"add_account_owners_admin_access,omitempty"` // Deprecated: If account_id is set, grant account owner team admin access to this project. This flag is ignored and assumed true.
AddressLines *[]string `json:"address_lines,omitempty"` // Deprecated: Address lines
BillingAddress *string `json:"billing_address,omitempty"` // DEPRECATED: use split address fields like company, address_lines, zip_code, city and state instead
BillingCurrency BillingCurrencyType `json:"billing_currency,omitempty"` // Deprecated: Billing currency
BillingEmails *[]BillingEmailIn `json:"billing_emails,omitempty"` // Deprecated: List of project billing email addresses
BillingExtraText *string `json:"billing_extra_text,omitempty"` // Deprecated: Extra text to be included in all project invoices, e.g. purchase order or cost center number
BillingGroupId *string `json:"billing_group_id,omitempty"` // Billing group ID
CardId *string `json:"card_id,omitempty"` // Deprecated: Credit card ID
City *string `json:"city,omitempty"` // Deprecated: Address city
Cloud *string `json:"cloud,omitempty"` // Target cloud
Company *string `json:"company,omitempty"` // Name of a company
CountryCode *string `json:"country_code,omitempty"` // Deprecated: Two letter country code for billing country
ProjectName *string `json:"project_name,omitempty"` // Project name
State *string `json:"state,omitempty"` // Deprecated: Address state
Tags *map[string]string `json:"tags,omitempty"` // Set of resource tags
TechEmails *[]TechEmailIn `json:"tech_emails,omitempty"` // List of project tech email addresses
VatId *string `json:"vat_id,omitempty"` // Deprecated: EU VAT Identification Number
ZipCode *string `json:"zip_code,omitempty"` // Deprecated: Address zip code
}
// ProjectUpdateOut Project information
type ProjectUpdateOut struct {
AccountId string `json:"account_id"` // Account ID
AccountName *string `json:"account_name,omitempty"` // Account name
AddressLines []string `json:"address_lines,omitempty"` // Address lines
AvailableCredits *string `json:"available_credits,omitempty"` // DEPRECATED: Available credits, in USD. Always 0.00, use billing group credits instead
BillingAddress string `json:"billing_address"` // DEPRECATED: use split address fields like company, address_lines, zip_code, city and state instead
BillingCurrency BillingCurrencyType `json:"billing_currency,omitempty"` // Billing currency
BillingEmails []BillingEmailOut `json:"billing_emails"` // List of project billing email addresses
BillingExtraText *string `json:"billing_extra_text,omitempty"` // Extra text to be included in all project invoices, e.g. purchase order or cost center number
BillingGroupId string `json:"billing_group_id"` // Billing group ID
BillingGroupName string `json:"billing_group_name"` // Billing group name
CardInfo *CardInfoOut `json:"card_info,omitempty"` // Credit card assigned to the project
City *string `json:"city,omitempty"` // Address city
Company *string `json:"company,omitempty"` // Name of a company
Country string `json:"country"` // Billing country
CountryCode string `json:"country_code"` // Two letter ISO country code
DefaultCloud string `json:"default_cloud"` // Default cloud to use when launching services
EndOfLifeExtension *EndOfLifeExtensionOut `json:"end_of_life_extension,omitempty"` // End of life extension information
EstimatedBalance string `json:"estimated_balance"` // Estimated balance, in USD
EstimatedBalanceLocal *string `json:"estimated_balance_local,omitempty"` // Estimated balance, in billing currency
Features map[string]any `json:"features,omitempty"` // Feature flags
OrganizationId string `json:"organization_id"` // Organization ID
PaymentMethod string `json:"payment_method"` // Payment method
ProjectName string `json:"project_name"` // Project name
State *string `json:"state,omitempty"` // Address state or province
Tags map[string]string `json:"tags,omitempty"` // Set of resource tags
TechEmails []TechEmailOut `json:"tech_emails,omitempty"` // List of project tech email addresses
TenantId *string `json:"tenant_id,omitempty"` // Tenant ID