/* Code generated by Azure.Iot.Operations.ProtocolCompilerLib v1.0.0.0; DO NOT EDIT. */

#nullable enable

using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
using Azure.Iot.Operations.Services.AssetAndDeviceRegistry.Generated.Common;

namespace Azure.Iot.Operations.Services.AssetAndDeviceRegistry.Generated.AdrBaseService
{
    /// <summary>
    /// Set of endpoints for device to connect to.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("Azure.Iot.Operations.ProtocolCompilerLib", "1.0.0.0")]
    public partial class OutboundSchema : IJsonOnDeserialized, IJsonOnSerializing
    {
        /// <summary>
        /// Device messaging endpoint model.
        /// </summary>
        [JsonPropertyName("assigned")]
        [JsonIgnore(Condition = JsonIgnoreCondition.Never)]
        [JsonRequired]
        public Dictionary<string, DeviceOutboundEndpoint> Assigned { get; set; } = default!;

        /// <summary>
        /// Device messaging endpoint model.
        /// </summary>
        [JsonPropertyName("unassigned")]
        [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
        public Dictionary<string, DeviceOutboundEndpoint>? Unassigned { get; set; } = default;

        void IJsonOnDeserialized.OnDeserialized()
        {
            if (Assigned is null)
            {
                throw new ArgumentNullException("assigned field cannot be null");
            }
        }

        void IJsonOnSerializing.OnSerializing()
        {
            if (Assigned is null)
            {
                throw new ArgumentNullException("assigned field cannot be null");
            }
        }
    }
}
