add enum support to php, refactor post process model enum

This commit is contained in:
wing328 2016-04-02 19:03:32 +08:00
parent f2d180f9a8
commit 800a858acb
47 changed files with 1480 additions and 663 deletions

View File

@ -133,6 +133,99 @@ public class DefaultCodegen {
return objs; return objs;
} }
/**
* post process enum defined in model's properties
*
* @param objs Map of models
* @return maps of models with better enum support
*/
public Map<String, Object> postProcessModelsEnum(Map<String, Object> objs) {
List<Object> models = (List<Object>) objs.get("models");
for (Object _mo : models) {
Map<String, Object> mo = (Map<String, Object>) _mo;
CodegenModel cm = (CodegenModel) mo.get("model");
for (CodegenProperty var : cm.vars) {
Map<String, Object> allowableValues = var.allowableValues;
// handle ArrayProperty
if (var.items != null) {
allowableValues = var.items.allowableValues;
}
if (allowableValues == null) {
continue;
}
List<String> values = (List<String>) allowableValues.get("values");
if (values == null) {
continue;
}
// put "enumVars" map into `allowableValues", including `name` and `value`
List<Map<String, String>> enumVars = new ArrayList<Map<String, String>>();
String commonPrefix = findCommonPrefixOfVars(values);
int truncateIdx = commonPrefix.length();
for (String value : values) {
Map<String, String> enumVar = new HashMap<String, String>();
String enumName;
if (truncateIdx == 0) {
enumName = value;
} else {
enumName = value.substring(truncateIdx);
if ("".equals(enumName)) {
enumName = value;
}
}
enumVar.put("name", toEnumVarName(enumName));
enumVar.put("value", value);
enumVars.add(enumVar);
}
allowableValues.put("enumVars", enumVars);
// handle default value for enum, e.g. available => StatusEnum.AVAILABLE
if (var.defaultValue != null) {
String enumName = null;
for (Map<String, String> enumVar : enumVars) {
if (var.defaultValue.equals(enumVar.get("value"))) {
enumName = enumVar.get("name");
break;
}
}
if (enumName != null) {
var.defaultValue = var.datatypeWithEnum + "." + enumName;
}
}
}
}
return objs;
}
/**
* Returns the common prefix of variables for enum naming
*
* @param vars List of variable names
* @return the common prefix for naming
*/
public String findCommonPrefixOfVars(List<String> vars) {
String prefix = StringUtils.getCommonPrefix(vars.toArray(new String[vars.size()]));
// exclude trailing characters that should be part of a valid variable
// e.g. ["status-on", "status-off"] => "status-" (not "status-o")
return prefix.replaceAll("[a-zA-Z0-9]+\\z", "");
}
/**
* Return the sanitized variable name for enum
*
* @param value enum variable name
* @return the sanitized variable name for enum
*/
public String toEnumVarName(String value) {
String var = value.replaceAll("\\W+", "_").toUpperCase();
if (var.matches("\\d.*")) {
return "_" + var;
} else {
return var;
}
}
// override with any special post-processing // override with any special post-processing
@SuppressWarnings("static-method") @SuppressWarnings("static-method")

View File

