added autogenerated rust server code

This commit is contained in:
2024-05-11 23:30:37 +02:00
parent e3cc07061c
commit 0246f22e3e
29 changed files with 1704 additions and 14 deletions

12
docs/Authorization.md Normal file
View File

@@ -0,0 +1,12 @@
# Authorization
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**to_date** | **String** | | [optional] [default to null]
**from_date** | **String** | | [optional] [default to null]
**user** | **String** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

11
docs/Credentials.md Normal file
View File

@@ -0,0 +1,11 @@
# Credentials
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**username** | **String** | | [optional] [default to null]
**password** | **String** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

174
docs/DefaultApi.md Normal file
View File

@@ -0,0 +1,174 @@
# \DefaultApi
All URIs are relative to *https://localhost/api*
Method | HTTP request | Description
------------- | ------------- | -------------
[**auth_login_post**](DefaultApi.md#auth_login_post) | **Post** /auth/login | Authenticate user
[**auth_token_post**](DefaultApi.md#auth_token_post) | **Post** /auth/token | Generate authentication token for another user
[**elections_all_get**](DefaultApi.md#elections_all_get) | **Get** /elections/all | Get all existing elections
[**elections_create_post**](DefaultApi.md#elections_create_post) | **Post** /elections/create | Create new election
[**elections_id_get**](DefaultApi.md#elections_id_get) | **Get** /elections/{id} | Get all existing elections
[**elections_id_post**](DefaultApi.md#elections_id_post) | **Post** /elections/{id} | Vote in exsisting election
# **auth_login_post**
> ::models::InlineResponse200 auth_login_post(ctx, credentials)
Authenticate user
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context containing the authentication | nil if no authentication
**credentials** | [**Credentials**](Credentials.md)| |
### Return type
[**::models::InlineResponse200**](inline_response_200.md)
### Authorization
[JWT](../README.md#JWT)
### 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)
# **auth_token_post**
> ::models::InlineResponse2001 auth_token_post(ctx, authorization, token)
Generate authentication token for another user
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context containing the authentication | nil if no authentication
**authorization** | **String**| Your authorization token |
**token** | [**Authorization**](Authorization.md)| |
### Return type
[**::models::InlineResponse2001**](inline_response_200_1.md)
### Authorization
[JWT](../README.md#JWT)
### 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)
# **elections_all_get**
> ::models::ElectionList elections_all_get(ctx, authorization)
Get all existing elections
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context containing the authentication | nil if no authentication
**authorization** | **String**| Your authorization token |
### Return type
[**::models::ElectionList**](ElectionList.md)
### Authorization
[JWT](../README.md#JWT)
### 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)
# **elections_create_post**
> ::models::Election elections_create_post(ctx, authorization, election)
Create new election
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context containing the authentication | nil if no authentication
**authorization** | **String**| Your authorization token |
**election** | [**Election**](Election.md)| |
### Return type
[**::models::Election**](Election.md)
### Authorization
[JWT](../README.md#JWT)
### 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)
# **elections_id_get**
> ::models::Election elections_id_get(ctx, authorization, id)
Get all existing elections
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context containing the authentication | nil if no authentication
**authorization** | **String**| Your authorization token |
**id** | **String**| |
### Return type
[**::models::Election**](Election.md)
### Authorization
[JWT](../README.md#JWT)
### 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)
# **elections_id_post**
> ::models::Vote elections_id_post(ctx, authorization, election)
Vote in exsisting election
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context containing the authentication | nil if no authentication
**authorization** | **String**| Your authorization token |
**election** | [**Vote**](Vote.md)| |
### Return type
[**::models::Vote**](Vote.md)
### Authorization
[JWT](../README.md#JWT)
### 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)

16
docs/Election.md Normal file
View File

@@ -0,0 +1,16 @@
# Election
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | | [optional] [default to null]
**username** | **String** | | [optional] [default to null]
**name** | **String** | | [optional] [default to null]
**description** | **String** | | [optional] [default to null]
**start_date** | **String** | | [optional] [default to null]
**end_date** | **String** | | [optional] [default to null]
**items** | [**Vec<::models::ElectionItem>**](ElectionItem.md) | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

11
docs/ElectionItem.md Normal file
View File

@@ -0,0 +1,11 @@
# ElectionItem
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | | [optional] [default to null]
**name** | **String** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

9
docs/ElectionList.md Normal file
View File

@@ -0,0 +1,9 @@
# ElectionList
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

10
docs/InlineResponse200.md Normal file
View File

@@ -0,0 +1,10 @@
# InlineResponse200
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**token** | **String** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# InlineResponse2001
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**token** | **String** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

12
docs/User.md Normal file
View File

@@ -0,0 +1,12 @@
# User
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | | [optional] [default to null]
**username** | **String** | | [optional] [default to null]
**password** | **String** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

12
docs/Vote.md Normal file
View File

@@ -0,0 +1,12 @@
# Vote
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**authorization** | [***::models::Authorization**](Authorization.md) | | [optional] [default to null]
**userid** | **String** | | [optional] [default to null]
**data** | [**Vec<::models::VoteItem>**](VoteItem.md) | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

11
docs/VoteItem.md Normal file
View File

@@ -0,0 +1,11 @@
# VoteItem
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**item** | [***::models::ElectionItem**](ElectionItem.md) | | [optional] [default to null]
**value** | **f32** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)