better model name for c#

This commit is contained in:
wing328
2016-03-04 14:46:01 +08:00
parent e0b16151f4
commit 329530c442
7 changed files with 278 additions and 69 deletions

View File

@@ -1352,6 +1352,12 @@ namespace IO.Swagger.Api
// authentication (api_key) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
{
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
}
// authentication (petstore_auth) required
// oauth required
@@ -1359,12 +1365,6 @@ namespace IO.Swagger.Api
{
localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken;
}
// authentication (api_key) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
{
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
}
// make the HTTP request
@@ -1445,6 +1445,13 @@ namespace IO.Swagger.Api
// authentication (api_key) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
{
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
}
// authentication (petstore_auth) required
// oauth required
@@ -1453,13 +1460,6 @@ namespace IO.Swagger.Api
localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken;
}
// authentication (api_key) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
{
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
@@ -2267,6 +2267,12 @@ namespace IO.Swagger.Api
// authentication (api_key) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
{
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
}
// authentication (petstore_auth) required
// oauth required
@@ -2274,12 +2280,6 @@ namespace IO.Swagger.Api
{
localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken;
}
// authentication (api_key) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
{
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
}
// make the HTTP request
@@ -2360,6 +2360,13 @@ namespace IO.Swagger.Api
// authentication (api_key) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
{
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
}
// authentication (petstore_auth) required
// oauth required
@@ -2368,13 +2375,6 @@ namespace IO.Swagger.Api
localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken;
}
// authentication (api_key) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
{
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,

View File

@@ -1102,18 +1102,18 @@ namespace IO.Swagger.Api
// authentication (test_api_key_query) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_query")))
{
localVarQueryParams["test_api_key_query"] = Configuration.GetApiKeyWithPrefix("test_api_key_query");
}
// authentication (test_api_key_header) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_header")))
{
localVarHeaderParams["test_api_key_header"] = Configuration.GetApiKeyWithPrefix("test_api_key_header");
}
// authentication (test_api_key_query) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_query")))
{
localVarQueryParams["test_api_key_query"] = Configuration.GetApiKeyWithPrefix("test_api_key_query");
}
// make the HTTP request
@@ -1194,13 +1194,6 @@ namespace IO.Swagger.Api
// authentication (test_api_key_query) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_query")))
{
localVarQueryParams["test_api_key_query"] = Configuration.GetApiKeyWithPrefix("test_api_key_query");
}
// authentication (test_api_key_header) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_header")))
@@ -1208,6 +1201,13 @@ namespace IO.Swagger.Api
localVarHeaderParams["test_api_key_header"] = Configuration.GetApiKeyWithPrefix("test_api_key_header");
}
// authentication (test_api_key_query) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_query")))
{
localVarQueryParams["test_api_key_query"] = Configuration.GetApiKeyWithPrefix("test_api_key_query");
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,

View File

@@ -7,17 +7,19 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace IO.Swagger.Model
{
/// <summary>
///
/// </summary>
[DataContract]
public partial class InlineResponse200 : IEquatable<InlineResponse200>
{
/// <summary>
/// Initializes a new instance of the <see cref="InlineResponse200" /> class.
/// Initializes a new instance of the <see cref="InlineResponse200" />class.
/// </summary>
/// <param name="Id">Id (required).</param>
@@ -47,22 +49,18 @@ namespace IO.Swagger.Model
[DataMember(Name="id", EmitDefaultValue=false)]
public long? Id { get; set; }
/// <summary>
/// Gets or Sets Category
/// </summary>
[DataMember(Name="category", EmitDefaultValue=false)]
public Object Category { 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>

View File

@@ -0,0 +1,113 @@
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace IO.Swagger.Model
{
/// <summary>
///
/// </summary>
[DataContract]
public partial class ObjectReturn : IEquatable<ObjectReturn>
{
/// <summary>
/// Initializes a new instance of the <see cref="ObjectReturn" /> class.
/// Initializes a new instance of the <see cref="ObjectReturn" />class.
/// </summary>
/// <param name="_Return">_Return.</param>
public ObjectReturn(int? _Return = null)
{
this._Return = _Return;
}
/// <summary>
/// Gets or Sets _Return
/// </summary>
[DataMember(Name="return", EmitDefaultValue=false)]
public int? _Return { 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 ObjectReturn {\n");
sb.Append(" _Return: ").Append(_Return).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 JsonConvert.SerializeObject(this, 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)
{
// credit: http://stackoverflow.com/a/10454552/677735
return this.Equals(obj as ObjectReturn);
}
/// <summary>
/// Returns true if ObjectReturn instances are equal
/// </summary>
/// <param name="other">Instance of ObjectReturn to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(ObjectReturn other)
{
// credit: http://stackoverflow.com/a/10454552/677735
if (other == null)
return false;
return
(
this._Return == other._Return ||
this._Return != null &&
this._Return.Equals(other._Return)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
// credit: http://stackoverflow.com/a/263416/677735
unchecked // Overflow is fine, just wrap
{
int hash = 41;
// Suitable nullity checks etc, of course :)
if (this._Return != null)
hash = hash * 59 + this._Return.GetHashCode();
return hash;
}
}
}
}

View File

@@ -0,0 +1,113 @@
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace IO.Swagger.Model
{
/// <summary>
///
/// </summary>
[DataContract]
public partial class SpecialModelName : IEquatable<SpecialModelName>
{
/// <summary>
/// Initializes a new instance of the <see cref="SpecialModelName" /> class.
/// Initializes a new instance of the <see cref="SpecialModelName" />class.
/// </summary>
/// <param name="SpecialPropertyName">SpecialPropertyName.</param>
public SpecialModelName(long? SpecialPropertyName = null)
{
this.SpecialPropertyName = SpecialPropertyName;
}
/// <summary>
/// Gets or Sets SpecialPropertyName
/// </summary>
[DataMember(Name="$special[property.name]", EmitDefaultValue=false)]
public long? SpecialPropertyName { 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 SpecialModelName {\n");
sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).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 JsonConvert.SerializeObject(this, 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)
{
// credit: http://stackoverflow.com/a/10454552/677735
return this.Equals(obj as SpecialModelName);
}
/// <summary>
/// Returns true if SpecialModelName instances are equal
/// </summary>
/// <param name="other">Instance of SpecialModelName to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(SpecialModelName other)
{
// credit: http://stackoverflow.com/a/10454552/677735
if (other == null)
return false;
return
(
this.SpecialPropertyName == other.SpecialPropertyName ||
this.SpecialPropertyName != null &&
this.SpecialPropertyName.Equals(other.SpecialPropertyName)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
// credit: http://stackoverflow.com/a/263416/677735
unchecked // Overflow is fine, just wrap
{
int hash = 41;
// Suitable nullity checks etc, of course :)
if (this.SpecialPropertyName != null)
hash = hash * 59 + this.SpecialPropertyName.GetHashCode();
return hash;
}
}
}
}

View File

@@ -60,6 +60,8 @@
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Client\ApiResponse.cs" />
<Compile Include="TestOrder.cs" />
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\InlineResponse200.cs" />
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\ObjectReturn.cs" />
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\SpecialModelName.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>

View File

@@ -1,28 +1,11 @@
<Properties StartupItem="SwaggerClientTest.csproj">
<Properties StartupItem="SwaggerClientTest.csproj">
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
<MonoDevelop.Ide.Workbench ActiveDocument="Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs">
<Files>
<File FileName="TestPet.cs" Line="162" Column="35" />
<File FileName="TestPet.cs" Line="1" Column="1" />
<File FileName="TestOrder.cs" Line="1" Column="1" />
<File FileName="Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs" Line="8" Column="24" />
<File FileName="Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs" Line="18" Column="9" />
</Files>
<Pads>
<Pad Id="MonoDevelop.NUnit.TestPad">
<State name="__root__">
<Node name="SwaggerClientTest" expanded="True">
<Node name="SwaggerClientTest" expanded="True">
<Node name="SwaggerClient" expanded="True">
<Node name="TestPet" expanded="True">
<Node name="TestPet" expanded="True">
<Node name="TestEqual" selected="True" />
</Node>
</Node>
</Node>
</Node>
</Node>
</State>
</Pad>
</Pads>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore />