// <auto-generated/>

#nullable disable

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

namespace SampleTypeSpec
{
    /// <summary> A sample dynamic model. </summary>
    public partial class DynamicModel
    {
        /// <summary> Keeps track of any properties unknown to the library. </summary>
        private protected readonly IDictionary<string, BinaryData> _additionalBinaryDataProperties;

        /// <summary> Initializes a new instance of <see cref="DynamicModel"/>. </summary>
        /// <param name="name"></param>
        /// <param name="requiredNullableList"></param>
        /// <param name="requiredNullableDictionary"></param>
        /// <param name="primitiveDictionary"></param>
        /// <param name="foo"></param>
        /// <param name="listFoo"></param>
        /// <param name="listOfListFoo"></param>
        /// <param name="dictionaryFoo"></param>
        /// <param name="dictionaryOfDictionaryFoo"></param>
        /// <param name="dictionaryListFoo"></param>
        /// <param name="listOfDictionaryFoo"></param>
        /// <exception cref="ArgumentNullException"> <paramref name="name"/>, <paramref name="primitiveDictionary"/>, <paramref name="foo"/>, <paramref name="listFoo"/>, <paramref name="listOfListFoo"/>, <paramref name="dictionaryFoo"/>, <paramref name="dictionaryOfDictionaryFoo"/>, <paramref name="dictionaryListFoo"/> or <paramref name="listOfDictionaryFoo"/> is null. </exception>
        public DynamicModel(string name, IEnumerable<int> requiredNullableList, IDictionary<string, int> requiredNullableDictionary, IDictionary<string, int> primitiveDictionary, AnotherDynamicModel foo, IEnumerable<AnotherDynamicModel> listFoo, IEnumerable<IList<AnotherDynamicModel>> listOfListFoo, IDictionary<string, AnotherDynamicModel> dictionaryFoo, IDictionary<string, IDictionary<string, AnotherDynamicModel>> dictionaryOfDictionaryFoo, IDictionary<string, IList<AnotherDynamicModel>> dictionaryListFoo, IEnumerable<IDictionary<string, AnotherDynamicModel>> listOfDictionaryFoo)
        {
            Argument.AssertNotNull(name, nameof(name));
            Argument.AssertNotNull(primitiveDictionary, nameof(primitiveDictionary));
            Argument.AssertNotNull(foo, nameof(foo));
            Argument.AssertNotNull(listFoo, nameof(listFoo));
            Argument.AssertNotNull(listOfListFoo, nameof(listOfListFoo));
            Argument.AssertNotNull(dictionaryFoo, nameof(dictionaryFoo));
            Argument.AssertNotNull(dictionaryOfDictionaryFoo, nameof(dictionaryOfDictionaryFoo));
            Argument.AssertNotNull(dictionaryListFoo, nameof(dictionaryListFoo));
            Argument.AssertNotNull(listOfDictionaryFoo, nameof(listOfDictionaryFoo));

            Name = name;
            OptionalNullableList = new ChangeTrackingList<int>();
            RequiredNullableList = requiredNullableList?.ToList();
            OptionalNullableDictionary = new ChangeTrackingDictionary<string, int>();
            RequiredNullableDictionary = requiredNullableDictionary;
            PrimitiveDictionary = primitiveDictionary;
            Foo = foo;
            ListFoo = listFoo.ToList();
            ListOfListFoo = listOfListFoo.ToList();
            DictionaryFoo = dictionaryFoo;
            DictionaryOfDictionaryFoo = dictionaryOfDictionaryFoo;
            DictionaryListFoo = dictionaryListFoo;
            ListOfDictionaryFoo = listOfDictionaryFoo.ToList();
        }

