/*
 * Ed-Fi Operational Data Store API
 *
 * The Ed-Fi ODS / API enables applications to read and write education data stored in an Ed-Fi ODS through a secure REST interface.  ***  > *Note: Consumers of ODS / API information should sanitize all data for display and storage. The ODS / API provides reasonable safeguards against cross-site scripting attacks and other malicious content, but the platform does not and cannot guarantee that the data it contains is free of all potentially harmful content.*  *** 
 *
 * The version of the OpenAPI document: 3
 * 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 = EdFi.Roster.Sdk.Client.OpenAPIDateConverter;

namespace EdFi.Roster.Sdk.Models.Resources
{
    /// <summary>
    /// TpdmProfessionalDevelopmentEvent
    /// </summary>
    [DataContract(Name = "tpdm_professionalDevelopmentEvent")]
    public partial class TpdmProfessionalDevelopmentEvent : IEquatable<TpdmProfessionalDevelopmentEvent>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="TpdmProfessionalDevelopmentEvent" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected TpdmProfessionalDevelopmentEvent() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="TpdmProfessionalDevelopmentEvent" /> class.
        /// </summary>
        /// <param name="id">id.</param>
        /// <param name="_namespace">Namespace for the event, typically associated with the issuing authority. (required).</param>
        /// <param name="professionalDevelopmentTitle">The title or name for a professional development. (required).</param>
        /// <param name="multipleSession">An indication of whether or not a professional development event is comprised of multiple sessions or not..</param>
        /// <param name="professionalDevelopmentOfferedByDescriptor">A code describing an organization that is offering a specific professional development. (required).</param>
        /// <param name="professionalDevelopmentReason">The reported reason for a teacher candidate&#39;s professional development..</param>
        /// <param name="required">An indication of whether a teacher candidate is active in a professional development..</param>
        /// <param name="totalHours">The number of total hours the professional development contains..</param>
        /// <param name="etag">A unique system-generated value that identifies the version of the resource..</param>
        public TpdmProfessionalDevelopmentEvent(string id = default(string), string _namespace = default(string), string professionalDevelopmentTitle = default(string), bool multipleSession = default(bool), string professionalDevelopmentOfferedByDescriptor = default(string), string professionalDevelopmentReason = default(string), bool required = default(bool), int totalHours = default(int), string etag = default(string))
        {
            // to ensure "_namespace" is required (not null)
            this.Namespace = _namespace ?? throw new ArgumentNullException("_namespace is a required property for TpdmProfessionalDevelopmentEvent and cannot be null");
            // to ensure "professionalDevelopmentTitle" is required (not null)
            this.ProfessionalDevelopmentTitle = professionalDevelopmentTitle ?? throw new ArgumentNullException("professionalDevelopmentTitle is a required property for TpdmProfessionalDevelopmentEvent and cannot be null");
            // to ensure "professionalDevelopmentOfferedByDescriptor" is required (not null)
            this.ProfessionalDevelopmentOfferedByDescriptor = professionalDevelopmentOfferedByDescriptor ?? throw new ArgumentNullException("professionalDevelopmentOfferedByDescriptor is a required property for TpdmProfessionalDevelopmentEvent and cannot be null");
            this.Id = id;
            this.MultipleSession = multipleSession;
            this.ProfessionalDevelopmentReason = professionalDevelopmentReason;
            this.Required = required;
            this.TotalHours = totalHours;
            this.Etag = etag;
        }

        /// <summary>
        /// Gets or Sets Id
        /// </summary>
        [DataMember(Name = "id", EmitDefaultValue = false)]
        public string Id { get; set; }

        /// <summary>
        /// Namespace for the event, typically associated with the issuing authority.
        /// </summary>
        /// <value>Namespace for the event, typically associated with the issuing authority.</value>
        [DataMember(Name = "namespace", IsRequired = true, EmitDefaultValue = false)]
        public string Namespace { get; set; }

        /// <summary>
        /// The title or name for a professional development.
        /// </summary>
        /// <value>The title or name for a professional development.</value>
        [DataMember(Name = "professionalDevelopmentTitle", IsRequired = true, EmitDefaultValue = false)]
        public string ProfessionalDevelopmentTitle { get; set; }

        /// <summary>
        /// An indication of whether or not a professional development event is comprised of multiple sessions or not.
        /// </summary>
        /// <value>An indication of whether or not a professional development event is comprised of multiple sessions or not.</value>
        [DataMember(Name = "multipleSession", EmitDefaultValue = true)]
        public bool MultipleSession { get; set; }

        /// <summary>
        /// A code describing an organization that is offering a specific professional development.
        /// </summary>
        /// <value>A code describing an organization that is offering a specific professional development.</value>
        [DataMember(Name = "professionalDevelopmentOfferedByDescriptor", IsRequired = true, EmitDefaultValue = false)]
        public string ProfessionalDevelopmentOfferedByDescriptor { get; set; }

        /// <summary>
        /// The reported reason for a teacher candidate&#39;s professional development.
        /// </summary>
        /// <value>The reported reason for a teacher candidate&#39;s professional development.</value>
        [DataMember(Name = "professionalDevelopmentReason", EmitDefaultValue = false)]
        public string ProfessionalDevelopmentReason { get; set; }

        /// <summary>
        /// An indication of whether a teacher candidate is active in a professional development.
        /// </summary>
        /// <value>An indication of whether a teacher candidate is active in a professional development.</value>
        [DataMember(Name = "required", EmitDefaultValue = true)]
        public bool Required { get; set; }

        /// <summary>
        /// The number of total hours the professional development contains.
        /// </summary>
        /// <value>The number of total hours the professional development contains.</value>
        [DataMember(Name = "totalHours", EmitDefaultValue = false)]
        public int TotalHours { get; set; }

        /// <summary>
        /// A unique system-generated value that identifies the version of the resource.
        /// </summary>
        /// <value>A unique system-generated value that identifies the version of the resource.</value>
        [DataMember(Name = "_etag", EmitDefaultValue = false)]
        public string Etag { 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 TpdmProfessionalDevelopmentEvent {\n");
            sb.Append("  Id: ").Append(Id).Append("\n");
            sb.Append("  Namespace: ").Append(Namespace).Append("\n");
            sb.Append("  ProfessionalDevelopmentTitle: ").Append(ProfessionalDevelopmentTitle).Append("\n");
            sb.Append("  MultipleSession: ").Append(MultipleSession).Append("\n");
            sb.Append("  ProfessionalDevelopmentOfferedByDescriptor: ").Append(ProfessionalDevelopmentOfferedByDescriptor).Append("\n");
            sb.Append("  ProfessionalDevelopmentReason: ").Append(ProfessionalDevelopmentReason).Append("\n");
            sb.Append("  Required: ").Append(Required).Append("\n");
            sb.Append("  TotalHours: ").Append(TotalHours).Append("\n");
            sb.Append("  Etag: ").Append(Etag).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 TpdmProfessionalDevelopmentEvent);
        }

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

            return 
                (
                    this.Id == input.Id ||
                    (this.Id != null &&
                    this.Id.Equals(input.Id))
                ) && 
                (
                    this.Namespace == input.Namespace ||
                    (this.Namespace != null &&
                    this.Namespace.Equals(input.Namespace))
                ) && 
                (
                    this.ProfessionalDevelopmentTitle == input.ProfessionalDevelopmentTitle ||
                    (this.ProfessionalDevelopmentTitle != null &&
                    this.ProfessionalDevelopmentTitle.Equals(input.ProfessionalDevelopmentTitle))
                ) && 
                (
                    this.MultipleSession == input.MultipleSession ||
                    this.MultipleSession.Equals(input.MultipleSession)
                ) && 
                (
                    this.ProfessionalDevelopmentOfferedByDescriptor == input.ProfessionalDevelopmentOfferedByDescriptor ||
                    (this.ProfessionalDevelopmentOfferedByDescriptor != null &&
                    this.ProfessionalDevelopmentOfferedByDescriptor.Equals(input.ProfessionalDevelopmentOfferedByDescriptor))
                ) && 
                (
                    this.ProfessionalDevelopmentReason == input.ProfessionalDevelopmentReason ||
                    (this.ProfessionalDevelopmentReason != null &&
                    this.ProfessionalDevelopmentReason.Equals(input.ProfessionalDevelopmentReason))
                ) && 
                (
                    this.Required == input.Required ||
                    this.Required.Equals(input.Required)
                ) && 
                (
                    this.TotalHours == input.TotalHours ||
                    this.TotalHours.Equals(input.TotalHours)
                ) && 
                (
                    this.Etag == input.Etag ||
                    (this.Etag != null &&
                    this.Etag.Equals(input.Etag))
                );
        }

        /// <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.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.Namespace != null)
                    hashCode = hashCode * 59 + this.Namespace.GetHashCode();
                if (this.ProfessionalDevelopmentTitle != null)
                    hashCode = hashCode * 59 + this.ProfessionalDevelopmentTitle.GetHashCode();
                hashCode = hashCode * 59 + this.MultipleSession.GetHashCode();
                if (this.ProfessionalDevelopmentOfferedByDescriptor != null)
                    hashCode = hashCode * 59 + this.ProfessionalDevelopmentOfferedByDescriptor.GetHashCode();
                if (this.ProfessionalDevelopmentReason != null)
                    hashCode = hashCode * 59 + this.ProfessionalDevelopmentReason.GetHashCode();
                hashCode = hashCode * 59 + this.Required.GetHashCode();
                hashCode = hashCode * 59 + this.TotalHours.GetHashCode();
                if (this.Etag != null)
                    hashCode = hashCode * 59 + this.Etag.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)
        {
            // Namespace (string) maxLength
            if(this.Namespace != null && this.Namespace.Length > 255)
            {
                yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Namespace, length must be less than 255.", new [] { "Namespace" });
            }

            // ProfessionalDevelopmentTitle (string) maxLength
            if(this.ProfessionalDevelopmentTitle != null && this.ProfessionalDevelopmentTitle.Length > 60)
            {
                yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ProfessionalDevelopmentTitle, length must be less than 60.", new [] { "ProfessionalDevelopmentTitle" });
            }

            // ProfessionalDevelopmentOfferedByDescriptor (string) maxLength
            if(this.ProfessionalDevelopmentOfferedByDescriptor != null && this.ProfessionalDevelopmentOfferedByDescriptor.Length > 306)
            {
                yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ProfessionalDevelopmentOfferedByDescriptor, length must be less than 306.", new [] { "ProfessionalDevelopmentOfferedByDescriptor" });
            }

            // ProfessionalDevelopmentReason (string) maxLength
            if(this.ProfessionalDevelopmentReason != null && this.ProfessionalDevelopmentReason.Length > 60)
            {
                yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ProfessionalDevelopmentReason, length must be less than 60.", new [] { "ProfessionalDevelopmentReason" });
            }

            yield break;
        }
    }

}
