csharp/Adyen/adyen-dotnet-api-library/Adyen/Model/MarketPay/AccountEvent.cs

MarketPay
AccountEvent.cs
#region License
// /*
//  *                       ######
//  *                       ######
//  * ############    ####( ######  #####. ######  ############   ############
//  * #############  #####( ######  #####. ######  #############  #############
//  *        ######  #####( ######  #####. ######  #####  ######  #####  ######
//  * ###### ######  #####( ######  #####. ######  #####  #####   #####  ######
//  * ###### ######  #####( ######  #####. ######  #####          #####  ######
//  * #############  #############  #############  #############  #####  ######
//  *  ############   ############  #############   ############  #####  ######
//  *                                      ######
//  *                               #############
//  *                               ############
//  *
//  * Adyen Dotnet API Library
//  *
//  * Copyright (c) 2020 Adyen B.V.
//  * This file is open source and available under the MIT license.
//  * See the LICENSE file for more info.
//  */
#endregion

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace Adyen.Model.MarketPay
{
    /// 
    /// AccountEvent
    /// 
    [DataContract]
        public partial clast AccountEvent :  IEquatable, IValidatableObject
    {
        /// 
        /// The event. >Permitted values: `InactivateAccount`, `RefundNotPaidOutTransfers`. For more information, refer to [Verification checks](https://docs.adyen.com/marketpay/onboarding-and-verification/verification-checks).
        /// 
        /// The event. >Permitted values: `InactivateAccount`, `RefundNotPaidOutTransfers`. For more information, refer to [Verification checks](https://docs.adyen.com/marketpay/onboarding-and-verification/verification-checks).
        [JsonConverter(typeof(StringEnumConverter))]
                public enum EventEnum
        {
            /// 
            /// Enum InactivateAccount for value: InactivateAccount
            /// 
            [EnumMember(Value = "InactivateAccount")]
            InactivateAccount = 1,
            /// 
            /// Enum RefundNotPaidOutTransfers for value: RefundNotPaidOutTransfers
            /// 
            [EnumMember(Value = "RefundNotPaidOutTransfers")]
            RefundNotPaidOutTransfers = 2        }
        /// 
        /// The event. >Permitted values: `InactivateAccount`, `RefundNotPaidOutTransfers`. For more information, refer to [Verification checks](https://docs.adyen.com/marketpay/onboarding-and-verification/verification-checks).
        /// 
        /// The event. >Permitted values: `InactivateAccount`, `RefundNotPaidOutTransfers`. For more information, refer to [Verification checks](https://docs.adyen.com/marketpay/onboarding-and-verification/verification-checks).
        [DataMember(Name="event", EmitDefaultValue=false)]
        public EventEnum Event { get; set; }
        /// 
        /// Initializes a new instance of the  clast.
        /// 
        /// The event. >Permitted values: `InactivateAccount`, `RefundNotPaidOutTransfers`. For more information, refer to [Verification checks](https://docs.adyen.com/marketpay/onboarding-and-verification/verification-checks). (required).
        /// The date on which the event will take place. (required).
        /// The reason why this event has been created. (required).
        public AccountEvent(EventEnum _event = default(EventEnum), DateTime? executionDate = default(DateTime?), string reason = default(string))
        {
            // to ensure "executionDate" is required (not null)
            if (executionDate == null)
            {
                throw new InvalidDataException("executionDate is a required property for AccountEvent and cannot be null");
            }
            else
            {
                this.ExecutionDate = executionDate;
            }
            // to ensure "reason" is required (not null)
            if (reason == null)
            {
                throw new InvalidDataException("reason is a required property for AccountEvent and cannot be null");
            }
            else
            {
                this.Reason = reason;
            }
            this.Event = _event;
        }
        

        /// 
        /// The date on which the event will take place.
        /// 
        /// The date on which the event will take place.
        [DataMember(Name="executionDate", EmitDefaultValue=false)]
        public DateTime? ExecutionDate { get; set; }

        /// 
        /// The reason why this event has been created.
        /// 
        /// The reason why this event has been created.
        [DataMember(Name="reason", EmitDefaultValue=false)]
        public string Reason { get; set; }

        /// 
        /// Returns the string presentation of the object
        /// 
        /// String presentation of the object
        public override string ToString()
        {
            var sb = new StringBuilder();
            sb.Append("clast AccountEvent {\n");
            sb.Append("  Event: ").Append(Event).Append("\n");
            sb.Append("  ExecutionDate: ").Append(ExecutionDate).Append("\n");
            sb.Append("  Reason: ").Append(Reason).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }
  
        /// 
        /// Returns the JSON string presentation of the object
        /// 
        /// JSON string presentation of the object
        public virtual string ToJson()
        {
            return JsonConvert.SerializeObject(this, Formatting.Indented);
        }

        /// 
        /// Returns true if objects are equal
        /// 
        /// Object to be compared
        /// Boolean
        public override bool Equals(object input)
        {
            return this.Equals(input as AccountEvent);
        }

        /// 
        /// Returns true if AccountEvent instances are equal
        /// 
        /// Instance of AccountEvent to be compared
        /// Boolean
        public bool Equals(AccountEvent input)
        {
            if (input == null)
                return false;

            return 
                (
                    this.Event == input.Event ||
                    this.Event.Equals(input.Event)
                ) && 
                (
                    this.ExecutionDate == input.ExecutionDate ||
                    (this.ExecutionDate != null &&
                    this.ExecutionDate.Equals(input.ExecutionDate))
                ) && 
                (
                    this.Reason == input.Reason ||
                    (this.Reason != null &&
                    this.Reason.Equals(input.Reason))
                );
        }

        /// 
        /// Gets the hash code
        /// 
        /// Hash code
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                hashCode = hashCode * 59 + this.Event.GetHashCode();
                if (this.ExecutionDate != null)
                    hashCode = hashCode * 59 + this.ExecutionDate.GetHashCode();
                if (this.Reason != null)
                    hashCode = hashCode * 59 + this.Reason.GetHashCode();
                return hashCode;
            }
        }

        /// 
        /// To validate all properties of the instance
        /// 
        /// Validation context
        /// Validation Result
        IEnumerable IValidatableObject.Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }
}