Regenerate PHP petstore sample

This commit is contained in:
Arne Jørgensen
2016-04-09 21:05:45 +02:00
parent 65d677c385
commit 747f6ba0bb
21 changed files with 235 additions and 140 deletions

View File

@@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class Animal implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'Animal';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@@ -107,6 +113,10 @@ class Animal implements ArrayAccess
public function __construct(array $data = null)
{
// Initialize discriminator property with the model name.
$discrimintor = array_search('className', self::$attributeMap);
$this->{$discrimintor} = static::$swaggerModelName;
if ($data != null) {
$this->class_name = $data["class_name"];
}

View File

@@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class Cat extends Animal implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'Cat';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@@ -107,6 +113,7 @@ class Cat extends Animal implements ArrayAccess
public function __construct(array $data = null)
{
parent::__construct($data);
if ($data != null) {
$this->declawed = $data["declawed"];
}

View File

@@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class Category implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'Category';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@@ -116,6 +122,7 @@ class Category implements ArrayAccess
public function __construct(array $data = null)
{
if ($data != null) {
$this->id = $data["id"];
$this->name = $data["name"];

View File

@@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class Dog extends Animal implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'Dog';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@@ -107,6 +113,7 @@ class Dog extends Animal implements ArrayAccess
public function __construct(array $data = null)
{
parent::__construct($data);
if ($data != null) {
$this->breed = $data["breed"];
}

View File

@@ -46,17 +46,23 @@ use \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
* @var string[]
*/
static $swaggerTypes = array(
'tags' => '\Swagger\Client\Model\Tag[]',
'photo_urls' => 'string[]',
'name' => 'string',
'id' => 'int',
'category' => 'object',
'status' => 'string',
'name' => 'string',
'photo_urls' => 'string[]'
'tags' => '\Swagger\Client\Model\Tag[]',
'status' => 'string'
);
static function swaggerTypes() {
@@ -68,12 +74,12 @@ class InlineResponse200 implements ArrayAccess
* @var string[]
*/
static $attributeMap = array(
'tags' => 'tags',
'photo_urls' => 'photoUrls',
'name' => 'name',
'id' => 'id',
'category' => 'category',
'status' => 'status',
'name' => 'name',
'photo_urls' => 'photoUrls'
'tags' => 'tags',
'status' => 'status'
);
static function attributeMap() {
@@ -85,12 +91,12 @@ class InlineResponse200 implements ArrayAccess
* @var string[]
*/
static $setters = array(
'tags' => 'setTags',
'photo_urls' => 'setPhotoUrls',
'name' => 'setName',
'id' => 'setId',
'category' => 'setCategory',
'status' => 'setStatus',
'name' => 'setName',
'photo_urls' => 'setPhotoUrls'
'tags' => 'setTags',
'status' => 'setStatus'
);
static function setters() {
@@ -102,12 +108,12 @@ class InlineResponse200 implements ArrayAccess
* @var string[]
*/
static $getters = array(
'tags' => 'getTags',
'photo_urls' => 'getPhotoUrls',
'name' => 'getName',
'id' => 'getId',
'category' => 'getCategory',
'status' => 'getStatus',
'name' => 'getName',
'photo_urls' => 'getPhotoUrls'
'tags' => 'getTags',
'status' => 'getStatus'
);
static function getters() {
@@ -115,10 +121,15 @@ class InlineResponse200 implements ArrayAccess
}
/**
* $tags
* @var \Swagger\Client\Model\Tag[]
* $photo_urls
* @var string[]
*/
protected $tags;
protected $photo_urls;
/**
* $name
* @var string
*/
protected $name;
/**
* $id
* @var int
@@ -129,21 +140,16 @@ class InlineResponse200 implements ArrayAccess
* @var object
*/
protected $category;
/**
* $tags
* @var \Swagger\Client\Model\Tag[]
*/
protected $tags;
/**
* $status pet status in the store
* @var string
*/
protected $status;
/**
* $name
* @var string
*/
protected $name;
/**
* $photo_urls
* @var string[]
*/
protected $photo_urls;
/**
* Constructor
@@ -152,33 +158,54 @@ class InlineResponse200 implements ArrayAccess
public function __construct(array $data = null)
{
if ($data != null) {
$this->tags = $data["tags"];
$this->photo_urls = $data["photo_urls"];
$this->name = $data["name"];
$this->id = $data["id"];
$this->category = $data["category"];
$this->tags = $data["tags"];
$this->status = $data["status"];
$this->name = $data["name"];
$this->photo_urls = $data["photo_urls"];
}
}
/**
* Gets tags
* @return \Swagger\Client\Model\Tag[]
* Gets photo_urls
* @return string[]
*/
public function getTags()
public function getPhotoUrls()
{
return $this->tags;
return $this->photo_urls;
}
/**
* Sets tags
* @param \Swagger\Client\Model\Tag[] $tags
* Sets photo_urls
* @param string[] $photo_urls
* @return $this
*/
public function setTags($tags)
public function setPhotoUrls($photo_urls)
{
$this->tags = $tags;
$this->photo_urls = $photo_urls;
return $this;
}
/**
* Gets name
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Sets name
* @param string $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
@@ -221,6 +248,26 @@ class InlineResponse200 implements ArrayAccess
$this->category = $category;
return $this;
}
/**
* Gets tags
* @return \Swagger\Client\Model\Tag[]
*/
public function getTags()
{
return $this->tags;
}
/**
* Sets tags
* @param \Swagger\Client\Model\Tag[] $tags
* @return $this
*/
public function setTags($tags)
{
$this->tags = $tags;
return $this;
}
/**
* Gets status
* @return string
@@ -244,46 +291,6 @@ class InlineResponse200 implements ArrayAccess
$this->status = $status;
return $this;
}
/**
* Gets name
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Sets name
* @param string $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Gets photo_urls
* @return string[]
*/
public function getPhotoUrls()
{
return $this->photo_urls;
}
/**
* Sets photo_urls
* @param string[] $photo_urls
* @return $this
*/
public function setPhotoUrls($photo_urls)
{
$this->photo_urls = $photo_urls;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
* @param integer $offset Offset

View File

@@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class Model200Response implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = '200_response';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@@ -107,6 +113,7 @@ class Model200Response implements ArrayAccess
public function __construct(array $data = null)
{
if ($data != null) {
$this->name = $data["name"];
}

View File

@@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class ModelReturn implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'Return';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@@ -107,6 +113,7 @@ class ModelReturn implements ArrayAccess
public function __construct(array $data = null)
{
if ($data != null) {
$this->return = $data["return"];
}

View File

@@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class Name implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'Name';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@@ -116,6 +122,7 @@ class Name implements ArrayAccess
public function __construct(array $data = null)
{
if ($data != null) {
$this->name = $data["name"];
$this->snake_case = $data["snake_case"];

View File

@@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class Order implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'Order';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@@ -152,6 +158,7 @@ class Order implements ArrayAccess
public function __construct(array $data = null)
{
if ($data != null) {
$this->id = $data["id"];
$this->pet_id = $data["pet_id"];

View File

@@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class Pet implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'Pet';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@@ -152,6 +158,7 @@ class Pet implements ArrayAccess
public function __construct(array $data = null)
{
if ($data != null) {
$this->id = $data["id"];
$this->category = $data["category"];

View File

@@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class SpecialModelName implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = '$special[model.name]';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@@ -107,6 +113,7 @@ class SpecialModelName implements ArrayAccess
public function __construct(array $data = null)
{
if ($data != null) {
$this->special_property_name = $data["special_property_name"];
}

View File

@@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class Tag implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'Tag';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@@ -116,6 +122,7 @@ class Tag implements ArrayAccess
public function __construct(array $data = null)
{
if ($data != null) {
$this->id = $data["id"];
$this->name = $data["name"];

View File

@@ -46,6 +46,12 @@ use \ArrayAccess;
*/
class User implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'User';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
@@ -170,6 +176,7 @@ class User implements ArrayAccess
public function __construct(array $data = null)
{
if ($data != null) {
$this->id = $data["id"];
$this->username = $data["username"];