Update samples for aspnetcore

This commit is contained in:
Jean-François Côté 2023-05-16 14:42:51 -04:00
parent 9f7b0ba849
commit 8efcc2c62d
16 changed files with 24 additions and 1140 deletions

View File

@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Models
/// <summary>
/// Gets or Sets ShipDate
/// </summary>
[DataMember(Name="shipDate", EmitDefaultValue=false)]
[DataMember(Name="shipDate", EmitDefaultValue=true)]
public DateTime ShipDate { get; set; }
@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Models
) &&
(
ShipDate == other.ShipDate ||
ShipDate != null &&
ShipDate.Equals(other.ShipDate)
) &&
(
@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Models
hashCode = hashCode * 59 + PetId.GetHashCode();
hashCode = hashCode * 59 + Quantity.GetHashCode();
if (ShipDate != null)
hashCode = hashCode * 59 + ShipDate.GetHashCode();
hashCode = hashCode * 59 + Status.GetHashCode();

View File

@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Models
/// <summary>
/// Gets or Sets ShipDate
/// </summary>
[DataMember(Name="shipDate", EmitDefaultValue=false)]
[DataMember(Name="shipDate", EmitDefaultValue=true)]
public DateTime ShipDate { get; set; }
@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Models
) &&
(
ShipDate == other.ShipDate ||
ShipDate != null &&
ShipDate.Equals(other.ShipDate)
) &&
(
@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Models
hashCode = hashCode * 59 + PetId.GetHashCode();
hashCode = hashCode * 59 + Quantity.GetHashCode();
if (ShipDate != null)
hashCode = hashCode * 59 + ShipDate.GetHashCode();
hashCode = hashCode * 59 + Status.GetHashCode();

View File

@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Models
/// <summary>
/// Gets or Sets ShipDate
/// </summary>
[DataMember(Name="shipDate", EmitDefaultValue=false)]
[DataMember(Name="shipDate", EmitDefaultValue=true)]
public DateTime ShipDate { get; set; }
@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Models
) &&
(
ShipDate == other.ShipDate ||
ShipDate != null &&
ShipDate.Equals(other.ShipDate)
) &&
(
@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Models
hashCode = hashCode * 59 + PetId.GetHashCode();
hashCode = hashCode * 59 + Quantity.GetHashCode();
if (ShipDate != null)
hashCode = hashCode * 59 + ShipDate.GetHashCode();
hashCode = hashCode * 59 + Status.GetHashCode();

View File

@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Models
/// <summary>
/// Gets or Sets ShipDate
/// </summary>
[DataMember(Name="shipDate", EmitDefaultValue=false)]
[DataMember(Name="shipDate", EmitDefaultValue=true)]
public DateTime ShipDate { get; set; }

View File

@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Models
/// <summary>
/// Gets or Sets ShipDate
/// </summary>
[DataMember(Name="shipDate", EmitDefaultValue=false)]
[DataMember(Name="shipDate", EmitDefaultValue=true)]
public DateTime ShipDate { get; set; }
@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Models
) &&
(
ShipDate == other.ShipDate ||
ShipDate != null &&
ShipDate.Equals(other.ShipDate)
) &&
(
@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Models
hashCode = hashCode * 59 + PetId.GetHashCode();
hashCode = hashCode * 59 + Quantity.GetHashCode();
if (ShipDate != null)
hashCode = hashCode * 59 + ShipDate.GetHashCode();
hashCode = hashCode * 59 + Status.GetHashCode();

View File

@ -1,42 +0,0 @@
using System;
using System.ComponentModel;
using System.Globalization;
using Newtonsoft.Json;
namespace Org.OpenAPITools.Converters
{
/// <summary>
/// Custom string to enum converter
/// </summary>
public class CustomEnumConverter<T> : TypeConverter
{
/// <summary>
/// Determine if we can convert a type to an enum
/// </summary>
/// <param name="context"></param>
/// <param name="sourceType"></param>
/// <returns></returns>
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType);
}
/// <summary>
/// Convert from a type value to an enum
/// </summary>
/// <param name="context"></param>
/// <param name="culture"></param>
/// <param name="value"></param>
/// <returns></returns>
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
var s = value as string;
if (string.IsNullOrEmpty(s))
{
return null;
}
return JsonConvert.DeserializeObject<T>(@"""" + value.ToString() + @"""");
}
}
}

View File

