/* 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>
    /// Response containing the discovered device response or error details if the operation failed.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("Azure.Iot.Operations.ProtocolCompilerLib", "1.0.0.0")]
    public partial class CreateOrUpdateDiscoveredDeviceResponsePayload : IJsonOnDeserialized, IJsonOnSerializing
    {
        /// <summary>
        /// The discovered device response.
        /// </summary>
        [JsonPropertyName("discoveredDeviceResponse")]
        [JsonIgnore(Condition = JsonIgnoreCondition.Never)]
        [JsonRequired]
        public DiscoveredDeviceResponseSchema DiscoveredDeviceResponse { get; set; } = default!;

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

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