v1.16.4
This commit is contained in:
dayterr
2026-09-18 16:49:20 +03:00
parent b39021820a
commit bf932e5ef9
161 changed files with 2375 additions and 227 deletions

View File

@@ -0,0 +1,42 @@
package vmfolder
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// MoveRequest to move a vm folder to a compute
type MoveRequest struct {
// VM Folder ID
// Required: true
FolderID uint64 `url:"folder_id" json:"folder_id"`
// New parent folder ID
// Required: true
NewParentID uint64 `url:"new_parent_id" json:"new_parent_id"`
}
// Move moves a vm folder to a compute
func (v VMFolder) Move(ctx context.Context, req MoveRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vmfolder/move"
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}