Skip to content

Commit 2acd248

Browse files
committed
sdk update & project mode enum split
1 parent ba7f411 commit 2acd248

File tree

67 files changed

+1970
-62
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1970
-62
lines changed
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
// Generated ZEROPS sdk
2+
3+
package body
4+
5+
import (
6+
"encoding/json"
7+
"strconv"
8+
9+
"github.com/zeropsio/zerops-go/types"
10+
"github.com/zeropsio/zerops-go/validator"
11+
)
12+
13+
var _ strconv.NumError
14+
var _ json.Unmarshaler = (*BackupRetentionPolicy)(nil)
15+
16+
type BackupRetentionPolicy struct {
17+
MaxTotalFiles types.Int `json:"maxTotalFiles"`
18+
MaxTotalGiB types.Int `json:"maxTotalGiB"`
19+
ProtectedTags types.StringArray `json:"protectedTags"`
20+
MinDaily types.Int `json:"minDaily"`
21+
MaxDaily types.Int `json:"maxDaily"`
22+
MinWeekly types.Int `json:"minWeekly"`
23+
MaxWeekly types.Int `json:"maxWeekly"`
24+
MinMonthly types.Int `json:"minMonthly"`
25+
MaxMonthly types.Int `json:"maxMonthly"`
26+
}
27+
28+
func (dto BackupRetentionPolicy) GetMaxTotalFiles() types.Int {
29+
return dto.MaxTotalFiles
30+
}
31+
func (dto BackupRetentionPolicy) GetMaxTotalGiB() types.Int {
32+
return dto.MaxTotalGiB
33+
}
34+
func (dto BackupRetentionPolicy) GetProtectedTags() types.StringArray {
35+
return dto.ProtectedTags
36+
}
37+
func (dto BackupRetentionPolicy) GetMinDaily() types.Int {
38+
return dto.MinDaily
39+
}
40+
func (dto BackupRetentionPolicy) GetMaxDaily() types.Int {
41+
return dto.MaxDaily
42+
}
43+
func (dto BackupRetentionPolicy) GetMinWeekly() types.Int {
44+
return dto.MinWeekly
45+
}
46+
func (dto BackupRetentionPolicy) GetMaxWeekly() types.Int {
47+
return dto.MaxWeekly
48+
}
49+
func (dto BackupRetentionPolicy) GetMinMonthly() types.Int {
50+
return dto.MinMonthly
51+
}
52+
func (dto BackupRetentionPolicy) GetMaxMonthly() types.Int {
53+
return dto.MaxMonthly
54+
}
55+
56+
func (dto *BackupRetentionPolicy) UnmarshalJSON(b []byte) error {
57+
var aux = struct {
58+
MaxTotalFiles *types.Int
59+
MaxTotalGiB *types.Int
60+
ProtectedTags *types.StringArray
61+
MinDaily *types.Int
62+
MaxDaily *types.Int
63+
MinWeekly *types.Int
64+
MaxWeekly *types.Int
65+
MinMonthly *types.Int
66+
MaxMonthly *types.Int
67+
}{}
68+
err := json.Unmarshal(b, &aux)
69+
if err != nil {
70+
return validator.JsonValidation("BackupRetentionPolicy", err)
71+
}
72+
var errorList validator.ErrorList
73+
if aux.MaxTotalFiles == nil {
74+
errorList = errorList.With(validator.NewError("maxTotalFiles", "field is required"))
75+
}
76+
if aux.MaxTotalGiB == nil {
77+
errorList = errorList.With(validator.NewError("maxTotalGiB", "field is required"))
78+
}
79+
if aux.ProtectedTags == nil {
80+
errorList = errorList.With(validator.NewError("protectedTags", "field is required"))
81+
}
82+
if aux.MinDaily == nil {
83+
errorList = errorList.With(validator.NewError("minDaily", "field is required"))
84+
}
85+
if aux.MaxDaily == nil {
86+
errorList = errorList.With(validator.NewError("maxDaily", "field is required"))
87+
}
88+
if aux.MinWeekly == nil {
89+
errorList = errorList.With(validator.NewError("minWeekly", "field is required"))
90+
}
91+
if aux.MaxWeekly == nil {
92+
errorList = errorList.With(validator.NewError("maxWeekly", "field is required"))
93+
}
94+
if aux.MinMonthly == nil {
95+
errorList = errorList.With(validator.NewError("minMonthly", "field is required"))
96+
}
97+
if aux.MaxMonthly == nil {
98+
errorList = errorList.With(validator.NewError("maxMonthly", "field is required"))
99+
}
100+
if errorList != nil {
101+
return errorList.GetError()
102+
}
103+
dto.MaxTotalFiles = *aux.MaxTotalFiles
104+
dto.MaxTotalGiB = *aux.MaxTotalGiB
105+
dto.ProtectedTags = *aux.ProtectedTags
106+
dto.MinDaily = *aux.MinDaily
107+
dto.MaxDaily = *aux.MaxDaily
108+
dto.MinWeekly = *aux.MinWeekly
109+
dto.MaxWeekly = *aux.MaxWeekly
110+
dto.MinMonthly = *aux.MinMonthly
111+
dto.MaxMonthly = *aux.MaxMonthly
112+
113+
return nil
114+
}

