﻿// Code generated by Microsoft (R) AutoRest Code Generator 0.9.7.0
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

using System;
using System.Linq;
using Newtonsoft.Json.Linq;

namespace MBL412Wk2.ServiceConsumer.SchoolSearchAPI.Models
{
    public partial class ChangePasswordBindingModel
    {
        private string _confirmPassword;
        
        /// <summary>
        /// Optional.
        /// </summary>
        public string ConfirmPassword
        {
            get { return this._confirmPassword; }
            set { this._confirmPassword = value; }
        }
        
        private string _newPassword;
        
        /// <summary>
        /// Required.
        /// </summary>
        public string NewPassword
        {
            get { return this._newPassword; }
            set { this._newPassword = value; }
        }
        
        private string _oldPassword;
        
        /// <summary>
        /// Required.
        /// </summary>
        public string OldPassword
        {
            get { return this._oldPassword; }
            set { this._oldPassword = value; }
        }
        
        /// <summary>
        /// Initializes a new instance of the ChangePasswordBindingModel class.
        /// </summary>
        public ChangePasswordBindingModel()
        {
        }
        
        /// <summary>
        /// Initializes a new instance of the ChangePasswordBindingModel class
        /// with required arguments.
        /// </summary>
        public ChangePasswordBindingModel(string oldPassword, string newPassword)
            : this()
        {
            if (oldPassword == null)
            {
                throw new ArgumentNullException("oldPassword");
            }
            if (newPassword == null)
            {
                throw new ArgumentNullException("newPassword");
            }
            this.OldPassword = oldPassword;
            this.NewPassword = newPassword;
        }
        
        /// <summary>
        /// Serialize the object
        /// </summary>
        /// <returns>
        /// Returns the json model for the type ChangePasswordBindingModel
        /// </returns>
        public virtual JToken SerializeJson(JToken outputObject)
        {
            if (outputObject == null)
            {
                outputObject = new JObject();
            }
            if (this.NewPassword == null)
            {
                throw new ArgumentNullException("NewPassword");
            }
            if (this.OldPassword == null)
            {
                throw new ArgumentNullException("OldPassword");
            }
            if (this.ConfirmPassword != null)
            {
                outputObject["ConfirmPassword"] = this.ConfirmPassword;
            }
            if (this.NewPassword != null)
            {
                outputObject["NewPassword"] = this.NewPassword;
            }
            if (this.OldPassword != null)
            {
                outputObject["OldPassword"] = this.OldPassword;
            }
            return outputObject;
        }
    }
}
