/* 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 EventsSchemaElementSchema : IJsonOnDeserialized, IJsonOnSerializing
    {
        /// <summary>
        /// The name of the event group containing the event for which the runtime health is being reported.
        /// </summary>
        [JsonPropertyName("eventGroupName")]
        [JsonIgnore(Condition = JsonIgnoreCondition.Never)]
        [JsonRequired]
        public string EventGroupName { get; set; } = default!;

        /// <summary>
        /// The name of the event for which the runtime health is being reported.
        /// </summary>
        [JsonPropertyName("eventName")]
        [JsonIgnore(Condition = JsonIgnoreCondition.Never)]
        [JsonRequired]
        public string EventName { get; set; } = default!;

        /// <summary>
        /// The runtime health of the specific event.
        /// </summary>
        [JsonPropertyName("runtimeHealth")]
        [JsonIgnore(Condition = JsonIgnoreCondition.Never)]
        [JsonRequired]
        public RuntimeHealth RuntimeHealth { get; set; } = default!;

        void IJsonOnDeserialized.OnDeserialized()
        {
            if (EventGroupName is null)
            {
                throw new ArgumentNullException("eventGroupName field cannot be null");
            }
            if (EventName is null)
            {
                throw new ArgumentNullException("eventName field cannot be null");
            }
            if (RuntimeHealth is null)
            {
                throw new ArgumentNullException("runtimeHealth field cannot be null");
            }
        }

        void IJsonOnSerializing.OnSerializing()
        {
            if (EventGroupName is null)
            {
                throw new ArgumentNullException("eventGroupName field cannot be null");
            }
            if (EventName is null)
            {
                throw new ArgumentNullException("eventName field cannot be null");
            }
            if (RuntimeHealth is null)
            {
                throw new ArgumentNullException("runtimeHealth field cannot be null");
            }
        }
    }
}