@ -436,14 +436,16 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
return codegenModel; return codegenModel;
} }
private String findCommonPrefixOfVars(List<String> vars) { @Override
public String findCommonPrefixOfVars(List<String> vars) {
String prefix = StringUtils.getCommonPrefix(vars.toArray(new String[vars.size()])); String prefix = StringUtils.getCommonPrefix(vars.toArray(new String[vars.size()]));
// exclude trailing characters that should be part of a valid variable // exclude trailing characters that should be part of a valid variable
// e.g. ["status-on", "status-off"] => "status-" (not "status-o") // e.g. ["status-on", "status-off"] => "status-" (not "status-o")
return prefix.replaceAll("[a-zA-Z0-9]+\\z", ""); return prefix.replaceAll("[a-zA-Z0-9]+\\z", "");
} }
private String toEnumVarName(String value) { @Override
public String toEnumVarName(String value) {
String var = value.replaceAll("_", " "); String var = value.replaceAll("_", " ");
var = WordUtils.capitalizeFully(var); var = WordUtils.capitalizeFully(var);
var = var.replaceAll("\\W+", ""); var = var.replaceAll("\\W+", "");

View File

@ -697,63 +697,7 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig {
@Override @Override
public Map<String, Object> postProcessModels(Map<String, Object> objs) { public Map<String, Object> postProcessModels(Map<String, Object> objs) {
List<Object> models = (List<Object>) objs.get("models"); return postProcessModelsEnum(objs);
for (Object _mo : models) {
Map<String, Object> mo = (Map<String, Object>) _mo;
CodegenModel cm = (CodegenModel) mo.get("model");
for (CodegenProperty var : cm.vars) {
Map<String, Object> allowableValues = var.allowableValues;
// handle ArrayProperty
if (var.items != null) {
allowableValues = var.items.allowableValues;
}
if (allowableValues == null) {
continue;
}
List<String> values = (List<String>) allowableValues.get("values");
if (values == null) {
continue;
}
// put "enumVars" map into `allowableValues", including `name` and `value`
List<Map<String, String>> enumVars = new ArrayList<Map<String, String>>();
String commonPrefix = findCommonPrefixOfVars(values);
int truncateIdx = commonPrefix.length();
for (String value : values) {
Map<String, String> enumVar = new HashMap<String, String>();
String enumName;
if (truncateIdx == 0) {
enumName = value;
} else {
enumName = value.substring(truncateIdx);
if ("".equals(enumName)) {
enumName = value;
}
}
enumVar.put("name", toEnumVarName(enumName));
enumVar.put("value", value);
enumVars.add(enumVar);
}
allowableValues.put("enumVars", enumVars);
// handle default value for enum, e.g. available => StatusEnum.AVAILABLE
if (var.defaultValue != null) {
String enumName = null;
for (Map<String, String> enumVar : enumVars) {
if (var.defaultValue.equals(enumVar.get("value"))) {
enumName = enumVar.get("name");
break;
}
}
if (enumName != null) {
var.defaultValue = var.datatypeWithEnum + "." + enumName;
}
}
}
}
return objs;
} }
@Override @Override
@ -850,14 +794,16 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig {
return super.needToImport(type) && type.indexOf(".") < 0; return super.needToImport(type) && type.indexOf(".") < 0;
} }
private static String findCommonPrefixOfVars(List<String> vars) { @Override
public String findCommonPrefixOfVars(List<String> vars) {
String prefix = StringUtils.getCommonPrefix(vars.toArray(new String[vars.size()])); String prefix = StringUtils.getCommonPrefix(vars.toArray(new String[vars.size()]));
// exclude trailing characters that should be part of a valid variable // exclude trailing characters that should be part of a valid variable
// e.g. ["status-on", "status-off"] => "status-" (not "status-o") // e.g. ["status-on", "status-off"] => "status-" (not "status-o")
return prefix.replaceAll("[a-zA-Z0-9]+\\z", ""); return prefix.replaceAll("[a-zA-Z0-9]+\\z", "");
} }
private static String toEnumVarName(String value) { @Override
public String toEnumVarName(String value) {
String var = value.replaceAll("\\W+", "_").toUpperCase(); String var = value.replaceAll("\\W+", "_").toUpperCase();
if (var.matches("\\d.*")) { if (var.matches("\\d.*")) {
return "_" + var; return "_" + var;

View File

@ -930,14 +930,16 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
&& !languageSpecificPrimitives.contains(type); && !languageSpecificPrimitives.contains(type);
} }
private static String findCommonPrefixOfVars(List<String> vars) { @Override
public String findCommonPrefixOfVars(List<String> vars) {
String prefix = StringUtils.getCommonPrefix(vars.toArray(new String[vars.size()])); String prefix = StringUtils.getCommonPrefix(vars.toArray(new String[vars.size()]));
// exclude trailing characters that should be part of a valid variable // exclude trailing characters that should be part of a valid variable
// e.g. ["status-on", "status-off"] => "status-" (not "status-o") // e.g. ["status-on", "status-off"] => "status-" (not "status-o")
return prefix.replaceAll("[a-zA-Z0-9]+\\z", ""); return prefix.replaceAll("[a-zA-Z0-9]+\\z", "");
} }
private static String toEnumVarName(String value) { @Override
public String toEnumVarName(String value) {
String var = value.replaceAll("\\W+", "_").toUpperCase(); String var = value.replaceAll("\\W+", "_").toUpperCase();
if (var.matches("\\d.*")) { if (var.matches("\\d.*")) {
return "_" + var; return "_" + var;

View File

@ -4,6 +4,7 @@ import io.swagger.codegen.CliOption;
import io.swagger.codegen.CodegenConfig; import io.swagger.codegen.CodegenConfig;
import io.swagger.codegen.CodegenConstants; import io.swagger.codegen.CodegenConstants;
import io.swagger.codegen.CodegenParameter; import io.swagger.codegen.CodegenParameter;
import io.swagger.codegen.CodegenProperty;
import io.swagger.codegen.CodegenType; import io.swagger.codegen.CodegenType;
import io.swagger.codegen.DefaultCodegen; import io.swagger.codegen.DefaultCodegen;
import io.swagger.codegen.SupportingFile; import io.swagger.codegen.SupportingFile;
@ -12,6 +13,7 @@ import io.swagger.models.properties.*;
import java.io.File; import java.io.File;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map;
import java.util.HashSet; import java.util.HashSet;
import java.util.regex.Matcher; import java.util.regex.Matcher;
@ -567,4 +569,14 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
p.example = example; p.example = example;
} }
@Override
public String toEnumName(CodegenProperty property) {
LOGGER.info("php toEnumName:" + underscore(property.name).toUpperCase());
return underscore(property.name).toUpperCase();
}
@Override
public Map<String, Object> postProcessModels(Map<String, Object> objs) {
return postProcessModelsEnum(objs);
}
} }

View File

@ -69,7 +69,7 @@ class ApiClient
* Constructor of the class * Constructor of the class
* @param Configuration $config config for this ApiClient * @param Configuration $config config for this ApiClient
*/ */
public function __construct(Configuration $config = null) public function __construct(\{{invokerPackage}}\Configuration $config = null)
{ {
if ($config == null) { if ($config == null) {
$config = Configuration::getDefaultConfiguration(); $config = Configuration::getDefaultConfiguration();

View File

@ -60,7 +60,7 @@ use \{{invokerPackage}}\ObjectSerializer;
* Constructor * Constructor
* @param \{{invokerPackage}}\ApiClient|null $apiClient The api client to use * @param \{{invokerPackage}}\ApiClient|null $apiClient The api client to use
*/ */
function __construct($apiClient = null) function __construct(\{{invokerPackage}}\ApiClient $apiClient = null)
{ {
if ($apiClient == null) { if ($apiClient == null) {
$apiClient = new ApiClient(); $apiClient = new ApiClient();
@ -84,7 +84,7 @@ use \{{invokerPackage}}\ObjectSerializer;
* @param \{{invokerPackage}}\ApiClient $apiClient set the API client * @param \{{invokerPackage}}\ApiClient $apiClient set the API client
* @return {{classname}} * @return {{classname}}
*/ */
public function setApiClient(ApiClient $apiClient) public function setApiClient(\{{invokerPackage}}\ApiClient $apiClient)
{ {
$this->apiClient = $apiClient; $this->apiClient = $apiClient;
return $this; return $this;

View File

@ -106,6 +106,22 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA
return {{#parent}}parent::getters() + {{/parent}}self::$getters; return {{#parent}}parent::getters() + {{/parent}}self::$getters;
} }
{{#vars}}{{#isEnum}}{{#allowableValues}}{{#enumVars}}const {{datatypeWithEnum}}_{{{name}}} = "{{{value}}}";
{{/enumVars}}{{/allowableValues}}{{/isEnum}}{{/vars}}
{{#isEnum}}
/**
* Gets allowable values of the enum
* @return string[]
*/
public function {{getter}}AllowableValues() {
return [
{{#allowableValues}}{{#values}}self::{{datatypeWithEnum}}_{{{this}}},{{^-last}}
{{/-last}}{{/values}}{{/allowableValues}}
];
}
{{/isEnum}}
{{#vars}} {{#vars}}
/** /**
* ${{name}} {{#description}}{{{description}}}{{/description}} * ${{name}} {{#description}}{{{description}}}{{/description}}

View File

@ -4,9 +4,9 @@
"description": "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", "description": "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",
"version": "1.0.0", "version": "1.0.0",
"title": "Swagger Petstore", "title": "Swagger Petstore",
"termsOfService": "http://helloreverb.com/terms/", "termsOfService": "http://swagger.io/terms/",
"contact": { "contact": {
"email": "apiteam@wordnik.com" "email": "apiteam@swagger.io"
}, },
"license": { "license": {
"name": "Apache 2.0", "name": "Apache 2.0",
@ -19,6 +19,49 @@
"http" "http"
], ],
"paths": { "paths": {
"/pet?testing_byte_array=true": {
"post": {
"tags": [
"pet"
],
"summary": "Fake endpoint to test byte array in body parameter for adding a new pet to the store",
"description": "",
"operationId": "addPetUsingByteArray",
"consumes": [
"application/json",
"application/xml"
],
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"in": "body",
"name": "body",
"description": "Pet object in the form of byte array",
"required": false,
"schema": {
"type": "string",
"format": "binary"
}
}
],
"responses": {
"405": {
"description": "Invalid input"
}
},
"security": [
{
"petstore_auth": [
"write:pets",
"read:pets"
]
}
]
}
},
"/pet": { "/pet": {
"post": { "post": {
"tags": [ "tags": [
@ -113,7 +156,7 @@
"pet" "pet"
], ],
"summary": "Finds Pets by status", "summary": "Finds Pets by status",
"description": "Multiple status values can be provided with comma seperated strings", "description": "Multiple status values can be provided with comma separated strings",
"operationId": "findPetsByStatus", "operationId": "findPetsByStatus",
"produces": [ "produces": [
"application/json", "application/json",
@ -123,14 +166,23 @@
{ {
"name": "status", "name": "status",
"in": "query", "in": "query",
"description": "Status values that need to be considered for filter", "description": "Status values that need to be considered for query",
"required": false, "required": false,
"type": "array", "type": "array",
"items": { "items": {
"type": "string", "type": "string",
"enum": ["available", "pending", "sold"] "enum": [
"available",
"pending",
"sold"
]
}, },
"collectionFormat": "multi", "collectionFormat": "multi",
"enum": [
"available",
"pending",
"sold"
],
"default": "available" "default": "available"
} }
], ],
@ -142,15 +194,6 @@
"items": { "items": {
"$ref": "#/definitions/Pet" "$ref": "#/definitions/Pet"
} }
},
"examples": {
"application/json": {
"name": "Puma",
"type": "Dog",
"color": "Black",
"gender": "Female",
"breed": "Mixed"
}
} }
}, },
"400": { "400": {
@ -216,6 +259,150 @@
] ]
} }
}, },
"/pet/{petId}?testing_byte_array=true": {
"get": {
"tags": [
"pet"
],
"summary": "Fake endpoint to test byte array return by 'Find pet by ID'",
"description": "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions",
"operationId": "",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"name": "petId",
"in": "path",
"description": "ID of pet that needs to be fetched",
"required": true,
"type": "integer",
"format": "int64"
}
],
"responses": {
"404": {
"description": "Pet not found"
},
"200": {
"description": "successful operation",
"schema": {
"type": "string",
"format": "binary"
}
},
"400": {
"description": "Invalid ID supplied"
}
},
"security": [
{
"api_key": []
},
{
"petstore_auth": [
"write:pets",
"read:pets"
]
}
]
}
},
"/pet/{petId}?response=inline_arbitrary_object": {
"get": {
"tags": [
"pet"
],
"summary": "Fake endpoint to test inline arbitrary object return by 'Find pet by ID'",
"description": "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions",
"operationId": "getPetByIdInObject",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"name": "petId",
"in": "path",
"description": "ID of pet that needs to be fetched",
"required": true,
"type": "integer",
"format": "int64"
}
],
"responses": {
"404": {
"description": "Pet not found"
},
"200": {
"description": "successful operation",
"schema": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"category": {
"type": "object"
},
"name": {
"type": "string",
"example": "doggie"
},
"photoUrls": {
"type": "array",
"xml": {
"name": "photoUrl",
"wrapped": true
},
"items": {
"type": "string"
}
},
"tags": {
"type": "array",
"xml": {
"name": "tag",
"wrapped": true
},
"items": {
"$ref": "#/definitions/Tag"
}
},
"status": {
"type": "string",
"description": "pet status in the store",
"enum": [
"available",
"pending",
"sold"
]
}
}
}
},
"400": {
"description": "Invalid ID supplied"
}
},
"security": [
{
"api_key": []
},
{
"petstore_auth": [
"write:pets",
"read:pets"
]
}
]
}
},
"/pet/{petId}": { "/pet/{petId}": {
"get": { "get": {
"tags": [ "tags": [
@ -443,6 +630,33 @@
] ]
} }
}, },
"/store/inventory?response=arbitrary_object": {
"get": {
"tags": [
"store"
],
"summary": "Fake endpoint to test arbitrary object return by 'Get inventory'",
"description": "Returns an arbitrary object which is actually a map of status codes to quantities",
"operationId": "getInventoryInObject",
"produces": [
"application/json",
"application/xml"
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"type": "object"
}
}
},
"security": [
{
"api_key": []
}
]
}
},
"/store/order": { "/store/order": {
"post": { "post": {
"tags": [ "tags": [
@ -476,7 +690,62 @@
"400": { "400": {
"description": "Invalid Order" "description": "Invalid Order"
} }
},
"security": [
{
"test_api_client_id": [],
"test_api_client_secret": []
} }
]
}
},
"/store/findByStatus": {
"get": {
"tags": [
"store"
],
"summary": "Finds orders by status",
"description": "A single status value can be provided as a string",
"operationId": "findOrdersByStatus",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"name": "status",
"in": "query",
"description": "Status value that needs to be considered for query",
"required": false,
"type": "string",
"enum": [
"placed",
"approved",
"delivered"
],
"default": "placed"
}
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Order"
}
}
},
"400": {
"description": "Invalid status value"
}
},
"security": [
{
"test_api_client_id": [],
"test_api_client_secret": []
}
]
} }
}, },
"/store/order/{orderId}": { "/store/order/{orderId}": {
@ -513,7 +782,15 @@
"400": { "400": {
"description": "Invalid ID supplied" "description": "Invalid ID supplied"
} }
},
"security": [
{
"test_api_key_header": []
},
{
"test_api_key_query": []
} }
]
}, },
"delete": { "delete": {
"tags": [ "tags": [
@ -730,6 +1007,18 @@
"description": "successful operation", "description": "successful operation",
"schema": { "schema": {
"$ref": "#/definitions/User" "$ref": "#/definitions/User"
},
"examples": {
"application/json": {
"id": 1,
"username": "johnp",
"firstName": "John",
"lastName": "Public",
"email": "johnp@swagger.io",
"password": "-secret-",
"phone": "0123456789",
"userStatus": 0
}
} }
}, },
"400": { "400": {
@ -802,7 +1091,12 @@
"400": { "400": {
"description": "Invalid username supplied" "description": "Invalid username supplied"
} }
},
"security": [
{
"test_http_basic": []
} }
]
} }
} }
}, },
@ -820,6 +1114,29 @@
"write:pets": "modify pets in your account", "write:pets": "modify pets in your account",
"read:pets": "read your pets" "read:pets": "read your pets"
} }
},
"test_api_client_id": {
"type": "apiKey",
"name": "x-test_api_client_id",
"in": "header"
},
"test_api_client_secret": {
"type": "apiKey",
"name": "x-test_api_client_secret",
"in": "header"
},
"test_api_key_header": {
"type": "apiKey",
"name": "test_api_key_header",
"in": "header"
},
"test_api_key_query": {
"type": "apiKey",
"name": "test_api_key_query",
"in": "query"
},
"test_http_basic": {
"type": "basic"
} }
}, },
"definitions": { "definitions": {
@ -940,7 +1257,8 @@
"properties": { "properties": {
"id": { "id": {
"type": "integer", "type": "integer",
"format": "int64" "format": "int64",
"readOnly": true
}, },
"petId": { "petId": {
"type": "integer", "type": "integer",
@ -970,6 +1288,110 @@
"xml": { "xml": {
"name": "Order" "name": "Order"
} }
},
"$special[model.name]": {
"properties": {
"$special[property.name]": {
"type": "integer",
"format": "int64"
}
},
"xml": {
"name": "$special[model.name]"
}
},
"Return": {
"descripton": "Model for testing reserved words",
"properties": {
"return": {
"type": "integer",
"format": "int32"
}
},
"xml": {
"name": "Return"
}
},
"Name": {
"descripton": "Model for testing model name same as property name",
"properties": {
"name": {
"type": "integer",
"format": "int32"
},
"snake_case": {
"type": "integer",
"format": "int32"
}
},
"xml": {
"name": "Name"
}
},
"200_response": {
"descripton": "Model for testing model name starting with number",
"properties": {
"name": {
"type": "integer",
"format": "int32"
}
},
"xml": {
"name": "Name"
}
},
"Dog" : {
"allOf" : [ {
"$ref" : "#/definitions/Animal"
}, {
"type" : "object",
"properties" : {
"breed" : {
"type" : "string"
}
}
} ]
},
"Cat" : {
"allOf" : [ {
"$ref" : "#/definitions/Animal"
}, {
"type" : "object",
"properties" : {
"declawed" : {
"type" : "boolean"
}
}
} ]
},
"Animal" : {
"type" : "object",
"discriminator": "className",
"required": [
"className"
],
"properties" : {
"className" : {
"type" : "string"
}
}
},
"Enum_Test" : {
"type" : "object",
"properties" : {
"enum_string" : {
"type" : "string",
"enum" : ["UPPER", "lower"]
},
"enum_integer" : {
"type" : "integer",
"enum" : [1, -1]
},
"enum_number" : {
"type" : "number",
"enum" : [1.1, -1.2]
}
}
} }
} }
} }

View File

@ -3,7 +3,7 @@ package io.swagger.client;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class ApiException extends Exception { public class ApiException extends Exception {
private int code = 0; private int code = 0;
private Map<String, List<String>> responseHeaders = null; private Map<String, List<String>> responseHeaders = null;

View File

@ -1,6 +1,6 @@
package io.swagger.client; package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class Configuration { public class Configuration {
private static ApiClient defaultApiClient = new ApiClient(); private static ApiClient defaultApiClient = new ApiClient();

View File

@ -1,6 +1,6 @@
package io.swagger.client; package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class Pair { public class Pair {
private String name = ""; private String name = "";
private String value = ""; private String value = "";

View File

@ -1,6 +1,6 @@
package io.swagger.client; package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class StringUtil { public class StringUtil {
/** /**
* Check if the given array contains the given value (with case-insensitive comparison). * Check if the given array contains the given value (with case-insensitive comparison).

View File

@ -8,15 +8,15 @@ import io.swagger.client.Configuration;
import io.swagger.client.Pair; import io.swagger.client.Pair;
import io.swagger.client.model.Pet; import io.swagger.client.model.Pet;
import io.swagger.client.model.InlineResponse200;
import java.io.File; import java.io.File;
import io.swagger.client.model.ModelApiResponse;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class PetApi { public class PetApi {
private ApiClient apiClient; private ApiClient apiClient;
@ -36,20 +36,16 @@ public class PetApi {
this.apiClient = apiClient; this.apiClient = apiClient;
} }
/** /**
* Add a new pet to the store * Add a new pet to the store
* *
* @param body Pet object that needs to be added to the store (required) * @param body Pet object that needs to be added to the store (optional)
* @throws ApiException if fails to make API call * @throws ApiException if fails to make API call
*/ */
public void addPet(Pet body) throws ApiException { public void addPet(Pet body) throws ApiException {
Object localVarPostBody = body; Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling addPet");
}
// create path and map variables // create path and map variables
String localVarPath = "/pet".replaceAll("\\{format\\}","json"); String localVarPath = "/pet".replaceAll("\\{format\\}","json");
@ -61,8 +57,11 @@ public class PetApi {
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/xml", "application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -75,7 +74,49 @@ public class PetApi {
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
} }
/**
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
*
* @param body Pet object in the form of byte array (optional)
* @throws ApiException if fails to make API call
*/
public void addPetUsingByteArray(byte[] body) throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/pet?testing_byte_array=true".replaceAll("\\{format\\}","json");
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json", "application/xml"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "petstore_auth" };
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
}
/** /**
* Deletes a pet * Deletes a pet
* *
@ -101,12 +142,15 @@ public class PetApi {
Map<String, Object> localVarFormParams = new HashMap<String, Object>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (apiKey != null) if (apiKey != null)
localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey)); localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey));
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/xml", "application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -119,22 +163,19 @@ public class PetApi {
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
} }
/** /**
* Finds Pets by status * Finds Pets by status
* Multiple status values can be provided with comma separated strings * Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter (required) * @param status Status values that need to be considered for query (optional, default to available)
* @return List<Pet> * @return List<Pet>
* @throws ApiException if fails to make API call * @throws ApiException if fails to make API call
*/ */
public List<Pet> findPetsByStatus(List<String> status) throws ApiException { public List<Pet> findPetsByStatus(List<String> status) throws ApiException {
Object localVarPostBody = null; Object localVarPostBody = null;
// verify the required parameter 'status' is set
if (status == null) {
throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus");
}
// create path and map variables // create path and map variables
String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json"); String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json");
@ -143,12 +184,16 @@ public class PetApi {
Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>();
localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status));
localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "status", status));
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/xml", "application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -159,24 +204,22 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "petstore_auth" }; String[] localVarAuthNames = new String[] { "petstore_auth" };
GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {}; GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
} }
/** /**
* Finds Pets by tags * Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by (required) * @param tags Tags to filter by (optional)
* @return List<Pet> * @return List<Pet>
* @throws ApiException if fails to make API call * @throws ApiException if fails to make API call
*/ */
public List<Pet> findPetsByTags(List<String> tags) throws ApiException { public List<Pet> findPetsByTags(List<String> tags) throws ApiException {
Object localVarPostBody = null; Object localVarPostBody = null;
// verify the required parameter 'tags' is set
if (tags == null) {
throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags");
}
// create path and map variables // create path and map variables
String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json"); String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json");
@ -185,12 +228,16 @@ public class PetApi {
Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>();
localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags));
localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "tags", tags));
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/xml", "application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -201,13 +248,16 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "petstore_auth" }; String[] localVarAuthNames = new String[] { "petstore_auth" };
GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {}; GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
} }
/** /**
* Find pet by ID * Find pet by ID
* Returns a single pet * Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param petId ID of pet to return (required) * @param petId ID of pet that needs to be fetched (required)
* @return Pet * @return Pet
* @throws ApiException if fails to make API call * @throws ApiException if fails to make API call
*/ */
@ -231,8 +281,11 @@ public class PetApi {
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/xml", "application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -241,25 +294,119 @@ public class PetApi {
}; };
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" }; String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
GenericType<Pet> localVarReturnType = new GenericType<Pet>() {}; GenericType<Pet> localVarReturnType = new GenericType<Pet>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
} }
/**
* Fake endpoint to test inline arbitrary object return by &#39;Find pet by ID&#39;
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param petId ID of pet that needs to be fetched (required)
* @return InlineResponse200
* @throws ApiException if fails to make API call
*/
public InlineResponse200 getPetByIdInObject(Long petId) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetByIdInObject");
}
// create path and map variables
String localVarPath = "/pet/{petId}?response=inline_arbitrary_object".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
GenericType<InlineResponse200> localVarReturnType = new GenericType<InlineResponse200>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Fake endpoint to test byte array return by &#39;Find pet by ID&#39;
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param petId ID of pet that needs to be fetched (required)
* @return byte[]
* @throws ApiException if fails to make API call
*/
public byte[] petPetIdtestingByteArraytrueGet(Long petId) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException(400, "Missing the required parameter 'petId' when calling petPetIdtestingByteArraytrueGet");
}
// create path and map variables
String localVarPath = "/pet/{petId}?testing_byte_array=true".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key", "petstore_auth" };
GenericType<byte[]> localVarReturnType = new GenericType<byte[]>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/** /**
* Update an existing pet * Update an existing pet
* *
* @param body Pet object that needs to be added to the store (required) * @param body Pet object that needs to be added to the store (optional)
* @throws ApiException if fails to make API call * @throws ApiException if fails to make API call
*/ */
public void updatePet(Pet body) throws ApiException { public void updatePet(Pet body) throws ApiException {
Object localVarPostBody = body; Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling updatePet");
}
// create path and map variables // create path and map variables
String localVarPath = "/pet".replaceAll("\\{format\\}","json"); String localVarPath = "/pet".replaceAll("\\{format\\}","json");
@ -271,8 +418,11 @@ public class PetApi {
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/xml", "application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -285,7 +435,9 @@ public class PetApi {
apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
} }
/** /**
* Updates a pet in the store with form data * Updates a pet in the store with form data
* *
@ -294,7 +446,7 @@ public class PetApi {
* @param status Updated status of the pet (optional) * @param status Updated status of the pet (optional)
* @throws ApiException if fails to make API call * @throws ApiException if fails to make API call
*/ */
public void updatePetWithForm(Long petId, String name, String status) throws ApiException { public void updatePetWithForm(String petId, String name, String status) throws ApiException {
Object localVarPostBody = null; Object localVarPostBody = null;
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
@ -313,13 +465,16 @@ public class PetApi {
if (name != null) if (name != null)
localVarFormParams.put("name", name); localVarFormParams.put("name", name);
if (status != null) if (status != null)
localVarFormParams.put("status", status); localVarFormParams.put("status", status);
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/xml", "application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -332,17 +487,18 @@ if (status != null)
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
} }
/** /**
* uploads an image * uploads an image
* *
* @param petId ID of pet to update (required) * @param petId ID of pet to update (required)
* @param additionalMetadata Additional data to pass to server (optional) * @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional) * @param file file to upload (optional)
* @return ModelApiResponse
* @throws ApiException if fails to make API call * @throws ApiException if fails to make API call
*/ */
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException { public void uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
Object localVarPostBody = null; Object localVarPostBody = null;
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
@ -361,13 +517,16 @@ if (status != null)
if (additionalMetadata != null) if (additionalMetadata != null)
localVarFormParams.put("additionalMetadata", additionalMetadata); localVarFormParams.put("additionalMetadata", additionalMetadata);
if (file != null) if (file != null)
localVarFormParams.put("file", file); localVarFormParams.put("file", file);
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -378,7 +537,9 @@ if (file != null)
String[] localVarAuthNames = new String[] { "petstore_auth" }; String[] localVarAuthNames = new String[] { "petstore_auth" };
GenericType<ModelApiResponse> localVarReturnType = new GenericType<ModelApiResponse>() {};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
} }
} }

View File

@ -14,7 +14,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class StoreApi { public class StoreApi {
private ApiClient apiClient; private ApiClient apiClient;
@ -34,6 +34,7 @@ public class StoreApi {
this.apiClient = apiClient; this.apiClient = apiClient;
} }
/** /**
* Delete purchase order by ID * Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors * For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
@ -60,8 +61,11 @@ public class StoreApi {
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/xml", "application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -74,7 +78,53 @@ public class StoreApi {
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
} }
/**
* Finds orders by status
* A single status value can be provided as a string
* @param status Status value that needs to be considered for query (optional, default to placed)
* @return List<Order>
* @throws ApiException if fails to make API call
*/
public List<Order> findOrdersByStatus(String status) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/store/findByStatus".replaceAll("\\{format\\}","json");
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status));
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "test_api_client_id", "test_api_client_secret" };
GenericType<List<Order>> localVarReturnType = new GenericType<List<Order>>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/** /**
* Returns pet inventories by status * Returns pet inventories by status
* Returns a map of status codes to quantities * Returns a map of status codes to quantities
@ -95,8 +145,11 @@ public class StoreApi {
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -107,17 +160,61 @@ public class StoreApi {
String[] localVarAuthNames = new String[] { "api_key" }; String[] localVarAuthNames = new String[] { "api_key" };
GenericType<Map<String, Integer>> localVarReturnType = new GenericType<Map<String, Integer>>() {}; GenericType<Map<String, Integer>> localVarReturnType = new GenericType<Map<String, Integer>>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
} }
/**
* Fake endpoint to test arbitrary object return by &#39;Get inventory&#39;
* Returns an arbitrary object which is actually a map of status codes to quantities
* @return Object
* @throws ApiException if fails to make API call
*/
public Object getInventoryInObject() throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/store/inventory?response=arbitrary_object".replaceAll("\\{format\\}","json");
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/xml"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
GenericType<Object> localVarReturnType = new GenericType<Object>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/** /**
* Find purchase order by ID * Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions * For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched (required) * @param orderId ID of pet that needs to be fetched (required)
* @return Order * @return Order
* @throws ApiException if fails to make API call * @throws ApiException if fails to make API call
*/ */
public Order getOrderById(Long orderId) throws ApiException { public Order getOrderById(String orderId) throws ApiException {
Object localVarPostBody = null; Object localVarPostBody = null;
// verify the required parameter 'orderId' is set // verify the required parameter 'orderId' is set
@ -137,8 +234,11 @@ public class StoreApi {
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/xml", "application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -147,26 +247,24 @@ public class StoreApi {
}; };
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { }; String[] localVarAuthNames = new String[] { "test_api_key_header", "test_api_key_query" };
GenericType<Order> localVarReturnType = new GenericType<Order>() {}; GenericType<Order> localVarReturnType = new GenericType<Order>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
} }
/** /**
* Place an order for a pet * Place an order for a pet
* *
* @param body order placed for purchasing the pet (required) * @param body order placed for purchasing the pet (optional)
* @return Order * @return Order
* @throws ApiException if fails to make API call * @throws ApiException if fails to make API call
*/ */
public Order placeOrder(Order body) throws ApiException { public Order placeOrder(Order body) throws ApiException {
Object localVarPostBody = body; Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling placeOrder");
}
// create path and map variables // create path and map variables
String localVarPath = "/store/order".replaceAll("\\{format\\}","json"); String localVarPath = "/store/order".replaceAll("\\{format\\}","json");
@ -178,8 +276,11 @@ public class StoreApi {
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/xml", "application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -188,9 +289,12 @@ public class StoreApi {
}; };
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { }; String[] localVarAuthNames = new String[] { "test_api_client_id", "test_api_client_secret" };
GenericType<Order> localVarReturnType = new GenericType<Order>() {}; GenericType<Order> localVarReturnType = new GenericType<Order>() {};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
} }
} }

View File

@ -14,7 +14,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class UserApi { public class UserApi {
private ApiClient apiClient; private ApiClient apiClient;
@ -34,20 +34,16 @@ public class UserApi {
this.apiClient = apiClient; this.apiClient = apiClient;
} }
/** /**
* Create user * Create user
* This can only be done by the logged in user. * This can only be done by the logged in user.
* @param body Created user object (required) * @param body Created user object (optional)
* @throws ApiException if fails to make API call * @throws ApiException if fails to make API call
*/ */
public void createUser(User body) throws ApiException { public void createUser(User body) throws ApiException {
Object localVarPostBody = body; Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling createUser");
}
// create path and map variables // create path and map variables
String localVarPath = "/user".replaceAll("\\{format\\}","json"); String localVarPath = "/user".replaceAll("\\{format\\}","json");
@ -59,8 +55,11 @@ public class UserApi {
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/xml", "application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -73,21 +72,18 @@ public class UserApi {
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
} }
/** /**
* Creates list of users with given input array * Creates list of users with given input array
* *
* @param body List of user object (required) * @param body List of user object (optional)
* @throws ApiException if fails to make API call * @throws ApiException if fails to make API call
*/ */
public void createUsersWithArrayInput(List<User> body) throws ApiException { public void createUsersWithArrayInput(List<User> body) throws ApiException {
Object localVarPostBody = body; Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput");
}
// create path and map variables // create path and map variables
String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json"); String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json");
@ -99,8 +95,11 @@ public class UserApi {
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/xml", "application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -113,21 +112,18 @@ public class UserApi {
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
} }
/** /**
* Creates list of users with given input array * Creates list of users with given input array
* *
* @param body List of user object (required) * @param body List of user object (optional)
* @throws ApiException if fails to make API call * @throws ApiException if fails to make API call
*/ */
public void createUsersWithListInput(List<User> body) throws ApiException { public void createUsersWithListInput(List<User> body) throws ApiException {
Object localVarPostBody = body; Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput");
}
// create path and map variables // create path and map variables
String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json"); String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json");
@ -139,8 +135,11 @@ public class UserApi {
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/xml", "application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -153,7 +152,9 @@ public class UserApi {
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
} }
/** /**
* Delete user * Delete user
* This can only be done by the logged in user. * This can only be done by the logged in user.
@ -180,8 +181,11 @@ public class UserApi {
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/xml", "application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -190,11 +194,13 @@ public class UserApi {
}; };
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { }; String[] localVarAuthNames = new String[] { "test_http_basic" };
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
} }
/** /**
* Get user by user name * Get user by user name
* *
@ -222,8 +228,11 @@ public class UserApi {
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/xml", "application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -234,30 +243,23 @@ public class UserApi {
String[] localVarAuthNames = new String[] { }; String[] localVarAuthNames = new String[] { };
GenericType<User> localVarReturnType = new GenericType<User>() {}; GenericType<User> localVarReturnType = new GenericType<User>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
} }
/** /**
* Logs user into the system * Logs user into the system
* *
* @param username The user name for login (required) * @param username The user name for login (optional)
* @param password The password for login in clear text (required) * @param password The password for login in clear text (optional)
* @return String * @return String
* @throws ApiException if fails to make API call * @throws ApiException if fails to make API call
*/ */
public String loginUser(String username, String password) throws ApiException { public String loginUser(String username, String password) throws ApiException {
Object localVarPostBody = null; Object localVarPostBody = null;
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser");
}
// verify the required parameter 'password' is set
if (password == null) {
throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser");
}
// create path and map variables // create path and map variables
String localVarPath = "/user/login".replaceAll("\\{format\\}","json"); String localVarPath = "/user/login".replaceAll("\\{format\\}","json");
@ -266,13 +268,18 @@ public class UserApi {
Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password));
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/xml", "application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -283,9 +290,12 @@ public class UserApi {
String[] localVarAuthNames = new String[] { }; String[] localVarAuthNames = new String[] { };
GenericType<String> localVarReturnType = new GenericType<String>() {}; GenericType<String> localVarReturnType = new GenericType<String>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
} }
/** /**
* Logs out current logged in user session * Logs out current logged in user session
* *
@ -305,8 +315,11 @@ public class UserApi {
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/xml", "application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -319,12 +332,14 @@ public class UserApi {
apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
} }
/** /**
* Updated user * Updated user
* This can only be done by the logged in user. * This can only be done by the logged in user.
* @param username name that need to be deleted (required) * @param username name that need to be deleted (required)
* @param body Updated user object (required) * @param body Updated user object (optional)
* @throws ApiException if fails to make API call * @throws ApiException if fails to make API call
*/ */
public void updateUser(String username, User body) throws ApiException { public void updateUser(String username, User body) throws ApiException {
@ -335,11 +350,6 @@ public class UserApi {
throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser");
} }
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser");
}
// create path and map variables // create path and map variables
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
@ -352,8 +362,11 @@ public class UserApi {
final String[] localVarAccepts = { final String[] localVarAccepts = {
"application/xml", "application/json" "application/json", "application/xml"
}; };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
@ -366,5 +379,7 @@ public class UserApi {
apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
} }
} }

View File

@ -5,7 +5,7 @@ import io.swagger.client.Pair;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class ApiKeyAuth implements Authentication { public class ApiKeyAuth implements Authentication {
private final String location; private final String location;
private final String paramName; private final String paramName;

View File

@ -9,7 +9,7 @@ import java.util.List;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class HttpBasicAuth implements Authentication { public class HttpBasicAuth implements Authentication {
private String username; private String username;
private String password; private String password;

View File

@ -5,7 +5,7 @@ import io.swagger.client.Pair;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class OAuth implements Authentication { public class OAuth implements Authentication {
private String accessToken; private String accessToken;

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class Category { public class Category {
private Long id = null; private Long id = null;
@ -50,6 +50,7 @@ public class Category {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -7,12 +7,9 @@ import io.swagger.annotations.ApiModelProperty;
/**
* Model for testing model name starting with number
**/
@ApiModel(description = "Model for testing model name starting with number")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class Model200Response { public class Model200Response {
private Integer name = null; private Integer name = null;
@ -35,6 +32,7 @@ public class Model200Response {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -7,12 +7,9 @@ import io.swagger.annotations.ApiModelProperty;
/**
* Model for testing reserved words
**/
@ApiModel(description = "Model for testing reserved words")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class ModelReturn { public class ModelReturn {
private Integer _return = null; private Integer _return = null;
@ -35,6 +32,7 @@ public class ModelReturn {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -7,17 +7,13 @@ import io.swagger.annotations.ApiModelProperty;
/**
* Model for testing model name same as property name
**/
@ApiModel(description = "Model for testing model name same as property name")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class Name { public class Name {
private Integer name = null; private Integer name = null;
private Integer snakeCase = null; private Integer snakeCase = null;
private String property = null;
/** /**
@ -27,7 +23,7 @@ public class Name {
return this; return this;
} }
@ApiModelProperty(example = "null", required = true, value = "") @ApiModelProperty(example = "null", value = "")
@JsonProperty("name") @JsonProperty("name")
public Integer getName() { public Integer getName() {
return name; return name;
@ -37,28 +33,22 @@ public class Name {
} }
/**
**/
public Name snakeCase(Integer snakeCase) {
this.snakeCase = snakeCase;
return this;
}
@ApiModelProperty(example = "null", value = "") @ApiModelProperty(example = "null", value = "")
@JsonProperty("snake_case") @JsonProperty("snake_case")
public Integer getSnakeCase() { public Integer getSnakeCase() {
return snakeCase; return snakeCase;
} }
public void setSnakeCase(Integer snakeCase) {
this.snakeCase = snakeCase;
/**
**/
public Name property(String property) {
this.property = property;
return this;
} }
@ApiModelProperty(example = "null", value = "")
@JsonProperty("property")
public String getProperty() {
return property;
}
public void setProperty(String property) {
this.property = property;
}
@Override @Override
@ -71,13 +61,12 @@ public class Name {
} }
Name name = (Name) o; Name name = (Name) o;
return Objects.equals(this.name, name.name) && return Objects.equals(this.name, name.name) &&
Objects.equals(this.snakeCase, name.snakeCase) && Objects.equals(this.snakeCase, name.snakeCase);
Objects.equals(this.property, name.property);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(name, snakeCase, property); return Objects.hash(name, snakeCase);
} }
@Override @Override
@ -87,7 +76,6 @@ public class Name {
sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n");
sb.append(" property: ").append(toIndentedString(property)).append("\n");
sb.append("}"); sb.append("}");
return sb.toString(); return sb.toString();
} }

View File

@ -11,7 +11,7 @@ import java.util.Date;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class Order { public class Order {
private Long id = null; private Long id = null;
@ -39,24 +39,14 @@ public class Order {
} }
private StatusEnum status = null; private StatusEnum status = null;
private Boolean complete = false; private Boolean complete = null;
/**
**/
public Order id(Long id) {
this.id = id;
return this;
}
@ApiModelProperty(example = "null", value = "") @ApiModelProperty(example = "null", value = "")
@JsonProperty("id") @JsonProperty("id")
public Long getId() { public Long getId() {
return id; return id;
} }
public void setId(Long id) {
this.id = id;
}
/** /**
@ -145,6 +135,7 @@ public class Order {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -14,7 +14,7 @@ import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class Pet { public class Pet {
private Long id = null; private Long id = null;
@ -148,6 +148,7 @@ public class Pet {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class SpecialModelName { public class SpecialModelName {
private Long specialPropertyName = null; private Long specialPropertyName = null;
@ -32,6 +32,7 @@ public class SpecialModelName {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class Tag { public class Tag {
private Long id = null; private Long id = null;
@ -50,6 +50,7 @@ public class Tag {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class User { public class User {
private Long id = null; private Long id = null;
@ -159,6 +159,7 @@ public class User {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -13,7 +13,7 @@ import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-13T14:36:33.302+02:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-02T17:10:39.649+08:00")
public class InlineResponse200 { public class InlineResponse200 {
private List<Tag> tags = new ArrayList<Tag>(); private List<Tag> tags = new ArrayList<Tag>();
@ -147,6 +147,7 @@ public class InlineResponse200 {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -1,11 +1,11 @@
# SwaggerClient-php # SwaggerClient-php
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. 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 PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
- API version: 1.0.0 - API version: 1.0.0
- Package version: 1.0.0 - Package version: 1.0.0
- Build date: 2016-05-02T21:49:03.153+08:00 - Build date: 2016-04-02T19:03:06.710+08:00
- Build package: class io.swagger.codegen.languages.PhpClientCodegen - Build package: class io.swagger.codegen.languages.PhpClientCodegen
## Requirements ## Requirements
@ -22,11 +22,11 @@ To install the bindings via [Composer](http://getcomposer.org/), add the followi
"repositories": [ "repositories": [
{ {
"type": "git", "type": "git",
"url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" "url": "https://github.com/YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID.git"
} }
], ],
"require": { "require": {
"GIT_USER_ID/GIT_REPO_ID": "*@dev" "YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID": "*@dev"
} }
} }
``` ```
@ -58,24 +58,16 @@ Please follow the [installation procedure](#installation--usage) and then run th
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\FakeApi(); // Configure OAuth2 access token for authorization: petstore_auth
$number = 3.4; // float | None Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$double = 1.2; // double | None
$string = "string_example"; // string | None $api_instance = new Swagger\Client\Api\PetApi();
$byte = "B"; // string | None $body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet object that needs to be added to the store
$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 { try {
$api_instance->testEndpointParameters($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password); $api_instance->addPet($body);
} catch (Exception $e) { } catch (Exception $e) {
echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), "\n"; echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), "\n";
} }
?> ?>
@ -87,17 +79,21 @@ All URIs are relative to *http://petstore.swagger.io/v2*
Class | Method | HTTP request | Description 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* | [**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* | [**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* | [**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* | [**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* | [**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* | [**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* | [**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 *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* | [**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* | [**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* | [**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 *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 *UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user
@ -113,11 +109,11 @@ Class | Method | HTTP request | Description
## Documentation For Models ## Documentation For Models
- [Animal](docs/Animal.md) - [Animal](docs/Animal.md)
- [ApiResponse](docs/ApiResponse.md)
- [Cat](docs/Cat.md) - [Cat](docs/Cat.md)
- [Category](docs/Category.md) - [Category](docs/Category.md)
- [Dog](docs/Dog.md) - [Dog](docs/Dog.md)
- [FormatTest](docs/FormatTest.md) - [EnumTest](docs/EnumTest.md)
- [InlineResponse200](docs/InlineResponse200.md)
- [Model200Response](docs/Model200Response.md) - [Model200Response](docs/Model200Response.md)
- [ModelReturn](docs/ModelReturn.md) - [ModelReturn](docs/ModelReturn.md)
- [Name](docs/Name.md) - [Name](docs/Name.md)
@ -131,17 +127,45 @@ Class | Method | HTTP request | Description
## Documentation For Authorization ## Documentation For Authorization
## test_api_key_header
- **Type**: API key
- **API key parameter name**: test_api_key_header
- **Location**: HTTP header
## api_key ## api_key
- **Type**: API key - **Type**: API key
- **API key parameter name**: api_key - **API key parameter name**: api_key
- **Location**: HTTP header - **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 ## petstore_auth
- **Type**: OAuth - **Type**: OAuth
- **Flow**: implicit - **Flow**: implicit
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
- **Scopes**: - **Scopes**:
- **write:pets**: modify pets in your account - **write:pets**: modify pets in your account
- **read:pets**: read your pets - **read:pets**: read your pets

View File

@ -60,7 +60,7 @@ class PetApi
* Constructor * Constructor
* @param \Swagger\Client\ApiClient|null $apiClient The api client to use * @param \Swagger\Client\ApiClient|null $apiClient The api client to use
*/ */
function __construct($apiClient = null) function __construct(\Swagger\Client\ApiClient $apiClient = null)
{ {
if ($apiClient == null) { if ($apiClient == null) {
$apiClient = new ApiClient(); $apiClient = new ApiClient();
@ -84,7 +84,7 @@ class PetApi
* @param \Swagger\Client\ApiClient $apiClient set the API client * @param \Swagger\Client\ApiClient $apiClient set the API client
* @return PetApi * @return PetApi
*/ */
public function setApiClient(ApiClient $apiClient) public function setApiClient(\Swagger\Client\ApiClient $apiClient)
{ {
$this->apiClient = $apiClient; $this->apiClient = $apiClient;
return $this; return $this;

View File

@ -60,7 +60,7 @@ class StoreApi
* Constructor * Constructor
* @param \Swagger\Client\ApiClient|null $apiClient The api client to use * @param \Swagger\Client\ApiClient|null $apiClient The api client to use
*/ */
function __construct($apiClient = null) function __construct(\Swagger\Client\ApiClient $apiClient = null)
{ {
if ($apiClient == null) { if ($apiClient == null) {
$apiClient = new ApiClient(); $apiClient = new ApiClient();
@ -84,7 +84,7 @@ class StoreApi
* @param \Swagger\Client\ApiClient $apiClient set the API client * @param \Swagger\Client\ApiClient $apiClient set the API client
* @return StoreApi * @return StoreApi
*/ */
public function setApiClient(ApiClient $apiClient) public function setApiClient(\Swagger\Client\ApiClient $apiClient)
{ {
$this->apiClient = $apiClient; $this->apiClient = $apiClient;
return $this; return $this;

View File

@ -60,7 +60,7 @@ class UserApi
* Constructor * Constructor
* @param \Swagger\Client\ApiClient|null $apiClient The api client to use * @param \Swagger\Client\ApiClient|null $apiClient The api client to use
*/ */
function __construct($apiClient = null) function __construct(\Swagger\Client\ApiClient $apiClient = null)
{ {
if ($apiClient == null) { if ($apiClient == null) {
$apiClient = new ApiClient(); $apiClient = new ApiClient();
@ -84,7 +84,7 @@ class UserApi
* @param \Swagger\Client\ApiClient $apiClient set the API client * @param \Swagger\Client\ApiClient $apiClient set the API client
* @return UserApi * @return UserApi
*/ */
public function setApiClient(ApiClient $apiClient) public function setApiClient(\Swagger\Client\ApiClient $apiClient)
{ {
$this->apiClient = $apiClient; $this->apiClient = $apiClient;
return $this; return $this;

View File

@ -69,7 +69,7 @@ class ApiClient
* Constructor of the class * Constructor of the class
* @param Configuration $config config for this ApiClient * @param Configuration $config config for this ApiClient
*/ */
public function __construct(Configuration $config = null) public function __construct(\Swagger\Client\Configuration $config = null)
{ {
if ($config == null) { if ($config == null) {
$config = Configuration::getDefaultConfiguration(); $config = Configuration::getDefaultConfiguration();

View File

@ -46,12 +46,6 @@ use \ArrayAccess;
*/ */
class Animal implements 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 * Array of property to type mappings. Used for (de)serialization
* @var string[] * @var string[]
@ -100,12 +94,18 @@ class Animal implements ArrayAccess
return self::$getters; return self::$getters;
} }
/** /**
* $class_name * $class_name
* @var string * @var string
*/ */
protected $class_name; protected $class_name;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -113,14 +113,11 @@ class Animal implements ArrayAccess
public function __construct(array $data = null) 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) { if ($data != null) {
$this->class_name = $data["class_name"]; $this->class_name = $data["class_name"];
} }
} }
/** /**
* Gets class_name * Gets class_name
* @return string * @return string
@ -141,6 +138,7 @@ class Animal implements ArrayAccess
$this->class_name = $class_name; $this->class_name = $class_name;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -188,10 +186,10 @@ class Animal implements ArrayAccess
*/ */
public function __toString() public function __toString()
{ {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print if (defined('JSON_PRETTY_PRINT')) {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} } else {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
} }
} }
}

View File

@ -46,12 +46,6 @@ use \ArrayAccess;
*/ */
class Cat extends Animal implements 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 * Array of property to type mappings. Used for (de)serialization
* @var string[] * @var string[]
@ -100,12 +94,18 @@ class Cat extends Animal implements ArrayAccess
return parent::getters() + self::$getters; return parent::getters() + self::$getters;
} }
/** /**
* $declawed * $declawed
* @var bool * @var bool
*/ */
protected $declawed; protected $declawed;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -113,11 +113,11 @@ class Cat extends Animal implements ArrayAccess
public function __construct(array $data = null) public function __construct(array $data = null)
{ {
parent::__construct($data); parent::__construct($data);
if ($data != null) { if ($data != null) {
$this->declawed = $data["declawed"]; $this->declawed = $data["declawed"];
} }
} }
/** /**
* Gets declawed * Gets declawed
* @return bool * @return bool
@ -138,6 +138,7 @@ class Cat extends Animal implements ArrayAccess
$this->declawed = $declawed; $this->declawed = $declawed;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -185,10 +186,10 @@ class Cat extends Animal implements ArrayAccess
*/ */
public function __toString() public function __toString()
{ {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print if (defined('JSON_PRETTY_PRINT')) {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} } else {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
} }
} }
}

View File

@ -46,12 +46,6 @@ use \ArrayAccess;
*/ */
class Category implements 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 * Array of property to type mappings. Used for (de)serialization
* @var string[] * @var string[]
@ -104,17 +98,24 @@ class Category implements ArrayAccess
return self::$getters; return self::$getters;
} }
/** /**
* $id * $id
* @var int * @var int
*/ */
protected $id; protected $id;
/** /**
* $name * $name
* @var string * @var string
*/ */
protected $name; protected $name;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -122,12 +123,12 @@ class Category implements ArrayAccess
public function __construct(array $data = null) public function __construct(array $data = null)
{ {
if ($data != null) { if ($data != null) {
$this->id = $data["id"]; $this->id = $data["id"];
$this->name = $data["name"]; $this->name = $data["name"];
} }
} }
/** /**
* Gets id * Gets id
* @return int * @return int
@ -148,6 +149,7 @@ class Category implements ArrayAccess
$this->id = $id; $this->id = $id;
return $this; return $this;
} }
/** /**
* Gets name * Gets name
* @return string * @return string
@ -168,6 +170,7 @@ class Category implements ArrayAccess
$this->name = $name; $this->name = $name;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -215,10 +218,10 @@ class Category implements ArrayAccess
*/ */
public function __toString() public function __toString()
{ {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print if (defined('JSON_PRETTY_PRINT')) {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} } else {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
} }
} }
}

View File

@ -46,12 +46,6 @@ use \ArrayAccess;
*/ */
class Dog extends Animal implements 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 * Array of property to type mappings. Used for (de)serialization
* @var string[] * @var string[]
@ -100,12 +94,18 @@ class Dog extends Animal implements ArrayAccess
return parent::getters() + self::$getters; return parent::getters() + self::$getters;
} }
/** /**
* $breed * $breed
* @var string * @var string
*/ */
protected $breed; protected $breed;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -113,11 +113,11 @@ class Dog extends Animal implements ArrayAccess
public function __construct(array $data = null) public function __construct(array $data = null)
{ {
parent::__construct($data); parent::__construct($data);
if ($data != null) { if ($data != null) {
$this->breed = $data["breed"]; $this->breed = $data["breed"];
} }
} }
/** /**
* Gets breed * Gets breed
* @return string * @return string
@ -138,6 +138,7 @@ class Dog extends Animal implements ArrayAccess
$this->breed = $breed; $this->breed = $breed;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -185,10 +186,10 @@ class Dog extends Animal implements ArrayAccess
*/ */
public function __toString() public function __toString()
{ {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print if (defined('JSON_PRETTY_PRINT')) {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} } else {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
} }
} }
}

View File

@ -46,12 +46,6 @@ use \ArrayAccess;
*/ */
class InlineResponse200 implements ArrayAccess class InlineResponse200 implements ArrayAccess
{ {
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'inline_response_200';
/** /**
* Array of property to type mappings. Used for (de)serialization * Array of property to type mappings. Used for (de)serialization
* @var string[] * @var string[]
@ -120,37 +114,51 @@ class InlineResponse200 implements ArrayAccess
return self::$getters; return self::$getters;
} }
const STATUS_AVAILABLE = "available";
const STATUS_PENDING = "pending";
const STATUS_SOLD = "sold";
/** /**
* $tags * $tags
* @var \Swagger\Client\Model\Tag[] * @var \Swagger\Client\Model\Tag[]
*/ */
protected $tags; protected $tags;
/** /**
* $id * $id
* @var int * @var int
*/ */
protected $id; protected $id;
/** /**
* $category * $category
* @var object * @var object
*/ */
protected $category; protected $category;
/** /**
* $status pet status in the store * $status pet status in the store
* @var string * @var string
*/ */
protected $status; protected $status;
/** /**
* $name * $name
* @var string * @var string
*/ */
protected $name; protected $name;
/** /**
* $photo_urls * $photo_urls
* @var string[] * @var string[]
*/ */
protected $photo_urls; protected $photo_urls;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -158,7 +166,6 @@ class InlineResponse200 implements ArrayAccess
public function __construct(array $data = null) public function __construct(array $data = null)
{ {
if ($data != null) { if ($data != null) {
$this->tags = $data["tags"]; $this->tags = $data["tags"];
$this->id = $data["id"]; $this->id = $data["id"];
@ -168,6 +175,7 @@ class InlineResponse200 implements ArrayAccess
$this->photo_urls = $data["photo_urls"]; $this->photo_urls = $data["photo_urls"];
} }
} }
/** /**
* Gets tags * Gets tags
* @return \Swagger\Client\Model\Tag[] * @return \Swagger\Client\Model\Tag[]
@ -188,6 +196,7 @@ class InlineResponse200 implements ArrayAccess
$this->tags = $tags; $this->tags = $tags;
return $this; return $this;
} }
/** /**
* Gets id * Gets id
* @return int * @return int
@ -208,6 +217,7 @@ class InlineResponse200 implements ArrayAccess
$this->id = $id; $this->id = $id;
return $this; return $this;
} }
/** /**
* Gets category * Gets category
* @return object * @return object
@ -228,6 +238,7 @@ class InlineResponse200 implements ArrayAccess
$this->category = $category; $this->category = $category;
return $this; return $this;
} }
/** /**
* Gets status * Gets status
* @return string * @return string
@ -251,6 +262,7 @@ class InlineResponse200 implements ArrayAccess
$this->status = $status; $this->status = $status;
return $this; return $this;
} }
/** /**
* Gets name * Gets name
* @return string * @return string
@ -271,6 +283,7 @@ class InlineResponse200 implements ArrayAccess
$this->name = $name; $this->name = $name;
return $this; return $this;
} }
/** /**
* Gets photo_urls * Gets photo_urls
* @return string[] * @return string[]
@ -291,6 +304,7 @@ class InlineResponse200 implements ArrayAccess
$this->photo_urls = $photo_urls; $this->photo_urls = $photo_urls;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -338,10 +352,10 @@ class InlineResponse200 implements ArrayAccess
*/ */
public function __toString() public function __toString()
{ {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print if (defined('JSON_PRETTY_PRINT')) {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} } else {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
} }
} }
}

View File

@ -38,7 +38,7 @@ use \ArrayAccess;
* Model200Response Class Doc Comment * Model200Response Class Doc Comment
* *
* @category Class * @category Class
* @description Model for testing model name starting with number * @description
* @package Swagger\Client * @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen * @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
@ -46,12 +46,6 @@ use \ArrayAccess;
*/ */
class Model200Response implements 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 * Array of property to type mappings. Used for (de)serialization
* @var string[] * @var string[]
@ -100,12 +94,18 @@ class Model200Response implements ArrayAccess
return self::$getters; return self::$getters;
} }
/** /**
* $name * $name
* @var int * @var int
*/ */
protected $name; protected $name;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -113,11 +113,11 @@ class Model200Response implements ArrayAccess
public function __construct(array $data = null) public function __construct(array $data = null)
{ {
if ($data != null) { if ($data != null) {
$this->name = $data["name"]; $this->name = $data["name"];
} }
} }
/** /**
* Gets name * Gets name
* @return int * @return int
@ -138,6 +138,7 @@ class Model200Response implements ArrayAccess
$this->name = $name; $this->name = $name;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -185,10 +186,10 @@ class Model200Response implements ArrayAccess
*/ */
public function __toString() public function __toString()
{ {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print if (defined('JSON_PRETTY_PRINT')) {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} } else {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
} }
} }
}

View File

@ -38,7 +38,7 @@ use \ArrayAccess;
* ModelReturn Class Doc Comment * ModelReturn Class Doc Comment
* *
* @category Class * @category Class
* @description Model for testing reserved words * @description
* @package Swagger\Client * @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen * @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
@ -46,12 +46,6 @@ use \ArrayAccess;
*/ */
class ModelReturn implements 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 * Array of property to type mappings. Used for (de)serialization
* @var string[] * @var string[]
@ -100,12 +94,18 @@ class ModelReturn implements ArrayAccess
return self::$getters; return self::$getters;
} }
/** /**
* $return * $return
* @var int * @var int
*/ */
protected $return; protected $return;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -113,11 +113,11 @@ class ModelReturn implements ArrayAccess
public function __construct(array $data = null) public function __construct(array $data = null)
{ {
if ($data != null) { if ($data != null) {
$this->return = $data["return"]; $this->return = $data["return"];
} }
} }
/** /**
* Gets return * Gets return
* @return int * @return int
@ -138,6 +138,7 @@ class ModelReturn implements ArrayAccess
$this->return = $return; $this->return = $return;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -185,10 +186,10 @@ class ModelReturn implements ArrayAccess
*/ */
public function __toString() public function __toString()
{ {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print if (defined('JSON_PRETTY_PRINT')) {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} } else {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
} }
} }
}

View File

@ -38,7 +38,7 @@ use \ArrayAccess;
* Name Class Doc Comment * Name Class Doc Comment
* *
* @category Class * @category Class
* @description Model for testing model name same as property name * @description
* @package Swagger\Client * @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen * @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
@ -46,20 +46,13 @@ use \ArrayAccess;
*/ */
class Name implements 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 * Array of property to type mappings. Used for (de)serialization
* @var string[] * @var string[]
*/ */
static $swaggerTypes = array( static $swaggerTypes = array(
'name' => 'int', 'name' => 'int',
'snake_case' => 'int', 'snake_case' => 'int'
'property' => 'string'
); );
static function swaggerTypes() { static function swaggerTypes() {
@ -72,8 +65,7 @@ class Name implements ArrayAccess
*/ */
static $attributeMap = array( static $attributeMap = array(
'name' => 'name', 'name' => 'name',
'snake_case' => 'snake_case', 'snake_case' => 'snake_case'
'property' => 'property'
); );
static function attributeMap() { static function attributeMap() {
@ -86,8 +78,7 @@ class Name implements ArrayAccess
*/ */
static $setters = array( static $setters = array(
'name' => 'setName', 'name' => 'setName',
'snake_case' => 'setSnakeCase', 'snake_case' => 'setSnakeCase'
'property' => 'setProperty'
); );
static function setters() { static function setters() {
@ -100,29 +91,30 @@ class Name implements ArrayAccess
*/ */
static $getters = array( static $getters = array(
'name' => 'getName', 'name' => 'getName',
'snake_case' => 'getSnakeCase', 'snake_case' => 'getSnakeCase'
'property' => 'getProperty'
); );
static function getters() { static function getters() {
return self::$getters; return self::$getters;
} }
/** /**
* $name * $name
* @var int * @var int
*/ */
protected $name; protected $name;
/** /**
* $snake_case * $snake_case
* @var int * @var int
*/ */
protected $snake_case; protected $snake_case;
/**
* $property
* @var string
*/
protected $property;
/** /**
* Constructor * Constructor
@ -131,13 +123,12 @@ class Name implements ArrayAccess
public function __construct(array $data = null) public function __construct(array $data = null)
{ {
if ($data != null) { if ($data != null) {
$this->name = $data["name"]; $this->name = $data["name"];
$this->snake_case = $data["snake_case"]; $this->snake_case = $data["snake_case"];
$this->property = $data["property"];
} }
} }
/** /**
* Gets name * Gets name
* @return int * @return int
@ -158,6 +149,7 @@ class Name implements ArrayAccess
$this->name = $name; $this->name = $name;
return $this; return $this;
} }
/** /**
* Gets snake_case * Gets snake_case
* @return int * @return int
@ -178,26 +170,7 @@ class Name implements ArrayAccess
$this->snake_case = $snake_case; $this->snake_case = $snake_case;
return $this; 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. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -245,10 +218,10 @@ class Name implements ArrayAccess
*/ */
public function __toString() public function __toString()
{ {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print if (defined('JSON_PRETTY_PRINT')) {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} } else {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
} }
} }
}

View File

@ -46,12 +46,6 @@ use \ArrayAccess;
*/ */
class Order implements 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 * Array of property to type mappings. Used for (de)serialization
* @var string[] * @var string[]
@ -120,36 +114,50 @@ class Order implements ArrayAccess
return self::$getters; return self::$getters;
} }
const STATUS_PLACED = "placed";
const STATUS_APPROVED = "approved";
const STATUS_DELIVERED = "delivered";
/** /**
* $id * $id
* @var int * @var int
*/ */
protected $id; protected $id;
/** /**
* $pet_id * $pet_id
* @var int * @var int
*/ */
protected $pet_id; protected $pet_id;
/** /**
* $quantity * $quantity
* @var int * @var int
*/ */
protected $quantity; protected $quantity;
/** /**
* $ship_date * $ship_date
* @var \DateTime * @var \DateTime
*/ */
protected $ship_date; protected $ship_date;
/** /**
* $status Order Status * $status Order Status
* @var string * @var string
*/ */
protected $status; protected $status;
/** /**
* $complete * $complete
* @var bool * @var bool
*/ */
protected $complete = false; protected $complete;
/** /**
* Constructor * Constructor
@ -158,7 +166,6 @@ class Order implements ArrayAccess
public function __construct(array $data = null) public function __construct(array $data = null)
{ {
if ($data != null) { if ($data != null) {
$this->id = $data["id"]; $this->id = $data["id"];
$this->pet_id = $data["pet_id"]; $this->pet_id = $data["pet_id"];
@ -168,6 +175,7 @@ class Order implements ArrayAccess
$this->complete = $data["complete"]; $this->complete = $data["complete"];
} }
} }
/** /**
* Gets id * Gets id
* @return int * @return int
@ -188,6 +196,7 @@ class Order implements ArrayAccess
$this->id = $id; $this->id = $id;
return $this; return $this;
} }
/** /**
* Gets pet_id * Gets pet_id
* @return int * @return int
@ -208,6 +217,7 @@ class Order implements ArrayAccess
$this->pet_id = $pet_id; $this->pet_id = $pet_id;
return $this; return $this;
} }
/** /**
* Gets quantity * Gets quantity
* @return int * @return int
@ -228,6 +238,7 @@ class Order implements ArrayAccess
$this->quantity = $quantity; $this->quantity = $quantity;
return $this; return $this;
} }
/** /**
* Gets ship_date * Gets ship_date
* @return \DateTime * @return \DateTime
@ -248,6 +259,7 @@ class Order implements ArrayAccess
$this->ship_date = $ship_date; $this->ship_date = $ship_date;
return $this; return $this;
} }
/** /**
* Gets status * Gets status
* @return string * @return string
@ -271,6 +283,7 @@ class Order implements ArrayAccess
$this->status = $status; $this->status = $status;
return $this; return $this;
} }
/** /**
* Gets complete * Gets complete
* @return bool * @return bool
@ -291,6 +304,7 @@ class Order implements ArrayAccess
$this->complete = $complete; $this->complete = $complete;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -338,10 +352,10 @@ class Order implements ArrayAccess
*/ */
public function __toString() public function __toString()
{ {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print if (defined('JSON_PRETTY_PRINT')) {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} } else {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
} }
} }
}

View File

@ -46,12 +46,6 @@ use \ArrayAccess;
*/ */
class Pet implements 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 * Array of property to type mappings. Used for (de)serialization
* @var string[] * @var string[]
@ -120,37 +114,51 @@ class Pet implements ArrayAccess
return self::$getters; return self::$getters;
} }
const STATUS_AVAILABLE = "available";
const STATUS_PENDING = "pending";
const STATUS_SOLD = "sold";
/** /**
* $id * $id
* @var int * @var int
*/ */
protected $id; protected $id;
/** /**
* $category * $category
* @var \Swagger\Client\Model\Category * @var \Swagger\Client\Model\Category
*/ */
protected $category; protected $category;
/** /**
* $name * $name
* @var string * @var string
*/ */
protected $name; protected $name;
/** /**
* $photo_urls * $photo_urls
* @var string[] * @var string[]
*/ */
protected $photo_urls; protected $photo_urls;
/** /**
* $tags * $tags
* @var \Swagger\Client\Model\Tag[] * @var \Swagger\Client\Model\Tag[]
*/ */
protected $tags; protected $tags;
/** /**
* $status pet status in the store * $status pet status in the store
* @var string * @var string
*/ */
protected $status; protected $status;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -158,7 +166,6 @@ class Pet implements ArrayAccess
public function __construct(array $data = null) public function __construct(array $data = null)
{ {
if ($data != null) { if ($data != null) {
$this->id = $data["id"]; $this->id = $data["id"];
$this->category = $data["category"]; $this->category = $data["category"];
@ -168,6 +175,7 @@ class Pet implements ArrayAccess
$this->status = $data["status"]; $this->status = $data["status"];
} }
} }
/** /**
* Gets id * Gets id
* @return int * @return int
@ -188,6 +196,7 @@ class Pet implements ArrayAccess
$this->id = $id; $this->id = $id;
return $this; return $this;
} }
/** /**
* Gets category * Gets category
* @return \Swagger\Client\Model\Category * @return \Swagger\Client\Model\Category
@ -208,6 +217,7 @@ class Pet implements ArrayAccess
$this->category = $category; $this->category = $category;
return $this; return $this;
} }
/** /**
* Gets name * Gets name
* @return string * @return string
@ -228,6 +238,7 @@ class Pet implements ArrayAccess
$this->name = $name; $this->name = $name;
return $this; return $this;
} }
/** /**
* Gets photo_urls * Gets photo_urls
* @return string[] * @return string[]
@ -248,6 +259,7 @@ class Pet implements ArrayAccess
$this->photo_urls = $photo_urls; $this->photo_urls = $photo_urls;
return $this; return $this;
} }
/** /**
* Gets tags * Gets tags
* @return \Swagger\Client\Model\Tag[] * @return \Swagger\Client\Model\Tag[]
@ -268,6 +280,7 @@ class Pet implements ArrayAccess
$this->tags = $tags; $this->tags = $tags;
return $this; return $this;
} }
/** /**
* Gets status * Gets status
* @return string * @return string
@ -291,6 +304,7 @@ class Pet implements ArrayAccess
$this->status = $status; $this->status = $status;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -338,10 +352,10 @@ class Pet implements ArrayAccess
*/ */
public function __toString() public function __toString()
{ {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print if (defined('JSON_PRETTY_PRINT')) {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} } else {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
} }
} }
}

