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

namespace Azure.Iot.Operations.Services.SchemaRegistry.Generated
{
    /// <summary>
    /// GET Schema request object
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("Azure.Iot.Operations.ProtocolCompilerLib", "1.0.0.0")]
    public partial class GetRequestSchema : IJsonOnDeserialized, IJsonOnSerializing
    {
        /// <summary>
        /// Schema name.
        /// </summary>
        [JsonPropertyName("name")]
        [JsonIgnore(Condition = JsonIgnoreCondition.Never)]
        [JsonRequired]
        public string Name { get; set; } = default!;

        /// <summary>
        /// Version of the schema. Allowed between 0-9.
        /// </summary>
        [JsonPropertyName("version")]
        [JsonIgnore(Condition = JsonIgnoreCondition.Never)]
        [JsonRequired]
        public string Version { get; set; } = default!;

        void IJsonOnDeserialized.OnDeserialized()
        {
            if (Name is null)
            {
                throw new ArgumentNullException("name field cannot be null");
            }
            if (Version is null)
            {
                throw new ArgumentNullException("version field cannot be null");
            }
        }

        void IJsonOnSerializing.OnSerializing()
        {
            if (Name is null)
            {
                throw new ArgumentNullException("name field cannot be null");
            }
            if (Version is null)
            {
                throw new ArgumentNullException("version field cannot be null");
            }
        }
    }
}