dto/input/body/postObjectStorageServiceStack.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ type PostObjectStorageServiceStack struct {
2020
DiskGBytes types.Int `json:"diskGBytes"`
2121
Policy types.StringNull `json:"policy"`
2222
RawPolicy types.TextNull `json:"rawPolicy"`
23+
CdnEnabled types.BoolNull `json:"cdnEnabled"`
2324
}
2425

2526
func (dto PostObjectStorageServiceStack) GetProjectId() uuid.ProjectId {
@@ -37,6 +38,9 @@ func (dto PostObjectStorageServiceStack) GetPolicy() types.StringNull {
3738
func (dto PostObjectStorageServiceStack) GetRawPolicy() types.TextNull {
3839
return dto.RawPolicy
3940
}
41+
func (dto PostObjectStorageServiceStack) GetCdnEnabled() types.BoolNull {
42+
return dto.CdnEnabled
43+
}
4044

4145
func (dto *PostObjectStorageServiceStack) UnmarshalJSON(b []byte) error {
4246
var aux = struct {
@@ -45,6 +49,7 @@ func (dto *PostObjectStorageServiceStack) UnmarshalJSON(b []byte) error {
4549
DiskGBytes *types.Int
4650
Policy types.StringNull
4751
RawPolicy types.TextNull
52+
CdnEnabled types.BoolNull
4853
}{}
4954
err := json.Unmarshal(b, &aux)
5055
if err != nil {
@@ -68,6 +73,7 @@ func (dto *PostObjectStorageServiceStack) UnmarshalJSON(b []byte) error {
6873
dto.DiskGBytes = *aux.DiskGBytes
6974
dto.Policy = aux.Policy
7075
dto.RawPolicy = aux.RawPolicy
76+
dto.CdnEnabled = aux.CdnEnabled
7177

7278
return nil
7379
}

dto/input/body/postProject.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ type PostProject struct {
2222
Mode *enum.ProjectModeEnum `json:"mode"`
2323
TagList types.StringArray `json:"tagList"`
2424
EnvVariables PostProjectEnvVariables `json:"envVariables"`
25+
EnvIsolation types.StringNull `json:"envIsolation"`
26+
SshIsolation types.StringNull `json:"sshIsolation"`
2527
MaxCreditLimit types.DecimalNull `json:"maxCreditLimit"`
2628
}
2729

@@ -43,6 +45,12 @@ func (dto PostProject) GetTagList() types.StringArray {
4345
func (dto PostProject) GetEnvVariables() PostProjectEnvVariables {
4446
return dto.EnvVariables
4547
}
48+
func (dto PostProject) GetEnvIsolation() types.StringNull {
49+
return dto.EnvIsolation
50+
}
51+
func (dto PostProject) GetSshIsolation() types.StringNull {
52+
return dto.SshIsolation
53+
}
4654
func (dto PostProject) GetMaxCreditLimit() types.DecimalNull {
4755
return dto.MaxCreditLimit
4856
}
@@ -64,6 +72,8 @@ func (dto *PostProject) UnmarshalJSON(b []byte) error {
6472
Mode *enum.ProjectModeEnum
6573
TagList *types.StringArray
6674
EnvVariables *PostProjectEnvVariables
75+
EnvIsolation types.StringNull
76+
SshIsolation types.StringNull
6777
MaxCreditLimit types.DecimalNull
6878
}{}
6979
err := json.Unmarshal(b, &aux)
@@ -92,6 +102,8 @@ func (dto *PostProject) UnmarshalJSON(b []byte) error {
92102
dto.Mode = aux.Mode
93103
dto.TagList = *aux.TagList
94104
dto.EnvVariables = *aux.EnvVariables
105+
dto.EnvIsolation = aux.EnvIsolation
106+
dto.SshIsolation = aux.SshIsolation
95107
dto.MaxCreditLimit = aux.MaxCreditLimit
96108

97109
return nil
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Generated ZEROPS sdk
2+
3+
package body
4+
5+
import (
6+
"encoding/json"
7+
"strconv"
8+
9+
"github.com/zeropsio/zerops-go/types"
10+
"github.com/zeropsio/zerops-go/validator"
11+
)
12+
13+
var _ strconv.NumError
14+
var _ json.Unmarshaler = (*PostServiceStackBackup)(nil)
15+
16+
type PostServiceStackBackup struct {
17+
Tags types.StringArrayNull `json:"tags"`
18+
}
19+
20+
func (dto PostServiceStackBackup) GetTags() types.StringArrayNull {
21+
return dto.Tags
22+
}
23+
24+
func (dto *PostServiceStackBackup) UnmarshalJSON(b []byte) error {
25+
var aux = struct {
26+
Tags types.StringArrayNull
27+
}{}
28+
err := json.Unmarshal(b, &aux)
29+
if err != nil {
30+
return validator.JsonValidation("PostServiceStackBackup", err)
31+
}
32+
var errorList validator.ErrorList
33+
34+
if errorList != nil {
35+
return errorList.GetError()
36+
}
37+
dto.Tags = aux.Tags
38+
39+
return nil
40+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Generated ZEROPS sdk
2+
3+
package body
4+
5+
import (
6+
"encoding/json"
7+
"strconv"
8+
9+
"github.com/zeropsio/zerops-go/types"
10+
"github.com/zeropsio/zerops-go/validator"
11+
)
12+
13+
var _ strconv.NumError
14+
var _ json.Unmarshaler = (*PostServiceStackBackupModify)(nil)
15+
16+
type PostServiceStackBackupModify struct {
17+
Tags types.StringArrayNull `json:"tags"`
18+
}
19+
20+
func (dto PostServiceStackBackupModify) GetTags() types.StringArrayNull {
21+
return dto.Tags
22+
}
23+
24+
func (dto *PostServiceStackBackupModify) UnmarshalJSON(b []byte) error {
25+
var aux = struct {
26+
Tags types.StringArrayNull
27+
}{}
28+
err := json.Unmarshal(b, &aux)
29+
if err != nil {
30+
return validator.JsonValidation("PostServiceStackBackupModify", err)
31+
}
32+
var errorList validator.ErrorList
33+
34+
if errorList != nil {
35+
return errorList.GetError()
36+
}
37+
dto.Tags = aux.Tags
38+
39+
return nil
40+
}

dto/input/body/postStandardServiceStack.go

Lines changed: 60 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,20 @@ var _ strconv.NumError
1616
var _ json.Unmarshaler = (*PostStandardServiceStack)(nil)
1717

1818
type PostStandardServiceStack struct {
19-
ProjectId uuid.ProjectId `json:"projectId"`
20-
Name types.String `json:"name"`
21-
StartWithoutCode types.Bool `json:"startWithoutCode"`
22-
CustomAutoscaling *CustomAutoscaling `json:"customAutoscaling"`
23-
Mode *enum.ServiceStackModeEnum `json:"mode"`
24-
UserData PostStandardServiceStackUserData `json:"userData"`
25-
UserDataEnvFile types.TextNull `json:"userDataEnvFile"`
19+
ProjectId uuid.ProjectId `json:"projectId"`
20+
Name types.String `json:"name"`
21+
CustomAutoscaling *CustomAutoscaling `json:"customAutoscaling"`
22+
Mode *enum.ServiceStackModeEnum `json:"mode"`
23+
UserData PostStandardServiceStackUserData `json:"userData"`
24+
UserDataEnvFile types.TextNull `json:"userDataEnvFile"`
25+
StartWithoutCode types.BoolNull `json:"startWithoutCode"`
26+
BuildFromGit types.StringNull `json:"buildFromGit"`
27+
ZeropsSetup types.StringNull `json:"zeropsSetup"`
28+
ZeropsYaml types.TextNull `json:"zeropsYaml"`
29+
EnvIsolation types.StringNull `json:"envIsolation"`
30+
SshIsolation types.StringNull `json:"sshIsolation"`
31+
EnableSubdomainAccess types.BoolNull `json:"enableSubdomainAccess"`
32+
CdnEnabled types.BoolNull `json:"cdnEnabled"`
2633
}
2734

2835
func (dto PostStandardServiceStack) GetProjectId() uuid.ProjectId {
@@ -31,9 +38,6 @@ func (dto PostStandardServiceStack) GetProjectId() uuid.ProjectId {
3138
func (dto PostStandardServiceStack) GetName() types.String {
3239
return dto.Name
3340
}
34-
func (dto PostStandardServiceStack) GetStartWithoutCode() types.Bool {
35-
return dto.StartWithoutCode
36-
}
3741
func (dto PostStandardServiceStack) GetCustomAutoscaling() *CustomAutoscaling {
3842
return dto.CustomAutoscaling
3943
}
@@ -46,6 +50,30 @@ func (dto PostStandardServiceStack) GetUserData() PostStandardServiceStackUserDa
4650
func (dto PostStandardServiceStack) GetUserDataEnvFile() types.TextNull {
4751
return dto.UserDataEnvFile
4852
}
53+
func (dto PostStandardServiceStack) GetStartWithoutCode() types.BoolNull {
54+
return dto.StartWithoutCode
55+
}
56+
func (dto PostStandardServiceStack) GetBuildFromGit() types.StringNull {
57+
return dto.BuildFromGit
58+
}
59+
func (dto PostStandardServiceStack) GetZeropsSetup() types.StringNull {
60+
return dto.ZeropsSetup
61+
}
62+
func (dto PostStandardServiceStack) GetZeropsYaml() types.TextNull {
63+
return dto.ZeropsYaml
64+
}
65+
func (dto PostStandardServiceStack) GetEnvIsolation() types.StringNull {
66+
return dto.EnvIsolation
67+
}
68+
func (dto PostStandardServiceStack) GetSshIsolation() types.StringNull {
69+
return dto.SshIsolation
70+
}
71+
func (dto PostStandardServiceStack) GetEnableSubdomainAccess() types.BoolNull {
72+
return dto.EnableSubdomainAccess
73+
}
74+
func (dto PostStandardServiceStack) GetCdnEnabled() types.BoolNull {
75+
return dto.CdnEnabled
76+
}
4977

5078
type PostStandardServiceStackUserData []UserDataPut
5179

@@ -58,13 +86,20 @@ func (dto PostStandardServiceStackUserData) MarshalJSON() ([]byte, error) {
5886

5987
func (dto *PostStandardServiceStack) UnmarshalJSON(b []byte) error {
6088
var aux = struct {
61-
ProjectId *uuid.ProjectId
62-
Name *types.String
63-
StartWithoutCode *types.Bool
64-
CustomAutoscaling *CustomAutoscaling
65-
Mode *enum.ServiceStackModeEnum
66-
UserData *PostStandardServiceStackUserData
67-
UserDataEnvFile types.TextNull
89+
ProjectId *uuid.ProjectId
90+
Name *types.String
91+
CustomAutoscaling *CustomAutoscaling
92+
Mode *enum.ServiceStackModeEnum
93+
UserData *PostStandardServiceStackUserData
94+
UserDataEnvFile types.TextNull
95+
StartWithoutCode types.BoolNull
96+
BuildFromGit types.StringNull
97+
ZeropsSetup types.StringNull
98+
ZeropsYaml types.TextNull
99+
EnvIsolation types.StringNull
100+
SshIsolation types.StringNull
101+
EnableSubdomainAccess types.BoolNull
102+
CdnEnabled types.BoolNull
68103
}{}
69104
err := json.Unmarshal(b, &aux)
70105
if err != nil {
@@ -77,9 +112,6 @@ func (dto *PostStandardServiceStack) UnmarshalJSON(b []byte) error {
77112
if aux.Name == nil {
78113
errorList = errorList.With(validator.NewError("name", "field is required"))
79114
}
80-
if aux.StartWithoutCode == nil {
81-
errorList = errorList.With(validator.NewError("startWithoutCode", "field is required"))
82-
}
83115
if aux.UserData == nil {
84116
errorList = errorList.With(validator.NewError("userData", "field is required"))
85117
}
@@ -88,11 +120,18 @@ func (dto *PostStandardServiceStack) UnmarshalJSON(b []byte) error {
88120
}
89121
dto.ProjectId = *aux.ProjectId
90122
dto.Name = *aux.Name
91-
dto.StartWithoutCode = *aux.StartWithoutCode
92123
dto.CustomAutoscaling = aux.CustomAutoscaling
93124
dto.Mode = aux.Mode
94125
dto.UserData = *aux.UserData
95126
dto.UserDataEnvFile = aux.UserDataEnvFile
127+
dto.StartWithoutCode = aux.StartWithoutCode
128+
dto.BuildFromGit = aux.BuildFromGit
129+
dto.ZeropsSetup = aux.ZeropsSetup
130+
dto.ZeropsYaml = aux.ZeropsYaml
131+
dto.EnvIsolation = aux.EnvIsolation
132+
dto.SshIsolation = aux.SshIsolation
133+
dto.EnableSubdomainAccess = aux.EnableSubdomainAccess
134+
dto.CdnEnabled = aux.CdnEnabled
96135

97136
return nil
98137
}

0 commit comments

Comments
 (0)