Files
dynamix-golang-sdk/pkg/sdn/acsgroups/delete.go

34 lines
852 B
Go
Raw Normal View History

2025-09-27 01:06:15 +03:00
package acsgroups
import (
"context"
"net/http"
2026-02-20 17:30:02 +03:00
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
2025-09-27 01:06:15 +03:00
)
// DeleteRequest struct to delete access group
type DeleteRequest struct {
2025-11-14 17:59:31 +03:00
// ID of the access group
2025-09-27 01:06:15 +03:00
// Required: true
GroupID string `url:"access_group_id" json:"access_group_id" validate:"required"`
}
2026-04-17 17:10:10 +03:00
// Delete an access groups
func (i AccessGroups) Delete(ctx context.Context, req DeleteRequest) (string, error) {
2025-09-27 01:06:15 +03:00
err := validators.ValidateRequest(req)
if err != nil {
2026-04-17 17:10:10 +03:00
return "", validators.ValidationErrors(validators.GetErrors(err))
2025-09-27 01:06:15 +03:00
}
url := "/sdn/access_group/delete"
res, err := i.client.DecortApiCallCtype(ctx, http.MethodDelete, url, constants.MIMEJSON, req)
if err != nil {
2026-04-17 17:10:10 +03:00
return "", err
2025-09-27 01:06:15 +03:00
}
2026-04-17 17:10:10 +03:00
return string(res), nil
2025-09-27 01:06:15 +03:00
}