v1.14.8
This commit is contained in:
@@ -3,7 +3,6 @@ package acsgroups
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/constants"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
@@ -16,24 +15,19 @@ type DeleteRequest struct {
|
||||
GroupID string `url:"access_group_id" json:"access_group_id" validate:"required"`
|
||||
}
|
||||
|
||||
// Delete a access groups
|
||||
func (i AccessGroups) Delete(ctx context.Context, req DeleteRequest) (bool, error) {
|
||||
// Delete an access groups
|
||||
func (i AccessGroups) Delete(ctx context.Context, req DeleteRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/sdn/access_group/delete"
|
||||
|
||||
res, err := i.client.DecortApiCallCtype(ctx, http.MethodDelete, url, constants.MIMEJSON, req)
|
||||
if err != nil {
|
||||
return false, err
|
||||
return "", err
|
||||
}
|
||||
|
||||
result, err := strconv.ParseBool(string(res))
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return result, nil
|
||||
return string(res), nil
|
||||
}
|
||||
|
||||
@@ -15,9 +15,7 @@ type AccessGroup struct {
|
||||
DisplayName string `json:"display_name"`
|
||||
Comment string `json:"comment"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
CreatedBy string `json:"created_by"`
|
||||
UpdatedAt string `json:"updated_at"`
|
||||
UpdatedBy string `json:"updated_by"`
|
||||
NetObjectAccessGroup NetObjectAccessGroup `json:"net_object_access_group"`
|
||||
DefaultSecurityPolicy DefaultSecurityPolicy `json:"default_security_policy"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user