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.
33 lines
766 B
33 lines
766 B
package account
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
|
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
|
)
|
|
|
|
// EnableAccountsRequest to enable group of accounts
|
|
type EnableAccountsRequest struct {
|
|
// IDs od accounts
|
|
// Required: true
|
|
AccountIDs []uint64 `url:"accountIds" json:"accountIds" validate:"min=1"`
|
|
}
|
|
|
|
// EnableAccounts enables accounts
|
|
func (a Account) EnableAccounts(ctx context.Context, req EnableAccountsRequest) (bool, error) {
|
|
err := validators.ValidateRequest(req)
|
|
if err != nil {
|
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
|
}
|
|
|
|
url := "/cloudbroker/account/enableAccounts"
|
|
|
|
_, err = a.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
|
if err != nil {
|
|
return false, err
|
|
}
|
|
|
|
return true, nil
|
|
}
|