<commit_before>﻿using System;
using System.ComponentModel.DataAnnotations;

namespace Tgstation.Server.Host.Models
{
	/// <inheritdoc />
	public sealed class CompileJob : Api.Models.Internal.CompileJob
	{
		/// <summary>
		/// See <see cref="Api.Models.CompileJob.Job"/>
		/// </summary>
		[Required]
		public Job Job { get; set; }

		/// <summary>
		/// See <see cref="Api.Models.CompileJob.RevisionInformation"/>
		/// </summary>
		[Required]
		public RevisionInformation RevisionInformation { get; set; }

		/// <summary>
		/// The <see cref="Version"/> the <see cref="CompileJob"/> was made with in string form
		/// </summary>
		[Required]
		public string ByondVersion { get; set; }

		/// <summary>
		/// Convert the <see cref="CompileJob"/> to it's API form
		/// </summary>
		/// <returns>A new <see cref="Api.Models.CompileJob"/></returns>
		public Api.Models.CompileJob ToApi() => new Api.Models.CompileJob
		{
			DirectoryName = DirectoryName,
			DmeName = DmeName,
			Id = Id,
			Job = Job.ToApi(),
			Output = Output,
			RevisionInformation = RevisionInformation.ToApi(),
			ByondVersion = Version.Parse(ByondVersion),
			MinimumSecurityLevel = MinimumSecurityLevel
		};
	}
}
<commit_msg>I've struggled with this before but it seems multiple cascade paths will absolutely not allow us to create CompileJobs with Required jobs<commit_after>﻿using System;
using System.ComponentModel.DataAnnotations;

namespace Tgstation.Server.Host.Models
{
	/// <inheritdoc />
	public sealed class CompileJob : Api.Models.Internal.CompileJob
	{
		/// <summary>
		/// See <see cref="Api.Models.CompileJob.Job"/>
		/// </summary>
		public Job Job { get; set; }

		/// <summary>
		/// See <see cref="Api.Models.CompileJob.RevisionInformation"/>
		/// </summary>
		[Required]
		public RevisionInformation RevisionInformation { get; set; }

		/// <summary>
		/// The <see cref="Version"/> the <see cref="CompileJob"/> was made with in string form
		/// </summary>
		[Required]
		public string ByondVersion { get; set; }

		/// <summary>
		/// Convert the <see cref="CompileJob"/> to it's API form
		/// </summary>
		/// <returns>A new <see cref="Api.Models.CompileJob"/></returns>
		public Api.Models.CompileJob ToApi() => new Api.Models.CompileJob
		{
			DirectoryName = DirectoryName,
			DmeName = DmeName,
			Id = Id,
			Job = Job.ToApi(),
			Output = Output,
			RevisionInformation = RevisionInformation.ToApi(),
			ByondVersion = Version.Parse(ByondVersion),
			MinimumSecurityLevel = MinimumSecurityLevel
		};
	}
}

{'fraction_non_alphanumeric': 0.14842817349781137, 'fraction_numerical': 0.0, 'mean_word_length': 3.3570190641247835, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 39, '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': '3740521', 'n_tokens_mistral': 871, 'n_tokens_neox': 764, 'n_words': 198}