-
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
955ce7c
commit 5840200
Showing
7 changed files
with
132 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ import ( | |
var _ = Describe("Contributor", func() { | ||
When("unmarshaling from JSON", func() { | ||
It("should unmarshal", func() { | ||
exampleJSON := []byte("{\"customerId\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\",\"description\":\"string\",\"email\":\"string\",\"id\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\",\"logoRefId\":\"string\",\"name\":\"string\",\"phone\":\"string\",\"state\":\"enabled\",\"url\":\"string\"}") | ||
exampleJSON := []byte("{\"customerId\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\",\"description\":\"string\",\"email\":\"string\",\"id\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\",\"logoRefId\":\"string\",\"name\":\"string\",\"phone\":\"string\",\"state\":\"enabled\",\"supportInformation\":{\"email\":\"[email protected]\",\"phone\":\"string\"},\"url\":\"string\"}") | ||
|
||
sut := marketplacev2.Contributor{} | ||
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
51 changes: 51 additions & 0 deletions
51
mittwaldv2/generated/schemas/marketplacev2/ownextension_requestedchanges.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,51 @@ | ||
package marketplacev2 | ||
|
||
import "fmt" | ||
|
||
// 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: | ||
// "context": {"$ref": "#/components/schemas/de.mittwald.v1.marketplace.Context"} | ||
// "scopes": | ||
// type: "array" | ||
// items: | ||
// type: "string" | ||
// "webhookUrls": {"$ref": "#/components/schemas/de.mittwald.v1.marketplace.BackendComponents"} | ||
// additionalProperties: false | ||
|
||
type OwnExtensionRequestedChanges struct { | ||
Context *Context `json:"context,omitempty"` | ||
Scopes []string `json:"scopes,omitempty"` | ||
WebhookUrls *BackendComponents `json:"webhookUrls,omitempty"` | ||
} | ||
|
||
func (o *OwnExtensionRequestedChanges) Validate() error { | ||
if err := func() error { | ||
if o.Context == nil { | ||
return nil | ||
} | ||
return o.Context.Validate() | ||
}(); err != nil { | ||
return fmt.Errorf("invalid property context: %w", err) | ||
} | ||
if err := func() error { | ||
if o.Scopes == nil { | ||
return nil | ||
} | ||
return nil | ||
}(); err != nil { | ||
return fmt.Errorf("invalid property scopes: %w", err) | ||
} | ||
if err := func() error { | ||
if o.WebhookUrls == nil { | ||
return nil | ||
} | ||
return o.WebhookUrls.Validate() | ||
}(); err != nil { | ||
return fmt.Errorf("invalid property webhookUrls: %w", err) | ||
} | ||
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 |
---|---|---|
|
@@ -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\",\"statistics\":{\"amountOfInstances\":42},\"subTitle\":{\"de\":\"Ping deine App an\",\"en\":\"Ping your app\"},\"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},\"functional\":true,\"id\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\",\"logoRefId\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\",\"name\":\"string\",\"published\":true,\"requestedChanges\":{\"context\":\"project\",\"scopes\":[\"string\"],\"webhookUrls\":{\"extensionAddedToContext\":{\"url\":\"string\"},\"extensionInstanceRemovedFromContext\":{\"url\":\"string\"},\"extensionInstanceSecretRotated\":{\"url\":\"string\"},\"extensionInstanceUpdated\":{\"url\":\"string\"}}},\"scopes\":[\"string\"],\"state\":\"enabled\",\"statistics\":{\"amountOfInstances\":42},\"subTitle\":{\"de\":\"Ping deine App an\",\"en\":\"Ping your app\"},\"support\":{\"email\":\"[email protected]\",\"phone\":\"string\"},\"tags\":[\"string\"],\"verificationRequested\":true,\"verified\":true}") | ||
|
||
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