fix csharp enum issue after rebase

This commit is contained in:
wing328 2016-04-27 22:06:47 +08:00
parent 4419e71d4b
commit 0310d95800
44 changed files with 690 additions and 915 deletions

View File

@ -1301,7 +1301,8 @@ public class DefaultCodegen {
}
}
if (p instanceof BaseIntegerProperty) {
// type is integer and without format
if (p instanceof BaseIntegerProperty && !(p instanceof IntegerProperty) && !(p instanceof LongProperty)) {
BaseIntegerProperty sp = (BaseIntegerProperty) p;
property.isInteger = true;
/*if (sp.getEnum() != null) {
@ -1367,7 +1368,8 @@ public class DefaultCodegen {
property.isByteArray = true;
}
if (p instanceof DecimalProperty) {
// type is number and without format
if (p instanceof DecimalProperty && !(p instanceof DoubleProperty) && !(p instanceof FloatProperty)) {
DecimalProperty sp = (DecimalProperty) p;
property.isFloat = true;
/*if (sp.getEnum() != null) {

View File

@ -9,7 +9,7 @@
/// <summary>
/// Enum {{name}} for {{{value}}}
/// </summary>
[EnumMember(Value = {{{value}}})]
{{name}}{{^-last}},
{{/-last}}{{#-last}}{{/-last}}{{/enumVars}}{{/allowableValues}}
[EnumMember(Value = {{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isFloat}}"{{/isFloat}}{{#isDouble}}"{{/isDouble}}{{{value}}}{{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isFloat}}"{{/isFloat}})]
{{name}}{{#isLong}} = {{{value}}}{{/isLong}}{{#isInteger}} = {{{value}}}{{/isInteger}}{{^-last}},
{{/-last}}{{/enumVars}}{{/allowableValues}}
}

View File

@ -13,145 +13,7 @@ using Newtonsoft.Json.Converters;
{{#model}}
namespace {{packageName}}.Model
{
/// <summary>
/// {{description}}
/// </summary>
[DataContract]
public partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}>
{ {{#vars}}{{#isEnum}}
/// <summary>
/// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}}
/// </summary>{{#description}}
/// <value>{{{description}}}</value>{{/description}}
[JsonConverter(typeof(StringEnumConverter))]
{{>enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}}
{{>enumClass}}{{/items}}{{/items.isEnum}}{{/vars}}
{{#vars}}{{#isEnum}}
/// <summary>
/// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}}
/// </summary>{{#description}}
/// <value>{{{description}}}</value>{{/description}}
[DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})]
public {{{datatypeWithEnum}}} {{name}} { get; set; }
{{/isEnum}}{{/vars}}
/// <summary>
/// Initializes a new instance of the <see cref="{{classname}}" /> class.
/// Initializes a new instance of the <see cref="{{classname}}" />class.
/// </summary>
{{#vars}}{{^isReadOnly}} /// <param name="{{name}}">{{#description}}{{description}}{{/description}}{{^description}}{{name}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}.</param>
{{/isReadOnly}}{{/vars}}
public {{classname}}({{#vars}}{{^isReadOnly}}{{{datatypeWithEnum}}} {{name}} = null{{/isReadOnly}}{{#hasMoreNonReadOnly}}, {{/hasMoreNonReadOnly}}{{/vars}})
{
{{#vars}}{{^isReadOnly}}{{#required}}// to ensure "{{name}}" is required (not null)
if ({{name}} == null)
{
throw new InvalidDataException("{{name}} is a required property for {{classname}} and cannot be null");
}
else
{
this.{{name}} = {{name}};
}
{{/required}}{{/isReadOnly}}{{/vars}}{{#vars}}{{^isReadOnly}}{{^required}}{{#defaultValue}}// use default value if no "{{name}}" provided
if ({{name}} == null)
{
this.{{name}} = {{{defaultValue}}};
}
else
{
this.{{name}} = {{name}};
}
{{/defaultValue}}{{^defaultValue}}this.{{name}} = {{name}};
{{/defaultValue}}{{/required}}{{/isReadOnly}}{{/vars}}
}
{{#vars}}{{^isEnum}}
/// <summary>
/// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}}
/// </summary>{{#description}}
/// <value>{{description}}</value>{{/description}}
[DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})]
public {{{datatype}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }
{{/isEnum}}{{/vars}}
/// <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 {{classname}} {\n");
{{#vars}}
sb.Append(" {{name}}: ").Append({{name}}).Append("\n");
{{/vars}}
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 {{#parent}} new {{/parent}}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 {{classname}});
}
/// <summary>
/// Returns true if {{classname}} instances are equal
/// </summary>
/// <param name="other">Instance of {{classname}} to be compared</param>
/// <returns>Boolean</returns>
public bool Equals({{classname}} other)
{
// credit: http://stackoverflow.com/a/10454552/677735
if (other == null)
return false;
return {{#vars}}{{#isNotContainer}}
(
this.{{name}} == other.{{name}} ||
this.{{name}} != null &&
this.{{name}}.Equals(other.{{name}})
){{#hasMore}} && {{/hasMore}}{{/isNotContainer}}{{^isNotContainer}}
(
this.{{name}} == other.{{name}} ||
this.{{name}} != null &&
this.{{name}}.SequenceEqual(other.{{name}})
){{#hasMore}} && {{/hasMore}}{{/isNotContainer}}{{/vars}}{{^vars}}false{{/vars}};
}
/// <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 :)
{{#vars}}
if (this.{{name}} != null)
hash = hash * 59 + this.{{name}}.GetHashCode();
{{/vars}}
return hash;
}
}
}
{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{>modelGeneric}}{{/isEnum}}
{{/model}}
{{/models}}
}

View File

@ -3,23 +3,35 @@
/// </summary>
[DataContract]
public partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}>
{ {{#vars}}{{#isEnum}}
{{>modelInnerEnum}}{{/isEnum}}{{#items.isEnum}}{{#items}}
{{>modelInnerEnum}}{{/items}}{{/items.isEnum}}{{/vars}}
{{#vars}}{{#isEnum}}
{
{{#vars}}
{{#isEnum}}
{{>modelInnerEnum}}
{{/isEnum}}
{{#items.isEnum}}
{{#items}}
{{>modelInnerEnum}}
{{/items}}
{{/items.isEnum}}
{{/vars}}
{{#vars}}
{{#isEnum}}
/// <summary>
/// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}}
/// </summary>{{#description}}
/// <value>{{{description}}}</value>{{/description}}
[DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})]
public {{{datatypeWithEnum}}}{{#isEnum}}?{{/isEnum}} {{name}} { get; set; }
{{/isEnum}}{{/vars}}
{{/isEnum}}
{{/vars}}
/// <summary>
/// Initializes a new instance of the <see cref="{{classname}}" /> class.
/// Initializes a new instance of the <see cref="{{classname}}" />class.
/// </summary>
{{#vars}}{{^isReadOnly}} /// <param name="{{name}}">{{#description}}{{description}}{{/description}}{{^description}}{{name}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}.</param>
{{/isReadOnly}}{{/vars}}
{{#vars}}
{{^isReadOnly}}
/// <param name="{{name}}">{{#description}}{{description}}{{/description}}{{^description}}{{name}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}.</param>
{{/isReadOnly}}
{{/vars}}
public {{classname}}({{#vars}}{{^isReadOnly}}{{{datatypeWithEnum}}}{{#isEnum}}?{{/isEnum}} {{name}} = null{{#hasMore}}, {{/hasMore}}{{/isReadOnly}}{{/vars}})
{
{{#vars}}{{^isReadOnly}}{{#required}}// to ensure "{{name}}" is required (not null)
@ -31,7 +43,9 @@
{
this.{{name}} = {{name}};
}
{{/required}}{{/isReadOnly}}{{/vars}}{{#vars}}{{^isReadOnly}}{{^required}}{{#defaultValue}}// use default value if no "{{name}}" provided
{{/required}}{{/isReadOnly}}{{/vars}}
{{#vars}}{{^isReadOnly}}{{^required}}
{{#defaultValue}}// use default value if no "{{name}}" provided
if ({{name}} == null)
{
this.{{name}} = {{{defaultValue}}};
@ -40,18 +54,23 @@
{
this.{{name}} = {{name}};
}
{{/defaultValue}}{{^defaultValue}}this.{{name}} = {{name}};
{{/defaultValue}}{{/required}}{{/isReadOnly}}{{/vars}}
{{/defaultValue}}
{{^defaultValue}}
this.{{name}} = {{name}};
{{/defaultValue}}
{{/required}}{{/isReadOnly}}{{/vars}}
}
{{#vars}}{{^isEnum}}
{{#vars}}
{{^isEnum}}
/// <summary>
/// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}}
/// </summary>{{#description}}
/// <value>{{description}}</value>{{/description}}
[DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})]
public {{{datatype}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }
{{/isEnum}}{{/vars}}
{{/isEnum}}
{{/vars}}
/// <summary>
/// Returns the string presentation of the object
/// </summary>

View File

@ -9,7 +9,7 @@
/// <summary>
/// Enum {{name}} for {{{value}}}
/// </summary>
[EnumMember(Value = {{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}})]
{{name}}{{#isInteger}} = {{{value}}}{{/isInteger}}{{^-last}},
[EnumMember(Value = {{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isFloat}}"{{/isFloat}}{{#isDouble}}"{{/isDouble}}{{{value}}}{{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isFloat}}"{{/isFloat}})]
{{name}}{{#isLong}} = {{{value}}}{{/isLong}}{{#isInteger}} = {{{value}}}{{/isInteger}}{{^-last}},
{{/-last}}{{/enumVars}}{{/allowableValues}}
}

View File

@ -106,7 +106,7 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA
return {{#parent}}parent::getters() + {{/parent}}self::$getters;
}
{{#vars}}{{#isEnum}}{{#allowableValues}}{{#enumVars}}const {{datatypeWithEnum}}_{{{name}}} = "{{{value}}}";
{{#vars}}{{#isEnum}}{{#allowableValues}}{{#enumVars}}const {{datatypeWithEnum}}_{{{name}}} = {{{value}}};
{{/enumVars}}{{/allowableValues}}{{/isEnum}}{{/vars}}
{{#vars}}{{#isEnum}}

View File

@ -899,6 +899,33 @@ definitions:
format: password
maxLength: 64
minLength: 10
EnumClass:
type: string
default: '-efg'
enum:
- _abc
- '-efg'
- (xyz)
Enum_Test:
type: object
properties:
enum_string:
type: string
enum:
- UPPER
- lower
enum_integer:
type: integer
format: int32
enum:
- 1
- -1
enum_number:
type: number
format: double
enum:
- 1.1
- -1.2
externalDocs:
description: Find out more about Swagger
url: 'http://swagger.io'

View File

@ -6,7 +6,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c
- API version: 1.0.0
- SDK version: 1.0.0
- Build date: 2016-05-02T22:02:29.555+08:00
- Build date: 2016-04-27T22:04:12.906+08:00
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen
## Frameworks supported
@ -54,7 +54,7 @@ namespace Example
{
var apiInstance = new FakeApi();
var number = 3.4; // double? | None
var number = number_example; // string | None
var _double = 1.2; // double? | None
var _string = _string_example; // string | None
var _byte = B; // byte[] | None
@ -117,6 +117,8 @@ Class | Method | HTTP request | Description
- [IO.Swagger.Model.Cat](docs/Cat.md)
- [IO.Swagger.Model.Category](docs/Category.md)
- [IO.Swagger.Model.Dog](docs/Dog.md)
- [IO.Swagger.Model.EnumClass](docs/EnumClass.md)
- [IO.Swagger.Model.EnumTest](docs/EnumTest.md)
- [IO.Swagger.Model.FormatTest](docs/FormatTest.md)
- [IO.Swagger.Model.Model200Response](docs/Model200Response.md)
- [IO.Swagger.Model.ModelReturn](docs/ModelReturn.md)

View File

@ -14,7 +14,6 @@ Name | Type | Description | Notes
**Binary** | **byte[]** | | [optional]
**Date** | **DateTime?** | |
**DateTime** | **DateTime?** | | [optional]
**Uuid** | **Guid?** | | [optional]
**Password** | **string** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -5,7 +5,6 @@ using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
@ -18,13 +17,10 @@ namespace IO.Swagger.Model
[DataContract]
public partial class Animal : IEquatable<Animal>
{
/// <summary>
/// Initializes a new instance of the <see cref="Animal" /> class.
/// Initializes a new instance of the <see cref="Animal" />class.
/// </summary>
/// <param name="ClassName">ClassName (required).</param>
public Animal(string ClassName = null)
{
// to ensure "ClassName" is required (not null)
@ -37,15 +33,14 @@ namespace IO.Swagger.Model
this.ClassName = ClassName;
}
}
}
/// <summary>
/// Gets or Sets ClassName
/// </summary>
[DataMember(Name="className", EmitDefaultValue=false)]
public string ClassName { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>

View File

@ -12,47 +12,44 @@ using Newtonsoft.Json.Converters;
namespace IO.Swagger.Model
{
/// <summary>
///
/// ApiResponse
/// </summary>
[DataContract]
public partial class ApiResponse : IEquatable<ApiResponse>
{
/// <summary>
/// Initializes a new instance of the <see cref="ApiResponse" /> class.
/// Initializes a new instance of the <see cref="ApiResponse" />class.
/// </summary>
/// <param name="Code">Code.</param>
/// <param name="Type">Type.</param>
/// <param name="Message">Message.</param>
public ApiResponse(int? Code = null, string Type = null, string Message = null)
{
this.Code = Code;
this.Type = Type;
this.Message = Message;
}
/// <summary>
/// Gets or Sets Code
/// </summary>
[DataMember(Name="code", EmitDefaultValue=false)]
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>
@ -62,8 +59,8 @@ namespace IO.Swagger.Model
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(" Type: ").Append(Type).Append("\n");
sb.Append(" Message: ").Append(Message).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -137,6 +134,6 @@ namespace IO.Swagger.Model
return hash;
}
}
}
}

View File

@ -5,7 +5,6 @@ using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
@ -18,14 +17,11 @@ namespace IO.Swagger.Model
[DataContract]
public partial class Cat : Animal, IEquatable<Cat>
{
/// <summary>
/// Initializes a new instance of the <see cref="Cat" /> class.
/// Initializes a new instance of the <see cref="Cat" />class.
/// </summary>
/// <param name="ClassName">ClassName (required).</param>
/// <param name="Declawed">Declawed.</param>
public Cat(string ClassName = null, bool? Declawed = null)
{
// to ensure "ClassName" is required (not null)
@ -37,23 +33,22 @@ namespace IO.Swagger.Model
{
this.ClassName = ClassName;
}
this.Declawed = Declawed;
}
/// <summary>
/// Gets or Sets ClassName
/// </summary>
[DataMember(Name="className", EmitDefaultValue=false)]
public string ClassName { get; set; }
/// <summary>
/// Gets or Sets Declawed
/// </summary>
[DataMember(Name="declawed", EmitDefaultValue=false)]
public bool? Declawed { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -63,7 +58,7 @@ namespace IO.Swagger.Model
var sb = new StringBuilder();
sb.Append("class Cat {\n");
sb.Append(" ClassName: ").Append(ClassName).Append("\n");
sb.Append(" Declawed: ").Append(Declawed).Append("\n");
sb.Append(" Declawed: ").Append(Declawed).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

View File

@ -5,7 +5,6 @@ using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
@ -18,34 +17,31 @@ namespace IO.Swagger.Model
[DataContract]
public partial class Category : IEquatable<Category>
{
/// <summary>
/// Initializes a new instance of the <see cref="Category" /> class.
/// Initializes a new instance of the <see cref="Category" />class.
/// </summary>
/// <param name="Id">Id.</param>
/// <param name="Name">Name.</param>
public Category(long? Id = null, string Name = null)
{
this.Id = Id;
this.Name = Name;
}
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name="id", EmitDefaultValue=false)]
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>
@ -55,7 +51,7 @@ namespace IO.Swagger.Model
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(" Name: ").Append(Name).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

View File

@ -5,7 +5,6 @@ using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
@ -18,14 +17,11 @@ namespace IO.Swagger.Model
[DataContract]
public partial class Dog : Animal, IEquatable<Dog>
{
/// <summary>
/// Initializes a new instance of the <see cref="Dog" /> class.
/// Initializes a new instance of the <see cref="Dog" />class.
/// </summary>
/// <param name="ClassName">ClassName (required).</param>
/// <param name="Breed">Breed.</param>
public Dog(string ClassName = null, string Breed = null)
{
// to ensure "ClassName" is required (not null)
@ -37,23 +33,22 @@ namespace IO.Swagger.Model
{
this.ClassName = ClassName;
}
this.Breed = Breed;
}
/// <summary>
/// Gets or Sets ClassName
/// </summary>
[DataMember(Name="className", EmitDefaultValue=false)]
public string ClassName { get; set; }
/// <summary>
/// Gets or Sets Breed
/// </summary>
[DataMember(Name="breed", EmitDefaultValue=false)]
public string Breed { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -63,7 +58,7 @@ namespace IO.Swagger.Model
var sb = new StringBuilder();
sb.Append("class Dog {\n");
sb.Append(" ClassName: ").Append(ClassName).Append("\n");
sb.Append(" Breed: ").Append(Breed).Append("\n");
sb.Append(" Breed: ").Append(Breed).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

View File

@ -5,7 +5,6 @@ using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

View File

@ -5,7 +5,6 @@ using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
@ -78,42 +77,39 @@ namespace IO.Swagger.Model
NUMBER_MINUS_1_DOT_2
}
/// <summary>
/// Gets or Sets EnumString
/// </summary>
[DataMember(Name="enum_string", EmitDefaultValue=false)]
public EnumStringEnum? EnumString { get; set; }
/// <summary>
/// Gets or Sets EnumInteger
/// </summary>
[DataMember(Name="enum_integer", EmitDefaultValue=false)]
public EnumIntegerEnum? EnumInteger { get; set; }
/// <summary>
/// Gets or Sets EnumNumber
/// </summary>
[DataMember(Name="enum_number", EmitDefaultValue=false)]
public EnumNumberEnum? EnumNumber { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="EnumTest" /> class.
/// Initializes a new instance of the <see cref="EnumTest" />class.
/// </summary>
/// <param name="EnumString">EnumString.</param>
/// <param name="EnumInteger">EnumInteger.</param>
/// <param name="EnumNumber">EnumNumber.</param>
public EnumTest(EnumStringEnum? EnumString = null, EnumIntegerEnum? EnumInteger = null, EnumNumberEnum? EnumNumber = null)
{
this.EnumString = EnumString;
this.EnumInteger = EnumInteger;
this.EnumNumber = EnumNumber;
}
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -123,9 +119,8 @@ namespace IO.Swagger.Model
var sb = new StringBuilder();
sb.Append("class EnumTest {\n");
sb.Append(" EnumString: ").Append(EnumString).Append("\n");
sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n");
sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n");
sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n");
sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -190,16 +185,12 @@ namespace IO.Swagger.Model
{
int hash = 41;
// Suitable nullity checks etc, of course :)
if (this.EnumString != null)
hash = hash * 59 + this.EnumString.GetHashCode();
if (this.EnumInteger != null)
hash = hash * 59 + this.EnumInteger.GetHashCode();
if (this.EnumNumber != null)
hash = hash * 59 + this.EnumNumber.GetHashCode();
return hash;
}
}

View File

@ -12,15 +12,13 @@ using Newtonsoft.Json.Converters;
namespace IO.Swagger.Model
{
/// <summary>
///
/// FormatTest
/// </summary>
[DataContract]
public partial class FormatTest : IEquatable<FormatTest>
{
/// <summary>
/// Initializes a new instance of the <see cref="FormatTest" /> class.
/// Initializes a new instance of the <see cref="FormatTest" />class.
/// </summary>
/// <param name="Integer">Integer.</param>
/// <param name="Int32">Int32.</param>
@ -33,10 +31,8 @@ namespace IO.Swagger.Model
/// <param name="Binary">Binary.</param>
/// <param name="Date">Date (required).</param>
/// <param name="DateTime">DateTime.</param>
/// <param name="Uuid">Uuid.</param>
/// <param name="Password">Password (required).</param>
public FormatTest(int? Integer = null, int? Int32 = null, long? Int64 = null, double? Number = null, float? _Float = null, double? _Double = null, string _String = null, byte[] _Byte = null, byte[] Binary = null, DateTime? Date = null, DateTime? DateTime = null, Guid? Uuid = null, string Password = null)
public FormatTest(int? Integer = null, int? Int32 = null, long? Int64 = null, double? Number = null, float? _Float = null, double? _Double = null, string _String = null, byte[] _Byte = null, byte[] Binary = null, DateTime? Date = null, DateTime? DateTime = null, string Password = null)
{
// to ensure "Number" is required (not null)
if (Number == null)
@ -74,97 +70,86 @@ namespace IO.Swagger.Model
{
this.Password = Password;
}
this.Integer = Integer;
this.Int32 = Int32;
this.Int64 = Int64;
this._Float = _Float;
this._Double = _Double;
this._String = _String;
this.Binary = Binary;
this.DateTime = DateTime;
this.Uuid = Uuid;
}
/// <summary>
/// Gets or Sets Integer
/// </summary>
[DataMember(Name="integer", EmitDefaultValue=false)]
public int? Integer { get; set; }
/// <summary>
/// Gets or Sets Int32
/// </summary>
[DataMember(Name="int32", EmitDefaultValue=false)]
public int? Int32 { get; set; }
/// <summary>
/// Gets or Sets Int64
/// </summary>
[DataMember(Name="int64", EmitDefaultValue=false)]
public long? Int64 { get; set; }
/// <summary>
/// Gets or Sets Number
/// </summary>
[DataMember(Name="number", EmitDefaultValue=false)]
public double? Number { get; set; }
/// <summary>
/// Gets or Sets _Float
/// </summary>
[DataMember(Name="float", EmitDefaultValue=false)]
public float? _Float { get; set; }
/// <summary>
/// Gets or Sets _Double
/// </summary>
[DataMember(Name="double", EmitDefaultValue=false)]
public double? _Double { get; set; }
/// <summary>
/// Gets or Sets _String
/// </summary>
[DataMember(Name="string", EmitDefaultValue=false)]
public string _String { get; set; }
/// <summary>
/// Gets or Sets _Byte
/// </summary>
[DataMember(Name="byte", EmitDefaultValue=false)]
public byte[] _Byte { get; set; }
/// <summary>
/// Gets or Sets Binary
/// </summary>
[DataMember(Name="binary", EmitDefaultValue=false)]
public byte[] Binary { get; set; }
/// <summary>
/// Gets or Sets Date
/// </summary>
[DataMember(Name="date", EmitDefaultValue=false)]
public DateTime? Date { get; set; }
/// <summary>
/// Gets or Sets DateTime
/// </summary>
[DataMember(Name="dateTime", EmitDefaultValue=false)]
public DateTime? DateTime { get; set; }
/// <summary>
/// Gets or Sets Uuid
/// </summary>
[DataMember(Name="uuid", EmitDefaultValue=false)]
public Guid? Uuid { get; set; }
/// <summary>
/// Gets or Sets Password
/// </summary>
[DataMember(Name="password", EmitDefaultValue=false)]
public string Password { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -174,18 +159,17 @@ namespace IO.Swagger.Model
var sb = new StringBuilder();
sb.Append("class FormatTest {\n");
sb.Append(" Integer: ").Append(Integer).Append("\n");
sb.Append(" Int32: ").Append(Int32).Append("\n");
sb.Append(" Int64: ").Append(Int64).Append("\n");
sb.Append(" Number: ").Append(Number).Append("\n");
sb.Append(" _Float: ").Append(_Float).Append("\n");
sb.Append(" _Double: ").Append(_Double).Append("\n");
sb.Append(" _String: ").Append(_String).Append("\n");
sb.Append(" _Byte: ").Append(_Byte).Append("\n");
sb.Append(" Binary: ").Append(Binary).Append("\n");
sb.Append(" Date: ").Append(Date).Append("\n");
sb.Append(" DateTime: ").Append(DateTime).Append("\n");
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append(" Int32: ").Append(Int32).Append("\n");
sb.Append(" Int64: ").Append(Int64).Append("\n");
sb.Append(" Number: ").Append(Number).Append("\n");
sb.Append(" _Float: ").Append(_Float).Append("\n");
sb.Append(" _Double: ").Append(_Double).Append("\n");
sb.Append(" _String: ").Append(_String).Append("\n");
sb.Append(" _Byte: ").Append(_Byte).Append("\n");
sb.Append(" Binary: ").Append(Binary).Append("\n");
sb.Append(" Date: ").Append(Date).Append("\n");
sb.Append(" DateTime: ").Append(DateTime).Append("\n");
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -277,11 +261,6 @@ namespace IO.Swagger.Model
this.DateTime != null &&
this.DateTime.Equals(other.DateTime)
) &&
(
this.Uuid == other.Uuid ||
this.Uuid != null &&
this.Uuid.Equals(other.Uuid)
) &&
(
this.Password == other.Password ||
this.Password != null &&
@ -322,13 +301,11 @@ namespace IO.Swagger.Model
hash = hash * 59 + this.Date.GetHashCode();
if (this.DateTime != null)
hash = hash * 59 + this.DateTime.GetHashCode();
if (this.Uuid != null)
hash = hash * 59 + this.Uuid.GetHashCode();
if (this.Password != null)
hash = hash * 59 + this.Password.GetHashCode();
return hash;
}
}
}
}

View File

@ -5,7 +5,6 @@ using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
@ -13,31 +12,28 @@ using Newtonsoft.Json.Converters;
namespace IO.Swagger.Model
{
/// <summary>
/// Model200Response
/// Model for testing model name starting with number
/// </summary>
[DataContract]
public partial class Model200Response : IEquatable<Model200Response>
{
/// <summary>
/// Initializes a new instance of the <see cref="Model200Response" /> class.
/// Initializes a new instance of the <see cref="Model200Response" />class.
/// </summary>
/// <param name="Name">Name.</param>
public Model200Response(int? Name = null)
{
this.Name = Name;
}
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name="name", EmitDefaultValue=false)]
public int? Name { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -47,7 +43,6 @@ namespace IO.Swagger.Model
var sb = new StringBuilder();
sb.Append("class Model200Response {\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -102,10 +97,8 @@ namespace IO.Swagger.Model
{
int hash = 41;
// Suitable nullity checks etc, of course :)
if (this.Name != null)
hash = hash * 59 + this.Name.GetHashCode();
return hash;
}
}

View File

@ -5,7 +5,6 @@ using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
@ -13,31 +12,28 @@ using Newtonsoft.Json.Converters;
namespace IO.Swagger.Model
{
/// <summary>
/// ModelReturn
/// Model for testing reserved words
/// </summary>
[DataContract]
public partial class ModelReturn : IEquatable<ModelReturn>
{
/// <summary>
/// Initializes a new instance of the <see cref="ModelReturn" /> class.
/// Initializes a new instance of the <see cref="ModelReturn" />class.
/// </summary>
/// <param name="_Return">_Return.</param>
public ModelReturn(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>
@ -47,7 +43,6 @@ namespace IO.Swagger.Model
var sb = new StringBuilder();
sb.Append("class ModelReturn {\n");
sb.Append(" _Return: ").Append(_Return).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -102,10 +97,8 @@ namespace IO.Swagger.Model
{
int hash = 41;
// Suitable nullity checks etc, of course :)
if (this._Return != null)
hash = hash * 59 + this._Return.GetHashCode();
return hash;
}
}

View File

@ -5,7 +5,6 @@ using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
@ -13,39 +12,48 @@ using Newtonsoft.Json.Converters;
namespace IO.Swagger.Model
{
/// <summary>
/// Name
/// Model for testing model name same as property name
/// </summary>
[DataContract]
public partial class Name : IEquatable<Name>
{
/// <summary>
/// Initializes a new instance of the <see cref="Name" /> class.
/// Initializes a new instance of the <see cref="Name" />class.
/// </summary>
/// <param name="_Name">_Name.</param>
/// <param name="SnakeCase">SnakeCase.</param>
public Name(int? _Name = null, int? SnakeCase = null)
/// <param name="_Name">_Name (required).</param>
/// <param name="Property">Property.</param>
public Name(int? _Name = null, string Property = null)
{
// to ensure "_Name" is required (not null)
if (_Name == null)
{
throw new InvalidDataException("_Name is a required property for Name and cannot be null");
}
else
{
this._Name = _Name;
this.SnakeCase = SnakeCase;
}
this.Property = Property;
}
/// <summary>
/// Gets or Sets _Name
/// </summary>
[DataMember(Name="name", EmitDefaultValue=false)]
public int? _Name { get; set; }
/// <summary>
/// Gets or Sets SnakeCase
/// </summary>
[DataMember(Name="snake_case", EmitDefaultValue=false)]
public int? SnakeCase { get; set; }
public int? SnakeCase { get; private set; }
/// <summary>
/// Gets or Sets Property
/// </summary>
[DataMember(Name="property", EmitDefaultValue=false)]
public string Property { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -55,8 +63,8 @@ namespace IO.Swagger.Model
var sb = new StringBuilder();
sb.Append("class Name {\n");
sb.Append(" _Name: ").Append(_Name).Append("\n");
sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n");
sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n");
sb.Append(" Property: ").Append(Property).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -102,6 +110,11 @@ namespace IO.Swagger.Model
this.SnakeCase == other.SnakeCase ||
this.SnakeCase != null &&
this.SnakeCase.Equals(other.SnakeCase)
) &&
(
this.Property == other.Property ||
this.Property != null &&
this.Property.Equals(other.Property)
);
}
@ -116,13 +129,12 @@ namespace IO.Swagger.Model
{
int hash = 41;
// Suitable nullity checks etc, of course :)
if (this._Name != null)
hash = hash * 59 + this._Name.GetHashCode();
if (this.SnakeCase != null)
hash = hash * 59 + this.SnakeCase.GetHashCode();
if (this.Property != null)
hash = hash * 59 + this.Property.GetHashCode();
return hash;
}
}

View File

@ -5,7 +5,6 @@ using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
@ -45,73 +44,72 @@ namespace IO.Swagger.Model
Delivered
}
/// <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.
/// 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 (default to StatusEnum.Placed).</param>
/// <param name="Complete">Complete.</param>
/// <param name="Status">Order Status.</param>
/// <param name="Complete">Complete (default to false).</param>
public Order(long? Id = null, long? PetId = null, int? Quantity = null, DateTime? ShipDate = null, StatusEnum? Status = null, bool? Complete = null)
{
this.Id = Id;
public Order(long? PetId = null, int? Quantity = null, DateTime? ShipDate = null, StatusEnum? Status = null, bool? Complete = null)
{
this.PetId = PetId;
this.Quantity = Quantity;
this.ShipDate = ShipDate;
// use default value if no "Status" provided
if (Status == null)
this.Status = Status;
// use default value if no "Complete" provided
if (Complete == null)
{
this.Status = StatusEnum.Placed;
this.Complete = false;
}
else
{
this.Status = Status;
}
this.Complete = Complete;
}
}
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name="id", EmitDefaultValue=false)]
public long? Id { get; private set; }
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=false)]
public bool? Complete { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -121,12 +119,11 @@ namespace IO.Swagger.Model
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(" 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();
}
@ -206,25 +203,18 @@ namespace IO.Swagger.Model
{
int hash = 41;
// Suitable nullity checks etc, of course :)
if (this.Id != null)
hash = hash * 59 + this.Id.GetHashCode();
if (this.PetId != null)
hash = hash * 59 + this.PetId.GetHashCode();
if (this.Quantity != null)
hash = hash * 59 + this.Quantity.GetHashCode();
if (this.ShipDate != null)
hash = hash * 59 + this.ShipDate.GetHashCode();
if (this.Status != null)
hash = hash * 59 + this.Status.GetHashCode();
if (this.Complete != null)
hash = hash * 59 + this.Complete.GetHashCode();
return hash;
}
}

View File

@ -5,7 +5,6 @@ using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
@ -45,17 +44,14 @@ namespace IO.Swagger.Model
Sold
}
/// <summary>
/// pet status in the store
/// </summary>
/// <value>pet status in the store</value>
[DataMember(Name="status", EmitDefaultValue=false)]
public StatusEnum? Status { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="Pet" /> class.
/// Initializes a new instance of the <see cref="Pet" />class.
/// </summary>
/// <param name="Id">Id.</param>
/// <param name="Category">Category.</param>
@ -63,7 +59,6 @@ namespace IO.Swagger.Model
/// <param name="PhotoUrls">PhotoUrls (required).</param>
/// <param name="Tags">Tags.</param>
/// <param name="Status">pet status in the store.</param>
public Pet(long? Id = null, Category Category = null, string Name = null, List<string> PhotoUrls = null, List<Tag> Tags = null, StatusEnum? Status = null)
{
// to ensure "Name" is required (not null)
@ -84,44 +79,43 @@ namespace IO.Swagger.Model
{
this.PhotoUrls = PhotoUrls;
}
this.Id = Id;
this.Category = Category;
this.Tags = Tags;
this.Status = Status;
}
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name="id", EmitDefaultValue=false)]
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>
[DataMember(Name="name", EmitDefaultValue=false)]
public string Name { get; set; }
/// <summary>
/// Gets or Sets PhotoUrls
/// </summary>
[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>
/// Returns the string presentation of the object
/// </summary>
@ -131,12 +125,11 @@ namespace IO.Swagger.Model
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(" 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();
}
@ -216,25 +209,18 @@ namespace IO.Swagger.Model
{
int hash = 41;
// Suitable nullity checks etc, of course :)
if (this.Id != null)
hash = hash * 59 + this.Id.GetHashCode();
if (this.Category != null)
hash = hash * 59 + this.Category.GetHashCode();
if (this.Name != null)
hash = hash * 59 + this.Name.GetHashCode();
if (this.PhotoUrls != null)
hash = hash * 59 + this.PhotoUrls.GetHashCode();
if (this.Tags != null)
hash = hash * 59 + this.Tags.GetHashCode();
if (this.Status != null)
hash = hash * 59 + this.Status.GetHashCode();
return hash;
}
}

View File

@ -5,7 +5,6 @@ using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
@ -18,26 +17,23 @@ namespace IO.Swagger.Model
[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>

View File

@ -5,7 +5,6 @@ using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
@ -18,34 +17,31 @@ namespace IO.Swagger.Model
[DataContract]
public partial class Tag : IEquatable<Tag>
{
/// <summary>
/// Initializes a new instance of the <see cref="Tag" /> class.
/// Initializes a new instance of the <see cref="Tag" />class.
/// </summary>
/// <param name="Id">Id.</param>
/// <param name="Name">Name.</param>
public Tag(long? Id = null, string Name = null)
{
this.Id = Id;
this.Name = Name;
}
/// <summary>
/// Gets or Sets Id
/// </summary>
[DataMember(Name="id", EmitDefaultValue=false)]
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>
@ -55,7 +51,7 @@ namespace IO.Swagger.Model
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(" Name: ").Append(Name).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

View File

@ -5,7 +5,6 @@ using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
@ -18,10 +17,8 @@ namespace IO.Swagger.Model
[DataContract]
public partial class User : IEquatable<User>
{
/// <summary>
/// Initializes a new instance of the <see cref="User" /> class.
/// Initializes a new instance of the <see cref="User" />class.
/// </summary>
/// <param name="Id">Id.</param>
/// <param name="Username">Username.</param>
@ -31,70 +28,69 @@ namespace IO.Swagger.Model
/// <param name="Password">Password.</param>
/// <param name="Phone">Phone.</param>
/// <param name="UserStatus">User Status.</param>
public User(long? Id = null, string Username = null, string FirstName = null, string LastName = null, string Email = null, string Password = null, string Phone = null, int? UserStatus = null)
{
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>
@ -104,13 +100,13 @@ namespace IO.Swagger.Model
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(" 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();
}

View File

@ -72,6 +72,8 @@
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\EnumClass.cs" />
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\EnumTest.cs" />
<Compile Include="TestEnum.cs" />
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\ApiResponse.cs" />
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\FormatTest.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>

View File

@ -73,6 +73,9 @@ namespace SwaggerClientTest.TestOrder
}
/*
* Skip the following test as the fake endpiont has been removed from the swagger spec
* We'll uncomment below after we update the Petstore server
/// <summary>
/// Test TestGetInventoryInObject
/// </summary>
@ -93,6 +96,7 @@ namespace SwaggerClientTest.TestOrder
Assert.IsInstanceOf (typeof(int?), Int32.Parse(entry.Value));
}
}
*/
/// <summary>
/// Test Enum

View File

@ -1,9 +0,0 @@
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/.NETFramework,Version=v4.5.AssemblyAttribute.cs
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.swagger-logo.png
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/Newtonsoft.Json.dll
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/nunit.framework.dll
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/RestSharp.dll
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb

View File

@ -1,11 +1,11 @@
# SwaggerClient-php
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
- API version: 1.0.0
- Package version: 1.0.0
- Build date: 2016-04-06T21:53:32.791+08:00
- Build date: 2016-04-27T17:54:12.143+08:00
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
## Requirements
@ -58,16 +58,24 @@ Please follow the [installation procedure](#installation--usage) and then run th
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: petstore_auth
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$api_instance = new Swagger\Client\Api\PetApi();
$body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet object that needs to be added to the store
$api_instance = new Swagger\Client\Api\FakeApi();
$number = "number_example"; // string | None
$double = 1.2; // double | None
$string = "string_example"; // string | None
$byte = "B"; // string | None
$integer = 56; // int | None
$int32 = 56; // int | None
$int64 = 789; // int | None
$float = 3.4; // float | None
$binary = "B"; // string | None
$date = new \DateTime(); // \DateTime | None
$date_time = new \DateTime(); // \DateTime | None
$password = "password_example"; // string | None
try {
$api_instance->addPet($body);
$api_instance->testEndpointParameters($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password);
} catch (Exception $e) {
echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), "\n";
echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), "\n";
}
?>
@ -79,21 +87,17 @@ All URIs are relative to *http://petstore.swagger.io/v2*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters
*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
*PetApi* | [**addPetUsingByteArray**](docs/PetApi.md#addpetusingbytearray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
*PetApi* | [**getPetByIdInObject**](docs/PetApi.md#getpetbyidinobject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by &#39;Find pet by ID&#39;
*PetApi* | [**petPetIdtestingByteArraytrueGet**](docs/PetApi.md#petpetidtestingbytearraytrueget) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by &#39;Find pet by ID&#39;
*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
*StoreApi* | [**findOrdersByStatus**](docs/StoreApi.md#findordersbystatus) | **GET** /store/findByStatus | Finds orders by status
*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
*StoreApi* | [**getInventoryInObject**](docs/StoreApi.md#getinventoryinobject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by &#39;Get inventory&#39;
*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID
*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user
@ -109,12 +113,13 @@ Class | Method | HTTP request | Description
## Documentation For Models
- [Animal](docs/Animal.md)
- [ApiResponse](docs/ApiResponse.md)
- [Cat](docs/Cat.md)
- [Category](docs/Category.md)
- [Dog](docs/Dog.md)
- [EnumClass](docs/EnumClass.md)
- [EnumTest](docs/EnumTest.md)
- [InlineResponse200](docs/InlineResponse200.md)
- [FormatTest](docs/FormatTest.md)
- [Model200Response](docs/Model200Response.md)
- [ModelReturn](docs/ModelReturn.md)
- [Name](docs/Name.md)
@ -128,45 +133,17 @@ Class | Method | HTTP request | Description
## Documentation For Authorization
## test_api_key_header
- **Type**: API key
- **API key parameter name**: test_api_key_header
- **Location**: HTTP header
## api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header
## test_http_basic
- **Type**: HTTP basic authentication
## test_api_client_secret
- **Type**: API key
- **API key parameter name**: x-test_api_client_secret
- **Location**: HTTP header
## test_api_client_id
- **Type**: API key
- **API key parameter name**: x-test_api_client_id
- **Location**: HTTP header
## test_api_key_query
- **Type**: API key
- **API key parameter name**: test_api_key_query
- **Location**: URL query string
## petstore_auth
- **Type**: OAuth
- **Flow**: implicit
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
- **Scopes**:
- **write:pets**: modify pets in your account
- **read:pets**: read your pets

View File

@ -7,8 +7,8 @@ Name | Type | Description | Notes
**pet_id** | **int** | | [optional]
**quantity** | **int** | | [optional]
**ship_date** | [**\DateTime**](\DateTime.md) | | [optional]
**status** | **string** | Order Status | [optional] [default to STATUS_PLACED]
**complete** | **bool** | | [optional]
**status** | **string** | Order Status | [optional]
**complete** | **bool** | | [optional] [default to false]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class Animal implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'Animal';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@ -98,14 +104,12 @@ class Animal implements ArrayAccess
/**
* $class_name
* @var string
*/
protected $class_name;
/**
* Constructor
* @param mixed[] $data Associated array of property value initalizing the model
@ -113,13 +117,16 @@ class Animal implements ArrayAccess
public function __construct(array $data = null)
{
// Initialize discriminator property with the model name.
$discrimintor = array_search('className', self::$attributeMap);
$this->{$discrimintor} = static::$swaggerModelName;
if ($data != null) {
$this->class_name = $data["class_name"];
}
}
/**
* Gets class_name.
* Gets class_name
* @return string
*/
public function getClassName()
@ -128,7 +135,7 @@ class Animal implements ArrayAccess
}
/**
* Sets class_name.
* Sets class_name
* @param string $class_name
* @return $this
*/
@ -138,7 +145,6 @@ class Animal implements ArrayAccess
$this->class_name = $class_name;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
* @param integer $offset Offset
@ -181,17 +187,15 @@ class Animal implements ArrayAccess
}
/**
* Gets the string presentation of the object.
* Gets the string presentation of the object
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} else {
}
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
}
}
}
?>

View File

@ -108,6 +108,10 @@ class ApiResponse implements ArrayAccess
return self::$getters;
}
/**
* $code
* @var int

View File

@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class Cat extends Animal implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'Cat';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@ -98,14 +104,12 @@ class Cat extends Animal implements ArrayAccess
/**
* $declawed
* @var bool
*/
protected $declawed;
/**
* Constructor
* @param mixed[] $data Associated array of property value initalizing the model
@ -113,13 +117,13 @@ class Cat extends Animal implements ArrayAccess
public function __construct(array $data = null)
{
parent::__construct($data);
if ($data != null) {
$this->declawed = $data["declawed"];
}
}
/**
* Gets declawed.
* Gets declawed
* @return bool
*/
public function getDeclawed()
@ -128,7 +132,7 @@ class Cat extends Animal implements ArrayAccess
}
/**
* Sets declawed.
* Sets declawed
* @param bool $declawed
* @return $this
*/
@ -138,7 +142,6 @@ class Cat extends Animal implements ArrayAccess
$this->declawed = $declawed;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
* @param integer $offset Offset
@ -181,17 +184,15 @@ class Cat extends Animal implements ArrayAccess
}
/**
* Gets the string presentation of the object.
* Gets the string presentation of the object
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} else {
}
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
}
}
}
?>

View File

@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class Category implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'Category';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@ -102,20 +108,17 @@ class Category implements ArrayAccess
/**
* $id
* @var int
*/
protected $id;
/**
* $name
* @var string
*/
protected $name;
/**
* Constructor
* @param mixed[] $data Associated array of property value initalizing the model
@ -123,14 +126,14 @@ class Category implements ArrayAccess
public function __construct(array $data = null)
{
if ($data != null) {
$this->id = $data["id"];
$this->name = $data["name"];
}
}
/**
* Gets id.
* Gets id
* @return int
*/
public function getId()
@ -139,7 +142,7 @@ class Category implements ArrayAccess
}
/**
* Sets id.
* Sets id
* @param int $id
* @return $this
*/
@ -149,9 +152,8 @@ class Category implements ArrayAccess
$this->id = $id;
return $this;
}
/**
* Gets name.
* Gets name
* @return string
*/
public function getName()
@ -160,7 +162,7 @@ class Category implements ArrayAccess
}
/**
* Sets name.
* Sets name
* @param string $name
* @return $this
*/
@ -170,7 +172,6 @@ class Category implements ArrayAccess
$this->name = $name;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
* @param integer $offset Offset
@ -213,17 +214,15 @@ class Category implements ArrayAccess
}
/**
* Gets the string presentation of the object.
* Gets the string presentation of the object
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} else {
}
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
}
}
}
?>

View File

@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class Dog extends Animal implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'Dog';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@ -98,14 +104,12 @@ class Dog extends Animal implements ArrayAccess
/**
* $breed
* @var string
*/
protected $breed;
/**
* Constructor
* @param mixed[] $data Associated array of property value initalizing the model
@ -113,13 +117,13 @@ class Dog extends Animal implements ArrayAccess
public function __construct(array $data = null)
{
parent::__construct($data);
if ($data != null) {
$this->breed = $data["breed"];
}
}
/**
* Gets breed.
* Gets breed
* @return string
*/
public function getBreed()
@ -128,7 +132,7 @@ class Dog extends Animal implements ArrayAccess
}
/**
* Sets breed.
* Sets breed
* @param string $breed
* @return $this
*/
@ -138,7 +142,6 @@ class Dog extends Animal implements ArrayAccess
$this->breed = $breed;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
* @param integer $offset Offset
@ -181,17 +184,15 @@ class Dog extends Animal implements ArrayAccess
}
/**
* Gets the string presentation of the object.
* Gets the string presentation of the object
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} else {
}
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
}
}
}
?>

View File

@ -68,7 +68,6 @@ class FormatTest implements ArrayAccess
'binary' => 'string',
'date' => '\DateTime',
'date_time' => '\DateTime',
'uuid' => 'string',
'password' => 'string'
);
@ -92,7 +91,6 @@ class FormatTest implements ArrayAccess
'binary' => 'binary',
'date' => 'date',
'date_time' => 'dateTime',
'uuid' => 'uuid',
'password' => 'password'
);
@ -116,7 +114,6 @@ class FormatTest implements ArrayAccess
'binary' => 'setBinary',
'date' => 'setDate',
'date_time' => 'setDateTime',
'uuid' => 'setUuid',
'password' => 'setPassword'
);
@ -140,7 +137,6 @@ class FormatTest implements ArrayAccess
'binary' => 'getBinary',
'date' => 'getDate',
'date_time' => 'getDateTime',
'uuid' => 'getUuid',
'password' => 'getPassword'
);
@ -148,6 +144,10 @@ class FormatTest implements ArrayAccess
return self::$getters;
}
/**
* $integer
* @var int
@ -203,11 +203,6 @@ class FormatTest implements ArrayAccess
* @var \DateTime
*/
protected $date_time;
/**
* $uuid
* @var string
*/
protected $uuid;
/**
* $password
* @var string
@ -234,7 +229,6 @@ class FormatTest implements ArrayAccess
$this->binary = $data["binary"];
$this->date = $data["date"];
$this->date_time = $data["date_time"];
$this->uuid = $data["uuid"];
$this->password = $data["password"];
}
}
@ -458,26 +452,6 @@ class FormatTest implements ArrayAccess
$this->date_time = $date_time;
return $this;
}
/**
* Gets uuid
* @return string
*/
public function getUuid()
{
return $this->uuid;
}
/**
* Sets uuid
* @param string $uuid
* @return $this
*/
public function setUuid($uuid)
{
$this->uuid = $uuid;
return $this;
}
/**
* Gets password
* @return string

View File

@ -38,7 +38,7 @@ use \ArrayAccess;
* Model200Response Class Doc Comment
*
* @category Class
* @description
* @description Model for testing model name starting with number
* @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class Model200Response implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = '200_response';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@ -98,14 +104,12 @@ class Model200Response implements ArrayAccess
/**
* $name
* @var int
*/
protected $name;
/**
* Constructor
* @param mixed[] $data Associated array of property value initalizing the model
@ -113,13 +117,13 @@ class Model200Response implements ArrayAccess
public function __construct(array $data = null)
{
if ($data != null) {
$this->name = $data["name"];
}
}
/**
* Gets name.
* Gets name
* @return int
*/
public function getName()
@ -128,7 +132,7 @@ class Model200Response implements ArrayAccess
}
/**
* Sets name.
* Sets name
* @param int $name
* @return $this
*/
@ -138,7 +142,6 @@ class Model200Response implements ArrayAccess
$this->name = $name;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
* @param integer $offset Offset
@ -181,17 +184,15 @@ class Model200Response implements ArrayAccess
}
/**
* Gets the string presentation of the object.
* Gets the string presentation of the object
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} else {
}
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
}
}
}
?>

View File

@ -38,7 +38,7 @@ use \ArrayAccess;
* ModelReturn Class Doc Comment
*
* @category Class
* @description
* @description Model for testing reserved words
* @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class ModelReturn implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'Return';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@ -98,14 +104,12 @@ class ModelReturn implements ArrayAccess
/**
* $return
* @var int
*/
protected $return;
/**
* Constructor
* @param mixed[] $data Associated array of property value initalizing the model
@ -113,13 +117,13 @@ class ModelReturn implements ArrayAccess
public function __construct(array $data = null)
{
if ($data != null) {
$this->return = $data["return"];
}
}
/**
* Gets return.
* Gets return
* @return int
*/
public function getReturn()
@ -128,7 +132,7 @@ class ModelReturn implements ArrayAccess
}
/**
* Sets return.
* Sets return
* @param int $return
* @return $this
*/
@ -138,7 +142,6 @@ class ModelReturn implements ArrayAccess
$this->return = $return;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
* @param integer $offset Offset
@ -181,17 +184,15 @@ class ModelReturn implements ArrayAccess
}
/**
* Gets the string presentation of the object.
* Gets the string presentation of the object
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} else {
}
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
}
}
}
?>

View File

@ -38,7 +38,7 @@ use \ArrayAccess;
* Name Class Doc Comment
*
* @category Class
* @description
* @description Model for testing model name same as property name
* @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
@ -46,13 +46,20 @@ use \ArrayAccess;
*/
class Name implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'Name';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
*/
static $swaggerTypes = array(
'name' => 'int',
'snake_case' => 'int'
'snake_case' => 'int',
'property' => 'string'
);
static function swaggerTypes() {
@ -65,7 +72,8 @@ class Name implements ArrayAccess
*/
static $attributeMap = array(
'name' => 'name',
'snake_case' => 'snake_case'
'snake_case' => 'snake_case',
'property' => 'property'
);
static function attributeMap() {
@ -78,7 +86,8 @@ class Name implements ArrayAccess
*/
static $setters = array(
'name' => 'setName',
'snake_case' => 'setSnakeCase'
'snake_case' => 'setSnakeCase',
'property' => 'setProperty'
);
static function setters() {
@ -91,7 +100,8 @@ class Name implements ArrayAccess
*/
static $getters = array(
'name' => 'getName',
'snake_case' => 'getSnakeCase'
'snake_case' => 'getSnakeCase',
'property' => 'getProperty'
);
static function getters() {
@ -102,19 +112,21 @@ class Name implements ArrayAccess
/**
* $name
* @var int
*/
protected $name;
/**
* $snake_case
* @var int
*/
protected $snake_case;
/**
* $property
* @var string
*/
protected $property;
/**
* Constructor
@ -123,14 +135,15 @@ class Name implements ArrayAccess
public function __construct(array $data = null)
{
if ($data != null) {
$this->name = $data["name"];
$this->snake_case = $data["snake_case"];
$this->property = $data["property"];
}
}
/**
* Gets name.
* Gets name
* @return int
*/
public function getName()
@ -139,7 +152,7 @@ class Name implements ArrayAccess
}
/**
* Sets name.
* Sets name
* @param int $name
* @return $this
*/
@ -149,9 +162,8 @@ class Name implements ArrayAccess
$this->name = $name;
return $this;
}
/**
* Gets snake_case.
* Gets snake_case
* @return int
*/
public function getSnakeCase()
@ -160,7 +172,7 @@ class Name implements ArrayAccess
}
/**
* Sets snake_case.
* Sets snake_case
* @param int $snake_case
* @return $this
*/
@ -170,7 +182,26 @@ class Name implements ArrayAccess
$this->snake_case = $snake_case;
return $this;
}
/**
* Gets property
* @return string
*/
public function getProperty()
{
return $this->property;
}
/**
* Sets property
* @param string $property
* @return $this
*/
public function setProperty($property)
{
$this->property = $property;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
* @param integer $offset Offset
@ -213,17 +244,15 @@ class Name implements ArrayAccess
}
/**
* Gets the string presentation of the object.
* Gets the string presentation of the object
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} else {
}
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
}
}
}
?>

View File

@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class Order implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'Order';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@ -133,43 +139,36 @@ class Order implements ArrayAccess
}
/**
* $id
* @var int
*/
protected $id;
/**
* $pet_id
* @var int
*/
protected $pet_id;
/**
* $quantity
* @var int
*/
protected $quantity;
/**
* $ship_date
* @var \DateTime
*/
protected $ship_date;
/**
* $status Order Status
* @var string
*/
protected $status = STATUS_PLACED;
protected $status;
/**
* $complete
* @var bool
*/
protected $complete;
protected $complete = false;
/**
* Constructor
@ -178,6 +177,7 @@ class Order implements ArrayAccess
public function __construct(array $data = null)
{
if ($data != null) {
$this->id = $data["id"];
$this->pet_id = $data["pet_id"];
@ -187,9 +187,8 @@ class Order implements ArrayAccess
$this->complete = $data["complete"];
}
}
/**
* Gets id.
* Gets id
* @return int
*/
public function getId()
@ -198,7 +197,7 @@ class Order implements ArrayAccess
}
/**
* Sets id.
* Sets id
* @param int $id
* @return $this
*/
@ -208,9 +207,8 @@ class Order implements ArrayAccess
$this->id = $id;
return $this;
}
/**
* Gets pet_id.
* Gets pet_id
* @return int
*/
public function getPetId()
@ -219,7 +217,7 @@ class Order implements ArrayAccess
}
/**
* Sets pet_id.
* Sets pet_id
* @param int $pet_id
* @return $this
*/
@ -229,9 +227,8 @@ class Order implements ArrayAccess
$this->pet_id = $pet_id;
return $this;
}
/**
* Gets quantity.
* Gets quantity
* @return int
*/
public function getQuantity()
@ -240,7 +237,7 @@ class Order implements ArrayAccess
}
/**
* Sets quantity.
* Sets quantity
* @param int $quantity
* @return $this
*/
@ -250,9 +247,8 @@ class Order implements ArrayAccess
$this->quantity = $quantity;
return $this;
}
/**
* Gets ship_date.
* Gets ship_date
* @return \DateTime
*/
public function getShipDate()
@ -261,7 +257,7 @@ class Order implements ArrayAccess
}
/**
* Sets ship_date.
* Sets ship_date
* @param \DateTime $ship_date
* @return $this
*/
@ -271,9 +267,8 @@ class Order implements ArrayAccess
$this->ship_date = $ship_date;
return $this;
}
/**
* Gets status.
* Gets status
* @return string
*/
public function getStatus()
@ -282,7 +277,7 @@ class Order implements ArrayAccess
}
/**
* Sets status.
* Sets status
* @param string $status Order Status
* @return $this
*/
@ -295,9 +290,8 @@ class Order implements ArrayAccess
$this->status = $status;
return $this;
}
/**
* Gets complete.
* Gets complete
* @return bool
*/
public function getComplete()
@ -306,7 +300,7 @@ class Order implements ArrayAccess
}
/**
* Sets complete.
* Sets complete
* @param bool $complete
* @return $this
*/
@ -316,7 +310,6 @@ class Order implements ArrayAccess
$this->complete = $complete;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
* @param integer $offset Offset
@ -359,17 +352,15 @@ class Order implements ArrayAccess
}
/**
* Gets the string presentation of the object.
* Gets the string presentation of the object
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} else {
}
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
}
}
}
?>

View File

@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class Pet implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'Pet';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@ -133,44 +139,37 @@ class Pet implements ArrayAccess
}
/**
* $id
* @var int
*/
protected $id;
/**
* $category
* @var \Swagger\Client\Model\Category
*/
protected $category;
/**
* $name
* @var string
*/
protected $name;
/**
* $photo_urls
* @var string[]
*/
protected $photo_urls;
/**
* $tags
* @var \Swagger\Client\Model\Tag[]
*/
protected $tags;
/**
* $status pet status in the store
* @var string
*/
protected $status;
/**
* Constructor
* @param mixed[] $data Associated array of property value initalizing the model
@ -178,6 +177,7 @@ class Pet implements ArrayAccess
public function __construct(array $data = null)
{
if ($data != null) {
$this->id = $data["id"];
$this->category = $data["category"];
@ -187,9 +187,8 @@ class Pet implements ArrayAccess
$this->status = $data["status"];
}
}
/**
* Gets id.
* Gets id
* @return int
*/
public function getId()
@ -198,7 +197,7 @@ class Pet implements ArrayAccess
}
/**
* Sets id.
* Sets id
* @param int $id
* @return $this
*/
@ -208,9 +207,8 @@ class Pet implements ArrayAccess
$this->id = $id;
return $this;
}
/**
* Gets category.
* Gets category
* @return \Swagger\Client\Model\Category
*/
public function getCategory()
@ -219,7 +217,7 @@ class Pet implements ArrayAccess
}
/**
* Sets category.
* Sets category
* @param \Swagger\Client\Model\Category $category
* @return $this
*/
@ -229,9 +227,8 @@ class Pet implements ArrayAccess
$this->category = $category;
return $this;
}
/**
* Gets name.
* Gets name
* @return string
*/
public function getName()
@ -240,7 +237,7 @@ class Pet implements ArrayAccess
}
/**
* Sets name.
* Sets name
* @param string $name
* @return $this
*/
@ -250,9 +247,8 @@ class Pet implements ArrayAccess
$this->name = $name;
return $this;
}
/**
* Gets photo_urls.
* Gets photo_urls
* @return string[]
*/
public function getPhotoUrls()
@ -261,7 +257,7 @@ class Pet implements ArrayAccess
}
/**
* Sets photo_urls.
* Sets photo_urls
* @param string[] $photo_urls
* @return $this
*/
@ -271,9 +267,8 @@ class Pet implements ArrayAccess
$this->photo_urls = $photo_urls;
return $this;
}
/**
* Gets tags.
* Gets tags
* @return \Swagger\Client\Model\Tag[]
*/
public function getTags()
@ -282,7 +277,7 @@ class Pet implements ArrayAccess
}
/**
* Sets tags.
* Sets tags
* @param \Swagger\Client\Model\Tag[] $tags
* @return $this
*/
@ -292,9 +287,8 @@ class Pet implements ArrayAccess
$this->tags = $tags;
return $this;
}
/**
* Gets status.
* Gets status
* @return string
*/
public function getStatus()
@ -303,7 +297,7 @@ class Pet implements ArrayAccess
}
/**
* Sets status.
* Sets status
* @param string $status pet status in the store
* @return $this
*/
@ -316,7 +310,6 @@ class Pet implements ArrayAccess
$this->status = $status;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
* @param integer $offset Offset
@ -359,17 +352,15 @@ class Pet implements ArrayAccess
}
/**
* Gets the string presentation of the object.
* Gets the string presentation of the object
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} else {
}
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
}
}
}
?>

View File

@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class SpecialModelName implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = '$special[model.name]';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@ -98,14 +104,12 @@ class SpecialModelName implements ArrayAccess
/**
* $special_property_name
* @var int
*/
protected $special_property_name;
/**
* Constructor
* @param mixed[] $data Associated array of property value initalizing the model
@ -113,13 +117,13 @@ class SpecialModelName implements ArrayAccess
public function __construct(array $data = null)
{
if ($data != null) {
$this->special_property_name = $data["special_property_name"];
}
}
/**
* Gets special_property_name.
* Gets special_property_name
* @return int
*/
public function getSpecialPropertyName()
@ -128,7 +132,7 @@ class SpecialModelName implements ArrayAccess
}
/**
* Sets special_property_name.
* Sets special_property_name
* @param int $special_property_name
* @return $this
*/
@ -138,7 +142,6 @@ class SpecialModelName implements ArrayAccess
$this->special_property_name = $special_property_name;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
* @param integer $offset Offset
@ -181,17 +184,15 @@ class SpecialModelName implements ArrayAccess
}
/**
* Gets the string presentation of the object.
* Gets the string presentation of the object
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} else {
}
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
}
}
}
?>

View File

@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class Tag implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'Tag';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@ -102,20 +108,17 @@ class Tag implements ArrayAccess
/**
* $id
* @var int
*/
protected $id;
/**
* $name
* @var string
*/
protected $name;
/**
* Constructor
* @param mixed[] $data Associated array of property value initalizing the model
@ -123,14 +126,14 @@ class Tag implements ArrayAccess
public function __construct(array $data = null)
{
if ($data != null) {
$this->id = $data["id"];
$this->name = $data["name"];
}
}
/**
* Gets id.
* Gets id
* @return int
*/
public function getId()
@ -139,7 +142,7 @@ class Tag implements ArrayAccess
}
/**
* Sets id.
* Sets id
* @param int $id
* @return $this
*/
@ -149,9 +152,8 @@ class Tag implements ArrayAccess
$this->id = $id;
return $this;
}
/**
* Gets name.
* Gets name
* @return string
*/
public function getName()
@ -160,7 +162,7 @@ class Tag implements ArrayAccess
}
/**
* Sets name.
* Sets name
* @param string $name
* @return $this
*/
@ -170,7 +172,6 @@ class Tag implements ArrayAccess
$this->name = $name;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
* @param integer $offset Offset
@ -213,17 +214,15 @@ class Tag implements ArrayAccess
}
/**
* Gets the string presentation of the object.
* Gets the string presentation of the object
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} else {
}
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
}
}
}
?>

View File

@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class User implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'User';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@ -126,56 +132,47 @@ class User implements ArrayAccess
/**
* $id
* @var int
*/
protected $id;
/**
* $username
* @var string
*/
protected $username;
/**
* $first_name
* @var string
*/
protected $first_name;
/**
* $last_name
* @var string
*/
protected $last_name;
/**
* $email
* @var string
*/
protected $email;
/**
* $password
* @var string
*/
protected $password;
/**
* $phone
* @var string
*/
protected $phone;
/**
* $user_status User Status
* @var int
*/
protected $user_status;
/**
* Constructor
* @param mixed[] $data Associated array of property value initalizing the model
@ -183,6 +180,7 @@ class User implements ArrayAccess
public function __construct(array $data = null)
{
if ($data != null) {
$this->id = $data["id"];
$this->username = $data["username"];
@ -194,9 +192,8 @@ class User implements ArrayAccess
$this->user_status = $data["user_status"];
}
}
/**
* Gets id.
* Gets id
* @return int
*/
public function getId()
@ -205,7 +202,7 @@ class User implements ArrayAccess
}
/**
* Sets id.
* Sets id
* @param int $id
* @return $this
*/
@ -215,9 +212,8 @@ class User implements ArrayAccess
$this->id = $id;
return $this;
}
/**
* Gets username.
* Gets username
* @return string
*/
public function getUsername()
@ -226,7 +222,7 @@ class User implements ArrayAccess
}
/**
* Sets username.
* Sets username
* @param string $username
* @return $this
*/
@ -236,9 +232,8 @@ class User implements ArrayAccess
$this->username = $username;
return $this;
}
/**
* Gets first_name.
* Gets first_name
* @return string
*/
public function getFirstName()
@ -247,7 +242,7 @@ class User implements ArrayAccess
}
/**
* Sets first_name.
* Sets first_name
* @param string $first_name
* @return $this
*/
@ -257,9 +252,8 @@ class User implements ArrayAccess
$this->first_name = $first_name;
return $this;
}
/**
* Gets last_name.
* Gets last_name
* @return string
*/
public function getLastName()
@ -268,7 +262,7 @@ class User implements ArrayAccess
}
/**
* Sets last_name.
* Sets last_name
* @param string $last_name
* @return $this
*/
@ -278,9 +272,8 @@ class User implements ArrayAccess
$this->last_name = $last_name;
return $this;
}
/**
* Gets email.
* Gets email
* @return string
*/
public function getEmail()
@ -289,7 +282,7 @@ class User implements ArrayAccess
}
/**
* Sets email.
* Sets email
* @param string $email
* @return $this
*/
@ -299,9 +292,8 @@ class User implements ArrayAccess
$this->email = $email;
return $this;
}
/**
* Gets password.
* Gets password
* @return string
*/
public function getPassword()
@ -310,7 +302,7 @@ class User implements ArrayAccess
}
/**
* Sets password.
* Sets password
* @param string $password
* @return $this
*/
@ -320,9 +312,8 @@ class User implements ArrayAccess
$this->password = $password;
return $this;
}
/**
* Gets phone.
* Gets phone
* @return string
*/
public function getPhone()
@ -331,7 +322,7 @@ class User implements ArrayAccess
}
/**
* Sets phone.
* Sets phone
* @param string $phone
* @return $this
*/
@ -341,9 +332,8 @@ class User implements ArrayAccess
$this->phone = $phone;
return $this;
}
/**
* Gets user_status.
* Gets user_status
* @return int
*/
public function getUserStatus()
@ -352,7 +342,7 @@ class User implements ArrayAccess
}
/**
* Sets user_status.
* Sets user_status
* @param int $user_status User Status
* @return $this
*/
@ -362,7 +352,6 @@ class User implements ArrayAccess
$this->user_status = $user_status;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
* @param integer $offset Offset
@ -405,17 +394,15 @@ class User implements ArrayAccess
}
/**
* Gets the string presentation of the object.
* Gets the string presentation of the object
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} else {
}
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
}
}
}
?>