View File

@ -46,12 +46,6 @@ use \ArrayAccess;
*/ */
class SpecialModelName implements 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 * Array of property to type mappings. Used for (de)serialization
* @var string[] * @var string[]
@ -100,12 +94,18 @@ class SpecialModelName implements ArrayAccess
return self::$getters; return self::$getters;
} }
/** /**
* $special_property_name * $special_property_name
* @var int * @var int
*/ */
protected $special_property_name; protected $special_property_name;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -113,11 +113,11 @@ class SpecialModelName implements ArrayAccess
public function __construct(array $data = null) public function __construct(array $data = null)
{ {
if ($data != null) { if ($data != null) {
$this->special_property_name = $data["special_property_name"]; $this->special_property_name = $data["special_property_name"];
} }
} }
/** /**
* Gets special_property_name * Gets special_property_name
* @return int * @return int
@ -138,6 +138,7 @@ class SpecialModelName implements ArrayAccess
$this->special_property_name = $special_property_name; $this->special_property_name = $special_property_name;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -185,10 +186,10 @@ class SpecialModelName implements ArrayAccess
*/ */
public function __toString() public function __toString()
{ {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print if (defined('JSON_PRETTY_PRINT')) {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} } else {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
} }
} }
}

View File

@ -46,12 +46,6 @@ use \ArrayAccess;
*/ */
class Tag implements 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 * Array of property to type mappings. Used for (de)serialization
* @var string[] * @var string[]
@ -104,17 +98,24 @@ class Tag implements ArrayAccess
return self::$getters; return self::$getters;
} }
/** /**
* $id * $id
* @var int * @var int
*/ */
protected $id; protected $id;
/** /**
* $name * $name
* @var string * @var string
*/ */
protected $name; protected $name;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -122,12 +123,12 @@ class Tag implements ArrayAccess
public function __construct(array $data = null) public function __construct(array $data = null)
{ {
if ($data != null) { if ($data != null) {
$this->id = $data["id"]; $this->id = $data["id"];
$this->name = $data["name"]; $this->name = $data["name"];
} }
} }
/** /**
* Gets id * Gets id
* @return int * @return int
@ -148,6 +149,7 @@ class Tag implements ArrayAccess
$this->id = $id; $this->id = $id;
return $this; return $this;
} }
/** /**
* Gets name * Gets name
* @return string * @return string
@ -168,6 +170,7 @@ class Tag implements ArrayAccess
$this->name = $name; $this->name = $name;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -215,10 +218,10 @@ class Tag implements ArrayAccess
*/ */
public function __toString() public function __toString()
{ {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print if (defined('JSON_PRETTY_PRINT')) {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} } else {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
} }
} }
}

