// <auto-generated/>

//------------------------------------------------------------------------------------------------
//      This file has been programatically generated; DON´T EDIT!
//------------------------------------------------------------------------------------------------

#pragma warning disable SA1001
#pragma warning disable SA1027
#pragma warning disable SA1028
#pragma warning disable SA1121
#pragma warning disable SA1205
#pragma warning disable SA1309
#pragma warning disable SA1402
#pragma warning disable SA1505
#pragma warning disable SA1507
#pragma warning disable SA1508
#pragma warning disable SA1652

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Numerics;
using System.Text.Json;

using JSONREADER = System.Text.Json.Utf8JsonReader;
using JSONWRITER = System.Text.Json.Utf8JsonWriter;
using FIELDINFO = SharpGLTF.Reflection.FieldInfo;


namespace SharpGLTF.Schema2.AGI
{
	using Collections;

	/// <summary>
	/// The type of motion applied by this articulation stage.
	/// </summary>
	public enum AgiArticulationTransformType
	{
		xTranslate,
		yTranslate,
		zTranslate,
		xRotate,
		yRotate,
		zRotate,
		xScale,
		yScale,
		zScale,
		uniformScale,
	}


	/// <summary>
	/// One stage of a model articulation definition.
	/// </summary>
	#if NET6_0_OR_GREATER
	[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
	#endif
	[global::System.CodeDom.Compiler.GeneratedCodeAttribute("SharpGLTF.CodeGen", "1.0.0.0")]
	partial class AgiArticulationStage : ExtraProperties
	{
	
		#region reflection
	
		public new const string SCHEMANAME = "stage";
		protected override string GetSchemaName() => SCHEMANAME;
	
		protected override IEnumerable<string> ReflectFieldsNames()
		{
			yield return "initialValue";
			yield return "maximumValue";
			yield return "minimumValue";
			yield return "name";
			yield return "type";
			foreach(var f in base.ReflectFieldsNames()) yield return f;
		}
		protected override bool TryReflectField(string name, out FIELDINFO value)
		{
			switch(name)
			{
				case "initialValue": value = FIELDINFO.From("initialValue",this, instance => instance._initialValue); return true;
				case "maximumValue": value = FIELDINFO.From("maximumValue",this, instance => instance._maximumValue); return true;
				case "minimumValue": value = FIELDINFO.From("minimumValue",this, instance => instance._minimumValue); return true;
				case "name": value = FIELDINFO.From("name",this, instance => instance._name); return true;
				case "type": value = FIELDINFO.From("type",this, instance => instance._type); return true;
				default: return base.TryReflectField(name, out value);
			}
		}
	
		#endregion
	
		#region data
	
		private Double _initialValue;
		
		private Double _maximumValue;
		
		private Double _minimumValue;
		
		private String _name;
		
		private AgiArticulationTransformType _type;
		
		#endregion
	
		#region serialization
	
		protected override void SerializeProperties(JSONWRITER writer)
		{
			base.SerializeProperties(writer);
			SerializeProperty(writer, "initialValue", _initialValue);
			SerializeProperty(writer, "maximumValue", _maximumValue);
			SerializeProperty(writer, "minimumValue", _minimumValue);
			SerializeProperty(writer, "name", _name);
			SerializePropertyEnumSymbol<AgiArticulationTransformType>(writer, "type", _type);
		}
	
		protected override void DeserializeProperty(string jsonPropertyName, ref JSONREADER reader)
		{
			switch (jsonPropertyName)
			{
				case "initialValue": DeserializePropertyValue<AgiArticulationStage, Double>(ref reader, this, out _initialValue); break;
				case "maximumValue": DeserializePropertyValue<AgiArticulationStage, Double>(ref reader, this, out _maximumValue); break;
				case "minimumValue": DeserializePropertyValue<AgiArticulationStage, Double>(ref reader, this, out _minimumValue); break;
				case "name": DeserializePropertyValue<AgiArticulationStage, String>(ref reader, this, out _name); break;
				case "type": _type = DeserializePropertyValue<AgiArticulationTransformType>(ref reader); break;
				default: base.DeserializeProperty(jsonPropertyName,ref reader); break;
			}
		}
	
		#endregion
	
	}

	/// <summary>
	/// A model articulation definition.
	/// </summary>
	#if NET6_0_OR_GREATER
	[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
	#endif
	[global::System.CodeDom.Compiler.GeneratedCodeAttribute("SharpGLTF.CodeGen", "1.0.0.0")]
	partial class AgiArticulation : ExtraProperties
	{
	
		#region reflection
	
		public new const string SCHEMANAME = "articulation";
		protected override string GetSchemaName() => SCHEMANAME;
	
		protected override IEnumerable<string> ReflectFieldsNames()
		{
			yield return "name";
			yield return "pointingVector";
			yield return "stages";
			foreach(var f in base.ReflectFieldsNames()) yield return f;
		}
		protected override bool TryReflectField(string name, out FIELDINFO value)
		{
			switch(name)
			{
				case "name": value = FIELDINFO.From("name",this, instance => instance._name); return true;
				case "pointingVector": value = FIELDINFO.From("pointingVector",this, instance => instance._pointingVector); return true;
				case "stages": value = FIELDINFO.From("stages",this, instance => instance._stages); return true;
				default: return base.TryReflectField(name, out value);
			}
		}
	
		#endregion
	
		#region data
	
		private String _name;
		
		private Vector3? _pointingVector;
		
		private const int _stagesMinItems = 1;
		private ChildrenList<AgiArticulationStage,AgiArticulation> _stages;
		
		#endregion
	
		#region serialization
	
		protected override void SerializeProperties(JSONWRITER writer)
		{
			base.SerializeProperties(writer);
			SerializeProperty(writer, "name", _name);
			SerializeProperty(writer, "pointingVector", _pointingVector);
			SerializeProperty(writer, "stages", _stages, _stagesMinItems);
		}
	
		protected override void DeserializeProperty(string jsonPropertyName, ref JSONREADER reader)
		{
			switch (jsonPropertyName)
			{
				case "name": DeserializePropertyValue<AgiArticulation, String>(ref reader, this, out _name); break;
				case "pointingVector": DeserializePropertyValue<AgiArticulation, Vector3?>(ref reader, this, out _pointingVector); break;
				case "stages": DeserializePropertyList<AgiArticulation, AgiArticulationStage>(ref reader, this, _stages); break;
				default: base.DeserializeProperty(jsonPropertyName,ref reader); break;
			}
		}
	
		#endregion
	
	}

	/// <summary>
	/// glTF Extension that defines metadata for applying external analysis or effects to a model.
	/// </summary>
	#if NET6_0_OR_GREATER
	[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
	#endif
	[global::System.CodeDom.Compiler.GeneratedCodeAttribute("SharpGLTF.CodeGen", "1.0.0.0")]
	partial class AgiRootArticulations : ExtraProperties
	{
	
		#region reflection
	
		public new const string SCHEMANAME = "AGI_articulations";
		protected override string GetSchemaName() => SCHEMANAME;
	
		protected override IEnumerable<string> ReflectFieldsNames()
		{
			yield return "articulations";
			foreach(var f in base.ReflectFieldsNames()) yield return f;
		}
		protected override bool TryReflectField(string name, out FIELDINFO value)
		{
			switch(name)
			{
				case "articulations": value = FIELDINFO.From("articulations",this, instance => instance._articulations); return true;
				default: return base.TryReflectField(name, out value);
			}
		}
	
		#endregion
	
		#region data
	
		private const int _articulationsMinItems = 1;
		private ChildrenList<AgiArticulation,AgiRootArticulations> _articulations;
		
		#endregion
	
		#region serialization
	
		protected override void SerializeProperties(JSONWRITER writer)
		{
			base.SerializeProperties(writer);
			SerializeProperty(writer, "articulations", _articulations, _articulationsMinItems);
		}
	
		protected override void DeserializeProperty(string jsonPropertyName, ref JSONREADER reader)
		{
			switch (jsonPropertyName)
			{
				case "articulations": DeserializePropertyList<AgiRootArticulations, AgiArticulation>(ref reader, this, _articulations); break;
				default: base.DeserializeProperty(jsonPropertyName,ref reader); break;
			}
		}
	
		#endregion
	
	}

}