@ -1,147 +0,0 @@
/*
* 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://openapi-generator.tech
*/
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Org.OpenAPITools.Converters;
namespace Org.OpenAPITools.Models
{
/// <summary>
/// Describes the result of uploading an image resource
/// </summary>
[DataContract]
public partial class ApiResponse : IEquatable<ApiResponse>
{
/// <summary>
/// Gets or Sets Code
/// </summary>
[DataMember(Name="code", EmitDefaultValue=true)]
public int Code { get; set; }
/// <summary>
/// Gets or Sets Type
/// </summary>
[DataMember(Name="type", EmitDefaultValue=false)]
public string Type { get; set; }
/// <summary>
/// Gets or Sets Message
/// </summary>
[DataMember(Name="message", EmitDefaultValue=false)]
public string Message { 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 ApiResponse {\n");
sb.Append(" Code: ").Append(Code).Append("\n");
sb.Append(" Type: ").Append(Type).Append("\n");
sb.Append(" Message: ").Append(Message).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 string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
if (obj is null) return false;
if (ReferenceEquals(this, obj)) return true;
return obj.GetType() == GetType() && Equals((ApiResponse)obj);
}
/// <summary>
/// Returns true if ApiResponse instances are equal
/// </summary>
/// <param name="other">Instance of ApiResponse to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(ApiResponse other)
{
if (other is null) return false;
if (ReferenceEquals(this, other)) return true;
return
(
Code == other.Code ||
Code.Equals(other.Code)
) &&
(
Type == other.Type ||
Type != null &&
Type.Equals(other.Type)
) &&
(
Message == other.Message ||
Message != null &&
Message.Equals(other.Message)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
var hashCode = 41;
// Suitable nullity checks etc, of course :)
hashCode = hashCode * 59 + Code.GetHashCode();
if (Type != null)
hashCode = hashCode * 59 + Type.GetHashCode();
if (Message != null)
hashCode = hashCode * 59 + Message.GetHashCode();
return hashCode;
}
}
#region Operators
#pragma warning disable 1591
public static bool operator ==(ApiResponse left, ApiResponse right)
{
return Equals(left, right);
}
public static bool operator !=(ApiResponse left, ApiResponse right)
{
return !Equals(left, right);
}
#pragma warning restore 1591
#endregion Operators
}
}

View File

@ -1,134 +0,0 @@
/*
* 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://openapi-generator.tech
*/
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Org.OpenAPITools.Converters;
namespace Org.OpenAPITools.Models
{
/// <summary>
/// A category for a pet
/// </summary>
[DataContract]
public partial class Category : IEquatable<Category>
{
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name="id", EmitDefaultValue=true)]
public long Id { get; set; }
/// <summary>
/// Gets or Sets Name
/// </summary>
[RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")]
[DataMember(Name="name", EmitDefaultValue=false)]
public string Name { 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 Category {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Name: ").Append(Name).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 string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
if (obj is null) return false;
if (ReferenceEquals(this, obj)) return true;
return obj.GetType() == GetType() && Equals((Category)obj);
}
/// <summary>
/// Returns true if Category instances are equal
/// </summary>
/// <param name="other">Instance of Category to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(Category other)
{
if (other is null) return false;
if (ReferenceEquals(this, other)) return true;
return
(
Id == other.Id ||
Id.Equals(other.Id)
) &&
(
Name == other.Name ||
Name != null &&
Name.Equals(other.Name)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
var hashCode = 41;
// Suitable nullity checks etc, of course :)
hashCode = hashCode * 59 + Id.GetHashCode();
if (Name != null)
hashCode = hashCode * 59 + Name.GetHashCode();
return hashCode;
}
}
#region Operators
#pragma warning disable 1591
public static bool operator ==(Category left, Category right)
{
return Equals(left, right);
}
public static bool operator !=(Category left, Category right)
{
return !Equals(left, right);
}
#pragma warning restore 1591
#endregion Operators
}
}

View File

@ -1,219 +0,0 @@
/*
* 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://openapi-generator.tech
*/
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Org.OpenAPITools.Converters;
namespace Org.OpenAPITools.Models
{
/// <summary>
/// An order for a pets from the pet store
/// </summary>
[DataContract]
public partial class Order : IEquatable<Order>
{
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name="id", EmitDefaultValue=true)]
public long Id { get; set; }
/// <summary>
/// Gets or Sets PetId
/// </summary>
[DataMember(Name="petId", EmitDefaultValue=true)]
public long PetId { get; set; }
/// <summary>
/// Gets or Sets Quantity
/// </summary>
[DataMember(Name="quantity", EmitDefaultValue=true)]
public int Quantity { get; set; }
/// <summary>
/// Gets or Sets ShipDate
/// </summary>
[DataMember(Name="shipDate", EmitDefaultValue=false)]
public DateTime ShipDate { get; set; }
/// <summary>
/// Order Status
/// </summary>
/// <value>Order Status</value>
[TypeConverter(typeof(CustomEnumConverter<StatusEnum>))]
[JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
public enum StatusEnum
{
/// <summary>
/// Enum PlacedEnum for placed
/// </summary>
[EnumMember(Value = "placed")]
PlacedEnum = 1,
/// <summary>
/// Enum ApprovedEnum for approved
/// </summary>
[EnumMember(Value = "approved")]
ApprovedEnum = 2,
/// <summary>
/// Enum DeliveredEnum for delivered
/// </summary>
[EnumMember(Value = "delivered")]
DeliveredEnum = 3
}
/// <summary>
/// Order Status
/// </summary>
/// <value>Order Status</value>
[DataMember(Name="status", EmitDefaultValue=true)]
public StatusEnum Status { get; set; }
/// <summary>
/// Gets or Sets Complete
/// </summary>
[DataMember(Name="complete", EmitDefaultValue=true)]
public bool Complete { get; set; } = false;
/// <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 string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
if (obj is null) return false;
if (ReferenceEquals(this, obj)) return true;
return obj.GetType() == GetType() && Equals((Order)obj);
}
/// <summary>
/// Returns true if Order instances are equal
/// </summary>
/// <param name="other">Instance of Order to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(Order other)
{
if (other is null) return false;
if (ReferenceEquals(this, other)) return true;
return
(
Id == other.Id ||
Id.Equals(other.Id)
) &&
(
PetId == other.PetId ||
PetId.Equals(other.PetId)
) &&
(
Quantity == other.Quantity ||
Quantity.Equals(other.Quantity)
) &&
(
ShipDate == other.ShipDate ||
ShipDate != null &&
ShipDate.Equals(other.ShipDate)
) &&
(
Status == other.Status ||
Status.Equals(other.Status)
) &&
(
Complete == other.Complete ||
Complete.Equals(other.Complete)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
var hashCode = 41;
// Suitable nullity checks etc, of course :)
hashCode = hashCode * 59 + Id.GetHashCode();
hashCode = hashCode * 59 + PetId.GetHashCode();
hashCode = hashCode * 59 + Quantity.GetHashCode();
if (ShipDate != null)
hashCode = hashCode * 59 + ShipDate.GetHashCode();
hashCode = hashCode * 59 + Status.GetHashCode();
hashCode = hashCode * 59 + Complete.GetHashCode();
return hashCode;
}
}
#region Operators
#pragma warning disable 1591
public static bool operator ==(Order left, Order right)
{
return Equals(left, right);
}
public static bool operator !=(Order left, Order right)
{
return !Equals(left, right);
}
#pragma warning restore 1591
#endregion Operators
}
}

