MarketPay
ViasName.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
{
///
/// ViasName
///
[DataContract]
public partial clast ViasName : IEquatable, IValidatableObject
{
///
/// The gender. >The following values are permitted: `MALE`, `FEMALE`, `UNKNOWN`.
///
/// The gender. >The following values are permitted: `MALE`, `FEMALE`, `UNKNOWN`.
[JsonConverter(typeof(StringEnumConverter))]
public enum GenderEnum
{
///
/// Enum MALE for value: MALE
///
[EnumMember(Value = "MALE")]
MALE = 1,
///
/// Enum FEMALE for value: FEMALE
///
[EnumMember(Value = "FEMALE")]
FEMALE = 2,
///
/// Enum UNKNOWN for value: UNKNOWN
///
[EnumMember(Value = "UNKNOWN")]
UNKNOWN = 3 }
///
/// The gender. >The following values are permitted: `MALE`, `FEMALE`, `UNKNOWN`.
///
/// The gender. >The following values are permitted: `MALE`, `FEMALE`, `UNKNOWN`.
[DataMember(Name="gender", EmitDefaultValue=false)]
public GenderEnum Gender { get; set; }
///
/// Initializes a new instance of the clast.
///
/// The first name. (required).
/// The gender. >The following values are permitted: `MALE`, `FEMALE`, `UNKNOWN`. (required).
/// The name's infix, if applicable. >A maximum length of twenty (20) characters is imposed..
/// The last name. (required).
public ViasName(string firstName = default(string), GenderEnum gender = default(GenderEnum), string infix = default(string), string lastName = default(string))
{
// to ensure "firstName" is required (not null)
if (firstName == null)
{
throw new InvalidDataException("firstName is a required property for ViasName and cannot be null");
}
else
{
this.FirstName = firstName;
}
// to ensure "lastName" is required (not null)
if (lastName == null)
{
throw new InvalidDataException("lastName is a required property for ViasName and cannot be null");
}
else
{
this.LastName = lastName;
}
this.Gender = gender;
this.Infix = infix;
}
///
/// The first name.
///
/// The first name.
[DataMember(Name="firstName", EmitDefaultValue=false)]
public string FirstName { get; set; }
///
/// The name's infix, if applicable. >A maximum length of twenty (20) characters is imposed.
///
/// The name's infix, if applicable. >A maximum length of twenty (20) characters is imposed.
[DataMember(Name="infix", EmitDefaultValue=false)]
public string Infix { get; set; }
///
/// The last name.
///
/// The last name.
[DataMember(Name="lastName", EmitDefaultValue=false)]
public string LastName { 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 ViasName {\n");
sb.Append(" FirstName: ").Append(FirstName).Append("\n");
sb.Append(" Gender: ").Append(Gender).Append("\n");
sb.Append(" Infix: ").Append(Infix).Append("\n");
sb.Append(" LastName: ").Append(LastName).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 ViasName);
}
///
/// Returns true if ViasName instances are equal
///
/// Instance of ViasName to be compared
/// Boolean
public bool Equals(ViasName input)
{
if (input == null)
return false;
return
(
this.FirstName == input.FirstName ||
(this.FirstName != null &&
this.FirstName.Equals(input.FirstName))
) &&
(
this.Gender == input.Gender ||
this.Gender.Equals(input.Gender)
) &&
(
this.Infix == input.Infix ||
(this.Infix != null &&
this.Infix.Equals(input.Infix))
) &&
(
this.LastName == input.LastName ||
(this.LastName != null &&
this.LastName.Equals(input.LastName))
);
}
///
/// Gets the hash code
///
/// Hash code
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.FirstName != null)
hashCode = hashCode * 59 + this.FirstName.GetHashCode();
hashCode = hashCode * 59 + this.Gender.GetHashCode();
if (this.Infix != null)
hashCode = hashCode * 59 + this.Infix.GetHashCode();
if (this.LastName != null)
hashCode = hashCode * 59 + this.LastName.GetHashCode();
return hashCode;
}
}
///
/// To validate all properties of the instance
///
/// Validation context
/// Validation Result
IEnumerable IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}