/* 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.DeviceDiscoveryService
{
    /// <summary>
    /// The request to create or update a discovered device.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("Azure.Iot.Operations.ProtocolCompilerLib", "1.0.0.0")]
    public partial class CreateOrUpdateDiscoveredDeviceRequestPayload : IJsonOnDeserialized, IJsonOnSerializing
    {
        /// <summary>
        /// The 'discoveredDeviceRequest' Field.
        /// </summary>
        [JsonPropertyName("discoveredDeviceRequest")]
        [JsonIgnore(Condition = JsonIgnoreCondition.Never)]
        [JsonRequired]
        public CreateOrUpdateDiscoveredDeviceRequestSchema DiscoveredDeviceRequest { get; set; } = default!;

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

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