Skip to content

Latest commit

 

History

History
763 lines (561 loc) · 21 KB

File metadata and controls

763 lines (561 loc) · 21 KB

GameControllerApi

All URIs are relative to https://localhost/gamification

Method HTTP request Description
addActionUsingPOST POST /model/game/{gameId}/action/{actionId} Add action
deleteActionUsingDELETE DELETE /model/game/{gameId}/action/{actionId} Delete action
deleteGameUsingDELETE1 DELETE /model/game/{gameId} Delete game
deleteLevelUsingDELETE DELETE /model/game/{gameId}/level/{levelName} Delete a level
editActionUsingPUT PUT /model/game/{domain}/action/{actionId} Edit action
readActionUsingGET GET /model/game/{gameId}/action/{actionId} Get action
readAllActionUsingGET GET /model/game/{gameId}/action Get actions
readGameStatisticsUsingGET GET /data/game/{gameId}/statistics Get game statistics
readGameUsingGET1 GET /model/game/{gameId} Read game definition
readGamesUsingGET1 GET /model/game Get games
saveGameUsingPOST2 POST /model/game Save a game
saveLevelUsingPOST POST /model/game/{gameId}/level Save a level
startGameUsingPUT PUT /model/game/{gameId}/start Start game
stopGameUsingPUT PUT /model/game/{gameId}/stop Stop a game

addActionUsingPOST

addActionUsingPOST(gameId)

Add action

Example

// Import classes:
//import it.smartcommunitylab.ApiClient;
//import it.smartcommunitylab.ApiException;
//import it.smartcommunitylab.Configuration;
//import it.smartcommunitylab.auth.*;
//import it.smartcommunitylab.basic.api.GameControllerApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

