/*
 * 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>
    /// UploadPhotoRequest
    /// </summary>
    [DataContract(Name = "UploadPhotoRequest")]
    public partial class UploadPhotoRequest : IEquatable<UploadPhotoRequest>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="UploadPhotoRequest" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected UploadPhotoRequest() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="UploadPhotoRequest" /> class.
        /// </summary>
        /// <param name="imageBase64">A Base64 representation of the image file (Use Microsoft.IdentityModel.Tokens.Base64UrlEncoder to encode.) (required).</param>
        public UploadPhotoRequest(string imageBase64 = default(string))
        {
            // to ensure "imageBase64" is required (not null)
            if (imageBase64 == null)
            {
                throw new ArgumentNullException("imageBase64 is a required property for UploadPhotoRequest and cannot be null");
            }
            this.ImageBase64 = imageBase64;
        }

        /// <summary>
        /// A Base64 representation of the image file (Use Microsoft.IdentityModel.Tokens.Base64UrlEncoder to encode.)
        /// </summary>
        /// <value>A Base64 representation of the image file (Use Microsoft.IdentityModel.Tokens.Base64UrlEncoder to encode.)</value>
        [DataMember(Name = "imageBase64", IsRequired = true, EmitDefaultValue = true)]
        public string ImageBase64 { 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 UploadPhotoRequest {\n");
            sb.Append("  ImageBase64: ").Append(ImageBase64).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 UploadPhotoRequest);
        }

        /// <summary>
        /// Returns true if UploadPhotoRequest instances are equal
        /// </summary>
        /// <param name="input">Instance of UploadPhotoRequest to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(UploadPhotoRequest input)
        {
            if (input == null)
            {
                return false;
            }
            return 
                (
                    this.ImageBase64 == input.ImageBase64 ||
                    (this.ImageBase64 != null &&
                    this.ImageBase64.Equals(input.ImageBase64))
                );
        }

        /// <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.ImageBase64 != null)
                {
                    hashCode = (hashCode * 59) + this.ImageBase64.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)
        {
            // ImageBase64 (string) minLength
            if (this.ImageBase64 != null && this.ImageBase64.Length < 1)
            {
                yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ImageBase64, length must be greater than 1.", new [] { "ImageBase64" });
            }

            yield break;
        }
    }

}
