An API for the washing machines and dryer in the Aristotelessteig Dormitory for our Project in the course NFC.
This Dart package is automatically generated by the OpenAPI Generator project:
- API version: 1.0.2
- Build package: org.openapitools.codegen.languages.DartClientCodegen
Dart 2.0 or later
If this Dart package is published to Github, add the following dependency to your pubspec.yaml
dependencies:
openapi:
git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
To use the package in your local drive, add the following dependency to your pubspec.yaml
dependencies:
openapi:
path: /path/to/openapi
TODO
Please follow the installation procedure and then run the following:
import 'package:openapi/api.dart';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
var api_instance = MachineApi();
var machine = Machine(); // Machine | Machine object that needs to be added
try {
api_instance.addMachines(machine);
} catch (e) {
print("Exception when calling MachineApi->addMachines: $e\n");
}
All URIs are relative to https://virtserver.swaggerhub.com/nfcproject/LaundryRoom/1.0.2
Class | Method | HTTP request | Description |
---|---|---|---|
MachineApi | addMachines | POST /machine | Adds a new machine |
MachineApi | deleteMachine | DELETE /machine/{machineId} | Deletes a machine |
MachineApi | getMachineById | GET /machine/{machineId} | Find machine by ID |
MachineApi | listAvailableMachines | GET /machine/available | Lists all available machines |
MachineApi | listMachines | GET /machine | Lists all machines |
MachineApi | machineHold | POST /machine/{machineId}/hold | Holds the machine |
MachineApi | machinePay | POST /machine/{machineId}/pay | Pay for the given machine |
UserApi | addUsers | POST /user | Adds a new user |
UserApi | deleteUser | DELETE /user/{userId} | Deletes a user |
UserApi | getUserByCardId | GET /user/findByCardId | Find user by card ID |
UserApi | getUserById | GET /user/{userId} | Find user by ID |
UserApi | listUsers | GET /user | Lists all users |
UserApi | reservedMachines | GET /user/{userId}/reserved | Check which machines are reserved by the given user |
UserApi | userBalance | GET /user/{userId}/balance | Check the user's balance |
UserApi | userDeduct | POST /user/{userId}/deduct | Charges the user's account |
UserApi | userLinkCard | POST /user/{userId}/linkCard | Links the provided card to the user's account |
UserApi | userRecharge | POST /user/{userId}/recharge | Recharges the user's account |
- Type: API key
- API key parameter name: api_key
- Location: HTTP header