/* 
 * bSDD API prototype
 *
 * API to access the buildingSMART Data Dictionary
 *
 * OpenAPI spec version: v1
 * Contact: bsdd_support@buildingsmart.org
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 */
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter;

namespace IO.Swagger.Model
{
    /// <summary>
    /// UploadImportFileResultV1
    /// </summary>
    [DataContract]
        public partial class UploadImportFileResultV1 :  IEquatable<UploadImportFileResultV1>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="UploadImportFileResultV1" /> class.
        /// </summary>
        /// <param name="isOk">Indicates if the file will be imported.  Warnings are allowed, import will continue but may lead to undesired values in the database..</param>
        /// <param name="errors">The list of errors found.  It may happen that if you fix one error new errors will be discovered..</param>
        /// <param name="warnings">List of warnings.  It is best to have no warnings at all to avoid inconsistent or incorrect values in the database.</param>
        /// <param name="informationalMessages">Informational messages.</param>
        public UploadImportFileResultV1(bool? isOk = default(bool?), List<UploadImportFileResultItemV1> errors = default(List<UploadImportFileResultItemV1>), List<UploadImportFileResultItemV1> warnings = default(List<UploadImportFileResultItemV1>), List<UploadImportFileResultItemV1> informationalMessages = default(List<UploadImportFileResultItemV1>))
        {
            this.IsOk = isOk;
            this.Errors = errors;
            this.Warnings = warnings;
            this.InformationalMessages = informationalMessages;
        }
        
        /// <summary>
        /// Indicates if the file will be imported.  Warnings are allowed, import will continue but may lead to undesired values in the database.
        /// </summary>
        /// <value>Indicates if the file will be imported.  Warnings are allowed, import will continue but may lead to undesired values in the database.</value>
        [DataMember(Name="isOk", EmitDefaultValue=false)]
        public bool? IsOk { get; set; }

        /// <summary>
        /// The list of errors found.  It may happen that if you fix one error new errors will be discovered.
        /// </summary>
        /// <value>The list of errors found.  It may happen that if you fix one error new errors will be discovered.</value>
        [DataMember(Name="errors", EmitDefaultValue=false)]
        public List<UploadImportFileResultItemV1> Errors { get; set; }

        /// <summary>
        /// List of warnings.  It is best to have no warnings at all to avoid inconsistent or incorrect values in the database
        /// </summary>
        /// <value>List of warnings.  It is best to have no warnings at all to avoid inconsistent or incorrect values in the database</value>
        [DataMember(Name="warnings", EmitDefaultValue=false)]
        public List<UploadImportFileResultItemV1> Warnings { get; set; }

        /// <summary>
        /// Informational messages
        /// </summary>
        /// <value>Informational messages</value>
        [DataMember(Name="informationalMessages", EmitDefaultValue=false)]
        public List<UploadImportFileResultItemV1> InformationalMessages { 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 UploadImportFileResultV1 {\n");
            sb.Append("  IsOk: ").Append(IsOk).Append("\n");
            sb.Append("  Errors: ").Append(Errors).Append("\n");
            sb.Append("  Warnings: ").Append(Warnings).Append("\n");
            sb.Append("  InformationalMessages: ").Append(InformationalMessages).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 JsonConvert.SerializeObject(this, 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 UploadImportFileResultV1);
        }

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

            return 
                (
                    this.IsOk == input.IsOk ||
                    (this.IsOk != null &&
                    this.IsOk.Equals(input.IsOk))
                ) && 
                (
                    this.Errors == input.Errors ||
                    this.Errors != null &&
                    input.Errors != null &&
                    this.Errors.SequenceEqual(input.Errors)
                ) && 
                (
                    this.Warnings == input.Warnings ||
                    this.Warnings != null &&
                    input.Warnings != null &&
                    this.Warnings.SequenceEqual(input.Warnings)
                ) && 
                (
                    this.InformationalMessages == input.InformationalMessages ||
                    this.InformationalMessages != null &&
                    input.InformationalMessages != null &&
                    this.InformationalMessages.SequenceEqual(input.InformationalMessages)
                );
        }

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

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