49 lines
1.4 KiB
Go
49 lines
1.4 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
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
type Preferences struct {
|
|
|
|
// If driver journey, specifies if the driver allows smoking in the car.
|
|
Smoking bool `json:"smoking,omitempty"`
|
|
|
|
// If driver journey, specifies if the driver allows animals in the car.
|
|
Animals bool `json:"animals,omitempty"`
|
|
|
|
// If driver journey, specifies if the driver enjoys music in the car.
|
|
Music bool `json:"music,omitempty"`
|
|
|
|
// If driver journey, specifies if the driver enjoys talking with passengers.
|
|
IsTalker bool `json:"isTalker,omitempty"`
|
|
|
|
// If driver journey, specifies the size of allowed luggages. From very small (1) to very big (5).
|
|
LuggageSize int32 `json:"luggageSize,omitempty"`
|
|
}
|
|
|
|
// AssertPreferencesRequired checks if the required fields are not zero-ed
|
|
func AssertPreferencesRequired(obj Preferences) error {
|
|
return nil
|
|
}
|
|
|
|
// AssertPreferencesConstraints checks if the values respects the defined constraints
|
|
func AssertPreferencesConstraints(obj Preferences) error {
|
|
if obj.LuggageSize < 1 {
|
|
return &ParsingError{Err: errors.New(errMsgMinValueConstraint)}
|
|
}
|
|
if obj.LuggageSize > 5 {
|
|
return &ParsingError{Err: errors.New(errMsgMaxValueConstraint)}
|
|
}
|
|
return nil
|
|
}
|