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.
dynamix-golang-sdk/pkg/cloudbroker/vins/mass_enable.go

33 lines
751 B

2 months ago
package vins
import (
"context"
"net/http"
1 month ago
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
2 months ago
)
// MassEnableRequest struct to enable several VINSes
type MassEnableRequest struct {
// VINS IDs
// Required: true
VINSIDs []uint64 `url:"vinsIds" json:"vinsIds" validate:"min=1"`
}
// MassEnable start jobs to enable several VINSes
1 month ago
func (v VINS) MassEnable(ctx context.Context, req MassEnableRequest) (string, error) {
2 months ago
err := validators.ValidateRequest(req)
if err != nil {
1 month ago
return "", validators.ValidationErrors(validators.GetErrors(err))
2 months ago
}
url := "/cloudbroker/vins/massEnable"
1 month ago
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, req)
2 months ago
if err != nil {
1 month ago
return "", err
2 months ago
}
1 month ago
return string(res), nil
2 months ago
}