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

        /// <summary>
        /// Array of dataset runtime health information.
        /// </summary>
        [JsonPropertyName("datasets")]
        [JsonIgnore(Condition = JsonIgnoreCondition.Never)]
        [JsonRequired]
        public List<DatasetsSchemaElementSchema> Datasets { get; set; } = default!;

        void IJsonOnDeserialized.OnDeserialized()
        {
            if (AssetName is null)
            {
                throw new ArgumentNullException("assetName field cannot be null");
            }
            if (Datasets is null)
            {
                throw new ArgumentNullException("datasets field cannot be null");
            }
        }

        void IJsonOnSerializing.OnSerializing()
        {
            if (AssetName is null)
            {
                throw new ArgumentNullException("assetName field cannot be null");
            }
            if (Datasets is null)
            {
                throw new ArgumentNullException("datasets field cannot be null");
            }
        }
    }
}