View File

@ -46,12 +46,6 @@ use \ArrayAccess;
*/ */
class User implements 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 * Array of property to type mappings. Used for (de)serialization
* @var string[] * @var string[]
@ -128,47 +122,60 @@ class User implements ArrayAccess
return self::$getters; return self::$getters;
} }
/** /**
* $id * $id
* @var int * @var int
*/ */
protected $id; protected $id;
/** /**
* $username * $username
* @var string * @var string
*/ */
protected $username; protected $username;
/** /**
* $first_name * $first_name
* @var string * @var string
*/ */
protected $first_name; protected $first_name;
/** /**
* $last_name * $last_name
* @var string * @var string
*/ */
protected $last_name; protected $last_name;
/** /**
* $email * $email
* @var string * @var string
*/ */
protected $email; protected $email;
/** /**
* $password * $password
* @var string * @var string
*/ */
protected $password; protected $password;
/** /**
* $phone * $phone
* @var string * @var string
*/ */
protected $phone; protected $phone;
/** /**
* $user_status User Status * $user_status User Status
* @var int * @var int
*/ */
protected $user_status; protected $user_status;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -176,7 +183,6 @@ class User implements ArrayAccess
public function __construct(array $data = null) public function __construct(array $data = null)
{ {
if ($data != null) { if ($data != null) {
$this->id = $data["id"]; $this->id = $data["id"];
$this->username = $data["username"]; $this->username = $data["username"];
@ -188,6 +194,7 @@ class User implements ArrayAccess
$this->user_status = $data["user_status"]; $this->user_status = $data["user_status"];
} }
} }
/** /**
* Gets id * Gets id
* @return int * @return int
@ -208,6 +215,7 @@ class User implements ArrayAccess
$this->id = $id; $this->id = $id;
return $this; return $this;
} }
/** /**
* Gets username * Gets username
* @return string * @return string
@ -228,6 +236,7 @@ class User implements ArrayAccess
$this->username = $username; $this->username = $username;
return $this; return $this;
} }
/** /**
* Gets first_name * Gets first_name
* @return string * @return string
@ -248,6 +257,7 @@ class User implements ArrayAccess
$this->first_name = $first_name; $this->first_name = $first_name;
return $this; return $this;
} }
/** /**
* Gets last_name * Gets last_name
* @return string * @return string
@ -268,6 +278,7 @@ class User implements ArrayAccess
$this->last_name = $last_name; $this->last_name = $last_name;
return $this; return $this;
} }
/** /**
* Gets email * Gets email
* @return string * @return string
@ -288,6 +299,7 @@ class User implements ArrayAccess
$this->email = $email; $this->email = $email;
return $this; return $this;
} }
/** /**
* Gets password * Gets password
* @return string * @return string
@ -308,6 +320,7 @@ class User implements ArrayAccess
$this->password = $password; $this->password = $password;
return $this; return $this;
} }
/** /**
* Gets phone * Gets phone
* @return string * @return string
@ -328,6 +341,7 @@ class User implements ArrayAccess
$this->phone = $phone; $this->phone = $phone;
return $this; return $this;
} }
/** /**
* Gets user_status * Gets user_status
* @return int * @return int
@ -348,6 +362,7 @@ class User implements ArrayAccess
$this->user_status = $user_status; $this->user_status = $user_status;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -395,10 +410,10 @@ class User implements ArrayAccess
*/ */
public function __toString() public function __toString()
{ {
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print if (defined('JSON_PRETTY_PRINT')) {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} } else {
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
} }
} }
}