v1.10.0
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
package sep
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// UpdateCapacityLimitRequest struct to update capacity limits
|
||||
type UpdateCapacityLimitRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
|
||||
}
|
||||
|
||||
// UpdateCapacityLimit updates SEP capacity limit
|
||||
func (s SEP) UpdateCapacityLimit(ctx context.Context, req UpdateCapacityLimitRequest) (uint64, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/sep/updateCapacityLimit"
|
||||
|
||||
res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
result, err := strconv.ParseUint(string(res), 10, 64)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
Reference in New Issue
Block a user