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

        /// <summary>
        /// A Base64Url representation of the probe image file (Use Microsoft.IdentityModel.Tokens.Base64UrlEncoder to encode.)
        /// </summary>
        /// <value>A Base64Url representation of the probe image file (Use Microsoft.IdentityModel.Tokens.Base64UrlEncoder to encode.)</value>
        [DataMember(Name = "probeImageBase64Url", IsRequired = true, EmitDefaultValue = true)]
        public string ProbeImageBase64Url { get; set; }

        /// <summary>
        /// A Base64Url representation of the reference templates
        /// </summary>
        /// <value>A Base64Url representation of the reference templates</value>
        [DataMember(Name = "referenceTemplateBase64Urls", IsRequired = true, EmitDefaultValue = true)]
        public List<string> ReferenceTemplateBase64Urls { 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 VerifyRequest {\n");
            sb.Append("  ProbeImageBase64Url: ").Append(ProbeImageBase64Url).Append("\n");
            sb.Append("  ReferenceTemplateBase64Urls: ").Append(ReferenceTemplateBase64Urls).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 VerifyRequest);
        }

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

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

            yield break;
        }
    }

}
