/* 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.EdgeRegistry.Generated.Common;

namespace Azure.Iot.Operations.Services.EdgeRegistry.Generated
{
    /// <summary>
    /// Request payload for deleting an xRegistry entity.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("Azure.Iot.Operations.ProtocolCompilerLib", "1.0.0.0")]
    public partial class DeleteRequestPayload : IJsonOnDeserialized, IJsonOnSerializing
    {
        /// <summary>
        /// Group identifier. Uses the default if not specified.
        /// </summary>
        [JsonPropertyName("groupId")]
        [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
        public string? GroupId { get; set; } = default;

        /// <summary>
        /// Options that control the behavior of the delete operation.
        /// </summary>
        [JsonPropertyName("options")]
        [JsonIgnore(Condition = JsonIgnoreCondition.Never)]
        [JsonRequired]
        public DeleteOptions Options { get; set; } = default!;

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

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