Skip to content

Commit 4efb83d

Browse files
chore: update auto-generated code
1 parent 84097c0 commit 4efb83d

File tree

3 files changed

+103
-3
lines changed

3 files changed

+103
-3
lines changed

mittwaldv2/generated/clients/marketplaceclientv2/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ type Client interface {
103103
ctx context.Context,
104104
req GetContributorRequest,
105105
reqEditors ...func(req *http.Request) error,
106-
) (*marketplacev2.Contributor, *http.Response, error)
106+
) (*any, *http.Response, error)
107107
GetExtensionInstanceForCustomer(
108108
ctx context.Context,
109109
req GetExtensionInstanceForCustomerRequest,
@@ -658,7 +658,7 @@ func (c *clientImpl) GetContributor(
658658
ctx context.Context,
659659
req GetContributorRequest,
660660
reqEditors ...func(req *http.Request) error,
661-
) (*marketplacev2.Contributor, *http.Response, error) {
661+
) (*any, *http.Response, error) {
662662
httpReq, err := req.BuildRequest(reqEditors...)
663663
if err != nil {
664664
return nil, nil, err
@@ -674,7 +674,7 @@ func (c *clientImpl) GetContributor(
674674
return nil, httpRes, err
675675
}
676676

677-
var response marketplacev2.Contributor
677+
var response any
678678
if err := json.NewDecoder(httpRes.Body).Decode(&response); err != nil {
679679
return nil, httpRes, err
680680
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
package marketplacev2
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/mittwald/api-client-go/mittwaldv2/generated/schemas/customerv2"
7+
)
8+
9+
// This code was automatically generated by github.com/mittwald/api-client-go-builder.
10+
// DO NOT EDIT.
11+
12+
// This data type was generated from the following JSON schema:
13+
// type: "object"
14+
// properties:
15+
// "contactPersonUserId":
16+
// type: "string"
17+
// format: "uuid"
18+
// "contractOwner": {"$ref": "#/components/schemas/de.mittwald.v1.customer.Contact"}
19+
// "customerId":
20+
// type: "string"
21+
// "description":
22+
// type: "string"
23+
// "email":
24+
// type: "string"
25+
// format: "email"
26+
// deprecated: true
27+
// "id":
28+
// type: "string"
29+
// "logoRefId":
30+
// type: "string"
31+
// format: "uuid"
32+
// "name":
33+
// type: "string"
34+
// "phone":
35+
// type: "string"
36+
// deprecated: true
37+
// "state": {"$ref": "#/components/schemas/de.mittwald.v1.marketplace.ContributorState"}
38+
// "supportInformation": {"$ref": "#/components/schemas/de.mittwald.v1.marketplace.SupportMeta"}
39+
// "url":
40+
// type: "string"
41+
// required:
42+
// - "id"
43+
// - "customerId"
44+
// - "state"
45+
// - "name"
46+
// - "supportInformation"
47+
// - "contactPersonUserId"
48+
// - "contractOwner"
49+
50+
type OwnContributor struct {
51+
ContactPersonUserId string `json:"contactPersonUserId"`
52+
ContractOwner customerv2.Contact `json:"contractOwner"`
53+
CustomerId string `json:"customerId"`
54+
Description *string `json:"description,omitempty"`
55+
Email *string `json:"email,omitempty"`
56+
Id string `json:"id"`
57+
LogoRefId *string `json:"logoRefId,omitempty"`
58+
Name string `json:"name"`
59+
Phone *string `json:"phone,omitempty"`
60+
State ContributorState `json:"state"`
61+
SupportInformation SupportMeta `json:"supportInformation"`
62+
Url *string `json:"url,omitempty"`
63+
}
64+
65+
func (o *OwnContributor) Validate() error {
66+
if err := o.ContractOwner.Validate(); err != nil {
67+
return fmt.Errorf("invalid property contractOwner: %w", err)
68+
}
69+
if err := o.State.Validate(); err != nil {
70+
return fmt.Errorf("invalid property state: %w", err)
71+
}
72+
if err := o.SupportInformation.Validate(); err != nil {
73+
return fmt.Errorf("invalid property supportInformation: %w", err)
74+
}
75+
return nil
76+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package marketplacev2_test
2+
3+
// This code was automatically generated by github.com/mittwald/api-client-go-builder.
4+
// DO NOT EDIT.
5+
6+
import (
7+
"encoding/json"
8+
9+
"github.com/mittwald/api-client-go/mittwaldv2/generated/schemas/marketplacev2"
10+
. "github.com/onsi/ginkgo/v2"
11+
. "github.com/onsi/gomega"
12+
)
13+
14+
var _ = Describe("OwnContributor", func() {
15+
When("unmarshaling from JSON", func() {
16+
It("should unmarshal", func() {
17+
exampleJSON := []byte("{\"contactPersonUserId\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\",\"contractOwner\":{\"address\":{\"addressPrefix\":null,\"city\":\"Espelkamp\",\"countryCode\":\"DE\",\"houseNumber\":\"4-6\",\"street\":\"Königsberger Straße\",\"zip\":\"32339\"},\"company\":\"string\",\"emailAddress\":\"string\",\"firstName\":\"string\",\"lastName\":\"string\",\"phoneNumbers\":[\"string\"],\"salutation\":\"mr\",\"title\":\"string\",\"useFormalTerm\":true},\"customerId\":\"string\",\"description\":\"string\",\"email\":\"string\",\"id\":\"string\",\"logoRefId\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\",\"name\":\"string\",\"phone\":\"string\",\"state\":\"enabled\",\"supportInformation\":{\"email\":\"[email protected]\",\"phone\":\"string\"},\"url\":\"string\"}")
18+
19+
sut := marketplacev2.OwnContributor{}
20+
Expect(json.Unmarshal(exampleJSON, &sut)).To(Succeed())
21+
Expect(sut.Validate()).To(Succeed())
22+
})
23+
})
24+
})

0 commit comments

Comments
 (0)