/*
 * Warframe.market API
 *
 * ## Documentation is under very slow and heavy development  This document will gradually be supplemented and updated over some extended period of time.  ## Unstable endpoints Endpoint that is not stable and probably will be changed in the future will be marked with exclamation sign -> ⚠ 
 *
 * The version of the OpenAPI document: 1.14.0
 * 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 = WarframeMarket.Client.OpenAPIDateConverter;

namespace WarframeMarket.Model
{
    /// <summary>
    /// &#x60;owner&#x60; will contain &#x60;userShort&#x60; model. *** 
    /// </summary>
    [DataContract(Name = "auctionEntryExpanded")]
    public partial class AuctionEntryExpanded : IEquatable<AuctionEntryExpanded>, IValidatableObject
    {
        /// <summary>
        /// Defines Platform
        /// </summary>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum PlatformEnum
        {
            /// <summary>
            /// Enum Switch for value: switch
            /// </summary>
            [EnumMember(Value = "switch")]
            Switch = 1,

            /// <summary>
            /// Enum Pc for value: pc
            /// </summary>
            [EnumMember(Value = "pc")]
            Pc = 2,

            /// <summary>
            /// Enum Ps4 for value: ps4
            /// </summary>
            [EnumMember(Value = "ps4")]
            Ps4 = 3,

            /// <summary>
            /// Enum Xbox for value: xbox
            /// </summary>
            [EnumMember(Value = "xbox")]
            Xbox = 4
        }


        /// <summary>
        /// Gets or Sets Platform
        /// </summary>
        [DataMember(Name = "platform", EmitDefaultValue = false)]
        public PlatformEnum? Platform { get; set; }
        /// <summary>
        /// Auction will be removed or archivated after &#x60;marked_operation_at&#x60;
        /// </summary>
        /// <value>Auction will be removed or archivated after &#x60;marked_operation_at&#x60;</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum IsMarkedForEnum
        {
            /// <summary>
            /// Enum Null for value: null
            /// </summary>
            [EnumMember(Value = "null")]
            Null = 1,

            /// <summary>
            /// Enum Removing for value: removing
            /// </summary>
            [EnumMember(Value = "removing")]
            Removing = 2,

            /// <summary>
            /// Enum Archiving for value: archiving
            /// </summary>
            [EnumMember(Value = "archiving")]
            Archiving = 3
        }


        /// <summary>
        /// Auction will be removed or archivated after &#x60;marked_operation_at&#x60;
        /// </summary>
        /// <value>Auction will be removed or archivated after &#x60;marked_operation_at&#x60;</value>
        [DataMember(Name = "is_marked_for", EmitDefaultValue = true)]
        public IsMarkedForEnum? IsMarkedFor { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="AuctionEntryExpanded" /> class.
        /// </summary>
        /// <param name="id">id.</param>
        /// <param name="minimalReputation">Minimal amount of reputation that is required to participate in this auction. (default to 0).</param>
        /// <param name="winner">If winner is set, auction is in the paused state. While on pause, bids can&#39;t be added, but can be removed..</param>
        /// <param name="varPrivate">varPrivate.</param>
        /// <param name="visible">visible.</param>
        /// <param name="noteRaw">Raw format string, use it inside textarea, for editing purposes..</param>
        /// <param name="note">It&#39;s safe to inject this into html, this is refined, formatted string from MD processor..</param>
        /// <param name="owner">owner.</param>
        /// <param name="startingPrice">startingPrice.</param>
        /// <param name="buyoutPrice">if &#x60;buyout_price&#x60; is set to null, that means ∞.</param>
        /// <param name="minimalIncrement">Minimum bid increase value (default to 1).</param>
        /// <param name="isDirectSell">Shortcut to &#x60;starting_price&#x60; &#x3D;&#x3D; &#x60;buyout_price&#x60;, means that auction is not an auction, but an order..</param>
        /// <param name="topBid">topBid.</param>
        /// <param name="created">created.</param>
        /// <param name="updated">Last time auction was updated, eighter by owner or by placing a bid..</param>
        /// <param name="platform">platform.</param>
        /// <param name="closed">Auction is closed, and was marked for removal or archiving, no one can add or remove bids now..</param>
        /// <param name="isMarkedFor">Auction will be removed or archivated after &#x60;marked_operation_at&#x60;.</param>
        /// <param name="markedOperationAt">markedOperationAt.</param>
        /// <param name="item">item.</param>
        public AuctionEntryExpanded(string id = default(string), int minimalReputation = 0, string winner = default(string), bool varPrivate = default(bool), bool visible = default(bool), string noteRaw = default(string), string note = default(string), UserShort owner = default(UserShort), int startingPrice = default(int), int? buyoutPrice = default(int?), int minimalIncrement = 1, bool isDirectSell = default(bool), int? topBid = default(int?), DateTime created = default(DateTime), DateTime updated = default(DateTime), PlatformEnum? platform = default(PlatformEnum?), bool closed = default(bool), IsMarkedForEnum? isMarkedFor = default(IsMarkedForEnum?), DateTime? markedOperationAt = default(DateTime?), AuctionsCreatePostRequestItem item = default(AuctionsCreatePostRequestItem))
        {
            this.Id = id;
            this.MinimalReputation = minimalReputation;
            this.Winner = winner;
            this.VarPrivate = varPrivate;
            this.Visible = visible;
            this.NoteRaw = noteRaw;
            this.Note = note;
            this.Owner = owner;
            this.StartingPrice = startingPrice;
            this.BuyoutPrice = buyoutPrice;
            this.MinimalIncrement = minimalIncrement;
            this.IsDirectSell = isDirectSell;
            this.TopBid = topBid;
            this.Created = created;
            this.Updated = updated;
            this.Platform = platform;
            this.Closed = closed;
            this.IsMarkedFor = isMarkedFor;
            this.MarkedOperationAt = markedOperationAt;
            this.Item = item;
        }

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

        /// <summary>
        /// Minimal amount of reputation that is required to participate in this auction.
        /// </summary>
        /// <value>Minimal amount of reputation that is required to participate in this auction.</value>
        [DataMember(Name = "minimal_reputation", EmitDefaultValue = false)]
        public int MinimalReputation { get; set; }

        /// <summary>
        /// If winner is set, auction is in the paused state. While on pause, bids can&#39;t be added, but can be removed.
        /// </summary>
        /// <value>If winner is set, auction is in the paused state. While on pause, bids can&#39;t be added, but can be removed.</value>
        [DataMember(Name = "winner", EmitDefaultValue = true)]
        public string Winner { get; set; }

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

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

        /// <summary>
        /// Raw format string, use it inside textarea, for editing purposes.
        /// </summary>
        /// <value>Raw format string, use it inside textarea, for editing purposes.</value>
        [DataMember(Name = "note_raw", EmitDefaultValue = false)]
        public string NoteRaw { get; set; }

        /// <summary>
        /// It&#39;s safe to inject this into html, this is refined, formatted string from MD processor.
        /// </summary>
        /// <value>It&#39;s safe to inject this into html, this is refined, formatted string from MD processor.</value>
        [DataMember(Name = "note", EmitDefaultValue = false)]
        public string Note { get; set; }

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

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

        /// <summary>
        /// if &#x60;buyout_price&#x60; is set to null, that means ∞
        /// </summary>
        /// <value>if &#x60;buyout_price&#x60; is set to null, that means ∞</value>
        [DataMember(Name = "buyout_price", EmitDefaultValue = true)]
        public int? BuyoutPrice { get; set; }

        /// <summary>
        /// Minimum bid increase value
        /// </summary>
        /// <value>Minimum bid increase value</value>
        [DataMember(Name = "minimal_increment", EmitDefaultValue = false)]
        public int MinimalIncrement { get; set; }

        /// <summary>
        /// Shortcut to &#x60;starting_price&#x60; &#x3D;&#x3D; &#x60;buyout_price&#x60;, means that auction is not an auction, but an order.
        /// </summary>
        /// <value>Shortcut to &#x60;starting_price&#x60; &#x3D;&#x3D; &#x60;buyout_price&#x60;, means that auction is not an auction, but an order.</value>
        [DataMember(Name = "is_direct_sell", EmitDefaultValue = true)]
        public bool IsDirectSell { get; set; }

        /// <summary>
        /// Gets or Sets TopBid
        /// </summary>
        [DataMember(Name = "top_bid", EmitDefaultValue = true)]
        public int? TopBid { get; set; }

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

        /// <summary>
        /// Last time auction was updated, eighter by owner or by placing a bid.
        /// </summary>
        /// <value>Last time auction was updated, eighter by owner or by placing a bid.</value>
        [DataMember(Name = "updated", EmitDefaultValue = false)]
        public DateTime Updated { get; set; }

        /// <summary>
        /// Auction is closed, and was marked for removal or archiving, no one can add or remove bids now.
        /// </summary>
        /// <value>Auction is closed, and was marked for removal or archiving, no one can add or remove bids now.</value>
        [DataMember(Name = "closed", EmitDefaultValue = true)]
        public bool Closed { get; set; }

        /// <summary>
        /// Gets or Sets MarkedOperationAt
        /// </summary>
        [DataMember(Name = "marked_operation_at", EmitDefaultValue = true)]
        public DateTime? MarkedOperationAt { get; set; }

        /// <summary>
        /// Gets or Sets Item
        /// </summary>
        [DataMember(Name = "item", EmitDefaultValue = false)]
        public AuctionsCreatePostRequestItem Item { 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 AuctionEntryExpanded {\n");
            sb.Append("  Id: ").Append(Id).Append("\n");
            sb.Append("  MinimalReputation: ").Append(MinimalReputation).Append("\n");
            sb.Append("  Winner: ").Append(Winner).Append("\n");
            sb.Append("  VarPrivate: ").Append(VarPrivate).Append("\n");
            sb.Append("  Visible: ").Append(Visible).Append("\n");
            sb.Append("  NoteRaw: ").Append(NoteRaw).Append("\n");
            sb.Append("  Note: ").Append(Note).Append("\n");
            sb.Append("  Owner: ").Append(Owner).Append("\n");
            sb.Append("  StartingPrice: ").Append(StartingPrice).Append("\n");
            sb.Append("  BuyoutPrice: ").Append(BuyoutPrice).Append("\n");
            sb.Append("  MinimalIncrement: ").Append(MinimalIncrement).Append("\n");
            sb.Append("  IsDirectSell: ").Append(IsDirectSell).Append("\n");
            sb.Append("  TopBid: ").Append(TopBid).Append("\n");
            sb.Append("  Created: ").Append(Created).Append("\n");
            sb.Append("  Updated: ").Append(Updated).Append("\n");
            sb.Append("  Platform: ").Append(Platform).Append("\n");
            sb.Append("  Closed: ").Append(Closed).Append("\n");
            sb.Append("  IsMarkedFor: ").Append(IsMarkedFor).Append("\n");
            sb.Append("  MarkedOperationAt: ").Append(MarkedOperationAt).Append("\n");
            sb.Append("  Item: ").Append(Item).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 AuctionEntryExpanded);
        }

        /// <summary>
        /// Returns true if AuctionEntryExpanded instances are equal
        /// </summary>
        /// <param name="input">Instance of AuctionEntryExpanded to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(AuctionEntryExpanded input)
        {
            if (input == null)
            {
                return false;
            }
            return 
                (
                    this.Id == input.Id ||
                    (this.Id != null &&
                    this.Id.Equals(input.Id))
                ) && 
                (
                    this.MinimalReputation == input.MinimalReputation ||
                    this.MinimalReputation.Equals(input.MinimalReputation)
                ) && 
                (
                    this.Winner == input.Winner ||
                    (this.Winner != null &&
                    this.Winner.Equals(input.Winner))
                ) && 
                (
                    this.VarPrivate == input.VarPrivate ||
                    this.VarPrivate.Equals(input.VarPrivate)
                ) && 
                (
                    this.Visible == input.Visible ||
                    this.Visible.Equals(input.Visible)
                ) && 
                (
                    this.NoteRaw == input.NoteRaw ||
                    (this.NoteRaw != null &&
                    this.NoteRaw.Equals(input.NoteRaw))
                ) && 
                (
                    this.Note == input.Note ||
                    (this.Note != null &&
                    this.Note.Equals(input.Note))
                ) && 
                (
                    this.Owner == input.Owner ||
                    (this.Owner != null &&
                    this.Owner.Equals(input.Owner))
                ) && 
                (
                    this.StartingPrice == input.StartingPrice ||
                    this.StartingPrice.Equals(input.StartingPrice)
                ) && 
                (
                    this.BuyoutPrice == input.BuyoutPrice ||
                    (this.BuyoutPrice != null &&
                    this.BuyoutPrice.Equals(input.BuyoutPrice))
                ) && 
                (
                    this.MinimalIncrement == input.MinimalIncrement ||
                    this.MinimalIncrement.Equals(input.MinimalIncrement)
                ) && 
                (
                    this.IsDirectSell == input.IsDirectSell ||
                    this.IsDirectSell.Equals(input.IsDirectSell)
                ) && 
                (
                    this.TopBid == input.TopBid ||
                    (this.TopBid != null &&
                    this.TopBid.Equals(input.TopBid))
                ) && 
                (
                    this.Created == input.Created ||
                    (this.Created != null &&
                    this.Created.Equals(input.Created))
                ) && 
                (
                    this.Updated == input.Updated ||
                    (this.Updated != null &&
                    this.Updated.Equals(input.Updated))
                ) && 
                (
                    this.Platform == input.Platform ||
                    this.Platform.Equals(input.Platform)
                ) && 
                (
                    this.Closed == input.Closed ||
                    this.Closed.Equals(input.Closed)
                ) && 
                (
                    this.IsMarkedFor == input.IsMarkedFor ||
                    this.IsMarkedFor.Equals(input.IsMarkedFor)
                ) && 
                (
                    this.MarkedOperationAt == input.MarkedOperationAt ||
                    (this.MarkedOperationAt != null &&
                    this.MarkedOperationAt.Equals(input.MarkedOperationAt))
                ) && 
                (
                    this.Item == input.Item ||
                    (this.Item != null &&
                    this.Item.Equals(input.Item))
                );
        }

        /// <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.Id != null)
                {
                    hashCode = (hashCode * 59) + this.Id.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.MinimalReputation.GetHashCode();
                if (this.Winner != null)
                {
                    hashCode = (hashCode * 59) + this.Winner.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.VarPrivate.GetHashCode();
                hashCode = (hashCode * 59) + this.Visible.GetHashCode();
                if (this.NoteRaw != null)
                {
                    hashCode = (hashCode * 59) + this.NoteRaw.GetHashCode();
                }
                if (this.Note != null)
                {
                    hashCode = (hashCode * 59) + this.Note.GetHashCode();
                }
                if (this.Owner != null)
                {
                    hashCode = (hashCode * 59) + this.Owner.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.StartingPrice.GetHashCode();
                if (this.BuyoutPrice != null)
                {
                    hashCode = (hashCode * 59) + this.BuyoutPrice.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.MinimalIncrement.GetHashCode();
                hashCode = (hashCode * 59) + this.IsDirectSell.GetHashCode();
                if (this.TopBid != null)
                {
                    hashCode = (hashCode * 59) + this.TopBid.GetHashCode();
                }
                if (this.Created != null)
                {
                    hashCode = (hashCode * 59) + this.Created.GetHashCode();
                }
                if (this.Updated != null)
                {
                    hashCode = (hashCode * 59) + this.Updated.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.Platform.GetHashCode();
                hashCode = (hashCode * 59) + this.Closed.GetHashCode();
                hashCode = (hashCode * 59) + this.IsMarkedFor.GetHashCode();
                if (this.MarkedOperationAt != null)
                {
                    hashCode = (hashCode * 59) + this.MarkedOperationAt.GetHashCode();
                }
                if (this.Item != null)
                {
                    hashCode = (hashCode * 59) + this.Item.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)
        {
            // StartingPrice (int) minimum
            if (this.StartingPrice < (int)1)
            {
                yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StartingPrice, must be a value greater than or equal to 1.", new [] { "StartingPrice" });
            }

            yield break;
        }
    }

}
