openapi-generator-cli -g dart-dio. Генерируется, но коммитится: CI ловит дрейф openapi/openapi.json, а приложение собирается без запуска генератора. Пересобирается через just gen-client после любого изменения роутов.
259 lines
6.0 KiB
Markdown
259 lines
6.0 KiB
Markdown
# fintracker_api.api.RulesApi
|
|
|
|
## Load the API package
|
|
```dart
|
|
import 'package:fintracker_api/api.dart';
|
|
```
|
|
|
|
All URIs are relative to *http://localhost*
|
|
|
|
Method | HTTP request | Description
|
|
------------- | ------------- | -------------
|
|
[**rulesApply**](RulesApi.md#rulesapply) | **POST** /api/v1/rules/apply | Apply
|
|
[**rulesCreate**](RulesApi.md#rulescreate) | **POST** /api/v1/rules | Create
|
|
[**rulesDelete**](RulesApi.md#rulesdelete) | **DELETE** /api/v1/rules/{rule_id} | Delete
|
|
[**rulesList**](RulesApi.md#ruleslist) | **GET** /api/v1/rules | List
|
|
[**rulesPatch**](RulesApi.md#rulespatch) | **PATCH** /api/v1/rules/{rule_id} | Patch
|
|
[**rulesStale**](RulesApi.md#rulesstale) | **GET** /api/v1/rules/stale | Stale
|
|
|
|
|
|
# **rulesApply**
|
|
> RefreshLogOut rulesApply()
|
|
|
|
Apply
|
|
|
|
Re-run the whole metric refresh so edited rules take effect everywhere at once.
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:fintracker_api/api.dart';
|
|
|
|
final api = FintrackerApi().getRulesApi();
|
|
|
|
try {
|
|
final response = api.rulesApply();
|
|
print(response);
|
|
} on DioException catch (e) {
|
|
print('Exception when calling RulesApi->rulesApply: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
This endpoint does not need any parameter.
|
|
|
|
### Return type
|
|
|
|
[**RefreshLogOut**](RefreshLogOut.md)
|
|
|
|
### Authorization
|
|
|
|
[HTTPBearer](../README.md#HTTPBearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/json, application/problem+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)
|
|
|
|
# **rulesCreate**
|
|
> RuleOut rulesCreate(ruleCreate)
|
|
|
|
Create
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:fintracker_api/api.dart';
|
|
|
|
final api = FintrackerApi().getRulesApi();
|
|
final RuleCreate ruleCreate = ; // RuleCreate |
|
|
|
|
try {
|
|
final response = api.rulesCreate(ruleCreate);
|
|
print(response);
|
|
} on DioException catch (e) {
|
|
print('Exception when calling RulesApi->rulesCreate: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**ruleCreate** | [**RuleCreate**](RuleCreate.md)| |
|
|
|
|
### Return type
|
|
|
|
[**RuleOut**](RuleOut.md)
|
|
|
|
### Authorization
|
|
|
|
[HTTPBearer](../README.md#HTTPBearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: application/json, application/problem+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)
|
|
|
|
# **rulesDelete**
|
|
> rulesDelete(ruleId)
|
|
|
|
Delete
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:fintracker_api/api.dart';
|
|
|
|
final api = FintrackerApi().getRulesApi();
|
|
final int ruleId = 56; // int |
|
|
|
|
try {
|
|
api.rulesDelete(ruleId);
|
|
} on DioException catch (e) {
|
|
print('Exception when calling RulesApi->rulesDelete: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**ruleId** | **int**| |
|
|
|
|
### Return type
|
|
|
|
void (empty response body)
|
|
|
|
### Authorization
|
|
|
|
[HTTPBearer](../README.md#HTTPBearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/problem+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)
|
|
|
|
# **rulesList**
|
|
> List<RuleOut> rulesList()
|
|
|
|
List
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:fintracker_api/api.dart';
|
|
|
|
final api = FintrackerApi().getRulesApi();
|
|
|
|
try {
|
|
final response = api.rulesList();
|
|
print(response);
|
|
} on DioException catch (e) {
|
|
print('Exception when calling RulesApi->rulesList: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
This endpoint does not need any parameter.
|
|
|
|
### Return type
|
|
|
|
[**List<RuleOut>**](RuleOut.md)
|
|
|
|
### Authorization
|
|
|
|
[HTTPBearer](../README.md#HTTPBearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/json, application/problem+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)
|
|
|
|
# **rulesPatch**
|
|
> RuleOut rulesPatch(ruleId, rulePatch)
|
|
|
|
Patch
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:fintracker_api/api.dart';
|
|
|
|
final api = FintrackerApi().getRulesApi();
|
|
final int ruleId = 56; // int |
|
|
final RulePatch rulePatch = ; // RulePatch |
|
|
|
|
try {
|
|
final response = api.rulesPatch(ruleId, rulePatch);
|
|
print(response);
|
|
} on DioException catch (e) {
|
|
print('Exception when calling RulesApi->rulesPatch: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**ruleId** | **int**| |
|
|
**rulePatch** | [**RulePatch**](RulePatch.md)| |
|
|
|
|
### Return type
|
|
|
|
[**RuleOut**](RuleOut.md)
|
|
|
|
### Authorization
|
|
|
|
[HTTPBearer](../README.md#HTTPBearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: application/json, application/problem+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)
|
|
|
|
# **rulesStale**
|
|
> List<RuleOut> rulesStale()
|
|
|
|
Stale
|
|
|
|
Enabled rules that matched nothing in the latest refresh: the payee was renamed, or the transaction was re-categorised in ZenMoney.
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:fintracker_api/api.dart';
|
|
|
|
final api = FintrackerApi().getRulesApi();
|
|
|
|
try {
|
|
final response = api.rulesStale();
|
|
print(response);
|
|
} on DioException catch (e) {
|
|
print('Exception when calling RulesApi->rulesStale: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
This endpoint does not need any parameter.
|
|
|
|
### Return type
|
|
|
|
[**List<RuleOut>**](RuleOut.md)
|
|
|
|
### Authorization
|
|
|
|
[HTTPBearer](../README.md#HTTPBearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/json, application/problem+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)
|
|
|