You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
decort-golang-sdk/pkg/cloudbroker/k8ci/access_remove.go

37 lines
985 B

package k8ci
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// AccessRemoveRequest struct for removing permission to access to account for a k8ci
type AccessRemoveRequest struct {
// ID of the K8 catalog item to remove access for
// Required: true
K8CIID uint64 `url:"k8ciId" json:"k8ciId" validate:"required"`
// Account ID to be removed from the sharedWith access list
// Required: true
AccountId uint64 `url:"accountId" json:"accountId" validate:"required"`
}
// Remove accountId from sharedWith access list for k8ci.
func (k K8CI) AccessRemove(ctx context.Context, req AccessRemoveRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/k8ci/accessRemove"
res, err := k.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return "", err
}
return string(res), nil
}