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

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

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

        void IJsonOnDeserialized.OnDeserialized()
        {
            if (ManagementActionName is null)
            {
                throw new ArgumentNullException("managementActionName field cannot be null");
            }
            if (ManagementGroupName is null)
            {
                throw new ArgumentNullException("managementGroupName field cannot be null");
            }
            if (RuntimeHealth is null)
            {
                throw new ArgumentNullException("runtimeHealth field cannot be null");
            }
        }

        void IJsonOnSerializing.OnSerializing()
        {
            if (ManagementActionName is null)
            {
                throw new ArgumentNullException("managementActionName field cannot be null");
            }
            if (ManagementGroupName is null)
            {
                throw new ArgumentNullException("managementGroupName field cannot be null");
            }
            if (RuntimeHealth is null)
            {
                throw new ArgumentNullException("runtimeHealth field cannot be null");
            }
        }
    }
}