View File

@ -1,223 +0,0 @@
/*
* 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://openapi-generator.tech
*/
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Org.OpenAPITools.Converters;
namespace Org.OpenAPITools.Models
{
/// <summary>
/// A pet for sale in the pet store
/// </summary>
[DataContract]
public partial class Pet : IEquatable<Pet>
{
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name="id", EmitDefaultValue=true)]
public long Id { get; set; }
/// <summary>
/// Gets or Sets Category
/// </summary>
[DataMember(Name="category", EmitDefaultValue=false)]
public Category Category { get; set; }
/// <summary>
/// Gets or Sets Name
/// </summary>
[Required]
[DataMember(Name="name", EmitDefaultValue=false)]
public string Name { get; set; }
/// <summary>
/// Gets or Sets PhotoUrls
/// </summary>
[Required]
[DataMember(Name="photoUrls", EmitDefaultValue=false)]
public List<string> PhotoUrls { get; set; }
/// <summary>
/// Gets or Sets Tags
/// </summary>
[DataMember(Name="tags", EmitDefaultValue=false)]
public List<Tag> Tags { get; set; }
/// <summary>
/// pet status in the store
/// </summary>
/// <value>pet status in the store</value>
[TypeConverter(typeof(CustomEnumConverter<StatusEnum>))]
[JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
public enum StatusEnum
{
/// <summary>
/// Enum AvailableEnum for available
/// </summary>
[EnumMember(Value = "available")]
AvailableEnum = 1,
/// <summary>
/// Enum PendingEnum for pending
/// </summary>
[EnumMember(Value = "pending")]
PendingEnum = 2,
/// <summary>
/// Enum SoldEnum for sold
/// </summary>
[EnumMember(Value = "sold")]
SoldEnum = 3
}
/// <summary>
/// pet status in the store
/// </summary>
/// <value>pet status in the store</value>
[DataMember(Name="status", EmitDefaultValue=true)]
public StatusEnum Status { 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 Pet {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Category: ").Append(Category).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n");
sb.Append(" Tags: ").Append(Tags).Append("\n");
sb.Append(" Status: ").Append(Status).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 string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
if (obj is null) return false;
if (ReferenceEquals(this, obj)) return true;
return obj.GetType() == GetType() && Equals((Pet)obj);
}
/// <summary>
/// Returns true if Pet instances are equal
/// </summary>
/// <param name="other">Instance of Pet to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(Pet other)
{
if (other is null) return false;
if (ReferenceEquals(this, other)) return true;
return
(
Id == other.Id ||
Id.Equals(other.Id)
) &&
(
Category == other.Category ||
Category != null &&
Category.Equals(other.Category)
) &&
(
Name == other.Name ||
Name != null &&
Name.Equals(other.Name)
) &&
(
PhotoUrls == other.PhotoUrls ||
PhotoUrls != null &&
other.PhotoUrls != null &&
PhotoUrls.SequenceEqual(other.PhotoUrls)
) &&
(
Tags == other.Tags ||
Tags != null &&
other.Tags != null &&
Tags.SequenceEqual(other.Tags)
) &&
(
Status == other.Status ||
Status.Equals(other.Status)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
var hashCode = 41;
// Suitable nullity checks etc, of course :)
hashCode = hashCode * 59 + Id.GetHashCode();
if (Category != null)
hashCode = hashCode * 59 + Category.GetHashCode();
if (Name != null)
hashCode = hashCode * 59 + Name.GetHashCode();
if (PhotoUrls != null)
hashCode = hashCode * 59 + PhotoUrls.GetHashCode();
if (Tags != null)
hashCode = hashCode * 59 + Tags.GetHashCode();
hashCode = hashCode * 59 + Status.GetHashCode();
return hashCode;
}
}
#region Operators
#pragma warning disable 1591
public static bool operator ==(Pet left, Pet right)
{
return Equals(left, right);
}
public static bool operator !=(Pet left, Pet right)
{
return !Equals(left, right);
}
#pragma warning restore 1591
#endregion Operators
}
}