GameControllerApi apiInstance = new GameControllerApi();
String gameId = "gameId_example"; // String | gameId
try {
    apiInstance.addActionUsingPOST(gameId);
} catch (ApiException e) {
    System.err.println("Exception when calling GameControllerApi#addActionUsingPOST");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gameId String gameId

Return type

null (empty response body)

Authorization

basic

HTTP request headers

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

deleteActionUsingDELETE

deleteActionUsingDELETE(gameId, actionId)

Delete action

Example

// Import classes:
//import it.smartcommunitylab.ApiClient;
//import it.smartcommunitylab.ApiException;
//import it.smartcommunitylab.Configuration;
//import it.smartcommunitylab.auth.*;
//import it.smartcommunitylab.basic.api.GameControllerApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

GameControllerApi apiInstance = new GameControllerApi();
String gameId = "gameId_example"; // String | gameId
String actionId = "actionId_example"; // String | actionId
try {
    apiInstance.deleteActionUsingDELETE(gameId, actionId);
} catch (ApiException e) {
    System.err.println("Exception when calling GameControllerApi#deleteActionUsingDELETE");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gameId String gameId
actionId String actionId

Return type

null (empty response body)

Authorization

basic

HTTP request headers

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

deleteGameUsingDELETE1

deleteGameUsingDELETE1(gameId)

Delete game

Example

// Import classes:
//import it.smartcommunitylab.ApiClient;
//import it.smartcommunitylab.ApiException;
//import it.smartcommunitylab.Configuration;
//import it.smartcommunitylab.auth.*;
//import it.smartcommunitylab.basic.api.GameControllerApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

GameControllerApi apiInstance = new GameControllerApi();
String gameId = "gameId_example"; // String | gameId
try {
    apiInstance.deleteGameUsingDELETE1(gameId);
} catch (ApiException e) {
    System.err.println("Exception when calling GameControllerApi#deleteGameUsingDELETE1");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gameId String gameId

Return type

null (empty response body)

Authorization

basic

HTTP request headers

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

deleteLevelUsingDELETE

Boolean deleteLevelUsingDELETE(gameId, levelName)

Delete a level

Example

// Import classes:
//import it.smartcommunitylab.ApiClient;
//import it.smartcommunitylab.ApiException;
//import it.smartcommunitylab.Configuration;
//import it.smartcommunitylab.auth.*;
//import it.smartcommunitylab.basic.api.GameControllerApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

GameControllerApi apiInstance = new GameControllerApi();
String gameId = "gameId_example"; // String | gameId
String levelName = "levelName_example"; // String | levelName
try {
    Boolean result = apiInstance.deleteLevelUsingDELETE(gameId, levelName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GameControllerApi#deleteLevelUsingDELETE");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gameId String gameId
levelName String levelName

Return type

Boolean

Authorization

basic

HTTP request headers

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

editActionUsingPUT

editActionUsingPUT(gameId)

Edit action

Example

// Import classes:
//import it.smartcommunitylab.ApiClient;
//import it.smartcommunitylab.ApiException;
//import it.smartcommunitylab.Configuration;
//import it.smartcommunitylab.auth.*;
//import it.smartcommunitylab.basic.api.GameControllerApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

GameControllerApi apiInstance = new GameControllerApi();
String gameId = "gameId_example"; // String | gameId
try {
    apiInstance.editActionUsingPUT(gameId);
} catch (ApiException e) {
    System.err.println("Exception when calling GameControllerApi#editActionUsingPUT");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gameId String gameId

Return type

null (empty response body)

Authorization

basic

HTTP request headers

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

readActionUsingGET

readActionUsingGET(gameId)

Get action

Example

// Import classes:
//import it.smartcommunitylab.ApiClient;
//import it.smartcommunitylab.ApiException;
//import it.smartcommunitylab.Configuration;
//import it.smartcommunitylab.auth.*;
//import it.smartcommunitylab.basic.api.GameControllerApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

GameControllerApi apiInstance = new GameControllerApi();
String gameId = "gameId_example"; // String | gameId
try {
    apiInstance.readActionUsingGET(gameId);
} catch (ApiException e) {
    System.err.println("Exception when calling GameControllerApi#readActionUsingGET");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gameId String gameId

Return type

null (empty response body)

Authorization

basic

HTTP request headers

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

readAllActionUsingGET

List<String> readAllActionUsingGET(gameId)

Get actions

Example

// Import classes:
//import it.smartcommunitylab.ApiClient;
//import it.smartcommunitylab.ApiException;
//import it.smartcommunitylab.Configuration;
//import it.smartcommunitylab.auth.*;
//import it.smartcommunitylab.basic.api.GameControllerApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

GameControllerApi apiInstance = new GameControllerApi();
String gameId = "gameId_example"; // String | gameId
try {
    List<String> result = apiInstance.readAllActionUsingGET(gameId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GameControllerApi#readAllActionUsingGET");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gameId String gameId

Return type

List<String>

Authorization

basic

HTTP request headers

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

readGameStatisticsUsingGET

List<GameStatistics> readGameStatisticsUsingGET(gameId, pointConceptName, periodName, timestamp, periodIndex, page, size)

Get game statistics

Example

// Import classes:
//import it.smartcommunitylab.ApiClient;
//import it.smartcommunitylab.ApiException;
//import it.smartcommunitylab.Configuration;
//import it.smartcommunitylab.auth.*;
//import it.smartcommunitylab.basic.api.GameControllerApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

GameControllerApi apiInstance = new GameControllerApi();
String gameId = "gameId_example"; // String | gameId
String pointConceptName = "pointConceptName_example"; // String | pointConceptName
String periodName = "periodName_example"; // String | periodName
Long timestamp = 789L; // Long | timestamp
String periodIndex = "periodIndex_example"; // String | periodIndex
Integer page = -1; // Integer | page
Integer size = -1; // Integer | size
try {
    List<GameStatistics> result = apiInstance.readGameStatisticsUsingGET(gameId, pointConceptName, periodName, timestamp, periodIndex, page, size);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GameControllerApi#readGameStatisticsUsingGET");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gameId String gameId
pointConceptName String pointConceptName [optional]
periodName String periodName [optional]
timestamp Long timestamp [optional]
periodIndex String periodIndex [optional]
page Integer page [optional] [default to -1]
size Integer size [optional] [default to -1]

Return type

List<GameStatistics>

Authorization

basic

HTTP request headers

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

readGameUsingGET1

GameDTO readGameUsingGET1(gameId)

Read game definition

Example

// Import classes:
//import it.smartcommunitylab.ApiClient;
//import it.smartcommunitylab.ApiException;
//import it.smartcommunitylab.Configuration;
//import it.smartcommunitylab.auth.*;
//import it.smartcommunitylab.basic.api.GameControllerApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

GameControllerApi apiInstance = new GameControllerApi();
String gameId = "gameId_example"; // String | gameId
try {
    GameDTO result = apiInstance.readGameUsingGET1(gameId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GameControllerApi#readGameUsingGET1");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gameId String gameId

Return type

GameDTO

Authorization

basic

HTTP request headers

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

readGamesUsingGET1

List<GameDTO> readGamesUsingGET1()

Get games

Get all the game definitions of a user

Example

// Import classes:
//import it.smartcommunitylab.ApiClient;
//import it.smartcommunitylab.ApiException;
//import it.smartcommunitylab.Configuration;
//import it.smartcommunitylab.auth.*;
//import it.smartcommunitylab.basic.api.GameControllerApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

GameControllerApi apiInstance = new GameControllerApi();
try {
    List<GameDTO> result = apiInstance.readGamesUsingGET1();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GameControllerApi#readGamesUsingGET1");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

List<GameDTO>

Authorization

basic

HTTP request headers

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

saveGameUsingPOST2

GameDTO saveGameUsingPOST2(game)

Save a game

Example

// Import classes:
//import it.smartcommunitylab.ApiClient;
//import it.smartcommunitylab.ApiException;
//import it.smartcommunitylab.Configuration;
//import it.smartcommunitylab.auth.*;
//import it.smartcommunitylab.basic.api.GameControllerApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

GameControllerApi apiInstance = new GameControllerApi();
GameDTO game = new GameDTO(); // GameDTO | game
try {
    GameDTO result = apiInstance.saveGameUsingPOST2(game);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GameControllerApi#saveGameUsingPOST2");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
game GameDTO game

Return type

GameDTO

Authorization

basic

HTTP request headers

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

saveLevelUsingPOST

LevelDTO saveLevelUsingPOST(gameId, level)

Save a level

Example

// Import classes:
//import it.smartcommunitylab.ApiClient;
//import it.smartcommunitylab.ApiException;
//import it.smartcommunitylab.Configuration;
//import it.smartcommunitylab.auth.*;
//import it.smartcommunitylab.basic.api.GameControllerApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

GameControllerApi apiInstance = new GameControllerApi();
String gameId = "gameId_example"; // String | gameId
LevelDTO level = new LevelDTO(); // LevelDTO | level
try {
    LevelDTO result = apiInstance.saveLevelUsingPOST(gameId, level);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GameControllerApi#saveLevelUsingPOST");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gameId String gameId
level LevelDTO level

Return type

LevelDTO

Authorization

basic

HTTP request headers

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

startGameUsingPUT

startGameUsingPUT(gameId)

Start game

The game is able to accept action executions

Example

// Import classes:
//import it.smartcommunitylab.ApiClient;
//import it.smartcommunitylab.ApiException;
//import it.smartcommunitylab.Configuration;
//import it.smartcommunitylab.auth.*;
//import it.smartcommunitylab.basic.api.GameControllerApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

GameControllerApi apiInstance = new GameControllerApi();
String gameId = "gameId_example"; // String | gameId
try {
    apiInstance.startGameUsingPUT(gameId);
} catch (ApiException e) {
    System.err.println("Exception when calling GameControllerApi#startGameUsingPUT");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gameId String gameId

Return type

null (empty response body)

Authorization

basic

HTTP request headers

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

stopGameUsingPUT

stopGameUsingPUT(gameId)

Stop a game

The game will not accept action execution anymore

Example

// Import classes:
//import it.smartcommunitylab.ApiClient;
//import it.smartcommunitylab.ApiException;
//import it.smartcommunitylab.Configuration;
//import it.smartcommunitylab.auth.*;
//import it.smartcommunitylab.basic.api.GameControllerApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

GameControllerApi apiInstance = new GameControllerApi();
String gameId = "gameId_example"; // String | gameId
try {
    apiInstance.stopGameUsingPUT(gameId);
} catch (ApiException e) {
    System.err.println("Exception when calling GameControllerApi#stopGameUsingPUT");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gameId String gameId

Return type

null (empty response body)

Authorization

basic

HTTP request headers

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