/* 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
{
    [System.CodeDom.Compiler.GeneratedCode("Azure.Iot.Operations.ProtocolCompilerLib", "1.0.0.0")]
    public partial class EventStreamDestination : IJsonOnDeserialized, IJsonOnSerializing
    {
        /// <summary>
        /// The destination configuration.
        /// </summary>
        [JsonPropertyName("configuration")]
        [JsonIgnore(Condition = JsonIgnoreCondition.Never)]
        [JsonRequired]
        public DestinationConfiguration Configuration { get; set; } = default!;

        /// <summary>
        /// The target destination.
        /// </summary>
        [JsonPropertyName("target")]
        [JsonIgnore(Condition = JsonIgnoreCondition.Never)]
        [JsonRequired]
        public EventStreamTarget Target { get; set; } = default!;

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

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