/*
 * 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>
    /// An API error log for a specific SnapTrade user.
    /// </summary>
    [DataContract(Name = "UserErrorLog")]
    public partial class UserErrorLog : IEquatable<UserErrorLog>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="UserErrorLog" /> class.
        /// </summary>
        /// <param name="requestedAt">requestedAt.</param>
        /// <param name="response">response.</param>
        /// <param name="statusCode">statusCode.</param>
        /// <param name="queryParams">queryParams.</param>
        /// <param name="httpMethod">httpMethod.</param>
        /// <param name="endpoint">endpoint.</param>
        public UserErrorLog(string requestedAt = default(string), string response = default(string), decimal statusCode = default(decimal), string queryParams = default(string), string httpMethod = default(string), string endpoint = default(string)) : base()
        {
            this.RequestedAt = requestedAt;
            this.Response = response;
            this.StatusCode = statusCode;
            this.QueryParams = queryParams;
            this.HttpMethod = httpMethod;
            this.Endpoint = endpoint;
            this.AdditionalProperties = new Dictionary<string, object>();
        }

        /// <summary>
        /// Gets or Sets RequestedAt
        /// </summary>
        [DataMember(Name = "requestedAt", EmitDefaultValue = false)]
        public string RequestedAt { get; set; }

        /// <summary>
        /// Gets or Sets Response
        /// </summary>
        [DataMember(Name = "response", EmitDefaultValue = false)]
        public string Response { get; set; }

        /// <summary>
        /// Gets or Sets StatusCode
        /// </summary>
        [DataMember(Name = "statusCode", EmitDefaultValue = false)]
        public decimal StatusCode { get; set; }

        /// <summary>
        /// Gets or Sets QueryParams
        /// </summary>
        [DataMember(Name = "queryParams", EmitDefaultValue = false)]
        public string QueryParams { get; set; }

        /// <summary>
        /// Gets or Sets HttpMethod
        /// </summary>
        [DataMember(Name = "httpMethod", EmitDefaultValue = false)]
        public string HttpMethod { get; set; }

        /// <summary>
        /// Gets or Sets Endpoint
        /// </summary>
        [DataMember(Name = "endpoint", EmitDefaultValue = false)]
        public string Endpoint { get; set; }

        /// <summary>
        /// Gets or Sets additional properties
        /// </summary>
        [JsonExtensionData]
        public IDictionary<string, object> AdditionalProperties { 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 UserErrorLog {\n");
            sb.Append("  ").Append(base.ToString().Replace("\n", "\n  ")).Append("\n");
            sb.Append("  RequestedAt: ").Append(RequestedAt).Append("\n");
            sb.Append("  Response: ").Append(Response).Append("\n");
            sb.Append("  StatusCode: ").Append(StatusCode).Append("\n");
            sb.Append("  QueryParams: ").Append(QueryParams).Append("\n");
            sb.Append("  HttpMethod: ").Append(HttpMethod).Append("\n");
            sb.Append("  Endpoint: ").Append(Endpoint).Append("\n");
            sb.Append("  AdditionalProperties: ").Append(AdditionalProperties).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 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 UserErrorLog);
        }

        /// <summary>
        /// Returns true if UserErrorLog instances are equal
        /// </summary>
        /// <param name="input">Instance of UserErrorLog to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(UserErrorLog input)
        {
            if (input == null)
            {
                return false;
            }
            return base.Equals(input) && 
                (
                    this.RequestedAt == input.RequestedAt ||
                    (this.RequestedAt != null &&
                    this.RequestedAt.Equals(input.RequestedAt))
                ) && base.Equals(input) && 
                (
                    this.Response == input.Response ||
                    (this.Response != null &&
                    this.Response.Equals(input.Response))
                ) && base.Equals(input) && 
                (
                    this.StatusCode == input.StatusCode ||
                    this.StatusCode.Equals(input.StatusCode)
                ) && base.Equals(input) && 
                (
                    this.QueryParams == input.QueryParams ||
                    (this.QueryParams != null &&
                    this.QueryParams.Equals(input.QueryParams))
                ) && base.Equals(input) && 
                (
                    this.HttpMethod == input.HttpMethod ||
                    (this.HttpMethod != null &&
                    this.HttpMethod.Equals(input.HttpMethod))
                ) && base.Equals(input) && 
                (
                    this.Endpoint == input.Endpoint ||
                    (this.Endpoint != null &&
                    this.Endpoint.Equals(input.Endpoint))
                )
                && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any());
        }

        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = base.GetHashCode();
                if (this.RequestedAt != null)
                {
                    hashCode = (hashCode * 59) + this.RequestedAt.GetHashCode();
                }
                if (this.Response != null)
                {
                    hashCode = (hashCode * 59) + this.Response.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.StatusCode.GetHashCode();
                if (this.QueryParams != null)
                {
                    hashCode = (hashCode * 59) + this.QueryParams.GetHashCode();
                }
                if (this.HttpMethod != null)
                {
                    hashCode = (hashCode * 59) + this.HttpMethod.GetHashCode();
                }
                if (this.Endpoint != null)
                {
                    hashCode = (hashCode * 59) + this.Endpoint.GetHashCode();
                }
                if (this.AdditionalProperties != null)
                {
                    hashCode = (hashCode * 59) + this.AdditionalProperties.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;
        }
    }

}
