context: /* 
   * Dowding HTTP REST API
   *
   * The Dowding HTTP REST API allows you to add and retrieve contact data from Dowding as well as perform other peripheral functions.
   *
   * OpenAPI spec version: 1.0.0
   * 
   * Generated by: https://github.com/swagger-api/swagger-codegen.git
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  using System;
  using System.Linq;
  using System.IO;
  using System.Text;
  using System.Collections;
  using System.Collections.Generic;
  using System.Collections.ObjectModel;
  using System.Runtime.Serialization;
  using Newtonsoft.Json;
  using Newtonsoft.Json.Converters;
  
  namespace Dowding.Model
  {
      /// <summary>
      /// HomepointDto
      /// </summary>
      [DataContract]
      public partial class HomepointDto :  IEquatable<HomepointDto>
      {
          /// <summary>
          /// Initializes a new instance of the <see cref="HomepointDto" /> class.
          /// </summary>
          [JsonConstructorAttribute]
          protected HomepointDto() { }
          /// <summary>
          /// Initializes a new instance of the <see cref="HomepointDto" /> class.
          /// </summary>
          /// <param name="Ts">Number representing the timestamp in milliseconds since the unix epoch that this tick occurred (required).</param>
          /// <param name="CorrelationId">String representing the correlated contact the correlatable belongs to (required).</param>
          /// <param name="AgentId">UUID of AGENT that provided this correlatable (required).</param>
          /// <param name="Lat">Number representing the WGS84 latitude of the homepoint that was set for the vehicle (required).</param>
          /// <param name="Lon">Number representing the WGS84 longitude of the homepoint that was set for the vehicle (required).</param>
          /// <param name="Hae">Number representing the WGS84 height above ellipsoid of the homepoint that was set for the vehicle.</param>
          public HomepointDto(decimal? Ts = null, string CorrelationId = null, string AgentId = null, decimal? Lat = null, decimal? Lon = null, decimal? Hae = null)
          {
              // to ensure "Ts" is required (not null)
              if (Ts == null)
              {
                  throw new InvalidDataException("Ts is a required property for HomepointDto and cannot be null");
              }
              else
              {
                  this.Ts = Ts;
              }
              // to ensure "CorrelationId" is required (not null)
              if (CorrelationId == null)
              {
                  throw new InvalidDataException("CorrelationId is a required property for HomepointDto and cannot be null");
              }
              else
              {
                  this.CorrelationId = CorrelationId;
              }
              // to ensure "AgentId" is required (not null)
              if (AgentId == null)
              {
                  throw new InvalidDataException("AgentId is a required property for HomepointDto and cannot be null");
              }
              else
              {
                  this.AgentId = AgentId;
              }
              // to ensure "Lat" is required (not null)
              if (Lat == null)
              {
                  throw new InvalidDataException("Lat is a required property for HomepointDto and cannot be null");
              }
              else
              {
                  this.Lat = Lat;
              }
              // to ensure "Lon" is required (not null)
              if (Lon == null)
              {
                  throw new InvalidDataException("Lon is a required property for HomepointDto and cannot be null");
              }
              else
              {
                  this.Lon = Lon;
              }
              this.Hae = Hae;
          }
          
          /// <summary>
          /// Number representing the timestamp in milliseconds since the unix epoch that this tick occurred
          /// </summary>
          /// <value>Number representing the timestamp in milliseconds since the unix epoch that this tick occurred</value>
          [DataMember(Name="ts", EmitDefaultValue=false)]
          public decimal? Ts { get; set; }
          /// <summary>
          /// String representing the correlated contact the correlatable belongs to
          /// </summary>
          /// <value>String representing the correlated contact the correlatable belongs to</value>
          [DataMember(Name="correlation_id", EmitDefaultValue=false)]
          public string CorrelationId { get; set; }
          /// <summary>
          /// UUID of AGENT that provided this correlatable
          /// </summary>
          /// <value>UUID of AGENT that provided this correlatable</value>
          [DataMember(Name="agent_id", EmitDefaultValue=false)]
          public string AgentId { get; set; }
          /// <summary>
          /// Number representing the WGS84 latitude of the homepoint that was set for the vehicle
          /// </summary>
          /// <value>Number representing the WGS84 latitude of the homepoint that was set for the vehicle</value>
          [DataMember(Name="lat", EmitDefaultValue=false)]
          public decimal? Lat { get; set; }
          /// <summary>
          /// Number representing the WGS84 longitude of the homepoint that was set for the vehicle
          /// </summary>
          /// <value>Number representing the WGS84 longitude of the homepoint that was set for the vehicle</value>
          [DataMember(Name="lon", EmitDefaultValue=false)]
          public decimal? Lon { get; set; }
          /// <summary>
          /// Number representing the WGS84 height above ellipsoid of the homepoint that was set for the vehicle
          /// </summary>
          /// <value>Number representing the WGS84 height above ellipsoid of the homepoint that was set for the vehicle</value>
          [DataMember(Name="hae", EmitDefaultValue=false)]
          public decimal? Hae { get; set; }
          /// <summary>
          /// Returns the string presentation of the object
          /// </summary>
          /// <returns>String presentation of the object</returns>
          public override string ToString()
          {
              var sb = new StringBuilder();
              sb.Append("class HomepointDto {\n");
              sb.Append("  Ts: ").Append(Ts).Append("\n");
              sb.Append("  CorrelationId: ").Append(CorrelationId).Append("\n");
              sb.Append("  AgentId: ").Append(AgentId).Append("\n");
              sb.Append("  Lat: ").Append(Lat).Append("\n");
              sb.Append("  Lon: ").Append(Lon).Append("\n");
              sb.Append("  Hae: ").Append(Hae).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 string ToJson()
          {
              return JsonConvert.SerializeObject(this, Formatting.Indented);
          }
  
          /// <summary>
          /// Returns true if objects are equal
          /// </summary>
          /// <param name="obj">Object to be compared</param>
          /// <returns>Boolean</returns>
          public override bool Equals(object obj)
          {
              // credit: http://stackoverflow.com/a/10454552/677735
              return this.Equals(obj as HomepointDto);
          }
  
          /// <summary>
          /// Returns true if HomepointDto instances are equal
          /// </summary>
          /// <param name="other">Instance of HomepointDto to be compared</param>
          /// <returns>Boolean</returns>
          public bool Equals(HomepointDto other)
          {
              // credit: http://stackoverflow.com/a/10454552/677735
              if (other == null)
                  return false;
  
              return 
                  (
                      this.Ts == other.Ts ||
                      this.Ts != null &&
                      this.Ts.Equals(other.Ts)
                  ) && 
                  (
                      this.CorrelationId == other.CorrelationId ||
                      this.CorrelationId != null &&
                      this.CorrelationId.Equals(other.CorrelationId)
                  ) && 
                  (
                      this.AgentId == other.AgentId ||
                      this.AgentId != null &&
                      this.AgentId.Equals(other.AgentId)
                  ) && 
                  (
                      this.Lat == other.Lat ||
                      this.Lat != null &&
                      this.Lat.Equals(other.Lat)
                  ) && 
                  (
                      this.Lon == other.Lon ||
                      this.Lon != null &&
                      this.Lon.Equals(other.Lon)
                  ) && 
                  (
                      this.Hae == other.Hae ||
                      this.Hae != null &&
                      this.Hae.Equals(other.Hae)
                  );
          }
  
          /// <summary>
          /// Gets the hash code
          /// </summary>
          /// <returns>Hash code</returns>
          public override int GetHashCode()
          {
              // credit: http://stackoverflow.com/a/263416/677735
              unchecked // Overflow is fine, just wrap
              {
                  int hash = 41;
                  // Suitable nullity checks etc, of course :)
                  if (this.Ts != null)
  
gt:                     hash = hash * 59 + this.Ts.GetHashCode();