View File

@ -1,133 +0,0 @@
/*
* 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://openapi-generator.tech
*/
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Org.OpenAPITools.Converters;
namespace Org.OpenAPITools.Models
{
/// <summary>
/// A tag for a pet
/// </summary>
[DataContract]
public partial class Tag : IEquatable<Tag>
{
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name="id", EmitDefaultValue=true)]
public long Id { get; set; }
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name="name", EmitDefaultValue=false)]
public string Name { 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 Tag {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Name: ").Append(Name).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 string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
if (obj is null) return false;
if (ReferenceEquals(this, obj)) return true;
return obj.GetType() == GetType() && Equals((Tag)obj);
}
/// <summary>
/// Returns true if Tag instances are equal
/// </summary>
/// <param name="other">Instance of Tag to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(Tag other)
{
if (other is null) return false;
if (ReferenceEquals(this, other)) return true;
return
(
Id == other.Id ||
Id.Equals(other.Id)
) &&
(
Name == other.Name ||
Name != null &&
Name.Equals(other.Name)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
var hashCode = 41;
// Suitable nullity checks etc, of course :)
hashCode = hashCode * 59 + Id.GetHashCode();
if (Name != null)
hashCode = hashCode * 59 + Name.GetHashCode();
return hashCode;
}
}
#region Operators
#pragma warning disable 1591
public static bool operator ==(Tag left, Tag right)
{
return Equals(left, right);
}
public static bool operator !=(Tag left, Tag right)
{
return !Equals(left, right);
}
#pragma warning restore 1591
#endregion Operators
}
}

View File

