Final commit.

This commit is contained in:
Dennis Nemec
2026-06-01 17:12:28 +02:00
parent 3ecbc82885
commit a9bf8ecdd1
385 changed files with 29081 additions and 12089 deletions

View File

@ -0,0 +1,360 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
import 'dart:async';
import 'package:built_value/json_object.dart';
import 'package:built_value/serializer.dart';
import 'package:dio/dio.dart';
import 'package:holzleitner_api/src/api_util.dart';
import 'package:holzleitner_api/src/model/delivered_belegnummern_response.dart';
import 'package:holzleitner_api/src/model/import_summary.dart';
import 'package:holzleitner_api/src/model/mark_mail_sent_request.dart';
import 'package:holzleitner_api/src/model/mark_mail_sent_response.dart';
class AdminApi {
final Dio _dio;
final Serializers _serializers;
const AdminApi(this._dio, this._serializers);
/// Liefert die Belegnummern ausgelieferter (abgeschlossener) Lieferungen, **deren Liefermail noch nicht versendet wurde** (`mail_sent_at IS NULL`). „Ausgeliefert\" = es existiert ein Abschluss. Mit `day` (DD-MM-YYYY) nur Abschlüsse dieses Berliner Kalendertages; **ohne `day` alle offenen** (über alle Tage) — so bleiben Belege über Mitternacht nicht hängen.
///
///
/// Parameters:
/// * [day] - Tag DD-MM-YYYY; ohne Angabe ALLE offenen Belege
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [DeliveredBelegnummernResponse] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<DeliveredBelegnummernResponse>> deliveredBelegnummern({
String? day,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/admin/delivered-belegnummern';
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'apiKey',
'name': 'admin_api_key',
'keyName': 'X-Admin-Api-Key',
'where': 'header',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
if (day != null) r'day': encodeQueryParameter(_serializers, day, const FullType(String)),
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
DeliveredBelegnummernResponse? _responseData;
try {
final rawResponse = _response.data;
_responseData = rawResponse == null ? null : _serializers.deserialize(
rawResponse,
specifiedType: const FullType(DeliveredBelegnummernResponse),
) as DeliveredBelegnummernResponse;
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<DeliveredBelegnummernResponse>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Stößt den ERP-Import für ein Datum an und liefert die Zusammenfassung.
///
///
/// Parameters:
/// * [date] - Ziel-Tourdatum YYYY-MM-DD (Default: heute)
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [ImportSummary] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<ImportSummary>> importErp({
String? date,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/admin/import-erp';
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'apiKey',
'name': 'admin_api_key',
'keyName': 'X-Admin-Api-Key',
'where': 'header',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
if (date != null) r'date': encodeQueryParameter(_serializers, date, const FullType(String)),
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
ImportSummary? _responseData;
try {
final rawResponse = _response.data;
_responseData = rawResponse == null ? null : _serializers.deserialize(
rawResponse,
specifiedType: const FullType(ImportSummary),
) as ImportSummary;
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<ImportSummary>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Markiert die Liefermails der angegebenen Belegnummern als **versendet** (&#x60;mail_sent_at &#x3D; now()&#x60;, nur wo noch offen). Vom Mailclient aufzurufen, NACHDEM ERPframe die Mails erfolgreich verschickt hat — danach erscheinen die Belege nicht mehr in &#x60;GET /admin/delivered-belegnummern&#x60;.
///
///
/// Parameters:
/// * [markMailSentRequest]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [MarkMailSentResponse] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<MarkMailSentResponse>> markMailSent({
required MarkMailSentRequest markMailSentRequest,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/admin/mark-mail-sent';
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'apiKey',
'name': 'admin_api_key',
'keyName': 'X-Admin-Api-Key',
'where': 'header',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
const _type = FullType(MarkMailSentRequest);
_bodyData = _serializers.serialize(markMailSentRequest, specifiedType: _type);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
MarkMailSentResponse? _responseData;
try {
final rawResponse = _response.data;
_responseData = rawResponse == null ? null : _serializers.deserialize(
rawResponse,
specifiedType: const FullType(MarkMailSentResponse),
) as MarkMailSentResponse;
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<MarkMailSentResponse>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Stößt das ERP-Rückschreiben eines bereits lokal abgeschlossenen Lieferabschlusses erneut an (idempotenter Retry, falls der automatische Push beim Abschluss fehlschlug).
///
///
/// Parameters:
/// * [deliveryId] - UUID der abgeschlossenen Lieferung
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future]
/// Throws [DioException] if API call or serialization fails
Future<Response<void>> pushCompletion({
required String deliveryId,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/admin/push-completion';
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'apiKey',
'name': 'admin_api_key',
'keyName': 'X-Admin-Api-Key',
'where': 'header',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
r'delivery_id': encodeQueryParameter(_serializers, deliveryId, const FullType(String)),
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
return _response;
}
}

View File

@ -0,0 +1,93 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
import 'dart:async';
import 'package:built_value/json_object.dart';
import 'package:built_value/serializer.dart';
import 'package:dio/dio.dart';
import 'package:holzleitner_api/src/api_util.dart';
class AttachmentsApi {
final Dio _dio;
final Serializers _serializers;
const AttachmentsApi(this._dio, this._serializers);
/// Liefert ein gerendertes Vorschaubild des Attachments (Bytes), geladen aus DOCUframe. Auflösung/Format über Query-Parameter steuerbar (&#x60;?w&#x3D;&amp;h&#x3D;&amp;q&#x3D;&amp;ext&#x3D;&amp;page&#x3D;&#x60;).
///
///
/// Parameters:
/// * [id] - Attachment-Id (unsere UUID)
/// * [w] - Breite in Pixeln (Default 1024)
/// * [h] - Höhe in Pixeln (Default 1024)
/// * [q] - Qualität 0100 (Default 85)
/// * [ext] - png|jpeg|jpg|webp|tiff (Default jpeg)
/// * [page] - Seitennummer (Default 1)
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future]
/// Throws [DioException] if API call or serialization fails
Future<Response<void>> getAttachment({
required String id,
int? w,
int? h,
int? q,
String? ext,
String? page,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/attachments/{id}'.replaceAll('{' r'id' '}', encodeQueryParameter(_serializers, id, const FullType(String)).toString());
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'bearer_auth',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
if (w != null) r'w': encodeQueryParameter(_serializers, w, const FullType(int)),
if (h != null) r'h': encodeQueryParameter(_serializers, h, const FullType(int)),
if (q != null) r'q': encodeQueryParameter(_serializers, q, const FullType(int)),
if (ext != null) r'ext': encodeQueryParameter(_serializers, ext, const FullType(String)),
if (page != null) r'page': encodeQueryParameter(_serializers, page, const FullType(String)),
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
return _response;
}
}

View File

@ -12,9 +12,14 @@ import 'package:holzleitner_api/src/api_util.dart';
import 'package:holzleitner_api/src/model/assign_car_request.dart';
import 'package:holzleitner_api/src/model/cancel_delivery_request.dart';
import 'package:holzleitner_api/src/model/create_delivery_note_request.dart';
import 'package:holzleitner_api/src/model/delivery_credit_event_request.dart';
import 'package:holzleitner_api/src/model/delivery_credit_response.dart';
import 'package:holzleitner_api/src/model/delivery_note_response.dart';
import 'package:holzleitner_api/src/model/delivery_response.dart';
import 'package:holzleitner_api/src/model/delivery_service_response.dart';
import 'package:holzleitner_api/src/model/hold_delivery_request.dart';
import 'package:holzleitner_api/src/model/set_delivery_service_request.dart';
import 'package:holzleitner_api/src/model/update_delivery_note_request.dart';
class DeliveriesApi {
@ -24,6 +29,109 @@ class DeliveriesApi {
const DeliveriesApi(this._dio, this._serializers);
/// Wendet ein Betrags-Gutschrift-Ereignis an (&#x60;set&#x60;/&#x60;remove&#x60;). Append-only, idempotent über &#x60;clientEventId&#x60;. Nur bei aktiver Lieferung; bei &#x60;set&#x60; sind Betrag (0 &lt; x ≤ 150 €, 10-€-Schritte) und Grund Pflicht. Antwort: der aktuelle Gutschrift-Stand (&#x60;null&#x60;, wenn entfernt).
///
///
/// Parameters:
/// * [deliveryId]
/// * [deliveryCreditEventRequest]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [DeliveryCreditResponse] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<DeliveryCreditResponse>> applyCredit({
required String deliveryId,
required DeliveryCreditEventRequest deliveryCreditEventRequest,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/deliveries/{delivery_id}/credit'.replaceAll('{' r'delivery_id' '}', encodeQueryParameter(_serializers, deliveryId, const FullType(String)).toString());
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'bearer_auth',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
const _type = FullType(DeliveryCreditEventRequest);
_bodyData = _serializers.serialize(deliveryCreditEventRequest, specifiedType: _type);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
DeliveryCreditResponse? _responseData;
try {
final rawResponse = _response.data;
_responseData = rawResponse == null ? null : _serializers.deserialize(
rawResponse,
specifiedType: const FullType(DeliveryCreditResponse),
) as DeliveryCreditResponse;
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<DeliveryCreditResponse>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Setzt das &#x60;assigned_car_id&#x60; einer Lieferung. &#x60;carId: null&#x60; löst die Zuordnung wieder. Der Use Case stellt sicher, dass das Fahrzeug zum angemeldeten Account gehört.
///
///
@ -231,7 +339,7 @@ class DeliveriesApi {
}
/// Schließt die Lieferung ab — &#x60;state &#x3D; completed&#x60;. Nur aus &#x60;active&#x60;.
///
/// &#x60;multipart/form-data&#x60; mit drei Feldern: * &#x60;customer_signature&#x60; — PNG der Kunden-Unterschrift (Pflicht) * &#x60;driver_signature&#x60; — PNG der Fahrer-Unterschrift (Pflicht) * &#x60;acknowledgements&#x60; — JSON (&#x60;CompleteDeliveryAcknowledgements&#x60;): &#x60;receiptConfirmed&#x60; (Pflicht true), &#x60;notesAcknowledged&#x60;, &#x60;acknowledgedNoteIds&#x60;, &#x60;authorCarId&#x60;. Atomar: Signaturen werden lokal gespeichert, die Abschluss-Zeile geschrieben und der Status auf &#x60;completed&#x60; gesetzt — alles oder nichts. Gates: Lieferung aktiv, alle scanbaren Positionen fertig, Notizen bestätigt (falls vorhanden).
///
/// Parameters:
/// * [deliveryId]
@ -269,6 +377,7 @@ class DeliveriesApi {
],
...?extra,
},
contentType: 'multipart/form-data',
validateStatus: validateStatus,
);
@ -414,6 +523,116 @@ class DeliveriesApi {
);
}
/// Löscht eine Notiz. Antwortet mit &#x60;204 No Content&#x60;.
///
///
/// Parameters:
/// * [deliveryId]
/// * [noteId]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future]
/// Throws [DioException] if API call or serialization fails
Future<Response<void>> deleteNote({
required String deliveryId,
required String noteId,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/deliveries/{delivery_id}/notes/{note_id}'.replaceAll('{' r'delivery_id' '}', encodeQueryParameter(_serializers, deliveryId, const FullType(String)).toString()).replaceAll('{' r'note_id' '}', encodeQueryParameter(_serializers, noteId, const FullType(String)).toString());
final _options = Options(
method: r'DELETE',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'bearer_auth',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _response = await _dio.request<Object>(
_path,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
return _response;
}
/// Entfernt den Service-Wert einer Lieferung (Service „nicht gesetzt\&quot;). Nur bei aktiver Lieferung. Antwort &#x60;204&#x60;.
///
///
/// Parameters:
/// * [deliveryId]
/// * [serviceId]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future]
/// Throws [DioException] if API call or serialization fails
Future<Response<void>> deleteServiceValue({
required String deliveryId,
required String serviceId,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/deliveries/{delivery_id}/services/{service_id}'.replaceAll('{' r'delivery_id' '}', encodeQueryParameter(_serializers, deliveryId, const FullType(String)).toString()).replaceAll('{' r'service_id' '}', encodeQueryParameter(_serializers, serviceId, const FullType(String)).toString());
final _options = Options(
method: r'DELETE',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'bearer_auth',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _response = await _dio.request<Object>(
_path,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
return _response;
}
/// Setzt die Lieferung auf &#x60;held&#x60;. Nur aus &#x60;active&#x60; zulässig.
///
///
@ -598,4 +817,296 @@ class DeliveriesApi {
);
}
/// Setzt (Upsert) den Wert eines Service für eine Lieferung. Genau das zum Service-Typ passende Feld (&#x60;boolValue&#x60;/&#x60;numericValue&#x60;) muss gesetzt sein; numerische Werte werden gegen min/max geprüft. Nur bei aktiver Lieferung.
///
///
/// Parameters:
/// * [deliveryId]
/// * [serviceId]
/// * [setDeliveryServiceRequest]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [DeliveryServiceResponse] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<DeliveryServiceResponse>> setService({
required String deliveryId,
required String serviceId,
required SetDeliveryServiceRequest setDeliveryServiceRequest,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/deliveries/{delivery_id}/services/{service_id}'.replaceAll('{' r'delivery_id' '}', encodeQueryParameter(_serializers, deliveryId, const FullType(String)).toString()).replaceAll('{' r'service_id' '}', encodeQueryParameter(_serializers, serviceId, const FullType(String)).toString());
final _options = Options(
method: r'PUT',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'bearer_auth',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
const _type = FullType(SetDeliveryServiceRequest);
_bodyData = _serializers.serialize(setDeliveryServiceRequest, specifiedType: _type);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
DeliveryServiceResponse? _responseData;
try {
final rawResponse = _response.data;
_responseData = rawResponse == null ? null : _serializers.deserialize(
rawResponse,
specifiedType: const FullType(DeliveryServiceResponse),
) as DeliveryServiceResponse;
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<DeliveryServiceResponse>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Ändert Text/Bild einer Notiz. Innerhalb des (geteilten) Accounts darf jeder Fahrer Notizen pflegen — kein Autor-Check. &#x60;delivery_id&#x60; ist Teil des Pfads (REST-Konsistenz), die Notiz wird über &#x60;note_id&#x60; adressiert.
///
///
/// Parameters:
/// * [deliveryId]
/// * [noteId]
/// * [updateDeliveryNoteRequest]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [DeliveryNoteResponse] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<DeliveryNoteResponse>> updateNote({
required String deliveryId,
required String noteId,
required UpdateDeliveryNoteRequest updateDeliveryNoteRequest,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/deliveries/{delivery_id}/notes/{note_id}'.replaceAll('{' r'delivery_id' '}', encodeQueryParameter(_serializers, deliveryId, const FullType(String)).toString()).replaceAll('{' r'note_id' '}', encodeQueryParameter(_serializers, noteId, const FullType(String)).toString());
final _options = Options(
method: r'PATCH',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'bearer_auth',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
const _type = FullType(UpdateDeliveryNoteRequest);
_bodyData = _serializers.serialize(updateDeliveryNoteRequest, specifiedType: _type);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
DeliveryNoteResponse? _responseData;
try {
final rawResponse = _response.data;
_responseData = rawResponse == null ? null : _serializers.deserialize(
rawResponse,
specifiedType: const FullType(DeliveryNoteResponse),
) as DeliveryNoteResponse;
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<DeliveryNoteResponse>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Lädt ein Bild zu einer Lieferung hoch (multipart/form-data, Feld &#x60;file&#x60;) und legt dafür eine Bild-Notiz an. Das Bild geht in den DOCUframe-Dokumentenspeicher; gespeichert wird die zurückgelieferte Referenz (&#x60;~ObjectID&#x60;) als &#x60;image_attachment&#x60; der Notiz.
///
///
/// Parameters:
/// * [deliveryId]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [DeliveryNoteResponse] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<DeliveryNoteResponse>> uploadNoteImage({
required String deliveryId,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/deliveries/{delivery_id}/notes/image'.replaceAll('{' r'delivery_id' '}', encodeQueryParameter(_serializers, deliveryId, const FullType(String)).toString());
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'bearer_auth',
},
],
...?extra,
},
contentType: 'multipart/form-data',
validateStatus: validateStatus,
);
final _response = await _dio.request<Object>(
_path,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
DeliveryNoteResponse? _responseData;
try {
final rawResponse = _response.data;
_responseData = rawResponse == null ? null : _serializers.deserialize(
rawResponse,
specifiedType: const FullType(DeliveryNoteResponse),
) as DeliveryNoteResponse;
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<DeliveryNoteResponse>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
}

View File

@ -0,0 +1,368 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
import 'dart:async';
import 'package:built_value/json_object.dart';
import 'package:built_value/serializer.dart';
import 'package:dio/dio.dart';
import 'package:holzleitner_api/src/api_util.dart';
import 'package:holzleitner_api/src/model/create_payment_method_request.dart';
import 'package:holzleitner_api/src/model/payment_method_response.dart';
import 'package:holzleitner_api/src/model/payment_methods_list.dart';
import 'package:holzleitner_api/src/model/update_payment_method_request.dart';
class PaymentMethodsApi {
final Dio _dio;
final Serializers _serializers;
const PaymentMethodsApi(this._dio, this._serializers);
/// Legt eine neue Zahlungsmethode an.
///
///
/// Parameters:
/// * [createPaymentMethodRequest]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [PaymentMethodResponse] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<PaymentMethodResponse>> createPaymentMethod({
required CreatePaymentMethodRequest createPaymentMethodRequest,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/payment-methods';
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'bearer_auth',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
const _type = FullType(CreatePaymentMethodRequest);
_bodyData = _serializers.serialize(createPaymentMethodRequest, specifiedType: _type);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
PaymentMethodResponse? _responseData;
try {
final rawResponse = _response.data;
_responseData = rawResponse == null ? null : _serializers.deserialize(
rawResponse,
specifiedType: const FullType(PaymentMethodResponse),
) as PaymentMethodResponse;
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<PaymentMethodResponse>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Hartes Löschen. &#x60;409 Conflict&#x60;, wenn die Methode von einer Lieferung referenziert wird — der Admin soll dann den &#x60;active &#x3D; false&#x60;-Pfad nutzen.
///
///
/// Parameters:
/// * [id] - Zahlungsmethoden-Id
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future]
/// Throws [DioException] if API call or serialization fails
Future<Response<void>> deletePaymentMethod({
required String id,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/payment-methods/{id}'.replaceAll('{' r'id' '}', encodeQueryParameter(_serializers, id, const FullType(String)).toString());
final _options = Options(
method: r'DELETE',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'bearer_auth',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _response = await _dio.request<Object>(
_path,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
return _response;
}
/// Listet die Zahlungsmethoden.
///
///
/// Parameters:
/// * [includeInactive] - Wenn true, werden inaktive Methoden mitgeliefert (default: false)
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [PaymentMethodsList] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<PaymentMethodsList>> listPaymentMethods({
bool? includeInactive,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/payment-methods';
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'bearer_auth',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
if (includeInactive != null) r'includeInactive': encodeQueryParameter(_serializers, includeInactive, const FullType(bool)),
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
PaymentMethodsList? _responseData;
try {
final rawResponse = _response.data;
_responseData = rawResponse == null ? null : _serializers.deserialize(
rawResponse,
specifiedType: const FullType(PaymentMethodsList),
) as PaymentMethodsList;
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<PaymentMethodsList>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Patcht Anzeige-Name und/oder Aktiv-Flag.
///
///
/// Parameters:
/// * [id] - Zahlungsmethoden-Id
/// * [updatePaymentMethodRequest]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [PaymentMethodResponse] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<PaymentMethodResponse>> updatePaymentMethod({
required String id,
required UpdatePaymentMethodRequest updatePaymentMethodRequest,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/payment-methods/{id}'.replaceAll('{' r'id' '}', encodeQueryParameter(_serializers, id, const FullType(String)).toString());
final _options = Options(
method: r'PATCH',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'bearer_auth',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
const _type = FullType(UpdatePaymentMethodRequest);
_bodyData = _serializers.serialize(updatePaymentMethodRequest, specifiedType: _type);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
PaymentMethodResponse? _responseData;
try {
final rawResponse = _response.data;
_responseData = rawResponse == null ? null : _serializers.deserialize(
rawResponse,
specifiedType: const FullType(PaymentMethodResponse),
) as PaymentMethodResponse;
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<PaymentMethodResponse>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
}

View File

@ -0,0 +1,368 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
import 'dart:async';
import 'package:built_value/json_object.dart';
import 'package:built_value/serializer.dart';
import 'package:dio/dio.dart';
import 'package:holzleitner_api/src/api_util.dart';
import 'package:holzleitner_api/src/model/create_service_request.dart';
import 'package:holzleitner_api/src/model/service_response.dart';
import 'package:holzleitner_api/src/model/services_list.dart';
import 'package:holzleitner_api/src/model/update_service_request.dart';
class ServicesApi {
final Dio _dio;
final Serializers _serializers;
const ServicesApi(this._dio, this._serializers);
/// Legt einen neuen Service an.
///
///
/// Parameters:
/// * [createServiceRequest]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [ServiceResponse] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<ServiceResponse>> createService({
required CreateServiceRequest createServiceRequest,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/services';
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'bearer_auth',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
const _type = FullType(CreateServiceRequest);
_bodyData = _serializers.serialize(createServiceRequest, specifiedType: _type);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
ServiceResponse? _responseData;
try {
final rawResponse = _response.data;
_responseData = rawResponse == null ? null : _serializers.deserialize(
rawResponse,
specifiedType: const FullType(ServiceResponse),
) as ServiceResponse;
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<ServiceResponse>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Hartes Löschen. &#x60;409 Conflict&#x60;, wenn der Service noch von einer Lieferung referenziert wird — dann stattdessen deaktivieren.
///
///
/// Parameters:
/// * [id] - Service-Id
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future]
/// Throws [DioException] if API call or serialization fails
Future<Response<void>> deleteService({
required String id,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/services/{id}'.replaceAll('{' r'id' '}', encodeQueryParameter(_serializers, id, const FullType(String)).toString());
final _options = Options(
method: r'DELETE',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'bearer_auth',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _response = await _dio.request<Object>(
_path,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
return _response;
}
/// Listet die Services (sortiert nach &#x60;sortOrder&#x60;).
///
///
/// Parameters:
/// * [includeInactive] - Wenn true, werden inaktive Services mitgeliefert (default: false)
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [ServicesList] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<ServicesList>> listServices({
bool? includeInactive,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/services';
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'bearer_auth',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
if (includeInactive != null) r'includeInactive': encodeQueryParameter(_serializers, includeInactive, const FullType(bool)),
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
ServicesList? _responseData;
try {
final rawResponse = _response.data;
_responseData = rawResponse == null ? null : _serializers.deserialize(
rawResponse,
specifiedType: const FullType(ServicesList),
) as ServicesList;
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<ServicesList>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Patcht Name/Grenzen/Aktiv-Flag/Sortierung. &#x60;kind&#x60; ist nicht änderbar.
///
///
/// Parameters:
/// * [id] - Service-Id
/// * [updateServiceRequest]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [ServiceResponse] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<ServiceResponse>> updateService({
required String id,
required UpdateServiceRequest updateServiceRequest,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/services/{id}'.replaceAll('{' r'id' '}', encodeQueryParameter(_serializers, id, const FullType(String)).toString());
final _options = Options(
method: r'PATCH',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'bearer_auth',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
const _type = FullType(UpdateServiceRequest);
_bodyData = _serializers.serialize(updateServiceRequest, specifiedType: _type);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
ServiceResponse? _responseData;
try {
final rawResponse = _response.data;
_responseData = rawResponse == null ? null : _serializers.deserialize(
rawResponse,
specifiedType: const FullType(ServiceResponse),
) as ServiceResponse;
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<ServiceResponse>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
}