-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20eb971
commit a9b722e
Showing
11 changed files
with
255 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ import ( | |
var _ = Describe("Extension", func() { | ||
When("unmarshaling from JSON", func() { | ||
It("should unmarshal", func() { | ||
exampleJSON := []byte("{\"blocked\":true,\"context\":\"project\",\"contributorId\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\",\"deprecation\":{\"deprecatedAt\":\"2006-01-02T15:04:05Z\",\"note\":\"This extension is no longer actively maintained. Please Use the successor extension instead.\",\"successorId\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\"},\"description\":\"string\",\"detailedDescriptions\":{\"de\":{\"markdown\":\"string\",\"plain\":\"string\"},\"en\":{\"markdown\":\"string\",\"plain\":\"string\"}},\"disabled\":true,\"frontendComponents\":[{\"name\":\"string\",\"url\":\"string\"}],\"frontendFragments\":{\"string\":null},\"id\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\",\"logoRefId\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\",\"name\":\"string\",\"published\":true,\"scopes\":[\"string\"],\"state\":\"enabled\",\"support\":{\"email\":\"[email protected]\",\"phone\":\"string\"},\"tags\":[\"string\"]}") | ||
exampleJSON := []byte("{\"blocked\":true,\"context\":\"project\",\"contributorId\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\",\"deprecation\":{\"deprecatedAt\":\"2006-01-02T15:04:05Z\",\"note\":\"This extension is no longer actively maintained. Please Use the successor extension instead.\",\"successorId\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\"},\"description\":\"string\",\"detailedDescriptions\":{\"de\":{\"markdown\":\"string\",\"plain\":\"string\"},\"en\":{\"markdown\":\"string\",\"plain\":\"string\"}},\"disabled\":true,\"frontendComponents\":[{\"name\":\"string\",\"url\":\"string\"}],\"frontendFragments\":{\"string\":null},\"id\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\",\"logoRefId\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\",\"name\":\"MyPingExtension\",\"published\":true,\"scopes\":[\"string\"],\"state\":\"enabled\",\"subTitle\":{\"de\":\"Ping deine App an\",\"en\":\"Ping your app\"},\"support\":{\"email\":\"[email protected]\",\"phone\":\"string\"},\"tags\":[\"string\"]}") | ||
|
||
sut := marketplacev2.Extension{} | ||
Expect(json.Unmarshal(exampleJSON, &sut)).To(Succeed()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ import ( | |
var _ = Describe("OwnExtension", func() { | ||
When("unmarshaling from JSON", func() { | ||
It("should unmarshal", func() { | ||
exampleJSON := []byte("{\"backendComponents\":{\"extensionAddedToContext\":{\"url\":\"string\"},\"extensionInstanceRemovedFromContext\":{\"url\":\"string\"},\"extensionInstanceSecretRotated\":{\"url\":\"string\"},\"extensionInstanceUpdated\":{\"url\":\"string\"}},\"blocked\":true,\"context\":\"project\",\"contributorId\":\"string\",\"deprecation\":{\"deprecatedAt\":\"2006-01-02T15:04:05Z\",\"note\":\"This extension is no longer actively maintained. Please Use the successor extension instead.\",\"successorId\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\"},\"description\":\"string\",\"detailedDescriptions\":{\"de\":{\"markdown\":\"string\",\"plain\":\"string\"},\"en\":{\"markdown\":\"string\",\"plain\":\"string\"}},\"disabled\":true,\"frontendComponents\":[{\"name\":\"string\",\"url\":\"string\"}],\"frontendFragments\":{\"string\":null},\"id\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\",\"name\":\"string\",\"scopes\":[\"string\"],\"state\":\"enabled\",\"support\":{\"email\":\"[email protected]\",\"phone\":\"string\"},\"tags\":[\"string\"]}") | ||
exampleJSON := []byte("{\"backendComponents\":{\"extensionAddedToContext\":{\"url\":\"string\"},\"extensionInstanceRemovedFromContext\":{\"url\":\"string\"},\"extensionInstanceSecretRotated\":{\"url\":\"string\"},\"extensionInstanceUpdated\":{\"url\":\"string\"}},\"blocked\":true,\"context\":\"project\",\"contributorId\":\"string\",\"deprecation\":{\"deprecatedAt\":\"2006-01-02T15:04:05Z\",\"note\":\"This extension is no longer actively maintained. Please Use the successor extension instead.\",\"successorId\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\"},\"description\":\"string\",\"detailedDescriptions\":{\"de\":{\"markdown\":\"string\",\"plain\":\"string\"},\"en\":{\"markdown\":\"string\",\"plain\":\"string\"}},\"disabled\":true,\"frontendComponents\":[{\"name\":\"string\",\"url\":\"string\"}],\"frontendFragments\":{\"string\":null},\"id\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\",\"name\":\"string\",\"scopes\":[\"string\"],\"state\":\"enabled\",\"subTitle\":{\"de\":\"Ping deine App an\",\"en\":\"Ping your app\"},\"support\":{\"email\":\"[email protected]\",\"phone\":\"string\"},\"tags\":[\"string\"]}") | ||
|
||
sut := marketplacev2.OwnExtension{} | ||
Expect(json.Unmarshal(exampleJSON, &sut)).To(Succeed()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package marketplacev2 | ||
|
||
// This code was automatically generated by github.com/mittwald/api-client-go-builder. | ||
// DO NOT EDIT. | ||
|
||
//This data type was generated from the following JSON schema: | ||
// type: "object" | ||
// properties: | ||
// "de": | ||
// type: "string" | ||
// example: "Ping deine App an" | ||
// "en": | ||
// type: "string" | ||
// example: "Ping your app" | ||
// required: | ||
// - "de" | ||
// description: "A brief subtitle for the extension." | ||
|
||
// A brief subtitle for the extension. | ||
type SubTitle struct { | ||
De string `json:"de"` | ||
En *string `json:"en,omitempty"` | ||
} | ||
|
||
func (o *SubTitle) Validate() error { | ||
return nil | ||
} |
24 changes: 24 additions & 0 deletions
24
mittwaldv2/generated/schemas/marketplacev2/subtitle_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package marketplacev2_test | ||
|
||
// This code was automatically generated by github.com/mittwald/api-client-go-builder. | ||
// DO NOT EDIT. | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
"github.com/mittwald/api-client-go/mittwaldv2/generated/schemas/marketplacev2" | ||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("SubTitle", func() { | ||
When("unmarshaling from JSON", func() { | ||
It("should unmarshal", func() { | ||
exampleJSON := []byte("{\"de\":\"Ping deine App an\",\"en\":\"Ping your app\"}") | ||
|
||
sut := marketplacev2.SubTitle{} | ||
Expect(json.Unmarshal(exampleJSON, &sut)).To(Succeed()) | ||
Expect(sut.Validate()).To(Succeed()) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package projectv2 | ||
|
||
// This code was automatically generated by github.com/mittwald/api-client-go-builder. | ||
// DO NOT EDIT. | ||
|
||
//This data type was generated from the following JSON schema: | ||
// type: "object" | ||
// properties: | ||
// "maximum": | ||
// type: "integer" | ||
// minimum: 1 | ||
// "minimum": | ||
// type: "integer" | ||
// minimum: 1 | ||
// required: | ||
// - "minimum" | ||
// - "maximum" | ||
|
||
type Scaling struct { | ||
Maximum int64 `json:"maximum"` | ||
Minimum int64 `json:"minimum"` | ||
} | ||
|
||
func (o *Scaling) Validate() error { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package projectv2_test | ||
|
||
// This code was automatically generated by github.com/mittwald/api-client-go-builder. | ||
// DO NOT EDIT. | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
"github.com/mittwald/api-client-go/mittwaldv2/generated/schemas/projectv2" | ||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("Scaling", func() { | ||
When("unmarshaling from JSON", func() { | ||
It("should unmarshal", func() { | ||
exampleJSON := []byte("{\"maximum\":42,\"minimum\":42}") | ||
|
||
sut := projectv2.Scaling{} | ||
Expect(json.Unmarshal(exampleJSON, &sut)).To(Succeed()) | ||
Expect(sut.Validate()).To(Succeed()) | ||
}) | ||
}) | ||
}) |
108 changes: 108 additions & 0 deletions
108
mittwaldv2/generated/schemas/projectv2/serverinternal.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
package projectv2 | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
) | ||
|
||
// This code was automatically generated by github.com/mittwald/api-client-go-builder. | ||
// DO NOT EDIT. | ||
|
||
//This data type was generated from the following JSON schema: | ||
// type: "object" | ||
// properties: | ||
// "clusterName": | ||
// type: "string" | ||
// "createdAt": | ||
// type: "string" | ||
// format: "date-time" | ||
// "customerId": | ||
// type: "string" | ||
// example: "673c107f-75e1-451c-8eaa-5bf101bd2b2c" | ||
// "description": | ||
// type: "string" | ||
// example: "My first Server!" | ||
// "disabledReason": {"$ref": "#/components/schemas/de.mittwald.v1.project.ServerDisableReason"} | ||
// "id": | ||
// type: "string" | ||
// format: "uuid" | ||
// "imageRefId": | ||
// type: "string" | ||
// format: "uuid" | ||
// "isReady": | ||
// type: "boolean" | ||
// description: "deprecated by property status" | ||
// deprecated: true | ||
// "machineType": {"$ref": "#/components/schemas/de.mittwald.v1.project.MachineType"} | ||
// "readiness": {"$ref": "#/components/schemas/de.mittwald.v1.project.DeprecatedServerReadinessStatus"} | ||
// "scaling": {"$ref": "#/components/schemas/de.mittwald.v1.project.Scaling"} | ||
// "shortId": | ||
// type: "string" | ||
// example: "s-4e7tz3" | ||
// "statisticsBaseDomain": | ||
// type: "string" | ||
// format: "hostname" | ||
// example: "pe-prod.staging.mcloud.services" | ||
// "status": {"$ref": "#/components/schemas/de.mittwald.v1.project.ServerStatus"} | ||
// "storage": | ||
// type: "string" | ||
// example: "50Gi" | ||
// required: | ||
// - "id" | ||
// - "shortId" | ||
// - "customerId" | ||
// - "machineType" | ||
// - "storage" | ||
// - "description" | ||
// - "isReady" | ||
// - "readiness" | ||
// - "createdAt" | ||
// - "clusterName" | ||
// - "status" | ||
|
||
type ServerInternal struct { | ||
ClusterName string `json:"clusterName"` | ||
CreatedAt time.Time `json:"createdAt"` | ||
CustomerId string `json:"customerId"` | ||
Description string `json:"description"` | ||
DisabledReason *ServerDisableReason `json:"disabledReason,omitempty"` | ||
Id string `json:"id"` | ||
ImageRefId *string `json:"imageRefId,omitempty"` | ||
IsReady bool `json:"isReady"` | ||
MachineType MachineType `json:"machineType"` | ||
Readiness DeprecatedServerReadinessStatus `json:"readiness"` | ||
Scaling *Scaling `json:"scaling,omitempty"` | ||
ShortId string `json:"shortId"` | ||
StatisticsBaseDomain *string `json:"statisticsBaseDomain,omitempty"` | ||
Status ServerStatus `json:"status"` | ||
Storage string `json:"storage"` | ||
} | ||
|
||
func (o *ServerInternal) Validate() error { | ||
if err := func() error { | ||
if o.DisabledReason == nil { | ||
return nil | ||
} | ||
return o.DisabledReason.Validate() | ||
}(); err != nil { | ||
return fmt.Errorf("invalid property disabledReason: %w", err) | ||
} | ||
if err := o.MachineType.Validate(); err != nil { | ||
return fmt.Errorf("invalid property machineType: %w", err) | ||
} | ||
if err := o.Readiness.Validate(); err != nil { | ||
return fmt.Errorf("invalid property readiness: %w", err) | ||
} | ||
if err := func() error { | ||
if o.Scaling == nil { | ||
return nil | ||
} | ||
return o.Scaling.Validate() | ||
}(); err != nil { | ||
return fmt.Errorf("invalid property scaling: %w", err) | ||
} | ||
if err := o.Status.Validate(); err != nil { | ||
return fmt.Errorf("invalid property status: %w", err) | ||
} | ||
return nil | ||
} |
24 changes: 24 additions & 0 deletions
24
mittwaldv2/generated/schemas/projectv2/serverinternal_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package projectv2_test | ||
|
||
// This code was automatically generated by github.com/mittwald/api-client-go-builder. | ||
// DO NOT EDIT. | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
"github.com/mittwald/api-client-go/mittwaldv2/generated/schemas/projectv2" | ||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("ServerInternal", func() { | ||
When("unmarshaling from JSON", func() { | ||
It("should unmarshal", func() { | ||
exampleJSON := []byte("{\"clusterName\":\"string\",\"createdAt\":\"2006-01-02T15:04:05Z\",\"customerId\":\"673c107f-75e1-451c-8eaa-5bf101bd2b2c\",\"description\":\"My first Server!\",\"disabledReason\":\"suspended\",\"id\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\",\"imageRefId\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\",\"isReady\":true,\"machineType\":{\"cpu\":\"2\",\"memory\":\"4Gi\",\"name\":\"shared.large\"},\"readiness\":\"creating\",\"scaling\":{\"maximum\":42,\"minimum\":42},\"shortId\":\"s-4e7tz3\",\"statisticsBaseDomain\":\"pe-prod.staging.mcloud.services\",\"status\":\"pending\",\"storage\":\"50Gi\"}") | ||
|
||
sut := projectv2.ServerInternal{} | ||
Expect(json.Unmarshal(exampleJSON, &sut)).To(Succeed()) | ||
Expect(sut.Validate()).To(Succeed()) | ||
}) | ||
}) | ||
}) |