Skip to content

Latest commit

 

History

History
484 lines (368 loc) · 11.6 KB

File metadata and controls

484 lines (368 loc) · 11.6 KB

WerewolfAPI.Api.PlayerApi

All URIs are relative to https://project-ile.net:1038/v1

Method HTTP request Description
AddPlayer POST /player Add a new player to the system
DeletePlayer DELETE /player/{playerId} Deletes a player
FindPlayersByGame GET /player/findByGame/{gameID} Finds Players by game
GetPlayerById GET /player/{playerId} Find player by ID
LoginPlayer POST /player/login Login into a player account
LogoutPlayer GET /player/logout/{sessionID} Player logout
PlayerGet GET /player Get list of players
UpdatePlayer PUT /player Update an existing player

AddPlayer

Player AddPlayer (Player body)

Add a new player to the system

Example

using System;
using System.Diagnostics;
using WerewolfAPI.Api;
using WerewolfAPI.Client;
using WerewolfAPI.Model;

namespace Example
{
    public class AddPlayerExample
    {
        public void main()
        {
            var apiInstance = new PlayerApi();
            var body = new Player(); // Player | Player object that needs to be added to the system

            try
            {
                // Add a new player to the system
                Player result = apiInstance.AddPlayer(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PlayerApi.AddPlayer: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
body Player Player object that needs to be added to the system

Return type

Player

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]

DeletePlayer

void DeletePlayer (long? playerId)

Deletes a player

Example

using System;
using System.Diagnostics;
using WerewolfAPI.Api;
using WerewolfAPI.Client;
using WerewolfAPI.Model;

namespace Example
{
    public class DeletePlayerExample
    {
        public void main()
        {
            var apiInstance = new PlayerApi();
            var playerId = 789;  // long? | Player id to delete

            try
            {
                // Deletes a player
                apiInstance.DeletePlayer(playerId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PlayerApi.DeletePlayer: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
playerId long? Player id to delete

Return type

void (empty response body)

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]

FindPlayersByGame

List FindPlayersByGame (string gameID)

Finds Players by game

Example

using System;
using System.Diagnostics;
using WerewolfAPI.Api;
using WerewolfAPI.Client;
using WerewolfAPI.Model;

namespace Example
{
    public class FindPlayersByGameExample
    {
        public void main()
        {
            var apiInstance = new PlayerApi();
            var gameID = gameID_example;  // string | Game id

            try
            {
                // Finds Players by game
                List<Player> result = apiInstance.FindPlayersByGame(gameID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PlayerApi.FindPlayersByGame: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
gameID string Game id

Return type

List

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]

GetPlayerById

Player GetPlayerById (long? playerId)

Find player by ID

Returns a single player

Example

using System;
using System.Diagnostics;
using WerewolfAPI.Api;
using WerewolfAPI.Client;
using WerewolfAPI.Model;

namespace Example
{
    public class GetPlayerByIdExample
    {
        public void main()
        {
            var apiInstance = new PlayerApi();
            var playerId = 789;  // long? | ID of player to return

            try
            {
                // Find player by ID
                Player result = apiInstance.GetPlayerById(playerId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PlayerApi.GetPlayerById: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
playerId long? ID of player to return

Return type

Player

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]

LoginPlayer

Player LoginPlayer (Player body)

Login into a player account

Example

using System;
using System.Diagnostics;
using WerewolfAPI.Api;
using WerewolfAPI.Client;
using WerewolfAPI.Model;

namespace Example
{
    public class LoginPlayerExample
    {
        public void main()
        {
            var apiInstance = new PlayerApi();
            var body = new Player(); // Player | Player object that at least contains login/password

            try
            {
                // Login into a player account
                Player result = apiInstance.LoginPlayer(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PlayerApi.LoginPlayer: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
body Player Player object that at least contains login/password

Return type

Player

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]

LogoutPlayer

List LogoutPlayer (string sessionID)

Player logout

Example

using System;
using System.Diagnostics;
using WerewolfAPI.Api;
using WerewolfAPI.Client;
using WerewolfAPI.Model;

namespace Example
{
    public class LogoutPlayerExample
    {
        public void main()
        {
            var apiInstance = new PlayerApi();
            var sessionID = sessionID_example;  // string | ID of player's session to logout

            try
            {
                // Player logout
                List<Player> result = apiInstance.LogoutPlayer(sessionID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PlayerApi.LogoutPlayer: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
sessionID string ID of player's session to logout

Return type

List

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]

PlayerGet

List PlayerGet ()

Get list of players

Example

using System;
using System.Diagnostics;
using WerewolfAPI.Api;
using WerewolfAPI.Client;
using WerewolfAPI.Model;

namespace Example
{
    public class PlayerGetExample
    {
        public void main()
        {
            var apiInstance = new PlayerApi();

            try
            {
                // Get list of players
                List<Player> result = apiInstance.PlayerGet();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PlayerApi.PlayerGet: " + e.Message );
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

List

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]

UpdatePlayer

void UpdatePlayer (Player body)

Update an existing player

Example

using System;
using System.Diagnostics;
using WerewolfAPI.Api;
using WerewolfAPI.Client;
using WerewolfAPI.Model;

namespace Example
{
    public class UpdatePlayerExample
    {
        public void main()
        {
            var apiInstance = new PlayerApi();
            var body = new Player(); // Player | Player object that needs to be added to the system

            try
            {
                // Update an existing player
                apiInstance.UpdatePlayer(body);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PlayerApi.UpdatePlayer: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
body Player Player object that needs to be added to the system

Return type

void (empty response body)

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]