# holzleitner_api.api.DeliveriesApi

## Load the API package
```dart
import 'package:holzleitner_api/api.dart';
```

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**assignCar**](DeliveriesApi.md#assigncar) | **PUT** /deliveries/{delivery_id}/assigned-car | 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.
[**cancel**](DeliveriesApi.md#cancel) | **POST** /deliveries/{delivery_id}/cancel | Setzt die Lieferung auf &#x60;canceled&#x60; — endgültig. Erlaubt aus &#x60;active&#x60; und &#x60;held&#x60;.
[**complete**](DeliveriesApi.md#complete) | **POST** /deliveries/{delivery_id}/complete | Schließt die Lieferung ab — &#x60;state &#x3D; completed&#x60;. Nur aus &#x60;active&#x60;.
[**createNote**](DeliveriesApi.md#createnote) | **POST** /deliveries/{delivery_id}/notes | Legt eine neue Notiz an einer Lieferung an. Mindestens eines von &#x60;text&#x60; und &#x60;imageAttachment&#x60; muss inhaltlich gefüllt sein (Leerstrings werden serverseitig getrimmt und als leer behandelt).
[**hold**](DeliveriesApi.md#hold) | **POST** /deliveries/{delivery_id}/hold | Setzt die Lieferung auf &#x60;held&#x60;. Nur aus &#x60;active&#x60; zulässig.
[**resume**](DeliveriesApi.md#resume) | **POST** /deliveries/{delivery_id}/resume | Setzt die Lieferung zurück auf &#x60;active&#x60;. Nur aus &#x60;held&#x60; zulässig.


# **assignCar**
> DeliveryResponse assignCar(deliveryId, assignCarRequest)

Setzt das `assigned_car_id` einer Lieferung. `carId: null` löst die Zuordnung wieder. Der Use Case stellt sicher, dass das Fahrzeug zum angemeldeten Account gehört.

### Example
```dart
import 'package:holzleitner_api/api.dart';

final api = HolzleitnerApi().getDeliveriesApi();
final String deliveryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final AssignCarRequest assignCarRequest = ; // AssignCarRequest | 

try {
    final response = api.assignCar(deliveryId, assignCarRequest);
    print(response);
} catch on DioException (e) {
    print('Exception when calling DeliveriesApi->assignCar: $e\n');
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **deliveryId** | **String**|  | 
 **assignCarRequest** | [**AssignCarRequest**](AssignCarRequest.md)|  | 

### Return type

[**DeliveryResponse**](DeliveryResponse.md)

### Authorization

[bearer_auth](../README.md#bearer_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)

# **cancel**
> DeliveryResponse cancel(deliveryId, cancelDeliveryRequest)

Setzt die Lieferung auf `canceled` — endgültig. Erlaubt aus `active` und `held`.

### Example
```dart
import 'package:holzleitner_api/api.dart';

final api = HolzleitnerApi().getDeliveriesApi();
final String deliveryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final CancelDeliveryRequest cancelDeliveryRequest = ; // CancelDeliveryRequest | 

try {
    final response = api.cancel(deliveryId, cancelDeliveryRequest);
    print(response);
} catch on DioException (e) {
    print('Exception when calling DeliveriesApi->cancel: $e\n');
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **deliveryId** | **String**|  | 
 **cancelDeliveryRequest** | [**CancelDeliveryRequest**](CancelDeliveryRequest.md)|  | 

### Return type

[**DeliveryResponse**](DeliveryResponse.md)

### Authorization

[bearer_auth](../README.md#bearer_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)

# **complete**
> DeliveryResponse complete(deliveryId)

Schließt die Lieferung ab — `state = completed`. Nur aus `active`.

### Example
```dart
import 'package:holzleitner_api/api.dart';

final api = HolzleitnerApi().getDeliveriesApi();
final String deliveryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 

try {
    final response = api.complete(deliveryId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling DeliveriesApi->complete: $e\n');
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **deliveryId** | **String**|  | 

### Return type

[**DeliveryResponse**](DeliveryResponse.md)

### Authorization

[bearer_auth](../README.md#bearer_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)

# **createNote**
> DeliveryNoteResponse createNote(deliveryId, createDeliveryNoteRequest)

Legt eine neue Notiz an einer Lieferung an. Mindestens eines von `text` und `imageAttachment` muss inhaltlich gefüllt sein (Leerstrings werden serverseitig getrimmt und als leer behandelt).

### Example
```dart
import 'package:holzleitner_api/api.dart';

final api = HolzleitnerApi().getDeliveriesApi();
final String deliveryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final CreateDeliveryNoteRequest createDeliveryNoteRequest = ; // CreateDeliveryNoteRequest | 

try {
    final response = api.createNote(deliveryId, createDeliveryNoteRequest);
    print(response);
} catch on DioException (e) {
    print('Exception when calling DeliveriesApi->createNote: $e\n');
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **deliveryId** | **String**|  | 
 **createDeliveryNoteRequest** | [**CreateDeliveryNoteRequest**](CreateDeliveryNoteRequest.md)|  | 

### Return type

[**DeliveryNoteResponse**](DeliveryNoteResponse.md)

### Authorization

[bearer_auth](../README.md#bearer_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)

# **hold**
> DeliveryResponse hold(deliveryId, holdDeliveryRequest)

Setzt die Lieferung auf `held`. Nur aus `active` zulässig.

### Example
```dart
import 'package:holzleitner_api/api.dart';

final api = HolzleitnerApi().getDeliveriesApi();
final String deliveryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final HoldDeliveryRequest holdDeliveryRequest = ; // HoldDeliveryRequest | 

try {
    final response = api.hold(deliveryId, holdDeliveryRequest);
    print(response);
} catch on DioException (e) {
    print('Exception when calling DeliveriesApi->hold: $e\n');
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **deliveryId** | **String**|  | 
 **holdDeliveryRequest** | [**HoldDeliveryRequest**](HoldDeliveryRequest.md)|  | 

### Return type

[**DeliveryResponse**](DeliveryResponse.md)

### Authorization

[bearer_auth](../README.md#bearer_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)

# **resume**
> DeliveryResponse resume(deliveryId)

Setzt die Lieferung zurück auf `active`. Nur aus `held` zulässig.

### Example
```dart
import 'package:holzleitner_api/api.dart';

final api = HolzleitnerApi().getDeliveriesApi();
final String deliveryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 

try {
    final response = api.resume(deliveryId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling DeliveriesApi->resume: $e\n');
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **deliveryId** | **String**|  | 

### Return type

[**DeliveryResponse**](DeliveryResponse.md)

### Authorization

[bearer_auth](../README.md#bearer_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)

