/*
 * 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 System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;

namespace Org.OpenAPITools.Model
{
    /// <summary>
    /// Coordinate
    /// </summary>
    [DataContract(Name = "Coordinate")]
    public partial class Coordinate : IEquatable<Coordinate>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Coordinate" /> class.
        /// </summary>
        /// <param name="isDegree">A value indicating whether the latitude and longitude values are in degree or radian..</param>
        /// <param name="lat">The latitude (y-axis).</param>
        /// <param name="lng">The longitude (x-axis).</param>
        public Coordinate(bool isDegree = default(bool), double lat = default(double), double lng = default(double))
        {
            this.IsDegree = isDegree;
            this.Lat = lat;
            this.Lng = lng;
        }

        /// <summary>
        /// A value indicating whether the latitude and longitude values are in degree or radian.
        /// </summary>
        /// <value>A value indicating whether the latitude and longitude values are in degree or radian.</value>
        [DataMember(Name = "isDegree", EmitDefaultValue = true)]
        public bool IsDegree { get; set; }

        /// <summary>
        /// The latitude (y-axis)
        /// </summary>
        /// <value>The latitude (y-axis)</value>
        [DataMember(Name = "lat", EmitDefaultValue = false)]
        public double Lat { get; set; }

        /// <summary>
        /// The longitude (x-axis)
        /// </summary>
        /// <value>The longitude (x-axis)</value>
        [DataMember(Name = "lng", EmitDefaultValue = false)]
        public double Lng { get; set; }

        /// <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 Coordinate {\n");
            sb.Append("  IsDegree: ").Append(IsDegree).Append("\n");
            sb.Append("  Lat: ").Append(Lat).Append("\n");
            sb.Append("  Lng: ").Append(Lng).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 Coordinate);
        }

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

        /// <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.IsDegree.GetHashCode();
                hashCode = (hashCode * 59) + this.Lat.GetHashCode();
                hashCode = (hashCode * 59) + this.Lng.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)
        {
            yield break;
        }
    }

}
