/// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from.</param>
        /// <returns>The object Value.</returns>
        internal static PartitionSchemeDescription GetFromJsonProperties(JsonReader reader)
        {
            PartitionSchemeDescription obj = null;
            var propName = reader.ReadPropertyName();

            if (!propName.Equals("PartitionScheme", StringComparison.Ordinal))
            {
                throw new JsonReaderException($"Incorrect discriminator property name {propName}, Expected discriminator property name is PartitionScheme.");
            }

            var propValue = reader.ReadValueAsString();

            if (propValue.Equals("Named", StringComparison.Ordinal))
            {
                obj = NamedPartitionSchemeDescriptionConverter.GetFromJsonProperties(reader);
            }
            else if (propValue.Equals("Singleton", StringComparison.Ordinal))
            {
                obj = SingletonPartitionSchemeDescriptionConverter.GetFromJsonProperties(reader);
            }
            else if (propValue.Equals("UniformInt64Range", StringComparison.Ordinal))
            {
                obj = UniformInt64RangePartitionSchemeDescriptionConverter.GetFromJsonProperties(reader);
            }
            else
            {
                throw new InvalidOperationException("Unknown PartitionScheme.");
            }

            return(obj);
        }
        /// <summary>
        /// Serializes the object to JSON.
        /// </summary>
        /// <param name="writer">The <see cref="T: Newtonsoft.Json.JsonWriter" /> to write to.</param>
        /// <param name="obj">The object to serialize to JSON.</param>
        internal static void Serialize(JsonWriter writer, PartitionSchemeDescription obj)
        {
            var kind = obj.PartitionScheme;

            if (kind.Equals(PartitionScheme.Named))
            {
                NamedPartitionSchemeDescriptionConverter.Serialize(writer, (NamedPartitionSchemeDescription)obj);
            }
            else if (kind.Equals(PartitionScheme.Singleton))
            {
                SingletonPartitionSchemeDescriptionConverter.Serialize(writer, (SingletonPartitionSchemeDescription)obj);
            }
            else if (kind.Equals(PartitionScheme.UniformInt64Range))
            {
                UniformInt64RangePartitionSchemeDescriptionConverter.Serialize(writer, (UniformInt64RangePartitionSchemeDescription)obj);
            }
            else
            {
                throw new InvalidOperationException("Unknown PartitionScheme.");
            }
        }