diff --git a/config.yaml b/config.yaml index dadb15a..aa95b39 100644 --- a/config.yaml +++ b/config.yaml @@ -250,6 +250,9 @@ ProjectBilling: - ProjectInvoiceGet - ProjectInvoiceList Service: + - AlloyDbOmniGoogleCloudPrivateKeyIdentify + - AlloyDbOmniGoogleCloudPrivateKeyRemove + - AlloyDbOmniGoogleCloudPrivateKeySet - ListProjectServiceTypes - ListPublicServiceTypes - ListServiceVersions diff --git a/handler/service/service.go b/handler/service/service.go index 470946b..384bfa5 100644 --- a/handler/service/service.go +++ b/handler/service/service.go @@ -11,6 +11,21 @@ import ( ) type Handler interface { + // AlloyDbOmniGoogleCloudPrivateKeyIdentify get Google service account key + // GET /v1/project/{project}/service/{service_name}/alloydbomni/google_cloud_private_key + // https://api.aiven.io/doc/#tag/Service:_AlloyDB_Omni/operation/AlloyDbOmniGoogleCloudPrivateKeyIdentify + AlloyDbOmniGoogleCloudPrivateKeyIdentify(ctx context.Context, project string, serviceName string) (*AlloyDbOmniGoogleCloudPrivateKeyIdentifyOut, error) + + // AlloyDbOmniGoogleCloudPrivateKeyRemove delete Google service account key + // DELETE /v1/project/{project}/service/{service_name}/alloydbomni/google_cloud_private_key + // https://api.aiven.io/doc/#tag/Service:_AlloyDB_Omni/operation/AlloyDbOmniGoogleCloudPrivateKeyRemove + AlloyDbOmniGoogleCloudPrivateKeyRemove(ctx context.Context, project string, serviceName string) (*AlloyDbOmniGoogleCloudPrivateKeyRemoveOut, error) + + // AlloyDbOmniGoogleCloudPrivateKeySet add Google service account key + // POST /v1/project/{project}/service/{service_name}/alloydbomni/google_cloud_private_key + // https://api.aiven.io/doc/#tag/Service:_AlloyDB_Omni/operation/AlloyDbOmniGoogleCloudPrivateKeySet + AlloyDbOmniGoogleCloudPrivateKeySet(ctx context.Context, project string, serviceName string, in *AlloyDbOmniGoogleCloudPrivateKeySetIn) (*AlloyDbOmniGoogleCloudPrivateKeySetOut, error) + // ListProjectServiceTypes list service types for a project // GET /v1/project/{project}/service_types // https://api.aiven.io/doc/#tag/Service/operation/ListProjectServiceTypes @@ -260,6 +275,45 @@ type ServiceHandler struct { doer doer } +func (h *ServiceHandler) AlloyDbOmniGoogleCloudPrivateKeyIdentify(ctx context.Context, project string, serviceName string) (*AlloyDbOmniGoogleCloudPrivateKeyIdentifyOut, error) { + path := fmt.Sprintf("/v1/project/%s/service/%s/alloydbomni/google_cloud_private_key", url.PathEscape(project), url.PathEscape(serviceName)) + b, err := h.doer.Do(ctx, "AlloyDbOmniGoogleCloudPrivateKeyIdentify", "GET", path, nil) + if err != nil { + return nil, err + } + out := new(AlloyDbOmniGoogleCloudPrivateKeyIdentifyOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out, nil +} +func (h *ServiceHandler) AlloyDbOmniGoogleCloudPrivateKeyRemove(ctx context.Context, project string, serviceName string) (*AlloyDbOmniGoogleCloudPrivateKeyRemoveOut, error) { + path := fmt.Sprintf("/v1/project/%s/service/%s/alloydbomni/google_cloud_private_key", url.PathEscape(project), url.PathEscape(serviceName)) + b, err := h.doer.Do(ctx, "AlloyDbOmniGoogleCloudPrivateKeyRemove", "DELETE", path, nil) + if err != nil { + return nil, err + } + out := new(AlloyDbOmniGoogleCloudPrivateKeyRemoveOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out, nil +} +func (h *ServiceHandler) AlloyDbOmniGoogleCloudPrivateKeySet(ctx context.Context, project string, serviceName string, in *AlloyDbOmniGoogleCloudPrivateKeySetIn) (*AlloyDbOmniGoogleCloudPrivateKeySetOut, error) { + path := fmt.Sprintf("/v1/project/%s/service/%s/alloydbomni/google_cloud_private_key", url.PathEscape(project), url.PathEscape(serviceName)) + b, err := h.doer.Do(ctx, "AlloyDbOmniGoogleCloudPrivateKeySet", "POST", path, in) + if err != nil { + return nil, err + } + out := new(AlloyDbOmniGoogleCloudPrivateKeySetOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out, nil +} func (h *ServiceHandler) ListProjectServiceTypes(ctx context.Context, project string) (*ListProjectServiceTypesOut, error) { path := fmt.Sprintf("/v1/project/%s/service_types", url.PathEscape(project)) b, err := h.doer.Do(ctx, "ListProjectServiceTypes", "GET", path, nil) @@ -888,6 +942,29 @@ type AlertOut struct { Severity string `json:"severity"` // Severity of the event } +// AlloyDbOmniGoogleCloudPrivateKeyIdentifyOut AlloyDbOmniGoogleCloudPrivateKeyIdentifyResponse +type AlloyDbOmniGoogleCloudPrivateKeyIdentifyOut struct { + ClientEmail string `json:"client_email"` // Email address of Google service account key + PrivateKeyId string `json:"private_key_id"` // Google service account key ID +} + +// AlloyDbOmniGoogleCloudPrivateKeyRemoveOut AlloyDbOmniGoogleCloudPrivateKeyRemoveResponse +type AlloyDbOmniGoogleCloudPrivateKeyRemoveOut struct { + ClientEmail string `json:"client_email"` // Email address of Google service account key + PrivateKeyId string `json:"private_key_id"` // Google service account key ID +} + +// AlloyDbOmniGoogleCloudPrivateKeySetIn AlloyDbOmniGoogleCloudPrivateKeySetRequestBody +type AlloyDbOmniGoogleCloudPrivateKeySetIn struct { + PrivateKey string `json:"private_key"` // Google Service Account Credentials +} + +// AlloyDbOmniGoogleCloudPrivateKeySetOut AlloyDbOmniGoogleCloudPrivateKeySetResponse +type AlloyDbOmniGoogleCloudPrivateKeySetOut struct { + ClientEmail string `json:"client_email"` // Email address of Google service account key + PrivateKeyId string `json:"private_key_id"` // Google service account key ID +} + // AlloydbomniOut Service type information type AlloydbomniOut struct { DefaultVersion *string `json:"default_version,omitempty"` // Default version of the service if no explicit version is defined