package account

import (
	"context"
	"net/http"

	"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)

// DisableAccountsRequest struct to disable group of accounts
type DisableAccountsRequest struct {
	// IDs of accounts
	// Required: true
	AccountIDs []uint64 `url:"accountIds" json:"accountIds" validate:"min=1"`
}

// DisableAccounts disables accounts
func (a Account) DisableAccounts(ctx context.Context, req DisableAccountsRequest) (string, error) {
	err := validators.ValidateRequest(req)
	if err != nil {
		return "", validators.ValidationErrors(validators.GetErrors(err))
	}

	url := "/cloudbroker/account/disableAccounts"

	res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, req)
	if err != nil {
		return "", err
	}

	return string(res), nil
}