        /// <summary> Initializes a new instance of <see cref="DynamicModel"/>. </summary>
        /// <param name="name"></param>
        /// <param name="optionalUnknown"></param>
        /// <param name="optionalInt"></param>
        /// <param name="optionalNullableList"></param>
        /// <param name="requiredNullableList"></param>
        /// <param name="optionalNullableDictionary"></param>
        /// <param name="requiredNullableDictionary"></param>
        /// <param name="primitiveDictionary"></param>
        /// <param name="foo"></param>
        /// <param name="listFoo"></param>
        /// <param name="listOfListFoo"></param>
        /// <param name="dictionaryFoo"></param>
        /// <param name="dictionaryOfDictionaryFoo"></param>
        /// <param name="dictionaryListFoo"></param>
        /// <param name="listOfDictionaryFoo"></param>
        /// <param name="additionalBinaryDataProperties"> Keeps track of any properties unknown to the library. </param>
        internal DynamicModel(string name, BinaryData optionalUnknown, int? optionalInt, IList<int> optionalNullableList, IList<int> requiredNullableList, IDictionary<string, int> optionalNullableDictionary, IDictionary<string, int> requiredNullableDictionary, IDictionary<string, int> primitiveDictionary, AnotherDynamicModel foo, IList<AnotherDynamicModel> listFoo, IList<IList<AnotherDynamicModel>> listOfListFoo, IDictionary<string, AnotherDynamicModel> dictionaryFoo, IDictionary<string, IDictionary<string, AnotherDynamicModel>> dictionaryOfDictionaryFoo, IDictionary<string, IList<AnotherDynamicModel>> dictionaryListFoo, IList<IDictionary<string, AnotherDynamicModel>> listOfDictionaryFoo, IDictionary<string, BinaryData> additionalBinaryDataProperties)
        {
            Name = name;
            OptionalUnknown = optionalUnknown;
            OptionalInt = optionalInt;
            OptionalNullableList = optionalNullableList;
            RequiredNullableList = requiredNullableList;
            OptionalNullableDictionary = optionalNullableDictionary;
            RequiredNullableDictionary = requiredNullableDictionary;
            PrimitiveDictionary = primitiveDictionary;
            Foo = foo;
            ListFoo = listFoo;
            ListOfListFoo = listOfListFoo;
            DictionaryFoo = dictionaryFoo;
            DictionaryOfDictionaryFoo = dictionaryOfDictionaryFoo;
            DictionaryListFoo = dictionaryListFoo;
            ListOfDictionaryFoo = listOfDictionaryFoo;
            _additionalBinaryDataProperties = additionalBinaryDataProperties;
        }

        /// <summary> Gets the Name. </summary>
        public string Name { get; }

        /// <summary>
        /// Gets or sets the OptionalUnknown.
        /// <para> To assign an object to this property use <see cref="BinaryData.FromObjectAsJson{T}(T, JsonSerializerOptions?)"/>. </para>
        /// <para> To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. </para>
        /// <para>
        /// Examples:
        /// <list type="bullet">
        /// <item>
        /// <term> BinaryData.FromObjectAsJson("foo"). </term>
        /// <description> Creates a payload of "foo". </description>
        /// </item>
        /// <item>
        /// <term> BinaryData.FromString("\"foo\""). </term>
        /// <description> Creates a payload of "foo". </description>
        /// </item>
        /// <item>
        /// <term> BinaryData.FromObjectAsJson(new { key = "value" }). </term>
        /// <description> Creates a payload of { "key": "value" }. </description>
        /// </item>
        /// <item>
        /// <term> BinaryData.FromString("{\"key\": \"value\"}"). </term>
        /// <description> Creates a payload of { "key": "value" }. </description>
        /// </item>
        /// </list>
        /// </para>
        /// </summary>
        public BinaryData OptionalUnknown { get; set; }

        /// <summary> Gets or sets the OptionalInt. </summary>
        public int? OptionalInt { get; set; }

        /// <summary> Gets or sets the OptionalNullableList. </summary>
        public IList<int> OptionalNullableList { get; set; }

        /// <summary> Gets the RequiredNullableList. </summary>
        public IList<int> RequiredNullableList { get; }

        /// <summary> Gets or sets the OptionalNullableDictionary. </summary>
        public IDictionary<string, int> OptionalNullableDictionary { get; set; }

        /// <summary> Gets the RequiredNullableDictionary. </summary>
        public IDictionary<string, int> RequiredNullableDictionary { get; }

        /// <summary> Gets the PrimitiveDictionary. </summary>
        public IDictionary<string, int> PrimitiveDictionary { get; }

        /// <summary> Gets the Foo. </summary>
        public AnotherDynamicModel Foo { get; }

        /// <summary> Gets the ListFoo. </summary>
        public IList<AnotherDynamicModel> ListFoo { get; }

        /// <summary> Gets the ListOfListFoo. </summary>
        public IList<IList<AnotherDynamicModel>> ListOfListFoo { get; }

        /// <summary> Gets the DictionaryFoo. </summary>
        public IDictionary<string, AnotherDynamicModel> DictionaryFoo { get; }

        /// <summary> Gets the DictionaryOfDictionaryFoo. </summary>
        public IDictionary<string, IDictionary<string, AnotherDynamicModel>> DictionaryOfDictionaryFoo { get; }

        /// <summary> Gets the DictionaryListFoo. </summary>
        public IDictionary<string, IList<AnotherDynamicModel>> DictionaryListFoo { get; }

        /// <summary> Gets the ListOfDictionaryFoo. </summary>
        public IList<IDictionary<string, AnotherDynamicModel>> ListOfDictionaryFoo { get; }
    }
}
