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 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{}{
|
|
"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 := 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
|
|
}
|