Skip to content

Commit 598b19e

Browse files
committed
fix: change naming to resolve conflicts, update sdk
1 parent 3ad2f14 commit 598b19e

19 files changed

+306
-123
lines changed

dto/input/body/putAppVersionBuildAndDeploy.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,34 @@ var _ strconv.NumError
1414
var _ json.Unmarshaler = (*PutAppVersionBuildAndDeploy)(nil)
1515

1616
type PutAppVersionBuildAndDeploy struct {
17-
BuildConfigContent types.MediumText `json:"buildConfigContent"`
18-
Source types.StringNull `json:"source"`
17+
ZeropsYaml types.MediumText `json:"zeropsYaml"`
18+
Source types.StringNull `json:"source"`
1919
}
2020

21-
func (dto PutAppVersionBuildAndDeploy) GetBuildConfigContent() types.MediumText {
22-
return dto.BuildConfigContent
21+
func (dto PutAppVersionBuildAndDeploy) GetZeropsYaml() types.MediumText {
22+
return dto.ZeropsYaml
2323
}
2424
func (dto PutAppVersionBuildAndDeploy) GetSource() types.StringNull {
2525
return dto.Source
2626
}
2727

2828
func (dto *PutAppVersionBuildAndDeploy) UnmarshalJSON(b []byte) error {
2929
var aux = struct {
30-
BuildConfigContent *types.MediumText
31-
Source types.StringNull
30+
ZeropsYaml *types.MediumText
31+
Source types.StringNull
3232
}{}
3333
err := json.Unmarshal(b, &aux)
3434
if err != nil {
3535
return validator.JsonValidation("PutAppVersionBuildAndDeploy", err)
3636
}
3737
var errorList validator.ErrorList
38-
if aux.BuildConfigContent == nil {
39-
errorList = errorList.With(validator.NewError("buildConfigContent", "field is required"))
38+
if aux.ZeropsYaml == nil {
39+
errorList = errorList.With(validator.NewError("zeropsYaml", "field is required"))
4040
}
4141
if errorList != nil {
4242
return errorList.GetError()
4343
}
44-
dto.BuildConfigContent = *aux.BuildConfigContent
44+
dto.ZeropsYaml = *aux.ZeropsYaml
4545
dto.Source = aux.Source
4646

4747
return nil

dto/input/body/putAppVersionDeploy.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ var _ strconv.NumError
1414
var _ json.Unmarshaler = (*PutAppVersionDeploy)(nil)
1515

1616
type PutAppVersionDeploy struct {
17-
ConfigContent types.MediumTextNull `json:"configContent"`
18-
Source types.StringNull `json:"source"`
17+
ZeropsYaml types.MediumTextNull `json:"zeropsYaml"`
18+
Source types.StringNull `json:"source"`
1919
}
2020

21-
func (dto PutAppVersionDeploy) GetConfigContent() types.MediumTextNull {
22-
return dto.ConfigContent
21+
func (dto PutAppVersionDeploy) GetZeropsYaml() types.MediumTextNull {
22+
return dto.ZeropsYaml
2323
}
2424
func (dto PutAppVersionDeploy) GetSource() types.StringNull {
2525
return dto.Source
2626
}
2727

2828
func (dto *PutAppVersionDeploy) UnmarshalJSON(b []byte) error {
2929
var aux = struct {
30-
ConfigContent types.MediumTextNull
31-
Source types.StringNull
30+
ZeropsYaml types.MediumTextNull
31+
Source types.StringNull
3232
}{}
3333
err := json.Unmarshal(b, &aux)
3434
if err != nil {
@@ -39,7 +39,7 @@ func (dto *PutAppVersionDeploy) UnmarshalJSON(b []byte) error {
3939
if errorList != nil {
4040
return errorList.GetError()
4141
}
42-
dto.ConfigContent = aux.ConfigContent
42+
dto.ZeropsYaml = aux.ZeropsYaml
4343
dto.Source = aux.Source
4444

4545
return nil

dto/input/body/zeropsYamlValidation.go

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,23 @@ var _ strconv.NumError
1616
var _ json.Unmarshaler = (*ZeropsYamlValidation)(nil)
1717

1818
type ZeropsYamlValidation struct {
19-
Name types.String `json:"name"`
20-
ServiceStackTypeId stringId.ServiceStackTypeId `json:"serviceStackTypeId"`
21-
ZeropsYaml types.Text `json:"zeropsYaml"`
22-
Operation enum.ZeropsYamlValidationOperationEnum `json:"operation"`
19+
ServiceStackName types.String `json:"serviceStackName"`
20+
ServiceStackTypeId stringId.ServiceStackTypeId `json:"serviceStackTypeId"`
21+
ServiceStackTypeVersionName types.String `json:"serviceStackTypeVersionName"`
22+
ZeropsYaml types.MediumText `json:"zeropsYaml"`
23+
Operation enum.ZeropsYamlValidationOperationEnum `json:"operation"`
2324
}
2425

25-
func (dto ZeropsYamlValidation) GetName() types.String {
26-
return dto.Name
26+
func (dto ZeropsYamlValidation) GetServiceStackName() types.String {
27+
return dto.ServiceStackName
2728
}
2829
func (dto ZeropsYamlValidation) GetServiceStackTypeId() stringId.ServiceStackTypeId {
2930
return dto.ServiceStackTypeId
3031
}
31-
func (dto ZeropsYamlValidation) GetZeropsYaml() types.Text {
32+
func (dto ZeropsYamlValidation) GetServiceStackTypeVersionName() types.String {
33+
return dto.ServiceStackTypeVersionName
34+
}
35+
func (dto ZeropsYamlValidation) GetZeropsYaml() types.MediumText {
3236
return dto.ZeropsYaml
3337
}
3438
func (dto ZeropsYamlValidation) GetOperation() enum.ZeropsYamlValidationOperationEnum {
@@ -37,22 +41,26 @@ func (dto ZeropsYamlValidation) GetOperation() enum.ZeropsYamlValidationOperatio
3741

3842
func (dto *ZeropsYamlValidation) UnmarshalJSON(b []byte) error {
3943
var aux = struct {
40-
Name *types.String
41-
ServiceStackTypeId *stringId.ServiceStackTypeId
42-
ZeropsYaml *types.Text
43-
Operation *enum.ZeropsYamlValidationOperationEnum
44+
ServiceStackName *types.String
45+
ServiceStackTypeId *stringId.ServiceStackTypeId
46+
ServiceStackTypeVersionName *types.String
47+
ZeropsYaml *types.MediumText
48+
Operation *enum.ZeropsYamlValidationOperationEnum
4449
}{}
4550
err := json.Unmarshal(b, &aux)
4651
if err != nil {
4752
return validator.JsonValidation("ZeropsYamlValidation", err)
4853
}
4954
var errorList validator.ErrorList
50-
if aux.Name == nil {
51-
errorList = errorList.With(validator.NewError("name", "field is required"))
55+
if aux.ServiceStackName == nil {
56+
errorList = errorList.With(validator.NewError("serviceStackName", "field is required"))
5257
}
5358
if aux.ServiceStackTypeId == nil {
5459
errorList = errorList.With(validator.NewError("serviceStackTypeId", "field is required"))
5560
}
61+
if aux.ServiceStackTypeVersionName == nil {
62+
errorList = errorList.With(validator.NewError("serviceStackTypeVersionName", "field is required"))
63+
}
5664
if aux.ZeropsYaml == nil {
5765
errorList = errorList.With(validator.NewError("zeropsYaml", "field is required"))
5866
}
@@ -62,8 +70,9 @@ func (dto *ZeropsYamlValidation) UnmarshalJSON(b []byte) error {
6270
if errorList != nil {
6371
return errorList.GetError()
6472
}
65-
dto.Name = *aux.Name
73+
dto.ServiceStackName = *aux.ServiceStackName
6674
dto.ServiceStackTypeId = *aux.ServiceStackTypeId
75+
dto.ServiceStackTypeVersionName = *aux.ServiceStackTypeVersionName
6776
dto.ZeropsYaml = *aux.ZeropsYaml
6877
dto.Operation = *aux.Operation
6978

dto/input/path/projectIdVpnPublicKey.go renamed to dto/input/path/projectIdBase64PublicKey.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/zeropsio/zerops-go/types/uuid"
88
)
99

10-
type ProjectIdVpnPublicKey struct {
11-
Id uuid.ProjectId
12-
VpnPublicKey types.String
10+
type ProjectIdBase64PublicKey struct {
11+
Id uuid.ProjectId
12+
Base64PublicKey types.String
1313
}

dto/output/userDataLight.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ type UserDataLight struct {
2424
LastUpdate types.DateTime `json:"lastUpdate"`
2525
IsSynced types.Bool `json:"isSynced"`
2626
DeleteOnSync types.Bool `json:"deleteOnSync"`
27+
Sensitive types.Bool `json:"sensitive"`
2728
Version enum.UserDataVersionEnum `json:"version"`
2829
LastSync types.DateTimeNull `json:"lastSync"`
2930
}

errorCode/codes.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ const (
258258
GithubWrongRepositoryFullNameFormat ErrorCode = "githubWrongRepositoryFullNameFormat"
259259
GithubWebhooksLimitExceeded ErrorCode = "githubWebhooksLimitExceeded"
260260
BranchIsEmpty ErrorCode = "branchIsEmpty"
261+
GithubFileBase64InvalidEncoding ErrorCode = "githubFileBase64InvalidEncoding"
261262
AvatarUploadForbiddenImageType ErrorCode = "avatarUploadForbiddenImageType"
262263
AvatarUploadMaxSize ErrorCode = "avatarUploadMaxSize"
263264
AvatarUploadFileNotFound ErrorCode = "avatarUploadFileNotFound"
@@ -275,6 +276,7 @@ const (
275276
GitlabPushIgnored ErrorCode = "gitlabPushIgnored"
276277
YamlFieldLengthError ErrorCode = "yamlFieldLengthError"
277278
YamlWrongUseFieldType ErrorCode = "yamlWrongUseFieldType"
279+
GitlabFileBase64InvalidEncoding ErrorCode = "gitlabFileBase64InvalidEncoding"
278280
VatNumberNotInEUCountry ErrorCode = "vatNumberNotInEUCountry"
279281
CompanyNotFoundInEU ErrorCode = "companyNotFoundInEU"
280282
VatNumberMissing ErrorCode = "vatNumberMissing"
@@ -294,6 +296,7 @@ const (
294296
InvoiceNotFound ErrorCode = "invoiceNotFound"
295297
PriceListNotFound ErrorCode = "priceListNotFound"
296298
CostLimitTooSmall ErrorCode = "costLimitTooSmall"
299+
InvalidVpnPublicKey ErrorCode = "invalidVpnPublicKey"
297300
YamlPreprocessingMaxDurationExceeded ErrorCode = "yamlPreprocessingMaxDurationExceeded"
298301
YamlPreprocessingError ErrorCode = "yamlPreprocessingError"
299302
ProjectImportInvalidYaml ErrorCode = "projectImportInvalidYaml"
@@ -321,6 +324,14 @@ const (
321324
UnexpectedYamlEncoding ErrorCode = "unexpectedYamlEncoding"
322325
BucketAlreadyExists ErrorCode = "bucketAlreadyExists"
323326
S3ApiRequestFailed ErrorCode = "s3ApiRequestFailed"
327+
ZeropsYamlSetupNotFound ErrorCode = "zeropsYamlSetupNotFound"
328+
ZeropsYamlInvalidYaml ErrorCode = "zeropsYamlInvalidYaml"
329+
ZeropsYamlInvalidParameter ErrorCode = "zeropsYamlInvalidParameter"
330+
ZeropsYamlMissingParameter ErrorCode = "zeropsYamlMissingParameter"
331+
ZeropsYamlDocumentRootRequired ErrorCode = "zeropsYamlDocumentRootRequired"
332+
ZeropsYamlStartCommandRequired ErrorCode = "zeropsYamlStartCommandRequired"
333+
ZeropsYamlNoProbeSpecified ErrorCode = "zeropsYamlNoProbeSpecified"
334+
ZeropsYamlTooManyProbes ErrorCode = "zeropsYamlTooManyProbes"
324335
UserIdWasNotFound ErrorCode = "userIdWasNotFound"
325336
AuthorIdWasNotFound ErrorCode = "authorIdWasNotFound"
326337
UserDoesNotHaveActiveConnectionToAnyClient ErrorCode = "userDoesNotHaveActiveConnectionToAnyClient"

sdk/GetProjectVpn.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ func (r GetProjectVpnResponse) StatusCode() int {
4141
return r.responseStatusCode
4242
}
4343

44-
func (h Handler) GetProjectVpn(ctx context.Context, inputDtoPath path.ProjectIdVpnPublicKey) (getProjectVpnResponse GetProjectVpnResponse, err error) {
45-
u := "/api/rest/public/project/" + inputDtoPath.Id.Native() + "/vpn"
44+
func (h Handler) GetProjectVpn(ctx context.Context, inputDtoPath path.ProjectIdBase64PublicKey) (getProjectVpnResponse GetProjectVpnResponse, err error) {
45+
u := "/api/rest/public/project/" + inputDtoPath.Id.Native() + "/vpn/" + inputDtoPath.Base64PublicKey.Native() + ""
4646

4747
var response GetProjectVpnResponse
4848
sdkResponse := sdkBase.Get(

sdk/GetServiceStackMariadbV103.go renamed to sdk/GetServiceStackMariadbV106.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,36 @@ import (
1515
"github.com/zeropsio/zerops-go/sdkBase"
1616
)
1717

18-
type GetServiceStackMariadbV103Response struct {
18+
type GetServiceStackMariadbV106Response struct {
1919
success output.ServiceStackMariaDb
2020
err error
2121
responseHeaders http.Header
2222
responseStatusCode int
2323
}
2424

25-
func (r GetServiceStackMariadbV103Response) OutputInterface() (output interface{}, err error) {
25+
func (r GetServiceStackMariadbV106Response) OutputInterface() (output interface{}, err error) {
2626
return r.success, r.err
2727
}
2828

29-
func (r GetServiceStackMariadbV103Response) Output() (output output.ServiceStackMariaDb, err error) {
29+
func (r GetServiceStackMariadbV106Response) Output() (output output.ServiceStackMariaDb, err error) {
3030
return r.success, r.err
3131
}
3232

33-
func (r GetServiceStackMariadbV103Response) Err() error {
33+
func (r GetServiceStackMariadbV106Response) Err() error {
3434
return r.err
3535
}
36-
func (r GetServiceStackMariadbV103Response) Headers() http.Header {
36+
func (r GetServiceStackMariadbV106Response) Headers() http.Header {
3737
return r.responseHeaders
3838
}
3939

40-
func (r GetServiceStackMariadbV103Response) StatusCode() int {
40+
func (r GetServiceStackMariadbV106Response) StatusCode() int {
4141
return r.responseStatusCode
4242
}
4343

44-
func (h Handler) GetServiceStackMariadbV103(ctx context.Context, inputDtoPath path.ServiceStackId) (getServiceStackMariadbV103Response GetServiceStackMariadbV103Response, err error) {
45-
u := "/api/rest/public/service-stack/mariadb_v10_3/" + inputDtoPath.Id.Native() + ""
44+
func (h Handler) GetServiceStackMariadbV106(ctx context.Context, inputDtoPath path.ServiceStackId) (getServiceStackMariadbV106Response GetServiceStackMariadbV106Response, err error) {
45+
u := "/api/rest/public/service-stack/mariadb_v10_6/" + inputDtoPath.Id.Native() + ""
4646

47-
var response GetServiceStackMariadbV103Response
47+
var response GetServiceStackMariadbV106Response
4848
sdkResponse := sdkBase.Get(
4949
ctx,
5050
h.environment,

sdk/GetServiceStackNodejsV14.go renamed to sdk/GetServiceStackNodejsV20.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,36 @@ import (
1515
"github.com/zeropsio/zerops-go/sdkBase"
1616
)
1717

18-
type GetServiceStackNodejsV14Response struct {
18+
type GetServiceStackNodejsV20Response struct {
1919
success output.ServiceStack
2020
err error
2121
responseHeaders http.Header
2222
responseStatusCode int
2323
}
2424

25-
func (r GetServiceStackNodejsV14Response) OutputInterface() (output interface{}, err error) {
25+
func (r GetServiceStackNodejsV20Response) OutputInterface() (output interface{}, err error) {
2626
return r.success, r.err
2727
}
2828

29-
func (r GetServiceStackNodejsV14Response) Output() (output output.ServiceStack, err error) {
29+
func (r GetServiceStackNodejsV20Response) Output() (output output.ServiceStack, err error) {
3030
return r.success, r.err
3131
}
3232

33-
func (r GetServiceStackNodejsV14Response) Err() error {
33+
func (r GetServiceStackNodejsV20Response) Err() error {
3434
return r.err
3535
}
36-
func (r GetServiceStackNodejsV14Response) Headers() http.Header {
36+
func (r GetServiceStackNodejsV20Response) Headers() http.Header {
3737
return r.responseHeaders
3838
}
3939

40-
func (r GetServiceStackNodejsV14Response) StatusCode() int {
40+
func (r GetServiceStackNodejsV20Response) StatusCode() int {
4141
return r.responseStatusCode
4242
}
4343

44-
func (h Handler) GetServiceStackNodejsV14(ctx context.Context, inputDtoPath path.ServiceStackId) (getServiceStackNodejsV14Response GetServiceStackNodejsV14Response, err error) {
45-
u := "/api/rest/public/service-stack/nodejs_v14/" + inputDtoPath.Id.Native() + ""
44+
func (h Handler) GetServiceStackNodejsV20(ctx context.Context, inputDtoPath path.ServiceStackId) (getServiceStackNodejsV20Response GetServiceStackNodejsV20Response, err error) {
45+
u := "/api/rest/public/service-stack/nodejs_v20/" + inputDtoPath.Id.Native() + ""
4646

47-
var response GetServiceStackNodejsV14Response
47+
var response GetServiceStackNodejsV20Response
4848
sdkResponse := sdkBase.Get(
4949
ctx,
5050
h.environment,

sdk/GetServiceStackMariadbV104.go renamed to sdk/GetServiceStackPostgresqlV14.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,36 @@ import (
1515
"github.com/zeropsio/zerops-go/sdkBase"
1616
)
1717

18-
type GetServiceStackMariadbV104Response struct {
19-
success output.ServiceStackMariaDb
18+
type GetServiceStackPostgresqlV14Response struct {
19+
success output.ServiceStackPostgreSql
2020
err error
2121
responseHeaders http.Header
2222
responseStatusCode int
2323
}
2424

25-
func (r GetServiceStackMariadbV104Response) OutputInterface() (output interface{}, err error) {
25+
func (r GetServiceStackPostgresqlV14Response) OutputInterface() (output interface{}, err error) {
2626
return r.success, r.err
2727
}
2828

29-
func (r GetServiceStackMariadbV104Response) Output() (output output.ServiceStackMariaDb, err error) {
29+
func (r GetServiceStackPostgresqlV14Response) Output() (output output.ServiceStackPostgreSql, err error) {
3030
return r.success, r.err
3131
}
3232

33-
func (r GetServiceStackMariadbV104Response) Err() error {
33+
func (r GetServiceStackPostgresqlV14Response) Err() error {
3434
return r.err
3535
}
36-
func (r GetServiceStackMariadbV104Response) Headers() http.Header {
36+
func (r GetServiceStackPostgresqlV14Response) Headers() http.Header {
3737
return r.responseHeaders
3838
}
3939

40-
func (r GetServiceStackMariadbV104Response) StatusCode() int {
40+
func (r GetServiceStackPostgresqlV14Response) StatusCode() int {
4141
return r.responseStatusCode
4242
}
4343

44-
func (h Handler) GetServiceStackMariadbV104(ctx context.Context, inputDtoPath path.ServiceStackId) (getServiceStackMariadbV104Response GetServiceStackMariadbV104Response, err error) {
45-
u := "/api/rest/public/service-stack/mariadb_v10_4/" + inputDtoPath.Id.Native() + ""
44+
func (h Handler) GetServiceStackPostgresqlV14(ctx context.Context, inputDtoPath path.ServiceStackId) (getServiceStackPostgresqlV14Response GetServiceStackPostgresqlV14Response, err error) {
45+
u := "/api/rest/public/service-stack/postgresql_v14/" + inputDtoPath.Id.Native() + ""
4646

47-
var response GetServiceStackMariadbV104Response
47+
var response GetServiceStackPostgresqlV14Response
4848
sdkResponse := sdkBase.Get(
4949
ctx,
5050
h.environment,

0 commit comments

Comments
 (0)