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
224 lines
7.4 KiB
C#
224 lines
7.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>
|
|
/// An order for a pets from the pet store
|
|
/// </summary>
|
|
[DataContract(Name = "Order")]
|
|
public partial class Order : IEquatable<Order>, IValidatableObject
|
|
{
|
|
/// <summary>
|
|
/// Order Status
|
|
/// </summary>
|
|
/// <value>Order Status</value>
|
|
[JsonConverter(typeof(StringEnumConverter))]
|
|
public enum StatusEnum
|
|
{
|
|
/// <summary>
|
|
/// Enum Placed for value: placed
|
|
/// </summary>
|
|
[EnumMember(Value = "placed")]
|
|
Placed = 1,
|
|
|
|
/// <summary>
|
|
/// Enum Approved for value: approved
|
|
/// </summary>
|
|
[EnumMember(Value = "approved")]
|
|
Approved = 2,
|
|
|
|
/// <summary>
|
|
/// Enum Delivered for value: delivered
|
|
/// </summary>
|
|
[EnumMember(Value = "delivered")]
|
|
Delivered = 3
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Order Status
|
|
/// </summary>
|
|
/// <value>Order Status</value>
|
|
[DataMember(Name = "status", EmitDefaultValue = false)]
|
|
public StatusEnum? Status { get; set; }
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="Order" /> class.
|
|
/// </summary>
|
|
/// <param name="id">id.</param>
|
|
/// <param name="petId">petId.</param>
|
|
/// <param name="quantity">quantity.</param>
|
|
/// <param name="shipDate">shipDate.</param>
|
|
/// <param name="status">Order Status.</param>
|
|
/// <param name="complete">complete (default to false).</param>
|
|
public Order(long id = default(long), long petId = default(long), int quantity = default(int), DateTime shipDate = default(DateTime), StatusEnum? status = default(StatusEnum?), bool complete = false)
|
|
{
|
|
this.Id = id;
|
|
this.PetId = petId;
|
|
this.Quantity = quantity;
|
|
this.ShipDate = shipDate;
|
|
this.Status = status;
|
|
this.Complete = complete;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets or Sets Id
|
|
/// </summary>
|
|
[DataMember(Name = "id", EmitDefaultValue = false)]
|
|
public long Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or Sets PetId
|
|
/// </summary>
|
|
[DataMember(Name = "petId", EmitDefaultValue = false)]
|
|
public long PetId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or Sets Quantity
|
|
/// </summary>
|
|
[DataMember(Name = "quantity", EmitDefaultValue = false)]
|
|
public int Quantity { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or Sets ShipDate
|
|
/// </summary>
|
|
[DataMember(Name = "shipDate", EmitDefaultValue = false)]
|
|
public DateTime ShipDate { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or Sets Complete
|
|
/// </summary>
|
|
[DataMember(Name = "complete", EmitDefaultValue = true)]
|
|
public bool Complete { 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 Order {\n");
|
|
sb.Append(" Id: ").Append(Id).Append("\n");
|
|
sb.Append(" PetId: ").Append(PetId).Append("\n");
|
|
sb.Append(" Quantity: ").Append(Quantity).Append("\n");
|
|
sb.Append(" ShipDate: ").Append(ShipDate).Append("\n");
|
|
sb.Append(" Status: ").Append(Status).Append("\n");
|
|
sb.Append(" Complete: ").Append(Complete).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 Order);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns true if Order instances are equal
|
|
/// </summary>
|
|
/// <param name="input">Instance of Order to be compared</param>
|
|
/// <returns>Boolean</returns>
|
|
public bool Equals(Order input)
|
|
{
|
|
if (input == null)
|
|
return false;
|
|
|
|
return
|
|
(
|
|
this.Id == input.Id ||
|
|
this.Id.Equals(input.Id)
|
|
) &&
|
|
(
|
|
this.PetId == input.PetId ||
|
|
this.PetId.Equals(input.PetId)
|
|
) &&
|
|
(
|
|
this.Quantity == input.Quantity ||
|
|
this.Quantity.Equals(input.Quantity)
|
|
) &&
|
|
(
|
|
this.ShipDate == input.ShipDate ||
|
|
(this.ShipDate != null &&
|
|
this.ShipDate.Equals(input.ShipDate))
|
|
) &&
|
|
(
|
|
this.Status == input.Status ||
|
|
this.Status.Equals(input.Status)
|
|
) &&
|
|
(
|
|
this.Complete == input.Complete ||
|
|
this.Complete.Equals(input.Complete)
|
|
);
|
|
}
|
|
|
|
/// <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();
|
|
hashCode = hashCode * 59 + this.PetId.GetHashCode();
|
|
hashCode = hashCode * 59 + this.Quantity.GetHashCode();
|
|
if (this.ShipDate != null)
|
|
hashCode = hashCode * 59 + this.ShipDate.GetHashCode();
|
|
hashCode = hashCode * 59 + this.Status.GetHashCode();
|
|
hashCode = hashCode * 59 + this.Complete.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;
|
|
}
|
|
}
|
|
|
|
}
|