forked from loafle/openapi-generator-original
* rename csharp-netcore to csharp * rename file * renmae modules/openapi-generator/src/main/resources/csharp-netcore * update samples * mv dir * update samples * rename csharp-netcore to csharp in appveyor.yml * update doc
235 lines
8.4 KiB
C#
235 lines
8.4 KiB
C#
/*
|
|
* OpenAPI Petstore
|
|
*
|
|
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
|
*
|
|
* The version of the OpenAPI document: 1.0.0
|
|
* 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 = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
|
|
|
namespace Org.OpenAPITools.Models
|
|
{
|
|
/// <summary>
|
|
/// A User who is purchasing from the pet store
|
|
/// </summary>
|
|
[DataContract(Name = "User")]
|
|
public partial class User : IEquatable<User>, IValidatableObject
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="User" /> class.
|
|
/// </summary>
|
|
/// <param name="id">id.</param>
|
|
/// <param name="username">username.</param>
|
|
/// <param name="firstName">firstName.</param>
|
|
/// <param name="lastName">lastName.</param>
|
|
/// <param name="email">email.</param>
|
|
/// <param name="password">password.</param>
|
|
/// <param name="phone">phone.</param>
|
|
/// <param name="userStatus">User Status.</param>
|
|
public User(long id = default(long), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int userStatus = default(int))
|
|
{
|
|
this.Id = id;
|
|
this.Username = username;
|
|
this.FirstName = firstName;
|
|
this.LastName = lastName;
|
|
this.Email = email;
|
|
this.Password = password;
|
|
this.Phone = phone;
|
|
this.UserStatus = userStatus;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets or Sets Id
|
|
/// </summary>
|
|
[DataMember(Name = "id", EmitDefaultValue = false)]
|
|
public long Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or Sets Username
|
|
/// </summary>
|
|
[DataMember(Name = "username", EmitDefaultValue = false)]
|
|
public string Username { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or Sets FirstName
|
|
/// </summary>
|
|
[DataMember(Name = "firstName", EmitDefaultValue = false)]
|
|
public string FirstName { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or Sets LastName
|
|
/// </summary>
|
|
[DataMember(Name = "lastName", EmitDefaultValue = false)]
|
|
public string LastName { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or Sets Email
|
|
/// </summary>
|
|
[DataMember(Name = "email", EmitDefaultValue = false)]
|
|
public string Email { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or Sets Password
|
|
/// </summary>
|
|
[DataMember(Name = "password", EmitDefaultValue = false)]
|
|
public string Password { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or Sets Phone
|
|
/// </summary>
|
|
[DataMember(Name = "phone", EmitDefaultValue = false)]
|
|
public string Phone { get; set; }
|
|
|
|
/// <summary>
|
|
/// User Status
|
|
/// </summary>
|
|
/// <value>User Status</value>
|
|
[DataMember(Name = "userStatus", EmitDefaultValue = false)]
|
|
public int UserStatus { 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 User {\n");
|
|
sb.Append(" Id: ").Append(Id).Append("\n");
|
|
sb.Append(" Username: ").Append(Username).Append("\n");
|
|
sb.Append(" FirstName: ").Append(FirstName).Append("\n");
|
|
sb.Append(" LastName: ").Append(LastName).Append("\n");
|
|
sb.Append(" Email: ").Append(Email).Append("\n");
|
|
sb.Append(" Password: ").Append(Password).Append("\n");
|
|
sb.Append(" Phone: ").Append(Phone).Append("\n");
|
|
sb.Append(" UserStatus: ").Append(UserStatus).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 User);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns true if User instances are equal
|
|
/// </summary>
|
|
/// <param name="input">Instance of User to be compared</param>
|
|
/// <returns>Boolean</returns>
|
|
public bool Equals(User input)
|
|
{
|
|
if (input == null)
|
|
return false;
|
|
|
|
return
|
|
(
|
|
this.Id == input.Id ||
|
|
this.Id.Equals(input.Id)
|
|
) &&
|
|
(
|
|
this.Username == input.Username ||
|
|
(this.Username != null &&
|
|
this.Username.Equals(input.Username))
|
|
) &&
|
|
(
|
|
this.FirstName == input.FirstName ||
|
|
(this.FirstName != null &&
|
|
this.FirstName.Equals(input.FirstName))
|
|
) &&
|
|
(
|
|
this.LastName == input.LastName ||
|
|
(this.LastName != null &&
|
|
this.LastName.Equals(input.LastName))
|
|
) &&
|
|
(
|
|
this.Email == input.Email ||
|
|
(this.Email != null &&
|
|
this.Email.Equals(input.Email))
|
|
) &&
|
|
(
|
|
this.Password == input.Password ||
|
|
(this.Password != null &&
|
|
this.Password.Equals(input.Password))
|
|
) &&
|
|
(
|
|
this.Phone == input.Phone ||
|
|
(this.Phone != null &&
|
|
this.Phone.Equals(input.Phone))
|
|
) &&
|
|
(
|
|
this.UserStatus == input.UserStatus ||
|
|
this.UserStatus.Equals(input.UserStatus)
|
|
);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the hash code
|
|
/// </summary>
|
|
/// <returns>Hash code</returns>
|
|
public override int GetHashCode()
|
|
{
|
|
unchecked // Overflow is fine, just wrap
|
|
{
|
|
int hashCode = 41;
|
|
hashCode = hashCode * 59 + this.Id.GetHashCode();
|
|
if (this.Username != null)
|
|
hashCode = hashCode * 59 + this.Username.GetHashCode();
|
|
if (this.FirstName != null)
|
|
hashCode = hashCode * 59 + this.FirstName.GetHashCode();
|
|
if (this.LastName != null)
|
|
hashCode = hashCode * 59 + this.LastName.GetHashCode();
|
|
if (this.Email != null)
|
|
hashCode = hashCode * 59 + this.Email.GetHashCode();
|
|
if (this.Password != null)
|
|
hashCode = hashCode * 59 + this.Password.GetHashCode();
|
|
if (this.Phone != null)
|
|
hashCode = hashCode * 59 + this.Phone.GetHashCode();
|
|
hashCode = hashCode * 59 + this.UserStatus.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)
|
|
{
|
|
yield break;
|
|
}
|
|
}
|
|
|
|
}
|