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

212
README.md Normal file
View File

@ -0,0 +1,212 @@
# SwaggerClient-php
Play perudo with your friends through the api!
This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
- API version: 1.0.0
- Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen
## Requirements
PHP 5.5 and later
## Installation & Usage
### Composer
To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`:
```
{
"repositories": [
{
"type": "git",
"url": "http://github.com/GIT_USER_ID/GIT_REPO_ID.git"
}
],
"require": {
"GIT_USER_ID/GIT_REPO_ID": "*@dev"
}
}
```
Then run `composer install`
### Manual Installation
Download the files and include `autoload.php`:
```php
require_once('/path/to/SwaggerClient-php/vendor/autoload.php');
```
## Tests
To run the unit tests:
```
composer install
./vendor/bin/phpunit
```
## Getting Started
Please follow the [installation procedure](#installation--usage) and then run the following:
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$player = "player_example"; // string |
try {
$result = $apiInstance->callTurn($player);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->callTurn: ', $e->getMessage(), PHP_EOL;
}
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$name = "name_example"; // string |
try {
$result = $apiInstance->createGame($name);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->createGame: ', $e->getMessage(), PHP_EOL;
}
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$player = "player_example"; // string |
try {
$result = $apiInstance->gameIsStarted($player);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->gameIsStarted: ', $e->getMessage(), PHP_EOL;
}
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$player = "player_example"; // string |
try {
$result = $apiInstance->getTurn($player);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->getTurn: ', $e->getMessage(), PHP_EOL;
}
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$name = "name_example"; // string |
$code = "code_example"; // string |
try {
$result = $apiInstance->joinGame($name, $code);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->joinGame: ', $e->getMessage(), PHP_EOL;
}
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$player = "player_example"; // string |
$body = new \Swagger\Client\Model\PlayerGuess(); // \Swagger\Client\Model\PlayerGuess |
try {
$result = $apiInstance->postTurn($player, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->postTurn: ', $e->getMessage(), PHP_EOL;
}
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$player = "player_example"; // string |
$body = new \Swagger\Client\Model\GameRules(); // \Swagger\Client\Model\GameRules |
try {
$result = $apiInstance->setGameRules($player, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->setGameRules: ', $e->getMessage(), PHP_EOL;
}
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$player = "player_example"; // string |
try {
$result = $apiInstance->startGame($player);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->startGame: ', $e->getMessage(), PHP_EOL;
}
?>
```
## Documentation for API Endpoints
All URIs are relative to */*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DefaultApi* | [**callTurn**](docs/Api/DefaultApi.md#callturn) | **POST** /player/call/{player} |
*DefaultApi* | [**createGame**](docs/Api/DefaultApi.md#creategame) | **GET** /game/create |
*DefaultApi* | [**gameIsStarted**](docs/Api/DefaultApi.md#gameisstarted) | **GET** /game/started/{player} |
*DefaultApi* | [**getTurn**](docs/Api/DefaultApi.md#getturn) | **GET** /player/turn/{player} |
*DefaultApi* | [**joinGame**](docs/Api/DefaultApi.md#joingame) | **GET** /game/join/{code} |
*DefaultApi* | [**postTurn**](docs/Api/DefaultApi.md#postturn) | **POST** /player/guess/{player} |
*DefaultApi* | [**setGameRules**](docs/Api/DefaultApi.md#setgamerules) | **POST** /game/rules/{player} |
*DefaultApi* | [**startGame**](docs/Api/DefaultApi.md#startgame) | **GET** /game/start/{player} |
## Documentation For Models
- [GameIsStarted](docs/Model/GameIsStarted.md)
- [GameRules](docs/Model/GameRules.md)
- [GameState](docs/Model/GameState.md)
- [MessageResponse](docs/Model/MessageResponse.md)
- [MyTurn](docs/Model/MyTurn.md)
- [Player](docs/Model/Player.md)
- [PlayerCode](docs/Model/PlayerCode.md)
- [PlayerGuess](docs/Model/PlayerGuess.md)
- [Round](docs/Model/Round.md)
- [Turn](docs/Model/Turn.md)
## Documentation For Authorization
All endpoints do not require authorization.
## Author

36
composer.json Normal file
View File

@ -0,0 +1,36 @@
{
"name": "ardent/perudo-php-api",
"description": "",
"keywords": [
"swagger",
"php",
"sdk",
"api"
],
"homepage": "http://swagger.io",
"license": "proprietary",
"authors": [
{
"name": "Swagger and contributors",
"homepage": "https://github.com/swagger-api/swagger-codegen"
}
],
"require": {
"php": ">=5.5",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"guzzlehttp/guzzle": "^6.2"
},
"require-dev": {
"phpunit/phpunit": "^4.8",
"squizlabs/php_codesniffer": "~2.6",
"friendsofphp/php-cs-fixer": "~1.12"
},
"autoload": {
"psr-4": { "Swagger\\Client\\" : "lib/" }
},
"autoload-dev": {
"psr-4": { "Swagger\\Client\\" : "test/" }
}
}

397
docs/Api/DefaultApi.md Normal file
View File

@ -0,0 +1,397 @@
# Swagger\Client\DefaultApi
All URIs are relative to */*
Method | HTTP request | Description
------------- | ------------- | -------------
[**callTurn**](DefaultApi.md#callturn) | **POST** /player/call/{player} |
[**createGame**](DefaultApi.md#creategame) | **GET** /game/create |
[**gameIsStarted**](DefaultApi.md#gameisstarted) | **GET** /game/started/{player} |
[**getTurn**](DefaultApi.md#getturn) | **GET** /player/turn/{player} |
[**joinGame**](DefaultApi.md#joingame) | **GET** /game/join/{code} |
[**postTurn**](DefaultApi.md#postturn) | **POST** /player/guess/{player} |
[**setGameRules**](DefaultApi.md#setgamerules) | **POST** /game/rules/{player} |
[**startGame**](DefaultApi.md#startgame) | **GET** /game/start/{player} |
# **callTurn**
> \Swagger\Client\Model\MyTurn callTurn($player)
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$player = "player_example"; // string |
try {
$result = $apiInstance->callTurn($player);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->callTurn: ', $e->getMessage(), PHP_EOL;
}
?>
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**player** | **string**| |
### Return type
[**\Swagger\Client\Model\MyTurn**](../Model/MyTurn.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
# **createGame**
> \Swagger\Client\Model\PlayerCode createGame($name)
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$name = "name_example"; // string |
try {
$result = $apiInstance->createGame($name);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->createGame: ', $e->getMessage(), PHP_EOL;
}
?>
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | **string**| |
### Return type
[**\Swagger\Client\Model\PlayerCode**](../Model/PlayerCode.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
# **gameIsStarted**
> \Swagger\Client\Model\GameIsStarted gameIsStarted($player)
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$player = "player_example"; // string |
try {
$result = $apiInstance->gameIsStarted($player);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->gameIsStarted: ', $e->getMessage(), PHP_EOL;
}
?>
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**player** | **string**| |
### Return type
[**\Swagger\Client\Model\GameIsStarted**](../Model/GameIsStarted.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
# **getTurn**
> \Swagger\Client\Model\MyTurn getTurn($player)
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$player = "player_example"; // string |
try {
$result = $apiInstance->getTurn($player);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->getTurn: ', $e->getMessage(), PHP_EOL;
}
?>
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**player** | **string**| |
### Return type
[**\Swagger\Client\Model\MyTurn**](../Model/MyTurn.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
# **joinGame**
> \Swagger\Client\Model\PlayerCode joinGame($name, $code)
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$name = "name_example"; // string |
$code = "code_example"; // string |
try {
$result = $apiInstance->joinGame($name, $code);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->joinGame: ', $e->getMessage(), PHP_EOL;
}
?>
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | **string**| |
**code** | **string**| |
### Return type
[**\Swagger\Client\Model\PlayerCode**](../Model/PlayerCode.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
# **postTurn**
> \Swagger\Client\Model\MyTurn postTurn($player, $body)
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$player = "player_example"; // string |
$body = new \Swagger\Client\Model\PlayerGuess(); // \Swagger\Client\Model\PlayerGuess |
try {
$result = $apiInstance->postTurn($player, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->postTurn: ', $e->getMessage(), PHP_EOL;
}
?>
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**player** | **string**| |
**body** | [**\Swagger\Client\Model\PlayerGuess**](../Model/PlayerGuess.md)| | [optional]
### Return type
[**\Swagger\Client\Model\MyTurn**](../Model/MyTurn.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
# **setGameRules**
> \Swagger\Client\Model\MessageResponse setGameRules($player, $body)
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$player = "player_example"; // string |
$body = new \Swagger\Client\Model\GameRules(); // \Swagger\Client\Model\GameRules |
try {
$result = $apiInstance->setGameRules($player, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->setGameRules: ', $e->getMessage(), PHP_EOL;
}
?>
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**player** | **string**| |
**body** | [**\Swagger\Client\Model\GameRules**](../Model/GameRules.md)| | [optional]
### Return type
[**\Swagger\Client\Model\MessageResponse**](../Model/MessageResponse.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
# **startGame**
> \Swagger\Client\Model\MessageResponse startGame($player)
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$player = "player_example"; // string |
try {
$result = $apiInstance->startGame($player);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->startGame: ', $e->getMessage(), PHP_EOL;
}
?>
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**player** | **string**| |
### Return type
[**\Swagger\Client\Model\MessageResponse**](../Model/MessageResponse.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

View File

@ -0,0 +1,8 @@
# AllOfRoundLoser
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# GameIsStarted
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**started** | **bool** | | [optional]
**game_state** | [**\Swagger\Client\Model\GameState**](GameState.md) | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

15
docs/Model/GameRules.md Normal file
View File

@ -0,0 +1,15 @@
# GameRules
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**start_dice_per_player** | **int** | | [optional]
**higher_count_lower_value** | **bool** | | [optional]
**joker_counts_double** | **bool** | | [optional]
**has_joker** | **bool** | | [optional]
**has_palifico** | **bool** | | [optional]
**has_calza** | **bool** | | [optional]
**joker_die_value** | **int** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

15
docs/Model/GameState.md Normal file
View File

@ -0,0 +1,15 @@
# GameState
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**state** | **string** | | [optional]
**code** | **string** | | [optional]
**rounds** | [**\Swagger\Client\Model\Round[]**](Round.md) | | [optional]
**players** | [**\Swagger\Client\Model\Player[]**](Player.md) | | [optional]
**current_player** | [**\Swagger\Client\Model\Player**](Player.md) | | [optional]
**owning_player** | [**\Swagger\Client\Model\Player**](Player.md) | | [optional]
**rules** | [**\Swagger\Client\Model\GameRules**](GameRules.md) | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# MessageResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**message** | **string** | | [optional]
**errors** | **string[]** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

11
docs/Model/MyTurn.md Normal file
View File

@ -0,0 +1,11 @@
# MyTurn
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**turn** | **bool** | | [optional]
**game_state** | [**\Swagger\Client\Model\GameState**](GameState.md) | | [optional]
**errors** | **string[]** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

11
docs/Model/Player.md Normal file
View File

@ -0,0 +1,11 @@
# Player
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **string** | | [optional]
**hash** | **string** | | [optional]
**name** | **string** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

11
docs/Model/PlayerCode.md Normal file
View File

@ -0,0 +1,11 @@
# PlayerCode
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**player** | [**\Swagger\Client\Model\Player**](Player.md) | | [optional]
**code** | **string** | | [optional]
**errors** | **string[]** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

10
docs/Model/PlayerGuess.md Normal file
View File

@ -0,0 +1,10 @@
# PlayerGuess
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**dice_count** | **int** | |
**die_value** | **int** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

13
docs/Model/Round.md Normal file
View File

@ -0,0 +1,13 @@
# Round
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**number** | **int** | | [optional]
**turns** | [**\Swagger\Client\Model\Turn[]**](Turn.md) | | [optional]
**loser** | [**AllOfRoundLoser**](AllOfRoundLoser.md) | | [optional]
**my_rolls** | [**int[][]**](array.md) | | [optional]
**rolls** | **int[]** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

12
docs/Model/Turn.md Normal file
View File

@ -0,0 +1,12 @@
# Turn
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**number** | **int** | | [optional]
**player** | [**\Swagger\Client\Model\Player**](Player.md) | | [optional]
**dice_count** | **int** | | [optional]
**die_value** | **int** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

2198
lib/Api/DefaultApi.php Normal file

File diff suppressed because it is too large Load Diff

120
lib/ApiException.php Normal file
View File

@ -0,0 +1,120 @@
<?php
/**
* ApiException
* 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;
use \Exception;
/**
* ApiException Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class ApiException extends Exception
{
/**
* The HTTP body of the server response either as Json or string.
*
* @var mixed
*/
protected $responseBody;
/**
* The HTTP header of the server response.
*
* @var string[]|null
*/
protected $responseHeaders;
/**
* The deserialized response object
*
* @var $responseObject;
*/
protected $responseObject;
/**
* Constructor
*
* @param string $message Error message
* @param int $code HTTP status code
* @param string[]|null $responseHeaders HTTP response header
* @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string
*/
public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null)
{
parent::__construct($message, $code);
$this->responseHeaders = $responseHeaders;
$this->responseBody = $responseBody;
}
/**
* Gets the HTTP response header
*
* @return string[]|null HTTP response header
*/
public function getResponseHeaders()
{
return $this->responseHeaders;
}
/**
* Gets the HTTP body of the server response either as Json or string
*
* @return mixed HTTP body of the server response either as \stdClass or string
*/
public function getResponseBody()
{
return $this->responseBody;
}
/**
* Sets the deseralized response object (during deserialization)
*
* @param mixed $obj Deserialized response object
*
* @return void
*/
public function setResponseObject($obj)
{
$this->responseObject = $obj;
}
/**
* Gets the deseralized response object (during deserialization)
*
* @return mixed the deserialized response object
*/
public function getResponseObject()
{
return $this->responseObject;
}
}

428
lib/Configuration.php Normal file
View File

@ -0,0 +1,428 @@
<?php
/**
* Configuration
* 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;
/**
* Configuration Class Doc Comment
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class Configuration
{
private static $defaultConfiguration;
/**
* Associate array to store API key(s)
*
* @var string[]
*/
protected $apiKeys = [];
/**
* Associate array to store API prefix (e.g. Bearer)
*
* @var string[]
*/
protected $apiKeyPrefixes = [];
/**
* Access token for OAuth
*
* @var string
*/
protected $accessToken = '';
/**
* Username for HTTP basic authentication
*
* @var string
*/
protected $username = '';
/**
* Password for HTTP basic authentication
*
* @var string
*/
protected $password = '';
/**
* The host
*
* @var string
*/
protected $host = '/';
/**
* User agent of the HTTP request, set to "PHP-Swagger" by default
*
* @var string
*/
protected $userAgent = 'Swagger-Codegen/1.0.0/php';
/**
* Debug switch (default set to false)
*
* @var bool
*/
protected $debug = false;
/**
* Debug file location (log to STDOUT by default)
*
* @var string
*/
protected $debugFile = 'php://output';
/**
* Debug file location (log to STDOUT by default)
*
* @var string
*/
protected $tempFolderPath;
/**
* Constructor
*/
public function __construct()
{
$this->tempFolderPath = sys_get_temp_dir();
}
/**
* Sets API key
*
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
* @param string $key API key or token
*
* @return $this
*/
public function setApiKey($apiKeyIdentifier, $key)
{
$this->apiKeys[$apiKeyIdentifier] = $key;
return $this;
}
/**
* Gets API key
*
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
*
* @return string API key or token
*/
public function getApiKey($apiKeyIdentifier)
{
return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null;
}
/**
* Sets the prefix for API key (e.g. Bearer)
*
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
* @param string $prefix API key prefix, e.g. Bearer
*
* @return $this
*/
public function setApiKeyPrefix($apiKeyIdentifier, $prefix)
{
$this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix;
return $this;
}
/**
* Gets API key prefix
*
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
*
* @return string
*/
public function getApiKeyPrefix($apiKeyIdentifier)
{
return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null;
}
/**
* Sets the access token for OAuth
*
* @param string $accessToken Token for OAuth
*
* @return $this
*/
public function setAccessToken($accessToken)
{
$this->accessToken = $accessToken;
return $this;
}
/**
* Gets the access token for OAuth
*
* @return string Access token for OAuth
*/
public function getAccessToken()
{
return $this->accessToken;
}
/**
* Sets the username for HTTP basic authentication
*
* @param string $username Username for HTTP basic authentication
*
* @return $this
*/
public function setUsername($username)
{
$this->username = $username;
return $this;
}
/**
* Gets the username for HTTP basic authentication
*
* @return string Username for HTTP basic authentication
*/
public function getUsername()
{
return $this->username;
}
/**
* Sets the password for HTTP basic authentication
*
* @param string $password Password for HTTP basic authentication
*
* @return $this
*/
public function setPassword($password)
{
$this->password = $password;
return $this;
}
/**
* Gets the password for HTTP basic authentication
*
* @return string Password for HTTP basic authentication
*/
public function getPassword()
{
return $this->password;
}
/**
* Sets the host
*
* @param string $host Host
*
* @return $this
*/
public function setHost($host)
{
$this->host = $host;
return $this;
}
/**
* Gets the host
*
* @return string Host
*/
public function getHost()
{
return $this->host;
}
/**
* Sets the user agent of the api client
*
* @param string $userAgent the user agent of the api client
*
* @throws \InvalidArgumentException
* @return $this
*/
public function setUserAgent($userAgent)
{
if (!is_string($userAgent)) {
throw new \InvalidArgumentException('User-agent must be a string.');
}
$this->userAgent = $userAgent;
return $this;
}
/**
* Gets the user agent of the api client
*
* @return string user agent
*/
public function getUserAgent()
{
return $this->userAgent;
}
/**
* Sets debug flag
*
* @param bool $debug Debug flag
*
* @return $this
*/
public function setDebug($debug)
{
$this->debug = $debug;
return $this;
}
/**
* Gets the debug flag
*
* @return bool
*/
public function getDebug()
{
return $this->debug;
}
/**
* Sets the debug file
*
* @param string $debugFile Debug file
*
* @return $this
*/
public function setDebugFile($debugFile)
{
$this->debugFile = $debugFile;
return $this;
}
/**
* Gets the debug file
*
* @return string
*/
public function getDebugFile()
{
return $this->debugFile;
}
/**
* Sets the temp folder path
*
* @param string $tempFolderPath Temp folder path
*
* @return $this
*/
public function setTempFolderPath($tempFolderPath)
{
$this->tempFolderPath = $tempFolderPath;
return $this;
}
/**
* Gets the temp folder path
*
* @return string Temp folder path
*/
public function getTempFolderPath()
{
return $this->tempFolderPath;
}
/**
* Gets the default configuration instance
*
* @return Configuration
*/
public static function getDefaultConfiguration()
{
if (self::$defaultConfiguration === null) {
self::$defaultConfiguration = new Configuration();
}
return self::$defaultConfiguration;
}
/**
* Sets the detault configuration instance
*
* @param Configuration $config An instance of the Configuration Object
*
* @return void
*/
public static function setDefaultConfiguration(Configuration $config)
{
self::$defaultConfiguration = $config;
}
/**
* Gets the essential information for debugging
*
* @return string The report for debugging
*/
public static function toDebugReport()
{
$report = 'PHP SDK (Swagger\Client) Debug Report:' . PHP_EOL;
$report .= ' OS: ' . php_uname() . PHP_EOL;
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
$report .= ' OpenAPI Spec Version: 1.0.0' . PHP_EOL;
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;
return $report;
}
/**
* Get API key (with prefix if set)
*
* @param string $apiKeyIdentifier name of apikey
*
* @return string API key with the prefix
*/
public function getApiKeyWithPrefix($apiKeyIdentifier)
{
$prefix = $this->getApiKeyPrefix($apiKeyIdentifier);
$apiKey = $this->getApiKey($apiKeyIdentifier);
if ($apiKey === null) {
return null;
}
if ($prefix === null) {
$keyWithPrefix = $apiKey;
} else {
$keyWithPrefix = $prefix . ' ' . $apiKey;
}
return $keyWithPrefix;
}
}

109
lib/HeaderSelector.php Normal file
View File

@ -0,0 +1,109 @@
<?php
/**
* ApiException
* 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;
use \Exception;
/**
* ApiException Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class HeaderSelector
{
/**
* @param string[] $accept
* @param string[] $contentTypes
* @return array
*/
public function selectHeaders($accept, $contentTypes)
{
$headers = [];
$accept = $this->selectAcceptHeader($accept);
if ($accept !== null) {
$headers['Accept'] = $accept;
}
$headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes);
return $headers;
}
/**
* @param string[] $accept
* @return array
*/
public function selectHeadersForMultipart($accept)
{
$headers = $this->selectHeaders($accept, []);
unset($headers['Content-Type']);
return $headers;
}
/**
* Return the header 'Accept' based on an array of Accept provided
*
* @param string[] $accept Array of header
*
* @return string Accept (e.g. application/json)
*/
private function selectAcceptHeader($accept)
{
if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) {
return null;
} elseif (preg_grep("/application\/json/i", $accept)) {
return 'application/json';
} else {
return implode(',', $accept);
}
}
/**
* Return the content type based on an array of content-type provided
*
* @param string[] $contentType Array fo content-type
*
* @return string Content-Type (e.g. application/json)
*/
private function selectContentTypeHeader($contentType)
{
if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) {
return 'application/json';
} elseif (preg_grep("/application\/json/i", $contentType)) {
return 'application/json';
} else {
return implode(',', $contentType);
}
}
}

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));
}
}

318
lib/ObjectSerializer.php Normal file
View File

@ -0,0 +1,318 @@
<?php
/**
* ObjectSerializer
*
* 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;
/**
* ObjectSerializer Class Doc Comment
*
* @category Class
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class ObjectSerializer
{
/**
* Serialize data
*
* @param mixed $data the data to serialize
* @param string $format the format of the Swagger type of the data
*
* @return string|object serialized form of $data
*/
public static function sanitizeForSerialization($data, $format = null)
{
if (is_scalar($data) || null === $data) {
return $data;
} elseif ($data instanceof \DateTime) {
return ($format === 'date') ? $data->format('Y-m-d') : $data->format(\DateTime::ATOM);
} elseif (is_array($data)) {
foreach ($data as $property => $value) {
$data[$property] = self::sanitizeForSerialization($value);
}
return $data;
} elseif (is_object($data)) {
$values = [];
$formats = $data::swaggerFormats();
foreach ($data::swaggerTypes() as $property => $swaggerType) {
$getter = $data::getters()[$property];
$value = $data->$getter();
if ($value !== null
&& !in_array($swaggerType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)
&& method_exists($swaggerType, 'getAllowableEnumValues')
&& !in_array($value, $swaggerType::getAllowableEnumValues())) {
$imploded = implode("', '", $swaggerType::getAllowableEnumValues());
throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'");
}
if ($value !== null) {
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $swaggerType, $formats[$property]);
}
}
return (object)$values;
} else {
return (string)$data;
}
}
/**
* Sanitize filename by removing path.
* e.g. ../../sun.gif becomes sun.gif
*
* @param string $filename filename to be sanitized
*
* @return string the sanitized filename
*/
public static function sanitizeFilename($filename)
{
if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) {
return $match[1];
} else {
return $filename;
}
}
/**
* Take value and turn it into a string suitable for inclusion in
* the path, by url-encoding.
*
* @param string $value a string which will be part of the path
*
* @return string the serialized object
*/
public static function toPathValue($value)
{
return rawurlencode(self::toString($value));
}
/**
* Take value and turn it into a string suitable for inclusion in
* the query, by imploding comma-separated if it's an object.
* If it's a string, pass through unchanged. It will be url-encoded
* later.
*
* @param string[]|string|\DateTime $object an object to be serialized to a string
* @param string|null $format the format of the parameter
*
* @return string the serialized object
*/
public static function toQueryValue($object, $format = null)
{
if (is_array($object)) {
return implode(',', $object);
} else {
return self::toString($object, $format);
}
}
/**
* Take value and turn it into a string suitable for inclusion in
* the header. If it's a string, pass through unchanged
* If it's a datetime object, format it in RFC3339
*
* @param string $value a string which will be part of the header
*
* @return string the header string
*/
public static function toHeaderValue($value)
{
return self::toString($value);
}
/**
* Take value and turn it into a string suitable for inclusion in
* the http body (form parameter). If it's a string, pass through unchanged
* If it's a datetime object, format it in RFC3339
*
* @param string|\SplFileObject $value the value of the form parameter
*
* @return string the form string
*/
public static function toFormValue($value)
{
if ($value instanceof \SplFileObject) {
return $value->getRealPath();
} else {
return self::toString($value);
}
}
/**
* Take value and turn it into a string suitable for inclusion in
* the parameter. If it's a string, pass through unchanged
* If it's a datetime object, format it in RFC3339
* If it's a date, format it in Y-m-d
*
* @param string|\DateTime $value the value of the parameter
* @param string|null $format the format of the parameter
*
* @return string the header string
*/
public static function toString($value, $format = null)
{
if ($value instanceof \DateTime) {
return ($format === 'date') ? $value->format('Y-m-d') : $value->format(\DateTime::ATOM);
} else {
return $value;
}
}
/**
* Serialize an array to a string.
*
* @param array $collection collection to serialize to a string
* @param string $collectionFormat the format use for serialization (csv,
* ssv, tsv, pipes, multi)
* @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array
*
* @return string
*/
public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false)
{
if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) {
// http_build_query() almost does the job for us. We just
// need to fix the result of multidimensional arrays.
return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&'));
}
switch ($collectionFormat) {
case 'pipes':
return implode('|', $collection);
case 'tsv':
return implode("\t", $collection);
case 'ssv':
return implode(' ', $collection);
case 'csv':
// Deliberate fall through. CSV is default format.
default:
return implode(',', $collection);
}
}
/**
* Deserialize a JSON string into an object
*
* @param mixed $data object or primitive to be deserialized
* @param string $class class name is passed as a string
* @param string[] $httpHeaders HTTP headers
* @param string $discriminator discriminator if polymorphism is used
*
* @return object|array|null an single or an array of $class instances
*/
public static function deserialize($data, $class, $httpHeaders = null)
{
if (null === $data) {
return null;
} elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int]
$inner = substr($class, 4, -1);
$deserialized = [];
if (strrpos($inner, ",") !== false) {
$subClass_array = explode(',', $inner, 2);
$subClass = $subClass_array[1];
foreach ($data as $key => $value) {
$deserialized[$key] = self::deserialize($value, $subClass, null);
}
}
return $deserialized;
} elseif (strcasecmp(substr($class, -2), '[]') === 0) {
$subClass = substr($class, 0, -2);
$values = [];
foreach ($data as $key => $value) {
$values[] = self::deserialize($value, $subClass, null);
}
return $values;
} elseif ($class === 'object') {
settype($data, 'array');
return $data;
} elseif ($class === '\DateTime') {
// Some API's return an invalid, empty string as a
// date-time property. DateTime::__construct() will return
// the current time for empty input which is probably not
// what is meant. The invalid empty string is probably to
// be interpreted as a missing field/value. Let's handle
// this graceful.
if (!empty($data)) {
return new \DateTime($data);
} else {
return null;
}
} elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) {
settype($data, $class);
return $data;
} elseif ($class === '\SplFileObject') {
/** @var \Psr\Http\Message\StreamInterface $data */
// determine file name
if (array_key_exists('Content-Disposition', $httpHeaders) &&
preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) {
$filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]);
} else {
$filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), '');
}
$file = fopen($filename, 'w');
while ($chunk = $data->read(200)) {
fwrite($file, $chunk);
}
fclose($file);
return new \SplFileObject($filename, 'r');
} elseif (method_exists($class, 'getAllowableEnumValues')) {
if (!in_array($data, $class::getAllowableEnumValues())) {
$imploded = implode("', '", $class::getAllowableEnumValues());
throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'");
}
return $data;
} else {
// If a discriminator is defined and points to a valid subclass, use it.
$discriminator = $class::DISCRIMINATOR;
if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) {
$subclass = '{{invokerPackage}}\Model\\' . $data->{$discriminator};
if (is_subclass_of($subclass, $class)) {
$class = $subclass;
}
}
$instance = new $class();
foreach ($instance::swaggerTypes() as $property => $type) {
$propertySetter = $instance::setters()[$property];
if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) {
continue;
}
$propertyValue = $data->{$instance::attributeMap()[$property]};
if (isset($propertyValue)) {
$instance->$propertySetter(self::deserialize($propertyValue, $type, null));
}
}
return $instance;
}
}
}