forked from loafle/openapi-generator-original
formate the module.mustache
This commit is contained in:
parent
df1d36cf47
commit
9efef02d5f
@ -163,14 +163,18 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
|
||||
public function list_invalid_properties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
{{#vars}}{{#required}}
|
||||
{{#vars}}
|
||||
{{#required}}
|
||||
if ($this->container['{{name}}'] === null) {
|
||||
$invalid_properties[] = "'${{name}}' can't be null";
|
||||
}{{/required}}
|
||||
{{#isEnum}}$allowed_values = array({{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}});
|
||||
}
|
||||
{{/required}}
|
||||
{{#isEnum}}
|
||||
$allowed_values = array({{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}});
|
||||
if (!in_array($this->container['{{name}}'], $allowed_values))) {
|
||||
$invalid_properties[] = "invalid value for '${{name}}', must be one of #{allowed_values}.";
|
||||
}{{/isEnum}}
|
||||
}
|
||||
{{/isEnum}}
|
||||
{{#hasValidation}}
|
||||
{{#maxLength}}
|
||||
if (strlen($this->container['{{name}}']) > {{maxLength}}) {
|
||||
@ -196,7 +200,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
|
||||
if (!preg_match("{{pattern}}", $this->container['{{name}}'])) {
|
||||
$invalid_properties[] = "invalid value for '${{name}}', must be conform to the pattern {{pattern}}.";
|
||||
}
|
||||
{{/pattern}}{{/hasValidation}}{{/vars}}
|
||||
{{/pattern}}
|
||||
{{/hasValidation}}
|
||||
{{/vars}}
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
@ -208,11 +214,13 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
{{#vars}}{{#required}}
|
||||
{{#vars}}
|
||||
{{#required}}
|
||||
if ($this->container['{{name}}'] === null) {
|
||||
return false;
|
||||
}{{/required}}
|
||||
{{#isEnum}}$allowed_values = array({{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}});
|
||||
{{#isEnum}}
|
||||
$allowed_values = array({{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}});
|
||||
if (!in_array($this->container['{{name}}'], $allowed_values))) {
|
||||
return false;
|
||||
}{{/isEnum}}
|
||||
@ -241,7 +249,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
|
||||
if (!preg_match("{{pattern}}", $this->container['{{name}}'])) {
|
||||
return false;
|
||||
}
|
||||
{{/pattern}}{{/hasValidation}}{{/vars}}
|
||||
{{/pattern}}
|
||||
{{/hasValidation}}
|
||||
{{/vars}}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -263,11 +273,12 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
|
||||
*/
|
||||
public function {{setter}}(${{name}})
|
||||
{
|
||||
{{#isEnum}}$allowed_values = array({{#allowableValues}}{{#values}}'{{{this}}}'{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}});
|
||||
{{#isEnum}}
|
||||
$allowed_values = array({{#allowableValues}}{{#values}}'{{{this}}}'{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}});
|
||||
if (!in_array(${{{name}}}, $allowed_values)) {
|
||||
throw new \InvalidArgumentException("Invalid value for '{{name}}', must be one of {{#allowableValues}}{{#values}}'{{{this}}}'{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}");
|
||||
}{{/isEnum}}
|
||||
|
||||
}
|
||||
{{/isEnum}}
|
||||
{{#hasValidation}}
|
||||
{{#maxLength}}
|
||||
if (strlen(${{name}}) > {{maxLength}}) {
|
||||
@ -292,7 +303,8 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
|
||||
if (!preg_match("{{pattern}}", ${{name}})) {
|
||||
throw new \InvalidArgumentException('invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must be conform to the pattern {{pattern}}.');
|
||||
}
|
||||
{{/pattern}}{{/hasValidation}}
|
||||
{{/pattern}}
|
||||
{{/hasValidation}}
|
||||
$this->container['{{name}}'] = ${{name}};
|
||||
|
||||
return $this;
|
||||
|
@ -5,7 +5,7 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git
|
||||
|
||||
- API version: 1.0.0
|
||||
- Package version: 1.0.0
|
||||
- Build date: 2016-05-07T07:50:05.452Z
|
||||
- Build date: 2016-05-07T10:11:34.658Z
|
||||
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
|
||||
|
||||
## Requirements
|
||||
|
@ -142,12 +142,9 @@ class Animal implements ArrayAccess
|
||||
public function list_invalid_properties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
|
||||
if ($this->container['class_name'] === null) {
|
||||
$invalid_properties[] = "'$class_name' can't be null";
|
||||
}
|
||||
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
@ -159,11 +156,9 @@ class Animal implements ArrayAccess
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
|
||||
if ($this->container['class_name'] === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -185,9 +180,6 @@ class Animal implements ArrayAccess
|
||||
*/
|
||||
public function setClassName($class_name)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['class_name'] = $class_name;
|
||||
|
||||
return $this;
|
||||
|
@ -130,7 +130,6 @@ class AnimalFarm implements ArrayAccess
|
||||
public function list_invalid_properties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
@ -142,7 +141,6 @@ class AnimalFarm implements ArrayAccess
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -165,13 +165,6 @@ class ApiResponse implements ArrayAccess
|
||||
public function list_invalid_properties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
@ -183,12 +176,11 @@ class ApiResponse implements ArrayAccess
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -210,9 +202,6 @@ class ApiResponse implements ArrayAccess
|
||||
*/
|
||||
public function setCode($code)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['code'] = $code;
|
||||
|
||||
return $this;
|
||||
@ -233,9 +222,6 @@ class ApiResponse implements ArrayAccess
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['type'] = $type;
|
||||
|
||||
return $this;
|
||||
@ -256,9 +242,6 @@ class ApiResponse implements ArrayAccess
|
||||
*/
|
||||
public function setMessage($message)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['message'] = $message;
|
||||
|
||||
return $this;
|
||||
|
@ -139,9 +139,6 @@ class Cat extends Animal implements ArrayAccess
|
||||
public function list_invalid_properties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
|
||||
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
@ -153,8 +150,7 @@ class Cat extends Animal implements ArrayAccess
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -176,9 +172,6 @@ class Cat extends Animal implements ArrayAccess
|
||||
*/
|
||||
public function setDeclawed($declawed)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['declawed'] = $declawed;
|
||||
|
||||
return $this;
|
||||
|
@ -152,11 +152,6 @@ class Category implements ArrayAccess
|
||||
public function list_invalid_properties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
@ -168,10 +163,9 @@ class Category implements ArrayAccess
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -193,9 +187,6 @@ class Category implements ArrayAccess
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['id'] = $id;
|
||||
|
||||
return $this;
|
||||
@ -216,9 +207,6 @@ class Category implements ArrayAccess
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['name'] = $name;
|
||||
|
||||
return $this;
|
||||
|
@ -139,9 +139,6 @@ class Dog extends Animal implements ArrayAccess
|
||||
public function list_invalid_properties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
|
||||
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
@ -153,8 +150,7 @@ class Dog extends Animal implements ArrayAccess
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -176,9 +172,6 @@ class Dog extends Animal implements ArrayAccess
|
||||
*/
|
||||
public function setBreed($breed)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['breed'] = $breed;
|
||||
|
||||
return $this;
|
||||
|
@ -130,7 +130,6 @@ class EnumClass implements ArrayAccess
|
||||
public function list_invalid_properties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
@ -142,7 +141,6 @@ class EnumClass implements ArrayAccess
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -204,22 +204,18 @@ class EnumTest implements ArrayAccess
|
||||
public function list_invalid_properties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
|
||||
$allowed_values = array("UPPER", "lower");
|
||||
if (!in_array($this->container['enum_string'], $allowed_values))) {
|
||||
$invalid_properties[] = "invalid value for '$enum_string', must be one of #{allowed_values}.";
|
||||
}
|
||||
|
||||
$allowed_values = array("1", "-1");
|
||||
if (!in_array($this->container['enum_integer'], $allowed_values))) {
|
||||
$invalid_properties[] = "invalid value for '$enum_integer', must be one of #{allowed_values}.";
|
||||
}
|
||||
|
||||
$allowed_values = array("1.1", "-1.2");
|
||||
if (!in_array($this->container['enum_number'], $allowed_values))) {
|
||||
$invalid_properties[] = "invalid value for '$enum_number', must be one of #{allowed_values}.";
|
||||
}
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
@ -231,7 +227,7 @@ class EnumTest implements ArrayAccess
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
|
||||
|
||||
$allowed_values = array("UPPER", "lower");
|
||||
if (!in_array($this->container['enum_string'], $allowed_values))) {
|
||||
return false;
|
||||
@ -246,7 +242,6 @@ class EnumTest implements ArrayAccess
|
||||
if (!in_array($this->container['enum_number'], $allowed_values))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -271,8 +266,6 @@ class EnumTest implements ArrayAccess
|
||||
if (!in_array($enum_string, $allowed_values)) {
|
||||
throw new \InvalidArgumentException("Invalid value for 'enum_string', must be one of 'UPPER', 'lower'");
|
||||
}
|
||||
|
||||
|
||||
$this->container['enum_string'] = $enum_string;
|
||||
|
||||
return $this;
|
||||
@ -297,8 +290,6 @@ class EnumTest implements ArrayAccess
|
||||
if (!in_array($enum_integer, $allowed_values)) {
|
||||
throw new \InvalidArgumentException("Invalid value for 'enum_integer', must be one of '1', '-1'");
|
||||
}
|
||||
|
||||
|
||||
$this->container['enum_integer'] = $enum_integer;
|
||||
|
||||
return $this;
|
||||
@ -323,8 +314,6 @@ class EnumTest implements ArrayAccess
|
||||
if (!in_array($enum_number, $allowed_values)) {
|
||||
throw new \InvalidArgumentException("Invalid value for 'enum_number', must be one of '1.1', '-1.2'");
|
||||
}
|
||||
|
||||
|
||||
$this->container['enum_number'] = $enum_number;
|
||||
|
||||
return $this;
|
||||
|
@ -295,84 +295,57 @@ class FormatTest implements ArrayAccess
|
||||
public function list_invalid_properties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
|
||||
|
||||
if ($this->container['integer'] > 100.0) {
|
||||
$invalid_properties[] = "invalid value for '$integer', must be smaller than or equal to 100.0.";
|
||||
}
|
||||
if ($this->container['integer'] < 10.0) {
|
||||
$invalid_properties[] = "invalid value for '$integer', must be bigger than or equal to 10.0.";
|
||||
}
|
||||
|
||||
|
||||
if ($this->container['int32'] > 200.0) {
|
||||
$invalid_properties[] = "invalid value for '$int32', must be smaller than or equal to 200.0.";
|
||||
}
|
||||
if ($this->container['int32'] < 20.0) {
|
||||
$invalid_properties[] = "invalid value for '$int32', must be bigger than or equal to 20.0.";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($this->container['number'] === null) {
|
||||
$invalid_properties[] = "'$number' can't be null";
|
||||
}
|
||||
|
||||
if ($this->container['number'] > 543.2) {
|
||||
$invalid_properties[] = "invalid value for '$number', must be smaller than or equal to 543.2.";
|
||||
}
|
||||
if ($this->container['number'] < 32.1) {
|
||||
$invalid_properties[] = "invalid value for '$number', must be bigger than or equal to 32.1.";
|
||||
}
|
||||
|
||||
|
||||
if ($this->container['float'] > 987.6) {
|
||||
$invalid_properties[] = "invalid value for '$float', must be smaller than or equal to 987.6.";
|
||||
}
|
||||
if ($this->container['float'] < 54.3) {
|
||||
$invalid_properties[] = "invalid value for '$float', must be bigger than or equal to 54.3.";
|
||||
}
|
||||
|
||||
|
||||
if ($this->container['double'] > 123.4) {
|
||||
$invalid_properties[] = "invalid value for '$double', must be smaller than or equal to 123.4.";
|
||||
}
|
||||
if ($this->container['double'] < 67.8) {
|
||||
$invalid_properties[] = "invalid value for '$double', must be bigger than or equal to 67.8.";
|
||||
}
|
||||
|
||||
|
||||
if (!preg_match("/[a-z]/i", $this->container['string'])) {
|
||||
$invalid_properties[] = "invalid value for '$string', must be conform to the pattern /[a-z]/i.";
|
||||
}
|
||||
|
||||
if ($this->container['byte'] === null) {
|
||||
$invalid_properties[] = "'$byte' can't be null";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ($this->container['date'] === null) {
|
||||
$invalid_properties[] = "'$date' can't be null";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ($this->container['password'] === null) {
|
||||
$invalid_properties[] = "'$password' can't be null";
|
||||
}
|
||||
|
||||
if (strlen($this->container['password']) > 64) {
|
||||
$invalid_properties[] = "invalid value for '$password', the character length must be smaller than or equal to 64.";
|
||||
}
|
||||
if (strlen($this->container['password']) < 10) {
|
||||
$invalid_properties[] = "invalid value for '$password', the character length must be bigger than or equal to 10.";
|
||||
}
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
@ -384,8 +357,8 @@ class FormatTest implements ArrayAccess
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
if ($this->container['integer'] > 100.0) {
|
||||
return false;
|
||||
}
|
||||
@ -393,7 +366,7 @@ class FormatTest implements ArrayAccess
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($this->container['int32'] > 200.0) {
|
||||
return false;
|
||||
}
|
||||
@ -401,12 +374,11 @@ class FormatTest implements ArrayAccess
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($this->container['number'] === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if ($this->container['number'] > 543.2) {
|
||||
return false;
|
||||
}
|
||||
@ -414,7 +386,7 @@ class FormatTest implements ArrayAccess
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($this->container['float'] > 987.6) {
|
||||
return false;
|
||||
}
|
||||
@ -422,7 +394,7 @@ class FormatTest implements ArrayAccess
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($this->container['double'] > 123.4) {
|
||||
return false;
|
||||
}
|
||||
@ -430,38 +402,34 @@ class FormatTest implements ArrayAccess
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!preg_match("/[a-z]/i", $this->container['string'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->container['byte'] === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ($this->container['date'] === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ($this->container['password'] === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (strlen($this->container['password']) > 64) {
|
||||
return false;
|
||||
}
|
||||
if (strlen($this->container['password']) < 10) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -482,8 +450,6 @@ class FormatTest implements ArrayAccess
|
||||
*/
|
||||
public function setInteger($integer)
|
||||
{
|
||||
|
||||
|
||||
|
||||
if ($integer > 100.0) {
|
||||
throw new \InvalidArgumentException('invalid value for $integer when calling FormatTest., must be smaller than or equal to 100.0.');
|
||||
@ -491,7 +457,6 @@ class FormatTest implements ArrayAccess
|
||||
if ($integer < 10.0) {
|
||||
throw new \InvalidArgumentException('invalid value for $integer when calling FormatTest., must be bigger than or equal to 10.0.');
|
||||
}
|
||||
|
||||
$this->container['integer'] = $integer;
|
||||
|
||||
return $this;
|
||||
@ -512,8 +477,6 @@ class FormatTest implements ArrayAccess
|
||||
*/
|
||||
public function setInt32($int32)
|
||||
{
|
||||
|
||||
|
||||
|
||||
if ($int32 > 200.0) {
|
||||
throw new \InvalidArgumentException('invalid value for $int32 when calling FormatTest., must be smaller than or equal to 200.0.');
|
||||
@ -521,7 +484,6 @@ class FormatTest implements ArrayAccess
|
||||
if ($int32 < 20.0) {
|
||||
throw new \InvalidArgumentException('invalid value for $int32 when calling FormatTest., must be bigger than or equal to 20.0.');
|
||||
}
|
||||
|
||||
$this->container['int32'] = $int32;
|
||||
|
||||
return $this;
|
||||
@ -542,9 +504,6 @@ class FormatTest implements ArrayAccess
|
||||
*/
|
||||
public function setInt64($int64)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['int64'] = $int64;
|
||||
|
||||
return $this;
|
||||
@ -565,8 +524,6 @@ class FormatTest implements ArrayAccess
|
||||
*/
|
||||
public function setNumber($number)
|
||||
{
|
||||
|
||||
|
||||
|
||||
if ($number > 543.2) {
|
||||
throw new \InvalidArgumentException('invalid value for $number when calling FormatTest., must be smaller than or equal to 543.2.');
|
||||
@ -574,7 +531,6 @@ class FormatTest implements ArrayAccess
|
||||
if ($number < 32.1) {
|
||||
throw new \InvalidArgumentException('invalid value for $number when calling FormatTest., must be bigger than or equal to 32.1.');
|
||||
}
|
||||
|
||||
$this->container['number'] = $number;
|
||||
|
||||
return $this;
|
||||
@ -595,8 +551,6 @@ class FormatTest implements ArrayAccess
|
||||
*/
|
||||
public function setFloat($float)
|
||||
{
|
||||
|
||||
|
||||
|
||||
if ($float > 987.6) {
|
||||
throw new \InvalidArgumentException('invalid value for $float when calling FormatTest., must be smaller than or equal to 987.6.');
|
||||
@ -604,7 +558,6 @@ class FormatTest implements ArrayAccess
|
||||
if ($float < 54.3) {
|
||||
throw new \InvalidArgumentException('invalid value for $float when calling FormatTest., must be bigger than or equal to 54.3.');
|
||||
}
|
||||
|
||||
$this->container['float'] = $float;
|
||||
|
||||
return $this;
|
||||
@ -625,8 +578,6 @@ class FormatTest implements ArrayAccess
|
||||
*/
|
||||
public function setDouble($double)
|
||||
{
|
||||
|
||||
|
||||
|
||||
if ($double > 123.4) {
|
||||
throw new \InvalidArgumentException('invalid value for $double when calling FormatTest., must be smaller than or equal to 123.4.');
|
||||
@ -634,7 +585,6 @@ class FormatTest implements ArrayAccess
|
||||
if ($double < 67.8) {
|
||||
throw new \InvalidArgumentException('invalid value for $double when calling FormatTest., must be bigger than or equal to 67.8.');
|
||||
}
|
||||
|
||||
$this->container['double'] = $double;
|
||||
|
||||
return $this;
|
||||
@ -655,13 +605,10 @@ class FormatTest implements ArrayAccess
|
||||
*/
|
||||
public function setString($string)
|
||||
{
|
||||
|
||||
|
||||
|
||||
if (!preg_match("/[a-z]/i", $string)) {
|
||||
throw new \InvalidArgumentException('invalid value for $string when calling FormatTest., must be conform to the pattern /[a-z]/i.');
|
||||
}
|
||||
|
||||
$this->container['string'] = $string;
|
||||
|
||||
return $this;
|
||||
@ -682,9 +629,6 @@ class FormatTest implements ArrayAccess
|
||||
*/
|
||||
public function setByte($byte)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['byte'] = $byte;
|
||||
|
||||
return $this;
|
||||
@ -705,9 +649,6 @@ class FormatTest implements ArrayAccess
|
||||
*/
|
||||
public function setBinary($binary)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['binary'] = $binary;
|
||||
|
||||
return $this;
|
||||
@ -728,9 +669,6 @@ class FormatTest implements ArrayAccess
|
||||
*/
|
||||
public function setDate($date)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['date'] = $date;
|
||||
|
||||
return $this;
|
||||
@ -751,9 +689,6 @@ class FormatTest implements ArrayAccess
|
||||
*/
|
||||
public function setDateTime($date_time)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['date_time'] = $date_time;
|
||||
|
||||
return $this;
|
||||
@ -774,9 +709,6 @@ class FormatTest implements ArrayAccess
|
||||
*/
|
||||
public function setUuid($uuid)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['uuid'] = $uuid;
|
||||
|
||||
return $this;
|
||||
@ -797,15 +729,12 @@ class FormatTest implements ArrayAccess
|
||||
*/
|
||||
public function setPassword($password)
|
||||
{
|
||||
|
||||
|
||||
if (strlen($password) > 64) {
|
||||
throw new \InvalidArgumentException('invalid length for $password when calling FormatTest., must be smaller than or equal to 64.');
|
||||
}
|
||||
if (strlen($password) < 10) {
|
||||
throw new \InvalidArgumentException('invalid length for $password when calling FormatTest., must be bigger than or equal to 10.');
|
||||
}
|
||||
|
||||
$this->container['password'] = $password;
|
||||
|
||||
return $this;
|
||||
|
@ -139,9 +139,6 @@ class Model200Response implements ArrayAccess
|
||||
public function list_invalid_properties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
|
||||
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
@ -153,8 +150,7 @@ class Model200Response implements ArrayAccess
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -176,9 +172,6 @@ class Model200Response implements ArrayAccess
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['name'] = $name;
|
||||
|
||||
return $this;
|
||||
|
@ -139,9 +139,6 @@ class ModelReturn implements ArrayAccess
|
||||
public function list_invalid_properties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
|
||||
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
@ -153,8 +150,7 @@ class ModelReturn implements ArrayAccess
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -176,9 +172,6 @@ class ModelReturn implements ArrayAccess
|
||||
*/
|
||||
public function setReturn($return)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['return'] = $return;
|
||||
|
||||
return $this;
|
||||
|
@ -165,16 +165,9 @@ class Name implements ArrayAccess
|
||||
public function list_invalid_properties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
|
||||
if ($this->container['name'] === null) {
|
||||
$invalid_properties[] = "'$name' can't be null";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
@ -186,15 +179,13 @@ class Name implements ArrayAccess
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
|
||||
if ($this->container['name'] === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -216,9 +207,6 @@ class Name implements ArrayAccess
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['name'] = $name;
|
||||
|
||||
return $this;
|
||||
@ -239,9 +227,6 @@ class Name implements ArrayAccess
|
||||
*/
|
||||
public function setSnakeCase($snake_case)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['snake_case'] = $snake_case;
|
||||
|
||||
return $this;
|
||||
@ -262,9 +247,6 @@ class Name implements ArrayAccess
|
||||
*/
|
||||
public function setProperty($property)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['property'] = $property;
|
||||
|
||||
return $this;
|
||||
|
@ -219,22 +219,10 @@ class Order implements ArrayAccess
|
||||
public function list_invalid_properties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$allowed_values = array("placed", "approved", "delivered");
|
||||
if (!in_array($this->container['status'], $allowed_values))) {
|
||||
$invalid_properties[] = "invalid value for '$status', must be one of #{allowed_values}.";
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
@ -246,21 +234,20 @@ class Order implements ArrayAccess
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$allowed_values = array("placed", "approved", "delivered");
|
||||
if (!in_array($this->container['status'], $allowed_values))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -282,9 +269,6 @@ class Order implements ArrayAccess
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['id'] = $id;
|
||||
|
||||
return $this;
|
||||
@ -305,9 +289,6 @@ class Order implements ArrayAccess
|
||||
*/
|
||||
public function setPetId($pet_id)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['pet_id'] = $pet_id;
|
||||
|
||||
return $this;
|
||||
@ -328,9 +309,6 @@ class Order implements ArrayAccess
|
||||
*/
|
||||
public function setQuantity($quantity)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['quantity'] = $quantity;
|
||||
|
||||
return $this;
|
||||
@ -351,9 +329,6 @@ class Order implements ArrayAccess
|
||||
*/
|
||||
public function setShipDate($ship_date)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['ship_date'] = $ship_date;
|
||||
|
||||
return $this;
|
||||
@ -378,8 +353,6 @@ class Order implements ArrayAccess
|
||||
if (!in_array($status, $allowed_values)) {
|
||||
throw new \InvalidArgumentException("Invalid value for 'status', must be one of 'placed', 'approved', 'delivered'");
|
||||
}
|
||||
|
||||
|
||||
$this->container['status'] = $status;
|
||||
|
||||
return $this;
|
||||
@ -400,9 +373,6 @@ class Order implements ArrayAccess
|
||||
*/
|
||||
public function setComplete($complete)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['complete'] = $complete;
|
||||
|
||||
return $this;
|
||||
|
@ -219,28 +219,16 @@ class Pet implements ArrayAccess
|
||||
public function list_invalid_properties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ($this->container['name'] === null) {
|
||||
$invalid_properties[] = "'$name' can't be null";
|
||||
}
|
||||
|
||||
|
||||
if ($this->container['photo_urls'] === null) {
|
||||
$invalid_properties[] = "'$photo_urls' can't be null";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$allowed_values = array("available", "pending", "sold");
|
||||
if (!in_array($this->container['status'], $allowed_values))) {
|
||||
$invalid_properties[] = "invalid value for '$status', must be one of #{allowed_values}.";
|
||||
}
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
@ -252,28 +240,25 @@ class Pet implements ArrayAccess
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ($this->container['name'] === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if ($this->container['photo_urls'] === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$allowed_values = array("available", "pending", "sold");
|
||||
if (!in_array($this->container['status'], $allowed_values))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -294,9 +279,6 @@ class Pet implements ArrayAccess
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['id'] = $id;
|
||||
|
||||
return $this;
|
||||
@ -317,9 +299,6 @@ class Pet implements ArrayAccess
|
||||
*/
|
||||
public function setCategory($category)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['category'] = $category;
|
||||
|
||||
return $this;
|
||||
@ -340,9 +319,6 @@ class Pet implements ArrayAccess
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['name'] = $name;
|
||||
|
||||
return $this;
|
||||
@ -363,9 +339,6 @@ class Pet implements ArrayAccess
|
||||
*/
|
||||
public function setPhotoUrls($photo_urls)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['photo_urls'] = $photo_urls;
|
||||
|
||||
return $this;
|
||||
@ -386,9 +359,6 @@ class Pet implements ArrayAccess
|
||||
*/
|
||||
public function setTags($tags)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['tags'] = $tags;
|
||||
|
||||
return $this;
|
||||
@ -413,8 +383,6 @@ class Pet implements ArrayAccess
|
||||
if (!in_array($status, $allowed_values)) {
|
||||
throw new \InvalidArgumentException("Invalid value for 'status', must be one of 'available', 'pending', 'sold'");
|
||||
}
|
||||
|
||||
|
||||
$this->container['status'] = $status;
|
||||
|
||||
return $this;
|
||||
|
@ -139,9 +139,6 @@ class SpecialModelName implements ArrayAccess
|
||||
public function list_invalid_properties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
|
||||
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
@ -153,8 +150,7 @@ class SpecialModelName implements ArrayAccess
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -176,9 +172,6 @@ class SpecialModelName implements ArrayAccess
|
||||
*/
|
||||
public function setSpecialPropertyName($special_property_name)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['special_property_name'] = $special_property_name;
|
||||
|
||||
return $this;
|
||||
|
@ -152,11 +152,6 @@ class Tag implements ArrayAccess
|
||||
public function list_invalid_properties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
@ -168,10 +163,9 @@ class Tag implements ArrayAccess
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -193,9 +187,6 @@ class Tag implements ArrayAccess
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['id'] = $id;
|
||||
|
||||
return $this;
|
||||
@ -216,9 +207,6 @@ class Tag implements ArrayAccess
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['name'] = $name;
|
||||
|
||||
return $this;
|
||||
|
@ -230,23 +230,6 @@ class User implements ArrayAccess
|
||||
public function list_invalid_properties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
@ -258,22 +241,21 @@ class User implements ArrayAccess
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -295,9 +277,6 @@ class User implements ArrayAccess
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['id'] = $id;
|
||||
|
||||
return $this;
|
||||
@ -318,9 +297,6 @@ class User implements ArrayAccess
|
||||
*/
|
||||
public function setUsername($username)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['username'] = $username;
|
||||
|
||||
return $this;
|
||||
@ -341,9 +317,6 @@ class User implements ArrayAccess
|
||||
*/
|
||||
public function setFirstName($first_name)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['first_name'] = $first_name;
|
||||
|
||||
return $this;
|
||||
@ -364,9 +337,6 @@ class User implements ArrayAccess
|
||||
*/
|
||||
public function setLastName($last_name)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['last_name'] = $last_name;
|
||||
|
||||
return $this;
|
||||
@ -387,9 +357,6 @@ class User implements ArrayAccess
|
||||
*/
|
||||
public function setEmail($email)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['email'] = $email;
|
||||
|
||||
return $this;
|
||||
@ -410,9 +377,6 @@ class User implements ArrayAccess
|
||||
*/
|
||||
public function setPassword($password)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['password'] = $password;
|
||||
|
||||
return $this;
|
||||
@ -433,9 +397,6 @@ class User implements ArrayAccess
|
||||
*/
|
||||
public function setPhone($phone)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['phone'] = $phone;
|
||||
|
||||
return $this;
|
||||
@ -456,9 +417,6 @@ class User implements ArrayAccess
|
||||
*/
|
||||
public function setUserStatus($user_status)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->container['user_status'] = $user_status;
|
||||
|
||||
return $this;
|
||||
|
Loading…
x
Reference in New Issue
Block a user