@ -1,218 +0,0 @@
/*
* 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://openapi-generator.tech
*/
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Org.OpenAPITools.Converters;
namespace Org.OpenAPITools.Models
{
/// <summary>
/// A User who is purchasing from the pet store
/// </summary>
[DataContract]
public partial class User : IEquatable<User>
{
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name="id", EmitDefaultValue=true)]
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=true)]
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 string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
if (obj is null) return false;
if (ReferenceEquals(this, obj)) return true;
return obj.GetType() == GetType() && Equals((User)obj);
}
/// <summary>
/// Returns true if User instances are equal
/// </summary>
/// <param name="other">Instance of User to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(User other)
{
if (other is null) return false;
if (ReferenceEquals(this, other)) return true;
return
(
Id == other.Id ||
Id.Equals(other.Id)
) &&
(
Username == other.Username ||
Username != null &&
Username.Equals(other.Username)
) &&
(
FirstName == other.FirstName ||
FirstName != null &&
FirstName.Equals(other.FirstName)
) &&
(
LastName == other.LastName ||
LastName != null &&
LastName.Equals(other.LastName)
) &&
(
Email == other.Email ||
Email != null &&
Email.Equals(other.Email)
) &&
(
Password == other.Password ||
Password != null &&
Password.Equals(other.Password)
) &&
(
Phone == other.Phone ||
Phone != null &&
Phone.Equals(other.Phone)
) &&
(
UserStatus == other.UserStatus ||
UserStatus.Equals(other.UserStatus)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
var hashCode = 41;
// Suitable nullity checks etc, of course :)
hashCode = hashCode * 59 + Id.GetHashCode();
if (Username != null)
hashCode = hashCode * 59 + Username.GetHashCode();
if (FirstName != null)
hashCode = hashCode * 59 + FirstName.GetHashCode();
if (LastName != null)
hashCode = hashCode * 59 + LastName.GetHashCode();
if (Email != null)
hashCode = hashCode * 59 + Email.GetHashCode();
if (Password != null)
hashCode = hashCode * 59 + Password.GetHashCode();
if (Phone != null)
hashCode = hashCode * 59 + Phone.GetHashCode();
hashCode = hashCode * 59 + UserStatus.GetHashCode();
return hashCode;
}
}
#region Operators
#pragma warning disable 1591
public static bool operator ==(User left, User right)
{
return Equals(left, right);
}
public static bool operator !=(User left, User right)
{
return !Equals(left, right);
}
#pragma warning restore 1591
#endregion Operators
}
}

View File

@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Models
/// <summary>
/// Gets or Sets ShipDate
/// </summary>
[DataMember(Name="shipDate", EmitDefaultValue=false)]
[DataMember(Name="shipDate", EmitDefaultValue=true)]
public DateTime ShipDate { get; set; }
@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Models
) &&
(
ShipDate == other.ShipDate ||
ShipDate != null &&
ShipDate.Equals(other.ShipDate)
) &&
(
@ -194,7 +194,7 @@ namespace Org.OpenAPITools.Models
hashCode = hashCode * 59 + PetId.GetHashCode();
hashCode = hashCode * 59 + Quantity.GetHashCode();
if (ShipDate != null)
hashCode = hashCode * 59 + ShipDate.GetHashCode();
hashCode = hashCode * 59 + Status.GetHashCode();

View File

@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Models
/// <summary>
/// Gets or Sets ShipDate
/// </summary>
[DataMember(Name="shipDate", EmitDefaultValue=false)]
[DataMember(Name="shipDate", EmitDefaultValue=true)]
public DateTime ShipDate { get; set; }
@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Models
) &&
(
ShipDate == other.ShipDate ||
ShipDate != null &&
ShipDate.Equals(other.ShipDate)
) &&
(
@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Models
hashCode = hashCode * 59 + PetId.GetHashCode();
hashCode = hashCode * 59 + Quantity.GetHashCode();
if (ShipDate != null)
hashCode = hashCode * 59 + ShipDate.GetHashCode();
hashCode = hashCode * 59 + Status.GetHashCode();

View File

@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Models
/// <summary>
/// Gets or Sets ShipDate
/// </summary>
[DataMember(Name="shipDate", EmitDefaultValue=false)]
[DataMember(Name="shipDate", EmitDefaultValue=true)]
public DateTime ShipDate { get; set; }
@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Models
) &&
(
ShipDate == other.ShipDate ||
ShipDate != null &&
ShipDate.Equals(other.ShipDate)
) &&
(
@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Models
hashCode = hashCode * 59 + PetId.GetHashCode();
hashCode = hashCode * 59 + Quantity.GetHashCode();
if (ShipDate != null)
hashCode = hashCode * 59 + ShipDate.GetHashCode();
hashCode = hashCode * 59 + Status.GetHashCode();

View File

@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Models
) &&
(
ShipDate == other.ShipDate ||
ShipDate != null &&
ShipDate.Equals(other.ShipDate)
) &&
(
@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Models
hashCode = hashCode * 59 + PetId.GetHashCode();
hashCode = hashCode * 59 + Quantity.GetHashCode();
if (ShipDate != null)
hashCode = hashCode * 59 + ShipDate.GetHashCode();
hashCode = hashCode * 59 + Status.GetHashCode();