# \DefaultApi

All URIs are relative to *http://localhost:8080*

Method | HTTP request | Description
------------- | ------------- | -------------
[**get_gamenight**](DefaultApi.md#get_gamenight) | **GET** /gamenight | 
[**get_gamenights**](DefaultApi.md#get_gamenights) | **GET** /gamenights | Get a all gamenights
[**get_token**](DefaultApi.md#get_token) | **GET** /token | 
[**join_post**](DefaultApi.md#join_post) | **POST** /join | 
[**leave_post**](DefaultApi.md#leave_post) | **POST** /leave | 
[**participants_get**](DefaultApi.md#participants_get) | **GET** /participants | Get all participants for a gamenight
[**post_gamenight**](DefaultApi.md#post_gamenight) | **POST** /gamenight | 
[**post_register**](DefaultApi.md#post_register) | **POST** /user | 
[**user_get**](DefaultApi.md#user_get) | **GET** /user | 



## get_gamenight

> models::Gamenight get_gamenight(get_gamenight_request_body)


### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**get_gamenight_request_body** | Option<[**GetGamenightRequestBody**](GetGamenightRequestBody.md)> |  |  |

### Return type

[**models::Gamenight**](Gamenight.md)

### Authorization

[JWT-Auth](../README.md#JWT-Auth)

### 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)


## get_gamenights

> Vec<models::Gamenight> get_gamenights()
Get a all gamenights

Retrieve the list of gamenights on this gamenight server. Requires authorization.

### Parameters

This endpoint does not need any parameter.

### Return type

[**Vec<models::Gamenight>**](Gamenight.md)

### Authorization

[JWT-Auth](../README.md#JWT-Auth)

### 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)


## get_token

> models::Token get_token(login)


Submit your credentials to get a JWT-token to use with the rest of the api.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**login** | Option<[**Login**](Login.md)> |  |  |

### Return type

[**models::Token**](Token.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)


## join_post

> join_post(gamenight_id)


### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**gamenight_id** | Option<[**GamenightId**](GamenightId.md)> |  |  |

### Return type

 (empty response body)

### Authorization

[JWT-Auth](../README.md#JWT-Auth)

### 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)


## leave_post

> leave_post(gamenight_id)


### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**gamenight_id** | Option<[**GamenightId**](GamenightId.md)> |  |  |

### Return type

 (empty response body)

### Authorization

[JWT-Auth](../README.md#JWT-Auth)

### 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)


## participants_get

> models::Participants participants_get(gamenight_id)
Get all participants for a gamenight

Retrieve the participants of a single gamenight by id.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**gamenight_id** | Option<[**GamenightId**](GamenightId.md)> |  |  |

### Return type

[**models::Participants**](Participants.md)

### Authorization

[JWT-Auth](../README.md#JWT-Auth)

### 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)


## post_gamenight

> post_gamenight(add_gamenight_request_body)


Add a gamenight by providing a name and a date, only available when providing an JWT token.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**add_gamenight_request_body** | Option<[**AddGamenightRequestBody**](AddGamenightRequestBody.md)> |  |  |

### Return type

 (empty response body)

### Authorization

[JWT-Auth](../README.md#JWT-Auth)

### 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)


## post_register

> post_register(registration)


Create a new user given a registration token and user information, username and email must be unique, and password and password_repeat must match.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**registration** | Option<[**Registration**](Registration.md)> |  |  |

### Return type

 (empty response body)

### Authorization

[JWT-Auth](../README.md#JWT-Auth)

### 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)


## user_get

> models::User user_get(user_id)


Get a user from primary id

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**user_id** | Option<[**UserId**](UserId.md)> |  |  |

### Return type

[**models::User**](User.md)

### Authorization

[JWT-Auth](../README.md#JWT-Auth)

### 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)