From 7cd0505197cd75fe18f0a2bf8e71bce871672dfb Mon Sep 17 00:00:00 2001 From: Murad Biashimov Date: Mon, 6 May 2024 10:38:56 +0200 Subject: [PATCH] refactor: removes v1 from the host setting (#59) --- README.md | 4 +- client.go | 4 +- client_test.go | 2 +- generator/main.go | 15 +- handler/account/account.go | 57 +++---- .../accountauthentication.go | 20 +-- handler/accountteam/accountteam.go | 28 ++-- .../accountteammember/accountteammember.go | 16 +- handler/billinggroup/billinggroup.go | 87 +++++----- handler/clickhouse/clickhouse.go | 16 +- handler/cloud/cloud.go | 8 +- handler/domain/domain.go | 20 +-- handler/flink/flink.go | 4 +- handler/flinkapplication/flinkapplication.go | 20 +-- .../flinkapplicationdeployment.go | 24 +-- .../flinkapplicationversion.go | 16 +- handler/flinkjob/flinkjob.go | 8 +- handler/kafka/kafka.go | 40 ++--- handler/kafkaconnect/kafkaconnect.go | 44 ++--- handler/kafkamirrormaker/kafkamirrormaker.go | 23 +-- .../kafkaschemaregistry.go | 60 +++---- handler/kafkatopic/kafkatopic.go | 36 ++-- handler/mysql/mysql.go | 4 +- handler/opensearch/opensearch.go | 32 ++-- handler/organization/organization.go | 156 ++++------------- handler/organizationuser/organizationuser.go | 48 +++--- handler/postgresql/postgresql.go | 24 +-- handler/privatelink/privatelink.go | 52 +++--- handler/project/project.go | 80 ++++----- handler/projectbilling/projectbilling.go | 40 ++--- handler/service/service.go | 135 ++++++++------- .../serviceintegration/serviceintegration.go | 54 +++--- handler/serviceuser/serviceuser.go | 20 +-- handler/staticip/staticip.go | 28 ++-- handler/user/user.go | 157 ++++++------------ handler/usergroup/usergroup.go | 32 ++-- handler/vpc/vpc.go | 36 ++-- 37 files changed, 675 insertions(+), 775 deletions(-) diff --git a/README.md b/README.md index 88ac515..376a737 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # go-client-codegen -go-client-codegen is an automatically code generated Aiven Go Client. It is generated from the Aiven API specification. +`go-client-codegen` is an automatically code generated Aiven Go Client from the Aiven API specification. + +_Warning:_ this client is under heavy development. ## Setup diff --git a/client.go b/client.go index ff00579..f1fffc6 100644 --- a/client.go +++ b/client.go @@ -52,11 +52,13 @@ func NewClient(opts ...Option) (Client, error) { return nil, errTokenIsRequired } + // Removes trailing / so it is easier later Host + URL + d.Host = strings.TrimSuffix(d.Host, "/") return newClient(d), nil } type aivenClient struct { - Host string `envconfig:"AIVEN_WEB_URL" default:"https://api.aiven.io/v1"` + Host string `envconfig:"AIVEN_WEB_URL" default:"https://api.aiven.io"` UserAgent string `envconfig:"AIVEN_USER_AGENT" default:"aiven-go-client/v3"` Token string `envconfig:"AIVEN_TOKEN"` Debug bool `envconfig:"AIVEN_DEBUG"` diff --git a/client_test.go b/client_test.go index cf477e2..963741b 100644 --- a/client_test.go +++ b/client_test.go @@ -43,7 +43,7 @@ func TestNewClient(t *testing.T) { func TestServiceCreate(t *testing.T) { // Creates a test server server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - require.Equal(t, "/project/foo/service", r.URL.Path) + require.Equal(t, "/v1/project/foo/service", r.URL.Path) // Validates request expectIn := new(service.ServiceCreateIn) diff --git a/generator/main.go b/generator/main.go index 9a685ab..4354ef5 100644 --- a/generator/main.go +++ b/generator/main.go @@ -20,9 +20,9 @@ import ( ) const ( - generatedHeader = "Code generated by Aiven. DO NOT EDIT." - versionIDParam = `/{version_id:latest|\d+}` - configPrefix = "GEN" + generatedHeader = "Code generated by Aiven. DO NOT EDIT." + configPrefix = "GEN" + defaultAPIVersion = "v1" ) type config struct { @@ -34,7 +34,10 @@ type config struct { OpenAPIFile string `envconfig:"OPENAPI_FILE" default:"openapi.json"` } -var pathClean = regexp.MustCompile(`\{[^{]+}`) +var ( + pathClean = regexp.MustCompile(`\{[^{]+}`) + pathVersioning = regexp.MustCompile(`^/v[0-9]/`) +) func main() { err := exec() @@ -84,6 +87,10 @@ func exec() error { continue } + if !pathVersioning.MatchString(path) { + path = fmt.Sprintf("/%s%s", defaultAPIVersion, path) + } + p.Path = path p.Method = strings.ToUpper(meth) p.ID = p.OperationID diff --git a/handler/account/account.go b/handler/account/account.go index 7b906dc..01d5fb0 100644 --- a/handler/account/account.go +++ b/handler/account/account.go @@ -11,72 +11,72 @@ import ( type Handler interface { // AccountAttachPaymentMethod attach payment method for account - // POST /account/{account_id}/payment_methods + // POST /v1/account/{account_id}/payment_methods // https://api.aiven.io/doc/#tag/Account/operation/AccountAttachPaymentMethod AccountAttachPaymentMethod(ctx context.Context, accountId string, in *AccountAttachPaymentMethodIn) (*AccountAttachPaymentMethodOut, error) // AccountBillingGroupList list account billing groups - // GET /account/{account_id}/billing-group + // GET /v1/account/{account_id}/billing-group // https://api.aiven.io/doc/#tag/Account/operation/AccountBillingGroupList AccountBillingGroupList(ctx context.Context, accountId string) ([]AccountBillingGroupOut, error) // AccountCreate create a new account - // POST /account + // POST /v1/account // https://api.aiven.io/doc/#tag/Account/operation/AccountCreate AccountCreate(ctx context.Context, in *AccountCreateIn) (*AccountCreateOut, error) // AccountDelete delete empty account - // DELETE /account/{account_id} + // DELETE /v1/account/{account_id} // https://api.aiven.io/doc/#tag/Account/operation/AccountDelete AccountDelete(ctx context.Context, accountId string) error // AccountEventList list account events - // GET /account/{account_id}/events + // GET /v1/account/{account_id}/events // https://api.aiven.io/doc/#tag/Account/operation/AccountEventList AccountEventList(ctx context.Context, accountId string) ([]EventOut, error) // AccountGet get account details - // GET /account/{account_id} + // GET /v1/account/{account_id} // https://api.aiven.io/doc/#tag/Account/operation/AccountGet AccountGet(ctx context.Context, accountId string) (*AccountGetOut, error) // AccountList list accounts you have access to - // GET /account + // GET /v1/account // https://api.aiven.io/doc/#tag/Account/operation/AccountList AccountList(ctx context.Context) ([]AccountOut, error) // AccountMove move an existing organization unitself - // PUT /account/{account_id}/parent_account + // PUT /v1/account/{account_id}/parent_account // https://api.aiven.io/doc/#tag/Account/operation/AccountMove AccountMove(ctx context.Context, accountId string, in *AccountMoveIn) (*AccountMoveOut, error) // AccountPaymentMethodDelete delete credit card attached to the account as a payment method - // DELETE /account/{account_id}/payment_method/{card_id} + // DELETE /v1/account/{account_id}/payment_method/{card_id} // https://api.aiven.io/doc/#tag/Account/operation/AccountPaymentMethodDelete AccountPaymentMethodDelete(ctx context.Context, accountId string, cardId string) error // AccountPaymentMethodsList list credit cards attached as a payment method to the account - // GET /account/{account_id}/payment_methods + // GET /v1/account/{account_id}/payment_methods // https://api.aiven.io/doc/#tag/Account/operation/AccountPaymentMethodsList AccountPaymentMethodsList(ctx context.Context, accountId string) ([]CardOut, error) // AccountProjectsList list projects belonging to account - // GET /account/{account_id}/projects + // GET /v1/account/{account_id}/projects // https://api.aiven.io/doc/#tag/Account/operation/AccountProjectsList AccountProjectsList(ctx context.Context, accountId string) (*AccountProjectsListOut, error) // AccountUpdate update existing account - // PUT /account/{account_id} + // PUT /v1/account/{account_id} // https://api.aiven.io/doc/#tag/Account/operation/AccountUpdate AccountUpdate(ctx context.Context, accountId string, in *AccountUpdateIn) (*AccountUpdateOut, error) // AccountUserProjectsList list projects associated with this account that user has access to - // GET /account/{account_id}/user/{user_id}/projects + // GET /v1/account/{account_id}/user/{user_id}/projects // https://api.aiven.io/doc/#tag/Account/operation/AccountUserProjectsList AccountUserProjectsList(ctx context.Context, accountId string, userId string) ([]UserProjectOut, error) // AccountUsersSearch list/search users who are members of any team on this account - // POST /account/{account_id}/users/search + // POST /v1/account/{account_id}/users/search // https://api.aiven.io/doc/#tag/Account/operation/AccountUsersSearch AccountUsersSearch(ctx context.Context, accountId string, in *AccountUsersSearchIn) ([]UserOut, error) } @@ -94,7 +94,7 @@ type AccountHandler struct { } func (h *AccountHandler) AccountAttachPaymentMethod(ctx context.Context, accountId string, in *AccountAttachPaymentMethodIn) (*AccountAttachPaymentMethodOut, error) { - path := fmt.Sprintf("/account/%s/payment_methods", accountId) + path := fmt.Sprintf("/v1/account/%s/payment_methods", accountId) b, err := h.doer.Do(ctx, "AccountAttachPaymentMethod", "POST", path, in) if err != nil { return nil, err @@ -107,7 +107,7 @@ func (h *AccountHandler) AccountAttachPaymentMethod(ctx context.Context, account return &out.Card, nil } func (h *AccountHandler) AccountBillingGroupList(ctx context.Context, accountId string) ([]AccountBillingGroupOut, error) { - path := fmt.Sprintf("/account/%s/billing-group", accountId) + path := fmt.Sprintf("/v1/account/%s/billing-group", accountId) b, err := h.doer.Do(ctx, "AccountBillingGroupList", "GET", path, nil) if err != nil { return nil, err @@ -120,7 +120,7 @@ func (h *AccountHandler) AccountBillingGroupList(ctx context.Context, accountId return out.AccountBillingGroups, nil } func (h *AccountHandler) AccountCreate(ctx context.Context, in *AccountCreateIn) (*AccountCreateOut, error) { - path := fmt.Sprintf("/account") + path := fmt.Sprintf("/v1/account") b, err := h.doer.Do(ctx, "AccountCreate", "POST", path, in) if err != nil { return nil, err @@ -133,12 +133,12 @@ func (h *AccountHandler) AccountCreate(ctx context.Context, in *AccountCreateIn) return &out.Account, nil } func (h *AccountHandler) AccountDelete(ctx context.Context, accountId string) error { - path := fmt.Sprintf("/account/%s", accountId) + path := fmt.Sprintf("/v1/account/%s", accountId) _, err := h.doer.Do(ctx, "AccountDelete", "DELETE", path, nil) return err } func (h *AccountHandler) AccountEventList(ctx context.Context, accountId string) ([]EventOut, error) { - path := fmt.Sprintf("/account/%s/events", accountId) + path := fmt.Sprintf("/v1/account/%s/events", accountId) b, err := h.doer.Do(ctx, "AccountEventList", "GET", path, nil) if err != nil { return nil, err @@ -151,7 +151,7 @@ func (h *AccountHandler) AccountEventList(ctx context.Context, accountId string) return out.Events, nil } func (h *AccountHandler) AccountGet(ctx context.Context, accountId string) (*AccountGetOut, error) { - path := fmt.Sprintf("/account/%s", accountId) + path := fmt.Sprintf("/v1/account/%s", accountId) b, err := h.doer.Do(ctx, "AccountGet", "GET", path, nil) if err != nil { return nil, err @@ -164,7 +164,7 @@ func (h *AccountHandler) AccountGet(ctx context.Context, accountId string) (*Acc return &out.Account, nil } func (h *AccountHandler) AccountList(ctx context.Context) ([]AccountOut, error) { - path := fmt.Sprintf("/account") + path := fmt.Sprintf("/v1/account") b, err := h.doer.Do(ctx, "AccountList", "GET", path, nil) if err != nil { return nil, err @@ -177,7 +177,7 @@ func (h *AccountHandler) AccountList(ctx context.Context) ([]AccountOut, error) return out.Accounts, nil } func (h *AccountHandler) AccountMove(ctx context.Context, accountId string, in *AccountMoveIn) (*AccountMoveOut, error) { - path := fmt.Sprintf("/account/%s/parent_account", accountId) + path := fmt.Sprintf("/v1/account/%s/parent_account", accountId) b, err := h.doer.Do(ctx, "AccountMove", "PUT", path, in) if err != nil { return nil, err @@ -190,12 +190,12 @@ func (h *AccountHandler) AccountMove(ctx context.Context, accountId string, in * return &out.Account, nil } func (h *AccountHandler) AccountPaymentMethodDelete(ctx context.Context, accountId string, cardId string) error { - path := fmt.Sprintf("/account/%s/payment_method/%s", accountId, cardId) + path := fmt.Sprintf("/v1/account/%s/payment_method/%s", accountId, cardId) _, err := h.doer.Do(ctx, "AccountPaymentMethodDelete", "DELETE", path, nil) return err } func (h *AccountHandler) AccountPaymentMethodsList(ctx context.Context, accountId string) ([]CardOut, error) { - path := fmt.Sprintf("/account/%s/payment_methods", accountId) + path := fmt.Sprintf("/v1/account/%s/payment_methods", accountId) b, err := h.doer.Do(ctx, "AccountPaymentMethodsList", "GET", path, nil) if err != nil { return nil, err @@ -208,7 +208,7 @@ func (h *AccountHandler) AccountPaymentMethodsList(ctx context.Context, accountI return out.Cards, nil } func (h *AccountHandler) AccountProjectsList(ctx context.Context, accountId string) (*AccountProjectsListOut, error) { - path := fmt.Sprintf("/account/%s/projects", accountId) + path := fmt.Sprintf("/v1/account/%s/projects", accountId) b, err := h.doer.Do(ctx, "AccountProjectsList", "GET", path, nil) if err != nil { return nil, err @@ -221,7 +221,7 @@ func (h *AccountHandler) AccountProjectsList(ctx context.Context, accountId stri return out, nil } func (h *AccountHandler) AccountUpdate(ctx context.Context, accountId string, in *AccountUpdateIn) (*AccountUpdateOut, error) { - path := fmt.Sprintf("/account/%s", accountId) + path := fmt.Sprintf("/v1/account/%s", accountId) b, err := h.doer.Do(ctx, "AccountUpdate", "PUT", path, in) if err != nil { return nil, err @@ -234,7 +234,7 @@ func (h *AccountHandler) AccountUpdate(ctx context.Context, accountId string, in return &out.Account, nil } func (h *AccountHandler) AccountUserProjectsList(ctx context.Context, accountId string, userId string) ([]UserProjectOut, error) { - path := fmt.Sprintf("/account/%s/user/%s/projects", accountId, userId) + path := fmt.Sprintf("/v1/account/%s/user/%s/projects", accountId, userId) b, err := h.doer.Do(ctx, "AccountUserProjectsList", "GET", path, nil) if err != nil { return nil, err @@ -247,7 +247,7 @@ func (h *AccountHandler) AccountUserProjectsList(ctx context.Context, accountId return out.UserProjects, nil } func (h *AccountHandler) AccountUsersSearch(ctx context.Context, accountId string, in *AccountUsersSearchIn) ([]UserOut, error) { - path := fmt.Sprintf("/account/%s/users/search", accountId) + path := fmt.Sprintf("/v1/account/%s/users/search", accountId) b, err := h.doer.Do(ctx, "AccountUsersSearch", "POST", path, in) if err != nil { return nil, err @@ -303,6 +303,7 @@ type AccountBillingGroupOut struct { Company string `json:"company"` Country string `json:"country"` CountryCode string `json:"country_code"` + CreateTime time.Time `json:"create_time"` EstimatedBalanceLocal string `json:"estimated_balance_local"` EstimatedBalanceUsd string `json:"estimated_balance_usd"` PaymentMethod PaymentMethodType `json:"payment_method"` diff --git a/handler/accountauthentication/accountauthentication.go b/handler/accountauthentication/accountauthentication.go index 28c7fd8..c743c9f 100644 --- a/handler/accountauthentication/accountauthentication.go +++ b/handler/accountauthentication/accountauthentication.go @@ -11,27 +11,27 @@ import ( type Handler interface { // AccountAuthenticationMethodCreate create a new authentication method - // POST /account/{account_id}/authentication + // POST /v1/account/{account_id}/authentication // https://api.aiven.io/doc/#tag/Account/operation/AccountAuthenticationMethodCreate AccountAuthenticationMethodCreate(ctx context.Context, accountId string, in *AccountAuthenticationMethodCreateIn) (*AccountAuthenticationMethodCreateOut, error) // AccountAuthenticationMethodDelete delete authentication method - // DELETE /account/{account_id}/authentication/{account_authentication_method_id} + // DELETE /v1/account/{account_id}/authentication/{account_authentication_method_id} // https://api.aiven.io/doc/#tag/Account/operation/AccountAuthenticationMethodDelete AccountAuthenticationMethodDelete(ctx context.Context, accountId string, accountAuthenticationMethodId string) error // AccountAuthenticationMethodGet get details of a single authentication method - // GET /account/{account_id}/authentication/{account_authentication_method_id} + // GET /v1/account/{account_id}/authentication/{account_authentication_method_id} // https://api.aiven.io/doc/#tag/Account/operation/AccountAuthenticationMethodGet AccountAuthenticationMethodGet(ctx context.Context, accountId string, accountAuthenticationMethodId string) (*AccountAuthenticationMethodGetOut, error) // AccountAuthenticationMethodUpdate update authentication method - // PUT /account/{account_id}/authentication/{account_authentication_method_id} + // PUT /v1/account/{account_id}/authentication/{account_authentication_method_id} // https://api.aiven.io/doc/#tag/Account/operation/AccountAuthenticationMethodUpdate AccountAuthenticationMethodUpdate(ctx context.Context, accountId string, accountAuthenticationMethodId string, in *AccountAuthenticationMethodUpdateIn) (*AccountAuthenticationMethodUpdateOut, error) // AccountAuthenticationMethodsList list authentication methods - // GET /account/{account_id}/authentication + // GET /v1/account/{account_id}/authentication // https://api.aiven.io/doc/#tag/Account/operation/AccountAuthenticationMethodsList AccountAuthenticationMethodsList(ctx context.Context, accountId string) ([]AuthenticationMethodOut, error) } @@ -49,7 +49,7 @@ type AccountAuthenticationHandler struct { } func (h *AccountAuthenticationHandler) AccountAuthenticationMethodCreate(ctx context.Context, accountId string, in *AccountAuthenticationMethodCreateIn) (*AccountAuthenticationMethodCreateOut, error) { - path := fmt.Sprintf("/account/%s/authentication", accountId) + path := fmt.Sprintf("/v1/account/%s/authentication", accountId) b, err := h.doer.Do(ctx, "AccountAuthenticationMethodCreate", "POST", path, in) if err != nil { return nil, err @@ -62,12 +62,12 @@ func (h *AccountAuthenticationHandler) AccountAuthenticationMethodCreate(ctx con return &out.AuthenticationMethod, nil } func (h *AccountAuthenticationHandler) AccountAuthenticationMethodDelete(ctx context.Context, accountId string, accountAuthenticationMethodId string) error { - path := fmt.Sprintf("/account/%s/authentication/%s", accountId, accountAuthenticationMethodId) + path := fmt.Sprintf("/v1/account/%s/authentication/%s", accountId, accountAuthenticationMethodId) _, err := h.doer.Do(ctx, "AccountAuthenticationMethodDelete", "DELETE", path, nil) return err } func (h *AccountAuthenticationHandler) AccountAuthenticationMethodGet(ctx context.Context, accountId string, accountAuthenticationMethodId string) (*AccountAuthenticationMethodGetOut, error) { - path := fmt.Sprintf("/account/%s/authentication/%s", accountId, accountAuthenticationMethodId) + path := fmt.Sprintf("/v1/account/%s/authentication/%s", accountId, accountAuthenticationMethodId) b, err := h.doer.Do(ctx, "AccountAuthenticationMethodGet", "GET", path, nil) if err != nil { return nil, err @@ -80,7 +80,7 @@ func (h *AccountAuthenticationHandler) AccountAuthenticationMethodGet(ctx contex return &out.AuthenticationMethod, nil } func (h *AccountAuthenticationHandler) AccountAuthenticationMethodUpdate(ctx context.Context, accountId string, accountAuthenticationMethodId string, in *AccountAuthenticationMethodUpdateIn) (*AccountAuthenticationMethodUpdateOut, error) { - path := fmt.Sprintf("/account/%s/authentication/%s", accountId, accountAuthenticationMethodId) + path := fmt.Sprintf("/v1/account/%s/authentication/%s", accountId, accountAuthenticationMethodId) b, err := h.doer.Do(ctx, "AccountAuthenticationMethodUpdate", "PUT", path, in) if err != nil { return nil, err @@ -93,7 +93,7 @@ func (h *AccountAuthenticationHandler) AccountAuthenticationMethodUpdate(ctx con return &out.AuthenticationMethod, nil } func (h *AccountAuthenticationHandler) AccountAuthenticationMethodsList(ctx context.Context, accountId string) ([]AuthenticationMethodOut, error) { - path := fmt.Sprintf("/account/%s/authentication", accountId) + path := fmt.Sprintf("/v1/account/%s/authentication", accountId) b, err := h.doer.Do(ctx, "AccountAuthenticationMethodsList", "GET", path, nil) if err != nil { return nil, err diff --git a/handler/accountteam/accountteam.go b/handler/accountteam/accountteam.go index 100efa2..d2134e0 100644 --- a/handler/accountteam/accountteam.go +++ b/handler/accountteam/accountteam.go @@ -11,37 +11,37 @@ import ( type Handler interface { // AccountTeamDelete delete a team - // DELETE /account/{account_id}/team/{team_id} + // DELETE /v1/account/{account_id}/team/{team_id} // https://api.aiven.io/doc/#tag/Account/operation/AccountTeamDelete AccountTeamDelete(ctx context.Context, accountId string, teamId string) error // AccountTeamGet get details for a single team - // GET /account/{account_id}/team/{team_id} + // GET /v1/account/{account_id}/team/{team_id} // https://api.aiven.io/doc/#tag/Account/operation/AccountTeamGet AccountTeamGet(ctx context.Context, accountId string, teamId string) (*AccountTeamGetOut, error) // AccountTeamInvitesList list pending invites - // GET /account/{account_id}/team/{team_id}/invites + // GET /v1/account/{account_id}/team/{team_id}/invites // https://api.aiven.io/doc/#tag/Account/operation/AccountTeamInvitesList AccountTeamInvitesList(ctx context.Context, accountId string, teamId string) ([]AccountInviteOut, error) // AccountTeamList list teams belonging to an account - // GET /account/{account_id}/teams + // GET /v1/account/{account_id}/teams // https://api.aiven.io/doc/#tag/Account/operation/AccountTeamList AccountTeamList(ctx context.Context, accountId string) ([]TeamOut, error) // AccountTeamProjectAssociate associate team to a project - // POST /account/{account_id}/team/{team_id}/project/{project} + // POST /v1/account/{account_id}/team/{team_id}/project/{project} // https://api.aiven.io/doc/#tag/Account/operation/AccountTeamProjectAssociate AccountTeamProjectAssociate(ctx context.Context, accountId string, teamId string, project string, in *AccountTeamProjectAssociateIn) error // AccountTeamProjectDisassociate disassociate team from a project - // DELETE /account/{account_id}/team/{team_id}/project/{project} + // DELETE /v1/account/{account_id}/team/{team_id}/project/{project} // https://api.aiven.io/doc/#tag/Account/operation/AccountTeamProjectDisassociate AccountTeamProjectDisassociate(ctx context.Context, accountId string, teamId string, project string) error // AccountTeamUpdate update team details - // PUT /account/{account_id}/team/{team_id} + // PUT /v1/account/{account_id}/team/{team_id} // https://api.aiven.io/doc/#tag/Account/operation/AccountTeamUpdate AccountTeamUpdate(ctx context.Context, accountId string, teamId string, in *AccountTeamUpdateIn) (*AccountTeamUpdateOut, error) } @@ -59,12 +59,12 @@ type AccountTeamHandler struct { } func (h *AccountTeamHandler) AccountTeamDelete(ctx context.Context, accountId string, teamId string) error { - path := fmt.Sprintf("/account/%s/team/%s", accountId, teamId) + path := fmt.Sprintf("/v1/account/%s/team/%s", accountId, teamId) _, err := h.doer.Do(ctx, "AccountTeamDelete", "DELETE", path, nil) return err } func (h *AccountTeamHandler) AccountTeamGet(ctx context.Context, accountId string, teamId string) (*AccountTeamGetOut, error) { - path := fmt.Sprintf("/account/%s/team/%s", accountId, teamId) + path := fmt.Sprintf("/v1/account/%s/team/%s", accountId, teamId) b, err := h.doer.Do(ctx, "AccountTeamGet", "GET", path, nil) if err != nil { return nil, err @@ -77,7 +77,7 @@ func (h *AccountTeamHandler) AccountTeamGet(ctx context.Context, accountId strin return &out.Team, nil } func (h *AccountTeamHandler) AccountTeamInvitesList(ctx context.Context, accountId string, teamId string) ([]AccountInviteOut, error) { - path := fmt.Sprintf("/account/%s/team/%s/invites", accountId, teamId) + path := fmt.Sprintf("/v1/account/%s/team/%s/invites", accountId, teamId) b, err := h.doer.Do(ctx, "AccountTeamInvitesList", "GET", path, nil) if err != nil { return nil, err @@ -90,7 +90,7 @@ func (h *AccountTeamHandler) AccountTeamInvitesList(ctx context.Context, account return out.AccountInvites, nil } func (h *AccountTeamHandler) AccountTeamList(ctx context.Context, accountId string) ([]TeamOut, error) { - path := fmt.Sprintf("/account/%s/teams", accountId) + path := fmt.Sprintf("/v1/account/%s/teams", accountId) b, err := h.doer.Do(ctx, "AccountTeamList", "GET", path, nil) if err != nil { return nil, err @@ -103,17 +103,17 @@ func (h *AccountTeamHandler) AccountTeamList(ctx context.Context, accountId stri return out.Teams, nil } func (h *AccountTeamHandler) AccountTeamProjectAssociate(ctx context.Context, accountId string, teamId string, project string, in *AccountTeamProjectAssociateIn) error { - path := fmt.Sprintf("/account/%s/team/%s/project/%s", accountId, teamId, project) + path := fmt.Sprintf("/v1/account/%s/team/%s/project/%s", accountId, teamId, project) _, err := h.doer.Do(ctx, "AccountTeamProjectAssociate", "POST", path, in) return err } func (h *AccountTeamHandler) AccountTeamProjectDisassociate(ctx context.Context, accountId string, teamId string, project string) error { - path := fmt.Sprintf("/account/%s/team/%s/project/%s", accountId, teamId, project) + path := fmt.Sprintf("/v1/account/%s/team/%s/project/%s", accountId, teamId, project) _, err := h.doer.Do(ctx, "AccountTeamProjectDisassociate", "DELETE", path, nil) return err } func (h *AccountTeamHandler) AccountTeamUpdate(ctx context.Context, accountId string, teamId string, in *AccountTeamUpdateIn) (*AccountTeamUpdateOut, error) { - path := fmt.Sprintf("/account/%s/team/%s", accountId, teamId) + path := fmt.Sprintf("/v1/account/%s/team/%s", accountId, teamId) b, err := h.doer.Do(ctx, "AccountTeamUpdate", "PUT", path, in) if err != nil { return nil, err diff --git a/handler/accountteammember/accountteammember.go b/handler/accountteammember/accountteammember.go index ee8adeb..377558a 100644 --- a/handler/accountteammember/accountteammember.go +++ b/handler/accountteammember/accountteammember.go @@ -11,22 +11,22 @@ import ( type Handler interface { // AccountTeamMemberCancelInvite cancel pending user invite - // DELETE /account/{account_id}/team/{team_id}/invites/{user_email} + // DELETE /v1/account/{account_id}/team/{team_id}/invites/{user_email} // https://api.aiven.io/doc/#tag/Account/operation/AccountTeamMemberCancelInvite AccountTeamMemberCancelInvite(ctx context.Context, accountId string, teamId string, userEmail string) error // AccountTeamMemberVerifyInvite confirm account team invite - // POST /account/{account_id}/invite/{invite_verification_code} + // POST /v1/account/{account_id}/invite/{invite_verification_code} // https://api.aiven.io/doc/#tag/Account/operation/AccountTeamMemberVerifyInvite AccountTeamMemberVerifyInvite(ctx context.Context, accountId string, inviteVerificationCode string) (*AccountTeamMemberVerifyInviteOut, error) // AccountTeamMembersInvite invite a new member to join the team - // POST /account/{account_id}/team/{team_id}/members + // POST /v1/account/{account_id}/team/{team_id}/members // https://api.aiven.io/doc/#tag/Account/operation/AccountTeamMembersInvite AccountTeamMembersInvite(ctx context.Context, accountId string, teamId string, in *AccountTeamMembersInviteIn) error // AccountTeamMembersList list members of a single team - // GET /account/{account_id}/team/{team_id}/members + // GET /v1/account/{account_id}/team/{team_id}/members // https://api.aiven.io/doc/#tag/Account/operation/AccountTeamMembersList AccountTeamMembersList(ctx context.Context, accountId string, teamId string) ([]MemberOut, error) } @@ -44,12 +44,12 @@ type AccountTeamMemberHandler struct { } func (h *AccountTeamMemberHandler) AccountTeamMemberCancelInvite(ctx context.Context, accountId string, teamId string, userEmail string) error { - path := fmt.Sprintf("/account/%s/team/%s/invites/%s", accountId, teamId, userEmail) + path := fmt.Sprintf("/v1/account/%s/team/%s/invites/%s", accountId, teamId, userEmail) _, err := h.doer.Do(ctx, "AccountTeamMemberCancelInvite", "DELETE", path, nil) return err } func (h *AccountTeamMemberHandler) AccountTeamMemberVerifyInvite(ctx context.Context, accountId string, inviteVerificationCode string) (*AccountTeamMemberVerifyInviteOut, error) { - path := fmt.Sprintf("/account/%s/invite/%s", accountId, inviteVerificationCode) + path := fmt.Sprintf("/v1/account/%s/invite/%s", accountId, inviteVerificationCode) b, err := h.doer.Do(ctx, "AccountTeamMemberVerifyInvite", "POST", path, nil) if err != nil { return nil, err @@ -62,12 +62,12 @@ func (h *AccountTeamMemberHandler) AccountTeamMemberVerifyInvite(ctx context.Con return &out.InviteDetails, nil } func (h *AccountTeamMemberHandler) AccountTeamMembersInvite(ctx context.Context, accountId string, teamId string, in *AccountTeamMembersInviteIn) error { - path := fmt.Sprintf("/account/%s/team/%s/members", accountId, teamId) + path := fmt.Sprintf("/v1/account/%s/team/%s/members", accountId, teamId) _, err := h.doer.Do(ctx, "AccountTeamMembersInvite", "POST", path, in) return err } func (h *AccountTeamMemberHandler) AccountTeamMembersList(ctx context.Context, accountId string, teamId string) ([]MemberOut, error) { - path := fmt.Sprintf("/account/%s/team/%s/members", accountId, teamId) + path := fmt.Sprintf("/v1/account/%s/team/%s/members", accountId, teamId) b, err := h.doer.Do(ctx, "AccountTeamMembersList", "GET", path, nil) if err != nil { return nil, err diff --git a/handler/billinggroup/billinggroup.go b/handler/billinggroup/billinggroup.go index 5b9decb..39be11b 100644 --- a/handler/billinggroup/billinggroup.go +++ b/handler/billinggroup/billinggroup.go @@ -11,67 +11,67 @@ import ( type Handler interface { // BillingGroupCreate create a billing group - // POST /billing-group + // POST /v1/billing-group // https://api.aiven.io/doc/#tag/BillingGroup/operation/BillingGroupCreate BillingGroupCreate(ctx context.Context, in *BillingGroupCreateIn) (*BillingGroupCreateOut, error) // BillingGroupCreditsClaim claim a credit code - // POST /billing-group/{billing_group_id}/credits + // POST /v1/billing-group/{billing_group_id}/credits // https://api.aiven.io/doc/#tag/BillingGroup/operation/BillingGroupCreditsClaim BillingGroupCreditsClaim(ctx context.Context, billingGroupId string, in *BillingGroupCreditsClaimIn) (*BillingGroupCreditsClaimOut, error) // BillingGroupCreditsList list billing group credits - // GET /billing-group/{billing_group_id}/credits + // GET /v1/billing-group/{billing_group_id}/credits // https://api.aiven.io/doc/#tag/BillingGroup/operation/BillingGroupCreditsList BillingGroupCreditsList(ctx context.Context, billingGroupId string) ([]CreditOut, error) // BillingGroupDelete delete billing group - // DELETE /billing-group/{billing_group_id} + // DELETE /v1/billing-group/{billing_group_id} // https://api.aiven.io/doc/#tag/BillingGroup/operation/BillingGroupDelete BillingGroupDelete(ctx context.Context, billingGroupId string) error // BillingGroupEventList list billing group events - // GET /billing-group/{billing_group_id}/events + // GET /v1/billing-group/{billing_group_id}/events // https://api.aiven.io/doc/#tag/BillingGroup/operation/BillingGroupEventList BillingGroupEventList(ctx context.Context, billingGroupId string) ([]EventOut, error) // BillingGroupGet get billing group details - // GET /billing-group/{billing_group_id} + // GET /v1/billing-group/{billing_group_id} // https://api.aiven.io/doc/#tag/BillingGroup/operation/BillingGroupGet BillingGroupGet(ctx context.Context, billingGroupId string) (*BillingGroupGetOut, error) // BillingGroupInvoiceLinesList get invoice lines for a single invoice - // GET /billing-group/{billing_group_id}/invoice/{invoice_number}/lines + // GET /v1/billing-group/{billing_group_id}/invoice/{invoice_number}/lines // https://api.aiven.io/doc/#tag/BillingGroup/operation/BillingGroupInvoiceLinesList BillingGroupInvoiceLinesList(ctx context.Context, billingGroupId string, invoiceNumber string) ([]LineOut, error) // BillingGroupInvoiceList get invoices generated for billing group - // GET /billing-group/{billing_group_id}/invoice + // GET /v1/billing-group/{billing_group_id}/invoice // https://api.aiven.io/doc/#tag/BillingGroup/operation/BillingGroupInvoiceList BillingGroupInvoiceList(ctx context.Context, billingGroupId string) ([]InvoiceOut, error) // BillingGroupList list billing groups - // GET /billing-group + // GET /v1/billing-group // https://api.aiven.io/doc/#tag/BillingGroup/operation/BillingGroupList BillingGroupList(ctx context.Context) ([]BillingGroupOut, error) // BillingGroupProjectAssign assign project to billing group - // POST /billing-group/{billing_group_id}/project-assign/{project} + // POST /v1/billing-group/{billing_group_id}/project-assign/{project} // https://api.aiven.io/doc/#tag/BillingGroup/operation/BillingGroupProjectAssign BillingGroupProjectAssign(ctx context.Context, billingGroupId string, project string) error // BillingGroupProjectList get projects assigned to billing group - // GET /billing-group/{billing_group_id}/projects + // GET /v1/billing-group/{billing_group_id}/projects // https://api.aiven.io/doc/#tag/BillingGroup/operation/BillingGroupProjectList BillingGroupProjectList(ctx context.Context, billingGroupId string) ([]ProjectOut, error) // BillingGroupProjectsAssign assign projects to billing group - // POST /billing-group/{billing_group_id}/projects-assign + // POST /v1/billing-group/{billing_group_id}/projects-assign // https://api.aiven.io/doc/#tag/BillingGroup/operation/BillingGroupProjectsAssign BillingGroupProjectsAssign(ctx context.Context, billingGroupId string, in *BillingGroupProjectsAssignIn) error // BillingGroupUpdate update billing group - // PUT /billing-group/{billing_group_id} + // PUT /v1/billing-group/{billing_group_id} // https://api.aiven.io/doc/#tag/BillingGroup/operation/BillingGroupUpdate BillingGroupUpdate(ctx context.Context, billingGroupId string, in *BillingGroupUpdateIn) (*BillingGroupUpdateOut, error) } @@ -89,7 +89,7 @@ type BillingGroupHandler struct { } func (h *BillingGroupHandler) BillingGroupCreate(ctx context.Context, in *BillingGroupCreateIn) (*BillingGroupCreateOut, error) { - path := fmt.Sprintf("/billing-group") + path := fmt.Sprintf("/v1/billing-group") b, err := h.doer.Do(ctx, "BillingGroupCreate", "POST", path, in) if err != nil { return nil, err @@ -102,7 +102,7 @@ func (h *BillingGroupHandler) BillingGroupCreate(ctx context.Context, in *Billin return &out.BillingGroup, nil } func (h *BillingGroupHandler) BillingGroupCreditsClaim(ctx context.Context, billingGroupId string, in *BillingGroupCreditsClaimIn) (*BillingGroupCreditsClaimOut, error) { - path := fmt.Sprintf("/billing-group/%s/credits", billingGroupId) + path := fmt.Sprintf("/v1/billing-group/%s/credits", billingGroupId) b, err := h.doer.Do(ctx, "BillingGroupCreditsClaim", "POST", path, in) if err != nil { return nil, err @@ -115,7 +115,7 @@ func (h *BillingGroupHandler) BillingGroupCreditsClaim(ctx context.Context, bill return &out.Credit, nil } func (h *BillingGroupHandler) BillingGroupCreditsList(ctx context.Context, billingGroupId string) ([]CreditOut, error) { - path := fmt.Sprintf("/billing-group/%s/credits", billingGroupId) + path := fmt.Sprintf("/v1/billing-group/%s/credits", billingGroupId) b, err := h.doer.Do(ctx, "BillingGroupCreditsList", "GET", path, nil) if err != nil { return nil, err @@ -128,12 +128,12 @@ func (h *BillingGroupHandler) BillingGroupCreditsList(ctx context.Context, billi return out.Credits, nil } func (h *BillingGroupHandler) BillingGroupDelete(ctx context.Context, billingGroupId string) error { - path := fmt.Sprintf("/billing-group/%s", billingGroupId) + path := fmt.Sprintf("/v1/billing-group/%s", billingGroupId) _, err := h.doer.Do(ctx, "BillingGroupDelete", "DELETE", path, nil) return err } func (h *BillingGroupHandler) BillingGroupEventList(ctx context.Context, billingGroupId string) ([]EventOut, error) { - path := fmt.Sprintf("/billing-group/%s/events", billingGroupId) + path := fmt.Sprintf("/v1/billing-group/%s/events", billingGroupId) b, err := h.doer.Do(ctx, "BillingGroupEventList", "GET", path, nil) if err != nil { return nil, err @@ -146,7 +146,7 @@ func (h *BillingGroupHandler) BillingGroupEventList(ctx context.Context, billing return out.Events, nil } func (h *BillingGroupHandler) BillingGroupGet(ctx context.Context, billingGroupId string) (*BillingGroupGetOut, error) { - path := fmt.Sprintf("/billing-group/%s", billingGroupId) + path := fmt.Sprintf("/v1/billing-group/%s", billingGroupId) b, err := h.doer.Do(ctx, "BillingGroupGet", "GET", path, nil) if err != nil { return nil, err @@ -159,7 +159,7 @@ func (h *BillingGroupHandler) BillingGroupGet(ctx context.Context, billingGroupI return &out.BillingGroup, nil } func (h *BillingGroupHandler) BillingGroupInvoiceLinesList(ctx context.Context, billingGroupId string, invoiceNumber string) ([]LineOut, error) { - path := fmt.Sprintf("/billing-group/%s/invoice/%s/lines", billingGroupId, invoiceNumber) + path := fmt.Sprintf("/v1/billing-group/%s/invoice/%s/lines", billingGroupId, invoiceNumber) b, err := h.doer.Do(ctx, "BillingGroupInvoiceLinesList", "GET", path, nil) if err != nil { return nil, err @@ -172,7 +172,7 @@ func (h *BillingGroupHandler) BillingGroupInvoiceLinesList(ctx context.Context, return out.Lines, nil } func (h *BillingGroupHandler) BillingGroupInvoiceList(ctx context.Context, billingGroupId string) ([]InvoiceOut, error) { - path := fmt.Sprintf("/billing-group/%s/invoice", billingGroupId) + path := fmt.Sprintf("/v1/billing-group/%s/invoice", billingGroupId) b, err := h.doer.Do(ctx, "BillingGroupInvoiceList", "GET", path, nil) if err != nil { return nil, err @@ -185,7 +185,7 @@ func (h *BillingGroupHandler) BillingGroupInvoiceList(ctx context.Context, billi return out.Invoices, nil } func (h *BillingGroupHandler) BillingGroupList(ctx context.Context) ([]BillingGroupOut, error) { - path := fmt.Sprintf("/billing-group") + path := fmt.Sprintf("/v1/billing-group") b, err := h.doer.Do(ctx, "BillingGroupList", "GET", path, nil) if err != nil { return nil, err @@ -198,12 +198,12 @@ func (h *BillingGroupHandler) BillingGroupList(ctx context.Context) ([]BillingGr return out.BillingGroups, nil } func (h *BillingGroupHandler) BillingGroupProjectAssign(ctx context.Context, billingGroupId string, project string) error { - path := fmt.Sprintf("/billing-group/%s/project-assign/%s", billingGroupId, project) + path := fmt.Sprintf("/v1/billing-group/%s/project-assign/%s", billingGroupId, project) _, err := h.doer.Do(ctx, "BillingGroupProjectAssign", "POST", path, nil) return err } func (h *BillingGroupHandler) BillingGroupProjectList(ctx context.Context, billingGroupId string) ([]ProjectOut, error) { - path := fmt.Sprintf("/billing-group/%s/projects", billingGroupId) + path := fmt.Sprintf("/v1/billing-group/%s/projects", billingGroupId) b, err := h.doer.Do(ctx, "BillingGroupProjectList", "GET", path, nil) if err != nil { return nil, err @@ -216,12 +216,12 @@ func (h *BillingGroupHandler) BillingGroupProjectList(ctx context.Context, billi return out.Projects, nil } func (h *BillingGroupHandler) BillingGroupProjectsAssign(ctx context.Context, billingGroupId string, in *BillingGroupProjectsAssignIn) error { - path := fmt.Sprintf("/billing-group/%s/projects-assign", billingGroupId) + path := fmt.Sprintf("/v1/billing-group/%s/projects-assign", billingGroupId) _, err := h.doer.Do(ctx, "BillingGroupProjectsAssign", "POST", path, in) return err } func (h *BillingGroupHandler) BillingGroupUpdate(ctx context.Context, billingGroupId string, in *BillingGroupUpdateIn) (*BillingGroupUpdateOut, error) { - path := fmt.Sprintf("/billing-group/%s", billingGroupId) + path := fmt.Sprintf("/v1/billing-group/%s", billingGroupId) b, err := h.doer.Do(ctx, "BillingGroupUpdate", "PUT", path, in) if err != nil { return nil, err @@ -292,6 +292,7 @@ type BillingGroupCreateOut struct { Company string `json:"company"` Country string `json:"country"` CountryCode string `json:"country_code"` + CreateTime time.Time `json:"create_time"` EstimatedBalanceLocal string `json:"estimated_balance_local"` EstimatedBalanceUsd string `json:"estimated_balance_usd"` PaymentMethod PaymentMethodType `json:"payment_method"` @@ -325,6 +326,7 @@ type BillingGroupGetOut struct { Company string `json:"company"` Country string `json:"country"` CountryCode string `json:"country_code"` + CreateTime time.Time `json:"create_time"` EstimatedBalanceLocal string `json:"estimated_balance_local"` EstimatedBalanceUsd string `json:"estimated_balance_usd"` PaymentMethod PaymentMethodType `json:"payment_method"` @@ -347,6 +349,7 @@ type BillingGroupOut struct { Company string `json:"company"` Country string `json:"country"` CountryCode string `json:"country_code"` + CreateTime time.Time `json:"create_time"` EstimatedBalanceLocal string `json:"estimated_balance_local"` EstimatedBalanceUsd string `json:"estimated_balance_usd"` PaymentMethod PaymentMethodType `json:"payment_method"` @@ -398,6 +401,7 @@ type BillingGroupUpdateOut struct { Company string `json:"company"` Country string `json:"country"` CountryCode string `json:"country_code"` + CreateTime time.Time `json:"create_time"` EstimatedBalanceLocal string `json:"estimated_balance_local"` EstimatedBalanceUsd string `json:"estimated_balance_usd"` PaymentMethod PaymentMethodType `json:"payment_method"` @@ -494,22 +498,24 @@ type InvoiceOut struct { type InvoiceStateType string const ( - InvoiceStateTypeAccrual InvoiceStateType = "accrual" - InvoiceStateTypeConsolidated InvoiceStateType = "consolidated" - InvoiceStateTypeDue InvoiceStateType = "due" - InvoiceStateTypeEstimate InvoiceStateType = "estimate" - InvoiceStateTypeFailedCreditCardCharge InvoiceStateType = "failed_credit_card_charge" - InvoiceStateTypeFailedNoCreditCard InvoiceStateType = "failed_no_credit_card" - InvoiceStateTypeMailed InvoiceStateType = "mailed" - InvoiceStateTypeNoPaymentExpected InvoiceStateType = "no_payment_expected" - InvoiceStateTypePaid InvoiceStateType = "paid" - InvoiceStateTypePartnerMetering InvoiceStateType = "partner_metering" - InvoiceStateTypeUncollectible InvoiceStateType = "uncollectible" - InvoiceStateTypeWaived InvoiceStateType = "waived" + InvoiceStateTypeAccrual InvoiceStateType = "accrual" + InvoiceStateTypeConsolidated InvoiceStateType = "consolidated" + InvoiceStateTypeDue InvoiceStateType = "due" + InvoiceStateTypeEstimate InvoiceStateType = "estimate" + InvoiceStateTypeFailedCreditCardCharge InvoiceStateType = "failed_credit_card_charge" + InvoiceStateTypeFailedNoCreditCard InvoiceStateType = "failed_no_credit_card" + InvoiceStateTypeMailed InvoiceStateType = "mailed" + InvoiceStateTypeNoPaymentExpected InvoiceStateType = "no_payment_expected" + InvoiceStateTypePaid InvoiceStateType = "paid" + InvoiceStateTypePartnerMetering InvoiceStateType = "partner_metering" + InvoiceStateTypeUncollectible InvoiceStateType = "uncollectible" + InvoiceStateTypeWaived InvoiceStateType = "waived" + InvoiceStateTypeDueOnlyProjectChargesCalculated InvoiceStateType = "due_only_project_charges_calculated" + InvoiceStateTypeEstimateOnlyProjectChargesCalculated InvoiceStateType = "estimate_only_project_charges_calculated" ) func InvoiceStateTypeChoices() []string { - return []string{"accrual", "consolidated", "due", "estimate", "failed_credit_card_charge", "failed_no_credit_card", "mailed", "no_payment_expected", "paid", "partner_metering", "uncollectible", "waived"} + return []string{"accrual", "consolidated", "due", "estimate", "failed_credit_card_charge", "failed_no_credit_card", "mailed", "no_payment_expected", "paid", "partner_metering", "uncollectible", "waived", "due_only_project_charges_calculated", "estimate_only_project_charges_calculated"} } type LineOut struct { @@ -585,6 +591,7 @@ const ( ServiceTypeM3Db ServiceType = "m3db" ServiceTypeMysql ServiceType = "mysql" ServiceTypeOpensearch ServiceType = "opensearch" + ServiceTypeParca ServiceType = "parca" ServiceTypePg ServiceType = "pg" ServiceTypeRedis ServiceType = "redis" ServiceTypeStresstester ServiceType = "stresstester" @@ -599,7 +606,7 @@ const ( ) func ServiceTypeChoices() []string { - return []string{"alertmanager", "cassandra", "clickhouse", "dragonfly", "elasticsearch", "flink", "grafana", "influxdb", "kafka", "kafka_connect", "kafka_mirrormaker", "m3aggregator", "m3db", "mysql", "opensearch", "pg", "redis", "stresstester", "sw", "thanos", "thanoscompactor", "thanosquery", "thanosreceiver", "thanosstore", "vector", "vmalert"} + return []string{"alertmanager", "cassandra", "clickhouse", "dragonfly", "elasticsearch", "flink", "grafana", "influxdb", "kafka", "kafka_connect", "kafka_mirrormaker", "m3aggregator", "m3db", "mysql", "opensearch", "parca", "pg", "redis", "stresstester", "sw", "thanos", "thanoscompactor", "thanosquery", "thanosreceiver", "thanosstore", "vector", "vmalert"} } type billingGroupCreateOut struct { diff --git a/handler/clickhouse/clickhouse.go b/handler/clickhouse/clickhouse.go index 62ffed3..8398908 100644 --- a/handler/clickhouse/clickhouse.go +++ b/handler/clickhouse/clickhouse.go @@ -10,22 +10,22 @@ import ( type Handler interface { // ServiceClickHouseDatabaseCreate create a database - // POST /project/{project}/service/{service_name}/clickhouse/db + // POST /v1/project/{project}/service/{service_name}/clickhouse/db // https://api.aiven.io/doc/#tag/Service:_ClickHouse/operation/ServiceClickHouseDatabaseCreate ServiceClickHouseDatabaseCreate(ctx context.Context, project string, serviceName string, in *ServiceClickHouseDatabaseCreateIn) error // ServiceClickHouseDatabaseDelete delete a database - // DELETE /project/{project}/service/{service_name}/clickhouse/db/{database} + // DELETE /v1/project/{project}/service/{service_name}/clickhouse/db/{database} // https://api.aiven.io/doc/#tag/Service:_ClickHouse/operation/ServiceClickHouseDatabaseDelete ServiceClickHouseDatabaseDelete(ctx context.Context, project string, serviceName string, database string) error // ServiceClickHouseQueryStats return statistics on recent queries - // GET /project/{project}/service/{service_name}/clickhouse/query/stats + // GET /v1/project/{project}/service/{service_name}/clickhouse/query/stats // https://api.aiven.io/doc/#tag/Service:_ClickHouse/operation/ServiceClickHouseQueryStats ServiceClickHouseQueryStats(ctx context.Context, project string, serviceName string) ([]QueryOut, error) // ServiceClickHouseTieredStorageSummary get the ClickHouse tiered storage summary - // GET /project/{project}/service/{service_name}/clickhouse/tiered-storage/summary + // GET /v1/project/{project}/service/{service_name}/clickhouse/tiered-storage/summary // https://api.aiven.io/doc/#tag/Service:_ClickHouse/operation/ServiceClickHouseTieredStorageSummary ServiceClickHouseTieredStorageSummary(ctx context.Context, project string, serviceName string) (*ServiceClickHouseTieredStorageSummaryOut, error) } @@ -43,17 +43,17 @@ type ClickHouseHandler struct { } func (h *ClickHouseHandler) ServiceClickHouseDatabaseCreate(ctx context.Context, project string, serviceName string, in *ServiceClickHouseDatabaseCreateIn) error { - path := fmt.Sprintf("/project/%s/service/%s/clickhouse/db", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/clickhouse/db", project, serviceName) _, err := h.doer.Do(ctx, "ServiceClickHouseDatabaseCreate", "POST", path, in) return err } func (h *ClickHouseHandler) ServiceClickHouseDatabaseDelete(ctx context.Context, project string, serviceName string, database string) error { - path := fmt.Sprintf("/project/%s/service/%s/clickhouse/db/%s", project, serviceName, database) + path := fmt.Sprintf("/v1/project/%s/service/%s/clickhouse/db/%s", project, serviceName, database) _, err := h.doer.Do(ctx, "ServiceClickHouseDatabaseDelete", "DELETE", path, nil) return err } func (h *ClickHouseHandler) ServiceClickHouseQueryStats(ctx context.Context, project string, serviceName string) ([]QueryOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/clickhouse/query/stats", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/clickhouse/query/stats", project, serviceName) b, err := h.doer.Do(ctx, "ServiceClickHouseQueryStats", "GET", path, nil) if err != nil { return nil, err @@ -66,7 +66,7 @@ func (h *ClickHouseHandler) ServiceClickHouseQueryStats(ctx context.Context, pro return out.Queries, nil } func (h *ClickHouseHandler) ServiceClickHouseTieredStorageSummary(ctx context.Context, project string, serviceName string) (*ServiceClickHouseTieredStorageSummaryOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/clickhouse/tiered-storage/summary", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/clickhouse/tiered-storage/summary", project, serviceName) b, err := h.doer.Do(ctx, "ServiceClickHouseTieredStorageSummary", "GET", path, nil) if err != nil { return nil, err diff --git a/handler/cloud/cloud.go b/handler/cloud/cloud.go index ae37b37..3df3c04 100644 --- a/handler/cloud/cloud.go +++ b/handler/cloud/cloud.go @@ -10,12 +10,12 @@ import ( type Handler interface { // ListClouds list cloud platforms - // GET /clouds + // GET /v1/clouds // https://api.aiven.io/doc/#tag/Cloud_platforms/operation/ListClouds ListClouds(ctx context.Context) ([]CloudOut, error) // ListProjectClouds list cloud platforms for a project - // GET /project/{project}/clouds + // GET /v1/project/{project}/clouds // https://api.aiven.io/doc/#tag/Cloud_platforms/operation/ListProjectClouds ListProjectClouds(ctx context.Context, project string) ([]CloudOut, error) } @@ -33,7 +33,7 @@ type CloudHandler struct { } func (h *CloudHandler) ListClouds(ctx context.Context) ([]CloudOut, error) { - path := fmt.Sprintf("/clouds") + path := fmt.Sprintf("/v1/clouds") b, err := h.doer.Do(ctx, "ListClouds", "GET", path, nil) if err != nil { return nil, err @@ -46,7 +46,7 @@ func (h *CloudHandler) ListClouds(ctx context.Context) ([]CloudOut, error) { return out.Clouds, nil } func (h *CloudHandler) ListProjectClouds(ctx context.Context, project string) ([]CloudOut, error) { - path := fmt.Sprintf("/project/%s/clouds", project) + path := fmt.Sprintf("/v1/project/%s/clouds", project) b, err := h.doer.Do(ctx, "ListProjectClouds", "GET", path, nil) if err != nil { return nil, err diff --git a/handler/domain/domain.go b/handler/domain/domain.go index 990652a..6a09e2e 100644 --- a/handler/domain/domain.go +++ b/handler/domain/domain.go @@ -11,27 +11,27 @@ import ( type Handler interface { // OrganizationDomainAdd create a domain - // POST /organization/{organization_id}/domains + // POST /v1/organization/{organization_id}/domains // https://api.aiven.io/doc/#tag/Domains/operation/OrganizationDomainAdd OrganizationDomainAdd(ctx context.Context, organizationId string, in *OrganizationDomainAddIn) (*OrganizationDomainAddOut, error) // OrganizationDomainUpdate update a domain - // PATCH /organization/{organization_id}/domains/{domain_id} + // PATCH /v1/organization/{organization_id}/domains/{domain_id} // https://api.aiven.io/doc/#tag/Domains/operation/OrganizationDomainUpdate OrganizationDomainUpdate(ctx context.Context, organizationId string, domainId string, in *OrganizationDomainUpdateIn) (*OrganizationDomainUpdateOut, error) // OrganizationDomainVerify verify a domain - // POST /organization/{organization_id}/domains/{domain_id}/verify + // POST /v1/organization/{organization_id}/domains/{domain_id}/verify // https://api.aiven.io/doc/#tag/Domains/operation/OrganizationDomainVerify OrganizationDomainVerify(ctx context.Context, organizationId string, domainId string) (*OrganizationDomainVerifyOut, error) // OrganizationDomainsList list domains - // GET /organization/{organization_id}/domains + // GET /v1/organization/{organization_id}/domains // https://api.aiven.io/doc/#tag/Domains/operation/OrganizationDomainsList OrganizationDomainsList(ctx context.Context, organizationId string) ([]DomainOut, error) // OrganizationDomainsRemove delete a domain - // DELETE /organization/{organization_id}/domains/{domain_id} + // DELETE /v1/organization/{organization_id}/domains/{domain_id} // https://api.aiven.io/doc/#tag/Domains/operation/OrganizationDomainsRemove OrganizationDomainsRemove(ctx context.Context, organizationId string, domainId string) error } @@ -49,7 +49,7 @@ type DomainHandler struct { } func (h *DomainHandler) OrganizationDomainAdd(ctx context.Context, organizationId string, in *OrganizationDomainAddIn) (*OrganizationDomainAddOut, error) { - path := fmt.Sprintf("/organization/%s/domains", organizationId) + path := fmt.Sprintf("/v1/organization/%s/domains", organizationId) b, err := h.doer.Do(ctx, "OrganizationDomainAdd", "POST", path, in) if err != nil { return nil, err @@ -62,7 +62,7 @@ func (h *DomainHandler) OrganizationDomainAdd(ctx context.Context, organizationI return out, nil } func (h *DomainHandler) OrganizationDomainUpdate(ctx context.Context, organizationId string, domainId string, in *OrganizationDomainUpdateIn) (*OrganizationDomainUpdateOut, error) { - path := fmt.Sprintf("/organization/%s/domains/%s", organizationId, domainId) + path := fmt.Sprintf("/v1/organization/%s/domains/%s", organizationId, domainId) b, err := h.doer.Do(ctx, "OrganizationDomainUpdate", "PATCH", path, in) if err != nil { return nil, err @@ -75,7 +75,7 @@ func (h *DomainHandler) OrganizationDomainUpdate(ctx context.Context, organizati return out, nil } func (h *DomainHandler) OrganizationDomainVerify(ctx context.Context, organizationId string, domainId string) (*OrganizationDomainVerifyOut, error) { - path := fmt.Sprintf("/organization/%s/domains/%s/verify", organizationId, domainId) + path := fmt.Sprintf("/v1/organization/%s/domains/%s/verify", organizationId, domainId) b, err := h.doer.Do(ctx, "OrganizationDomainVerify", "POST", path, nil) if err != nil { return nil, err @@ -88,7 +88,7 @@ func (h *DomainHandler) OrganizationDomainVerify(ctx context.Context, organizati return out, nil } func (h *DomainHandler) OrganizationDomainsList(ctx context.Context, organizationId string) ([]DomainOut, error) { - path := fmt.Sprintf("/organization/%s/domains", organizationId) + path := fmt.Sprintf("/v1/organization/%s/domains", organizationId) b, err := h.doer.Do(ctx, "OrganizationDomainsList", "GET", path, nil) if err != nil { return nil, err @@ -101,7 +101,7 @@ func (h *DomainHandler) OrganizationDomainsList(ctx context.Context, organizatio return out.Domains, nil } func (h *DomainHandler) OrganizationDomainsRemove(ctx context.Context, organizationId string, domainId string) error { - path := fmt.Sprintf("/organization/%s/domains/%s", organizationId, domainId) + path := fmt.Sprintf("/v1/organization/%s/domains/%s", organizationId, domainId) _, err := h.doer.Do(ctx, "OrganizationDomainsRemove", "DELETE", path, nil) return err } diff --git a/handler/flink/flink.go b/handler/flink/flink.go index 5055ef2..6cf8d9c 100644 --- a/handler/flink/flink.go +++ b/handler/flink/flink.go @@ -10,7 +10,7 @@ import ( type Handler interface { // ServiceFlinkOverview get a cluster overview - // GET /project/{project}/service/{service_name}/flink/overview + // GET /v1/project/{project}/service/{service_name}/flink/overview // https://api.aiven.io/doc/#tag/Service:_Flink/operation/ServiceFlinkOverview ServiceFlinkOverview(ctx context.Context, project string, serviceName string) (*ServiceFlinkOverviewOut, error) } @@ -28,7 +28,7 @@ type FlinkHandler struct { } func (h *FlinkHandler) ServiceFlinkOverview(ctx context.Context, project string, serviceName string) (*ServiceFlinkOverviewOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/flink/overview", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/flink/overview", project, serviceName) b, err := h.doer.Do(ctx, "ServiceFlinkOverview", "GET", path, nil) if err != nil { return nil, err diff --git a/handler/flinkapplication/flinkapplication.go b/handler/flinkapplication/flinkapplication.go index 058c523..2714cb4 100644 --- a/handler/flinkapplication/flinkapplication.go +++ b/handler/flinkapplication/flinkapplication.go @@ -11,27 +11,27 @@ import ( type Handler interface { // ServiceFlinkCreateApplication create a Flink Application - // POST /project/{project}/service/{service_name}/flink/application + // POST /v1/project/{project}/service/{service_name}/flink/application // https://api.aiven.io/doc/#tag/Service:_Flink/operation/ServiceFlinkCreateApplication ServiceFlinkCreateApplication(ctx context.Context, project string, serviceName string, in *ServiceFlinkCreateApplicationIn) (*ServiceFlinkCreateApplicationOut, error) // ServiceFlinkDeleteApplication delete a Flink Application - // DELETE /project/{project}/service/{service_name}/flink/application/{application_id} + // DELETE /v1/project/{project}/service/{service_name}/flink/application/{application_id} // https://api.aiven.io/doc/#tag/Service:_Flink/operation/ServiceFlinkDeleteApplication ServiceFlinkDeleteApplication(ctx context.Context, project string, serviceName string, applicationId string) (*ServiceFlinkDeleteApplicationOut, error) // ServiceFlinkGetApplication get a Flink Application - // GET /project/{project}/service/{service_name}/flink/application/{application_id} + // GET /v1/project/{project}/service/{service_name}/flink/application/{application_id} // https://api.aiven.io/doc/#tag/Service:_Flink/operation/ServiceFlinkGetApplication ServiceFlinkGetApplication(ctx context.Context, project string, serviceName string, applicationId string) (*ServiceFlinkGetApplicationOut, error) // ServiceFlinkListApplications get all Flink Applications - // GET /project/{project}/service/{service_name}/flink/application + // GET /v1/project/{project}/service/{service_name}/flink/application // https://api.aiven.io/doc/#tag/Service:_Flink/operation/ServiceFlinkListApplications ServiceFlinkListApplications(ctx context.Context, project string, serviceName string) ([]ApplicationOut, error) // ServiceFlinkUpdateApplication update a Flink Application - // PUT /project/{project}/service/{service_name}/flink/application/{application_id} + // PUT /v1/project/{project}/service/{service_name}/flink/application/{application_id} // https://api.aiven.io/doc/#tag/Service:_Flink/operation/ServiceFlinkUpdateApplication ServiceFlinkUpdateApplication(ctx context.Context, project string, serviceName string, applicationId string, in *ServiceFlinkUpdateApplicationIn) (*ServiceFlinkUpdateApplicationOut, error) } @@ -49,7 +49,7 @@ type FlinkApplicationHandler struct { } func (h *FlinkApplicationHandler) ServiceFlinkCreateApplication(ctx context.Context, project string, serviceName string, in *ServiceFlinkCreateApplicationIn) (*ServiceFlinkCreateApplicationOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/flink/application", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/flink/application", project, serviceName) b, err := h.doer.Do(ctx, "ServiceFlinkCreateApplication", "POST", path, in) if err != nil { return nil, err @@ -62,7 +62,7 @@ func (h *FlinkApplicationHandler) ServiceFlinkCreateApplication(ctx context.Cont return out, nil } func (h *FlinkApplicationHandler) ServiceFlinkDeleteApplication(ctx context.Context, project string, serviceName string, applicationId string) (*ServiceFlinkDeleteApplicationOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/flink/application/%s", project, serviceName, applicationId) + path := fmt.Sprintf("/v1/project/%s/service/%s/flink/application/%s", project, serviceName, applicationId) b, err := h.doer.Do(ctx, "ServiceFlinkDeleteApplication", "DELETE", path, nil) if err != nil { return nil, err @@ -75,7 +75,7 @@ func (h *FlinkApplicationHandler) ServiceFlinkDeleteApplication(ctx context.Cont return out, nil } func (h *FlinkApplicationHandler) ServiceFlinkGetApplication(ctx context.Context, project string, serviceName string, applicationId string) (*ServiceFlinkGetApplicationOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/flink/application/%s", project, serviceName, applicationId) + path := fmt.Sprintf("/v1/project/%s/service/%s/flink/application/%s", project, serviceName, applicationId) b, err := h.doer.Do(ctx, "ServiceFlinkGetApplication", "GET", path, nil) if err != nil { return nil, err @@ -88,7 +88,7 @@ func (h *FlinkApplicationHandler) ServiceFlinkGetApplication(ctx context.Context return out, nil } func (h *FlinkApplicationHandler) ServiceFlinkListApplications(ctx context.Context, project string, serviceName string) ([]ApplicationOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/flink/application", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/flink/application", project, serviceName) b, err := h.doer.Do(ctx, "ServiceFlinkListApplications", "GET", path, nil) if err != nil { return nil, err @@ -101,7 +101,7 @@ func (h *FlinkApplicationHandler) ServiceFlinkListApplications(ctx context.Conte return out.Applications, nil } func (h *FlinkApplicationHandler) ServiceFlinkUpdateApplication(ctx context.Context, project string, serviceName string, applicationId string, in *ServiceFlinkUpdateApplicationIn) (*ServiceFlinkUpdateApplicationOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/flink/application/%s", project, serviceName, applicationId) + path := fmt.Sprintf("/v1/project/%s/service/%s/flink/application/%s", project, serviceName, applicationId) b, err := h.doer.Do(ctx, "ServiceFlinkUpdateApplication", "PUT", path, in) if err != nil { return nil, err diff --git a/handler/flinkapplicationdeployment/flinkapplicationdeployment.go b/handler/flinkapplicationdeployment/flinkapplicationdeployment.go index 1e45ad5..209e2b8 100644 --- a/handler/flinkapplicationdeployment/flinkapplicationdeployment.go +++ b/handler/flinkapplicationdeployment/flinkapplicationdeployment.go @@ -11,32 +11,32 @@ import ( type Handler interface { // ServiceFlinkCancelApplicationDeployment cancel an ApplicationDeployment - // POST /project/{project}/service/{service_name}/flink/application/{application_id}/deployment/{deployment_id}/cancel + // POST /v1/project/{project}/service/{service_name}/flink/application/{application_id}/deployment/{deployment_id}/cancel // https://api.aiven.io/doc/#tag/Service:_Flink/operation/ServiceFlinkCancelApplicationDeployment ServiceFlinkCancelApplicationDeployment(ctx context.Context, project string, serviceName string, applicationId string, deploymentId string) (*ServiceFlinkCancelApplicationDeploymentOut, error) // ServiceFlinkCreateApplicationDeployment create an ApplicationDeployment - // POST /project/{project}/service/{service_name}/flink/application/{application_id}/deployment + // POST /v1/project/{project}/service/{service_name}/flink/application/{application_id}/deployment // https://api.aiven.io/doc/#tag/Service:_Flink/operation/ServiceFlinkCreateApplicationDeployment ServiceFlinkCreateApplicationDeployment(ctx context.Context, project string, serviceName string, applicationId string, in *ServiceFlinkCreateApplicationDeploymentIn) (*ServiceFlinkCreateApplicationDeploymentOut, error) // ServiceFlinkDeleteApplicationDeployment delete an ApplicationDeployment - // DELETE /project/{project}/service/{service_name}/flink/application/{application_id}/deployment/{deployment_id} + // DELETE /v1/project/{project}/service/{service_name}/flink/application/{application_id}/deployment/{deployment_id} // https://api.aiven.io/doc/#tag/Service:_Flink/operation/ServiceFlinkDeleteApplicationDeployment ServiceFlinkDeleteApplicationDeployment(ctx context.Context, project string, serviceName string, applicationId string, deploymentId string) (*ServiceFlinkDeleteApplicationDeploymentOut, error) // ServiceFlinkGetApplicationDeployment get an ApplicationDeployment - // GET /project/{project}/service/{service_name}/flink/application/{application_id}/deployment/{deployment_id} + // GET /v1/project/{project}/service/{service_name}/flink/application/{application_id}/deployment/{deployment_id} // https://api.aiven.io/doc/#tag/Service:_Flink/operation/ServiceFlinkGetApplicationDeployment ServiceFlinkGetApplicationDeployment(ctx context.Context, project string, serviceName string, applicationId string, deploymentId string) (*ServiceFlinkGetApplicationDeploymentOut, error) // ServiceFlinkListApplicationDeployments get all ApplicationDeployments - // GET /project/{project}/service/{service_name}/flink/application/{application_id}/deployment + // GET /v1/project/{project}/service/{service_name}/flink/application/{application_id}/deployment // https://api.aiven.io/doc/#tag/Service:_Flink/operation/ServiceFlinkListApplicationDeployments ServiceFlinkListApplicationDeployments(ctx context.Context, project string, serviceName string, applicationId string) ([]DeploymentOut, error) // ServiceFlinkStopApplicationDeployment stop an ApplicationDeployment - // POST /project/{project}/service/{service_name}/flink/application/{application_id}/deployment/{deployment_id}/stop + // POST /v1/project/{project}/service/{service_name}/flink/application/{application_id}/deployment/{deployment_id}/stop // https://api.aiven.io/doc/#tag/Service:_Flink/operation/ServiceFlinkStopApplicationDeployment ServiceFlinkStopApplicationDeployment(ctx context.Context, project string, serviceName string, applicationId string, deploymentId string) (*ServiceFlinkStopApplicationDeploymentOut, error) } @@ -54,7 +54,7 @@ type FlinkApplicationDeploymentHandler struct { } func (h *FlinkApplicationDeploymentHandler) ServiceFlinkCancelApplicationDeployment(ctx context.Context, project string, serviceName string, applicationId string, deploymentId string) (*ServiceFlinkCancelApplicationDeploymentOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/flink/application/%s/deployment/%s/cancel", project, serviceName, applicationId, deploymentId) + path := fmt.Sprintf("/v1/project/%s/service/%s/flink/application/%s/deployment/%s/cancel", project, serviceName, applicationId, deploymentId) b, err := h.doer.Do(ctx, "ServiceFlinkCancelApplicationDeployment", "POST", path, nil) if err != nil { return nil, err @@ -67,7 +67,7 @@ func (h *FlinkApplicationDeploymentHandler) ServiceFlinkCancelApplicationDeploym return out, nil } func (h *FlinkApplicationDeploymentHandler) ServiceFlinkCreateApplicationDeployment(ctx context.Context, project string, serviceName string, applicationId string, in *ServiceFlinkCreateApplicationDeploymentIn) (*ServiceFlinkCreateApplicationDeploymentOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/flink/application/%s/deployment", project, serviceName, applicationId) + path := fmt.Sprintf("/v1/project/%s/service/%s/flink/application/%s/deployment", project, serviceName, applicationId) b, err := h.doer.Do(ctx, "ServiceFlinkCreateApplicationDeployment", "POST", path, in) if err != nil { return nil, err @@ -80,7 +80,7 @@ func (h *FlinkApplicationDeploymentHandler) ServiceFlinkCreateApplicationDeploym return out, nil } func (h *FlinkApplicationDeploymentHandler) ServiceFlinkDeleteApplicationDeployment(ctx context.Context, project string, serviceName string, applicationId string, deploymentId string) (*ServiceFlinkDeleteApplicationDeploymentOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/flink/application/%s/deployment/%s", project, serviceName, applicationId, deploymentId) + path := fmt.Sprintf("/v1/project/%s/service/%s/flink/application/%s/deployment/%s", project, serviceName, applicationId, deploymentId) b, err := h.doer.Do(ctx, "ServiceFlinkDeleteApplicationDeployment", "DELETE", path, nil) if err != nil { return nil, err @@ -93,7 +93,7 @@ func (h *FlinkApplicationDeploymentHandler) ServiceFlinkDeleteApplicationDeploym return out, nil } func (h *FlinkApplicationDeploymentHandler) ServiceFlinkGetApplicationDeployment(ctx context.Context, project string, serviceName string, applicationId string, deploymentId string) (*ServiceFlinkGetApplicationDeploymentOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/flink/application/%s/deployment/%s", project, serviceName, applicationId, deploymentId) + path := fmt.Sprintf("/v1/project/%s/service/%s/flink/application/%s/deployment/%s", project, serviceName, applicationId, deploymentId) b, err := h.doer.Do(ctx, "ServiceFlinkGetApplicationDeployment", "GET", path, nil) if err != nil { return nil, err @@ -106,7 +106,7 @@ func (h *FlinkApplicationDeploymentHandler) ServiceFlinkGetApplicationDeployment return out, nil } func (h *FlinkApplicationDeploymentHandler) ServiceFlinkListApplicationDeployments(ctx context.Context, project string, serviceName string, applicationId string) ([]DeploymentOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/flink/application/%s/deployment", project, serviceName, applicationId) + path := fmt.Sprintf("/v1/project/%s/service/%s/flink/application/%s/deployment", project, serviceName, applicationId) b, err := h.doer.Do(ctx, "ServiceFlinkListApplicationDeployments", "GET", path, nil) if err != nil { return nil, err @@ -119,7 +119,7 @@ func (h *FlinkApplicationDeploymentHandler) ServiceFlinkListApplicationDeploymen return out.Deployments, nil } func (h *FlinkApplicationDeploymentHandler) ServiceFlinkStopApplicationDeployment(ctx context.Context, project string, serviceName string, applicationId string, deploymentId string) (*ServiceFlinkStopApplicationDeploymentOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/flink/application/%s/deployment/%s/stop", project, serviceName, applicationId, deploymentId) + path := fmt.Sprintf("/v1/project/%s/service/%s/flink/application/%s/deployment/%s/stop", project, serviceName, applicationId, deploymentId) b, err := h.doer.Do(ctx, "ServiceFlinkStopApplicationDeployment", "POST", path, nil) if err != nil { return nil, err diff --git a/handler/flinkapplicationversion/flinkapplicationversion.go b/handler/flinkapplicationversion/flinkapplicationversion.go index f4a52dc..74ac818 100644 --- a/handler/flinkapplicationversion/flinkapplicationversion.go +++ b/handler/flinkapplicationversion/flinkapplicationversion.go @@ -11,22 +11,22 @@ import ( type Handler interface { // ServiceFlinkCreateApplicationVersion create a Flink ApplicationVersion - // POST /project/{project}/service/{service_name}/flink/application/{application_id}/version + // POST /v1/project/{project}/service/{service_name}/flink/application/{application_id}/version // https://api.aiven.io/doc/#tag/Service:_Flink/operation/ServiceFlinkCreateApplicationVersion ServiceFlinkCreateApplicationVersion(ctx context.Context, project string, serviceName string, applicationId string, in *ServiceFlinkCreateApplicationVersionIn) (*ServiceFlinkCreateApplicationVersionOut, error) // ServiceFlinkDeleteApplicationVersion delete a Flink ApplicationVersion - // DELETE /project/{project}/service/{service_name}/flink/application/{application_id}/version/{application_version_id} + // DELETE /v1/project/{project}/service/{service_name}/flink/application/{application_id}/version/{application_version_id} // https://api.aiven.io/doc/#tag/Service:_Flink/operation/ServiceFlinkDeleteApplicationVersion ServiceFlinkDeleteApplicationVersion(ctx context.Context, project string, serviceName string, applicationId string, applicationVersionId string) (*ServiceFlinkDeleteApplicationVersionOut, error) // ServiceFlinkGetApplicationVersion get a Flink ApplicationVersion - // GET /project/{project}/service/{service_name}/flink/application/{application_id}/version/{application_version_id} + // GET /v1/project/{project}/service/{service_name}/flink/application/{application_id}/version/{application_version_id} // https://api.aiven.io/doc/#tag/Service:_Flink/operation/ServiceFlinkGetApplicationVersion ServiceFlinkGetApplicationVersion(ctx context.Context, project string, serviceName string, applicationId string, applicationVersionId string) (*ServiceFlinkGetApplicationVersionOut, error) // ServiceFlinkValidateApplicationVersion validate a Flink ApplicationVersion - // POST /project/{project}/service/{service_name}/flink/application/{application_id}/version/validate + // POST /v1/project/{project}/service/{service_name}/flink/application/{application_id}/version/validate // https://api.aiven.io/doc/#tag/Service:_Flink/operation/ServiceFlinkValidateApplicationVersion ServiceFlinkValidateApplicationVersion(ctx context.Context, project string, serviceName string, applicationId string, in *ServiceFlinkValidateApplicationVersionIn) (*ServiceFlinkValidateApplicationVersionOut, error) } @@ -44,7 +44,7 @@ type FlinkApplicationVersionHandler struct { } func (h *FlinkApplicationVersionHandler) ServiceFlinkCreateApplicationVersion(ctx context.Context, project string, serviceName string, applicationId string, in *ServiceFlinkCreateApplicationVersionIn) (*ServiceFlinkCreateApplicationVersionOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/flink/application/%s/version", project, serviceName, applicationId) + path := fmt.Sprintf("/v1/project/%s/service/%s/flink/application/%s/version", project, serviceName, applicationId) b, err := h.doer.Do(ctx, "ServiceFlinkCreateApplicationVersion", "POST", path, in) if err != nil { return nil, err @@ -57,7 +57,7 @@ func (h *FlinkApplicationVersionHandler) ServiceFlinkCreateApplicationVersion(ct return out, nil } func (h *FlinkApplicationVersionHandler) ServiceFlinkDeleteApplicationVersion(ctx context.Context, project string, serviceName string, applicationId string, applicationVersionId string) (*ServiceFlinkDeleteApplicationVersionOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/flink/application/%s/version/%s", project, serviceName, applicationId, applicationVersionId) + path := fmt.Sprintf("/v1/project/%s/service/%s/flink/application/%s/version/%s", project, serviceName, applicationId, applicationVersionId) b, err := h.doer.Do(ctx, "ServiceFlinkDeleteApplicationVersion", "DELETE", path, nil) if err != nil { return nil, err @@ -70,7 +70,7 @@ func (h *FlinkApplicationVersionHandler) ServiceFlinkDeleteApplicationVersion(ct return out, nil } func (h *FlinkApplicationVersionHandler) ServiceFlinkGetApplicationVersion(ctx context.Context, project string, serviceName string, applicationId string, applicationVersionId string) (*ServiceFlinkGetApplicationVersionOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/flink/application/%s/version/%s", project, serviceName, applicationId, applicationVersionId) + path := fmt.Sprintf("/v1/project/%s/service/%s/flink/application/%s/version/%s", project, serviceName, applicationId, applicationVersionId) b, err := h.doer.Do(ctx, "ServiceFlinkGetApplicationVersion", "GET", path, nil) if err != nil { return nil, err @@ -83,7 +83,7 @@ func (h *FlinkApplicationVersionHandler) ServiceFlinkGetApplicationVersion(ctx c return out, nil } func (h *FlinkApplicationVersionHandler) ServiceFlinkValidateApplicationVersion(ctx context.Context, project string, serviceName string, applicationId string, in *ServiceFlinkValidateApplicationVersionIn) (*ServiceFlinkValidateApplicationVersionOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/flink/application/%s/version/validate", project, serviceName, applicationId) + path := fmt.Sprintf("/v1/project/%s/service/%s/flink/application/%s/version/validate", project, serviceName, applicationId) b, err := h.doer.Do(ctx, "ServiceFlinkValidateApplicationVersion", "POST", path, in) if err != nil { return nil, err diff --git a/handler/flinkjob/flinkjob.go b/handler/flinkjob/flinkjob.go index faa9a8e..cc10a1d 100644 --- a/handler/flinkjob/flinkjob.go +++ b/handler/flinkjob/flinkjob.go @@ -10,12 +10,12 @@ import ( type Handler interface { // ServiceFlinkJobDetails get a Flink job info - // GET /project/{project}/service/{service_name}/flink/job/{job_id} + // GET /v1/project/{project}/service/{service_name}/flink/job/{job_id} // https://api.aiven.io/doc/#tag/Service:_Flink/operation/ServiceFlinkJobDetails ServiceFlinkJobDetails(ctx context.Context, project string, serviceName string, jobId string) (*ServiceFlinkJobDetailsOut, error) // ServiceFlinkJobsList get all Flink jobs - // GET /project/{project}/service/{service_name}/flink/job + // GET /v1/project/{project}/service/{service_name}/flink/job // https://api.aiven.io/doc/#tag/Service:_Flink/operation/ServiceFlinkJobsList ServiceFlinkJobsList(ctx context.Context, project string, serviceName string) ([]JobOut, error) } @@ -33,7 +33,7 @@ type FlinkJobHandler struct { } func (h *FlinkJobHandler) ServiceFlinkJobDetails(ctx context.Context, project string, serviceName string, jobId string) (*ServiceFlinkJobDetailsOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/flink/job/%s", project, serviceName, jobId) + path := fmt.Sprintf("/v1/project/%s/service/%s/flink/job/%s", project, serviceName, jobId) b, err := h.doer.Do(ctx, "ServiceFlinkJobDetails", "GET", path, nil) if err != nil { return nil, err @@ -46,7 +46,7 @@ func (h *FlinkJobHandler) ServiceFlinkJobDetails(ctx context.Context, project st return out, nil } func (h *FlinkJobHandler) ServiceFlinkJobsList(ctx context.Context, project string, serviceName string) ([]JobOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/flink/job", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/flink/job", project, serviceName) b, err := h.doer.Do(ctx, "ServiceFlinkJobsList", "GET", path, nil) if err != nil { return nil, err diff --git a/handler/kafka/kafka.go b/handler/kafka/kafka.go index 7195b1c..f21d739 100644 --- a/handler/kafka/kafka.go +++ b/handler/kafka/kafka.go @@ -10,52 +10,52 @@ import ( type Handler interface { // ServiceKafkaAclAdd add a Kafka ACL entry - // POST /project/{project}/service/{service_name}/acl + // POST /v1/project/{project}/service/{service_name}/acl // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaAclAdd ServiceKafkaAclAdd(ctx context.Context, project string, serviceName string, in *ServiceKafkaAclAddIn) ([]AclOut, error) // ServiceKafkaAclDelete delete a Kafka ACL entry - // DELETE /project/{project}/service/{service_name}/acl/{kafka_acl_id} + // DELETE /v1/project/{project}/service/{service_name}/acl/{kafka_acl_id} // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaAclDelete ServiceKafkaAclDelete(ctx context.Context, project string, serviceName string, kafkaAclId string) ([]AclOut, error) // ServiceKafkaAclList list Kafka ACL entries - // GET /project/{project}/service/{service_name}/acl + // GET /v1/project/{project}/service/{service_name}/acl // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaAclList ServiceKafkaAclList(ctx context.Context, project string, serviceName string) ([]AclOut, error) // ServiceKafkaQuotaCreate create Kafka quota - // POST /project/{project}/service/{service_name}/quota + // POST /v1/project/{project}/service/{service_name}/quota // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaQuotaCreate ServiceKafkaQuotaCreate(ctx context.Context, project string, serviceName string, in *ServiceKafkaQuotaCreateIn) error // ServiceKafkaQuotaDelete delete Kafka quota - // DELETE /project/{project}/service/{service_name}/quota + // DELETE /v1/project/{project}/service/{service_name}/quota // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaQuotaDelete ServiceKafkaQuotaDelete(ctx context.Context, project string, serviceName string) error // ServiceKafkaQuotaDescribe describe Specific Kafka quotas - // GET /project/{project}/service/{service_name}/quota/describe + // GET /v1/project/{project}/service/{service_name}/quota/describe // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaQuotaDescribe ServiceKafkaQuotaDescribe(ctx context.Context, project string, serviceName string) (*ServiceKafkaQuotaDescribeOut, error) // ServiceKafkaQuotaList list Kafka quotas - // GET /project/{project}/service/{service_name}/quota + // GET /v1/project/{project}/service/{service_name}/quota // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaQuotaList ServiceKafkaQuotaList(ctx context.Context, project string, serviceName string) ([]QuotaOut, error) // ServiceKafkaTieredStorageStorageUsageByTopic get the Kafka tiered storage object storage usage by topic - // GET /project/{project}/service/{service_name}/kafka/tiered-storage/storage-usage/by-topic + // GET /v1/project/{project}/service/{service_name}/kafka/tiered-storage/storage-usage/by-topic // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaTieredStorageStorageUsageByTopic ServiceKafkaTieredStorageStorageUsageByTopic(ctx context.Context, project string, serviceName string) (map[string]any, error) // ServiceKafkaTieredStorageStorageUsageTotal get the Kafka tiered storage total object storage usage - // GET /project/{project}/service/{service_name}/kafka/tiered-storage/storage-usage/total + // GET /v1/project/{project}/service/{service_name}/kafka/tiered-storage/storage-usage/total // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaTieredStorageStorageUsageTotal ServiceKafkaTieredStorageStorageUsageTotal(ctx context.Context, project string, serviceName string) (int, error) // ServiceKafkaTieredStorageSummary get the Kafka tiered storage summary - // GET /project/{project}/service/{service_name}/kafka/tiered-storage/summary + // GET /v1/project/{project}/service/{service_name}/kafka/tiered-storage/summary // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaTieredStorageSummary ServiceKafkaTieredStorageSummary(ctx context.Context, project string, serviceName string) (*ServiceKafkaTieredStorageSummaryOut, error) } @@ -73,7 +73,7 @@ type KafkaHandler struct { } func (h *KafkaHandler) ServiceKafkaAclAdd(ctx context.Context, project string, serviceName string, in *ServiceKafkaAclAddIn) ([]AclOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/acl", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/acl", project, serviceName) b, err := h.doer.Do(ctx, "ServiceKafkaAclAdd", "POST", path, in) if err != nil { return nil, err @@ -86,7 +86,7 @@ func (h *KafkaHandler) ServiceKafkaAclAdd(ctx context.Context, project string, s return out.Acl, nil } func (h *KafkaHandler) ServiceKafkaAclDelete(ctx context.Context, project string, serviceName string, kafkaAclId string) ([]AclOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/acl/%s", project, serviceName, kafkaAclId) + path := fmt.Sprintf("/v1/project/%s/service/%s/acl/%s", project, serviceName, kafkaAclId) b, err := h.doer.Do(ctx, "ServiceKafkaAclDelete", "DELETE", path, nil) if err != nil { return nil, err @@ -99,7 +99,7 @@ func (h *KafkaHandler) ServiceKafkaAclDelete(ctx context.Context, project string return out.Acl, nil } func (h *KafkaHandler) ServiceKafkaAclList(ctx context.Context, project string, serviceName string) ([]AclOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/acl", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/acl", project, serviceName) b, err := h.doer.Do(ctx, "ServiceKafkaAclList", "GET", path, nil) if err != nil { return nil, err @@ -112,17 +112,17 @@ func (h *KafkaHandler) ServiceKafkaAclList(ctx context.Context, project string, return out.Acl, nil } func (h *KafkaHandler) ServiceKafkaQuotaCreate(ctx context.Context, project string, serviceName string, in *ServiceKafkaQuotaCreateIn) error { - path := fmt.Sprintf("/project/%s/service/%s/quota", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/quota", project, serviceName) _, err := h.doer.Do(ctx, "ServiceKafkaQuotaCreate", "POST", path, in) return err } func (h *KafkaHandler) ServiceKafkaQuotaDelete(ctx context.Context, project string, serviceName string) error { - path := fmt.Sprintf("/project/%s/service/%s/quota", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/quota", project, serviceName) _, err := h.doer.Do(ctx, "ServiceKafkaQuotaDelete", "DELETE", path, nil) return err } func (h *KafkaHandler) ServiceKafkaQuotaDescribe(ctx context.Context, project string, serviceName string) (*ServiceKafkaQuotaDescribeOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/quota/describe", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/quota/describe", project, serviceName) b, err := h.doer.Do(ctx, "ServiceKafkaQuotaDescribe", "GET", path, nil) if err != nil { return nil, err @@ -135,7 +135,7 @@ func (h *KafkaHandler) ServiceKafkaQuotaDescribe(ctx context.Context, project st return &out.Quota, nil } func (h *KafkaHandler) ServiceKafkaQuotaList(ctx context.Context, project string, serviceName string) ([]QuotaOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/quota", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/quota", project, serviceName) b, err := h.doer.Do(ctx, "ServiceKafkaQuotaList", "GET", path, nil) if err != nil { return nil, err @@ -148,7 +148,7 @@ func (h *KafkaHandler) ServiceKafkaQuotaList(ctx context.Context, project string return out.Quotas, nil } func (h *KafkaHandler) ServiceKafkaTieredStorageStorageUsageByTopic(ctx context.Context, project string, serviceName string) (map[string]any, error) { - path := fmt.Sprintf("/project/%s/service/%s/kafka/tiered-storage/storage-usage/by-topic", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/tiered-storage/storage-usage/by-topic", project, serviceName) b, err := h.doer.Do(ctx, "ServiceKafkaTieredStorageStorageUsageByTopic", "GET", path, nil) if err != nil { return nil, err @@ -161,7 +161,7 @@ func (h *KafkaHandler) ServiceKafkaTieredStorageStorageUsageByTopic(ctx context. return out.StorageUsage, nil } func (h *KafkaHandler) ServiceKafkaTieredStorageStorageUsageTotal(ctx context.Context, project string, serviceName string) (int, error) { - path := fmt.Sprintf("/project/%s/service/%s/kafka/tiered-storage/storage-usage/total", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/tiered-storage/storage-usage/total", project, serviceName) b, err := h.doer.Do(ctx, "ServiceKafkaTieredStorageStorageUsageTotal", "GET", path, nil) if err != nil { return 0, err @@ -174,7 +174,7 @@ func (h *KafkaHandler) ServiceKafkaTieredStorageStorageUsageTotal(ctx context.Co return out.TotalStorageUsage, nil } func (h *KafkaHandler) ServiceKafkaTieredStorageSummary(ctx context.Context, project string, serviceName string) (*ServiceKafkaTieredStorageSummaryOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/kafka/tiered-storage/summary", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/tiered-storage/summary", project, serviceName) b, err := h.doer.Do(ctx, "ServiceKafkaTieredStorageSummary", "GET", path, nil) if err != nil { return nil, err diff --git a/handler/kafkaconnect/kafkaconnect.go b/handler/kafkaconnect/kafkaconnect.go index f01569b..ad64003 100644 --- a/handler/kafkaconnect/kafkaconnect.go +++ b/handler/kafkaconnect/kafkaconnect.go @@ -10,57 +10,57 @@ import ( type Handler interface { // ServiceKafkaConnectCreateConnector create a Kafka Connect connector - // POST /project/{project}/service/{service_name}/connectors + // POST /v1/project/{project}/service/{service_name}/connectors // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaConnectCreateConnector ServiceKafkaConnectCreateConnector(ctx context.Context, project string, serviceName string, in *ServiceKafkaConnectCreateConnectorIn) (*ServiceKafkaConnectCreateConnectorOut, error) // ServiceKafkaConnectDeleteConnector delete Kafka Connect connector - // DELETE /project/{project}/service/{service_name}/connectors/{connector_name} + // DELETE /v1/project/{project}/service/{service_name}/connectors/{connector_name} // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaConnectDeleteConnector ServiceKafkaConnectDeleteConnector(ctx context.Context, project string, serviceName string, connectorName string) error // ServiceKafkaConnectEditConnector edit Kafka Connect connector - // PUT /project/{project}/service/{service_name}/connectors/{connector_name} + // PUT /v1/project/{project}/service/{service_name}/connectors/{connector_name} // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaConnectEditConnector ServiceKafkaConnectEditConnector(ctx context.Context, project string, serviceName string, connectorName string, in *ServiceKafkaConnectEditConnectorIn) (*ServiceKafkaConnectEditConnectorOut, error) // ServiceKafkaConnectGetAvailableConnectors get available Kafka Connect connectors - // GET /project/{project}/service/{service_name}/available-connectors + // GET /v1/project/{project}/service/{service_name}/available-connectors // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaConnectGetAvailableConnectors ServiceKafkaConnectGetAvailableConnectors(ctx context.Context, project string, serviceName string) ([]PluginOut, error) // ServiceKafkaConnectGetConnectorConfiguration get Kafka Connect connector configuration schema - // GET /project/{project}/service/{service_name}/connector-plugins/{connector_name}/configuration + // GET /v1/project/{project}/service/{service_name}/connector-plugins/{connector_name}/configuration // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaConnectGetConnectorConfiguration ServiceKafkaConnectGetConnectorConfiguration(ctx context.Context, project string, serviceName string, connectorName string) ([]ConfigurationSchemaOut, error) // ServiceKafkaConnectGetConnectorStatus get a Kafka Connect Connector status - // GET /project/{project}/service/{service_name}/connectors/{connector_name}/status + // GET /v1/project/{project}/service/{service_name}/connectors/{connector_name}/status // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaConnectGetConnectorStatus ServiceKafkaConnectGetConnectorStatus(ctx context.Context, project string, serviceName string, connectorName string) (*ServiceKafkaConnectGetConnectorStatusOut, error) // ServiceKafkaConnectList lists Kafka connectors - // GET /project/{project}/service/{service_name}/connectors + // GET /v1/project/{project}/service/{service_name}/connectors // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaConnectList ServiceKafkaConnectList(ctx context.Context, project string, serviceName string) ([]ConnectorOut, error) // ServiceKafkaConnectPauseConnector pause a Kafka Connect Connector - // POST /project/{project}/service/{service_name}/connectors/{connector_name}/pause + // POST /v1/project/{project}/service/{service_name}/connectors/{connector_name}/pause // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaConnectPauseConnector ServiceKafkaConnectPauseConnector(ctx context.Context, project string, serviceName string, connectorName string) error // ServiceKafkaConnectRestartConnector restart a Kafka Connect Connector - // POST /project/{project}/service/{service_name}/connectors/{connector_name}/restart + // POST /v1/project/{project}/service/{service_name}/connectors/{connector_name}/restart // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaConnectRestartConnector ServiceKafkaConnectRestartConnector(ctx context.Context, project string, serviceName string, connectorName string) error // ServiceKafkaConnectRestartConnectorTask restart a Kafka Connect Connector task - // POST /project/{project}/service/{service_name}/connectors/{connector_name}/tasks/{task_id}/restart + // POST /v1/project/{project}/service/{service_name}/connectors/{connector_name}/tasks/{task_id}/restart // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaConnectRestartConnectorTask ServiceKafkaConnectRestartConnectorTask(ctx context.Context, project string, serviceName string, connectorName string, taskId string) error // ServiceKafkaConnectResumeConnector resume a Kafka Connect Connector - // POST /project/{project}/service/{service_name}/connectors/{connector_name}/resume + // POST /v1/project/{project}/service/{service_name}/connectors/{connector_name}/resume // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaConnectResumeConnector ServiceKafkaConnectResumeConnector(ctx context.Context, project string, serviceName string, connectorName string) error } @@ -78,7 +78,7 @@ type KafkaConnectHandler struct { } func (h *KafkaConnectHandler) ServiceKafkaConnectCreateConnector(ctx context.Context, project string, serviceName string, in *ServiceKafkaConnectCreateConnectorIn) (*ServiceKafkaConnectCreateConnectorOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/connectors", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/connectors", project, serviceName) b, err := h.doer.Do(ctx, "ServiceKafkaConnectCreateConnector", "POST", path, in) if err != nil { return nil, err @@ -91,12 +91,12 @@ func (h *KafkaConnectHandler) ServiceKafkaConnectCreateConnector(ctx context.Con return &out.Connector, nil } func (h *KafkaConnectHandler) ServiceKafkaConnectDeleteConnector(ctx context.Context, project string, serviceName string, connectorName string) error { - path := fmt.Sprintf("/project/%s/service/%s/connectors/%s", project, serviceName, connectorName) + path := fmt.Sprintf("/v1/project/%s/service/%s/connectors/%s", project, serviceName, connectorName) _, err := h.doer.Do(ctx, "ServiceKafkaConnectDeleteConnector", "DELETE", path, nil) return err } func (h *KafkaConnectHandler) ServiceKafkaConnectEditConnector(ctx context.Context, project string, serviceName string, connectorName string, in *ServiceKafkaConnectEditConnectorIn) (*ServiceKafkaConnectEditConnectorOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/connectors/%s", project, serviceName, connectorName) + path := fmt.Sprintf("/v1/project/%s/service/%s/connectors/%s", project, serviceName, connectorName) b, err := h.doer.Do(ctx, "ServiceKafkaConnectEditConnector", "PUT", path, in) if err != nil { return nil, err @@ -109,7 +109,7 @@ func (h *KafkaConnectHandler) ServiceKafkaConnectEditConnector(ctx context.Conte return &out.Connector, nil } func (h *KafkaConnectHandler) ServiceKafkaConnectGetAvailableConnectors(ctx context.Context, project string, serviceName string) ([]PluginOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/available-connectors", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/available-connectors", project, serviceName) b, err := h.doer.Do(ctx, "ServiceKafkaConnectGetAvailableConnectors", "GET", path, nil) if err != nil { return nil, err @@ -122,7 +122,7 @@ func (h *KafkaConnectHandler) ServiceKafkaConnectGetAvailableConnectors(ctx cont return out.Plugins, nil } func (h *KafkaConnectHandler) ServiceKafkaConnectGetConnectorConfiguration(ctx context.Context, project string, serviceName string, connectorName string) ([]ConfigurationSchemaOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/connector-plugins/%s/configuration", project, serviceName, connectorName) + path := fmt.Sprintf("/v1/project/%s/service/%s/connector-plugins/%s/configuration", project, serviceName, connectorName) b, err := h.doer.Do(ctx, "ServiceKafkaConnectGetConnectorConfiguration", "GET", path, nil) if err != nil { return nil, err @@ -135,7 +135,7 @@ func (h *KafkaConnectHandler) ServiceKafkaConnectGetConnectorConfiguration(ctx c return out.ConfigurationSchema, nil } func (h *KafkaConnectHandler) ServiceKafkaConnectGetConnectorStatus(ctx context.Context, project string, serviceName string, connectorName string) (*ServiceKafkaConnectGetConnectorStatusOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/connectors/%s/status", project, serviceName, connectorName) + path := fmt.Sprintf("/v1/project/%s/service/%s/connectors/%s/status", project, serviceName, connectorName) b, err := h.doer.Do(ctx, "ServiceKafkaConnectGetConnectorStatus", "GET", path, nil) if err != nil { return nil, err @@ -148,7 +148,7 @@ func (h *KafkaConnectHandler) ServiceKafkaConnectGetConnectorStatus(ctx context. return &out.Status, nil } func (h *KafkaConnectHandler) ServiceKafkaConnectList(ctx context.Context, project string, serviceName string) ([]ConnectorOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/connectors", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/connectors", project, serviceName) b, err := h.doer.Do(ctx, "ServiceKafkaConnectList", "GET", path, nil) if err != nil { return nil, err @@ -161,22 +161,22 @@ func (h *KafkaConnectHandler) ServiceKafkaConnectList(ctx context.Context, proje return out.Connectors, nil } func (h *KafkaConnectHandler) ServiceKafkaConnectPauseConnector(ctx context.Context, project string, serviceName string, connectorName string) error { - path := fmt.Sprintf("/project/%s/service/%s/connectors/%s/pause", project, serviceName, connectorName) + path := fmt.Sprintf("/v1/project/%s/service/%s/connectors/%s/pause", project, serviceName, connectorName) _, err := h.doer.Do(ctx, "ServiceKafkaConnectPauseConnector", "POST", path, nil) return err } func (h *KafkaConnectHandler) ServiceKafkaConnectRestartConnector(ctx context.Context, project string, serviceName string, connectorName string) error { - path := fmt.Sprintf("/project/%s/service/%s/connectors/%s/restart", project, serviceName, connectorName) + path := fmt.Sprintf("/v1/project/%s/service/%s/connectors/%s/restart", project, serviceName, connectorName) _, err := h.doer.Do(ctx, "ServiceKafkaConnectRestartConnector", "POST", path, nil) return err } func (h *KafkaConnectHandler) ServiceKafkaConnectRestartConnectorTask(ctx context.Context, project string, serviceName string, connectorName string, taskId string) error { - path := fmt.Sprintf("/project/%s/service/%s/connectors/%s/tasks/%s/restart", project, serviceName, connectorName, taskId) + path := fmt.Sprintf("/v1/project/%s/service/%s/connectors/%s/tasks/%s/restart", project, serviceName, connectorName, taskId) _, err := h.doer.Do(ctx, "ServiceKafkaConnectRestartConnectorTask", "POST", path, nil) return err } func (h *KafkaConnectHandler) ServiceKafkaConnectResumeConnector(ctx context.Context, project string, serviceName string, connectorName string) error { - path := fmt.Sprintf("/project/%s/service/%s/connectors/%s/resume", project, serviceName, connectorName) + path := fmt.Sprintf("/v1/project/%s/service/%s/connectors/%s/resume", project, serviceName, connectorName) _, err := h.doer.Do(ctx, "ServiceKafkaConnectResumeConnector", "POST", path, nil) return err } diff --git a/handler/kafkamirrormaker/kafkamirrormaker.go b/handler/kafkamirrormaker/kafkamirrormaker.go index fb3f7b8..1085c92 100644 --- a/handler/kafkamirrormaker/kafkamirrormaker.go +++ b/handler/kafkamirrormaker/kafkamirrormaker.go @@ -10,27 +10,27 @@ import ( type Handler interface { // ServiceKafkaMirrorMakerCreateReplicationFlow create a replication flow - // POST /project/{project}/service/{service_name}/mirrormaker/replication-flows + // POST /v1/project/{project}/service/{service_name}/mirrormaker/replication-flows // https://api.aiven.io/doc/#tag/Service:_Kafka_MirrorMaker/operation/ServiceKafkaMirrorMakerCreateReplicationFlow ServiceKafkaMirrorMakerCreateReplicationFlow(ctx context.Context, project string, serviceName string, in *ServiceKafkaMirrorMakerCreateReplicationFlowIn) error // ServiceKafkaMirrorMakerDeleteReplicationFlow delete a replication flow - // DELETE /project/{project}/service/{service_name}/mirrormaker/replication-flows/{source_cluster}/{target_cluster} + // DELETE /v1/project/{project}/service/{service_name}/mirrormaker/replication-flows/{source_cluster}/{target_cluster} // https://api.aiven.io/doc/#tag/Service:_Kafka_MirrorMaker/operation/ServiceKafkaMirrorMakerDeleteReplicationFlow ServiceKafkaMirrorMakerDeleteReplicationFlow(ctx context.Context, project string, serviceName string, sourceCluster string, targetCluster string) error // ServiceKafkaMirrorMakerGetReplicationFlow get a replication flow - // GET /project/{project}/service/{service_name}/mirrormaker/replication-flows/{source_cluster}/{target_cluster} + // GET /v1/project/{project}/service/{service_name}/mirrormaker/replication-flows/{source_cluster}/{target_cluster} // https://api.aiven.io/doc/#tag/Service:_Kafka_MirrorMaker/operation/ServiceKafkaMirrorMakerGetReplicationFlow ServiceKafkaMirrorMakerGetReplicationFlow(ctx context.Context, project string, serviceName string, sourceCluster string, targetCluster string) (*ServiceKafkaMirrorMakerGetReplicationFlowOut, error) // ServiceKafkaMirrorMakerGetReplicationFlows get replication flows - // GET /project/{project}/service/{service_name}/mirrormaker/replication-flows + // GET /v1/project/{project}/service/{service_name}/mirrormaker/replication-flows // https://api.aiven.io/doc/#tag/Service:_Kafka_MirrorMaker/operation/ServiceKafkaMirrorMakerGetReplicationFlows ServiceKafkaMirrorMakerGetReplicationFlows(ctx context.Context, project string, serviceName string) ([]ReplicationFlowOut, error) // ServiceKafkaMirrorMakerPatchReplicationFlow update a replication flow - // PUT /project/{project}/service/{service_name}/mirrormaker/replication-flows/{source_cluster}/{target_cluster} + // PUT /v1/project/{project}/service/{service_name}/mirrormaker/replication-flows/{source_cluster}/{target_cluster} // https://api.aiven.io/doc/#tag/Service:_Kafka_MirrorMaker/operation/ServiceKafkaMirrorMakerPatchReplicationFlow ServiceKafkaMirrorMakerPatchReplicationFlow(ctx context.Context, project string, serviceName string, sourceCluster string, targetCluster string, in *ServiceKafkaMirrorMakerPatchReplicationFlowIn) (*ServiceKafkaMirrorMakerPatchReplicationFlowOut, error) } @@ -48,17 +48,17 @@ type KafkaMirrorMakerHandler struct { } func (h *KafkaMirrorMakerHandler) ServiceKafkaMirrorMakerCreateReplicationFlow(ctx context.Context, project string, serviceName string, in *ServiceKafkaMirrorMakerCreateReplicationFlowIn) error { - path := fmt.Sprintf("/project/%s/service/%s/mirrormaker/replication-flows", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/mirrormaker/replication-flows", project, serviceName) _, err := h.doer.Do(ctx, "ServiceKafkaMirrorMakerCreateReplicationFlow", "POST", path, in) return err } func (h *KafkaMirrorMakerHandler) ServiceKafkaMirrorMakerDeleteReplicationFlow(ctx context.Context, project string, serviceName string, sourceCluster string, targetCluster string) error { - path := fmt.Sprintf("/project/%s/service/%s/mirrormaker/replication-flows/%s/%s", project, serviceName, sourceCluster, targetCluster) + path := fmt.Sprintf("/v1/project/%s/service/%s/mirrormaker/replication-flows/%s/%s", project, serviceName, sourceCluster, targetCluster) _, err := h.doer.Do(ctx, "ServiceKafkaMirrorMakerDeleteReplicationFlow", "DELETE", path, nil) return err } func (h *KafkaMirrorMakerHandler) ServiceKafkaMirrorMakerGetReplicationFlow(ctx context.Context, project string, serviceName string, sourceCluster string, targetCluster string) (*ServiceKafkaMirrorMakerGetReplicationFlowOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/mirrormaker/replication-flows/%s/%s", project, serviceName, sourceCluster, targetCluster) + path := fmt.Sprintf("/v1/project/%s/service/%s/mirrormaker/replication-flows/%s/%s", project, serviceName, sourceCluster, targetCluster) b, err := h.doer.Do(ctx, "ServiceKafkaMirrorMakerGetReplicationFlow", "GET", path, nil) if err != nil { return nil, err @@ -71,7 +71,7 @@ func (h *KafkaMirrorMakerHandler) ServiceKafkaMirrorMakerGetReplicationFlow(ctx return &out.ReplicationFlow, nil } func (h *KafkaMirrorMakerHandler) ServiceKafkaMirrorMakerGetReplicationFlows(ctx context.Context, project string, serviceName string) ([]ReplicationFlowOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/mirrormaker/replication-flows", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/mirrormaker/replication-flows", project, serviceName) b, err := h.doer.Do(ctx, "ServiceKafkaMirrorMakerGetReplicationFlows", "GET", path, nil) if err != nil { return nil, err @@ -84,7 +84,7 @@ func (h *KafkaMirrorMakerHandler) ServiceKafkaMirrorMakerGetReplicationFlows(ctx return out.ReplicationFlows, nil } func (h *KafkaMirrorMakerHandler) ServiceKafkaMirrorMakerPatchReplicationFlow(ctx context.Context, project string, serviceName string, sourceCluster string, targetCluster string, in *ServiceKafkaMirrorMakerPatchReplicationFlowIn) (*ServiceKafkaMirrorMakerPatchReplicationFlowOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/mirrormaker/replication-flows/%s/%s", project, serviceName, sourceCluster, targetCluster) + path := fmt.Sprintf("/v1/project/%s/service/%s/mirrormaker/replication-flows/%s/%s", project, serviceName, sourceCluster, targetCluster) b, err := h.doer.Do(ctx, "ServiceKafkaMirrorMakerPatchReplicationFlow", "PUT", path, in) if err != nil { return nil, err @@ -116,6 +116,7 @@ type ReplicationFlowOut struct { OffsetLagMax *int `json:"offset_lag_max,omitempty"` OffsetSyncsTopicLocation OffsetSyncsTopicLocationType `json:"offset_syncs_topic_location,omitempty"` ReplicationPolicyClass ReplicationPolicyClassType `json:"replication_policy_class,omitempty"` + ReplicationProgress *float64 `json:"replication_progress,omitempty"` SourceCluster string `json:"source_cluster"` SyncGroupOffsetsEnabled *bool `json:"sync_group_offsets_enabled,omitempty"` SyncGroupOffsetsIntervalSeconds *int `json:"sync_group_offsets_interval_seconds,omitempty"` @@ -157,6 +158,7 @@ type ServiceKafkaMirrorMakerGetReplicationFlowOut struct { OffsetLagMax *int `json:"offset_lag_max,omitempty"` OffsetSyncsTopicLocation OffsetSyncsTopicLocationType `json:"offset_syncs_topic_location,omitempty"` ReplicationPolicyClass ReplicationPolicyClassType `json:"replication_policy_class,omitempty"` + ReplicationProgress *float64 `json:"replication_progress,omitempty"` SourceCluster string `json:"source_cluster"` SyncGroupOffsetsEnabled *bool `json:"sync_group_offsets_enabled,omitempty"` SyncGroupOffsetsIntervalSeconds *int `json:"sync_group_offsets_interval_seconds,omitempty"` @@ -185,6 +187,7 @@ type ServiceKafkaMirrorMakerPatchReplicationFlowOut struct { OffsetLagMax *int `json:"offset_lag_max,omitempty"` OffsetSyncsTopicLocation OffsetSyncsTopicLocationType `json:"offset_syncs_topic_location,omitempty"` ReplicationPolicyClass ReplicationPolicyClassType `json:"replication_policy_class,omitempty"` + ReplicationProgress *float64 `json:"replication_progress,omitempty"` SourceCluster string `json:"source_cluster"` SyncGroupOffsetsEnabled *bool `json:"sync_group_offsets_enabled,omitempty"` SyncGroupOffsetsIntervalSeconds *int `json:"sync_group_offsets_interval_seconds,omitempty"` diff --git a/handler/kafkaschemaregistry/kafkaschemaregistry.go b/handler/kafkaschemaregistry/kafkaschemaregistry.go index 487827e..f954752 100644 --- a/handler/kafkaschemaregistry/kafkaschemaregistry.go +++ b/handler/kafkaschemaregistry/kafkaschemaregistry.go @@ -10,77 +10,77 @@ import ( type Handler interface { // ServiceSchemaRegistryAclAdd add a Schema Registry ACL entry - // POST /project/{project}/service/{service_name}/kafka/schema-registry/acl + // POST /v1/project/{project}/service/{service_name}/kafka/schema-registry/acl // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceSchemaRegistryAclAdd ServiceSchemaRegistryAclAdd(ctx context.Context, project string, serviceName string, in *ServiceSchemaRegistryAclAddIn) ([]AclOut, error) // ServiceSchemaRegistryAclDelete delete a Schema Registry ACL entry - // DELETE /project/{project}/service/{service_name}/kafka/schema-registry/acl/{schema_registry_acl_id} + // DELETE /v1/project/{project}/service/{service_name}/kafka/schema-registry/acl/{schema_registry_acl_id} // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceSchemaRegistryAclDelete ServiceSchemaRegistryAclDelete(ctx context.Context, project string, serviceName string, schemaRegistryAclId string) ([]AclOut, error) // ServiceSchemaRegistryAclList list Schema Registry ACL entries - // GET /project/{project}/service/{service_name}/kafka/schema-registry/acl + // GET /v1/project/{project}/service/{service_name}/kafka/schema-registry/acl // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceSchemaRegistryAclList ServiceSchemaRegistryAclList(ctx context.Context, project string, serviceName string) ([]AclOut, error) // ServiceSchemaRegistryCompatibility check compatibility of schema in Schema Registry - // POST /project/{project}/service/{service_name}/kafka/schema/compatibility/subjects/{subject_name}/versions/{version_id} + // POST /v1/project/{project}/service/{service_name}/kafka/schema/compatibility/subjects/{subject_name}/versions/{version_id} // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceSchemaRegistryCompatibility ServiceSchemaRegistryCompatibility(ctx context.Context, project string, serviceName string, subjectName string, versionId int, in *ServiceSchemaRegistryCompatibilityIn) (bool, error) // ServiceSchemaRegistryGlobalConfigGet get global configuration for Schema Registry - // GET /project/{project}/service/{service_name}/kafka/schema/config + // GET /v1/project/{project}/service/{service_name}/kafka/schema/config // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceSchemaRegistryGlobalConfigGet ServiceSchemaRegistryGlobalConfigGet(ctx context.Context, project string, serviceName string) (CompatibilityType, error) // ServiceSchemaRegistryGlobalConfigPut edit global configuration for Schema Registry - // PUT /project/{project}/service/{service_name}/kafka/schema/config + // PUT /v1/project/{project}/service/{service_name}/kafka/schema/config // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceSchemaRegistryGlobalConfigPut ServiceSchemaRegistryGlobalConfigPut(ctx context.Context, project string, serviceName string, in *ServiceSchemaRegistryGlobalConfigPutIn) (CompatibilityType, error) // ServiceSchemaRegistrySchemaGet get schema in Schema Registry - // GET /project/{project}/service/{service_name}/kafka/schema/schemas/ids/{schema_id} + // GET /v1/project/{project}/service/{service_name}/kafka/schema/schemas/ids/{schema_id} // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceSchemaRegistrySchemaGet ServiceSchemaRegistrySchemaGet(ctx context.Context, project string, serviceName string, schemaId string) error // ServiceSchemaRegistrySubjectConfigGet get configuration for Schema Registry subject - // GET /project/{project}/service/{service_name}/kafka/schema/config/{subject_name} + // GET /v1/project/{project}/service/{service_name}/kafka/schema/config/{subject_name} // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceSchemaRegistrySubjectConfigGet ServiceSchemaRegistrySubjectConfigGet(ctx context.Context, project string, serviceName string, subjectName string) (CompatibilityType, error) // ServiceSchemaRegistrySubjectConfigPut edit configuration for Schema Registry subject - // PUT /project/{project}/service/{service_name}/kafka/schema/config/{subject_name} + // PUT /v1/project/{project}/service/{service_name}/kafka/schema/config/{subject_name} // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceSchemaRegistrySubjectConfigPut ServiceSchemaRegistrySubjectConfigPut(ctx context.Context, project string, serviceName string, subjectName string, in *ServiceSchemaRegistrySubjectConfigPutIn) (CompatibilityType, error) // ServiceSchemaRegistrySubjectDelete delete Schema Registry subject - // DELETE /project/{project}/service/{service_name}/kafka/schema/subjects/{subject_name} + // DELETE /v1/project/{project}/service/{service_name}/kafka/schema/subjects/{subject_name} // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceSchemaRegistrySubjectDelete ServiceSchemaRegistrySubjectDelete(ctx context.Context, project string, serviceName string, subjectName string) error // ServiceSchemaRegistrySubjectVersionDelete delete Schema Registry subject version - // DELETE /project/{project}/service/{service_name}/kafka/schema/subjects/{subject_name}/versions/{version_id} + // DELETE /v1/project/{project}/service/{service_name}/kafka/schema/subjects/{subject_name}/versions/{version_id} // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceSchemaRegistrySubjectVersionDelete ServiceSchemaRegistrySubjectVersionDelete(ctx context.Context, project string, serviceName string, subjectName string, versionId int) error // ServiceSchemaRegistrySubjectVersionGet get Schema Registry Subject version - // GET /project/{project}/service/{service_name}/kafka/schema/subjects/{subject_name}/versions/{version_id} + // GET /v1/project/{project}/service/{service_name}/kafka/schema/subjects/{subject_name}/versions/{version_id} // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceSchemaRegistrySubjectVersionGet ServiceSchemaRegistrySubjectVersionGet(ctx context.Context, project string, serviceName string, subjectName string, versionId int) error // ServiceSchemaRegistrySubjectVersionPost register a new Schema in Schema Registry - // POST /project/{project}/service/{service_name}/kafka/schema/subjects/{subject_name}/versions + // POST /v1/project/{project}/service/{service_name}/kafka/schema/subjects/{subject_name}/versions // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceSchemaRegistrySubjectVersionPost ServiceSchemaRegistrySubjectVersionPost(ctx context.Context, project string, serviceName string, subjectName string, in *ServiceSchemaRegistrySubjectVersionPostIn) (int, error) // ServiceSchemaRegistrySubjectVersionsGet get Schema Registry subject versions - // GET /project/{project}/service/{service_name}/kafka/schema/subjects/{subject_name}/versions + // GET /v1/project/{project}/service/{service_name}/kafka/schema/subjects/{subject_name}/versions // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceSchemaRegistrySubjectVersionsGet ServiceSchemaRegistrySubjectVersionsGet(ctx context.Context, project string, serviceName string, subjectName string) ([]int, error) // ServiceSchemaRegistrySubjects lists Schema Registry subjects - // GET /project/{project}/service/{service_name}/kafka/schema/subjects + // GET /v1/project/{project}/service/{service_name}/kafka/schema/subjects // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceSchemaRegistrySubjects ServiceSchemaRegistrySubjects(ctx context.Context, project string, serviceName string) ([]string, error) } @@ -98,7 +98,7 @@ type KafkaSchemaRegistryHandler struct { } func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistryAclAdd(ctx context.Context, project string, serviceName string, in *ServiceSchemaRegistryAclAddIn) ([]AclOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/kafka/schema-registry/acl", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/schema-registry/acl", project, serviceName) b, err := h.doer.Do(ctx, "ServiceSchemaRegistryAclAdd", "POST", path, in) if err != nil { return nil, err @@ -111,7 +111,7 @@ func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistryAclAdd(ctx context.Con return out.Acl, nil } func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistryAclDelete(ctx context.Context, project string, serviceName string, schemaRegistryAclId string) ([]AclOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/kafka/schema-registry/acl/%s", project, serviceName, schemaRegistryAclId) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/schema-registry/acl/%s", project, serviceName, schemaRegistryAclId) b, err := h.doer.Do(ctx, "ServiceSchemaRegistryAclDelete", "DELETE", path, nil) if err != nil { return nil, err @@ -124,7 +124,7 @@ func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistryAclDelete(ctx context. return out.Acl, nil } func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistryAclList(ctx context.Context, project string, serviceName string) ([]AclOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/kafka/schema-registry/acl", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/schema-registry/acl", project, serviceName) b, err := h.doer.Do(ctx, "ServiceSchemaRegistryAclList", "GET", path, nil) if err != nil { return nil, err @@ -137,7 +137,7 @@ func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistryAclList(ctx context.Co return out.Acl, nil } func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistryCompatibility(ctx context.Context, project string, serviceName string, subjectName string, versionId int, in *ServiceSchemaRegistryCompatibilityIn) (bool, error) { - path := fmt.Sprintf("/project/%s/service/%s/kafka/schema/compatibility/subjects/%s/versions/%d", project, serviceName, subjectName, versionId) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/schema/compatibility/subjects/%s/versions/%d", project, serviceName, subjectName, versionId) b, err := h.doer.Do(ctx, "ServiceSchemaRegistryCompatibility", "POST", path, in) if err != nil { return false, err @@ -150,7 +150,7 @@ func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistryCompatibility(ctx cont return out.IsCompatible, nil } func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistryGlobalConfigGet(ctx context.Context, project string, serviceName string) (CompatibilityType, error) { - path := fmt.Sprintf("/project/%s/service/%s/kafka/schema/config", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/schema/config", project, serviceName) b, err := h.doer.Do(ctx, "ServiceSchemaRegistryGlobalConfigGet", "GET", path, nil) if err != nil { return "", err @@ -163,7 +163,7 @@ func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistryGlobalConfigGet(ctx co return out.CompatibilityLevel, nil } func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistryGlobalConfigPut(ctx context.Context, project string, serviceName string, in *ServiceSchemaRegistryGlobalConfigPutIn) (CompatibilityType, error) { - path := fmt.Sprintf("/project/%s/service/%s/kafka/schema/config", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/schema/config", project, serviceName) b, err := h.doer.Do(ctx, "ServiceSchemaRegistryGlobalConfigPut", "PUT", path, in) if err != nil { return "", err @@ -176,12 +176,12 @@ func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistryGlobalConfigPut(ctx co return out.Compatibility, nil } func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistrySchemaGet(ctx context.Context, project string, serviceName string, schemaId string) error { - path := fmt.Sprintf("/project/%s/service/%s/kafka/schema/schemas/ids/%s", project, serviceName, schemaId) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/schema/schemas/ids/%s", project, serviceName, schemaId) _, err := h.doer.Do(ctx, "ServiceSchemaRegistrySchemaGet", "GET", path, nil) return err } func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistrySubjectConfigGet(ctx context.Context, project string, serviceName string, subjectName string) (CompatibilityType, error) { - path := fmt.Sprintf("/project/%s/service/%s/kafka/schema/config/%s", project, serviceName, subjectName) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/schema/config/%s", project, serviceName, subjectName) b, err := h.doer.Do(ctx, "ServiceSchemaRegistrySubjectConfigGet", "GET", path, nil) if err != nil { return "", err @@ -194,7 +194,7 @@ func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistrySubjectConfigGet(ctx c return out.CompatibilityLevel, nil } func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistrySubjectConfigPut(ctx context.Context, project string, serviceName string, subjectName string, in *ServiceSchemaRegistrySubjectConfigPutIn) (CompatibilityType, error) { - path := fmt.Sprintf("/project/%s/service/%s/kafka/schema/config/%s", project, serviceName, subjectName) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/schema/config/%s", project, serviceName, subjectName) b, err := h.doer.Do(ctx, "ServiceSchemaRegistrySubjectConfigPut", "PUT", path, in) if err != nil { return "", err @@ -207,22 +207,22 @@ func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistrySubjectConfigPut(ctx c return out.Compatibility, nil } func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistrySubjectDelete(ctx context.Context, project string, serviceName string, subjectName string) error { - path := fmt.Sprintf("/project/%s/service/%s/kafka/schema/subjects/%s", project, serviceName, subjectName) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/schema/subjects/%s", project, serviceName, subjectName) _, err := h.doer.Do(ctx, "ServiceSchemaRegistrySubjectDelete", "DELETE", path, nil) return err } func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistrySubjectVersionDelete(ctx context.Context, project string, serviceName string, subjectName string, versionId int) error { - path := fmt.Sprintf("/project/%s/service/%s/kafka/schema/subjects/%s/versions/%d", project, serviceName, subjectName, versionId) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/schema/subjects/%s/versions/%d", project, serviceName, subjectName, versionId) _, err := h.doer.Do(ctx, "ServiceSchemaRegistrySubjectVersionDelete", "DELETE", path, nil) return err } func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistrySubjectVersionGet(ctx context.Context, project string, serviceName string, subjectName string, versionId int) error { - path := fmt.Sprintf("/project/%s/service/%s/kafka/schema/subjects/%s/versions/%d", project, serviceName, subjectName, versionId) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/schema/subjects/%s/versions/%d", project, serviceName, subjectName, versionId) _, err := h.doer.Do(ctx, "ServiceSchemaRegistrySubjectVersionGet", "GET", path, nil) return err } func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistrySubjectVersionPost(ctx context.Context, project string, serviceName string, subjectName string, in *ServiceSchemaRegistrySubjectVersionPostIn) (int, error) { - path := fmt.Sprintf("/project/%s/service/%s/kafka/schema/subjects/%s/versions", project, serviceName, subjectName) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/schema/subjects/%s/versions", project, serviceName, subjectName) b, err := h.doer.Do(ctx, "ServiceSchemaRegistrySubjectVersionPost", "POST", path, in) if err != nil { return 0, err @@ -235,7 +235,7 @@ func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistrySubjectVersionPost(ctx return out.Id, nil } func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistrySubjectVersionsGet(ctx context.Context, project string, serviceName string, subjectName string) ([]int, error) { - path := fmt.Sprintf("/project/%s/service/%s/kafka/schema/subjects/%s/versions", project, serviceName, subjectName) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/schema/subjects/%s/versions", project, serviceName, subjectName) b, err := h.doer.Do(ctx, "ServiceSchemaRegistrySubjectVersionsGet", "GET", path, nil) if err != nil { return nil, err @@ -248,7 +248,7 @@ func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistrySubjectVersionsGet(ctx return out.Versions, nil } func (h *KafkaSchemaRegistryHandler) ServiceSchemaRegistrySubjects(ctx context.Context, project string, serviceName string) ([]string, error) { - path := fmt.Sprintf("/project/%s/service/%s/kafka/schema/subjects", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/schema/subjects", project, serviceName) b, err := h.doer.Do(ctx, "ServiceSchemaRegistrySubjects", "GET", path, nil) if err != nil { return nil, err diff --git a/handler/kafkatopic/kafkatopic.go b/handler/kafkatopic/kafkatopic.go index 1ba5e54..fe8c424 100644 --- a/handler/kafkatopic/kafkatopic.go +++ b/handler/kafkatopic/kafkatopic.go @@ -10,37 +10,37 @@ import ( type Handler interface { // ServiceKafkaTopicCreate create a Kafka topic - // POST /project/{project}/service/{service_name}/topic + // POST /v1/project/{project}/service/{service_name}/topic // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaTopicCreate ServiceKafkaTopicCreate(ctx context.Context, project string, serviceName string, in *ServiceKafkaTopicCreateIn) error // ServiceKafkaTopicDelete delete a Kafka topic - // DELETE /project/{project}/service/{service_name}/topic/{topic_name} + // DELETE /v1/project/{project}/service/{service_name}/topic/{topic_name} // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaTopicDelete ServiceKafkaTopicDelete(ctx context.Context, project string, serviceName string, topicName string) error // ServiceKafkaTopicGet get Kafka topic info - // GET /project/{project}/service/{service_name}/topic/{topic_name} + // GET /v1/project/{project}/service/{service_name}/topic/{topic_name} // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaTopicGet ServiceKafkaTopicGet(ctx context.Context, project string, serviceName string, topicName string) (*ServiceKafkaTopicGetOut, error) // ServiceKafkaTopicList get Kafka topic list - // GET /project/{project}/service/{service_name}/topic + // GET /v1/project/{project}/service/{service_name}/topic // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaTopicList ServiceKafkaTopicList(ctx context.Context, project string, serviceName string) ([]TopicOut, error) // ServiceKafkaTopicMessageList list kafka topic messages - // POST /project/{project}/service/{service_name}/kafka/rest/topics/{topic_name}/messages + // POST /v1/project/{project}/service/{service_name}/kafka/rest/topics/{topic_name}/messages // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaTopicMessageList ServiceKafkaTopicMessageList(ctx context.Context, project string, serviceName string, topicName string, in *ServiceKafkaTopicMessageListIn) ([]MessageOut, error) // ServiceKafkaTopicMessageProduce produce message into a kafka topic - // POST /project/{project}/service/{service_name}/kafka/rest/topics/{topic_name}/produce + // POST /v1/project/{project}/service/{service_name}/kafka/rest/topics/{topic_name}/produce // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaTopicMessageProduce ServiceKafkaTopicMessageProduce(ctx context.Context, project string, serviceName string, topicName string, in *ServiceKafkaTopicMessageProduceIn) (*ServiceKafkaTopicMessageProduceOut, error) // ServiceKafkaTopicUpdate update a Kafka topic - // PUT /project/{project}/service/{service_name}/topic/{topic_name} + // PUT /v1/project/{project}/service/{service_name}/topic/{topic_name} // https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaTopicUpdate ServiceKafkaTopicUpdate(ctx context.Context, project string, serviceName string, topicName string, in *ServiceKafkaTopicUpdateIn) error } @@ -58,17 +58,17 @@ type KafkaTopicHandler struct { } func (h *KafkaTopicHandler) ServiceKafkaTopicCreate(ctx context.Context, project string, serviceName string, in *ServiceKafkaTopicCreateIn) error { - path := fmt.Sprintf("/project/%s/service/%s/topic", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/topic", project, serviceName) _, err := h.doer.Do(ctx, "ServiceKafkaTopicCreate", "POST", path, in) return err } func (h *KafkaTopicHandler) ServiceKafkaTopicDelete(ctx context.Context, project string, serviceName string, topicName string) error { - path := fmt.Sprintf("/project/%s/service/%s/topic/%s", project, serviceName, topicName) + path := fmt.Sprintf("/v1/project/%s/service/%s/topic/%s", project, serviceName, topicName) _, err := h.doer.Do(ctx, "ServiceKafkaTopicDelete", "DELETE", path, nil) return err } func (h *KafkaTopicHandler) ServiceKafkaTopicGet(ctx context.Context, project string, serviceName string, topicName string) (*ServiceKafkaTopicGetOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/topic/%s", project, serviceName, topicName) + path := fmt.Sprintf("/v1/project/%s/service/%s/topic/%s", project, serviceName, topicName) b, err := h.doer.Do(ctx, "ServiceKafkaTopicGet", "GET", path, nil) if err != nil { return nil, err @@ -81,7 +81,7 @@ func (h *KafkaTopicHandler) ServiceKafkaTopicGet(ctx context.Context, project st return &out.Topic, nil } func (h *KafkaTopicHandler) ServiceKafkaTopicList(ctx context.Context, project string, serviceName string) ([]TopicOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/topic", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/topic", project, serviceName) b, err := h.doer.Do(ctx, "ServiceKafkaTopicList", "GET", path, nil) if err != nil { return nil, err @@ -94,7 +94,7 @@ func (h *KafkaTopicHandler) ServiceKafkaTopicList(ctx context.Context, project s return out.Topics, nil } func (h *KafkaTopicHandler) ServiceKafkaTopicMessageList(ctx context.Context, project string, serviceName string, topicName string, in *ServiceKafkaTopicMessageListIn) ([]MessageOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/kafka/rest/topics/%s/messages", project, serviceName, topicName) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/rest/topics/%s/messages", project, serviceName, topicName) b, err := h.doer.Do(ctx, "ServiceKafkaTopicMessageList", "POST", path, in) if err != nil { return nil, err @@ -107,7 +107,7 @@ func (h *KafkaTopicHandler) ServiceKafkaTopicMessageList(ctx context.Context, pr return out.Messages, nil } func (h *KafkaTopicHandler) ServiceKafkaTopicMessageProduce(ctx context.Context, project string, serviceName string, topicName string, in *ServiceKafkaTopicMessageProduceIn) (*ServiceKafkaTopicMessageProduceOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/kafka/rest/topics/%s/produce", project, serviceName, topicName) + path := fmt.Sprintf("/v1/project/%s/service/%s/kafka/rest/topics/%s/produce", project, serviceName, topicName) b, err := h.doer.Do(ctx, "ServiceKafkaTopicMessageProduce", "POST", path, in) if err != nil { return nil, err @@ -120,7 +120,7 @@ func (h *KafkaTopicHandler) ServiceKafkaTopicMessageProduce(ctx context.Context, return out, nil } func (h *KafkaTopicHandler) ServiceKafkaTopicUpdate(ctx context.Context, project string, serviceName string, topicName string, in *ServiceKafkaTopicUpdateIn) error { - path := fmt.Sprintf("/project/%s/service/%s/topic/%s", project, serviceName, topicName) + path := fmt.Sprintf("/v1/project/%s/service/%s/topic/%s", project, serviceName, topicName) _, err := h.doer.Do(ctx, "ServiceKafkaTopicUpdate", "PUT", path, in) return err } @@ -381,10 +381,16 @@ const ( MessageFormatVersionType36Iv0 MessageFormatVersionType = "3.6-IV0" MessageFormatVersionType36Iv1 MessageFormatVersionType = "3.6-IV1" MessageFormatVersionType36Iv2 MessageFormatVersionType = "3.6-IV2" + MessageFormatVersionType37 MessageFormatVersionType = "3.7" + MessageFormatVersionType37Iv0 MessageFormatVersionType = "3.7-IV0" + MessageFormatVersionType37Iv1 MessageFormatVersionType = "3.7-IV1" + MessageFormatVersionType37Iv2 MessageFormatVersionType = "3.7-IV2" + MessageFormatVersionType37Iv3 MessageFormatVersionType = "3.7-IV3" + MessageFormatVersionType37Iv4 MessageFormatVersionType = "3.7-IV4" ) func MessageFormatVersionTypeChoices() []string { - return []string{"0.8.0", "0.8.1", "0.8.2", "0.9.0", "0.10.0", "0.10.0-IV0", "0.10.0-IV1", "0.10.1", "0.10.1-IV0", "0.10.1-IV1", "0.10.1-IV2", "0.10.2", "0.10.2-IV0", "0.11.0", "0.11.0-IV0", "0.11.0-IV1", "0.11.0-IV2", "1.0", "1.0-IV0", "1.1", "1.1-IV0", "2.0", "2.0-IV0", "2.0-IV1", "2.1", "2.1-IV0", "2.1-IV1", "2.1-IV2", "2.2", "2.2-IV0", "2.2-IV1", "2.3", "2.3-IV0", "2.3-IV1", "2.4", "2.4-IV0", "2.4-IV1", "2.5", "2.5-IV0", "2.6", "2.6-IV0", "2.7", "2.7-IV0", "2.7-IV1", "2.7-IV2", "2.8", "2.8-IV0", "2.8-IV1", "3.0", "3.0-IV0", "3.0-IV1", "3.1", "3.1-IV0", "3.2", "3.2-IV0", "3.3", "3.3-IV0", "3.3-IV1", "3.3-IV2", "3.3-IV3", "3.4", "3.4-IV0", "3.5", "3.5-IV0", "3.5-IV1", "3.5-IV2", "3.6", "3.6-IV0", "3.6-IV1", "3.6-IV2"} + return []string{"0.8.0", "0.8.1", "0.8.2", "0.9.0", "0.10.0", "0.10.0-IV0", "0.10.0-IV1", "0.10.1", "0.10.1-IV0", "0.10.1-IV1", "0.10.1-IV2", "0.10.2", "0.10.2-IV0", "0.11.0", "0.11.0-IV0", "0.11.0-IV1", "0.11.0-IV2", "1.0", "1.0-IV0", "1.1", "1.1-IV0", "2.0", "2.0-IV0", "2.0-IV1", "2.1", "2.1-IV0", "2.1-IV1", "2.1-IV2", "2.2", "2.2-IV0", "2.2-IV1", "2.3", "2.3-IV0", "2.3-IV1", "2.4", "2.4-IV0", "2.4-IV1", "2.5", "2.5-IV0", "2.6", "2.6-IV0", "2.7", "2.7-IV0", "2.7-IV1", "2.7-IV2", "2.8", "2.8-IV0", "2.8-IV1", "3.0", "3.0-IV0", "3.0-IV1", "3.1", "3.1-IV0", "3.2", "3.2-IV0", "3.3", "3.3-IV0", "3.3-IV1", "3.3-IV2", "3.3-IV3", "3.4", "3.4-IV0", "3.5", "3.5-IV0", "3.5-IV1", "3.5-IV2", "3.6", "3.6-IV0", "3.6-IV1", "3.6-IV2", "3.7", "3.7-IV0", "3.7-IV1", "3.7-IV2", "3.7-IV3", "3.7-IV4"} } type MessageOut struct { diff --git a/handler/mysql/mysql.go b/handler/mysql/mysql.go index f93c67b..0cc7bca 100644 --- a/handler/mysql/mysql.go +++ b/handler/mysql/mysql.go @@ -10,7 +10,7 @@ import ( type Handler interface { // MySQLServiceQueryStatistics fetch MySQL service query statistics - // POST /project/{project}/service/{service_name}/mysql/query/stats + // POST /v1/project/{project}/service/{service_name}/mysql/query/stats // https://api.aiven.io/doc/#tag/Service:_MySQL/operation/MySQLServiceQueryStatistics MySQLServiceQueryStatistics(ctx context.Context, project string, serviceName string, in *MySqlserviceQueryStatisticsIn) ([]QueryOut, error) } @@ -28,7 +28,7 @@ type MySQLHandler struct { } func (h *MySQLHandler) MySQLServiceQueryStatistics(ctx context.Context, project string, serviceName string, in *MySqlserviceQueryStatisticsIn) ([]QueryOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/mysql/query/stats", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/mysql/query/stats", project, serviceName) b, err := h.doer.Do(ctx, "MySQLServiceQueryStatistics", "POST", path, in) if err != nil { return nil, err diff --git a/handler/opensearch/opensearch.go b/handler/opensearch/opensearch.go index 0608ef4..157880d 100644 --- a/handler/opensearch/opensearch.go +++ b/handler/opensearch/opensearch.go @@ -11,42 +11,42 @@ import ( type Handler interface { // ServiceOpenSearchAclGet show OpenSearch ACL configuration - // GET /project/{project}/service/{service_name}/opensearch/acl + // GET /v1/project/{project}/service/{service_name}/opensearch/acl // https://api.aiven.io/doc/#tag/Service:_OpenSearch/operation/ServiceOpenSearchAclGet ServiceOpenSearchAclGet(ctx context.Context, project string, serviceName string) (*ServiceOpenSearchAclGetOut, error) // ServiceOpenSearchAclSet set OpenSearch ACL configuration - // POST /project/{project}/service/{service_name}/opensearch/acl + // POST /v1/project/{project}/service/{service_name}/opensearch/acl // https://api.aiven.io/doc/#tag/Service:_OpenSearch/operation/ServiceOpenSearchAclSet ServiceOpenSearchAclSet(ctx context.Context, project string, serviceName string, in *ServiceOpenSearchAclSetIn) (*ServiceOpenSearchAclSetOut, error) // ServiceOpenSearchAclUpdate update OpenSearch ACL configuration - // PUT /project/{project}/service/{service_name}/opensearch/acl + // PUT /v1/project/{project}/service/{service_name}/opensearch/acl // https://api.aiven.io/doc/#tag/Service:_OpenSearch/operation/ServiceOpenSearchAclUpdate ServiceOpenSearchAclUpdate(ctx context.Context, project string, serviceName string, in *ServiceOpenSearchAclUpdateIn) (*ServiceOpenSearchAclUpdateOut, error) // ServiceOpenSearchIndexDelete delete an OpenSearch index - // DELETE /project/{project}/service/{service_name}/index/{index_name} + // DELETE /v1/project/{project}/service/{service_name}/index/{index_name} // https://api.aiven.io/doc/#tag/Service:_OpenSearch/operation/ServiceOpenSearchIndexDelete ServiceOpenSearchIndexDelete(ctx context.Context, project string, serviceName string, indexName string) error // ServiceOpenSearchIndexList list OpenSearch indexes - // GET /project/{project}/service/{service_name}/index + // GET /v1/project/{project}/service/{service_name}/index // https://api.aiven.io/doc/#tag/Service:_OpenSearch/operation/ServiceOpenSearchIndexList ServiceOpenSearchIndexList(ctx context.Context, project string, serviceName string) ([]IndexeOut, error) // ServiceOpenSearchSecurityGet show OpenSearch security configuration status - // GET /project/{project}/service/{service_name}/opensearch/security + // GET /v1/project/{project}/service/{service_name}/opensearch/security // https://api.aiven.io/doc/#tag/Service:_OpenSearch/operation/ServiceOpenSearchSecurityGet ServiceOpenSearchSecurityGet(ctx context.Context, project string, serviceName string) (*ServiceOpenSearchSecurityGetOut, error) // ServiceOpenSearchSecurityReset change Opensearch Security Admin password - // PUT /project/{project}/service/{service_name}/opensearch/security/admin + // PUT /v1/project/{project}/service/{service_name}/opensearch/security/admin // https://api.aiven.io/doc/#tag/Service:_OpenSearch/operation/ServiceOpenSearchSecurityReset ServiceOpenSearchSecurityReset(ctx context.Context, project string, serviceName string, in *ServiceOpenSearchSecurityResetIn) (*ServiceOpenSearchSecurityResetOut, error) // ServiceOpenSearchSecuritySet enable Opensearch Security Admin by setting the password - // POST /project/{project}/service/{service_name}/opensearch/security/admin + // POST /v1/project/{project}/service/{service_name}/opensearch/security/admin // https://api.aiven.io/doc/#tag/Service:_OpenSearch/operation/ServiceOpenSearchSecuritySet ServiceOpenSearchSecuritySet(ctx context.Context, project string, serviceName string, in *ServiceOpenSearchSecuritySetIn) (*ServiceOpenSearchSecuritySetOut, error) } @@ -64,7 +64,7 @@ type OpenSearchHandler struct { } func (h *OpenSearchHandler) ServiceOpenSearchAclGet(ctx context.Context, project string, serviceName string) (*ServiceOpenSearchAclGetOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/opensearch/acl", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/opensearch/acl", project, serviceName) b, err := h.doer.Do(ctx, "ServiceOpenSearchAclGet", "GET", path, nil) if err != nil { return nil, err @@ -77,7 +77,7 @@ func (h *OpenSearchHandler) ServiceOpenSearchAclGet(ctx context.Context, project return &out.OpensearchAclConfig, nil } func (h *OpenSearchHandler) ServiceOpenSearchAclSet(ctx context.Context, project string, serviceName string, in *ServiceOpenSearchAclSetIn) (*ServiceOpenSearchAclSetOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/opensearch/acl", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/opensearch/acl", project, serviceName) b, err := h.doer.Do(ctx, "ServiceOpenSearchAclSet", "POST", path, in) if err != nil { return nil, err @@ -90,7 +90,7 @@ func (h *OpenSearchHandler) ServiceOpenSearchAclSet(ctx context.Context, project return &out.OpensearchAclConfig, nil } func (h *OpenSearchHandler) ServiceOpenSearchAclUpdate(ctx context.Context, project string, serviceName string, in *ServiceOpenSearchAclUpdateIn) (*ServiceOpenSearchAclUpdateOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/opensearch/acl", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/opensearch/acl", project, serviceName) b, err := h.doer.Do(ctx, "ServiceOpenSearchAclUpdate", "PUT", path, in) if err != nil { return nil, err @@ -103,12 +103,12 @@ func (h *OpenSearchHandler) ServiceOpenSearchAclUpdate(ctx context.Context, proj return &out.OpensearchAclConfig, nil } func (h *OpenSearchHandler) ServiceOpenSearchIndexDelete(ctx context.Context, project string, serviceName string, indexName string) error { - path := fmt.Sprintf("/project/%s/service/%s/index/%s", project, serviceName, indexName) + path := fmt.Sprintf("/v1/project/%s/service/%s/index/%s", project, serviceName, indexName) _, err := h.doer.Do(ctx, "ServiceOpenSearchIndexDelete", "DELETE", path, nil) return err } func (h *OpenSearchHandler) ServiceOpenSearchIndexList(ctx context.Context, project string, serviceName string) ([]IndexeOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/index", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/index", project, serviceName) b, err := h.doer.Do(ctx, "ServiceOpenSearchIndexList", "GET", path, nil) if err != nil { return nil, err @@ -121,7 +121,7 @@ func (h *OpenSearchHandler) ServiceOpenSearchIndexList(ctx context.Context, proj return out.Indexes, nil } func (h *OpenSearchHandler) ServiceOpenSearchSecurityGet(ctx context.Context, project string, serviceName string) (*ServiceOpenSearchSecurityGetOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/opensearch/security", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/opensearch/security", project, serviceName) b, err := h.doer.Do(ctx, "ServiceOpenSearchSecurityGet", "GET", path, nil) if err != nil { return nil, err @@ -134,7 +134,7 @@ func (h *OpenSearchHandler) ServiceOpenSearchSecurityGet(ctx context.Context, pr return out, nil } func (h *OpenSearchHandler) ServiceOpenSearchSecurityReset(ctx context.Context, project string, serviceName string, in *ServiceOpenSearchSecurityResetIn) (*ServiceOpenSearchSecurityResetOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/opensearch/security/admin", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/opensearch/security/admin", project, serviceName) b, err := h.doer.Do(ctx, "ServiceOpenSearchSecurityReset", "PUT", path, in) if err != nil { return nil, err @@ -147,7 +147,7 @@ func (h *OpenSearchHandler) ServiceOpenSearchSecurityReset(ctx context.Context, return out, nil } func (h *OpenSearchHandler) ServiceOpenSearchSecuritySet(ctx context.Context, project string, serviceName string, in *ServiceOpenSearchSecuritySetIn) (*ServiceOpenSearchSecuritySetOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/opensearch/security/admin", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/opensearch/security/admin", project, serviceName) b, err := h.doer.Do(ctx, "ServiceOpenSearchSecuritySet", "POST", path, in) if err != nil { return nil, err diff --git a/handler/organization/organization.go b/handler/organization/organization.go index eb87d46..3eac44c 100644 --- a/handler/organization/organization.go +++ b/handler/organization/organization.go @@ -11,37 +11,32 @@ import ( type Handler interface { // OrganizationAuthenticationConfigGet retrieve authentication configuration - // GET /organization/{organization_id}/config/authentication + // GET /v1/organization/{organization_id}/config/authentication // https://api.aiven.io/doc/#tag/Organizations/operation/OrganizationAuthenticationConfigGet OrganizationAuthenticationConfigGet(ctx context.Context, organizationId string) (*OrganizationAuthenticationConfigGetOut, error) // OrganizationAuthenticationConfigUpdate update authentication configuration - // PATCH /organization/{organization_id}/config/authentication + // PATCH /v1/organization/{organization_id}/config/authentication // https://api.aiven.io/doc/#tag/Organizations/operation/OrganizationAuthenticationConfigUpdate OrganizationAuthenticationConfigUpdate(ctx context.Context, organizationId string, in *OrganizationAuthenticationConfigUpdateIn) (*OrganizationAuthenticationConfigUpdateOut, error) // OrganizationGet get information about an organization - // GET /organization/{organization_id} + // GET /v1/organization/{organization_id} // https://api.aiven.io/doc/#tag/Organizations/operation/OrganizationGet OrganizationGet(ctx context.Context, organizationId string) (*OrganizationGetOut, error) - // OrganizationProjectsList list projects under the organization - // GET /organization/{organization_id}/projects - // https://api.aiven.io/doc/#tag/Organizations/operation/OrganizationProjectsList - OrganizationProjectsList(ctx context.Context, organizationId string) (*OrganizationProjectsListOut, error) - // OrganizationUpdate update organization's details - // PATCH /organization/{organization_id} + // PATCH /v1/organization/{organization_id} // https://api.aiven.io/doc/#tag/Organizations/operation/OrganizationUpdate OrganizationUpdate(ctx context.Context, organizationId string, in *OrganizationUpdateIn) (*OrganizationUpdateOut, error) // UserOrganizationCreate create an organization - // POST /organizations + // POST /v1/organizations // https://api.aiven.io/doc/#tag/Organizations/operation/UserOrganizationCreate UserOrganizationCreate(ctx context.Context, in *UserOrganizationCreateIn) (*UserOrganizationCreateOut, error) // UserOrganizationsList list organizations the user belongs to - // GET /organizations + // GET /v1/organizations // https://api.aiven.io/doc/#tag/Organizations/operation/UserOrganizationsList UserOrganizationsList(ctx context.Context) ([]OrganizationOut, error) } @@ -59,7 +54,7 @@ type OrganizationHandler struct { } func (h *OrganizationHandler) OrganizationAuthenticationConfigGet(ctx context.Context, organizationId string) (*OrganizationAuthenticationConfigGetOut, error) { - path := fmt.Sprintf("/organization/%s/config/authentication", organizationId) + path := fmt.Sprintf("/v1/organization/%s/config/authentication", organizationId) b, err := h.doer.Do(ctx, "OrganizationAuthenticationConfigGet", "GET", path, nil) if err != nil { return nil, err @@ -72,7 +67,7 @@ func (h *OrganizationHandler) OrganizationAuthenticationConfigGet(ctx context.Co return out, nil } func (h *OrganizationHandler) OrganizationAuthenticationConfigUpdate(ctx context.Context, organizationId string, in *OrganizationAuthenticationConfigUpdateIn) (*OrganizationAuthenticationConfigUpdateOut, error) { - path := fmt.Sprintf("/organization/%s/config/authentication", organizationId) + path := fmt.Sprintf("/v1/organization/%s/config/authentication", organizationId) b, err := h.doer.Do(ctx, "OrganizationAuthenticationConfigUpdate", "PATCH", path, in) if err != nil { return nil, err @@ -85,7 +80,7 @@ func (h *OrganizationHandler) OrganizationAuthenticationConfigUpdate(ctx context return out, nil } func (h *OrganizationHandler) OrganizationGet(ctx context.Context, organizationId string) (*OrganizationGetOut, error) { - path := fmt.Sprintf("/organization/%s", organizationId) + path := fmt.Sprintf("/v1/organization/%s", organizationId) b, err := h.doer.Do(ctx, "OrganizationGet", "GET", path, nil) if err != nil { return nil, err @@ -97,21 +92,8 @@ func (h *OrganizationHandler) OrganizationGet(ctx context.Context, organizationI } return out, nil } -func (h *OrganizationHandler) OrganizationProjectsList(ctx context.Context, organizationId string) (*OrganizationProjectsListOut, error) { - path := fmt.Sprintf("/organization/%s/projects", organizationId) - b, err := h.doer.Do(ctx, "OrganizationProjectsList", "GET", path, nil) - if err != nil { - return nil, err - } - out := new(OrganizationProjectsListOut) - err = json.Unmarshal(b, out) - if err != nil { - return nil, err - } - return out, nil -} func (h *OrganizationHandler) OrganizationUpdate(ctx context.Context, organizationId string, in *OrganizationUpdateIn) (*OrganizationUpdateOut, error) { - path := fmt.Sprintf("/organization/%s", organizationId) + path := fmt.Sprintf("/v1/organization/%s", organizationId) b, err := h.doer.Do(ctx, "OrganizationUpdate", "PATCH", path, in) if err != nil { return nil, err @@ -124,7 +106,7 @@ func (h *OrganizationHandler) OrganizationUpdate(ctx context.Context, organizati return out, nil } func (h *OrganizationHandler) UserOrganizationCreate(ctx context.Context, in *UserOrganizationCreateIn) (*UserOrganizationCreateOut, error) { - path := fmt.Sprintf("/organizations") + path := fmt.Sprintf("/v1/organizations") b, err := h.doer.Do(ctx, "UserOrganizationCreate", "POST", path, in) if err != nil { return nil, err @@ -137,7 +119,7 @@ func (h *OrganizationHandler) UserOrganizationCreate(ctx context.Context, in *Us return out, nil } func (h *OrganizationHandler) UserOrganizationsList(ctx context.Context) ([]OrganizationOut, error) { - path := fmt.Sprintf("/organizations") + path := fmt.Sprintf("/v1/organizations") b, err := h.doer.Do(ctx, "UserOrganizationsList", "GET", path, nil) if err != nil { return nil, err @@ -150,65 +132,32 @@ func (h *OrganizationHandler) UserOrganizationsList(ctx context.Context) ([]Orga return out.Organizations, nil } -type BillingCurrencyType string - -const ( - BillingCurrencyTypeAud BillingCurrencyType = "AUD" - BillingCurrencyTypeCad BillingCurrencyType = "CAD" - BillingCurrencyTypeChf BillingCurrencyType = "CHF" - BillingCurrencyTypeDkk BillingCurrencyType = "DKK" - BillingCurrencyTypeEur BillingCurrencyType = "EUR" - BillingCurrencyTypeGbp BillingCurrencyType = "GBP" - BillingCurrencyTypeJpy BillingCurrencyType = "JPY" - BillingCurrencyTypeNok BillingCurrencyType = "NOK" - BillingCurrencyTypeNzd BillingCurrencyType = "NZD" - BillingCurrencyTypeSek BillingCurrencyType = "SEK" - BillingCurrencyTypeSgd BillingCurrencyType = "SGD" - BillingCurrencyTypeUsd BillingCurrencyType = "USD" -) - -func BillingCurrencyTypeChoices() []string { - return []string{"AUD", "CAD", "CHF", "DKK", "EUR", "GBP", "JPY", "NOK", "NZD", "SEK", "SGD", "USD"} -} - -type BillingEmailOut struct { - Email string `json:"email"` -} -type CardInfoOut struct { - Brand string `json:"brand"` - CardId string `json:"card_id"` - Country string `json:"country"` - CountryCode string `json:"country_code"` - ExpMonth int `json:"exp_month"` - ExpYear int `json:"exp_year"` - Last4 string `json:"last4"` - Name string `json:"name"` - UserEmail string `json:"user_email"` -} -type ElasticsearchOut struct { - EolDate string `json:"eol_date"` - Version string `json:"version"` -} -type EndOfLifeExtensionOut struct { - Elasticsearch *ElasticsearchOut `json:"elasticsearch,omitempty"` -} type OrganizationAuthenticationConfigGetOut struct { - OauthEnabled *bool `json:"oauth_enabled,omitempty"` - PasswordAuthEnabled *bool `json:"password_auth_enabled,omitempty"` - SamlEnabled *bool `json:"saml_enabled,omitempty"` - TwoFactorRequired *bool `json:"two_factor_required,omitempty"` + OauthEnabled *bool `json:"oauth_enabled,omitempty"` + PasswordAuthEnabled *bool `json:"password_auth_enabled,omitempty"` + PersonalTokensEnabled *bool `json:"personal_tokens_enabled,omitempty"` + PersonalTokensRequireAllowedAuthMethod *bool `json:"personal_tokens_require_allowed_auth_method,omitempty"` + SamlAllowExternal *bool `json:"saml_allow_external,omitempty"` + SamlEnabled *bool `json:"saml_enabled,omitempty"` + TwoFactorRequired *bool `json:"two_factor_required,omitempty"` } type OrganizationAuthenticationConfigUpdateIn struct { - OauthEnabled *bool `json:"oauth_enabled,omitempty"` - PasswordAuthEnabled *bool `json:"password_auth_enabled,omitempty"` - SamlEnabled *bool `json:"saml_enabled,omitempty"` - TwoFactorRequired *bool `json:"two_factor_required,omitempty"` + OauthEnabled *bool `json:"oauth_enabled,omitempty"` + PasswordAuthEnabled *bool `json:"password_auth_enabled,omitempty"` + PersonalTokensEnabled *bool `json:"personal_tokens_enabled,omitempty"` + PersonalTokensRequireAllowedAuthMethod *bool `json:"personal_tokens_require_allowed_auth_method,omitempty"` + SamlAllowExternal *bool `json:"saml_allow_external,omitempty"` + SamlEnabled *bool `json:"saml_enabled,omitempty"` + TwoFactorRequired *bool `json:"two_factor_required,omitempty"` } type OrganizationAuthenticationConfigUpdateOut struct { - OauthEnabled *bool `json:"oauth_enabled,omitempty"` - PasswordAuthEnabled *bool `json:"password_auth_enabled,omitempty"` - SamlEnabled *bool `json:"saml_enabled,omitempty"` - TwoFactorRequired *bool `json:"two_factor_required,omitempty"` + OauthEnabled *bool `json:"oauth_enabled,omitempty"` + PasswordAuthEnabled *bool `json:"password_auth_enabled,omitempty"` + PersonalTokensEnabled *bool `json:"personal_tokens_enabled,omitempty"` + PersonalTokensRequireAllowedAuthMethod *bool `json:"personal_tokens_require_allowed_auth_method,omitempty"` + SamlAllowExternal *bool `json:"saml_allow_external,omitempty"` + SamlEnabled *bool `json:"saml_enabled,omitempty"` + TwoFactorRequired *bool `json:"two_factor_required,omitempty"` } type OrganizationGetOut struct { AccountId string `json:"account_id"` @@ -228,10 +177,6 @@ type OrganizationOut struct { Tier TierType `json:"tier"` UpdateTime time.Time `json:"update_time"` } -type OrganizationProjectsListOut struct { - Projects []ProjectOut `json:"projects"` - TotalProjectCount *int `json:"total_project_count,omitempty"` -} type OrganizationUpdateIn struct { DefaultGovernanceUserGroupId string `json:"default_governance_user_group_id,omitempty"` KafkaGovernanceEnabled *bool `json:"kafka_governance_enabled,omitempty"` @@ -247,41 +192,6 @@ type OrganizationUpdateOut struct { Tier TierType `json:"tier"` UpdateTime time.Time `json:"update_time"` } -type ProjectOut struct { - AccountId string `json:"account_id"` - AccountName string `json:"account_name,omitempty"` - AddressLines []string `json:"address_lines,omitempty"` - AvailableCredits string `json:"available_credits,omitempty"` - BillingAddress string `json:"billing_address"` - BillingCurrency BillingCurrencyType `json:"billing_currency,omitempty"` - BillingEmails []BillingEmailOut `json:"billing_emails"` - BillingExtraText string `json:"billing_extra_text,omitempty"` - BillingGroupId string `json:"billing_group_id"` - BillingGroupName string `json:"billing_group_name"` - CardInfo *CardInfoOut `json:"card_info,omitempty"` - City string `json:"city,omitempty"` - Company string `json:"company,omitempty"` - Country string `json:"country"` - CountryCode string `json:"country_code"` - DefaultCloud string `json:"default_cloud"` - EndOfLifeExtension *EndOfLifeExtensionOut `json:"end_of_life_extension,omitempty"` - EstimatedBalance string `json:"estimated_balance"` - EstimatedBalanceLocal string `json:"estimated_balance_local,omitempty"` - Features map[string]any `json:"features,omitempty"` - OrganizationId string `json:"organization_id"` - PaymentMethod string `json:"payment_method"` - ProjectName string `json:"project_name"` - State string `json:"state,omitempty"` - Tags map[string]string `json:"tags,omitempty"` - TechEmails []TechEmailOut `json:"tech_emails,omitempty"` - TenantId string `json:"tenant_id,omitempty"` - TrialExpirationTime *time.Time `json:"trial_expiration_time,omitempty"` - VatId string `json:"vat_id"` - ZipCode string `json:"zip_code,omitempty"` -} -type TechEmailOut struct { - Email string `json:"email"` -} type TierType string const ( diff --git a/handler/organizationuser/organizationuser.go b/handler/organizationuser/organizationuser.go index 6ce66e0..f373372 100644 --- a/handler/organizationuser/organizationuser.go +++ b/handler/organizationuser/organizationuser.go @@ -11,62 +11,62 @@ import ( type Handler interface { // OrganizationUserAuthenticationMethodsList list authentication methods for a user in the organization - // GET /organization/{organization_id}/user/{member_user_id}/authentication_methods + // GET /v1/organization/{organization_id}/user/{member_user_id}/authentication_methods // https://api.aiven.io/doc/#tag/Users/operation/OrganizationUserAuthenticationMethodsList OrganizationUserAuthenticationMethodsList(ctx context.Context, organizationId string, memberUserId string) ([]AuthenticationMethodOut, error) // OrganizationUserDelete remove a user from the organization - // DELETE /organization/{organization_id}/user/{member_user_id} + // DELETE /v1/organization/{organization_id}/user/{member_user_id} // https://api.aiven.io/doc/#tag/Users/operation/OrganizationUserDelete OrganizationUserDelete(ctx context.Context, organizationId string, memberUserId string) error // OrganizationUserGet get details on a user of the organization - // GET /organization/{organization_id}/user/{member_user_id} + // GET /v1/organization/{organization_id}/user/{member_user_id} // https://api.aiven.io/doc/#tag/Users/operation/OrganizationUserGet OrganizationUserGet(ctx context.Context, organizationId string, memberUserId string) (*OrganizationUserGetOut, error) // OrganizationUserInvitationAccept accept a user invitation to the organization - // POST /organization/{organization_id}/invitation/{user_email} + // POST /v1/organization/{organization_id}/invitation/{user_email} // https://api.aiven.io/doc/#tag/Organizations/operation/OrganizationUserInvitationAccept OrganizationUserInvitationAccept(ctx context.Context, organizationId string, userEmail string, in *OrganizationUserInvitationAcceptIn) error // OrganizationUserInvitationDelete remove an invitation to the organization - // DELETE /organization/{organization_id}/invitation/{user_email} + // DELETE /v1/organization/{organization_id}/invitation/{user_email} // https://api.aiven.io/doc/#tag/Organizations/operation/OrganizationUserInvitationDelete OrganizationUserInvitationDelete(ctx context.Context, organizationId string, userEmail string) error // OrganizationUserInvitationsList list user invitations to the organization - // GET /organization/{organization_id}/invitation + // GET /v1/organization/{organization_id}/invitation // https://api.aiven.io/doc/#tag/Organizations/operation/OrganizationUserInvitationsList OrganizationUserInvitationsList(ctx context.Context, organizationId string) ([]InvitationOut, error) // OrganizationUserInvite invite a user to the organization - // POST /organization/{organization_id}/invitation + // POST /v1/organization/{organization_id}/invitation // https://api.aiven.io/doc/#tag/Organizations/operation/OrganizationUserInvite OrganizationUserInvite(ctx context.Context, organizationId string, in *OrganizationUserInviteIn) error // OrganizationUserList list users of the organization - // GET /organization/{organization_id}/user + // GET /v1/organization/{organization_id}/user // https://api.aiven.io/doc/#tag/Users/operation/OrganizationUserList OrganizationUserList(ctx context.Context, organizationId string) ([]UserOut, error) // OrganizationUserPasswordReset reset the password of a managed user in the organization - // POST /organization/{organization_id}/user/{member_user_id}/reset_password + // POST /v1/organization/{organization_id}/user/{member_user_id}/reset_password // https://api.aiven.io/doc/#tag/Users/operation/OrganizationUserPasswordReset OrganizationUserPasswordReset(ctx context.Context, organizationId string, memberUserId string) error // OrganizationUserRevokeToken revoke the token of a managed user in the organization - // DELETE /organization/{organization_id}/user/{member_user_id}/access-token/{token_prefix} + // DELETE /v1/organization/{organization_id}/user/{member_user_id}/access-token/{token_prefix} // https://api.aiven.io/doc/#tag/Users/operation/OrganizationUserRevokeToken OrganizationUserRevokeToken(ctx context.Context, organizationId string, memberUserId string, tokenPrefix string) error // OrganizationUserTokensList list tokens from an organization's member - // GET /organization/{organization_id}/user/{member_user_id}/access-tokens + // GET /v1/organization/{organization_id}/user/{member_user_id}/access-tokens // https://api.aiven.io/doc/#tag/Users/operation/OrganizationUserTokensList OrganizationUserTokensList(ctx context.Context, organizationId string, memberUserId string) ([]TokenOut, error) // OrganizationUserUpdate update details on a user of the organization - // PATCH /organization/{organization_id}/user/{member_user_id} + // PATCH /v1/organization/{organization_id}/user/{member_user_id} // https://api.aiven.io/doc/#tag/Users/operation/OrganizationUserUpdate OrganizationUserUpdate(ctx context.Context, organizationId string, memberUserId string, in *OrganizationUserUpdateIn) (*OrganizationUserUpdateOut, error) } @@ -84,7 +84,7 @@ type OrganizationUserHandler struct { } func (h *OrganizationUserHandler) OrganizationUserAuthenticationMethodsList(ctx context.Context, organizationId string, memberUserId string) ([]AuthenticationMethodOut, error) { - path := fmt.Sprintf("/organization/%s/user/%s/authentication_methods", organizationId, memberUserId) + path := fmt.Sprintf("/v1/organization/%s/user/%s/authentication_methods", organizationId, memberUserId) b, err := h.doer.Do(ctx, "OrganizationUserAuthenticationMethodsList", "GET", path, nil) if err != nil { return nil, err @@ -97,12 +97,12 @@ func (h *OrganizationUserHandler) OrganizationUserAuthenticationMethodsList(ctx return out.AuthenticationMethods, nil } func (h *OrganizationUserHandler) OrganizationUserDelete(ctx context.Context, organizationId string, memberUserId string) error { - path := fmt.Sprintf("/organization/%s/user/%s", organizationId, memberUserId) + path := fmt.Sprintf("/v1/organization/%s/user/%s", organizationId, memberUserId) _, err := h.doer.Do(ctx, "OrganizationUserDelete", "DELETE", path, nil) return err } func (h *OrganizationUserHandler) OrganizationUserGet(ctx context.Context, organizationId string, memberUserId string) (*OrganizationUserGetOut, error) { - path := fmt.Sprintf("/organization/%s/user/%s", organizationId, memberUserId) + path := fmt.Sprintf("/v1/organization/%s/user/%s", organizationId, memberUserId) b, err := h.doer.Do(ctx, "OrganizationUserGet", "GET", path, nil) if err != nil { return nil, err @@ -115,17 +115,17 @@ func (h *OrganizationUserHandler) OrganizationUserGet(ctx context.Context, organ return out, nil } func (h *OrganizationUserHandler) OrganizationUserInvitationAccept(ctx context.Context, organizationId string, userEmail string, in *OrganizationUserInvitationAcceptIn) error { - path := fmt.Sprintf("/organization/%s/invitation/%s", organizationId, userEmail) + path := fmt.Sprintf("/v1/organization/%s/invitation/%s", organizationId, userEmail) _, err := h.doer.Do(ctx, "OrganizationUserInvitationAccept", "POST", path, in) return err } func (h *OrganizationUserHandler) OrganizationUserInvitationDelete(ctx context.Context, organizationId string, userEmail string) error { - path := fmt.Sprintf("/organization/%s/invitation/%s", organizationId, userEmail) + path := fmt.Sprintf("/v1/organization/%s/invitation/%s", organizationId, userEmail) _, err := h.doer.Do(ctx, "OrganizationUserInvitationDelete", "DELETE", path, nil) return err } func (h *OrganizationUserHandler) OrganizationUserInvitationsList(ctx context.Context, organizationId string) ([]InvitationOut, error) { - path := fmt.Sprintf("/organization/%s/invitation", organizationId) + path := fmt.Sprintf("/v1/organization/%s/invitation", organizationId) b, err := h.doer.Do(ctx, "OrganizationUserInvitationsList", "GET", path, nil) if err != nil { return nil, err @@ -138,12 +138,12 @@ func (h *OrganizationUserHandler) OrganizationUserInvitationsList(ctx context.Co return out.Invitations, nil } func (h *OrganizationUserHandler) OrganizationUserInvite(ctx context.Context, organizationId string, in *OrganizationUserInviteIn) error { - path := fmt.Sprintf("/organization/%s/invitation", organizationId) + path := fmt.Sprintf("/v1/organization/%s/invitation", organizationId) _, err := h.doer.Do(ctx, "OrganizationUserInvite", "POST", path, in) return err } func (h *OrganizationUserHandler) OrganizationUserList(ctx context.Context, organizationId string) ([]UserOut, error) { - path := fmt.Sprintf("/organization/%s/user", organizationId) + path := fmt.Sprintf("/v1/organization/%s/user", organizationId) b, err := h.doer.Do(ctx, "OrganizationUserList", "GET", path, nil) if err != nil { return nil, err @@ -156,17 +156,17 @@ func (h *OrganizationUserHandler) OrganizationUserList(ctx context.Context, orga return out.Users, nil } func (h *OrganizationUserHandler) OrganizationUserPasswordReset(ctx context.Context, organizationId string, memberUserId string) error { - path := fmt.Sprintf("/organization/%s/user/%s/reset_password", organizationId, memberUserId) + path := fmt.Sprintf("/v1/organization/%s/user/%s/reset_password", organizationId, memberUserId) _, err := h.doer.Do(ctx, "OrganizationUserPasswordReset", "POST", path, nil) return err } func (h *OrganizationUserHandler) OrganizationUserRevokeToken(ctx context.Context, organizationId string, memberUserId string, tokenPrefix string) error { - path := fmt.Sprintf("/organization/%s/user/%s/access-token/%s", organizationId, memberUserId, tokenPrefix) + path := fmt.Sprintf("/v1/organization/%s/user/%s/access-token/%s", organizationId, memberUserId, tokenPrefix) _, err := h.doer.Do(ctx, "OrganizationUserRevokeToken", "DELETE", path, nil) return err } func (h *OrganizationUserHandler) OrganizationUserTokensList(ctx context.Context, organizationId string, memberUserId string) ([]TokenOut, error) { - path := fmt.Sprintf("/organization/%s/user/%s/access-tokens", organizationId, memberUserId) + path := fmt.Sprintf("/v1/organization/%s/user/%s/access-tokens", organizationId, memberUserId) b, err := h.doer.Do(ctx, "OrganizationUserTokensList", "GET", path, nil) if err != nil { return nil, err @@ -179,7 +179,7 @@ func (h *OrganizationUserHandler) OrganizationUserTokensList(ctx context.Context return out.Tokens, nil } func (h *OrganizationUserHandler) OrganizationUserUpdate(ctx context.Context, organizationId string, memberUserId string, in *OrganizationUserUpdateIn) (*OrganizationUserUpdateOut, error) { - path := fmt.Sprintf("/organization/%s/user/%s", organizationId, memberUserId) + path := fmt.Sprintf("/v1/organization/%s/user/%s", organizationId, memberUserId) b, err := h.doer.Do(ctx, "OrganizationUserUpdate", "PATCH", path, in) if err != nil { return nil, err diff --git a/handler/postgresql/postgresql.go b/handler/postgresql/postgresql.go index 4440994..8065ec5 100644 --- a/handler/postgresql/postgresql.go +++ b/handler/postgresql/postgresql.go @@ -10,32 +10,32 @@ import ( type Handler interface { // PGServiceAvailableExtensions list PostgreSQL extensions that can be loaded with CREATE EXTENSION in this service - // GET /project/{project}/service/{service_name}/pg/available-extensions + // GET /v1/project/{project}/service/{service_name}/pg/available-extensions // https://api.aiven.io/doc/#tag/Service:_PostgreSQL/operation/PGServiceAvailableExtensions PGServiceAvailableExtensions(ctx context.Context, project string, serviceName string) ([]ExtensionOut, error) // PGServiceQueryStatistics fetch PostgreSQL service query statistics - // POST /project/{project}/service/{service_name}/pg/query/stats + // POST /v1/project/{project}/service/{service_name}/pg/query/stats // https://api.aiven.io/doc/#tag/Service:_PostgreSQL/operation/PGServiceQueryStatistics PGServiceQueryStatistics(ctx context.Context, project string, serviceName string, in *PgserviceQueryStatisticsIn) ([]QueryOut, error) // PgAvailableExtensions list PostgreSQL extensions available for this tenant grouped by PG version - // GET /tenants/{tenant}/pg-available-extensions + // GET /v1/tenants/{tenant}/pg-available-extensions // https://api.aiven.io/doc/#tag/Service/operation/PgAvailableExtensions PgAvailableExtensions(ctx context.Context, tenant string) ([]PgOut, error) // ServicePGBouncerCreate create a new connection pool for service - // POST /project/{project}/service/{service_name}/connection_pool + // POST /v1/project/{project}/service/{service_name}/connection_pool // https://api.aiven.io/doc/#tag/Service:_PostgreSQL/operation/ServicePGBouncerCreate ServicePGBouncerCreate(ctx context.Context, project string, serviceName string, in *ServicePgbouncerCreateIn) error // ServicePGBouncerDelete delete a connection pool - // DELETE /project/{project}/service/{service_name}/connection_pool/{pool_name} + // DELETE /v1/project/{project}/service/{service_name}/connection_pool/{pool_name} // https://api.aiven.io/doc/#tag/Service:_PostgreSQL/operation/ServicePGBouncerDelete ServicePGBouncerDelete(ctx context.Context, project string, serviceName string, poolName string) error // ServicePGBouncerUpdate update a connection pool - // PUT /project/{project}/service/{service_name}/connection_pool/{pool_name} + // PUT /v1/project/{project}/service/{service_name}/connection_pool/{pool_name} // https://api.aiven.io/doc/#tag/Service:_PostgreSQL/operation/ServicePGBouncerUpdate ServicePGBouncerUpdate(ctx context.Context, project string, serviceName string, poolName string, in *ServicePgbouncerUpdateIn) error } @@ -53,7 +53,7 @@ type PostgreSQLHandler struct { } func (h *PostgreSQLHandler) PGServiceAvailableExtensions(ctx context.Context, project string, serviceName string) ([]ExtensionOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/pg/available-extensions", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/pg/available-extensions", project, serviceName) b, err := h.doer.Do(ctx, "PGServiceAvailableExtensions", "GET", path, nil) if err != nil { return nil, err @@ -66,7 +66,7 @@ func (h *PostgreSQLHandler) PGServiceAvailableExtensions(ctx context.Context, pr return out.Extensions, nil } func (h *PostgreSQLHandler) PGServiceQueryStatistics(ctx context.Context, project string, serviceName string, in *PgserviceQueryStatisticsIn) ([]QueryOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/pg/query/stats", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/pg/query/stats", project, serviceName) b, err := h.doer.Do(ctx, "PGServiceQueryStatistics", "POST", path, in) if err != nil { return nil, err @@ -79,7 +79,7 @@ func (h *PostgreSQLHandler) PGServiceQueryStatistics(ctx context.Context, projec return out.Queries, nil } func (h *PostgreSQLHandler) PgAvailableExtensions(ctx context.Context, tenant string) ([]PgOut, error) { - path := fmt.Sprintf("/tenants/%s/pg-available-extensions", tenant) + path := fmt.Sprintf("/v1/tenants/%s/pg-available-extensions", tenant) b, err := h.doer.Do(ctx, "PgAvailableExtensions", "GET", path, nil) if err != nil { return nil, err @@ -92,17 +92,17 @@ func (h *PostgreSQLHandler) PgAvailableExtensions(ctx context.Context, tenant st return out.Pg, nil } func (h *PostgreSQLHandler) ServicePGBouncerCreate(ctx context.Context, project string, serviceName string, in *ServicePgbouncerCreateIn) error { - path := fmt.Sprintf("/project/%s/service/%s/connection_pool", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/connection_pool", project, serviceName) _, err := h.doer.Do(ctx, "ServicePGBouncerCreate", "POST", path, in) return err } func (h *PostgreSQLHandler) ServicePGBouncerDelete(ctx context.Context, project string, serviceName string, poolName string) error { - path := fmt.Sprintf("/project/%s/service/%s/connection_pool/%s", project, serviceName, poolName) + path := fmt.Sprintf("/v1/project/%s/service/%s/connection_pool/%s", project, serviceName, poolName) _, err := h.doer.Do(ctx, "ServicePGBouncerDelete", "DELETE", path, nil) return err } func (h *PostgreSQLHandler) ServicePGBouncerUpdate(ctx context.Context, project string, serviceName string, poolName string, in *ServicePgbouncerUpdateIn) error { - path := fmt.Sprintf("/project/%s/service/%s/connection_pool/%s", project, serviceName, poolName) + path := fmt.Sprintf("/v1/project/%s/service/%s/connection_pool/%s", project, serviceName, poolName) _, err := h.doer.Do(ctx, "ServicePGBouncerUpdate", "PUT", path, in) return err } diff --git a/handler/privatelink/privatelink.go b/handler/privatelink/privatelink.go index 6af0012..22e3255 100644 --- a/handler/privatelink/privatelink.go +++ b/handler/privatelink/privatelink.go @@ -10,67 +10,67 @@ import ( type Handler interface { // PublicPrivatelinkAvailabilityList list privatelink clouds and prices - // GET /tenants/{tenant}/privatelink-availability + // GET /v1/tenants/{tenant}/privatelink-availability // https://api.aiven.io/doc/#tag/Cloud_platforms/operation/PublicPrivatelinkAvailabilityList PublicPrivatelinkAvailabilityList(ctx context.Context, tenant string) ([]PrivatelinkAvailabilityOut, error) // ServicePrivatelinkAWSConnectionList list VPC Endpoint connections for an AWS Privatelink Endpoint Service - // GET /project/{project}/service/{service_name}/privatelink/aws/connections + // GET /v1/project/{project}/service/{service_name}/privatelink/aws/connections // https://api.aiven.io/doc/#tag/Service/operation/ServicePrivatelinkAWSConnectionList ServicePrivatelinkAWSConnectionList(ctx context.Context, project string, serviceName string) ([]ConnectionOut, error) // ServicePrivatelinkAWSCreate create an AWS Privatelink Endpoint Service - // POST /project/{project}/service/{service_name}/privatelink/aws + // POST /v1/project/{project}/service/{service_name}/privatelink/aws // https://api.aiven.io/doc/#tag/Service/operation/ServicePrivatelinkAWSCreate ServicePrivatelinkAWSCreate(ctx context.Context, project string, serviceName string, in *ServicePrivatelinkAwscreateIn) (*ServicePrivatelinkAwscreateOut, error) // ServicePrivatelinkAWSDelete delete an AWS Privatelink Endpoint Service - // DELETE /project/{project}/service/{service_name}/privatelink/aws + // DELETE /v1/project/{project}/service/{service_name}/privatelink/aws // https://api.aiven.io/doc/#tag/Service/operation/ServicePrivatelinkAWSDelete ServicePrivatelinkAWSDelete(ctx context.Context, project string, serviceName string) (*ServicePrivatelinkAwsdeleteOut, error) // ServicePrivatelinkAWSGet get AWS Privatelink Endpoint Service information - // GET /project/{project}/service/{service_name}/privatelink/aws + // GET /v1/project/{project}/service/{service_name}/privatelink/aws // https://api.aiven.io/doc/#tag/Service/operation/ServicePrivatelinkAWSGet ServicePrivatelinkAWSGet(ctx context.Context, project string, serviceName string) (*ServicePrivatelinkAwsgetOut, error) // ServicePrivatelinkAWSUpdate update an AWS Privatelink Endpoint Service - // PUT /project/{project}/service/{service_name}/privatelink/aws + // PUT /v1/project/{project}/service/{service_name}/privatelink/aws // https://api.aiven.io/doc/#tag/Service/operation/ServicePrivatelinkAWSUpdate ServicePrivatelinkAWSUpdate(ctx context.Context, project string, serviceName string, in *ServicePrivatelinkAwsupdateIn) (*ServicePrivatelinkAwsupdateOut, error) // ServicePrivatelinkAzureConnectionApproval approve an Azure private endpoint connection pending user approval - // POST /project/{project}/service/{service_name}/privatelink/azure/connections/{privatelink_connection_id}/approve + // POST /v1/project/{project}/service/{service_name}/privatelink/azure/connections/{privatelink_connection_id}/approve // https://api.aiven.io/doc/#tag/Service/operation/ServicePrivatelinkAzureConnectionApproval ServicePrivatelinkAzureConnectionApproval(ctx context.Context, project string, serviceName string, privatelinkConnectionId string) (*ServicePrivatelinkAzureConnectionApprovalOut, error) // ServicePrivatelinkAzureConnectionList list private endpoint connections for an Azure Privatelink Service - // GET /project/{project}/service/{service_name}/privatelink/azure/connections + // GET /v1/project/{project}/service/{service_name}/privatelink/azure/connections // https://api.aiven.io/doc/#tag/Service/operation/ServicePrivatelinkAzureConnectionList ServicePrivatelinkAzureConnectionList(ctx context.Context, project string, serviceName string) ([]ConnectionOutAlt, error) // ServicePrivatelinkAzureConnectionUpdate update a private endpoint connection for an Azure Privatelink Service - // PUT /project/{project}/service/{service_name}/privatelink/azure/connections/{privatelink_connection_id} + // PUT /v1/project/{project}/service/{service_name}/privatelink/azure/connections/{privatelink_connection_id} // https://api.aiven.io/doc/#tag/Service/operation/ServicePrivatelinkAzureConnectionUpdate ServicePrivatelinkAzureConnectionUpdate(ctx context.Context, project string, serviceName string, privatelinkConnectionId string, in *ServicePrivatelinkAzureConnectionUpdateIn) (*ServicePrivatelinkAzureConnectionUpdateOut, error) // ServicePrivatelinkAzureCreate create an Azure Privatelink Service - // POST /project/{project}/service/{service_name}/privatelink/azure + // POST /v1/project/{project}/service/{service_name}/privatelink/azure // https://api.aiven.io/doc/#tag/Service/operation/ServicePrivatelinkAzureCreate ServicePrivatelinkAzureCreate(ctx context.Context, project string, serviceName string, in *ServicePrivatelinkAzureCreateIn) (*ServicePrivatelinkAzureCreateOut, error) // ServicePrivatelinkAzureDelete delete an Azure Privatelink Service - // DELETE /project/{project}/service/{service_name}/privatelink/azure + // DELETE /v1/project/{project}/service/{service_name}/privatelink/azure // https://api.aiven.io/doc/#tag/Service/operation/ServicePrivatelinkAzureDelete ServicePrivatelinkAzureDelete(ctx context.Context, project string, serviceName string) (*ServicePrivatelinkAzureDeleteOut, error) // ServicePrivatelinkAzureGet get Azure Privatelink Service information - // GET /project/{project}/service/{service_name}/privatelink/azure + // GET /v1/project/{project}/service/{service_name}/privatelink/azure // https://api.aiven.io/doc/#tag/Service/operation/ServicePrivatelinkAzureGet ServicePrivatelinkAzureGet(ctx context.Context, project string, serviceName string) (*ServicePrivatelinkAzureGetOut, error) // ServicePrivatelinkAzureUpdate update an Azure Privatelink Service - // PUT /project/{project}/service/{service_name}/privatelink/azure + // PUT /v1/project/{project}/service/{service_name}/privatelink/azure // https://api.aiven.io/doc/#tag/Service/operation/ServicePrivatelinkAzureUpdate ServicePrivatelinkAzureUpdate(ctx context.Context, project string, serviceName string, in *ServicePrivatelinkAzureUpdateIn) (*ServicePrivatelinkAzureUpdateOut, error) } @@ -88,7 +88,7 @@ type PrivatelinkHandler struct { } func (h *PrivatelinkHandler) PublicPrivatelinkAvailabilityList(ctx context.Context, tenant string) ([]PrivatelinkAvailabilityOut, error) { - path := fmt.Sprintf("/tenants/%s/privatelink-availability", tenant) + path := fmt.Sprintf("/v1/tenants/%s/privatelink-availability", tenant) b, err := h.doer.Do(ctx, "PublicPrivatelinkAvailabilityList", "GET", path, nil) if err != nil { return nil, err @@ -101,7 +101,7 @@ func (h *PrivatelinkHandler) PublicPrivatelinkAvailabilityList(ctx context.Conte return out.PrivatelinkAvailability, nil } func (h *PrivatelinkHandler) ServicePrivatelinkAWSConnectionList(ctx context.Context, project string, serviceName string) ([]ConnectionOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/privatelink/aws/connections", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/privatelink/aws/connections", project, serviceName) b, err := h.doer.Do(ctx, "ServicePrivatelinkAWSConnectionList", "GET", path, nil) if err != nil { return nil, err @@ -114,7 +114,7 @@ func (h *PrivatelinkHandler) ServicePrivatelinkAWSConnectionList(ctx context.Con return out.Connections, nil } func (h *PrivatelinkHandler) ServicePrivatelinkAWSCreate(ctx context.Context, project string, serviceName string, in *ServicePrivatelinkAwscreateIn) (*ServicePrivatelinkAwscreateOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/privatelink/aws", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/privatelink/aws", project, serviceName) b, err := h.doer.Do(ctx, "ServicePrivatelinkAWSCreate", "POST", path, in) if err != nil { return nil, err @@ -127,7 +127,7 @@ func (h *PrivatelinkHandler) ServicePrivatelinkAWSCreate(ctx context.Context, pr return out, nil } func (h *PrivatelinkHandler) ServicePrivatelinkAWSDelete(ctx context.Context, project string, serviceName string) (*ServicePrivatelinkAwsdeleteOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/privatelink/aws", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/privatelink/aws", project, serviceName) b, err := h.doer.Do(ctx, "ServicePrivatelinkAWSDelete", "DELETE", path, nil) if err != nil { return nil, err @@ -140,7 +140,7 @@ func (h *PrivatelinkHandler) ServicePrivatelinkAWSDelete(ctx context.Context, pr return out, nil } func (h *PrivatelinkHandler) ServicePrivatelinkAWSGet(ctx context.Context, project string, serviceName string) (*ServicePrivatelinkAwsgetOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/privatelink/aws", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/privatelink/aws", project, serviceName) b, err := h.doer.Do(ctx, "ServicePrivatelinkAWSGet", "GET", path, nil) if err != nil { return nil, err @@ -153,7 +153,7 @@ func (h *PrivatelinkHandler) ServicePrivatelinkAWSGet(ctx context.Context, proje return out, nil } func (h *PrivatelinkHandler) ServicePrivatelinkAWSUpdate(ctx context.Context, project string, serviceName string, in *ServicePrivatelinkAwsupdateIn) (*ServicePrivatelinkAwsupdateOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/privatelink/aws", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/privatelink/aws", project, serviceName) b, err := h.doer.Do(ctx, "ServicePrivatelinkAWSUpdate", "PUT", path, in) if err != nil { return nil, err @@ -166,7 +166,7 @@ func (h *PrivatelinkHandler) ServicePrivatelinkAWSUpdate(ctx context.Context, pr return out, nil } func (h *PrivatelinkHandler) ServicePrivatelinkAzureConnectionApproval(ctx context.Context, project string, serviceName string, privatelinkConnectionId string) (*ServicePrivatelinkAzureConnectionApprovalOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/privatelink/azure/connections/%s/approve", project, serviceName, privatelinkConnectionId) + path := fmt.Sprintf("/v1/project/%s/service/%s/privatelink/azure/connections/%s/approve", project, serviceName, privatelinkConnectionId) b, err := h.doer.Do(ctx, "ServicePrivatelinkAzureConnectionApproval", "POST", path, nil) if err != nil { return nil, err @@ -179,7 +179,7 @@ func (h *PrivatelinkHandler) ServicePrivatelinkAzureConnectionApproval(ctx conte return out, nil } func (h *PrivatelinkHandler) ServicePrivatelinkAzureConnectionList(ctx context.Context, project string, serviceName string) ([]ConnectionOutAlt, error) { - path := fmt.Sprintf("/project/%s/service/%s/privatelink/azure/connections", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/privatelink/azure/connections", project, serviceName) b, err := h.doer.Do(ctx, "ServicePrivatelinkAzureConnectionList", "GET", path, nil) if err != nil { return nil, err @@ -192,7 +192,7 @@ func (h *PrivatelinkHandler) ServicePrivatelinkAzureConnectionList(ctx context.C return out.Connections, nil } func (h *PrivatelinkHandler) ServicePrivatelinkAzureConnectionUpdate(ctx context.Context, project string, serviceName string, privatelinkConnectionId string, in *ServicePrivatelinkAzureConnectionUpdateIn) (*ServicePrivatelinkAzureConnectionUpdateOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/privatelink/azure/connections/%s", project, serviceName, privatelinkConnectionId) + path := fmt.Sprintf("/v1/project/%s/service/%s/privatelink/azure/connections/%s", project, serviceName, privatelinkConnectionId) b, err := h.doer.Do(ctx, "ServicePrivatelinkAzureConnectionUpdate", "PUT", path, in) if err != nil { return nil, err @@ -205,7 +205,7 @@ func (h *PrivatelinkHandler) ServicePrivatelinkAzureConnectionUpdate(ctx context return out, nil } func (h *PrivatelinkHandler) ServicePrivatelinkAzureCreate(ctx context.Context, project string, serviceName string, in *ServicePrivatelinkAzureCreateIn) (*ServicePrivatelinkAzureCreateOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/privatelink/azure", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/privatelink/azure", project, serviceName) b, err := h.doer.Do(ctx, "ServicePrivatelinkAzureCreate", "POST", path, in) if err != nil { return nil, err @@ -218,7 +218,7 @@ func (h *PrivatelinkHandler) ServicePrivatelinkAzureCreate(ctx context.Context, return out, nil } func (h *PrivatelinkHandler) ServicePrivatelinkAzureDelete(ctx context.Context, project string, serviceName string) (*ServicePrivatelinkAzureDeleteOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/privatelink/azure", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/privatelink/azure", project, serviceName) b, err := h.doer.Do(ctx, "ServicePrivatelinkAzureDelete", "DELETE", path, nil) if err != nil { return nil, err @@ -231,7 +231,7 @@ func (h *PrivatelinkHandler) ServicePrivatelinkAzureDelete(ctx context.Context, return out, nil } func (h *PrivatelinkHandler) ServicePrivatelinkAzureGet(ctx context.Context, project string, serviceName string) (*ServicePrivatelinkAzureGetOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/privatelink/azure", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/privatelink/azure", project, serviceName) b, err := h.doer.Do(ctx, "ServicePrivatelinkAzureGet", "GET", path, nil) if err != nil { return nil, err @@ -244,7 +244,7 @@ func (h *PrivatelinkHandler) ServicePrivatelinkAzureGet(ctx context.Context, pro return out, nil } func (h *PrivatelinkHandler) ServicePrivatelinkAzureUpdate(ctx context.Context, project string, serviceName string, in *ServicePrivatelinkAzureUpdateIn) (*ServicePrivatelinkAzureUpdateOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/privatelink/azure", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/privatelink/azure", project, serviceName) b, err := h.doer.Do(ctx, "ServicePrivatelinkAzureUpdate", "PUT", path, in) if err != nil { return nil, err diff --git a/handler/project/project.go b/handler/project/project.go index c900862..08571d1 100644 --- a/handler/project/project.go +++ b/handler/project/project.go @@ -11,102 +11,102 @@ import ( type Handler interface { // ListProjectVpcPeeringConnectionTypes list VPC peering connection types for a project - // GET /project/{project}/vpc-peering-connection-types + // GET /v1/project/{project}/vpc-peering-connection-types // https://api.aiven.io/doc/#tag/Project/operation/ListProjectVpcPeeringConnectionTypes ListProjectVpcPeeringConnectionTypes(ctx context.Context, project string) ([]VpcPeeringConnectionTypeOut, error) // ProjectAlertsList list active alerts for a project - // GET /project/{project}/alerts + // GET /v1/project/{project}/alerts // https://api.aiven.io/doc/#tag/Project/operation/ProjectAlertsList ProjectAlertsList(ctx context.Context, project string) ([]AlertOut, error) // ProjectCreate create a project - // POST /project + // POST /v1/project // https://api.aiven.io/doc/#tag/Project/operation/ProjectCreate ProjectCreate(ctx context.Context, in *ProjectCreateIn) (*ProjectCreateOut, error) // ProjectDelete delete project - // DELETE /project/{project} + // DELETE /v1/project/{project} // https://api.aiven.io/doc/#tag/Project/operation/ProjectDelete ProjectDelete(ctx context.Context, project string) error // ProjectGenerateSbomDownloadUrl generate SBOM for project - // GET /project/{project}/generate-sbom-download-url/{file_format} + // GET /v1/project/{project}/generate-sbom-download-url/{file_format} // https://api.aiven.io/doc/#tag/Project/operation/ProjectGenerateSbomDownloadUrl ProjectGenerateSbomDownloadUrl(ctx context.Context, project string, fileFormat string) (string, error) // ProjectGet get project details - // GET /project/{project} + // GET /v1/project/{project} // https://api.aiven.io/doc/#tag/Project/operation/ProjectGet ProjectGet(ctx context.Context, project string) (*ProjectGetOut, error) // ProjectGetEventLogs get project event log entries - // GET /project/{project}/events + // GET /v1/project/{project}/events // https://api.aiven.io/doc/#tag/Project/operation/ProjectGetEventLogs ProjectGetEventLogs(ctx context.Context, project string) ([]EventOut, error) // ProjectInvite send project membership invitation - // POST /project/{project}/invite + // POST /v1/project/{project}/invite // https://api.aiven.io/doc/#tag/Project/operation/ProjectInvite ProjectInvite(ctx context.Context, project string, in *ProjectInviteIn) error // ProjectInviteAccept confirm project invite - // POST /project/{project}/invite/{invite_verification_code} + // POST /v1/project/{project}/invite/{invite_verification_code} // https://api.aiven.io/doc/#tag/Project/operation/ProjectInviteAccept ProjectInviteAccept(ctx context.Context, project string, inviteVerificationCode string) (*ProjectInviteAcceptOut, error) // ProjectInviteDelete delete an invitation to a project - // DELETE /project/{project}/invite/{invited_email} + // DELETE /v1/project/{project}/invite/{invited_email} // https://api.aiven.io/doc/#tag/Project/operation/ProjectInviteDelete ProjectInviteDelete(ctx context.Context, project string, invitedEmail string) error // ProjectKmsGetCA retrieve project CA certificate - // GET /project/{project}/kms/ca + // GET /v1/project/{project}/kms/ca // https://api.aiven.io/doc/#tag/Project_Key_Management/operation/ProjectKmsGetCA ProjectKmsGetCA(ctx context.Context, project string) (string, error) // ProjectList list projects - // GET /project + // GET /v1/project // https://api.aiven.io/doc/#tag/Project/operation/ProjectList ProjectList(ctx context.Context) (*ProjectListOut, error) // ProjectPrivatelinkAvailabilityList list Privatelink cloud availability and prices for a project - // GET /project/{project}/privatelink-availability + // GET /v1/project/{project}/privatelink-availability // https://api.aiven.io/doc/#tag/Project/operation/ProjectPrivatelinkAvailabilityList ProjectPrivatelinkAvailabilityList(ctx context.Context, project string) ([]PrivatelinkAvailabilityOut, error) // ProjectTagsList list all tags attached to this project - // GET /project/{project}/tags + // GET /v1/project/{project}/tags // https://api.aiven.io/doc/#tag/Project/operation/ProjectTagsList ProjectTagsList(ctx context.Context, project string) (map[string]string, error) // ProjectTagsReplace replace all project tags with a new set of tags, deleting old ones - // PUT /project/{project}/tags + // PUT /v1/project/{project}/tags // https://api.aiven.io/doc/#tag/Project/operation/ProjectTagsReplace ProjectTagsReplace(ctx context.Context, project string, in *ProjectTagsReplaceIn) error // ProjectTagsUpdate update one or more tags, creating ones that don't exist, and deleting ones given NULL value - // PATCH /project/{project}/tags + // PATCH /v1/project/{project}/tags // https://api.aiven.io/doc/#tag/Project/operation/ProjectTagsUpdate ProjectTagsUpdate(ctx context.Context, project string, in *ProjectTagsUpdateIn) error // ProjectUpdate update project - // PUT /project/{project} + // PUT /v1/project/{project} // https://api.aiven.io/doc/#tag/Project/operation/ProjectUpdate ProjectUpdate(ctx context.Context, project string, in *ProjectUpdateIn) (*ProjectUpdateOut, error) // ProjectUserList list users with access to the project. May contain same user multiple times if they belong to multiple teams associated to the project - // GET /project/{project}/users + // GET /v1/project/{project}/users // https://api.aiven.io/doc/#tag/Project/operation/ProjectUserList ProjectUserList(ctx context.Context, project string) (*ProjectUserListOut, error) // ProjectUserRemove remove user from the project - // DELETE /project/{project}/user/{user_email} + // DELETE /v1/project/{project}/user/{user_email} // https://api.aiven.io/doc/#tag/Project/operation/ProjectUserRemove ProjectUserRemove(ctx context.Context, project string, userEmail string) error // ProjectUserUpdate update a project user - // PUT /project/{project}/user/{user_email} + // PUT /v1/project/{project}/user/{user_email} // https://api.aiven.io/doc/#tag/Project/operation/ProjectUserUpdate ProjectUserUpdate(ctx context.Context, project string, userEmail string, in *ProjectUserUpdateIn) error } @@ -124,7 +124,7 @@ type ProjectHandler struct { } func (h *ProjectHandler) ListProjectVpcPeeringConnectionTypes(ctx context.Context, project string) ([]VpcPeeringConnectionTypeOut, error) { - path := fmt.Sprintf("/project/%s/vpc-peering-connection-types", project) + path := fmt.Sprintf("/v1/project/%s/vpc-peering-connection-types", project) b, err := h.doer.Do(ctx, "ListProjectVpcPeeringConnectionTypes", "GET", path, nil) if err != nil { return nil, err @@ -137,7 +137,7 @@ func (h *ProjectHandler) ListProjectVpcPeeringConnectionTypes(ctx context.Contex return out.VpcPeeringConnectionTypes, nil } func (h *ProjectHandler) ProjectAlertsList(ctx context.Context, project string) ([]AlertOut, error) { - path := fmt.Sprintf("/project/%s/alerts", project) + path := fmt.Sprintf("/v1/project/%s/alerts", project) b, err := h.doer.Do(ctx, "ProjectAlertsList", "GET", path, nil) if err != nil { return nil, err @@ -150,7 +150,7 @@ func (h *ProjectHandler) ProjectAlertsList(ctx context.Context, project string) return out.Alerts, nil } func (h *ProjectHandler) ProjectCreate(ctx context.Context, in *ProjectCreateIn) (*ProjectCreateOut, error) { - path := fmt.Sprintf("/project") + path := fmt.Sprintf("/v1/project") b, err := h.doer.Do(ctx, "ProjectCreate", "POST", path, in) if err != nil { return nil, err @@ -163,12 +163,12 @@ func (h *ProjectHandler) ProjectCreate(ctx context.Context, in *ProjectCreateIn) return &out.Project, nil } func (h *ProjectHandler) ProjectDelete(ctx context.Context, project string) error { - path := fmt.Sprintf("/project/%s", project) + path := fmt.Sprintf("/v1/project/%s", project) _, err := h.doer.Do(ctx, "ProjectDelete", "DELETE", path, nil) return err } func (h *ProjectHandler) ProjectGenerateSbomDownloadUrl(ctx context.Context, project string, fileFormat string) (string, error) { - path := fmt.Sprintf("/project/%s/generate-sbom-download-url/%s", project, fileFormat) + path := fmt.Sprintf("/v1/project/%s/generate-sbom-download-url/%s", project, fileFormat) b, err := h.doer.Do(ctx, "ProjectGenerateSbomDownloadUrl", "GET", path, nil) if err != nil { return "", err @@ -181,7 +181,7 @@ func (h *ProjectHandler) ProjectGenerateSbomDownloadUrl(ctx context.Context, pro return out.DownloadUrl, nil } func (h *ProjectHandler) ProjectGet(ctx context.Context, project string) (*ProjectGetOut, error) { - path := fmt.Sprintf("/project/%s", project) + path := fmt.Sprintf("/v1/project/%s", project) b, err := h.doer.Do(ctx, "ProjectGet", "GET", path, nil) if err != nil { return nil, err @@ -194,7 +194,7 @@ func (h *ProjectHandler) ProjectGet(ctx context.Context, project string) (*Proje return &out.Project, nil } func (h *ProjectHandler) ProjectGetEventLogs(ctx context.Context, project string) ([]EventOut, error) { - path := fmt.Sprintf("/project/%s/events", project) + path := fmt.Sprintf("/v1/project/%s/events", project) b, err := h.doer.Do(ctx, "ProjectGetEventLogs", "GET", path, nil) if err != nil { return nil, err @@ -207,12 +207,12 @@ func (h *ProjectHandler) ProjectGetEventLogs(ctx context.Context, project string return out.Events, nil } func (h *ProjectHandler) ProjectInvite(ctx context.Context, project string, in *ProjectInviteIn) error { - path := fmt.Sprintf("/project/%s/invite", project) + path := fmt.Sprintf("/v1/project/%s/invite", project) _, err := h.doer.Do(ctx, "ProjectInvite", "POST", path, in) return err } func (h *ProjectHandler) ProjectInviteAccept(ctx context.Context, project string, inviteVerificationCode string) (*ProjectInviteAcceptOut, error) { - path := fmt.Sprintf("/project/%s/invite/%s", project, inviteVerificationCode) + path := fmt.Sprintf("/v1/project/%s/invite/%s", project, inviteVerificationCode) b, err := h.doer.Do(ctx, "ProjectInviteAccept", "POST", path, nil) if err != nil { return nil, err @@ -225,12 +225,12 @@ func (h *ProjectHandler) ProjectInviteAccept(ctx context.Context, project string return &out.InviteDetails, nil } func (h *ProjectHandler) ProjectInviteDelete(ctx context.Context, project string, invitedEmail string) error { - path := fmt.Sprintf("/project/%s/invite/%s", project, invitedEmail) + path := fmt.Sprintf("/v1/project/%s/invite/%s", project, invitedEmail) _, err := h.doer.Do(ctx, "ProjectInviteDelete", "DELETE", path, nil) return err } func (h *ProjectHandler) ProjectKmsGetCA(ctx context.Context, project string) (string, error) { - path := fmt.Sprintf("/project/%s/kms/ca", project) + path := fmt.Sprintf("/v1/project/%s/kms/ca", project) b, err := h.doer.Do(ctx, "ProjectKmsGetCA", "GET", path, nil) if err != nil { return "", err @@ -243,7 +243,7 @@ func (h *ProjectHandler) ProjectKmsGetCA(ctx context.Context, project string) (s return out.Certificate, nil } func (h *ProjectHandler) ProjectList(ctx context.Context) (*ProjectListOut, error) { - path := fmt.Sprintf("/project") + path := fmt.Sprintf("/v1/project") b, err := h.doer.Do(ctx, "ProjectList", "GET", path, nil) if err != nil { return nil, err @@ -256,7 +256,7 @@ func (h *ProjectHandler) ProjectList(ctx context.Context) (*ProjectListOut, erro return out, nil } func (h *ProjectHandler) ProjectPrivatelinkAvailabilityList(ctx context.Context, project string) ([]PrivatelinkAvailabilityOut, error) { - path := fmt.Sprintf("/project/%s/privatelink-availability", project) + path := fmt.Sprintf("/v1/project/%s/privatelink-availability", project) b, err := h.doer.Do(ctx, "ProjectPrivatelinkAvailabilityList", "GET", path, nil) if err != nil { return nil, err @@ -269,7 +269,7 @@ func (h *ProjectHandler) ProjectPrivatelinkAvailabilityList(ctx context.Context, return out.PrivatelinkAvailability, nil } func (h *ProjectHandler) ProjectTagsList(ctx context.Context, project string) (map[string]string, error) { - path := fmt.Sprintf("/project/%s/tags", project) + path := fmt.Sprintf("/v1/project/%s/tags", project) b, err := h.doer.Do(ctx, "ProjectTagsList", "GET", path, nil) if err != nil { return nil, err @@ -282,17 +282,17 @@ func (h *ProjectHandler) ProjectTagsList(ctx context.Context, project string) (m return out.Tags, nil } func (h *ProjectHandler) ProjectTagsReplace(ctx context.Context, project string, in *ProjectTagsReplaceIn) error { - path := fmt.Sprintf("/project/%s/tags", project) + path := fmt.Sprintf("/v1/project/%s/tags", project) _, err := h.doer.Do(ctx, "ProjectTagsReplace", "PUT", path, in) return err } func (h *ProjectHandler) ProjectTagsUpdate(ctx context.Context, project string, in *ProjectTagsUpdateIn) error { - path := fmt.Sprintf("/project/%s/tags", project) + path := fmt.Sprintf("/v1/project/%s/tags", project) _, err := h.doer.Do(ctx, "ProjectTagsUpdate", "PATCH", path, in) return err } func (h *ProjectHandler) ProjectUpdate(ctx context.Context, project string, in *ProjectUpdateIn) (*ProjectUpdateOut, error) { - path := fmt.Sprintf("/project/%s", project) + path := fmt.Sprintf("/v1/project/%s", project) b, err := h.doer.Do(ctx, "ProjectUpdate", "PUT", path, in) if err != nil { return nil, err @@ -305,7 +305,7 @@ func (h *ProjectHandler) ProjectUpdate(ctx context.Context, project string, in * return &out.Project, nil } func (h *ProjectHandler) ProjectUserList(ctx context.Context, project string) (*ProjectUserListOut, error) { - path := fmt.Sprintf("/project/%s/users", project) + path := fmt.Sprintf("/v1/project/%s/users", project) b, err := h.doer.Do(ctx, "ProjectUserList", "GET", path, nil) if err != nil { return nil, err @@ -318,12 +318,12 @@ func (h *ProjectHandler) ProjectUserList(ctx context.Context, project string) (* return out, nil } func (h *ProjectHandler) ProjectUserRemove(ctx context.Context, project string, userEmail string) error { - path := fmt.Sprintf("/project/%s/user/%s", project, userEmail) + path := fmt.Sprintf("/v1/project/%s/user/%s", project, userEmail) _, err := h.doer.Do(ctx, "ProjectUserRemove", "DELETE", path, nil) return err } func (h *ProjectHandler) ProjectUserUpdate(ctx context.Context, project string, userEmail string, in *ProjectUserUpdateIn) error { - path := fmt.Sprintf("/project/%s/user/%s", project, userEmail) + path := fmt.Sprintf("/v1/project/%s/user/%s", project, userEmail) _, err := h.doer.Do(ctx, "ProjectUserUpdate", "PUT", path, in) return err } diff --git a/handler/projectbilling/projectbilling.go b/handler/projectbilling/projectbilling.go index a1ae982..412adeb 100644 --- a/handler/projectbilling/projectbilling.go +++ b/handler/projectbilling/projectbilling.go @@ -11,17 +11,17 @@ import ( type Handler interface { // ProjectCreditsClaim claim a credit code - // POST /project/{project}/credits + // POST /v1/project/{project}/credits // https://api.aiven.io/doc/#tag/Project_Billing/operation/ProjectCreditsClaim ProjectCreditsClaim(ctx context.Context, project string, in *ProjectCreditsClaimIn) (*ProjectCreditsClaimOut, error) // ProjectCreditsList list project credits - // GET /project/{project}/credits + // GET /v1/project/{project}/credits // https://api.aiven.io/doc/#tag/Project_Billing/operation/ProjectCreditsList ProjectCreditsList(ctx context.Context, project string) ([]CreditOut, error) // ProjectInvoiceList list project invoices - // GET /project/{project}/invoice + // GET /v1/project/{project}/invoice // https://api.aiven.io/doc/#tag/Project_Billing/operation/ProjectInvoiceList ProjectInvoiceList(ctx context.Context, project string) ([]InvoiceOut, error) } @@ -39,7 +39,7 @@ type ProjectBillingHandler struct { } func (h *ProjectBillingHandler) ProjectCreditsClaim(ctx context.Context, project string, in *ProjectCreditsClaimIn) (*ProjectCreditsClaimOut, error) { - path := fmt.Sprintf("/project/%s/credits", project) + path := fmt.Sprintf("/v1/project/%s/credits", project) b, err := h.doer.Do(ctx, "ProjectCreditsClaim", "POST", path, in) if err != nil { return nil, err @@ -52,7 +52,7 @@ func (h *ProjectBillingHandler) ProjectCreditsClaim(ctx context.Context, project return &out.Credit, nil } func (h *ProjectBillingHandler) ProjectCreditsList(ctx context.Context, project string) ([]CreditOut, error) { - path := fmt.Sprintf("/project/%s/credits", project) + path := fmt.Sprintf("/v1/project/%s/credits", project) b, err := h.doer.Do(ctx, "ProjectCreditsList", "GET", path, nil) if err != nil { return nil, err @@ -65,7 +65,7 @@ func (h *ProjectBillingHandler) ProjectCreditsList(ctx context.Context, project return out.Credits, nil } func (h *ProjectBillingHandler) ProjectInvoiceList(ctx context.Context, project string) ([]InvoiceOut, error) { - path := fmt.Sprintf("/project/%s/invoice", project) + path := fmt.Sprintf("/v1/project/%s/invoice", project) b, err := h.doer.Do(ctx, "ProjectInvoiceList", "GET", path, nil) if err != nil { return nil, err @@ -157,22 +157,24 @@ type InvoiceOut struct { type InvoiceStateType string const ( - InvoiceStateTypeAccrual InvoiceStateType = "accrual" - InvoiceStateTypeConsolidated InvoiceStateType = "consolidated" - InvoiceStateTypeDue InvoiceStateType = "due" - InvoiceStateTypeEstimate InvoiceStateType = "estimate" - InvoiceStateTypeFailedCreditCardCharge InvoiceStateType = "failed_credit_card_charge" - InvoiceStateTypeFailedNoCreditCard InvoiceStateType = "failed_no_credit_card" - InvoiceStateTypeMailed InvoiceStateType = "mailed" - InvoiceStateTypeNoPaymentExpected InvoiceStateType = "no_payment_expected" - InvoiceStateTypePaid InvoiceStateType = "paid" - InvoiceStateTypePartnerMetering InvoiceStateType = "partner_metering" - InvoiceStateTypeUncollectible InvoiceStateType = "uncollectible" - InvoiceStateTypeWaived InvoiceStateType = "waived" + InvoiceStateTypeAccrual InvoiceStateType = "accrual" + InvoiceStateTypeConsolidated InvoiceStateType = "consolidated" + InvoiceStateTypeDue InvoiceStateType = "due" + InvoiceStateTypeEstimate InvoiceStateType = "estimate" + InvoiceStateTypeFailedCreditCardCharge InvoiceStateType = "failed_credit_card_charge" + InvoiceStateTypeFailedNoCreditCard InvoiceStateType = "failed_no_credit_card" + InvoiceStateTypeMailed InvoiceStateType = "mailed" + InvoiceStateTypeNoPaymentExpected InvoiceStateType = "no_payment_expected" + InvoiceStateTypePaid InvoiceStateType = "paid" + InvoiceStateTypePartnerMetering InvoiceStateType = "partner_metering" + InvoiceStateTypeUncollectible InvoiceStateType = "uncollectible" + InvoiceStateTypeWaived InvoiceStateType = "waived" + InvoiceStateTypeDueOnlyProjectChargesCalculated InvoiceStateType = "due_only_project_charges_calculated" + InvoiceStateTypeEstimateOnlyProjectChargesCalculated InvoiceStateType = "estimate_only_project_charges_calculated" ) func InvoiceStateTypeChoices() []string { - return []string{"accrual", "consolidated", "due", "estimate", "failed_credit_card_charge", "failed_no_credit_card", "mailed", "no_payment_expected", "paid", "partner_metering", "uncollectible", "waived"} + return []string{"accrual", "consolidated", "due", "estimate", "failed_credit_card_charge", "failed_no_credit_card", "mailed", "no_payment_expected", "paid", "partner_metering", "uncollectible", "waived", "due_only_project_charges_calculated", "estimate_only_project_charges_calculated"} } type ProjectCreditsClaimIn struct { diff --git a/handler/service/service.go b/handler/service/service.go index cc0ad4f..162862b 100644 --- a/handler/service/service.go +++ b/handler/service/service.go @@ -11,152 +11,152 @@ import ( type Handler interface { // ListProjectServiceTypes list service types for a project - // GET /project/{project}/service_types + // GET /v1/project/{project}/service_types // https://api.aiven.io/doc/#tag/Service/operation/ListProjectServiceTypes ListProjectServiceTypes(ctx context.Context, project string) (*ListProjectServiceTypesOut, error) // ListPublicServiceTypes list publicly available service types - // GET /service_types + // GET /v1/service_types // https://api.aiven.io/doc/#tag/Service/operation/ListPublicServiceTypes ListPublicServiceTypes(ctx context.Context) (*ListPublicServiceTypesOut, error) // ListServiceVersions list service versions - // GET /service_versions + // GET /v1/service_versions // https://api.aiven.io/doc/#tag/Service/operation/ListServiceVersions ListServiceVersions(ctx context.Context) ([]ServiceVersionOut, error) // ProjectGetServiceLogs get service log entries - // POST /project/{project}/service/{service_name}/logs + // POST /v1/project/{project}/service/{service_name}/logs // https://api.aiven.io/doc/#tag/Service/operation/ProjectGetServiceLogs ProjectGetServiceLogs(ctx context.Context, project string, serviceName string, in *ProjectGetServiceLogsIn) (*ProjectGetServiceLogsOut, error) // ProjectServiceTagsList list all tags attached to the service - // GET /project/{project}/service/{service_name}/tags + // GET /v1/project/{project}/service/{service_name}/tags // https://api.aiven.io/doc/#tag/Service/operation/ProjectServiceTagsList ProjectServiceTagsList(ctx context.Context, project string, serviceName string) (map[string]string, error) // ProjectServiceTagsReplace replace all project tags with a new set of tags, deleting old ones - // PUT /project/{project}/service/{service_name}/tags + // PUT /v1/project/{project}/service/{service_name}/tags // https://api.aiven.io/doc/#tag/Service/operation/ProjectServiceTagsReplace ProjectServiceTagsReplace(ctx context.Context, project string, serviceName string, in *ProjectServiceTagsReplaceIn) error // ProjectServiceTagsUpdate update one or more tags, creating ones that don't exist, and deleting ones given NULL value - // PATCH /project/{project}/service/{service_name}/tags + // PATCH /v1/project/{project}/service/{service_name}/tags // https://api.aiven.io/doc/#tag/Service/operation/ProjectServiceTagsUpdate ProjectServiceTagsUpdate(ctx context.Context, project string, serviceName string, in *ProjectServiceTagsUpdateIn) error // ServiceAlertsList list active alerts for service - // GET /project/{project}/service/{service_name}/alerts + // GET /v1/project/{project}/service/{service_name}/alerts // https://api.aiven.io/doc/#tag/Service/operation/ServiceAlertsList ServiceAlertsList(ctx context.Context, project string, serviceName string) ([]AlertOut, error) // ServiceBackupToAnotherRegionReport get service's backup to another region information - // POST /project/{project}/service/{service_name}/backup_to_another_region/report + // POST /v1/project/{project}/service/{service_name}/backup_to_another_region/report // https://api.aiven.io/doc/#tag/Service/operation/ServiceBackupToAnotherRegionReport ServiceBackupToAnotherRegionReport(ctx context.Context, project string, serviceName string, in *ServiceBackupToAnotherRegionReportIn) (map[string]any, error) // ServiceBackupsGet get service backup information - // GET /project/{project}/service/{service_name}/backups + // GET /v1/project/{project}/service/{service_name}/backups // https://api.aiven.io/doc/#tag/Service/operation/ServiceBackupsGet ServiceBackupsGet(ctx context.Context, project string, serviceName string) ([]BackupOut, error) // ServiceCancelQuery cancel specified query from service - // POST /project/{project}/service/{service_name}/query/cancel + // POST /v1/project/{project}/service/{service_name}/query/cancel // https://api.aiven.io/doc/#tag/Service/operation/ServiceCancelQuery ServiceCancelQuery(ctx context.Context, project string, serviceName string, in *ServiceCancelQueryIn) (bool, error) // ServiceCreate create a service - // POST /project/{project}/service + // POST /v1/project/{project}/service // https://api.aiven.io/doc/#tag/Service/operation/ServiceCreate ServiceCreate(ctx context.Context, project string, in *ServiceCreateIn) (*ServiceCreateOut, error) // ServiceDatabaseCreate create a new logical database for service - // POST /project/{project}/service/{service_name}/db + // POST /v1/project/{project}/service/{service_name}/db // https://api.aiven.io/doc/#tag/Service/operation/ServiceDatabaseCreate ServiceDatabaseCreate(ctx context.Context, project string, serviceName string, in *ServiceDatabaseCreateIn) error // ServiceDatabaseDelete delete a logical database - // DELETE /project/{project}/service/{service_name}/db/{dbname} + // DELETE /v1/project/{project}/service/{service_name}/db/{dbname} // https://api.aiven.io/doc/#tag/Service/operation/ServiceDatabaseDelete ServiceDatabaseDelete(ctx context.Context, project string, serviceName string, dbname string) error // ServiceDatabaseList list service databases - // GET /project/{project}/service/{service_name}/db + // GET /v1/project/{project}/service/{service_name}/db // https://api.aiven.io/doc/#tag/Service/operation/ServiceDatabaseList ServiceDatabaseList(ctx context.Context, project string, serviceName string) ([]DatabaseOut, error) // ServiceDelete terminate a service - // DELETE /project/{project}/service/{service_name} + // DELETE /v1/project/{project}/service/{service_name} // https://api.aiven.io/doc/#tag/Service/operation/ServiceDelete ServiceDelete(ctx context.Context, project string, serviceName string) error // ServiceEnableWrites temporarily enable writes for a service in read-only mode. Will only work if disk usage is lower than 99.0% - // POST /project/{project}/service/{service_name}/enable-writes + // POST /v1/project/{project}/service/{service_name}/enable-writes // https://api.aiven.io/doc/#tag/Service/operation/ServiceEnableWrites ServiceEnableWrites(ctx context.Context, project string, serviceName string) (string, error) // ServiceGet get service information - // GET /project/{project}/service/{service_name} + // GET /v1/project/{project}/service/{service_name} // https://api.aiven.io/doc/#tag/Service/operation/ServiceGet ServiceGet(ctx context.Context, project string, serviceName string) (*ServiceGetOut, error) // ServiceGetMigrationStatus get migration status - // GET /project/{project}/service/{service_name}/migration + // GET /v1/project/{project}/service/{service_name}/migration // https://api.aiven.io/doc/#tag/Service/operation/ServiceGetMigrationStatus ServiceGetMigrationStatus(ctx context.Context, project string, serviceName string) (*ServiceGetMigrationStatusOut, error) // ServiceInfluxDBStats list stats for influxdb - // GET /project/{project}/service/{service_name}/influxdb/stats + // GET /v1/project/{project}/service/{service_name}/influxdb/stats // https://api.aiven.io/doc/#tag/Service/operation/ServiceInfluxDBStats ServiceInfluxDBStats(ctx context.Context, project string, serviceName string) (map[string]any, error) // ServiceKmsGetCA retrieve a service CA - // GET /project/{project}/service/{service_name}/kms/ca/{ca_name} + // GET /v1/project/{project}/service/{service_name}/kms/ca/{ca_name} // https://api.aiven.io/doc/#tag/Service/operation/ServiceKmsGetCA ServiceKmsGetCA(ctx context.Context, project string, serviceName string, caName string) (string, error) // ServiceKmsGetKeypair retrieve service keypair - // GET /project/{project}/service/{service_name}/kms/keypairs/{keypair_name} + // GET /v1/project/{project}/service/{service_name}/kms/keypairs/{keypair_name} // https://api.aiven.io/doc/#tag/Service/operation/ServiceKmsGetKeypair ServiceKmsGetKeypair(ctx context.Context, project string, serviceName string, keypairName string) (*ServiceKmsGetKeypairOut, error) // ServiceList list services - // GET /project/{project}/service + // GET /v1/project/{project}/service // https://api.aiven.io/doc/#tag/Service/operation/ServiceList ServiceList(ctx context.Context, project string) ([]ServiceOut, error) // ServiceMaintenanceStart start maintenance updates - // PUT /project/{project}/service/{service_name}/maintenance/start + // PUT /v1/project/{project}/service/{service_name}/maintenance/start // https://api.aiven.io/doc/#tag/Service/operation/ServiceMaintenanceStart ServiceMaintenanceStart(ctx context.Context, project string, serviceName string) error // ServiceMetricsFetch fetch service metrics - // POST /project/{project}/service/{service_name}/metrics + // POST /v1/project/{project}/service/{service_name}/metrics // https://api.aiven.io/doc/#tag/Service/operation/ServiceMetricsFetch ServiceMetricsFetch(ctx context.Context, project string, serviceName string, in *ServiceMetricsFetchIn) (map[string]any, error) // ServiceQueryActivity fetch current queries for the service - // POST /project/{project}/service/{service_name}/query/activity + // POST /v1/project/{project}/service/{service_name}/query/activity // https://api.aiven.io/doc/#tag/Service/operation/ServiceQueryActivity ServiceQueryActivity(ctx context.Context, project string, serviceName string, in *ServiceQueryActivityIn) ([]QueryOut, error) // ServiceQueryStatisticsReset reset service's query statistics - // PUT /project/{project}/service/{service_name}/query/stats/reset + // PUT /v1/project/{project}/service/{service_name}/query/stats/reset // https://api.aiven.io/doc/#tag/Service/operation/ServiceQueryStatisticsReset ServiceQueryStatisticsReset(ctx context.Context, project string, serviceName string) ([]map[string]any, error) // ServiceTaskCreate create a new task for service - // POST /project/{project}/service/{service_name}/task + // POST /v1/project/{project}/service/{service_name}/task // https://api.aiven.io/doc/#tag/Service/operation/ServiceTaskCreate ServiceTaskCreate(ctx context.Context, project string, serviceName string, in *ServiceTaskCreateIn) (*ServiceTaskCreateOut, error) // ServiceTaskGet get task result - // GET /project/{project}/service/{service_name}/task/{task_id} + // GET /v1/project/{project}/service/{service_name}/task/{task_id} // https://api.aiven.io/doc/#tag/Service/operation/ServiceTaskGet ServiceTaskGet(ctx context.Context, project string, serviceName string, taskId string) (*ServiceTaskGetOut, error) // ServiceUpdate update service configuration - // PUT /project/{project}/service/{service_name} + // PUT /v1/project/{project}/service/{service_name} // https://api.aiven.io/doc/#tag/Service/operation/ServiceUpdate ServiceUpdate(ctx context.Context, project string, serviceName string, in *ServiceUpdateIn) (*ServiceUpdateOut, error) } @@ -174,7 +174,7 @@ type ServiceHandler struct { } func (h *ServiceHandler) ListProjectServiceTypes(ctx context.Context, project string) (*ListProjectServiceTypesOut, error) { - path := fmt.Sprintf("/project/%s/service_types", project) + path := fmt.Sprintf("/v1/project/%s/service_types", project) b, err := h.doer.Do(ctx, "ListProjectServiceTypes", "GET", path, nil) if err != nil { return nil, err @@ -187,7 +187,7 @@ func (h *ServiceHandler) ListProjectServiceTypes(ctx context.Context, project st return &out.ServiceTypes, nil } func (h *ServiceHandler) ListPublicServiceTypes(ctx context.Context) (*ListPublicServiceTypesOut, error) { - path := fmt.Sprintf("/service_types") + path := fmt.Sprintf("/v1/service_types") b, err := h.doer.Do(ctx, "ListPublicServiceTypes", "GET", path, nil) if err != nil { return nil, err @@ -200,7 +200,7 @@ func (h *ServiceHandler) ListPublicServiceTypes(ctx context.Context) (*ListPubli return &out.ServiceTypes, nil } func (h *ServiceHandler) ListServiceVersions(ctx context.Context) ([]ServiceVersionOut, error) { - path := fmt.Sprintf("/service_versions") + path := fmt.Sprintf("/v1/service_versions") b, err := h.doer.Do(ctx, "ListServiceVersions", "GET", path, nil) if err != nil { return nil, err @@ -213,7 +213,7 @@ func (h *ServiceHandler) ListServiceVersions(ctx context.Context) ([]ServiceVers return out.ServiceVersions, nil } func (h *ServiceHandler) ProjectGetServiceLogs(ctx context.Context, project string, serviceName string, in *ProjectGetServiceLogsIn) (*ProjectGetServiceLogsOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/logs", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/logs", project, serviceName) b, err := h.doer.Do(ctx, "ProjectGetServiceLogs", "POST", path, in) if err != nil { return nil, err @@ -226,7 +226,7 @@ func (h *ServiceHandler) ProjectGetServiceLogs(ctx context.Context, project stri return out, nil } func (h *ServiceHandler) ProjectServiceTagsList(ctx context.Context, project string, serviceName string) (map[string]string, error) { - path := fmt.Sprintf("/project/%s/service/%s/tags", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/tags", project, serviceName) b, err := h.doer.Do(ctx, "ProjectServiceTagsList", "GET", path, nil) if err != nil { return nil, err @@ -239,17 +239,17 @@ func (h *ServiceHandler) ProjectServiceTagsList(ctx context.Context, project str return out.Tags, nil } func (h *ServiceHandler) ProjectServiceTagsReplace(ctx context.Context, project string, serviceName string, in *ProjectServiceTagsReplaceIn) error { - path := fmt.Sprintf("/project/%s/service/%s/tags", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/tags", project, serviceName) _, err := h.doer.Do(ctx, "ProjectServiceTagsReplace", "PUT", path, in) return err } func (h *ServiceHandler) ProjectServiceTagsUpdate(ctx context.Context, project string, serviceName string, in *ProjectServiceTagsUpdateIn) error { - path := fmt.Sprintf("/project/%s/service/%s/tags", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/tags", project, serviceName) _, err := h.doer.Do(ctx, "ProjectServiceTagsUpdate", "PATCH", path, in) return err } func (h *ServiceHandler) ServiceAlertsList(ctx context.Context, project string, serviceName string) ([]AlertOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/alerts", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/alerts", project, serviceName) b, err := h.doer.Do(ctx, "ServiceAlertsList", "GET", path, nil) if err != nil { return nil, err @@ -262,7 +262,7 @@ func (h *ServiceHandler) ServiceAlertsList(ctx context.Context, project string, return out.Alerts, nil } func (h *ServiceHandler) ServiceBackupToAnotherRegionReport(ctx context.Context, project string, serviceName string, in *ServiceBackupToAnotherRegionReportIn) (map[string]any, error) { - path := fmt.Sprintf("/project/%s/service/%s/backup_to_another_region/report", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/backup_to_another_region/report", project, serviceName) b, err := h.doer.Do(ctx, "ServiceBackupToAnotherRegionReport", "POST", path, in) if err != nil { return nil, err @@ -275,7 +275,7 @@ func (h *ServiceHandler) ServiceBackupToAnotherRegionReport(ctx context.Context, return out.Metrics, nil } func (h *ServiceHandler) ServiceBackupsGet(ctx context.Context, project string, serviceName string) ([]BackupOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/backups", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/backups", project, serviceName) b, err := h.doer.Do(ctx, "ServiceBackupsGet", "GET", path, nil) if err != nil { return nil, err @@ -288,7 +288,7 @@ func (h *ServiceHandler) ServiceBackupsGet(ctx context.Context, project string, return out.Backups, nil } func (h *ServiceHandler) ServiceCancelQuery(ctx context.Context, project string, serviceName string, in *ServiceCancelQueryIn) (bool, error) { - path := fmt.Sprintf("/project/%s/service/%s/query/cancel", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/query/cancel", project, serviceName) b, err := h.doer.Do(ctx, "ServiceCancelQuery", "POST", path, in) if err != nil { return false, err @@ -301,7 +301,7 @@ func (h *ServiceHandler) ServiceCancelQuery(ctx context.Context, project string, return out.Success, nil } func (h *ServiceHandler) ServiceCreate(ctx context.Context, project string, in *ServiceCreateIn) (*ServiceCreateOut, error) { - path := fmt.Sprintf("/project/%s/service", project) + path := fmt.Sprintf("/v1/project/%s/service", project) b, err := h.doer.Do(ctx, "ServiceCreate", "POST", path, in) if err != nil { return nil, err @@ -314,17 +314,17 @@ func (h *ServiceHandler) ServiceCreate(ctx context.Context, project string, in * return &out.Service, nil } func (h *ServiceHandler) ServiceDatabaseCreate(ctx context.Context, project string, serviceName string, in *ServiceDatabaseCreateIn) error { - path := fmt.Sprintf("/project/%s/service/%s/db", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/db", project, serviceName) _, err := h.doer.Do(ctx, "ServiceDatabaseCreate", "POST", path, in) return err } func (h *ServiceHandler) ServiceDatabaseDelete(ctx context.Context, project string, serviceName string, dbname string) error { - path := fmt.Sprintf("/project/%s/service/%s/db/%s", project, serviceName, dbname) + path := fmt.Sprintf("/v1/project/%s/service/%s/db/%s", project, serviceName, dbname) _, err := h.doer.Do(ctx, "ServiceDatabaseDelete", "DELETE", path, nil) return err } func (h *ServiceHandler) ServiceDatabaseList(ctx context.Context, project string, serviceName string) ([]DatabaseOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/db", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/db", project, serviceName) b, err := h.doer.Do(ctx, "ServiceDatabaseList", "GET", path, nil) if err != nil { return nil, err @@ -337,12 +337,12 @@ func (h *ServiceHandler) ServiceDatabaseList(ctx context.Context, project string return out.Databases, nil } func (h *ServiceHandler) ServiceDelete(ctx context.Context, project string, serviceName string) error { - path := fmt.Sprintf("/project/%s/service/%s", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s", project, serviceName) _, err := h.doer.Do(ctx, "ServiceDelete", "DELETE", path, nil) return err } func (h *ServiceHandler) ServiceEnableWrites(ctx context.Context, project string, serviceName string) (string, error) { - path := fmt.Sprintf("/project/%s/service/%s/enable-writes", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/enable-writes", project, serviceName) b, err := h.doer.Do(ctx, "ServiceEnableWrites", "POST", path, nil) if err != nil { return "", err @@ -355,7 +355,7 @@ func (h *ServiceHandler) ServiceEnableWrites(ctx context.Context, project string return out.Until, nil } func (h *ServiceHandler) ServiceGet(ctx context.Context, project string, serviceName string) (*ServiceGetOut, error) { - path := fmt.Sprintf("/project/%s/service/%s", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s", project, serviceName) b, err := h.doer.Do(ctx, "ServiceGet", "GET", path, nil) if err != nil { return nil, err @@ -368,7 +368,7 @@ func (h *ServiceHandler) ServiceGet(ctx context.Context, project string, service return &out.Service, nil } func (h *ServiceHandler) ServiceGetMigrationStatus(ctx context.Context, project string, serviceName string) (*ServiceGetMigrationStatusOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/migration", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/migration", project, serviceName) b, err := h.doer.Do(ctx, "ServiceGetMigrationStatus", "GET", path, nil) if err != nil { return nil, err @@ -381,7 +381,7 @@ func (h *ServiceHandler) ServiceGetMigrationStatus(ctx context.Context, project return out, nil } func (h *ServiceHandler) ServiceInfluxDBStats(ctx context.Context, project string, serviceName string) (map[string]any, error) { - path := fmt.Sprintf("/project/%s/service/%s/influxdb/stats", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/influxdb/stats", project, serviceName) b, err := h.doer.Do(ctx, "ServiceInfluxDBStats", "GET", path, nil) if err != nil { return nil, err @@ -394,7 +394,7 @@ func (h *ServiceHandler) ServiceInfluxDBStats(ctx context.Context, project strin return out.DbStats, nil } func (h *ServiceHandler) ServiceKmsGetCA(ctx context.Context, project string, serviceName string, caName string) (string, error) { - path := fmt.Sprintf("/project/%s/service/%s/kms/ca/%s", project, serviceName, caName) + path := fmt.Sprintf("/v1/project/%s/service/%s/kms/ca/%s", project, serviceName, caName) b, err := h.doer.Do(ctx, "ServiceKmsGetCA", "GET", path, nil) if err != nil { return "", err @@ -407,7 +407,7 @@ func (h *ServiceHandler) ServiceKmsGetCA(ctx context.Context, project string, se return out.Certificate, nil } func (h *ServiceHandler) ServiceKmsGetKeypair(ctx context.Context, project string, serviceName string, keypairName string) (*ServiceKmsGetKeypairOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/kms/keypairs/%s", project, serviceName, keypairName) + path := fmt.Sprintf("/v1/project/%s/service/%s/kms/keypairs/%s", project, serviceName, keypairName) b, err := h.doer.Do(ctx, "ServiceKmsGetKeypair", "GET", path, nil) if err != nil { return nil, err @@ -420,7 +420,7 @@ func (h *ServiceHandler) ServiceKmsGetKeypair(ctx context.Context, project strin return out, nil } func (h *ServiceHandler) ServiceList(ctx context.Context, project string) ([]ServiceOut, error) { - path := fmt.Sprintf("/project/%s/service", project) + path := fmt.Sprintf("/v1/project/%s/service", project) b, err := h.doer.Do(ctx, "ServiceList", "GET", path, nil) if err != nil { return nil, err @@ -433,12 +433,12 @@ func (h *ServiceHandler) ServiceList(ctx context.Context, project string) ([]Ser return out.Services, nil } func (h *ServiceHandler) ServiceMaintenanceStart(ctx context.Context, project string, serviceName string) error { - path := fmt.Sprintf("/project/%s/service/%s/maintenance/start", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/maintenance/start", project, serviceName) _, err := h.doer.Do(ctx, "ServiceMaintenanceStart", "PUT", path, nil) return err } func (h *ServiceHandler) ServiceMetricsFetch(ctx context.Context, project string, serviceName string, in *ServiceMetricsFetchIn) (map[string]any, error) { - path := fmt.Sprintf("/project/%s/service/%s/metrics", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/metrics", project, serviceName) b, err := h.doer.Do(ctx, "ServiceMetricsFetch", "POST", path, in) if err != nil { return nil, err @@ -451,7 +451,7 @@ func (h *ServiceHandler) ServiceMetricsFetch(ctx context.Context, project string return out.Metrics, nil } func (h *ServiceHandler) ServiceQueryActivity(ctx context.Context, project string, serviceName string, in *ServiceQueryActivityIn) ([]QueryOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/query/activity", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/query/activity", project, serviceName) b, err := h.doer.Do(ctx, "ServiceQueryActivity", "POST", path, in) if err != nil { return nil, err @@ -464,7 +464,7 @@ func (h *ServiceHandler) ServiceQueryActivity(ctx context.Context, project strin return out.Queries, nil } func (h *ServiceHandler) ServiceQueryStatisticsReset(ctx context.Context, project string, serviceName string) ([]map[string]any, error) { - path := fmt.Sprintf("/project/%s/service/%s/query/stats/reset", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/query/stats/reset", project, serviceName) b, err := h.doer.Do(ctx, "ServiceQueryStatisticsReset", "PUT", path, nil) if err != nil { return nil, err @@ -477,7 +477,7 @@ func (h *ServiceHandler) ServiceQueryStatisticsReset(ctx context.Context, projec return out.Queries, nil } func (h *ServiceHandler) ServiceTaskCreate(ctx context.Context, project string, serviceName string, in *ServiceTaskCreateIn) (*ServiceTaskCreateOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/task", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/task", project, serviceName) b, err := h.doer.Do(ctx, "ServiceTaskCreate", "POST", path, in) if err != nil { return nil, err @@ -490,7 +490,7 @@ func (h *ServiceHandler) ServiceTaskCreate(ctx context.Context, project string, return &out.Task, nil } func (h *ServiceHandler) ServiceTaskGet(ctx context.Context, project string, serviceName string, taskId string) (*ServiceTaskGetOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/task/%s", project, serviceName, taskId) + path := fmt.Sprintf("/v1/project/%s/service/%s/task/%s", project, serviceName, taskId) b, err := h.doer.Do(ctx, "ServiceTaskGet", "GET", path, nil) if err != nil { return nil, err @@ -503,7 +503,7 @@ func (h *ServiceHandler) ServiceTaskGet(ctx context.Context, project string, ser return &out.Task, nil } func (h *ServiceHandler) ServiceUpdate(ctx context.Context, project string, serviceName string, in *ServiceUpdateIn) (*ServiceUpdateOut, error) { - path := fmt.Sprintf("/project/%s/service/%s", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s", project, serviceName) b, err := h.doer.Do(ctx, "ServiceUpdate", "PUT", path, in) if err != nil { return nil, err @@ -669,6 +669,13 @@ func DowTypeAltChoices() []string { return []string{"monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", "never"} } +type DragonflyOut struct { + DefaultVersion string `json:"default_version,omitempty"` + Description string `json:"description"` + LatestAvailableVersion string `json:"latest_available_version,omitempty"` + ServicePlans []ServicePlanOut `json:"service_plans"` + UserConfigSchema map[string]any `json:"user_config_schema"` +} type ElasticsearchOut struct { DefaultVersion string `json:"default_version,omitempty"` Description string `json:"description"` @@ -736,6 +743,7 @@ const ( IntegrationTypeFlink IntegrationType = "flink" IntegrationTypeFlinkExternalBigquery IntegrationType = "flink_external_bigquery" IntegrationTypeFlinkExternalKafka IntegrationType = "flink_external_kafka" + IntegrationTypeFlinkExternalPostgresql IntegrationType = "flink_external_postgresql" IntegrationTypeInternalConnectivity IntegrationType = "internal_connectivity" IntegrationTypeJolokia IntegrationType = "jolokia" IntegrationTypeKafkaConnect IntegrationType = "kafka_connect" @@ -761,7 +769,7 @@ const ( ) func IntegrationTypeChoices() []string { - return []string{"alertmanager", "autoscaler", "caching", "cassandra_cross_service_cluster", "clickhouse_credentials", "clickhouse_kafka", "clickhouse_postgresql", "dashboard", "datadog", "datasource", "external_aws_cloudwatch_logs", "external_aws_cloudwatch_metrics", "external_elasticsearch_logs", "external_google_cloud_logging", "external_opensearch_logs", "flink", "flink_external_bigquery", "flink_external_kafka", "internal_connectivity", "jolokia", "kafka_connect", "kafka_connect_postgresql", "kafka_logs", "kafka_mirrormaker", "logs", "m3aggregator", "m3coordinator", "metrics", "opensearch_cross_cluster_replication", "opensearch_cross_cluster_search", "prometheus", "read_replica", "rsyslog", "schema_registry_proxy", "stresstester", "thanoscompactor", "thanosquery", "thanosstore", "vector", "vmalert"} + return []string{"alertmanager", "autoscaler", "caching", "cassandra_cross_service_cluster", "clickhouse_credentials", "clickhouse_kafka", "clickhouse_postgresql", "dashboard", "datadog", "datasource", "external_aws_cloudwatch_logs", "external_aws_cloudwatch_metrics", "external_elasticsearch_logs", "external_google_cloud_logging", "external_opensearch_logs", "flink", "flink_external_bigquery", "flink_external_kafka", "flink_external_postgresql", "internal_connectivity", "jolokia", "kafka_connect", "kafka_connect_postgresql", "kafka_logs", "kafka_mirrormaker", "logs", "m3aggregator", "m3coordinator", "metrics", "opensearch_cross_cluster_replication", "opensearch_cross_cluster_search", "prometheus", "read_replica", "rsyslog", "schema_registry_proxy", "stresstester", "thanoscompactor", "thanosquery", "thanosstore", "vector", "vmalert"} } type KafkaAuthenticationMethodType string @@ -824,6 +832,7 @@ func LikelyErrorCauseTypeChoices() []string { type ListProjectServiceTypesOut struct { Cassandra *CassandraOut `json:"cassandra,omitempty"` Clickhouse *ClickhouseOut `json:"clickhouse,omitempty"` + Dragonfly *DragonflyOut `json:"dragonfly,omitempty"` Elasticsearch *ElasticsearchOut `json:"elasticsearch,omitempty"` Flink *FlinkOut `json:"flink,omitempty"` Grafana *GrafanaOut `json:"grafana,omitempty"` @@ -841,6 +850,7 @@ type ListProjectServiceTypesOut struct { type ListPublicServiceTypesOut struct { Cassandra *CassandraOut `json:"cassandra,omitempty"` Clickhouse *ClickhouseOut `json:"clickhouse,omitempty"` + Dragonfly *DragonflyOut `json:"dragonfly,omitempty"` Elasticsearch *ElasticsearchOut `json:"elasticsearch,omitempty"` Flink *FlinkOut `json:"flink,omitempty"` Grafana *GrafanaOut `json:"grafana,omitempty"` @@ -1534,7 +1544,6 @@ type StateOut struct { type TargetVersionType string const ( - TargetVersionType12 TargetVersionType = "12" TargetVersionType13 TargetVersionType = "13" TargetVersionType14 TargetVersionType = "14" TargetVersionType15 TargetVersionType = "15" @@ -1542,7 +1551,7 @@ const ( ) func TargetVersionTypeChoices() []string { - return []string{"12", "13", "14", "15", "16"} + return []string{"13", "14", "15", "16"} } type TaskType string diff --git a/handler/serviceintegration/serviceintegration.go b/handler/serviceintegration/serviceintegration.go index 07c8643..5d25f81 100644 --- a/handler/serviceintegration/serviceintegration.go +++ b/handler/serviceintegration/serviceintegration.go @@ -10,62 +10,62 @@ import ( type Handler interface { // ServiceIntegrationCreate create a new service integration - // POST /project/{project}/integration + // POST /v1/project/{project}/integration // https://api.aiven.io/doc/#tag/Service_Integrations/operation/ServiceIntegrationCreate ServiceIntegrationCreate(ctx context.Context, project string, in *ServiceIntegrationCreateIn) (*ServiceIntegrationCreateOut, error) // ServiceIntegrationDelete delete a service integration - // DELETE /project/{project}/integration/{integration_id} + // DELETE /v1/project/{project}/integration/{integration_id} // https://api.aiven.io/doc/#tag/Service_Integrations/operation/ServiceIntegrationDelete ServiceIntegrationDelete(ctx context.Context, project string, integrationId string) error // ServiceIntegrationEndpointCreate create a new service integration endpoint - // POST /project/{project}/integration_endpoint + // POST /v1/project/{project}/integration_endpoint // https://api.aiven.io/doc/#tag/Service_Integrations/operation/ServiceIntegrationEndpointCreate ServiceIntegrationEndpointCreate(ctx context.Context, project string, in *ServiceIntegrationEndpointCreateIn) (*ServiceIntegrationEndpointCreateOut, error) // ServiceIntegrationEndpointDelete delete a service integration endpoint - // DELETE /project/{project}/integration_endpoint/{integration_endpoint_id} + // DELETE /v1/project/{project}/integration_endpoint/{integration_endpoint_id} // https://api.aiven.io/doc/#tag/Service_Integrations/operation/ServiceIntegrationEndpointDelete ServiceIntegrationEndpointDelete(ctx context.Context, project string, integrationEndpointId string) error // ServiceIntegrationEndpointGet get service integration endpoint - // GET /project/{project}/integration_endpoint/{integration_endpoint_id} + // GET /v1/project/{project}/integration_endpoint/{integration_endpoint_id} // https://api.aiven.io/doc/#tag/Service_Integrations/operation/ServiceIntegrationEndpointGet ServiceIntegrationEndpointGet(ctx context.Context, project string, integrationEndpointId string) (*ServiceIntegrationEndpointGetOut, error) // ServiceIntegrationEndpointList list available integration endpoints for project - // GET /project/{project}/integration_endpoint + // GET /v1/project/{project}/integration_endpoint // https://api.aiven.io/doc/#tag/Service_Integrations/operation/ServiceIntegrationEndpointList ServiceIntegrationEndpointList(ctx context.Context, project string) ([]ServiceIntegrationEndpointOut, error) // ServiceIntegrationEndpointTypes list available service integration endpoint types - // GET /project/{project}/integration_endpoint_types + // GET /v1/project/{project}/integration_endpoint_types // https://api.aiven.io/doc/#tag/Service_Integrations/operation/ServiceIntegrationEndpointTypes ServiceIntegrationEndpointTypes(ctx context.Context, project string) ([]EndpointTypeOut, error) // ServiceIntegrationEndpointUpdate update service integration endpoint - // PUT /project/{project}/integration_endpoint/{integration_endpoint_id} + // PUT /v1/project/{project}/integration_endpoint/{integration_endpoint_id} // https://api.aiven.io/doc/#tag/Service_Integrations/operation/ServiceIntegrationEndpointUpdate ServiceIntegrationEndpointUpdate(ctx context.Context, project string, integrationEndpointId string, in *ServiceIntegrationEndpointUpdateIn) (*ServiceIntegrationEndpointUpdateOut, error) // ServiceIntegrationGet get service integration - // GET /project/{project}/integration/{integration_id} + // GET /v1/project/{project}/integration/{integration_id} // https://api.aiven.io/doc/#tag/Service_Integrations/operation/ServiceIntegrationGet ServiceIntegrationGet(ctx context.Context, project string, integrationId string) (*ServiceIntegrationGetOut, error) // ServiceIntegrationList list available integrations for a service - // GET /project/{project}/service/{service_name}/integration + // GET /v1/project/{project}/service/{service_name}/integration // https://api.aiven.io/doc/#tag/Service_Integrations/operation/ServiceIntegrationList ServiceIntegrationList(ctx context.Context, project string, serviceName string) ([]ServiceIntegrationOut, error) // ServiceIntegrationTypes list available service integration types - // GET /project/{project}/integration_types + // GET /v1/project/{project}/integration_types // https://api.aiven.io/doc/#tag/Service_Integrations/operation/ServiceIntegrationTypes ServiceIntegrationTypes(ctx context.Context, project string) ([]IntegrationTypeOut, error) // ServiceIntegrationUpdate update a service integration - // PUT /project/{project}/integration/{integration_id} + // PUT /v1/project/{project}/integration/{integration_id} // https://api.aiven.io/doc/#tag/Service_Integrations/operation/ServiceIntegrationUpdate ServiceIntegrationUpdate(ctx context.Context, project string, integrationId string, in *ServiceIntegrationUpdateIn) (*ServiceIntegrationUpdateOut, error) } @@ -83,7 +83,7 @@ type ServiceIntegrationHandler struct { } func (h *ServiceIntegrationHandler) ServiceIntegrationCreate(ctx context.Context, project string, in *ServiceIntegrationCreateIn) (*ServiceIntegrationCreateOut, error) { - path := fmt.Sprintf("/project/%s/integration", project) + path := fmt.Sprintf("/v1/project/%s/integration", project) b, err := h.doer.Do(ctx, "ServiceIntegrationCreate", "POST", path, in) if err != nil { return nil, err @@ -96,12 +96,12 @@ func (h *ServiceIntegrationHandler) ServiceIntegrationCreate(ctx context.Context return &out.ServiceIntegration, nil } func (h *ServiceIntegrationHandler) ServiceIntegrationDelete(ctx context.Context, project string, integrationId string) error { - path := fmt.Sprintf("/project/%s/integration/%s", project, integrationId) + path := fmt.Sprintf("/v1/project/%s/integration/%s", project, integrationId) _, err := h.doer.Do(ctx, "ServiceIntegrationDelete", "DELETE", path, nil) return err } func (h *ServiceIntegrationHandler) ServiceIntegrationEndpointCreate(ctx context.Context, project string, in *ServiceIntegrationEndpointCreateIn) (*ServiceIntegrationEndpointCreateOut, error) { - path := fmt.Sprintf("/project/%s/integration_endpoint", project) + path := fmt.Sprintf("/v1/project/%s/integration_endpoint", project) b, err := h.doer.Do(ctx, "ServiceIntegrationEndpointCreate", "POST", path, in) if err != nil { return nil, err @@ -114,12 +114,12 @@ func (h *ServiceIntegrationHandler) ServiceIntegrationEndpointCreate(ctx context return &out.ServiceIntegrationEndpoint, nil } func (h *ServiceIntegrationHandler) ServiceIntegrationEndpointDelete(ctx context.Context, project string, integrationEndpointId string) error { - path := fmt.Sprintf("/project/%s/integration_endpoint/%s", project, integrationEndpointId) + path := fmt.Sprintf("/v1/project/%s/integration_endpoint/%s", project, integrationEndpointId) _, err := h.doer.Do(ctx, "ServiceIntegrationEndpointDelete", "DELETE", path, nil) return err } func (h *ServiceIntegrationHandler) ServiceIntegrationEndpointGet(ctx context.Context, project string, integrationEndpointId string) (*ServiceIntegrationEndpointGetOut, error) { - path := fmt.Sprintf("/project/%s/integration_endpoint/%s", project, integrationEndpointId) + path := fmt.Sprintf("/v1/project/%s/integration_endpoint/%s", project, integrationEndpointId) b, err := h.doer.Do(ctx, "ServiceIntegrationEndpointGet", "GET", path, nil) if err != nil { return nil, err @@ -132,7 +132,7 @@ func (h *ServiceIntegrationHandler) ServiceIntegrationEndpointGet(ctx context.Co return &out.ServiceIntegrationEndpoint, nil } func (h *ServiceIntegrationHandler) ServiceIntegrationEndpointList(ctx context.Context, project string) ([]ServiceIntegrationEndpointOut, error) { - path := fmt.Sprintf("/project/%s/integration_endpoint", project) + path := fmt.Sprintf("/v1/project/%s/integration_endpoint", project) b, err := h.doer.Do(ctx, "ServiceIntegrationEndpointList", "GET", path, nil) if err != nil { return nil, err @@ -145,7 +145,7 @@ func (h *ServiceIntegrationHandler) ServiceIntegrationEndpointList(ctx context.C return out.ServiceIntegrationEndpoints, nil } func (h *ServiceIntegrationHandler) ServiceIntegrationEndpointTypes(ctx context.Context, project string) ([]EndpointTypeOut, error) { - path := fmt.Sprintf("/project/%s/integration_endpoint_types", project) + path := fmt.Sprintf("/v1/project/%s/integration_endpoint_types", project) b, err := h.doer.Do(ctx, "ServiceIntegrationEndpointTypes", "GET", path, nil) if err != nil { return nil, err @@ -158,7 +158,7 @@ func (h *ServiceIntegrationHandler) ServiceIntegrationEndpointTypes(ctx context. return out.EndpointTypes, nil } func (h *ServiceIntegrationHandler) ServiceIntegrationEndpointUpdate(ctx context.Context, project string, integrationEndpointId string, in *ServiceIntegrationEndpointUpdateIn) (*ServiceIntegrationEndpointUpdateOut, error) { - path := fmt.Sprintf("/project/%s/integration_endpoint/%s", project, integrationEndpointId) + path := fmt.Sprintf("/v1/project/%s/integration_endpoint/%s", project, integrationEndpointId) b, err := h.doer.Do(ctx, "ServiceIntegrationEndpointUpdate", "PUT", path, in) if err != nil { return nil, err @@ -171,7 +171,7 @@ func (h *ServiceIntegrationHandler) ServiceIntegrationEndpointUpdate(ctx context return &out.ServiceIntegrationEndpoint, nil } func (h *ServiceIntegrationHandler) ServiceIntegrationGet(ctx context.Context, project string, integrationId string) (*ServiceIntegrationGetOut, error) { - path := fmt.Sprintf("/project/%s/integration/%s", project, integrationId) + path := fmt.Sprintf("/v1/project/%s/integration/%s", project, integrationId) b, err := h.doer.Do(ctx, "ServiceIntegrationGet", "GET", path, nil) if err != nil { return nil, err @@ -184,7 +184,7 @@ func (h *ServiceIntegrationHandler) ServiceIntegrationGet(ctx context.Context, p return &out.ServiceIntegration, nil } func (h *ServiceIntegrationHandler) ServiceIntegrationList(ctx context.Context, project string, serviceName string) ([]ServiceIntegrationOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/integration", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/integration", project, serviceName) b, err := h.doer.Do(ctx, "ServiceIntegrationList", "GET", path, nil) if err != nil { return nil, err @@ -197,7 +197,7 @@ func (h *ServiceIntegrationHandler) ServiceIntegrationList(ctx context.Context, return out.ServiceIntegrations, nil } func (h *ServiceIntegrationHandler) ServiceIntegrationTypes(ctx context.Context, project string) ([]IntegrationTypeOut, error) { - path := fmt.Sprintf("/project/%s/integration_types", project) + path := fmt.Sprintf("/v1/project/%s/integration_types", project) b, err := h.doer.Do(ctx, "ServiceIntegrationTypes", "GET", path, nil) if err != nil { return nil, err @@ -210,7 +210,7 @@ func (h *ServiceIntegrationHandler) ServiceIntegrationTypes(ctx context.Context, return out.IntegrationTypes, nil } func (h *ServiceIntegrationHandler) ServiceIntegrationUpdate(ctx context.Context, project string, integrationId string, in *ServiceIntegrationUpdateIn) (*ServiceIntegrationUpdateOut, error) { - path := fmt.Sprintf("/project/%s/integration/%s", project, integrationId) + path := fmt.Sprintf("/v1/project/%s/integration/%s", project, integrationId) b, err := h.doer.Do(ctx, "ServiceIntegrationUpdate", "PUT", path, in) if err != nil { return nil, err @@ -241,13 +241,14 @@ const ( EndpointTypeExternalPostgresql EndpointType = "external_postgresql" EndpointTypeExternalRedis EndpointType = "external_redis" EndpointTypeExternalSchemaRegistry EndpointType = "external_schema_registry" + EndpointTypeExternalSumologicLogs EndpointType = "external_sumologic_logs" EndpointTypeJolokia EndpointType = "jolokia" EndpointTypePrometheus EndpointType = "prometheus" EndpointTypeRsyslog EndpointType = "rsyslog" ) func EndpointTypeChoices() []string { - return []string{"autoscaler", "datadog", "external_aws_cloudwatch_logs", "external_aws_cloudwatch_metrics", "external_aws_s3", "external_clickhouse", "external_elasticsearch_logs", "external_google_cloud_bigquery", "external_google_cloud_logging", "external_kafka", "external_mysql", "external_opensearch_logs", "external_postgresql", "external_redis", "external_schema_registry", "jolokia", "prometheus", "rsyslog"} + return []string{"autoscaler", "datadog", "external_aws_cloudwatch_logs", "external_aws_cloudwatch_metrics", "external_aws_s3", "external_clickhouse", "external_elasticsearch_logs", "external_google_cloud_bigquery", "external_google_cloud_logging", "external_kafka", "external_mysql", "external_opensearch_logs", "external_postgresql", "external_redis", "external_schema_registry", "external_sumologic_logs", "jolokia", "prometheus", "rsyslog"} } type EndpointTypeOut struct { @@ -295,6 +296,7 @@ const ( IntegrationTypeFlink IntegrationType = "flink" IntegrationTypeFlinkExternalBigquery IntegrationType = "flink_external_bigquery" IntegrationTypeFlinkExternalKafka IntegrationType = "flink_external_kafka" + IntegrationTypeFlinkExternalPostgresql IntegrationType = "flink_external_postgresql" IntegrationTypeInternalConnectivity IntegrationType = "internal_connectivity" IntegrationTypeJolokia IntegrationType = "jolokia" IntegrationTypeKafkaConnect IntegrationType = "kafka_connect" @@ -320,7 +322,7 @@ const ( ) func IntegrationTypeChoices() []string { - return []string{"alertmanager", "autoscaler", "caching", "cassandra_cross_service_cluster", "clickhouse_credentials", "clickhouse_kafka", "clickhouse_postgresql", "dashboard", "datadog", "datasource", "external_aws_cloudwatch_logs", "external_aws_cloudwatch_metrics", "external_elasticsearch_logs", "external_google_cloud_logging", "external_opensearch_logs", "flink", "flink_external_bigquery", "flink_external_kafka", "internal_connectivity", "jolokia", "kafka_connect", "kafka_connect_postgresql", "kafka_logs", "kafka_mirrormaker", "logs", "m3aggregator", "m3coordinator", "metrics", "opensearch_cross_cluster_replication", "opensearch_cross_cluster_search", "prometheus", "read_replica", "rsyslog", "schema_registry_proxy", "stresstester", "thanoscompactor", "thanosquery", "thanosstore", "vector", "vmalert"} + return []string{"alertmanager", "autoscaler", "caching", "cassandra_cross_service_cluster", "clickhouse_credentials", "clickhouse_kafka", "clickhouse_postgresql", "dashboard", "datadog", "datasource", "external_aws_cloudwatch_logs", "external_aws_cloudwatch_metrics", "external_elasticsearch_logs", "external_google_cloud_logging", "external_opensearch_logs", "flink", "flink_external_bigquery", "flink_external_kafka", "flink_external_postgresql", "internal_connectivity", "jolokia", "kafka_connect", "kafka_connect_postgresql", "kafka_logs", "kafka_mirrormaker", "logs", "m3aggregator", "m3coordinator", "metrics", "opensearch_cross_cluster_replication", "opensearch_cross_cluster_search", "prometheus", "read_replica", "rsyslog", "schema_registry_proxy", "stresstester", "thanoscompactor", "thanosquery", "thanosstore", "vector", "vmalert"} } type IntegrationTypeOut struct { diff --git a/handler/serviceuser/serviceuser.go b/handler/serviceuser/serviceuser.go index c44d991..5df599a 100644 --- a/handler/serviceuser/serviceuser.go +++ b/handler/serviceuser/serviceuser.go @@ -11,27 +11,27 @@ import ( type Handler interface { // ServiceUserCreate create a new (sub) user for service - // POST /project/{project}/service/{service_name}/user + // POST /v1/project/{project}/service/{service_name}/user // https://api.aiven.io/doc/#tag/Service/operation/ServiceUserCreate ServiceUserCreate(ctx context.Context, project string, serviceName string, in *ServiceUserCreateIn) (*ServiceUserCreateOut, error) // ServiceUserCredentialsModify modify service user credentials - // PUT /project/{project}/service/{service_name}/user/{service_username} + // PUT /v1/project/{project}/service/{service_name}/user/{service_username} // https://api.aiven.io/doc/#tag/Service/operation/ServiceUserCredentialsModify ServiceUserCredentialsModify(ctx context.Context, project string, serviceName string, serviceUsername string, in *ServiceUserCredentialsModifyIn) (*ServiceUserCredentialsModifyOut, error) // ServiceUserCredentialsReset reset service user credentials - // PUT /project/{project}/service/{service_name}/user/{service_username}/credentials/reset + // PUT /v1/project/{project}/service/{service_name}/user/{service_username}/credentials/reset // https://api.aiven.io/doc/#tag/Service/operation/ServiceUserCredentialsReset ServiceUserCredentialsReset(ctx context.Context, project string, serviceName string, serviceUsername string) (*ServiceUserCredentialsResetOut, error) // ServiceUserDelete delete a service user - // DELETE /project/{project}/service/{service_name}/user/{service_username} + // DELETE /v1/project/{project}/service/{service_name}/user/{service_username} // https://api.aiven.io/doc/#tag/Service/operation/ServiceUserDelete ServiceUserDelete(ctx context.Context, project string, serviceName string, serviceUsername string) error // ServiceUserGet get details for a single user - // GET /project/{project}/service/{service_name}/user/{service_username} + // GET /v1/project/{project}/service/{service_name}/user/{service_username} // https://api.aiven.io/doc/#tag/Service/operation/ServiceUserGet ServiceUserGet(ctx context.Context, project string, serviceName string, serviceUsername string) (*ServiceUserGetOut, error) } @@ -49,7 +49,7 @@ type ServiceUserHandler struct { } func (h *ServiceUserHandler) ServiceUserCreate(ctx context.Context, project string, serviceName string, in *ServiceUserCreateIn) (*ServiceUserCreateOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/user", project, serviceName) + path := fmt.Sprintf("/v1/project/%s/service/%s/user", project, serviceName) b, err := h.doer.Do(ctx, "ServiceUserCreate", "POST", path, in) if err != nil { return nil, err @@ -62,7 +62,7 @@ func (h *ServiceUserHandler) ServiceUserCreate(ctx context.Context, project stri return &out.User, nil } func (h *ServiceUserHandler) ServiceUserCredentialsModify(ctx context.Context, project string, serviceName string, serviceUsername string, in *ServiceUserCredentialsModifyIn) (*ServiceUserCredentialsModifyOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/user/%s", project, serviceName, serviceUsername) + path := fmt.Sprintf("/v1/project/%s/service/%s/user/%s", project, serviceName, serviceUsername) b, err := h.doer.Do(ctx, "ServiceUserCredentialsModify", "PUT", path, in) if err != nil { return nil, err @@ -75,7 +75,7 @@ func (h *ServiceUserHandler) ServiceUserCredentialsModify(ctx context.Context, p return &out.Service, nil } func (h *ServiceUserHandler) ServiceUserCredentialsReset(ctx context.Context, project string, serviceName string, serviceUsername string) (*ServiceUserCredentialsResetOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/user/%s/credentials/reset", project, serviceName, serviceUsername) + path := fmt.Sprintf("/v1/project/%s/service/%s/user/%s/credentials/reset", project, serviceName, serviceUsername) b, err := h.doer.Do(ctx, "ServiceUserCredentialsReset", "PUT", path, nil) if err != nil { return nil, err @@ -88,12 +88,12 @@ func (h *ServiceUserHandler) ServiceUserCredentialsReset(ctx context.Context, pr return &out.Service, nil } func (h *ServiceUserHandler) ServiceUserDelete(ctx context.Context, project string, serviceName string, serviceUsername string) error { - path := fmt.Sprintf("/project/%s/service/%s/user/%s", project, serviceName, serviceUsername) + path := fmt.Sprintf("/v1/project/%s/service/%s/user/%s", project, serviceName, serviceUsername) _, err := h.doer.Do(ctx, "ServiceUserDelete", "DELETE", path, nil) return err } func (h *ServiceUserHandler) ServiceUserGet(ctx context.Context, project string, serviceName string, serviceUsername string) (*ServiceUserGetOut, error) { - path := fmt.Sprintf("/project/%s/service/%s/user/%s", project, serviceName, serviceUsername) + path := fmt.Sprintf("/v1/project/%s/service/%s/user/%s", project, serviceName, serviceUsername) b, err := h.doer.Do(ctx, "ServiceUserGet", "GET", path, nil) if err != nil { return nil, err diff --git a/handler/staticip/staticip.go b/handler/staticip/staticip.go index 0411763..2b195a3 100644 --- a/handler/staticip/staticip.go +++ b/handler/staticip/staticip.go @@ -10,37 +10,37 @@ import ( type Handler interface { // ProjectStaticIPAssociate associate a static IP address with a service - // POST /project/{project}/static-ips/{static_ip_address_id}/association + // POST /v1/project/{project}/static-ips/{static_ip_address_id}/association // https://api.aiven.io/doc/#tag/StaticIP/operation/ProjectStaticIPAssociate ProjectStaticIPAssociate(ctx context.Context, project string, staticIpAddressId string, in *ProjectStaticIpassociateIn) (*ProjectStaticIpassociateOut, error) // ProjectStaticIPAvailabilityList list static IP address cloud availability and prices for a project - // GET /project/{project}/static-ip-availability + // GET /v1/project/{project}/static-ip-availability // https://api.aiven.io/doc/#tag/StaticIP/operation/ProjectStaticIPAvailabilityList ProjectStaticIPAvailabilityList(ctx context.Context, project string) ([]StaticIpAddressAvailabilityOut, error) // ProjectStaticIPDissociate dissociate a static IP address from a service - // DELETE /project/{project}/static-ips/{static_ip_address_id}/association + // DELETE /v1/project/{project}/static-ips/{static_ip_address_id}/association // https://api.aiven.io/doc/#tag/StaticIP/operation/ProjectStaticIPDissociate ProjectStaticIPDissociate(ctx context.Context, project string, staticIpAddressId string) (*ProjectStaticIpdissociateOut, error) // ProjectStaticIPPatch update a static IP address configuration - // PATCH /project/{project}/static-ips/{static_ip_address_id} + // PATCH /v1/project/{project}/static-ips/{static_ip_address_id} // https://api.aiven.io/doc/#tag/StaticIP/operation/ProjectStaticIPPatch ProjectStaticIPPatch(ctx context.Context, project string, staticIpAddressId string, in *ProjectStaticIppatchIn) (*ProjectStaticIppatchOut, error) // PublicStaticIPAvailabilityList list static IP clouds and prices - // GET /tenants/{tenant}/static-ip-availability + // GET /v1/tenants/{tenant}/static-ip-availability // https://api.aiven.io/doc/#tag/Cloud_platforms/operation/PublicStaticIPAvailabilityList PublicStaticIPAvailabilityList(ctx context.Context, tenant string) ([]StaticIpAddressAvailabilityOut, error) // StaticIPCreate create static IP address - // POST /project/{project}/static-ips + // POST /v1/project/{project}/static-ips // https://api.aiven.io/doc/#tag/StaticIP/operation/StaticIPCreate StaticIPCreate(ctx context.Context, project string, in *StaticIpcreateIn) (*StaticIpcreateOut, error) // StaticIPList list static IP addresses - // GET /project/{project}/static-ips + // GET /v1/project/{project}/static-ips // https://api.aiven.io/doc/#tag/StaticIP/operation/StaticIPList StaticIPList(ctx context.Context, project string) ([]StaticIpOut, error) } @@ -58,7 +58,7 @@ type StaticIPHandler struct { } func (h *StaticIPHandler) ProjectStaticIPAssociate(ctx context.Context, project string, staticIpAddressId string, in *ProjectStaticIpassociateIn) (*ProjectStaticIpassociateOut, error) { - path := fmt.Sprintf("/project/%s/static-ips/%s/association", project, staticIpAddressId) + path := fmt.Sprintf("/v1/project/%s/static-ips/%s/association", project, staticIpAddressId) b, err := h.doer.Do(ctx, "ProjectStaticIPAssociate", "POST", path, in) if err != nil { return nil, err @@ -71,7 +71,7 @@ func (h *StaticIPHandler) ProjectStaticIPAssociate(ctx context.Context, project return out, nil } func (h *StaticIPHandler) ProjectStaticIPAvailabilityList(ctx context.Context, project string) ([]StaticIpAddressAvailabilityOut, error) { - path := fmt.Sprintf("/project/%s/static-ip-availability", project) + path := fmt.Sprintf("/v1/project/%s/static-ip-availability", project) b, err := h.doer.Do(ctx, "ProjectStaticIPAvailabilityList", "GET", path, nil) if err != nil { return nil, err @@ -84,7 +84,7 @@ func (h *StaticIPHandler) ProjectStaticIPAvailabilityList(ctx context.Context, p return out.StaticIpAddressAvailability, nil } func (h *StaticIPHandler) ProjectStaticIPDissociate(ctx context.Context, project string, staticIpAddressId string) (*ProjectStaticIpdissociateOut, error) { - path := fmt.Sprintf("/project/%s/static-ips/%s/association", project, staticIpAddressId) + path := fmt.Sprintf("/v1/project/%s/static-ips/%s/association", project, staticIpAddressId) b, err := h.doer.Do(ctx, "ProjectStaticIPDissociate", "DELETE", path, nil) if err != nil { return nil, err @@ -97,7 +97,7 @@ func (h *StaticIPHandler) ProjectStaticIPDissociate(ctx context.Context, project return out, nil } func (h *StaticIPHandler) ProjectStaticIPPatch(ctx context.Context, project string, staticIpAddressId string, in *ProjectStaticIppatchIn) (*ProjectStaticIppatchOut, error) { - path := fmt.Sprintf("/project/%s/static-ips/%s", project, staticIpAddressId) + path := fmt.Sprintf("/v1/project/%s/static-ips/%s", project, staticIpAddressId) b, err := h.doer.Do(ctx, "ProjectStaticIPPatch", "PATCH", path, in) if err != nil { return nil, err @@ -110,7 +110,7 @@ func (h *StaticIPHandler) ProjectStaticIPPatch(ctx context.Context, project stri return out, nil } func (h *StaticIPHandler) PublicStaticIPAvailabilityList(ctx context.Context, tenant string) ([]StaticIpAddressAvailabilityOut, error) { - path := fmt.Sprintf("/tenants/%s/static-ip-availability", tenant) + path := fmt.Sprintf("/v1/tenants/%s/static-ip-availability", tenant) b, err := h.doer.Do(ctx, "PublicStaticIPAvailabilityList", "GET", path, nil) if err != nil { return nil, err @@ -123,7 +123,7 @@ func (h *StaticIPHandler) PublicStaticIPAvailabilityList(ctx context.Context, te return out.StaticIpAddressAvailability, nil } func (h *StaticIPHandler) StaticIPCreate(ctx context.Context, project string, in *StaticIpcreateIn) (*StaticIpcreateOut, error) { - path := fmt.Sprintf("/project/%s/static-ips", project) + path := fmt.Sprintf("/v1/project/%s/static-ips", project) b, err := h.doer.Do(ctx, "StaticIPCreate", "POST", path, in) if err != nil { return nil, err @@ -136,7 +136,7 @@ func (h *StaticIPHandler) StaticIPCreate(ctx context.Context, project string, in return out, nil } func (h *StaticIPHandler) StaticIPList(ctx context.Context, project string) ([]StaticIpOut, error) { - path := fmt.Sprintf("/project/%s/static-ips", project) + path := fmt.Sprintf("/v1/project/%s/static-ips", project) b, err := h.doer.Do(ctx, "StaticIPList", "GET", path, nil) if err != nil { return nil, err diff --git a/handler/user/user.go b/handler/user/user.go index d47487a..32515ee 100644 --- a/handler/user/user.go +++ b/handler/user/user.go @@ -11,132 +11,127 @@ import ( type Handler interface { // AccessTokenCreate create new access token - // POST /access_token + // POST /v1/access_token // https://api.aiven.io/doc/#tag/Users/operation/AccessTokenCreate AccessTokenCreate(ctx context.Context, in *AccessTokenCreateIn) (*AccessTokenCreateOut, error) // AccessTokenList list all valid access tokens - // GET /access_token + // GET /v1/access_token // https://api.aiven.io/doc/#tag/Users/operation/AccessTokenList AccessTokenList(ctx context.Context) ([]TokenOut, error) // AccessTokenRevoke revoke an access token - // DELETE /access_token/{token_prefix} + // DELETE /v1/access_token/{token_prefix} // https://api.aiven.io/doc/#tag/Users/operation/AccessTokenRevoke AccessTokenRevoke(ctx context.Context, tokenPrefix string) error // AccessTokenUpdate update an existing access token - // PUT /access_token/{token_prefix} + // PUT /v1/access_token/{token_prefix} // https://api.aiven.io/doc/#tag/Users/operation/AccessTokenUpdate AccessTokenUpdate(ctx context.Context, tokenPrefix string, in *AccessTokenUpdateIn) (*AccessTokenUpdateOut, error) // CheckPasswordStrengthExistingUser check password strength for an existing user - // POST /me/password_strength + // POST /v1/me/password_strength // https://api.aiven.io/doc/#tag/Users/operation/CheckPasswordStrengthExistingUser CheckPasswordStrengthExistingUser(ctx context.Context, in *CheckPasswordStrengthExistingUserIn) (*CheckPasswordStrengthExistingUserOut, error) // CheckPasswordStrengthNewUser check password strength for a new user - // POST /user/password_strength + // POST /v1/user/password_strength // https://api.aiven.io/doc/#tag/Users/operation/CheckPasswordStrengthNewUser CheckPasswordStrengthNewUser(ctx context.Context, in *CheckPasswordStrengthNewUserIn) (*CheckPasswordStrengthNewUserOut, error) // OrganizationMemberGroupsList list user groups of the organization's member - // GET /organization/{organization_id}/user/{member_user_id}/user-groups + // GET /v1/organization/{organization_id}/user/{member_user_id}/user-groups // https://api.aiven.io/doc/#tag/Users/operation/OrganizationMemberGroupsList OrganizationMemberGroupsList(ctx context.Context, organizationId string, memberUserId string) ([]UserGroupOut, error) // TwoFactorAuthConfigure configure two-factor authentication - // PUT /me/2fa + // PUT /v1/me/2fa // https://api.aiven.io/doc/#tag/Users/operation/TwoFactorAuthConfigure TwoFactorAuthConfigure(ctx context.Context, in *TwoFactorAuthConfigureIn) (*TwoFactorAuthConfigureOut, error) // TwoFactorAuthConfigureOTP complete one-time password configuration - // PUT /me/2fa/otp + // PUT /v1/me/2fa/otp // https://api.aiven.io/doc/#tag/Users/operation/TwoFactorAuthConfigureOTP TwoFactorAuthConfigureOTP(ctx context.Context, in *TwoFactorAuthConfigureOtpIn) (*TwoFactorAuthConfigureOtpOut, error) // UserAccountInvitesAccept accept all invites for a single account - // POST /me/account/invites/accept + // POST /v1/me/account/invites/accept // https://api.aiven.io/doc/#tag/Users/operation/UserAccountInvitesAccept UserAccountInvitesAccept(ctx context.Context, in *UserAccountInvitesAcceptIn) ([]AccountInviteOut, error) // UserAccountInvitesList list pending account invites - // GET /me/account/invites + // GET /v1/me/account/invites // https://api.aiven.io/doc/#tag/Users/operation/UserAccountInvitesList UserAccountInvitesList(ctx context.Context) ([]AccountInviteOut, error) // UserAuth authenticate user - // POST /userauth + // POST /v1/userauth // https://api.aiven.io/doc/#tag/Users/operation/UserAuth UserAuth(ctx context.Context, in *UserAuthIn) (*UserAuthOut, error) // UserAuthLoginOptions get available login options - // POST /userauth/login_options + // POST /v1/userauth/login_options // https://api.aiven.io/doc/#tag/Users/operation/UserAuthLoginOptions UserAuthLoginOptions(ctx context.Context, in *UserAuthLoginOptionsIn) (*UserAuthLoginOptionsOut, error) // UserAuthenticationMethodDelete delete linked authentication method, and revoke all associated access tokens - // DELETE /me/authentication_methods/{user_authentication_method_id} + // DELETE /v1/me/authentication_methods/{user_authentication_method_id} // https://api.aiven.io/doc/#tag/Users/operation/UserAuthenticationMethodDelete UserAuthenticationMethodDelete(ctx context.Context, userAuthenticationMethodId string) error // UserAuthenticationMethodsList list linked authentication methods - // GET /me/authentication_methods + // GET /v1/me/authentication_methods // https://api.aiven.io/doc/#tag/Users/operation/UserAuthenticationMethodsList UserAuthenticationMethodsList(ctx context.Context) ([]AuthenticationMethodOut, error) - // UserCreate create a user - // POST /user - // https://api.aiven.io/doc/#tag/Users/operation/UserCreate - UserCreate(ctx context.Context, in *UserCreateIn) (*UserCreateOut, error) - // UserExpireTokens expire all authorization tokens - // POST /me/expire_tokens + // POST /v1/me/expire_tokens // https://api.aiven.io/doc/#tag/Users/operation/UserExpireTokens UserExpireTokens(ctx context.Context) error // UserInfo get information for the current session's user - // GET /me + // GET /v1/me // https://api.aiven.io/doc/#tag/Users/operation/UserInfo UserInfo(ctx context.Context) (*UserInfoOut, error) // UserLogout logout user, removing current authentication token - // POST /me/logout + // POST /v1/me/logout // https://api.aiven.io/doc/#tag/Users/operation/UserLogout UserLogout(ctx context.Context) error // UserPasswordChange change user password - // PUT /me/password + // PUT /v1/me/password // https://api.aiven.io/doc/#tag/Users/operation/UserPasswordChange UserPasswordChange(ctx context.Context, in *UserPasswordChangeIn) (string, error) // UserPasswordReset confirm user password reset - // POST /user/password_reset/{verification_code} + // POST /v1/user/password_reset/{verification_code} // https://api.aiven.io/doc/#tag/Users/operation/UserPasswordReset UserPasswordReset(ctx context.Context, verificationCode string, in *UserPasswordResetIn) error // UserPasswordResetRequest request user password reset - // POST /user/password_reset_request + // POST /v1/user/password_reset_request // https://api.aiven.io/doc/#tag/Users/operation/UserPasswordResetRequest UserPasswordResetRequest(ctx context.Context, in *UserPasswordResetRequestIn) error // UserUpdate edit profile - // PATCH /me + // PATCH /v1/me // https://api.aiven.io/doc/#tag/Users/operation/UserUpdate UserUpdate(ctx context.Context, in *UserUpdateIn) (*UserUpdateOut, error) // UserVerifyEmail confirm user email address - // POST /user/verify_email/{verification_code} + // POST /v1/user/verify_email/{verification_code} // https://api.aiven.io/doc/#tag/Users/operation/UserVerifyEmail UserVerifyEmail(ctx context.Context, verificationCode string) (*UserVerifyEmailOut, error) // ValidateCreditCode validate campaign credit code - // GET /user/credit_code/{credit_code} + // GET /v1/user/credit_code/{credit_code} // https://api.aiven.io/doc/#tag/Users/operation/ValidateCreditCode ValidateCreditCode(ctx context.Context, creditCode string) error // ValidateReferralCode validate referral_code code - // GET /me/referral/validation/{referral_code} + // GET /v1/me/referral/validation/{referral_code} // https://api.aiven.io/doc/#tag/Users/operation/ValidateReferralCode ValidateReferralCode(ctx context.Context, referralCode string) error } @@ -154,7 +149,7 @@ type UserHandler struct { } func (h *UserHandler) AccessTokenCreate(ctx context.Context, in *AccessTokenCreateIn) (*AccessTokenCreateOut, error) { - path := fmt.Sprintf("/access_token") + path := fmt.Sprintf("/v1/access_token") b, err := h.doer.Do(ctx, "AccessTokenCreate", "POST", path, in) if err != nil { return nil, err @@ -167,7 +162,7 @@ func (h *UserHandler) AccessTokenCreate(ctx context.Context, in *AccessTokenCrea return out, nil } func (h *UserHandler) AccessTokenList(ctx context.Context) ([]TokenOut, error) { - path := fmt.Sprintf("/access_token") + path := fmt.Sprintf("/v1/access_token") b, err := h.doer.Do(ctx, "AccessTokenList", "GET", path, nil) if err != nil { return nil, err @@ -180,12 +175,12 @@ func (h *UserHandler) AccessTokenList(ctx context.Context) ([]TokenOut, error) { return out.Tokens, nil } func (h *UserHandler) AccessTokenRevoke(ctx context.Context, tokenPrefix string) error { - path := fmt.Sprintf("/access_token/%s", tokenPrefix) + path := fmt.Sprintf("/v1/access_token/%s", tokenPrefix) _, err := h.doer.Do(ctx, "AccessTokenRevoke", "DELETE", path, nil) return err } func (h *UserHandler) AccessTokenUpdate(ctx context.Context, tokenPrefix string, in *AccessTokenUpdateIn) (*AccessTokenUpdateOut, error) { - path := fmt.Sprintf("/access_token/%s", tokenPrefix) + path := fmt.Sprintf("/v1/access_token/%s", tokenPrefix) b, err := h.doer.Do(ctx, "AccessTokenUpdate", "PUT", path, in) if err != nil { return nil, err @@ -198,7 +193,7 @@ func (h *UserHandler) AccessTokenUpdate(ctx context.Context, tokenPrefix string, return out, nil } func (h *UserHandler) CheckPasswordStrengthExistingUser(ctx context.Context, in *CheckPasswordStrengthExistingUserIn) (*CheckPasswordStrengthExistingUserOut, error) { - path := fmt.Sprintf("/me/password_strength") + path := fmt.Sprintf("/v1/me/password_strength") b, err := h.doer.Do(ctx, "CheckPasswordStrengthExistingUser", "POST", path, in) if err != nil { return nil, err @@ -211,7 +206,7 @@ func (h *UserHandler) CheckPasswordStrengthExistingUser(ctx context.Context, in return &out.PasswordStrength, nil } func (h *UserHandler) CheckPasswordStrengthNewUser(ctx context.Context, in *CheckPasswordStrengthNewUserIn) (*CheckPasswordStrengthNewUserOut, error) { - path := fmt.Sprintf("/user/password_strength") + path := fmt.Sprintf("/v1/user/password_strength") b, err := h.doer.Do(ctx, "CheckPasswordStrengthNewUser", "POST", path, in) if err != nil { return nil, err @@ -224,7 +219,7 @@ func (h *UserHandler) CheckPasswordStrengthNewUser(ctx context.Context, in *Chec return &out.PasswordStrength, nil } func (h *UserHandler) OrganizationMemberGroupsList(ctx context.Context, organizationId string, memberUserId string) ([]UserGroupOut, error) { - path := fmt.Sprintf("/organization/%s/user/%s/user-groups", organizationId, memberUserId) + path := fmt.Sprintf("/v1/organization/%s/user/%s/user-groups", organizationId, memberUserId) b, err := h.doer.Do(ctx, "OrganizationMemberGroupsList", "GET", path, nil) if err != nil { return nil, err @@ -237,7 +232,7 @@ func (h *UserHandler) OrganizationMemberGroupsList(ctx context.Context, organiza return out.UserGroups, nil } func (h *UserHandler) TwoFactorAuthConfigure(ctx context.Context, in *TwoFactorAuthConfigureIn) (*TwoFactorAuthConfigureOut, error) { - path := fmt.Sprintf("/me/2fa") + path := fmt.Sprintf("/v1/me/2fa") b, err := h.doer.Do(ctx, "TwoFactorAuthConfigure", "PUT", path, in) if err != nil { return nil, err @@ -250,7 +245,7 @@ func (h *UserHandler) TwoFactorAuthConfigure(ctx context.Context, in *TwoFactorA return out, nil } func (h *UserHandler) TwoFactorAuthConfigureOTP(ctx context.Context, in *TwoFactorAuthConfigureOtpIn) (*TwoFactorAuthConfigureOtpOut, error) { - path := fmt.Sprintf("/me/2fa/otp") + path := fmt.Sprintf("/v1/me/2fa/otp") b, err := h.doer.Do(ctx, "TwoFactorAuthConfigureOTP", "PUT", path, in) if err != nil { return nil, err @@ -263,7 +258,7 @@ func (h *UserHandler) TwoFactorAuthConfigureOTP(ctx context.Context, in *TwoFact return out, nil } func (h *UserHandler) UserAccountInvitesAccept(ctx context.Context, in *UserAccountInvitesAcceptIn) ([]AccountInviteOut, error) { - path := fmt.Sprintf("/me/account/invites/accept") + path := fmt.Sprintf("/v1/me/account/invites/accept") b, err := h.doer.Do(ctx, "UserAccountInvitesAccept", "POST", path, in) if err != nil { return nil, err @@ -276,7 +271,7 @@ func (h *UserHandler) UserAccountInvitesAccept(ctx context.Context, in *UserAcco return out.AccountInvites, nil } func (h *UserHandler) UserAccountInvitesList(ctx context.Context) ([]AccountInviteOut, error) { - path := fmt.Sprintf("/me/account/invites") + path := fmt.Sprintf("/v1/me/account/invites") b, err := h.doer.Do(ctx, "UserAccountInvitesList", "GET", path, nil) if err != nil { return nil, err @@ -289,7 +284,7 @@ func (h *UserHandler) UserAccountInvitesList(ctx context.Context) ([]AccountInvi return out.AccountInvites, nil } func (h *UserHandler) UserAuth(ctx context.Context, in *UserAuthIn) (*UserAuthOut, error) { - path := fmt.Sprintf("/userauth") + path := fmt.Sprintf("/v1/userauth") b, err := h.doer.Do(ctx, "UserAuth", "POST", path, in) if err != nil { return nil, err @@ -302,7 +297,7 @@ func (h *UserHandler) UserAuth(ctx context.Context, in *UserAuthIn) (*UserAuthOu return out, nil } func (h *UserHandler) UserAuthLoginOptions(ctx context.Context, in *UserAuthLoginOptionsIn) (*UserAuthLoginOptionsOut, error) { - path := fmt.Sprintf("/userauth/login_options") + path := fmt.Sprintf("/v1/userauth/login_options") b, err := h.doer.Do(ctx, "UserAuthLoginOptions", "POST", path, in) if err != nil { return nil, err @@ -315,12 +310,12 @@ func (h *UserHandler) UserAuthLoginOptions(ctx context.Context, in *UserAuthLogi return out, nil } func (h *UserHandler) UserAuthenticationMethodDelete(ctx context.Context, userAuthenticationMethodId string) error { - path := fmt.Sprintf("/me/authentication_methods/%s", userAuthenticationMethodId) + path := fmt.Sprintf("/v1/me/authentication_methods/%s", userAuthenticationMethodId) _, err := h.doer.Do(ctx, "UserAuthenticationMethodDelete", "DELETE", path, nil) return err } func (h *UserHandler) UserAuthenticationMethodsList(ctx context.Context) ([]AuthenticationMethodOut, error) { - path := fmt.Sprintf("/me/authentication_methods") + path := fmt.Sprintf("/v1/me/authentication_methods") b, err := h.doer.Do(ctx, "UserAuthenticationMethodsList", "GET", path, nil) if err != nil { return nil, err @@ -332,26 +327,13 @@ func (h *UserHandler) UserAuthenticationMethodsList(ctx context.Context) ([]Auth } return out.AuthenticationMethods, nil } -func (h *UserHandler) UserCreate(ctx context.Context, in *UserCreateIn) (*UserCreateOut, error) { - path := fmt.Sprintf("/user") - b, err := h.doer.Do(ctx, "UserCreate", "POST", path, in) - if err != nil { - return nil, err - } - out := new(UserCreateOut) - err = json.Unmarshal(b, out) - if err != nil { - return nil, err - } - return out, nil -} func (h *UserHandler) UserExpireTokens(ctx context.Context) error { - path := fmt.Sprintf("/me/expire_tokens") + path := fmt.Sprintf("/v1/me/expire_tokens") _, err := h.doer.Do(ctx, "UserExpireTokens", "POST", path, nil) return err } func (h *UserHandler) UserInfo(ctx context.Context) (*UserInfoOut, error) { - path := fmt.Sprintf("/me") + path := fmt.Sprintf("/v1/me") b, err := h.doer.Do(ctx, "UserInfo", "GET", path, nil) if err != nil { return nil, err @@ -364,12 +346,12 @@ func (h *UserHandler) UserInfo(ctx context.Context) (*UserInfoOut, error) { return &out.User, nil } func (h *UserHandler) UserLogout(ctx context.Context) error { - path := fmt.Sprintf("/me/logout") + path := fmt.Sprintf("/v1/me/logout") _, err := h.doer.Do(ctx, "UserLogout", "POST", path, nil) return err } func (h *UserHandler) UserPasswordChange(ctx context.Context, in *UserPasswordChangeIn) (string, error) { - path := fmt.Sprintf("/me/password") + path := fmt.Sprintf("/v1/me/password") b, err := h.doer.Do(ctx, "UserPasswordChange", "PUT", path, in) if err != nil { return "", err @@ -382,17 +364,17 @@ func (h *UserHandler) UserPasswordChange(ctx context.Context, in *UserPasswordCh return out.Token, nil } func (h *UserHandler) UserPasswordReset(ctx context.Context, verificationCode string, in *UserPasswordResetIn) error { - path := fmt.Sprintf("/user/password_reset/%s", verificationCode) + path := fmt.Sprintf("/v1/user/password_reset/%s", verificationCode) _, err := h.doer.Do(ctx, "UserPasswordReset", "POST", path, in) return err } func (h *UserHandler) UserPasswordResetRequest(ctx context.Context, in *UserPasswordResetRequestIn) error { - path := fmt.Sprintf("/user/password_reset_request") + path := fmt.Sprintf("/v1/user/password_reset_request") _, err := h.doer.Do(ctx, "UserPasswordResetRequest", "POST", path, in) return err } func (h *UserHandler) UserUpdate(ctx context.Context, in *UserUpdateIn) (*UserUpdateOut, error) { - path := fmt.Sprintf("/me") + path := fmt.Sprintf("/v1/me") b, err := h.doer.Do(ctx, "UserUpdate", "PATCH", path, in) if err != nil { return nil, err @@ -405,7 +387,7 @@ func (h *UserHandler) UserUpdate(ctx context.Context, in *UserUpdateIn) (*UserUp return &out.User, nil } func (h *UserHandler) UserVerifyEmail(ctx context.Context, verificationCode string) (*UserVerifyEmailOut, error) { - path := fmt.Sprintf("/user/verify_email/%s", verificationCode) + path := fmt.Sprintf("/v1/user/verify_email/%s", verificationCode) b, err := h.doer.Do(ctx, "UserVerifyEmail", "POST", path, nil) if err != nil { return nil, err @@ -418,12 +400,12 @@ func (h *UserHandler) UserVerifyEmail(ctx context.Context, verificationCode stri return &out.InviteDetails, nil } func (h *UserHandler) ValidateCreditCode(ctx context.Context, creditCode string) error { - path := fmt.Sprintf("/user/credit_code/%s", creditCode) + path := fmt.Sprintf("/v1/user/credit_code/%s", creditCode) _, err := h.doer.Do(ctx, "ValidateCreditCode", "GET", path, nil) return err } func (h *UserHandler) ValidateReferralCode(ctx context.Context, referralCode string) error { - path := fmt.Sprintf("/me/referral/validation/%s", referralCode) + path := fmt.Sprintf("/v1/me/referral/validation/%s", referralCode) _, err := h.doer.Do(ctx, "ValidateReferralCode", "GET", path, nil) return err } @@ -635,27 +617,10 @@ type UserAuthOut struct { Token string `json:"token"` UserEmail string `json:"user_email"` } -type UserCreateIn struct { - Company string `json:"company,omitempty"` - CountryCode string `json:"country_code,omitempty"` - CreditCode string `json:"credit_code,omitempty"` - Email string `json:"email"` - EmailCommunicationCategories *[]string `json:"email_communication_categories,omitempty"` - Origin string `json:"origin,omitempty"` - Password string `json:"password,omitempty"` - RealName string `json:"real_name"` - State string `json:"state,omitempty"` - Token string `json:"token,omitempty"` -} -type UserCreateOut struct { - State string `json:"state"` - Token string `json:"token"` - User UserOut `json:"user"` - UserEmail string `json:"user_email"` -} type UserGroupOut struct { CreateTime time.Time `json:"create_time"` Description string `json:"description"` + ManagedByScim bool `json:"managed_by_scim"` UpdateTime time.Time `json:"update_time"` UserGroupId string `json:"user_group_id"` UserGroupName string `json:"user_group_name"` @@ -681,26 +646,6 @@ type UserInfoOut struct { User string `json:"user"` UserId string `json:"user_id"` } -type UserOut struct { - Auth []string `json:"auth"` - City string `json:"city,omitempty"` - Country string `json:"country,omitempty"` - CreateTime *time.Time `json:"create_time,omitempty"` - Department string `json:"department,omitempty"` - Features map[string]any `json:"features,omitempty"` - Invitations []InvitationOut `json:"invitations"` - JobTitle string `json:"job_title,omitempty"` - ManagedByScim *bool `json:"managed_by_scim,omitempty"` - ManagingOrganizationId string `json:"managing_organization_id,omitempty"` - ProjectMembership ProjectMembershipOut `json:"project_membership"` - ProjectMemberships *ProjectMembershipsOut `json:"project_memberships,omitempty"` - Projects []string `json:"projects"` - RealName string `json:"real_name"` - State string `json:"state"` - TokenValidityBegin string `json:"token_validity_begin,omitempty"` - User string `json:"user"` - UserId string `json:"user_id"` -} type UserPasswordChangeIn struct { NewPassword string `json:"new_password"` Password string `json:"password"` diff --git a/handler/usergroup/usergroup.go b/handler/usergroup/usergroup.go index 7b1ffc4..7e3c89c 100644 --- a/handler/usergroup/usergroup.go +++ b/handler/usergroup/usergroup.go @@ -11,37 +11,37 @@ import ( type Handler interface { // UserGroupCreate create a group - // POST /organization/{organization_id}/user-groups + // POST /v1/organization/{organization_id}/user-groups // https://api.aiven.io/doc/#tag/Groups/operation/UserGroupCreate UserGroupCreate(ctx context.Context, organizationId string, in *UserGroupCreateIn) (*UserGroupCreateOut, error) // UserGroupDelete delete a group - // DELETE /organization/{organization_id}/user-groups/{user_group_id} + // DELETE /v1/organization/{organization_id}/user-groups/{user_group_id} // https://api.aiven.io/doc/#tag/Groups/operation/UserGroupDelete UserGroupDelete(ctx context.Context, organizationId string, userGroupId string) error // UserGroupGet retrieve a group - // GET /organization/{organization_id}/user-groups/{user_group_id} + // GET /v1/organization/{organization_id}/user-groups/{user_group_id} // https://api.aiven.io/doc/#tag/Groups/operation/UserGroupGet UserGroupGet(ctx context.Context, organizationId string, userGroupId string) (*UserGroupGetOut, error) // UserGroupMemberList list group members - // GET /organization/{organization_id}/user-groups/{user_group_id}/members + // GET /v1/organization/{organization_id}/user-groups/{user_group_id}/members // https://api.aiven.io/doc/#tag/Groups/operation/UserGroupMemberList UserGroupMemberList(ctx context.Context, organizationId string, userGroupId string) ([]MemberOut, error) // UserGroupMembersUpdate add or remove group members - // PATCH /organization/{organization_id}/user-groups/{user_group_id}/members + // PATCH /v1/organization/{organization_id}/user-groups/{user_group_id}/members // https://api.aiven.io/doc/#tag/Groups/operation/UserGroupMembersUpdate UserGroupMembersUpdate(ctx context.Context, organizationId string, userGroupId string, in *UserGroupMembersUpdateIn) error // UserGroupUpdate update a group - // PATCH /organization/{organization_id}/user-groups/{user_group_id} + // PATCH /v1/organization/{organization_id}/user-groups/{user_group_id} // https://api.aiven.io/doc/#tag/Groups/operation/UserGroupUpdate UserGroupUpdate(ctx context.Context, organizationId string, userGroupId string, in *UserGroupUpdateIn) (*UserGroupUpdateOut, error) // UserGroupsList list groups - // GET /organization/{organization_id}/user-groups + // GET /v1/organization/{organization_id}/user-groups // https://api.aiven.io/doc/#tag/Groups/operation/UserGroupsList UserGroupsList(ctx context.Context, organizationId string) ([]UserGroupOut, error) } @@ -59,7 +59,7 @@ type UserGroupHandler struct { } func (h *UserGroupHandler) UserGroupCreate(ctx context.Context, organizationId string, in *UserGroupCreateIn) (*UserGroupCreateOut, error) { - path := fmt.Sprintf("/organization/%s/user-groups", organizationId) + path := fmt.Sprintf("/v1/organization/%s/user-groups", organizationId) b, err := h.doer.Do(ctx, "UserGroupCreate", "POST", path, in) if err != nil { return nil, err @@ -72,12 +72,12 @@ func (h *UserGroupHandler) UserGroupCreate(ctx context.Context, organizationId s return out, nil } func (h *UserGroupHandler) UserGroupDelete(ctx context.Context, organizationId string, userGroupId string) error { - path := fmt.Sprintf("/organization/%s/user-groups/%s", organizationId, userGroupId) + path := fmt.Sprintf("/v1/organization/%s/user-groups/%s", organizationId, userGroupId) _, err := h.doer.Do(ctx, "UserGroupDelete", "DELETE", path, nil) return err } func (h *UserGroupHandler) UserGroupGet(ctx context.Context, organizationId string, userGroupId string) (*UserGroupGetOut, error) { - path := fmt.Sprintf("/organization/%s/user-groups/%s", organizationId, userGroupId) + path := fmt.Sprintf("/v1/organization/%s/user-groups/%s", organizationId, userGroupId) b, err := h.doer.Do(ctx, "UserGroupGet", "GET", path, nil) if err != nil { return nil, err @@ -90,7 +90,7 @@ func (h *UserGroupHandler) UserGroupGet(ctx context.Context, organizationId stri return out, nil } func (h *UserGroupHandler) UserGroupMemberList(ctx context.Context, organizationId string, userGroupId string) ([]MemberOut, error) { - path := fmt.Sprintf("/organization/%s/user-groups/%s/members", organizationId, userGroupId) + path := fmt.Sprintf("/v1/organization/%s/user-groups/%s/members", organizationId, userGroupId) b, err := h.doer.Do(ctx, "UserGroupMemberList", "GET", path, nil) if err != nil { return nil, err @@ -103,12 +103,12 @@ func (h *UserGroupHandler) UserGroupMemberList(ctx context.Context, organization return out.Members, nil } func (h *UserGroupHandler) UserGroupMembersUpdate(ctx context.Context, organizationId string, userGroupId string, in *UserGroupMembersUpdateIn) error { - path := fmt.Sprintf("/organization/%s/user-groups/%s/members", organizationId, userGroupId) + path := fmt.Sprintf("/v1/organization/%s/user-groups/%s/members", organizationId, userGroupId) _, err := h.doer.Do(ctx, "UserGroupMembersUpdate", "PATCH", path, in) return err } func (h *UserGroupHandler) UserGroupUpdate(ctx context.Context, organizationId string, userGroupId string, in *UserGroupUpdateIn) (*UserGroupUpdateOut, error) { - path := fmt.Sprintf("/organization/%s/user-groups/%s", organizationId, userGroupId) + path := fmt.Sprintf("/v1/organization/%s/user-groups/%s", organizationId, userGroupId) b, err := h.doer.Do(ctx, "UserGroupUpdate", "PATCH", path, in) if err != nil { return nil, err @@ -121,7 +121,7 @@ func (h *UserGroupHandler) UserGroupUpdate(ctx context.Context, organizationId s return out, nil } func (h *UserGroupHandler) UserGroupsList(ctx context.Context, organizationId string) ([]UserGroupOut, error) { - path := fmt.Sprintf("/organization/%s/user-groups", organizationId) + path := fmt.Sprintf("/v1/organization/%s/user-groups", organizationId) b, err := h.doer.Do(ctx, "UserGroupsList", "GET", path, nil) if err != nil { return nil, err @@ -157,6 +157,7 @@ type UserGroupCreateIn struct { type UserGroupCreateOut struct { CreateTime time.Time `json:"create_time"` Description string `json:"description"` + ManagedByScim bool `json:"managed_by_scim"` UpdateTime time.Time `json:"update_time"` UserGroupId string `json:"user_group_id"` UserGroupName string `json:"user_group_name"` @@ -164,6 +165,7 @@ type UserGroupCreateOut struct { type UserGroupGetOut struct { CreateTime time.Time `json:"create_time"` Description string `json:"description"` + ManagedByScim bool `json:"managed_by_scim"` UpdateTime time.Time `json:"update_time"` UserGroupId string `json:"user_group_id"` UserGroupName string `json:"user_group_name"` @@ -175,6 +177,7 @@ type UserGroupMembersUpdateIn struct { type UserGroupOut struct { CreateTime time.Time `json:"create_time"` Description string `json:"description"` + ManagedByScim bool `json:"managed_by_scim"` MemberCount int `json:"member_count"` UpdateTime time.Time `json:"update_time"` UserGroupId string `json:"user_group_id"` @@ -187,6 +190,7 @@ type UserGroupUpdateIn struct { type UserGroupUpdateOut struct { CreateTime time.Time `json:"create_time"` Description string `json:"description"` + ManagedByScim bool `json:"managed_by_scim"` UpdateTime time.Time `json:"update_time"` UserGroupId string `json:"user_group_id"` UserGroupName string `json:"user_group_name"` diff --git a/handler/vpc/vpc.go b/handler/vpc/vpc.go index 311abfc..2c5f9e0 100644 --- a/handler/vpc/vpc.go +++ b/handler/vpc/vpc.go @@ -11,47 +11,47 @@ import ( type Handler interface { // VpcCreate create a VPC in a cloud for the project - // POST /project/{project}/vpcs + // POST /v1/project/{project}/vpcs // https://api.aiven.io/doc/#tag/Project/operation/VpcCreate VpcCreate(ctx context.Context, project string, in *VpcCreateIn) (*VpcCreateOut, error) // VpcDelete delete a project VPC - // DELETE /project/{project}/vpcs/{project_vpc_id} + // DELETE /v1/project/{project}/vpcs/{project_vpc_id} // https://api.aiven.io/doc/#tag/Project/operation/VpcDelete VpcDelete(ctx context.Context, project string, projectVpcId string) (*VpcDeleteOut, error) // VpcGet get VPC information - // GET /project/{project}/vpcs/{project_vpc_id} + // GET /v1/project/{project}/vpcs/{project_vpc_id} // https://api.aiven.io/doc/#tag/Project/operation/VpcGet VpcGet(ctx context.Context, project string, projectVpcId string) (*VpcGetOut, error) // VpcList list VPCs for a project - // GET /project/{project}/vpcs + // GET /v1/project/{project}/vpcs // https://api.aiven.io/doc/#tag/Project/operation/VpcList VpcList(ctx context.Context, project string) ([]VpcOut, error) // VpcPeeringConnectionCreate create a peering connection for a project VPC - // POST /project/{project}/vpcs/{project_vpc_id}/peering-connections + // POST /v1/project/{project}/vpcs/{project_vpc_id}/peering-connections // https://api.aiven.io/doc/#tag/Project/operation/VpcPeeringConnectionCreate VpcPeeringConnectionCreate(ctx context.Context, project string, projectVpcId string, in *VpcPeeringConnectionCreateIn) (*VpcPeeringConnectionCreateOut, error) // VpcPeeringConnectionDelete delete a peering connection for a project VPC - // DELETE /project/{project}/vpcs/{project_vpc_id}/peering-connections/peer-accounts/{peer_cloud_account}/peer-vpcs/{peer_vpc} + // DELETE /v1/project/{project}/vpcs/{project_vpc_id}/peering-connections/peer-accounts/{peer_cloud_account}/peer-vpcs/{peer_vpc} // https://api.aiven.io/doc/#tag/Project/operation/VpcPeeringConnectionDelete VpcPeeringConnectionDelete(ctx context.Context, project string, projectVpcId string, peerCloudAccount string, peerVpc string) (*VpcPeeringConnectionDeleteOut, error) // VpcPeeringConnectionUpdate update user-defined peer network CIDRs for a project VPC - // PUT /project/{project}/vpcs/{project_vpc_id}/user-peer-network-cidrs + // PUT /v1/project/{project}/vpcs/{project_vpc_id}/user-peer-network-cidrs // https://api.aiven.io/doc/#tag/Project/operation/VpcPeeringConnectionUpdate VpcPeeringConnectionUpdate(ctx context.Context, project string, projectVpcId string, in *VpcPeeringConnectionUpdateIn) (*VpcPeeringConnectionUpdateOut, error) // VpcPeeringConnectionWithRegionDelete delete a peering connection for a project VPC - // DELETE /project/{project}/vpcs/{project_vpc_id}/peering-connections/peer-accounts/{peer_cloud_account}/peer-vpcs/{peer_vpc}/peer-regions/{peer_region} + // DELETE /v1/project/{project}/vpcs/{project_vpc_id}/peering-connections/peer-accounts/{peer_cloud_account}/peer-vpcs/{peer_vpc}/peer-regions/{peer_region} // https://api.aiven.io/doc/#tag/Project/operation/VpcPeeringConnectionWithRegionDelete VpcPeeringConnectionWithRegionDelete(ctx context.Context, project string, projectVpcId string, peerCloudAccount string, peerVpc string, peerRegion string) (*VpcPeeringConnectionWithRegionDeleteOut, error) // VpcPeeringConnectionWithResourceGroupDelete delete a peering connection for a project VPC - // DELETE /project/{project}/vpcs/{project_vpc_id}/peering-connections/peer-accounts/{peer_cloud_account}/peer-resource-groups/{peer_resource_group}/peer-vpcs/{peer_vpc} + // DELETE /v1/project/{project}/vpcs/{project_vpc_id}/peering-connections/peer-accounts/{peer_cloud_account}/peer-resource-groups/{peer_resource_group}/peer-vpcs/{peer_vpc} // https://api.aiven.io/doc/#tag/Project/operation/VpcPeeringConnectionWithResourceGroupDelete VpcPeeringConnectionWithResourceGroupDelete(ctx context.Context, project string, projectVpcId string, peerCloudAccount string, peerResourceGroup string, peerVpc string) (*VpcPeeringConnectionWithResourceGroupDeleteOut, error) } @@ -69,7 +69,7 @@ type VpcHandler struct { } func (h *VpcHandler) VpcCreate(ctx context.Context, project string, in *VpcCreateIn) (*VpcCreateOut, error) { - path := fmt.Sprintf("/project/%s/vpcs", project) + path := fmt.Sprintf("/v1/project/%s/vpcs", project) b, err := h.doer.Do(ctx, "VpcCreate", "POST", path, in) if err != nil { return nil, err @@ -82,7 +82,7 @@ func (h *VpcHandler) VpcCreate(ctx context.Context, project string, in *VpcCreat return out, nil } func (h *VpcHandler) VpcDelete(ctx context.Context, project string, projectVpcId string) (*VpcDeleteOut, error) { - path := fmt.Sprintf("/project/%s/vpcs/%s", project, projectVpcId) + path := fmt.Sprintf("/v1/project/%s/vpcs/%s", project, projectVpcId) b, err := h.doer.Do(ctx, "VpcDelete", "DELETE", path, nil) if err != nil { return nil, err @@ -95,7 +95,7 @@ func (h *VpcHandler) VpcDelete(ctx context.Context, project string, projectVpcId return out, nil } func (h *VpcHandler) VpcGet(ctx context.Context, project string, projectVpcId string) (*VpcGetOut, error) { - path := fmt.Sprintf("/project/%s/vpcs/%s", project, projectVpcId) + path := fmt.Sprintf("/v1/project/%s/vpcs/%s", project, projectVpcId) b, err := h.doer.Do(ctx, "VpcGet", "GET", path, nil) if err != nil { return nil, err @@ -108,7 +108,7 @@ func (h *VpcHandler) VpcGet(ctx context.Context, project string, projectVpcId st return out, nil } func (h *VpcHandler) VpcList(ctx context.Context, project string) ([]VpcOut, error) { - path := fmt.Sprintf("/project/%s/vpcs", project) + path := fmt.Sprintf("/v1/project/%s/vpcs", project) b, err := h.doer.Do(ctx, "VpcList", "GET", path, nil) if err != nil { return nil, err @@ -121,7 +121,7 @@ func (h *VpcHandler) VpcList(ctx context.Context, project string) ([]VpcOut, err return out.Vpcs, nil } func (h *VpcHandler) VpcPeeringConnectionCreate(ctx context.Context, project string, projectVpcId string, in *VpcPeeringConnectionCreateIn) (*VpcPeeringConnectionCreateOut, error) { - path := fmt.Sprintf("/project/%s/vpcs/%s/peering-connections", project, projectVpcId) + path := fmt.Sprintf("/v1/project/%s/vpcs/%s/peering-connections", project, projectVpcId) b, err := h.doer.Do(ctx, "VpcPeeringConnectionCreate", "POST", path, in) if err != nil { return nil, err @@ -134,7 +134,7 @@ func (h *VpcHandler) VpcPeeringConnectionCreate(ctx context.Context, project str return out, nil } func (h *VpcHandler) VpcPeeringConnectionDelete(ctx context.Context, project string, projectVpcId string, peerCloudAccount string, peerVpc string) (*VpcPeeringConnectionDeleteOut, error) { - path := fmt.Sprintf("/project/%s/vpcs/%s/peering-connections/peer-accounts/%s/peer-vpcs/%s", project, projectVpcId, peerCloudAccount, peerVpc) + path := fmt.Sprintf("/v1/project/%s/vpcs/%s/peering-connections/peer-accounts/%s/peer-vpcs/%s", project, projectVpcId, peerCloudAccount, peerVpc) b, err := h.doer.Do(ctx, "VpcPeeringConnectionDelete", "DELETE", path, nil) if err != nil { return nil, err @@ -147,7 +147,7 @@ func (h *VpcHandler) VpcPeeringConnectionDelete(ctx context.Context, project str return out, nil } func (h *VpcHandler) VpcPeeringConnectionUpdate(ctx context.Context, project string, projectVpcId string, in *VpcPeeringConnectionUpdateIn) (*VpcPeeringConnectionUpdateOut, error) { - path := fmt.Sprintf("/project/%s/vpcs/%s/user-peer-network-cidrs", project, projectVpcId) + path := fmt.Sprintf("/v1/project/%s/vpcs/%s/user-peer-network-cidrs", project, projectVpcId) b, err := h.doer.Do(ctx, "VpcPeeringConnectionUpdate", "PUT", path, in) if err != nil { return nil, err @@ -160,7 +160,7 @@ func (h *VpcHandler) VpcPeeringConnectionUpdate(ctx context.Context, project str return out, nil } func (h *VpcHandler) VpcPeeringConnectionWithRegionDelete(ctx context.Context, project string, projectVpcId string, peerCloudAccount string, peerVpc string, peerRegion string) (*VpcPeeringConnectionWithRegionDeleteOut, error) { - path := fmt.Sprintf("/project/%s/vpcs/%s/peering-connections/peer-accounts/%s/peer-vpcs/%s/peer-regions/%s", project, projectVpcId, peerCloudAccount, peerVpc, peerRegion) + path := fmt.Sprintf("/v1/project/%s/vpcs/%s/peering-connections/peer-accounts/%s/peer-vpcs/%s/peer-regions/%s", project, projectVpcId, peerCloudAccount, peerVpc, peerRegion) b, err := h.doer.Do(ctx, "VpcPeeringConnectionWithRegionDelete", "DELETE", path, nil) if err != nil { return nil, err @@ -173,7 +173,7 @@ func (h *VpcHandler) VpcPeeringConnectionWithRegionDelete(ctx context.Context, p return out, nil } func (h *VpcHandler) VpcPeeringConnectionWithResourceGroupDelete(ctx context.Context, project string, projectVpcId string, peerCloudAccount string, peerResourceGroup string, peerVpc string) (*VpcPeeringConnectionWithResourceGroupDeleteOut, error) { - path := fmt.Sprintf("/project/%s/vpcs/%s/peering-connections/peer-accounts/%s/peer-resource-groups/%s/peer-vpcs/%s", project, projectVpcId, peerCloudAccount, peerResourceGroup, peerVpc) + path := fmt.Sprintf("/v1/project/%s/vpcs/%s/peering-connections/peer-accounts/%s/peer-resource-groups/%s/peer-vpcs/%s", project, projectVpcId, peerCloudAccount, peerResourceGroup, peerVpc) b, err := h.doer.Do(ctx, "VpcPeeringConnectionWithResourceGroupDelete", "DELETE", path, nil) if err != nil { return nil, err