Skip to content

Commit

Permalink
Regenerate code
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-helmich committed Jan 21, 2025
1 parent f6d440a commit 3879bdc
Show file tree
Hide file tree
Showing 145 changed files with 888 additions and 888 deletions.
8 changes: 4 additions & 4 deletions mittwaldv2/generated/clients/app/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ type Client interface {
ctx context.Context,
req SetDatabaseUsersRequest,
) (*http.Response, error)
DeprecatedAppLinkDatabase(
DeprecatedLinkDatabase(
ctx context.Context,
req DeprecatedAppLinkDatabaseRequest,
req DeprecatedLinkDatabaseRequest,
) (*http.Response, error)
}
type clientImpl struct {
Expand Down Expand Up @@ -746,9 +746,9 @@ func (c *clientImpl) SetDatabaseUsers(
//Create linkage between an AppInstallation and a MySql-Database.
//
//This route is deprecated. Use PATCH /v2/app-installations/{appInstallationId}/database instead.
func (c *clientImpl) DeprecatedAppLinkDatabase(
func (c *clientImpl) DeprecatedLinkDatabase(
ctx context.Context,
req DeprecatedAppLinkDatabaseRequest,
req DeprecatedLinkDatabaseRequest,
) (*http.Response, error) {
httpReq, err := req.BuildRequest()
if err != nil {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import (
"github.com/google/uuid"
)

type DeprecatedAppLinkDatabaseRequest struct {
Body DeprecatedAppLinkDatabaseRequestBody
type DeprecatedLinkDatabaseRequest struct {
Body DeprecatedLinkDatabaseRequestBody
AppInstallationID uuid.UUID
}

func (r *DeprecatedAppLinkDatabaseRequest) BuildRequest() (*http.Request, error) {
func (r *DeprecatedLinkDatabaseRequest) BuildRequest() (*http.Request, error) {
body, err := r.body()
if err != nil {
return nil, err
Expand All @@ -28,18 +28,18 @@ func (r *DeprecatedAppLinkDatabaseRequest) BuildRequest() (*http.Request, error)
return http.NewRequest(http.MethodPut, r.url(), body)
}

func (r *DeprecatedAppLinkDatabaseRequest) body() (io.Reader, error) {
func (r *DeprecatedLinkDatabaseRequest) body() (io.Reader, error) {
out, err := json.Marshal(&r.Body)
if err != nil {
return nil, fmt.Errorf("error while marshalling JSON: %w", err)
}
return bytes.NewReader(out), nil
}

func (r *DeprecatedAppLinkDatabaseRequest) url() string {
func (r *DeprecatedLinkDatabaseRequest) url() string {
return fmt.Sprintf("/v2/appinstallations/%s/databases", url.PathEscape(r.AppInstallationID.String()))
}

func (r *DeprecatedAppLinkDatabaseRequest) query() url.Values {
func (r *DeprecatedLinkDatabaseRequest) query() url.Values {
return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import (
// - "purpose"

//
type DeprecatedAppLinkDatabaseRequestBody struct {
DatabaseId uuid.UUID `json:"databaseId"`
DatabaseUserIds map[string]string `json:"databaseUserIds,omitempty"`
Purpose DeprecatedAppLinkDatabaseRequestBodyPurpose `json:"purpose"`
type DeprecatedLinkDatabaseRequestBody struct {
DatabaseId uuid.UUID `json:"databaseId"`
DatabaseUserIds map[string]string `json:"databaseUserIds,omitempty"`
Purpose DeprecatedLinkDatabaseRequestBodyPurpose `json:"purpose"`
}

func (o *DeprecatedAppLinkDatabaseRequestBody) Validate() error {
func (o *DeprecatedLinkDatabaseRequestBody) Validate() error {
if err := o.Purpose.Validate(); err != nil {
return fmt.Errorf("invalid property purpose: %w", err)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package app

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: "string"
//enum:
// - "primary"
// - "cache"
// - "custom"

type DeprecatedLinkDatabaseRequestBodyPurpose string

const DeprecatedLinkDatabaseRequestBodyPurposePrimary DeprecatedLinkDatabaseRequestBodyPurpose = "primary"
const DeprecatedLinkDatabaseRequestBodyPurposeCache DeprecatedLinkDatabaseRequestBodyPurpose = "cache"
const DeprecatedLinkDatabaseRequestBodyPurposeCustom DeprecatedLinkDatabaseRequestBodyPurpose = "custom"

func (e DeprecatedLinkDatabaseRequestBodyPurpose) Validate() error {
if e == DeprecatedLinkDatabaseRequestBodyPurposePrimary || e == DeprecatedLinkDatabaseRequestBodyPurposeCache || e == DeprecatedLinkDatabaseRequestBodyPurposeCustom {
return nil
}
return fmt.Errorf("unexpected value for type %T: %s", e, e)
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
. "github.com/onsi/gomega"
)

var _ = Describe("DeprecatedAppLinkDatabaseRequestBody", func() {
var _ = Describe("DeprecatedLinkDatabaseRequestBody", func() {
When("unmarshaling from JSON", func() {
It("should unmarshal", func() {
exampleJSON := []byte("{\"databaseId\":\"7a9d8971-09b0-4c39-8c64-546b6e1875ce\",\"databaseUserIds\":{\"string\":\"string\"},\"purpose\":\"primary\"}")

sut := app.DeprecatedAppLinkDatabaseRequestBody{}
sut := app.DeprecatedLinkDatabaseRequestBody{}
Expect(json.Unmarshal(exampleJSON, &sut)).To(Succeed())
Expect(sut.Validate()).To(Succeed())
})
Expand Down
8 changes: 4 additions & 4 deletions mittwaldv2/generated/clients/customer/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ type Client interface {
ctx context.Context,
req ResendCustomerInviteMailRequest,
) (*http.Response, error)
DeprecatedCustomerLeaveCustomer(
DeprecatedLeaveCustomer(
ctx context.Context,
req DeprecatedCustomerLeaveCustomerRequest,
req DeprecatedLeaveCustomerRequest,
) (*http.Response, error)
}
type clientImpl struct {
Expand Down Expand Up @@ -776,9 +776,9 @@ func (c *clientImpl) ResendCustomerInviteMail(
}

//Leave a Customer.
func (c *clientImpl) DeprecatedCustomerLeaveCustomer(
func (c *clientImpl) DeprecatedLeaveCustomer(
ctx context.Context,
req DeprecatedCustomerLeaveCustomerRequest,
req DeprecatedLeaveCustomerRequest,
) (*http.Response, error) {
httpReq, err := req.BuildRequest()
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import (
"github.com/google/uuid"
)

type DeprecatedCustomerLeaveCustomerRequest struct {
type DeprecatedLeaveCustomerRequest struct {
Body any
CustomerID uuid.UUID
}

func (r *DeprecatedCustomerLeaveCustomerRequest) BuildRequest() (*http.Request, error) {
func (r *DeprecatedLeaveCustomerRequest) BuildRequest() (*http.Request, error) {
body, err := r.body()
if err != nil {
return nil, err
Expand All @@ -28,18 +28,18 @@ func (r *DeprecatedCustomerLeaveCustomerRequest) BuildRequest() (*http.Request,
return http.NewRequest(http.MethodPost, r.url(), body)
}

func (r *DeprecatedCustomerLeaveCustomerRequest) body() (io.Reader, error) {
func (r *DeprecatedLeaveCustomerRequest) body() (io.Reader, error) {
out, err := json.Marshal(&r.Body)
if err != nil {
return nil, fmt.Errorf("error while marshalling JSON: %w", err)
}
return bytes.NewReader(out), nil
}

func (r *DeprecatedCustomerLeaveCustomerRequest) url() string {
func (r *DeprecatedLeaveCustomerRequest) url() string {
return fmt.Sprintf("/v2/customers/%s/actions/leave", url.PathEscape(r.CustomerID.String()))
}

func (r *DeprecatedCustomerLeaveCustomerRequest) query() url.Values {
func (r *DeprecatedLeaveCustomerRequest) query() url.Values {
return nil
}
Loading

0 comments on commit 3879bdc

Please sign in to comment.