/*
 * SMAC API
 *
 * SMAC ASP.NET Core Web API
 *
 * The version of the OpenAPI document: v1
 * Generated by: https://github.com/openapitools/openapi-generator.git
 */


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using JsonSubTypes;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;

namespace Org.OpenAPITools.Model
{
    /// <summary>
    /// GeofenceData
    /// </summary>
    [DataContract(Name = "GeofenceData")]
    [JsonConverter(typeof(JsonSubtypes), "Type")]
    [JsonSubtypes.KnownSubType(typeof(GeofenceCircleData), "GeofenceCircleData")]
    [JsonSubtypes.KnownSubType(typeof(GeofencePolygonData), "GeofencePolygonData")]
    [JsonSubtypes.KnownSubType(typeof(GeofenceRectangleData), "GeofenceRectangleData")]
    public partial class GeofenceData : IEquatable<GeofenceData>, IValidatableObject
    {
        /// <summary>
        /// Defines the type of GeofenceData.
        /// </summary>
        /// <value>Defines the type of GeofenceData.</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum TypeEnum
        {
            /// <summary>
            /// Enum None for value: None
            /// </summary>
            [EnumMember(Value = "None")]
            None = 1,

            /// <summary>
            /// Enum Rectangle for value: Rectangle
            /// </summary>
            [EnumMember(Value = "Rectangle")]
            Rectangle = 2,

            /// <summary>
            /// Enum Polygon for value: Polygon
            /// </summary>
            [EnumMember(Value = "Polygon")]
            Polygon = 3,

            /// <summary>
            /// Enum Circle for value: Circle
            /// </summary>
            [EnumMember(Value = "Circle")]
            Circle = 4

        }


        /// <summary>
        /// Defines the type of GeofenceData.
        /// </summary>
        /// <value>Defines the type of GeofenceData.</value>
        [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)]
        public TypeEnum Type { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="GeofenceData" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected GeofenceData() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="GeofenceData" /> class.
        /// </summary>
        /// <param name="type">Defines the type of GeofenceData. (required).</param>
        public GeofenceData(TypeEnum type = default(TypeEnum))
        {
            this.Type = type;
        }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("class GeofenceData {\n");
            sb.Append("  Type: ").Append(Type).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public virtual string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
        }

        /// <summary>
        /// Returns true if objects are equal
        /// </summary>
        /// <param name="input">Object to be compared</param>
        /// <returns>Boolean</returns>
        public override bool Equals(object input)
        {
            return this.Equals(input as GeofenceData);
        }

        /// <summary>
        /// Returns true if GeofenceData instances are equal
        /// </summary>
        /// <param name="input">Instance of GeofenceData to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(GeofenceData input)
        {
            if (input == null)
            {
                return false;
            }
            return 
                (
                    this.Type == input.Type ||
                    this.Type.Equals(input.Type)
                );
        }

        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                hashCode = (hashCode * 59) + this.Type.GetHashCode();
                return hashCode;
            }
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
        {
            return this.BaseValidate(validationContext);
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        protected IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> BaseValidate(ValidationContext validationContext)
        {
            yield break;
        }
    }

}
