<commit_before>﻿using System;
using System.Collections.Generic;

namespace OhadSoft.AzureLetsEncrypt.Renewal
{
    public sealed class RenewalParameters
    {
        public string TenantId { get; }
        public Guid SubscriptionId { get; }
        public Guid ClientId { get; }
        public string ClientSecret { get; }
        public string ResourceGroup { get; }
        public string WebApp { get; }
        public string Email { get; }
        public IReadOnlyList<string> Hosts { get; }
        public bool UseIpBasedSsl { get; }
        public int RsaKeyLength { get; }
        public Uri AcmeBasedUri { get; }

        public RenewalParameters(
            string tenantId, 
            Guid subscriptionId, 
            Guid clientId, 
            string clientSecret, 
            string resourceGroup, 
            string webApp, 
            string email, 
            IReadOnlyList<string> hosts, 
            bool useIpBasedSsl = false, 
            int rsaKeyLength = 2048, 
            Uri acmeBasedUri = null)
        {
            TenantId = !String.IsNullOrWhiteSpace(tenantId)
                ? tenantId
                : throw new ArgumentException("Tenant ID must not be null or whitespace", nameof(tenantId));

            SubscriptionId = subscriptionId != Guid.Empty
                ? subscriptionId
                : throw new ArgumentException("Subscription ID must not be an empty GUID", nameof(subscriptionId));

            ClientId = clientId != Guid.Empty ? 
                clientId : 
                throw new ArgumentException("Client ID must not be an empty GUID", nameof(clientId));

            ClientSecret = !String.IsNullOrWhiteSpace(clientSecret)
                ? clientSecret
                : throw new ArgumentException("Client secret must not be null or whitespace", nameof(clientSecret));

            ResourceGroup = !String.IsNullOrWhiteSpace(resourceGroup)
                ? resourceGroup
                : throw new ArgumentException("Resource group name must not be null or whitespace", nameof(resourceGroup));

            WebApp = !String.IsNullOrWhiteSpace(webApp)
                ? webApp
                : throw new ArgumentException("Web app name must not be null or whitespace", nameof(webApp));

            Email = !String.IsNullOrWhiteSpace(email)
                ? email
                : throw new ArgumentException("E-mail must not be null or whitespace", nameof(email));
<commit_msg>minimal e-mail validation<commit_after>﻿using System;
using System.Collections.Generic;

namespace OhadSoft.AzureLetsEncrypt.Renewal
{
    public sealed class RenewalParameters
    {
        public string TenantId { get; }
        public Guid SubscriptionId { get; }
        public Guid ClientId { get; }
        public string ClientSecret { get; }
        public string ResourceGroup { get; }
        public string WebApp { get; }
        public string Email { get; }
        public IReadOnlyList<string> Hosts { get; }
        public bool UseIpBasedSsl { get; }
        public int RsaKeyLength { get; }
        public Uri AcmeBasedUri { get; }

        public RenewalParameters(
            string tenantId, 
            Guid subscriptionId, 
            Guid clientId, 
            string clientSecret, 
            string resourceGroup, 
            string webApp, 
            string email, 
            IReadOnlyList<string> hosts, 
            bool useIpBasedSsl = false, 
            int rsaKeyLength = 2048, 
            Uri acmeBasedUri = null)
        {
            TenantId = !String.IsNullOrWhiteSpace(tenantId)
                ? tenantId
                : throw new ArgumentException("Tenant ID must not be null or whitespace", nameof(tenantId));

            SubscriptionId = subscriptionId != Guid.Empty
                ? subscriptionId
                : throw new ArgumentException("Subscription ID must not be an empty GUID", nameof(subscriptionId));

            ClientId = clientId != Guid.Empty ? 
                clientId : 
                throw new ArgumentException("Client ID must not be an empty GUID", nameof(clientId));

            ClientSecret = !String.IsNullOrWhiteSpace(clientSecret)
                ? clientSecret
                : throw new ArgumentException("Client secret must not be null or whitespace", nameof(clientSecret));

            ResourceGroup = !String.IsNullOrWhiteSpace(resourceGroup)
                ? resourceGroup
                : throw new ArgumentException("Resource group name must not be null or whitespace", nameof(resourceGroup));

            WebApp = !String.IsNullOrWhiteSpace(webApp)
                ? webApp
                : throw new ArgumentException("Web app name must not be null or whitespace", nameof(webApp));

            Email = !String.IsNullOrWhiteSpace(email) && email.Contains("@") && email.Length >= 3 && email.Length <= 254
                ? email
                : throw new ArgumentException("E-mail address must not be null and must be valid", nameof(email));

{'fraction_non_alphanumeric': 0.07138572285542892, 'fraction_numerical': 0.0023995200959808036, 'mean_word_length': 2.0241837968561063, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3961072', 'n_tokens_mistral': 1271, 'n_tokens_neox': 1193, 'n_words': 374}