solidarity-service/interoperability/solidarity-api/server/openapi/model_driver_regular_availa...

72 lines
1.9 KiB
Go
Raw Permalink 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 DriverRegularAvailabilitiesRequest struct {
// The address or location description.
Address string `json:"address"`
// The latitude coordinate of the location.
Latitude float64 `json:"latitude"`
// The longitude coordinate of the location.
Longitude float64 `json:"longitude"`
// The radius around the location.
Radius int32 `json:"radius"`
Availabilities []RegularAvailabilitySlot `json:"availabilities"`
User User `json:"user"`
Preferences Preferences `json:"preferences,omitempty"`
Car Car `json:"car,omitempty"`
}
// AssertDriverRegularAvailabilitiesRequestRequired checks if the required fields are not zero-ed
func AssertDriverRegularAvailabilitiesRequestRequired(obj DriverRegularAvailabilitiesRequest) error {
elements := map[string]interface{}{
2023-10-20 11:47:51 +00:00
"address": obj.Address,
"latitude": obj.Latitude,
"longitude": obj.Longitude,
"radius": obj.Radius,
2023-10-20 11:41:39 +00:00
"availabilities": obj.Availabilities,
2023-10-20 11:47:51 +00:00
"user": obj.User,
2023-10-20 11:41:39 +00:00
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
for _, el := range obj.Availabilities {
if err := AssertRegularAvailabilitySlotRequired(el); err != nil {
return err
}
}
if err := AssertUserRequired(obj.User); err != nil {
return err
}
if err := AssertPreferencesRequired(obj.Preferences); err != nil {
return err
}
if err := AssertCarRequired(obj.Car); err != nil {
return err
}
return nil
}
// AssertDriverRegularAvailabilitiesRequestConstraints checks if the values respects the defined constraints
func AssertDriverRegularAvailabilitiesRequestConstraints(obj DriverRegularAvailabilitiesRequest) error {
return nil
}