Dump off the swaggerIo generator with tests removed and fix for Round->loser and Round->dicerolls

This commit is contained in:
Tim
2021-11-25 18:24:54 +01:00
commit 8d925075da
30 changed files with 7795 additions and 0 deletions

321
lib/Model/GameIsStarted.php Normal file
View File

@ -0,0 +1,321 @@
<?php
/**
* GameIsStarted
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Perudo API
*
* Play perudo with your friends through the api!
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.30
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
use \ArrayAccess;
use \Swagger\Client\ObjectSerializer;
/**
* GameIsStarted Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class GameIsStarted implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'GameIsStarted';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'started' => 'bool',
'game_state' => '\Swagger\Client\Model\GameState' ];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'started' => null,
'game_state' => null ];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'started' => 'started',
'game_state' => 'gameState' ];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'started' => 'setStarted',
'game_state' => 'setGameState' ];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'started' => 'getStarted',
'game_state' => 'getGameState' ];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['started'] = isset($data['started']) ? $data['started'] : null;
$this->container['game_state'] = isset($data['game_state']) ? $data['game_state'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets started
*
* @return bool
*/
public function getStarted()
{
return $this->container['started'];
}
/**
* Sets started
*
* @param bool $started started
*
* @return $this
*/
public function setStarted($started)
{
$this->container['started'] = $started;
return $this;
}
/**
* Gets game_state
*
* @return \Swagger\Client\Model\GameState
*/
public function getGameState()
{
return $this->container['game_state'];
}
/**
* Sets game_state
*
* @param \Swagger\Client\Model\GameState $game_state game_state
*
* @return $this
*/
public function setGameState($game_state)
{
$this->container['game_state'] = $game_state;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

471
lib/Model/GameRules.php Normal file
View File

@ -0,0 +1,471 @@
<?php
/**
* GameRules
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Perudo API
*
* Play perudo with your friends through the api!
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.30
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
use \ArrayAccess;
use \Swagger\Client\ObjectSerializer;
/**
* GameRules Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class GameRules implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'GameRules';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'start_dice_per_player' => 'int',
'higher_count_lower_value' => 'bool',
'joker_counts_double' => 'bool',
'has_joker' => 'bool',
'has_palifico' => 'bool',
'has_calza' => 'bool',
'joker_die_value' => 'int' ];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'start_dice_per_player' => null,
'higher_count_lower_value' => null,
'joker_counts_double' => null,
'has_joker' => null,
'has_palifico' => null,
'has_calza' => null,
'joker_die_value' => null ];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'start_dice_per_player' => 'startDicePerPlayer',
'higher_count_lower_value' => 'higherCountLowerValue',
'joker_counts_double' => 'jokerCountsDouble',
'has_joker' => 'hasJoker',
'has_palifico' => 'hasPalifico',
'has_calza' => 'hasCalza',
'joker_die_value' => 'jokerDieValue' ];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'start_dice_per_player' => 'setStartDicePerPlayer',
'higher_count_lower_value' => 'setHigherCountLowerValue',
'joker_counts_double' => 'setJokerCountsDouble',
'has_joker' => 'setHasJoker',
'has_palifico' => 'setHasPalifico',
'has_calza' => 'setHasCalza',
'joker_die_value' => 'setJokerDieValue' ];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'start_dice_per_player' => 'getStartDicePerPlayer',
'higher_count_lower_value' => 'getHigherCountLowerValue',
'joker_counts_double' => 'getJokerCountsDouble',
'has_joker' => 'getHasJoker',
'has_palifico' => 'getHasPalifico',
'has_calza' => 'getHasCalza',
'joker_die_value' => 'getJokerDieValue' ];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['start_dice_per_player'] = isset($data['start_dice_per_player']) ? $data['start_dice_per_player'] : null;
$this->container['higher_count_lower_value'] = isset($data['higher_count_lower_value']) ? $data['higher_count_lower_value'] : null;
$this->container['joker_counts_double'] = isset($data['joker_counts_double']) ? $data['joker_counts_double'] : null;
$this->container['has_joker'] = isset($data['has_joker']) ? $data['has_joker'] : null;
$this->container['has_palifico'] = isset($data['has_palifico']) ? $data['has_palifico'] : null;
$this->container['has_calza'] = isset($data['has_calza']) ? $data['has_calza'] : null;
$this->container['joker_die_value'] = isset($data['joker_die_value']) ? $data['joker_die_value'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets start_dice_per_player
*
* @return int
*/
public function getStartDicePerPlayer()
{
return $this->container['start_dice_per_player'];
}
/**
* Sets start_dice_per_player
*
* @param int $start_dice_per_player start_dice_per_player
*
* @return $this
*/
public function setStartDicePerPlayer($start_dice_per_player)
{
$this->container['start_dice_per_player'] = $start_dice_per_player;
return $this;
}
/**
* Gets higher_count_lower_value
*
* @return bool
*/
public function getHigherCountLowerValue()
{
return $this->container['higher_count_lower_value'];
}
/**
* Sets higher_count_lower_value
*
* @param bool $higher_count_lower_value higher_count_lower_value
*
* @return $this
*/
public function setHigherCountLowerValue($higher_count_lower_value)
{
$this->container['higher_count_lower_value'] = $higher_count_lower_value;
return $this;
}
/**
* Gets joker_counts_double
*
* @return bool
*/
public function getJokerCountsDouble()
{
return $this->container['joker_counts_double'];
}
/**
* Sets joker_counts_double
*
* @param bool $joker_counts_double joker_counts_double
*
* @return $this
*/
public function setJokerCountsDouble($joker_counts_double)
{
$this->container['joker_counts_double'] = $joker_counts_double;
return $this;
}
/**
* Gets has_joker
*
* @return bool
*/
public function getHasJoker()
{
return $this->container['has_joker'];
}
/**
* Sets has_joker
*
* @param bool $has_joker has_joker
*
* @return $this
*/
public function setHasJoker($has_joker)
{
$this->container['has_joker'] = $has_joker;
return $this;
}
/**
* Gets has_palifico
*
* @return bool
*/
public function getHasPalifico()
{
return $this->container['has_palifico'];
}
/**
* Sets has_palifico
*
* @param bool $has_palifico has_palifico
*
* @return $this
*/
public function setHasPalifico($has_palifico)
{
$this->container['has_palifico'] = $has_palifico;
return $this;
}
/**
* Gets has_calza
*
* @return bool
*/
public function getHasCalza()
{
return $this->container['has_calza'];
}
/**
* Sets has_calza
*
* @param bool $has_calza has_calza
*
* @return $this
*/
public function setHasCalza($has_calza)
{
$this->container['has_calza'] = $has_calza;
return $this;
}
/**
* Gets joker_die_value
*
* @return int
*/
public function getJokerDieValue()
{
return $this->container['joker_die_value'];
}
/**
* Sets joker_die_value
*
* @param int $joker_die_value joker_die_value
*
* @return $this
*/
public function setJokerDieValue($joker_die_value)
{
$this->container['joker_die_value'] = $joker_die_value;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

471
lib/Model/GameState.php Normal file
View File

@ -0,0 +1,471 @@
<?php
/**
* GameState
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Perudo API
*
* Play perudo with your friends through the api!
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.30
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
use \ArrayAccess;
use \Swagger\Client\ObjectSerializer;
/**
* GameState Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class GameState implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'GameState';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'state' => 'string',
'code' => 'string',
'rounds' => '\Swagger\Client\Model\Round[]',
'players' => '\Swagger\Client\Model\Player[]',
'current_player' => '\Swagger\Client\Model\Player',
'owning_player' => '\Swagger\Client\Model\Player',
'rules' => '\Swagger\Client\Model\GameRules' ];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'state' => null,
'code' => null,
'rounds' => null,
'players' => null,
'current_player' => null,
'owning_player' => null,
'rules' => null ];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'state' => 'state',
'code' => 'code',
'rounds' => 'rounds',
'players' => 'players',
'current_player' => 'currentPlayer',
'owning_player' => 'owningPlayer',
'rules' => 'rules' ];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'state' => 'setState',
'code' => 'setCode',
'rounds' => 'setRounds',
'players' => 'setPlayers',
'current_player' => 'setCurrentPlayer',
'owning_player' => 'setOwningPlayer',
'rules' => 'setRules' ];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'state' => 'getState',
'code' => 'getCode',
'rounds' => 'getRounds',
'players' => 'getPlayers',
'current_player' => 'getCurrentPlayer',
'owning_player' => 'getOwningPlayer',
'rules' => 'getRules' ];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['state'] = isset($data['state']) ? $data['state'] : null;
$this->container['code'] = isset($data['code']) ? $data['code'] : null;
$this->container['rounds'] = isset($data['rounds']) ? $data['rounds'] : null;
$this->container['players'] = isset($data['players']) ? $data['players'] : null;
$this->container['current_player'] = isset($data['current_player']) ? $data['current_player'] : null;
$this->container['owning_player'] = isset($data['owning_player']) ? $data['owning_player'] : null;
$this->container['rules'] = isset($data['rules']) ? $data['rules'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets state
*
* @return string
*/
public function getState()
{
return $this->container['state'];
}
/**
* Sets state
*
* @param string $state state
*
* @return $this
*/
public function setState($state)
{
$this->container['state'] = $state;
return $this;
}
/**
* Gets code
*
* @return string
*/
public function getCode()
{
return $this->container['code'];
}
/**
* Sets code
*
* @param string $code code
*
* @return $this
*/
public function setCode($code)
{
$this->container['code'] = $code;
return $this;
}
/**
* Gets rounds
*
* @return \Swagger\Client\Model\Round[]
*/
public function getRounds()
{
return $this->container['rounds'];
}
/**
* Sets rounds
*
* @param \Swagger\Client\Model\Round[] $rounds rounds
*
* @return $this
*/
public function setRounds($rounds)
{
$this->container['rounds'] = $rounds;
return $this;
}
/**
* Gets players
*
* @return \Swagger\Client\Model\Player[]
*/
public function getPlayers()
{
return $this->container['players'];
}
/**
* Sets players
*
* @param \Swagger\Client\Model\Player[] $players players
*
* @return $this
*/
public function setPlayers($players)
{
$this->container['players'] = $players;
return $this;
}
/**
* Gets current_player
*
* @return \Swagger\Client\Model\Player
*/
public function getCurrentPlayer()
{
return $this->container['current_player'];
}
/**
* Sets current_player
*
* @param \Swagger\Client\Model\Player $current_player current_player
*
* @return $this
*/
public function setCurrentPlayer($current_player)
{
$this->container['current_player'] = $current_player;
return $this;
}
/**
* Gets owning_player
*
* @return \Swagger\Client\Model\Player
*/
public function getOwningPlayer()
{
return $this->container['owning_player'];
}
/**
* Sets owning_player
*
* @param \Swagger\Client\Model\Player $owning_player owning_player
*
* @return $this
*/
public function setOwningPlayer($owning_player)
{
$this->container['owning_player'] = $owning_player;
return $this;
}
/**
* Gets rules
*
* @return \Swagger\Client\Model\GameRules
*/
public function getRules()
{
return $this->container['rules'];
}
/**
* Sets rules
*
* @param \Swagger\Client\Model\GameRules $rules rules
*
* @return $this
*/
public function setRules($rules)
{
$this->container['rules'] = $rules;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View File

@ -0,0 +1,321 @@
<?php
/**
* MessageResponse
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Perudo API
*
* Play perudo with your friends through the api!
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.30
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
use \ArrayAccess;
use \Swagger\Client\ObjectSerializer;
/**
* MessageResponse Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class MessageResponse implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'MessageResponse';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'message' => 'string',
'errors' => 'string[]' ];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'message' => null,
'errors' => null ];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'message' => 'message',
'errors' => 'errors' ];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'message' => 'setMessage',
'errors' => 'setErrors' ];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'message' => 'getMessage',
'errors' => 'getErrors' ];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['message'] = isset($data['message']) ? $data['message'] : null;
$this->container['errors'] = isset($data['errors']) ? $data['errors'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets message
*
* @return string
*/
public function getMessage()
{
return $this->container['message'];
}
/**
* Sets message
*
* @param string $message message
*
* @return $this
*/
public function setMessage($message)
{
$this->container['message'] = $message;
return $this;
}
/**
* Gets errors
*
* @return string[]
*/
public function getErrors()
{
return $this->container['errors'];
}
/**
* Sets errors
*
* @param string[] $errors errors
*
* @return $this
*/
public function setErrors($errors)
{
$this->container['errors'] = $errors;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View File

@ -0,0 +1,95 @@
<?php
/**
* ModelInterface
*
* PHP version 5
*
* @category Class
* @package Swagger\Client\Model
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Perudo API
*
* Play perudo with your friends through the api!
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.30
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
/**
* Interface abstracting model access.
*
* @package Swagger\Client\Model
* @author Swagger Codegen team
*/
interface ModelInterface
{
/**
* The original name of the model.
*
* @return string
*/
public function getModelName();
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes();
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats();
/**
* Array of attributes where the key is the local name, and the value is the original name
*
* @return array
*/
public static function attributeMap();
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters();
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters();
/**
* Show all the invalid properties with reasons.
*
* @return array
*/
public function listInvalidProperties();
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool
*/
public function valid();
}

351
lib/Model/MyTurn.php Normal file
View File

@ -0,0 +1,351 @@
<?php
/**
* MyTurn
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Perudo API
*
* Play perudo with your friends through the api!
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.30
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
use \ArrayAccess;
use \Swagger\Client\ObjectSerializer;
/**
* MyTurn Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class MyTurn implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'MyTurn';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'turn' => 'bool',
'game_state' => '\Swagger\Client\Model\GameState',
'errors' => 'string[]' ];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'turn' => null,
'game_state' => null,
'errors' => null ];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'turn' => 'turn',
'game_state' => 'gameState',
'errors' => 'errors' ];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'turn' => 'setTurn',
'game_state' => 'setGameState',
'errors' => 'setErrors' ];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'turn' => 'getTurn',
'game_state' => 'getGameState',
'errors' => 'getErrors' ];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['turn'] = isset($data['turn']) ? $data['turn'] : null;
$this->container['game_state'] = isset($data['game_state']) ? $data['game_state'] : null;
$this->container['errors'] = isset($data['errors']) ? $data['errors'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets turn
*
* @return bool
*/
public function getTurn()
{
return $this->container['turn'];
}
/**
* Sets turn
*
* @param bool $turn turn
*
* @return $this
*/
public function setTurn($turn)
{
$this->container['turn'] = $turn;
return $this;
}
/**
* Gets game_state
*
* @return \Swagger\Client\Model\GameState
*/
public function getGameState()
{
return $this->container['game_state'];
}
/**
* Sets game_state
*
* @param \Swagger\Client\Model\GameState $game_state game_state
*
* @return $this
*/
public function setGameState($game_state)
{
$this->container['game_state'] = $game_state;
return $this;
}
/**
* Gets errors
*
* @return string[]
*/
public function getErrors()
{
return $this->container['errors'];
}
/**
* Sets errors
*
* @param string[] $errors errors
*
* @return $this
*/
public function setErrors($errors)
{
$this->container['errors'] = $errors;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

351
lib/Model/Player.php Normal file
View File

@ -0,0 +1,351 @@
<?php
/**
* Player
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Perudo API
*
* Play perudo with your friends through the api!
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.30
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
use \ArrayAccess;
use \Swagger\Client\ObjectSerializer;
/**
* Player Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class Player implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'Player';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'id' => 'string',
'hash' => 'string',
'name' => 'string' ];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'id' => null,
'hash' => null,
'name' => null ];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'id' => 'id',
'hash' => 'hash',
'name' => 'name' ];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'id' => 'setId',
'hash' => 'setHash',
'name' => 'setName' ];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'id' => 'getId',
'hash' => 'getHash',
'name' => 'getName' ];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['id'] = isset($data['id']) ? $data['id'] : null;
$this->container['hash'] = isset($data['hash']) ? $data['hash'] : null;
$this->container['name'] = isset($data['name']) ? $data['name'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets id
*
* @return string
*/
public function getId()
{
return $this->container['id'];
}
/**
* Sets id
*
* @param string $id id
*
* @return $this
*/
public function setId($id)
{
$this->container['id'] = $id;
return $this;
}
/**
* Gets hash
*
* @return string
*/
public function getHash()
{
return $this->container['hash'];
}
/**
* Sets hash
*
* @param string $hash hash
*
* @return $this
*/
public function setHash($hash)
{
$this->container['hash'] = $hash;
return $this;
}
/**
* Gets name
*
* @return string
*/
public function getName()
{
return $this->container['name'];
}
/**
* Sets name
*
* @param string $name name
*
* @return $this
*/
public function setName($name)
{
$this->container['name'] = $name;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

351
lib/Model/PlayerCode.php Normal file
View File

@ -0,0 +1,351 @@
<?php
/**
* PlayerCode
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Perudo API
*
* Play perudo with your friends through the api!
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.30
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
use \ArrayAccess;
use \Swagger\Client\ObjectSerializer;
/**
* PlayerCode Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class PlayerCode implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'PlayerCode';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'player' => '\Swagger\Client\Model\Player',
'code' => 'string',
'errors' => 'string[]' ];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'player' => null,
'code' => null,
'errors' => null ];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'player' => 'player',
'code' => 'code',
'errors' => 'errors' ];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'player' => 'setPlayer',
'code' => 'setCode',
'errors' => 'setErrors' ];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'player' => 'getPlayer',
'code' => 'getCode',
'errors' => 'getErrors' ];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['player'] = isset($data['player']) ? $data['player'] : null;
$this->container['code'] = isset($data['code']) ? $data['code'] : null;
$this->container['errors'] = isset($data['errors']) ? $data['errors'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets player
*
* @return \Swagger\Client\Model\Player
*/
public function getPlayer()
{
return $this->container['player'];
}
/**
* Sets player
*
* @param \Swagger\Client\Model\Player $player player
*
* @return $this
*/
public function setPlayer($player)
{
$this->container['player'] = $player;
return $this;
}
/**
* Gets code
*
* @return string
*/
public function getCode()
{
return $this->container['code'];
}
/**
* Sets code
*
* @param string $code code
*
* @return $this
*/
public function setCode($code)
{
$this->container['code'] = $code;
return $this;
}
/**
* Gets errors
*
* @return string[]
*/
public function getErrors()
{
return $this->container['errors'];
}
/**
* Sets errors
*
* @param string[] $errors errors
*
* @return $this
*/
public function setErrors($errors)
{
$this->container['errors'] = $errors;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

327
lib/Model/PlayerGuess.php Normal file
View File

@ -0,0 +1,327 @@
<?php
/**
* PlayerGuess
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Perudo API
*
* Play perudo with your friends through the api!
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.30
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
use \ArrayAccess;
use \Swagger\Client\ObjectSerializer;
/**
* PlayerGuess Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class PlayerGuess implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'PlayerGuess';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'dice_count' => 'int',
'die_value' => 'int' ];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'dice_count' => null,
'die_value' => null ];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'dice_count' => 'diceCount',
'die_value' => 'dieValue' ];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'dice_count' => 'setDiceCount',
'die_value' => 'setDieValue' ];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'dice_count' => 'getDiceCount',
'die_value' => 'getDieValue' ];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['dice_count'] = isset($data['dice_count']) ? $data['dice_count'] : null;
$this->container['die_value'] = isset($data['die_value']) ? $data['die_value'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
if ($this->container['dice_count'] === null) {
$invalidProperties[] = "'dice_count' can't be null";
}
if ($this->container['die_value'] === null) {
$invalidProperties[] = "'die_value' can't be null";
}
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets dice_count
*
* @return int
*/
public function getDiceCount()
{
return $this->container['dice_count'];
}
/**
* Sets dice_count
*
* @param int $dice_count dice_count
*
* @return $this
*/
public function setDiceCount($dice_count)
{
$this->container['dice_count'] = $dice_count;
return $this;
}
/**
* Gets die_value
*
* @return int
*/
public function getDieValue()
{
return $this->container['die_value'];
}
/**
* Sets die_value
*
* @param int $die_value die_value
*
* @return $this
*/
public function setDieValue($die_value)
{
$this->container['die_value'] = $die_value;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

411
lib/Model/Round.php Normal file
View File

@ -0,0 +1,411 @@
<?php
/**
* Round
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Perudo API
*
* Play perudo with your friends through the api!
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.30
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
use \ArrayAccess;
use \Swagger\Client\ObjectSerializer;
/**
* Round Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class Round implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'Round';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'number' => 'int',
'turns' => '\Swagger\Client\Model\Turn[]',
'loser' => '\Swagger\Client\Model\Player',
'my_rolls' => 'int[]',
'rolls' => 'int[][]' ];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'number' => null,
'turns' => null,
'loser' => null,
'my_rolls' => null,
'rolls' => null ];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'number' => 'number',
'turns' => 'turns',
'loser' => 'loser',
'my_rolls' => 'myRolls',
'rolls' => 'rolls' ];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'number' => 'setNumber',
'turns' => 'setTurns',
'loser' => 'setLoser',
'my_rolls' => 'setMyRolls',
'rolls' => 'setRolls' ];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'number' => 'getNumber',
'turns' => 'getTurns',
'loser' => 'getLoser',
'my_rolls' => 'getMyRolls',
'rolls' => 'getRolls' ];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['number'] = isset($data['number']) ? $data['number'] : null;
$this->container['turns'] = isset($data['turns']) ? $data['turns'] : null;
$this->container['loser'] = isset($data['loser']) ? $data['loser'] : null;
$this->container['my_rolls'] = isset($data['my_rolls']) ? $data['my_rolls'] : null;
$this->container['rolls'] = isset($data['rolls']) ? $data['rolls'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets number
*
* @return int
*/
public function getNumber()
{
return $this->container['number'];
}
/**
* Sets number
*
* @param int $number number
*
* @return $this
*/
public function setNumber($number)
{
$this->container['number'] = $number;
return $this;
}
/**
* Gets turns
*
* @return \Swagger\Client\Model\Turn[]
*/
public function getTurns()
{
return $this->container['turns'];
}
/**
* Sets turns
*
* @param \Swagger\Client\Model\Turn[] $turns turns
*
* @return $this
*/
public function setTurns($turns)
{
$this->container['turns'] = $turns;
return $this;
}
/**
* Gets loser
*
* @return AllOfRoundLoser
*/
public function getLoser()
{
return $this->container['loser'];
}
/**
* Sets loser
*
* @param AllOfRoundLoser $loser loser
*
* @return $this
*/
public function setLoser($loser)
{
$this->container['loser'] = $loser;
return $this;
}
/**
* Gets my_rolls
*
* @return int[][]
*/
public function getMyRolls()
{
return $this->container['my_rolls'];
}
/**
* Sets my_rolls
*
* @param int[][] $my_rolls my_rolls
*
* @return $this
*/
public function setMyRolls($my_rolls)
{
$this->container['my_rolls'] = $my_rolls;
return $this;
}
/**
* Gets rolls
*
* @return int[]
*/
public function getRolls()
{
return $this->container['rolls'];
}
/**
* Sets rolls
*
* @param int[] $rolls rolls
*
* @return $this
*/
public function setRolls($rolls)
{
$this->container['rolls'] = $rolls;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

381
lib/Model/Turn.php Normal file
View File

@ -0,0 +1,381 @@
<?php
/**
* Turn
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Perudo API
*
* Play perudo with your friends through the api!
*
* OpenAPI spec version: 1.0.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 3.0.30
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
use \ArrayAccess;
use \Swagger\Client\ObjectSerializer;
/**
* Turn Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class Turn implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'Turn';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'number' => 'int',
'player' => '\Swagger\Client\Model\Player',
'dice_count' => 'int',
'die_value' => 'int' ];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'number' => null,
'player' => null,
'dice_count' => null,
'die_value' => null ];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'number' => 'number',
'player' => 'player',
'dice_count' => 'diceCount',
'die_value' => 'dieValue' ];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'number' => 'setNumber',
'player' => 'setPlayer',
'dice_count' => 'setDiceCount',
'die_value' => 'setDieValue' ];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'number' => 'getNumber',
'player' => 'getPlayer',
'dice_count' => 'getDiceCount',
'die_value' => 'getDieValue' ];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['number'] = isset($data['number']) ? $data['number'] : null;
$this->container['player'] = isset($data['player']) ? $data['player'] : null;
$this->container['dice_count'] = isset($data['dice_count']) ? $data['dice_count'] : null;
$this->container['die_value'] = isset($data['die_value']) ? $data['die_value'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets number
*
* @return int
*/
public function getNumber()
{
return $this->container['number'];
}
/**
* Sets number
*
* @param int $number number
*
* @return $this
*/
public function setNumber($number)
{
$this->container['number'] = $number;
return $this;
}
/**
* Gets player
*
* @return \Swagger\Client\Model\Player
*/
public function getPlayer()
{
return $this->container['player'];
}
/**
* Sets player
*
* @param \Swagger\Client\Model\Player $player player
*
* @return $this
*/
public function setPlayer($player)
{
$this->container['player'] = $player;
return $this;
}
/**
* Gets dice_count
*
* @return int
*/
public function getDiceCount()
{
return $this->container['dice_count'];
}
/**
* Sets dice_count
*
* @param int $dice_count dice_count
*
* @return $this
*/
public function setDiceCount($dice_count)
{
$this->container['dice_count'] = $dice_count;
return $this;
}
/**
* Gets die_value
*
* @return int
*/
public function getDieValue()
{
return $this->container['die_value'];
}
/**
* Sets die_value
*
* @param int $die_value die_value
*
* @return $this
*/
public function setDieValue($die_value)
{
$this->container['die_value'] = $die_value;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}