<gh_stars>0/*
 * SnapTrade
 *
 * Connect brokerage accounts to your app for live positions and trading
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: envkt@example.com
 * Generated by: https://konfigthis.com
 */


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 = SnapTrade.Net.Client.OpenAPIDateConverter;

namespace SnapTrade.Net.Model
{
    /// <summary>
    /// Status of account transaction sync
    /// </summary>
    [DataContract(Name = "TransactionsStatus")]
    public partial class TransactionsStatus : IEquatable<TransactionsStatus>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="TransactionsStatus" /> class.
        /// </summary>
        /// <param name="initialSyncCompleted">initialSyncCompleted.</param>
        /// <param name="lastSuccessfulSync">Date in YYYY-MM-DD format or null.</param>
        public TransactionsStatus(bool initialSyncCompleted = default(bool), DateTime? lastSuccessfulSync = default(DateTime?))
        {
            this.InitialSyncCompleted = initialSyncCompleted;
            this.LastSuccessfulSync = lastSuccessfulSync;
        }

        /// <summary>
        /// Gets or Sets InitialSyncCompleted
        /// </summary>
        [DataMember(Name = "initial_sync_completed", EmitDefaultValue = true)]
        public bool InitialSyncCompleted { get; set; }

        /// <summary>
        /// Date in YYYY-MM-DD format or null
        /// </summary>
        /// <value>Date in YYYY-MM-DD format or null</value>
        [DataMember(Name = "last_successful_sync", EmitDefaultValue = true)]
        [JsonConverter(typeof(OpenAPIDateConverter))]
        public DateTime? LastSuccessfulSync { 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 TransactionsStatus {\n");
            sb.Append("  InitialSyncCompleted: ").Append(InitialSyncCompleted).Append("\n");
            sb.Append("  LastSuccessfulSync: ").Append(LastSuccessfulSync).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 TransactionsStatus);
        }

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

        /// <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.InitialSyncCompleted.GetHashCode();
                if (this.LastSuccessfulSync != null)
                {
                    hashCode = (hashCode * 59) + this.LastSuccessfulSync.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;
        }
    }

}
