/* 
 * GK application - OmniPOS Service API
 *
 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
 *
 * OpenAPI spec version: 5.21.1-b03
 * 
 * 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>
    /// FuelSalesLineItem &lt;emph&gt;undocumented&lt;/emph&gt;
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwareGkrApiTxpoolDtoFuelSalesLineItem :  IEquatable<ComGkSoftwareGkrApiTxpoolDtoFuelSalesLineItem>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoFuelSalesLineItem" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwareGkrApiTxpoolDtoFuelSalesLineItem() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoFuelSalesLineItem" /> class.
        /// </summary>
        /// <param name="key">&lt;p&gt;Getter for inner key class.&lt;/p&gt; (required).</param>
        /// <param name="fuelSaleStatusCode">A status code denoting the mode of the Fuel Sale. Possible values are:Prepay: Where the FuelSaleLineItem happens before the FuelingTransactionPostPay: Where the FuelSaleLineItem happens after the Fueling TransactionPrepayRefund: Where the FuelSaleLineItem happens after a Prepay FuelSaleLineItem and the matching FuelingTransaction did not use all of the money (required).</param>
        /// <param name="fuelGradeID">A unique system assigned identifier for the retailer&#39;s itemID (values between 01-99) (required).</param>
        /// <param name="unitPrice">The price per volume unit charged by the FUELING POINT for the fuel delivered in the FUELING TRANSACTION (required).</param>
        /// <param name="fuelingPointID">A unique identifier for the FuelingPoint at a particular business unit group.</param>
        /// <param name="xxcustom05">Customizable information.</param>
        /// <param name="xxcustom03">Customizable information.</param>
        /// <param name="xxcustom02">Customizable information.</param>
        /// <param name="xxcustom04">Customizable information.</param>
        /// <param name="xxcustom01">Customizable information.</param>
        public ComGkSoftwareGkrApiTxpoolDtoFuelSalesLineItem(ComGkSoftwareGkrApiTxpoolDtoFuelSalesLineItemKey key = default(ComGkSoftwareGkrApiTxpoolDtoFuelSalesLineItemKey), string fuelSaleStatusCode = default(string), string fuelGradeID = default(string), double? unitPrice = default(double?), string fuelingPointID = default(string), string xxcustom05 = default(string), string xxcustom03 = default(string), string xxcustom02 = default(string), string xxcustom04 = default(string), string xxcustom01 = default(string))
        {
            // to ensure "key" is required (not null)
            if (key == null)
            {
                throw new InvalidDataException("key is a required property for ComGkSoftwareGkrApiTxpoolDtoFuelSalesLineItem and cannot be null");
            }
            else
            {
                this.Key = key;
            }
            // to ensure "fuelSaleStatusCode" is required (not null)
            if (fuelSaleStatusCode == null)
            {
                throw new InvalidDataException("fuelSaleStatusCode is a required property for ComGkSoftwareGkrApiTxpoolDtoFuelSalesLineItem and cannot be null");
            }
            else
            {
                this.FuelSaleStatusCode = fuelSaleStatusCode;
            }
            // to ensure "fuelGradeID" is required (not null)
            if (fuelGradeID == null)
            {
                throw new InvalidDataException("fuelGradeID is a required property for ComGkSoftwareGkrApiTxpoolDtoFuelSalesLineItem and cannot be null");
            }
            else
            {
                this.FuelGradeID = fuelGradeID;
            }
            // to ensure "unitPrice" is required (not null)
            if (unitPrice == null)
            {
                throw new InvalidDataException("unitPrice is a required property for ComGkSoftwareGkrApiTxpoolDtoFuelSalesLineItem and cannot be null");
            }
            else
            {
                this.UnitPrice = unitPrice;
            }
            this.FuelingPointID = fuelingPointID;
            this.Xxcustom05 = xxcustom05;
            this.Xxcustom03 = xxcustom03;
            this.Xxcustom02 = xxcustom02;
            this.Xxcustom04 = xxcustom04;
            this.Xxcustom01 = xxcustom01;
        }
        
        /// <summary>
        /// &lt;p&gt;Getter for inner key class.&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Getter for inner key class.&lt;/p&gt;</value>
        [DataMember(Name="key", EmitDefaultValue=false)]
        public ComGkSoftwareGkrApiTxpoolDtoFuelSalesLineItemKey Key { get; set; }

        /// <summary>
        /// A status code denoting the mode of the Fuel Sale. Possible values are:Prepay: Where the FuelSaleLineItem happens before the FuelingTransactionPostPay: Where the FuelSaleLineItem happens after the Fueling TransactionPrepayRefund: Where the FuelSaleLineItem happens after a Prepay FuelSaleLineItem and the matching FuelingTransaction did not use all of the money
        /// </summary>
        /// <value>A status code denoting the mode of the Fuel Sale. Possible values are:Prepay: Where the FuelSaleLineItem happens before the FuelingTransactionPostPay: Where the FuelSaleLineItem happens after the Fueling TransactionPrepayRefund: Where the FuelSaleLineItem happens after a Prepay FuelSaleLineItem and the matching FuelingTransaction did not use all of the money</value>
        [DataMember(Name="fuelSaleStatusCode", EmitDefaultValue=false)]
        public string FuelSaleStatusCode { get; set; }

        /// <summary>
        /// A unique system assigned identifier for the retailer&#39;s itemID (values between 01-99)
        /// </summary>
        /// <value>A unique system assigned identifier for the retailer&#39;s itemID (values between 01-99)</value>
        [DataMember(Name="fuelGradeID", EmitDefaultValue=false)]
        public string FuelGradeID { get; set; }

        /// <summary>
        /// The price per volume unit charged by the FUELING POINT for the fuel delivered in the FUELING TRANSACTION
        /// </summary>
        /// <value>The price per volume unit charged by the FUELING POINT for the fuel delivered in the FUELING TRANSACTION</value>
        [DataMember(Name="unitPrice", EmitDefaultValue=false)]
        public double? UnitPrice { get; set; }

        /// <summary>
        /// A unique identifier for the FuelingPoint at a particular business unit group
        /// </summary>
        /// <value>A unique identifier for the FuelingPoint at a particular business unit group</value>
        [DataMember(Name="fuelingPointID", EmitDefaultValue=false)]
        public string FuelingPointID { get; set; }

        /// <summary>
        /// Customizable information
        /// </summary>
        /// <value>Customizable information</value>
        [DataMember(Name="xxcustom05", EmitDefaultValue=false)]
        public string Xxcustom05 { get; set; }

        /// <summary>
        /// Customizable information
        /// </summary>
        /// <value>Customizable information</value>
        [DataMember(Name="xxcustom03", EmitDefaultValue=false)]
        public string Xxcustom03 { get; set; }

        /// <summary>
        /// Customizable information
        /// </summary>
        /// <value>Customizable information</value>
        [DataMember(Name="xxcustom02", EmitDefaultValue=false)]
        public string Xxcustom02 { get; set; }

        /// <summary>
        /// Customizable information
        /// </summary>
        /// <value>Customizable information</value>
        [DataMember(Name="xxcustom04", EmitDefaultValue=false)]
        public string Xxcustom04 { get; set; }

        /// <summary>
        /// Customizable information
        /// </summary>
        /// <value>Customizable information</value>
        [DataMember(Name="xxcustom01", EmitDefaultValue=false)]
        public string Xxcustom01 { 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 ComGkSoftwareGkrApiTxpoolDtoFuelSalesLineItem {\n");
            sb.Append("  Key: ").Append(Key).Append("\n");
            sb.Append("  FuelSaleStatusCode: ").Append(FuelSaleStatusCode).Append("\n");
            sb.Append("  FuelGradeID: ").Append(FuelGradeID).Append("\n");
            sb.Append("  UnitPrice: ").Append(UnitPrice).Append("\n");
            sb.Append("  FuelingPointID: ").Append(FuelingPointID).Append("\n");
            sb.Append("  Xxcustom05: ").Append(Xxcustom05).Append("\n");
            sb.Append("  Xxcustom03: ").Append(Xxcustom03).Append("\n");
            sb.Append("  Xxcustom02: ").Append(Xxcustom02).Append("\n");
            sb.Append("  Xxcustom04: ").Append(Xxcustom04).Append("\n");
            sb.Append("  Xxcustom01: ").Append(Xxcustom01).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 ComGkSoftwareGkrApiTxpoolDtoFuelSalesLineItem);
        }

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

            return 
                (
                    this.Key == input.Key ||
                    (this.Key != null &&
                    this.Key.Equals(input.Key))
                ) && 
                (
                    this.FuelSaleStatusCode == input.FuelSaleStatusCode ||
                    (this.FuelSaleStatusCode != null &&
                    this.FuelSaleStatusCode.Equals(input.FuelSaleStatusCode))
                ) && 
                (
                    this.FuelGradeID == input.FuelGradeID ||
                    (this.FuelGradeID != null &&
                    this.FuelGradeID.Equals(input.FuelGradeID))
                ) && 
                (
                    this.UnitPrice == input.UnitPrice ||
                    (this.UnitPrice != null &&
                    this.UnitPrice.Equals(input.UnitPrice))
                ) && 
                (
                    this.FuelingPointID == input.FuelingPointID ||
                    (this.FuelingPointID != null &&
                    this.FuelingPointID.Equals(input.FuelingPointID))
                ) && 
                (
                    this.Xxcustom05 == input.Xxcustom05 ||
                    (this.Xxcustom05 != null &&
                    this.Xxcustom05.Equals(input.Xxcustom05))
                ) && 
                (
                    this.Xxcustom03 == input.Xxcustom03 ||
                    (this.Xxcustom03 != null &&
                    this.Xxcustom03.Equals(input.Xxcustom03))
                ) && 
                (
                    this.Xxcustom02 == input.Xxcustom02 ||
                    (this.Xxcustom02 != null &&
                    this.Xxcustom02.Equals(input.Xxcustom02))
                ) && 
                (
                    this.Xxcustom04 == input.Xxcustom04 ||
                    (this.Xxcustom04 != null &&
                    this.Xxcustom04.Equals(input.Xxcustom04))
                ) && 
                (
                    this.Xxcustom01 == input.Xxcustom01 ||
                    (this.Xxcustom01 != null &&
                    this.Xxcustom01.Equals(input.Xxcustom01))
                );
        }

        /// <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.Key != null)
                    hashCode = hashCode * 59 + this.Key.GetHashCode();
                if (this.FuelSaleStatusCode != null)
                    hashCode = hashCode * 59 + this.FuelSaleStatusCode.GetHashCode();
                if (this.FuelGradeID != null)
                    hashCode = hashCode * 59 + this.FuelGradeID.GetHashCode();
                if (this.UnitPrice != null)
                    hashCode = hashCode * 59 + this.UnitPrice.GetHashCode();
                if (this.FuelingPointID != null)
                    hashCode = hashCode * 59 + this.FuelingPointID.GetHashCode();
                if (this.Xxcustom05 != null)
                    hashCode = hashCode * 59 + this.Xxcustom05.GetHashCode();
                if (this.Xxcustom03 != null)
                    hashCode = hashCode * 59 + this.Xxcustom03.GetHashCode();
                if (this.Xxcustom02 != null)
                    hashCode = hashCode * 59 + this.Xxcustom02.GetHashCode();
                if (this.Xxcustom04 != null)
                    hashCode = hashCode * 59 + this.Xxcustom04.GetHashCode();
                if (this.Xxcustom01 != null)
                    hashCode = hashCode * 59 + this.Xxcustom01.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;
        }
    }

}
