internal string GetCreateSyntax ()
{
if (!String.IsNullOrWhiteSpace (DBName) && !String.IsNullOrWhiteSpace (Name) && Duration >= TimeSpan.FromMinutes (60))
return $"CREATE RETENTION POLICY {Name} ON {DBName} DURATION {Duration.TotalMinutes}m REPLICATION {ReplicaN} {(IsDefault ? " DEFAULT" : "")}";
else if (Duration < TimeSpan.FromMinutes (60))
throw new ArgumentException ("Minimum retention duration is 1 hour");
else if (String.IsNullOrWhiteSpace (Name))
throw new ArgumentException ("Name not set");
else if (String.IsNullOrWhiteSpace (DBName))
throw new ArgumentException ("DBName is not set");
return null;
}
}