/* 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
{
    /// <summary>
    /// The discovered asset response.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("Azure.Iot.Operations.ProtocolCompilerLib", "1.0.0.0")]
    public partial class DiscoveredAssetResponseSchema : IJsonOnDeserialized, IJsonOnSerializing
    {
        /// <summary>
        /// The unique identifier for the discovered asset.
        /// </summary>
        [JsonPropertyName("discoveryId")]
        [JsonIgnore(Condition = JsonIgnoreCondition.Never)]
        [JsonRequired]
        public string DiscoveryId { get; set; } = default!;

        /// <summary>
        /// The version of the discovered asset resource.
        /// </summary>
        [JsonPropertyName("version")]
        [JsonIgnore(Condition = JsonIgnoreCondition.Never)]
        [JsonRequired]
        public ulong Version { get; set; } = default!;

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

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