/* 
 * 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>
    /// PartnerRole &lt;p&gt;PartnerRole.&lt;br /&gt;&lt;/p&gt;
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwareGkrApiServerMdCustomerDtoDomPartnerRole :  IEquatable<ComGkSoftwareGkrApiServerMdCustomerDtoDomPartnerRole>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiServerMdCustomerDtoDomPartnerRole" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwareGkrApiServerMdCustomerDtoDomPartnerRole() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiServerMdCustomerDtoDomPartnerRole" /> class.
        /// </summary>
        /// <param name="partnerParentCustomerID">&lt;p&gt;A unique system assigned identifier for the Customer.&lt;br /&gt;&lt;/p&gt; (required).</param>
        /// <param name="partnerRoleTypeCode">&lt;p&gt;The type of the partner role.&lt;br /&gt;&lt;/p&gt; (required).</param>
        /// <param name="defaultFlag">&lt;p&gt;Determines whether this partner role is the default one in case that multiple partner roles exist.&lt;br /&gt;&lt;/p&gt; (required).</param>
        public ComGkSoftwareGkrApiServerMdCustomerDtoDomPartnerRole(string partnerParentCustomerID = default(string), string partnerRoleTypeCode = default(string), bool? defaultFlag = default(bool?))
        {
            // to ensure "partnerParentCustomerID" is required (not null)
            if (partnerParentCustomerID == null)
            {
                throw new InvalidDataException("partnerParentCustomerID is a required property for ComGkSoftwareGkrApiServerMdCustomerDtoDomPartnerRole and cannot be null");
            }
            else
            {
                this.PartnerParentCustomerID = partnerParentCustomerID;
            }
            // to ensure "partnerRoleTypeCode" is required (not null)
            if (partnerRoleTypeCode == null)
            {
                throw new InvalidDataException("partnerRoleTypeCode is a required property for ComGkSoftwareGkrApiServerMdCustomerDtoDomPartnerRole and cannot be null");
            }
            else
            {
                this.PartnerRoleTypeCode = partnerRoleTypeCode;
            }
            // to ensure "defaultFlag" is required (not null)
            if (defaultFlag == null)
            {
                throw new InvalidDataException("defaultFlag is a required property for ComGkSoftwareGkrApiServerMdCustomerDtoDomPartnerRole and cannot be null");
            }
            else
            {
                this.DefaultFlag = defaultFlag;
            }
        }
        
        /// <summary>
        /// &lt;p&gt;A unique system assigned identifier for the Customer.&lt;br /&gt;&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;A unique system assigned identifier for the Customer.&lt;br /&gt;&lt;/p&gt;</value>
        [DataMember(Name="partnerParentCustomerID", EmitDefaultValue=false)]
        public string PartnerParentCustomerID { get; set; }

        /// <summary>
        /// &lt;p&gt;The type of the partner role.&lt;br /&gt;&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;The type of the partner role.&lt;br /&gt;&lt;/p&gt;</value>
        [DataMember(Name="partnerRoleTypeCode", EmitDefaultValue=false)]
        public string PartnerRoleTypeCode { get; set; }

        /// <summary>
        /// &lt;p&gt;Determines whether this partner role is the default one in case that multiple partner roles exist.&lt;br /&gt;&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Determines whether this partner role is the default one in case that multiple partner roles exist.&lt;br /&gt;&lt;/p&gt;</value>
        [DataMember(Name="defaultFlag", EmitDefaultValue=false)]
        public bool? DefaultFlag { 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 ComGkSoftwareGkrApiServerMdCustomerDtoDomPartnerRole {\n");
            sb.Append("  PartnerParentCustomerID: ").Append(PartnerParentCustomerID).Append("\n");
            sb.Append("  PartnerRoleTypeCode: ").Append(PartnerRoleTypeCode).Append("\n");
            sb.Append("  DefaultFlag: ").Append(DefaultFlag).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 ComGkSoftwareGkrApiServerMdCustomerDtoDomPartnerRole);
        }

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

            return 
                (
                    this.PartnerParentCustomerID == input.PartnerParentCustomerID ||
                    (this.PartnerParentCustomerID != null &&
                    this.PartnerParentCustomerID.Equals(input.PartnerParentCustomerID))
                ) && 
                (
                    this.PartnerRoleTypeCode == input.PartnerRoleTypeCode ||
                    (this.PartnerRoleTypeCode != null &&
                    this.PartnerRoleTypeCode.Equals(input.PartnerRoleTypeCode))
                ) && 
                (
                    this.DefaultFlag == input.DefaultFlag ||
                    (this.DefaultFlag != null &&
                    this.DefaultFlag.Equals(input.DefaultFlag))
                );
        }

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

}
