/*
* 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
{
///
/// An order for a pets from the pet store
///
[DataContract(Name = "Order")]
public partial class Order : IEquatable, IValidatableObject
{
///
/// Order Status
///
/// Order Status
[JsonConverter(typeof(StringEnumConverter))]
public enum StatusEnum
{
///
/// Enum Placed for value: placed
///
[EnumMember(Value = "placed")]
Placed = 1,
///
/// Enum Approved for value: approved
///
[EnumMember(Value = "approved")]
Approved = 2,
///
/// Enum Delivered for value: delivered
///
[EnumMember(Value = "delivered")]
Delivered = 3
}
///
/// Order Status
///
/// Order Status
[DataMember(Name = "status", EmitDefaultValue = false)]
public StatusEnum? Status { get; set; }
///
/// Initializes a new instance of the class.
///
/// id.
/// petId.
/// quantity.
/// shipDate.
/// Order Status.
/// complete (default to false).
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;
}
///
/// Gets or Sets Id
///
[DataMember(Name = "id", EmitDefaultValue = false)]
public long Id { get; set; }
///
/// Gets or Sets PetId
///
[DataMember(Name = "petId", EmitDefaultValue = false)]
public long PetId { get; set; }
///
/// Gets or Sets Quantity
///
[DataMember(Name = "quantity", EmitDefaultValue = false)]
public int Quantity { get; set; }
///
/// Gets or Sets ShipDate
///
[DataMember(Name = "shipDate", EmitDefaultValue = false)]
public DateTime ShipDate { get; set; }
///
/// Gets or Sets Complete
///
[DataMember(Name = "complete", EmitDefaultValue = true)]
public bool Complete { get; set; }
///
/// Returns the string presentation of the object
///
/// String presentation of the object
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();
}
///
/// Returns the JSON string presentation of the object
///
/// JSON string presentation of the object
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
///
/// Returns true if objects are equal
///
/// Object to be compared
/// Boolean
public override bool Equals(object input)
{
return this.Equals(input as Order);
}
///
/// Returns true if Order instances are equal
///
/// Instance of Order to be compared
/// Boolean
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)
);
}
///
/// Gets the hash code
///
/// Hash code
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;
}
}
///
/// To validate all properties of the instance
///
/// Validation context
/// Validation Result
IEnumerable IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}