72 lines
1.9 KiB
Go
72 lines
1.9 KiB
Go
/*
|
|
* 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 DriverPunctualAvailabilitiesRequest 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 []PunctualAvailabilitySlot `json:"availabilities"`
|
|
|
|
User User `json:"user"`
|
|
|
|
Preferences Preferences `json:"preferences,omitempty"`
|
|
|
|
Car Car `json:"car,omitempty"`
|
|
}
|
|
|
|
// AssertDriverPunctualAvailabilitiesRequestRequired checks if the required fields are not zero-ed
|
|
func AssertDriverPunctualAvailabilitiesRequestRequired(obj DriverPunctualAvailabilitiesRequest) error {
|
|
elements := map[string]interface{}{
|
|
"address": obj.Address,
|
|
"latitude": obj.Latitude,
|
|
"longitude": obj.Longitude,
|
|
"radius": obj.Radius,
|
|
"availabilities": obj.Availabilities,
|
|
"user": obj.User,
|
|
}
|
|
for name, el := range elements {
|
|
if isZero := IsZeroValue(el); isZero {
|
|
return &RequiredError{Field: name}
|
|
}
|
|
}
|
|
|
|
for _, el := range obj.Availabilities {
|
|
if err := AssertPunctualAvailabilitySlotRequired(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
|
|
}
|
|
|
|
// AssertDriverPunctualAvailabilitiesRequestConstraints checks if the values respects the defined constraints
|
|
func AssertDriverPunctualAvailabilitiesRequestConstraints(obj DriverPunctualAvailabilitiesRequest) error {
|
|
return nil
|
|
}
|