/* 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 AssetManagementGroupStatusSchemaElementSchema : IJsonOnDeserialized, IJsonOnSerializing
    {
        /// <summary>
        /// Array of action statuses that describe the status of each action.
        /// </summary>
        [JsonPropertyName("actions")]
        [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
        public List<AssetManagementGroupActionStatusSchemaElementSchema>? Actions { get; set; } = default;

        /// <summary>
        /// The name of the managementgroup. Must be unique within the status.managementGroup array. This name is used to correlate between the spec and status management group information.
        /// </summary>
        [JsonPropertyName("name")]
        [JsonIgnore(Condition = JsonIgnoreCondition.Never)]
        [JsonRequired]
        public string Name { get; set; } = default!;

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

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