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

MarketPay
CloseAccountResponse.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.Linq;
using System.Runtime.Serialization;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace Adyen.Model.MarketPay
{
    /// 
    /// CloseAccountResponse
    /// 
    [DataContract]
        public partial clast CloseAccountResponse :  IEquatable, IValidatableObject
    {
        /// 
        /// The new status of the account. >Permitted values: `Active`, `Inactive`, `Suspended`, `Closed`.
        /// 
        /// The new status of the account. >Permitted values: `Active`, `Inactive`, `Suspended`, `Closed`.
        [JsonConverter(typeof(StringEnumConverter))]
                public enum StatusEnum
        {
            /// 
            /// Enum Active for value: Active
            /// 
            [EnumMember(Value = "Active")]
            Active = 1,
            /// 
            /// Enum Closed for value: Closed
            /// 
            [EnumMember(Value = "Closed")]
            Closed = 2,
            /// 
            /// Enum Inactive for value: Inactive
            /// 
            [EnumMember(Value = "Inactive")]
            Inactive = 3,
            /// 
            /// Enum Suspended for value: Suspended
            /// 
            [EnumMember(Value = "Suspended")]
            Suspended = 4        }
        /// 
        /// The new status of the account. >Permitted values: `Active`, `Inactive`, `Suspended`, `Closed`.
        /// 
        /// The new status of the account. >Permitted values: `Active`, `Inactive`, `Suspended`, `Closed`.
        [DataMember(Name="status", EmitDefaultValue=false)]
        public StatusEnum Status { get; set; }
        /// 
        /// Initializes a new instance of the  clast.
        /// 
        /// Contains field validation errors that would prevent requests from being processed..
        /// The reference of a request.  Can be used to uniquely identify the request. (required).
        /// The result code..
        /// The new status of the account. >Permitted values: `Active`, `Inactive`, `Suspended`, `Closed`. (required).
        //public CloseAccountResponse(List invalidFields = default(List), string pspReference = default(string), string resultCode = default(string), StatusEnum status = default(StatusEnum))
        //{
        //    // to ensure "pspReference" is required (not null)
        //    if (pspReference == null)
        //    {
        //        throw new InvalidDataException("pspReference is a required property for CloseAccountResponse and cannot be null");
        //    }
        //    else
        //    {
        //        this.PspReference = pspReference;
        //    }
        //    // to ensure "status" is required (not null)
        //    if (status == null)
        //    {
        //        throw new InvalidDataException("status is a required property for CloseAccountResponse and cannot be null");
        //    }
        //    else
        //    {
        //        this.Status = status;
        //    }
        //    this.InvalidFields = invalidFields;
        //    this.ResultCode = resultCode;
        //}
        public CloseAccountResponse()
        {

        }
        /// 
        /// Contains field validation errors that would prevent requests from being processed.
        /// 
        /// Contains field validation errors that would prevent requests from being processed.
        [DataMember(Name="invalidFields", EmitDefaultValue=false)]
        public List InvalidFields { get; set; }

        /// 
        /// The reference of a request.  Can be used to uniquely identify the request.
        /// 
        /// The reference of a request.  Can be used to uniquely identify the request.
        [DataMember(Name="pspReference", EmitDefaultValue=false)]
        public string PspReference { get; set; }

        /// 
        /// The result code.
        /// 
        /// The result code.
        [DataMember(Name="resultCode", EmitDefaultValue=false)]
        public string ResultCode { 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 CloseAccountResponse {\n");
            sb.Append("  InvalidFields: ").Append(InvalidFields).Append("\n");
            sb.Append("  PspReference: ").Append(PspReference).Append("\n");
            sb.Append("  ResultCode: ").Append(ResultCode).Append("\n");
            sb.Append("  Status: ").Append(Status).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 CloseAccountResponse);
        }

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

            return 
                (
                    this.InvalidFields == input.InvalidFields ||
                    this.InvalidFields != null &&
                    input.InvalidFields != null &&
                    this.InvalidFields.SequenceEqual(input.InvalidFields)
                ) && 
                (
                    this.PspReference == input.PspReference ||
                    (this.PspReference != null &&
                    this.PspReference.Equals(input.PspReference))
                ) && 
                (
                    this.ResultCode == input.ResultCode ||
                    (this.ResultCode != null &&
                    this.ResultCode.Equals(input.ResultCode))
                ) && 
                (
                    this.Status == input.Status ||
                    this.Status.Equals(input.Status)
                );
        }

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

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