﻿using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.Versioning;

namespace PhoenixDiary.Utilities.AspNetCore.Middleware.ApiVersionChecker
{
    public class ApiVersionCheckerOptions
    {
        /// <summary>
        /// This filter allows to specify for which requests the api version should be checked. Pass null to check all requests.
        /// </summary>
        [CanBeNull]
        public IRequestFilter Filter { get; set; }

        /// <summary>
        /// This class reads the service API version value from a request.
        /// </summary>
        [NotNull]
        public IApiVersionReader ApiVersionReader { get; set; }

        /// <summary>
        /// List of supported versions.
        /// </summary>
        [NotNull]
        public IList<string> SupportedVersions { get; set; }

        /// <summary>
        /// This class defines the handling of a request with invalid version.
        /// </summary>
        [NotNull]
        public IInvalidVersionHandler InvalidVersionHandler { get; set; }
    }
}