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

33 lines
754 B

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