/*
 * SMAC API
 *
 * SMAC ASP.NET Core Web API
 *
 * The version of the OpenAPI document: v1
 * 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 = Org.OpenAPITools.Client.OpenAPIDateConverter;

namespace Org.OpenAPITools.Model
{
    /// <summary>
    /// UserProfileResponse
    /// </summary>
    [DataContract(Name = "UserProfileResponse")]
    public partial class UserProfileResponse : IEquatable<UserProfileResponse>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="UserProfileResponse" /> class.
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <param name="email">Email address.</param>
        /// <param name="givenName">First name or given name.</param>
        /// <param name="surname">Last name or surname.</param>
        /// <param name="gender">Gender.</param>
        /// <param name="dateOfBirth">Date of birth.</param>
        /// <param name="passportNumber">Passport number.</param>
        /// <param name="phoneNumber">Phone number.</param>
        /// <param name="photoDataURL">An image encoded as a &lt;a href&#x3D;\&quot;https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\&quot;&gt;Data URL&lt;/a&gt;.</param>
        public UserProfileResponse(Guid userId = default(Guid), string email = default(string), string givenName = default(string), string surname = default(string), string gender = default(string), DateTime? dateOfBirth = default(DateTime?), string passportNumber = default(string), string phoneNumber = default(string), string photoDataURL = default(string))
        {
            this.UserId = userId;
            this.Email = email;
            this.GivenName = givenName;
            this.Surname = surname;
            this.Gender = gender;
            this.DateOfBirth = dateOfBirth;
            this.PassportNumber = passportNumber;
            this.PhoneNumber = phoneNumber;
            this.PhotoDataURL = photoDataURL;
        }

        /// <summary>
        /// The user identifier
        /// </summary>
        /// <value>The user identifier</value>
        [DataMember(Name = "userId", EmitDefaultValue = false)]
        public Guid UserId { get; set; }

        /// <summary>
        /// Email address
        /// </summary>
        /// <value>Email address</value>
        [DataMember(Name = "email", EmitDefaultValue = true)]
        public string Email { get; set; }

        /// <summary>
        /// First name or given name
        /// </summary>
        /// <value>First name or given name</value>
        [DataMember(Name = "givenName", EmitDefaultValue = true)]
        public string GivenName { get; set; }

        /// <summary>
        /// Last name or surname
        /// </summary>
        /// <value>Last name or surname</value>
        [DataMember(Name = "surname", EmitDefaultValue = true)]
        public string Surname { get; set; }

        /// <summary>
        /// Gender
        /// </summary>
        /// <value>Gender</value>
        [DataMember(Name = "gender", EmitDefaultValue = true)]
        public string Gender { get; set; }

        /// <summary>
        /// Date of birth
        /// </summary>
        /// <value>Date of birth</value>
        [DataMember(Name = "dateOfBirth", EmitDefaultValue = true)]
        [JsonConverter(typeof(OpenAPIDateConverter))]
        public DateTime? DateOfBirth { get; set; }

        /// <summary>
        /// Passport number
        /// </summary>
        /// <value>Passport number</value>
        [DataMember(Name = "passportNumber", EmitDefaultValue = true)]
        public string PassportNumber { get; set; }

        /// <summary>
        /// Phone number
        /// </summary>
        /// <value>Phone number</value>
        [DataMember(Name = "phoneNumber", EmitDefaultValue = true)]
        public string PhoneNumber { get; set; }

        /// <summary>
        /// An image encoded as a &lt;a href&#x3D;\&quot;https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\&quot;&gt;Data URL&lt;/a&gt;
        /// </summary>
        /// <value>An image encoded as a &lt;a href&#x3D;\&quot;https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\&quot;&gt;Data URL&lt;/a&gt;</value>
        [DataMember(Name = "photoDataURL", EmitDefaultValue = true)]
        public string PhotoDataURL { 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 UserProfileResponse {\n");
            sb.Append("  UserId: ").Append(UserId).Append("\n");
            sb.Append("  Email: ").Append(Email).Append("\n");
            sb.Append("  GivenName: ").Append(GivenName).Append("\n");
            sb.Append("  Surname: ").Append(Surname).Append("\n");
            sb.Append("  Gender: ").Append(Gender).Append("\n");
            sb.Append("  DateOfBirth: ").Append(DateOfBirth).Append("\n");
            sb.Append("  PassportNumber: ").Append(PassportNumber).Append("\n");
            sb.Append("  PhoneNumber: ").Append(PhoneNumber).Append("\n");
            sb.Append("  PhotoDataURL: ").Append(PhotoDataURL).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 UserProfileResponse);
        }

        /// <summary>
        /// Returns true if UserProfileResponse instances are equal
        /// </summary>
        /// <param name="input">Instance of UserProfileResponse to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(UserProfileResponse input)
        {
            if (input == null)
            {
                return false;
            }
            return 
                (
                    this.UserId == input.UserId ||
                    (this.UserId != null &&
                    this.UserId.Equals(input.UserId))
                ) && 
                (
                    this.Email == input.Email ||
                    (this.Email != null &&
                    this.Email.Equals(input.Email))
                ) && 
                (
                    this.GivenName == input.GivenName ||
                    (this.GivenName != null &&
                    this.GivenName.Equals(input.GivenName))
                ) && 
                (
                    this.Surname == input.Surname ||
                    (this.Surname != null &&
                    this.Surname.Equals(input.Surname))
                ) && 
                (
                    this.Gender == input.Gender ||
                    (this.Gender != null &&
                    this.Gender.Equals(input.Gender))
                ) && 
                (
                    this.DateOfBirth == input.DateOfBirth ||
                    (this.DateOfBirth != null &&
                    this.DateOfBirth.Equals(input.DateOfBirth))
                ) && 
                (
                    this.PassportNumber == input.PassportNumber ||
                    (this.PassportNumber != null &&
                    this.PassportNumber.Equals(input.PassportNumber))
                ) && 
                (
                    this.PhoneNumber == input.PhoneNumber ||
                    (this.PhoneNumber != null &&
                    this.PhoneNumber.Equals(input.PhoneNumber))
                ) && 
                (
                    this.PhotoDataURL == input.PhotoDataURL ||
                    (this.PhotoDataURL != null &&
                    this.PhotoDataURL.Equals(input.PhotoDataURL))
                );
        }

        /// <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.UserId != null)
                {
                    hashCode = (hashCode * 59) + this.UserId.GetHashCode();
                }
                if (this.Email != null)
                {
                    hashCode = (hashCode * 59) + this.Email.GetHashCode();
                }
                if (this.GivenName != null)
                {
                    hashCode = (hashCode * 59) + this.GivenName.GetHashCode();
                }
                if (this.Surname != null)
                {
                    hashCode = (hashCode * 59) + this.Surname.GetHashCode();
                }
                if (this.Gender != null)
                {
                    hashCode = (hashCode * 59) + this.Gender.GetHashCode();
                }
                if (this.DateOfBirth != null)
                {
                    hashCode = (hashCode * 59) + this.DateOfBirth.GetHashCode();
                }
                if (this.PassportNumber != null)
                {
                    hashCode = (hashCode * 59) + this.PassportNumber.GetHashCode();
                }
                if (this.PhoneNumber != null)
                {
                    hashCode = (hashCode * 59) + this.PhoneNumber.GetHashCode();
                }
                if (this.PhotoDataURL != null)
                {
                    hashCode = (hashCode * 59) + this.PhotoDataURL.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)
        {
            // PassportNumber (string) maxLength
            if (this.PassportNumber != null && this.PassportNumber.Length > 9)
            {
                yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PassportNumber, length must be less than 9.", new [] { "PassportNumber" });
            }

            // PassportNumber (string) minLength
            if (this.PassportNumber != null && this.PassportNumber.Length < 6)
            {
                yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PassportNumber, length must be greater than 6.", new [] { "PassportNumber" });
            }

            yield break;
        }
    }

}
