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

37 lines
855 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
// Reason for action
// Required: false
3 years ago
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
3 years ago
}
// MassDisable start jobs to disable several VINSes
func (v VINS) MassDisable(ctx context.Context, req MassDisableRequest) (bool, error) {
3 years ago
err := validators.ValidateRequest(req)
3 years ago
if err != nil {
2 years ago
return false, validators.ValidationErrors(validators.GetErrors(err))
3 years ago
}
url := "/cloudbroker/vins/massDisable"
_, err = v.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return false, err
}
return true, nil
}