solidarity-service/interoperability/solidarity-api/server/openapi/model_booking_request.go

48 lines
1.3 KiB
Go
Raw Normal View History

2023-10-20 11:41:39 +00:00
/*
* Solidarity Mobility API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package openapi
type BookingRequest struct {
// Booking id is common between both operators, and must be created as a [UUID](https://datatracker.ietf.org/doc/html/rfc4122) by whoever initiates the booking. Usage of a [4 UUID](https://datatracker.ietf.org/doc/html/rfc4122#section-4.4) generation algorithm is advised.
Id string `json:"id"`
PassengerId string `json:"passengerId"`
DriverId string `json:"driverId"`
Status BookingStatus `json:"status"`
Operator string `json:"operator"`
}
// AssertBookingRequestRequired checks if the required fields are not zero-ed
func AssertBookingRequestRequired(obj BookingRequest) error {
elements := map[string]interface{}{
2023-10-20 11:47:51 +00:00
"id": obj.Id,
2023-10-20 11:41:39 +00:00
"passengerId": obj.PassengerId,
2023-10-20 11:47:51 +00:00
"driverId": obj.DriverId,
"status": obj.Status,
"operator": obj.Operator,
2023-10-20 11:41:39 +00:00
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
return nil
}
// AssertBookingRequestConstraints checks if the values respects the defined constraints
func AssertBookingRequestConstraints(obj BookingRequest) error {
return nil
}