/*
 * 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"`

	DepartureAddressLat    float64 `json:"departure_address_lat"`
	DepartureAddressLong   float64 `json:"departure_address_long"`
	DestinationAddressLat  float64 `json:"destination_address_lat"`
	DestinationAddressLong float64 `json:"destination_address_long"`
	DepartureAddress       string  `json:"departure_address"`
	DestinationAddress     string  `json:"destination_address"`
	Pickup_date            int32   `json:"pickup_date"`
}

// AssertBookingRequestRequired checks if the required fields are not zero-ed
func AssertBookingRequestRequired(obj BookingRequest) error {
	elements := map[string]interface{}{
		"id":                       obj.Id,
		"passengerId":              obj.PassengerId,
		"driverId":                 obj.DriverId,
		"status":                   obj.Status,
		"operator":                 obj.Operator,
		"departure_address_lat":    obj.DepartureAddressLat,
		"departure_address_long":   obj.DepartureAddressLong,
		"destination_address_lat":  obj.DestinationAddressLat,
		"destination_address_long": obj.DestinationAddressLong,
		"pickup_date":              obj.Pickup_date,
		"departure_address":        obj.DepartureAddress,
		"destination_address":      obj.DestinationAddress,
	}
	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
}
