/* 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>
    /// Response containing the asset resource or error details if the asset could not be retrieved.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("Azure.Iot.Operations.ProtocolCompilerLib", "1.0.0.0")]
    public partial class GetAssetResponsePayload : IJsonOnDeserialized, IJsonOnSerializing
    {
        /// <summary>
        /// The asset resource
        /// </summary>
        [JsonPropertyName("asset")]
        [JsonIgnore(Condition = JsonIgnoreCondition.Never)]
        [JsonRequired]
        public Asset Asset { get; set; } = default!;

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

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