func NewCancelReservationResponse(status CancelReservationStatus) *CancelReservationResponse {
	return &CancelReservationResponse{Status: status}
}
Creates a new CancelReservationResponse, containing all required fields. There are no optional fields for this message.
package reservation
import (
	"reflect"
	"gopkg.in/go-playground/validator.v9"
	"github.com/lorenzodonini/ocpp-go/ocpp2.0.1/types"
)
const CancelReservationFeatureName = "CancelReservation"
type CancelReservationStatus string
const (
	CancelReservationStatusAccepted CancelReservationStatus = "Accepted"
	CancelReservationStatusRejected CancelReservationStatus = "Rejected"
)
func isValidCancelReservationStatus(fl validator.FieldLevel) bool {
	status := CancelReservationStatus(fl.Field().String())
	switch status {
	case CancelReservationStatusAccepted, CancelReservationStatusRejected:
		return true
	default:
		return false
	}
}
type CancelReservationRequest struct {
	ReservationID int `json:"reservationId" validate:"gte=0"`
}
type CancelReservationResponse struct {
	Status     CancelReservationStatus `json:"status" validate:"required,cancelReservationStatus"`
	StatusInfo *types.StatusInfo       `json:"statusInfo,omitempty" validate:"omitempty"`
}
type CancelReservationFeature struct{}
func (f CancelReservationFeature) GetFeatureName() string {
	return CancelReservationFeatureName
}
func (f CancelReservationFeature) GetRequestType() reflect.Type {
	return reflect.TypeOf(CancelReservationRequest{})
}
func (f CancelReservationFeature) GetResponseType() reflect.Type {
	return reflect.TypeOf(CancelReservationResponse{})
}
func (r CancelReservationRequest) GetFeatureName() string {
	return CancelReservationFeatureName
}
func (c CancelReservationResponse) GetFeatureName() string {
	return CancelReservationFeatureName
}
func NewCancelReservationRequest(reservationId int) *CancelReservationRequest {
	return &CancelReservationRequest{ReservationID: reservationId}
}