PerudoPhpApi/docs/Api/DefaultApi.md

10 KiB

Swagger\Client\DefaultApi

All URIs are relative to /

Method HTTP request Description
callTurn POST /player/call/{player}
createGame GET /game/create
gameIsStarted GET /game/started/{player}
getTurn GET /player/turn/{player}
joinGame GET /game/join/{code}
postTurn POST /player/guess/{player}
setGameRules POST /game/rules/{player}
startGame GET /game/start/{player}

callTurn

\Swagger\Client\Model\MyTurn callTurn($player)

Example

<?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

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createGame

\Swagger\Client\Model\PlayerCode createGame($name)

Example

<?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

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

gameIsStarted

\Swagger\Client\Model\GameIsStarted gameIsStarted($player)

Example

<?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

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getTurn

\Swagger\Client\Model\MyTurn getTurn($player)

Example

<?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

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

joinGame

\Swagger\Client\Model\PlayerCode joinGame($name, $code)

Example

<?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

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

postTurn

\Swagger\Client\Model\MyTurn postTurn($player, $body)

Example

<?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 [optional]

Return type

\Swagger\Client\Model\MyTurn

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

setGameRules

\Swagger\Client\Model\MessageResponse setGameRules($player, $body)

Example

<?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 [optional]

Return type

\Swagger\Client\Model\MessageResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

startGame

\Swagger\Client\Model\MessageResponse startGame($player)

Example

<?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

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]