forked from gsn/predictor
feat: implemented service/transport/main layers
This commit is contained in:
parent
5158c5d7c9
commit
bcb9ace54c
29 changed files with 804 additions and 393 deletions
|
|
@ -203,38 +203,38 @@ func (o OptFloat64) Or(d float64) float64 {
|
|||
return d
|
||||
}
|
||||
|
||||
// NewOptParameters returns new OptParameters with value set to v.
|
||||
func NewOptParameters(v Parameters) OptParameters {
|
||||
return OptParameters{
|
||||
// NewOptPredictionParameters returns new OptPredictionParameters with value set to v.
|
||||
func NewOptPredictionParameters(v PredictionParameters) OptPredictionParameters {
|
||||
return OptPredictionParameters{
|
||||
Value: v,
|
||||
Set: true,
|
||||
}
|
||||
}
|
||||
|
||||
// OptParameters is optional Parameters.
|
||||
type OptParameters struct {
|
||||
Value Parameters
|
||||
// OptPredictionParameters is optional PredictionParameters.
|
||||
type OptPredictionParameters struct {
|
||||
Value PredictionParameters
|
||||
Set bool
|
||||
}
|
||||
|
||||
// IsSet returns true if OptParameters was set.
|
||||
func (o OptParameters) IsSet() bool { return o.Set }
|
||||
// IsSet returns true if OptPredictionParameters was set.
|
||||
func (o OptPredictionParameters) IsSet() bool { return o.Set }
|
||||
|
||||
// Reset unsets value.
|
||||
func (o *OptParameters) Reset() {
|
||||
var v Parameters
|
||||
func (o *OptPredictionParameters) Reset() {
|
||||
var v PredictionParameters
|
||||
o.Value = v
|
||||
o.Set = false
|
||||
}
|
||||
|
||||
// SetTo sets value to v.
|
||||
func (o *OptParameters) SetTo(v Parameters) {
|
||||
func (o *OptPredictionParameters) SetTo(v PredictionParameters) {
|
||||
o.Set = true
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
// Get returns value and boolean that denotes whether value was set.
|
||||
func (o OptParameters) Get() (v Parameters, ok bool) {
|
||||
func (o OptPredictionParameters) Get() (v PredictionParameters, ok bool) {
|
||||
if !o.Set {
|
||||
return v, false
|
||||
}
|
||||
|
|
@ -242,45 +242,45 @@ func (o OptParameters) Get() (v Parameters, ok bool) {
|
|||
}
|
||||
|
||||
// Or returns value if set, or given parameter if does not.
|
||||
func (o OptParameters) Or(d Parameters) Parameters {
|
||||
func (o OptPredictionParameters) Or(d PredictionParameters) PredictionParameters {
|
||||
if v, ok := o.Get(); ok {
|
||||
return v
|
||||
}
|
||||
return d
|
||||
}
|
||||
|
||||
// NewOptParametersFormat returns new OptParametersFormat with value set to v.
|
||||
func NewOptParametersFormat(v ParametersFormat) OptParametersFormat {
|
||||
return OptParametersFormat{
|
||||
// NewOptPredictionParametersFormat returns new OptPredictionParametersFormat with value set to v.
|
||||
func NewOptPredictionParametersFormat(v PredictionParametersFormat) OptPredictionParametersFormat {
|
||||
return OptPredictionParametersFormat{
|
||||
Value: v,
|
||||
Set: true,
|
||||
}
|
||||
}
|
||||
|
||||
// OptParametersFormat is optional ParametersFormat.
|
||||
type OptParametersFormat struct {
|
||||
Value ParametersFormat
|
||||
// OptPredictionParametersFormat is optional PredictionParametersFormat.
|
||||
type OptPredictionParametersFormat struct {
|
||||
Value PredictionParametersFormat
|
||||
Set bool
|
||||
}
|
||||
|
||||
// IsSet returns true if OptParametersFormat was set.
|
||||
func (o OptParametersFormat) IsSet() bool { return o.Set }
|
||||
// IsSet returns true if OptPredictionParametersFormat was set.
|
||||
func (o OptPredictionParametersFormat) IsSet() bool { return o.Set }
|
||||
|
||||
// Reset unsets value.
|
||||
func (o *OptParametersFormat) Reset() {
|
||||
var v ParametersFormat
|
||||
func (o *OptPredictionParametersFormat) Reset() {
|
||||
var v PredictionParametersFormat
|
||||
o.Value = v
|
||||
o.Set = false
|
||||
}
|
||||
|
||||
// SetTo sets value to v.
|
||||
func (o *OptParametersFormat) SetTo(v ParametersFormat) {
|
||||
func (o *OptPredictionParametersFormat) SetTo(v PredictionParametersFormat) {
|
||||
o.Set = true
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
// Get returns value and boolean that denotes whether value was set.
|
||||
func (o OptParametersFormat) Get() (v ParametersFormat, ok bool) {
|
||||
func (o OptPredictionParametersFormat) Get() (v PredictionParametersFormat, ok bool) {
|
||||
if !o.Set {
|
||||
return v, false
|
||||
}
|
||||
|
|
@ -288,45 +288,45 @@ func (o OptParametersFormat) Get() (v ParametersFormat, ok bool) {
|
|||
}
|
||||
|
||||
// Or returns value if set, or given parameter if does not.
|
||||
func (o OptParametersFormat) Or(d ParametersFormat) ParametersFormat {
|
||||
func (o OptPredictionParametersFormat) Or(d PredictionParametersFormat) PredictionParametersFormat {
|
||||
if v, ok := o.Get(); ok {
|
||||
return v
|
||||
}
|
||||
return d
|
||||
}
|
||||
|
||||
// NewOptParametersProfile returns new OptParametersProfile with value set to v.
|
||||
func NewOptParametersProfile(v ParametersProfile) OptParametersProfile {
|
||||
return OptParametersProfile{
|
||||
// NewOptPredictionParametersProfile returns new OptPredictionParametersProfile with value set to v.
|
||||
func NewOptPredictionParametersProfile(v PredictionParametersProfile) OptPredictionParametersProfile {
|
||||
return OptPredictionParametersProfile{
|
||||
Value: v,
|
||||
Set: true,
|
||||
}
|
||||
}
|
||||
|
||||
// OptParametersProfile is optional ParametersProfile.
|
||||
type OptParametersProfile struct {
|
||||
Value ParametersProfile
|
||||
// OptPredictionParametersProfile is optional PredictionParametersProfile.
|
||||
type OptPredictionParametersProfile struct {
|
||||
Value PredictionParametersProfile
|
||||
Set bool
|
||||
}
|
||||
|
||||
// IsSet returns true if OptParametersProfile was set.
|
||||
func (o OptParametersProfile) IsSet() bool { return o.Set }
|
||||
// IsSet returns true if OptPredictionParametersProfile was set.
|
||||
func (o OptPredictionParametersProfile) IsSet() bool { return o.Set }
|
||||
|
||||
// Reset unsets value.
|
||||
func (o *OptParametersProfile) Reset() {
|
||||
var v ParametersProfile
|
||||
func (o *OptPredictionParametersProfile) Reset() {
|
||||
var v PredictionParametersProfile
|
||||
o.Value = v
|
||||
o.Set = false
|
||||
}
|
||||
|
||||
// SetTo sets value to v.
|
||||
func (o *OptParametersProfile) SetTo(v ParametersProfile) {
|
||||
func (o *OptPredictionParametersProfile) SetTo(v PredictionParametersProfile) {
|
||||
o.Set = true
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
// Get returns value and boolean that denotes whether value was set.
|
||||
func (o OptParametersProfile) Get() (v ParametersProfile, ok bool) {
|
||||
func (o OptPredictionParametersProfile) Get() (v PredictionParametersProfile, ok bool) {
|
||||
if !o.Set {
|
||||
return v, false
|
||||
}
|
||||
|
|
@ -334,7 +334,7 @@ func (o OptParametersProfile) Get() (v ParametersProfile, ok bool) {
|
|||
}
|
||||
|
||||
// Or returns value if set, or given parameter if does not.
|
||||
func (o OptParametersProfile) Or(d ParametersProfile) ParametersProfile {
|
||||
func (o OptPredictionParametersProfile) Or(d PredictionParametersProfile) PredictionParametersProfile {
|
||||
if v, ok := o.Get(); ok {
|
||||
return v
|
||||
}
|
||||
|
|
@ -387,194 +387,194 @@ func (o OptString) Or(d string) string {
|
|||
return d
|
||||
}
|
||||
|
||||
// Ref: #/components/schemas/Prediction/Parameters
|
||||
type Parameters struct {
|
||||
LaunchLatitude OptFloat64 `json:"launch_latitude"`
|
||||
LaunchLongitude OptFloat64 `json:"launch_longitude"`
|
||||
LaunchDatetime OptDateTime `json:"launch_datetime"`
|
||||
LaunchAltitude OptFloat64 `json:"launch_altitude"`
|
||||
Profile OptParametersProfile `json:"profile"`
|
||||
AscentRate OptFloat64 `json:"ascent_rate"`
|
||||
BurstAltitude OptFloat64 `json:"burst_altitude"`
|
||||
DescentRate OptFloat64 `json:"descent_rate"`
|
||||
FloatAltitude OptFloat64 `json:"float_altitude"`
|
||||
StopDatetime OptDateTime `json:"stop_datetime"`
|
||||
// Ref: #/components/schemas/PredictionParameters
|
||||
type PredictionParameters struct {
|
||||
LaunchLatitude OptFloat64 `json:"launch_latitude"`
|
||||
LaunchLongitude OptFloat64 `json:"launch_longitude"`
|
||||
LaunchDatetime OptDateTime `json:"launch_datetime"`
|
||||
LaunchAltitude OptFloat64 `json:"launch_altitude"`
|
||||
Profile OptPredictionParametersProfile `json:"profile"`
|
||||
AscentRate OptFloat64 `json:"ascent_rate"`
|
||||
BurstAltitude OptFloat64 `json:"burst_altitude"`
|
||||
DescentRate OptFloat64 `json:"descent_rate"`
|
||||
FloatAltitude OptFloat64 `json:"float_altitude"`
|
||||
StopDatetime OptDateTime `json:"stop_datetime"`
|
||||
// Base64 encoded ascent curve.
|
||||
AscentCurve OptString `json:"ascent_curve"`
|
||||
// Base64 encoded descent curve.
|
||||
DescentCurve OptString `json:"descent_curve"`
|
||||
Interpolate OptBool `json:"interpolate"`
|
||||
Format OptParametersFormat `json:"format"`
|
||||
Dataset OptDateTime `json:"dataset"`
|
||||
DescentCurve OptString `json:"descent_curve"`
|
||||
Interpolate OptBool `json:"interpolate"`
|
||||
Format OptPredictionParametersFormat `json:"format"`
|
||||
Dataset OptDateTime `json:"dataset"`
|
||||
}
|
||||
|
||||
// GetLaunchLatitude returns the value of LaunchLatitude.
|
||||
func (s *Parameters) GetLaunchLatitude() OptFloat64 {
|
||||
func (s *PredictionParameters) GetLaunchLatitude() OptFloat64 {
|
||||
return s.LaunchLatitude
|
||||
}
|
||||
|
||||
// GetLaunchLongitude returns the value of LaunchLongitude.
|
||||
func (s *Parameters) GetLaunchLongitude() OptFloat64 {
|
||||
func (s *PredictionParameters) GetLaunchLongitude() OptFloat64 {
|
||||
return s.LaunchLongitude
|
||||
}
|
||||
|
||||
// GetLaunchDatetime returns the value of LaunchDatetime.
|
||||
func (s *Parameters) GetLaunchDatetime() OptDateTime {
|
||||
func (s *PredictionParameters) GetLaunchDatetime() OptDateTime {
|
||||
return s.LaunchDatetime
|
||||
}
|
||||
|
||||
// GetLaunchAltitude returns the value of LaunchAltitude.
|
||||
func (s *Parameters) GetLaunchAltitude() OptFloat64 {
|
||||
func (s *PredictionParameters) GetLaunchAltitude() OptFloat64 {
|
||||
return s.LaunchAltitude
|
||||
}
|
||||
|
||||
// GetProfile returns the value of Profile.
|
||||
func (s *Parameters) GetProfile() OptParametersProfile {
|
||||
func (s *PredictionParameters) GetProfile() OptPredictionParametersProfile {
|
||||
return s.Profile
|
||||
}
|
||||
|
||||
// GetAscentRate returns the value of AscentRate.
|
||||
func (s *Parameters) GetAscentRate() OptFloat64 {
|
||||
func (s *PredictionParameters) GetAscentRate() OptFloat64 {
|
||||
return s.AscentRate
|
||||
}
|
||||
|
||||
// GetBurstAltitude returns the value of BurstAltitude.
|
||||
func (s *Parameters) GetBurstAltitude() OptFloat64 {
|
||||
func (s *PredictionParameters) GetBurstAltitude() OptFloat64 {
|
||||
return s.BurstAltitude
|
||||
}
|
||||
|
||||
// GetDescentRate returns the value of DescentRate.
|
||||
func (s *Parameters) GetDescentRate() OptFloat64 {
|
||||
func (s *PredictionParameters) GetDescentRate() OptFloat64 {
|
||||
return s.DescentRate
|
||||
}
|
||||
|
||||
// GetFloatAltitude returns the value of FloatAltitude.
|
||||
func (s *Parameters) GetFloatAltitude() OptFloat64 {
|
||||
func (s *PredictionParameters) GetFloatAltitude() OptFloat64 {
|
||||
return s.FloatAltitude
|
||||
}
|
||||
|
||||
// GetStopDatetime returns the value of StopDatetime.
|
||||
func (s *Parameters) GetStopDatetime() OptDateTime {
|
||||
func (s *PredictionParameters) GetStopDatetime() OptDateTime {
|
||||
return s.StopDatetime
|
||||
}
|
||||
|
||||
// GetAscentCurve returns the value of AscentCurve.
|
||||
func (s *Parameters) GetAscentCurve() OptString {
|
||||
func (s *PredictionParameters) GetAscentCurve() OptString {
|
||||
return s.AscentCurve
|
||||
}
|
||||
|
||||
// GetDescentCurve returns the value of DescentCurve.
|
||||
func (s *Parameters) GetDescentCurve() OptString {
|
||||
func (s *PredictionParameters) GetDescentCurve() OptString {
|
||||
return s.DescentCurve
|
||||
}
|
||||
|
||||
// GetInterpolate returns the value of Interpolate.
|
||||
func (s *Parameters) GetInterpolate() OptBool {
|
||||
func (s *PredictionParameters) GetInterpolate() OptBool {
|
||||
return s.Interpolate
|
||||
}
|
||||
|
||||
// GetFormat returns the value of Format.
|
||||
func (s *Parameters) GetFormat() OptParametersFormat {
|
||||
func (s *PredictionParameters) GetFormat() OptPredictionParametersFormat {
|
||||
return s.Format
|
||||
}
|
||||
|
||||
// GetDataset returns the value of Dataset.
|
||||
func (s *Parameters) GetDataset() OptDateTime {
|
||||
func (s *PredictionParameters) GetDataset() OptDateTime {
|
||||
return s.Dataset
|
||||
}
|
||||
|
||||
// SetLaunchLatitude sets the value of LaunchLatitude.
|
||||
func (s *Parameters) SetLaunchLatitude(val OptFloat64) {
|
||||
func (s *PredictionParameters) SetLaunchLatitude(val OptFloat64) {
|
||||
s.LaunchLatitude = val
|
||||
}
|
||||
|
||||
// SetLaunchLongitude sets the value of LaunchLongitude.
|
||||
func (s *Parameters) SetLaunchLongitude(val OptFloat64) {
|
||||
func (s *PredictionParameters) SetLaunchLongitude(val OptFloat64) {
|
||||
s.LaunchLongitude = val
|
||||
}
|
||||
|
||||
// SetLaunchDatetime sets the value of LaunchDatetime.
|
||||
func (s *Parameters) SetLaunchDatetime(val OptDateTime) {
|
||||
func (s *PredictionParameters) SetLaunchDatetime(val OptDateTime) {
|
||||
s.LaunchDatetime = val
|
||||
}
|
||||
|
||||
// SetLaunchAltitude sets the value of LaunchAltitude.
|
||||
func (s *Parameters) SetLaunchAltitude(val OptFloat64) {
|
||||
func (s *PredictionParameters) SetLaunchAltitude(val OptFloat64) {
|
||||
s.LaunchAltitude = val
|
||||
}
|
||||
|
||||
// SetProfile sets the value of Profile.
|
||||
func (s *Parameters) SetProfile(val OptParametersProfile) {
|
||||
func (s *PredictionParameters) SetProfile(val OptPredictionParametersProfile) {
|
||||
s.Profile = val
|
||||
}
|
||||
|
||||
// SetAscentRate sets the value of AscentRate.
|
||||
func (s *Parameters) SetAscentRate(val OptFloat64) {
|
||||
func (s *PredictionParameters) SetAscentRate(val OptFloat64) {
|
||||
s.AscentRate = val
|
||||
}
|
||||
|
||||
// SetBurstAltitude sets the value of BurstAltitude.
|
||||
func (s *Parameters) SetBurstAltitude(val OptFloat64) {
|
||||
func (s *PredictionParameters) SetBurstAltitude(val OptFloat64) {
|
||||
s.BurstAltitude = val
|
||||
}
|
||||
|
||||
// SetDescentRate sets the value of DescentRate.
|
||||
func (s *Parameters) SetDescentRate(val OptFloat64) {
|
||||
func (s *PredictionParameters) SetDescentRate(val OptFloat64) {
|
||||
s.DescentRate = val
|
||||
}
|
||||
|
||||
// SetFloatAltitude sets the value of FloatAltitude.
|
||||
func (s *Parameters) SetFloatAltitude(val OptFloat64) {
|
||||
func (s *PredictionParameters) SetFloatAltitude(val OptFloat64) {
|
||||
s.FloatAltitude = val
|
||||
}
|
||||
|
||||
// SetStopDatetime sets the value of StopDatetime.
|
||||
func (s *Parameters) SetStopDatetime(val OptDateTime) {
|
||||
func (s *PredictionParameters) SetStopDatetime(val OptDateTime) {
|
||||
s.StopDatetime = val
|
||||
}
|
||||
|
||||
// SetAscentCurve sets the value of AscentCurve.
|
||||
func (s *Parameters) SetAscentCurve(val OptString) {
|
||||
func (s *PredictionParameters) SetAscentCurve(val OptString) {
|
||||
s.AscentCurve = val
|
||||
}
|
||||
|
||||
// SetDescentCurve sets the value of DescentCurve.
|
||||
func (s *Parameters) SetDescentCurve(val OptString) {
|
||||
func (s *PredictionParameters) SetDescentCurve(val OptString) {
|
||||
s.DescentCurve = val
|
||||
}
|
||||
|
||||
// SetInterpolate sets the value of Interpolate.
|
||||
func (s *Parameters) SetInterpolate(val OptBool) {
|
||||
func (s *PredictionParameters) SetInterpolate(val OptBool) {
|
||||
s.Interpolate = val
|
||||
}
|
||||
|
||||
// SetFormat sets the value of Format.
|
||||
func (s *Parameters) SetFormat(val OptParametersFormat) {
|
||||
func (s *PredictionParameters) SetFormat(val OptPredictionParametersFormat) {
|
||||
s.Format = val
|
||||
}
|
||||
|
||||
// SetDataset sets the value of Dataset.
|
||||
func (s *Parameters) SetDataset(val OptDateTime) {
|
||||
func (s *PredictionParameters) SetDataset(val OptDateTime) {
|
||||
s.Dataset = val
|
||||
}
|
||||
|
||||
type ParametersFormat string
|
||||
type PredictionParametersFormat string
|
||||
|
||||
const (
|
||||
ParametersFormatJSON ParametersFormat = "json"
|
||||
PredictionParametersFormatJSON PredictionParametersFormat = "json"
|
||||
)
|
||||
|
||||
// AllValues returns all ParametersFormat values.
|
||||
func (ParametersFormat) AllValues() []ParametersFormat {
|
||||
return []ParametersFormat{
|
||||
ParametersFormatJSON,
|
||||
// AllValues returns all PredictionParametersFormat values.
|
||||
func (PredictionParametersFormat) AllValues() []PredictionParametersFormat {
|
||||
return []PredictionParametersFormat{
|
||||
PredictionParametersFormatJSON,
|
||||
}
|
||||
}
|
||||
|
||||
// MarshalText implements encoding.TextMarshaler.
|
||||
func (s ParametersFormat) MarshalText() ([]byte, error) {
|
||||
func (s PredictionParametersFormat) MarshalText() ([]byte, error) {
|
||||
switch s {
|
||||
case ParametersFormatJSON:
|
||||
case PredictionParametersFormatJSON:
|
||||
return []byte(s), nil
|
||||
default:
|
||||
return nil, errors.Errorf("invalid value: %q", s)
|
||||
|
|
@ -582,45 +582,45 @@ func (s ParametersFormat) MarshalText() ([]byte, error) {
|
|||
}
|
||||
|
||||
// UnmarshalText implements encoding.TextUnmarshaler.
|
||||
func (s *ParametersFormat) UnmarshalText(data []byte) error {
|
||||
switch ParametersFormat(data) {
|
||||
case ParametersFormatJSON:
|
||||
*s = ParametersFormatJSON
|
||||
func (s *PredictionParametersFormat) UnmarshalText(data []byte) error {
|
||||
switch PredictionParametersFormat(data) {
|
||||
case PredictionParametersFormatJSON:
|
||||
*s = PredictionParametersFormatJSON
|
||||
return nil
|
||||
default:
|
||||
return errors.Errorf("invalid value: %q", data)
|
||||
}
|
||||
}
|
||||
|
||||
type ParametersProfile string
|
||||
type PredictionParametersProfile string
|
||||
|
||||
const (
|
||||
ParametersProfileStandardProfile ParametersProfile = "standard_profile"
|
||||
ParametersProfileFloatProfile ParametersProfile = "float_profile"
|
||||
ParametersProfileReverseProfile ParametersProfile = "reverse_profile"
|
||||
ParametersProfileCustomProfile ParametersProfile = "custom_profile"
|
||||
PredictionParametersProfileStandardProfile PredictionParametersProfile = "standard_profile"
|
||||
PredictionParametersProfileFloatProfile PredictionParametersProfile = "float_profile"
|
||||
PredictionParametersProfileReverseProfile PredictionParametersProfile = "reverse_profile"
|
||||
PredictionParametersProfileCustomProfile PredictionParametersProfile = "custom_profile"
|
||||
)
|
||||
|
||||
// AllValues returns all ParametersProfile values.
|
||||
func (ParametersProfile) AllValues() []ParametersProfile {
|
||||
return []ParametersProfile{
|
||||
ParametersProfileStandardProfile,
|
||||
ParametersProfileFloatProfile,
|
||||
ParametersProfileReverseProfile,
|
||||
ParametersProfileCustomProfile,
|
||||
// AllValues returns all PredictionParametersProfile values.
|
||||
func (PredictionParametersProfile) AllValues() []PredictionParametersProfile {
|
||||
return []PredictionParametersProfile{
|
||||
PredictionParametersProfileStandardProfile,
|
||||
PredictionParametersProfileFloatProfile,
|
||||
PredictionParametersProfileReverseProfile,
|
||||
PredictionParametersProfileCustomProfile,
|
||||
}
|
||||
}
|
||||
|
||||
// MarshalText implements encoding.TextMarshaler.
|
||||
func (s ParametersProfile) MarshalText() ([]byte, error) {
|
||||
func (s PredictionParametersProfile) MarshalText() ([]byte, error) {
|
||||
switch s {
|
||||
case ParametersProfileStandardProfile:
|
||||
case PredictionParametersProfileStandardProfile:
|
||||
return []byte(s), nil
|
||||
case ParametersProfileFloatProfile:
|
||||
case PredictionParametersProfileFloatProfile:
|
||||
return []byte(s), nil
|
||||
case ParametersProfileReverseProfile:
|
||||
case PredictionParametersProfileReverseProfile:
|
||||
return []byte(s), nil
|
||||
case ParametersProfileCustomProfile:
|
||||
case PredictionParametersProfileCustomProfile:
|
||||
return []byte(s), nil
|
||||
default:
|
||||
return nil, errors.Errorf("invalid value: %q", s)
|
||||
|
|
@ -628,122 +628,122 @@ func (s ParametersProfile) MarshalText() ([]byte, error) {
|
|||
}
|
||||
|
||||
// UnmarshalText implements encoding.TextUnmarshaler.
|
||||
func (s *ParametersProfile) UnmarshalText(data []byte) error {
|
||||
switch ParametersProfile(data) {
|
||||
case ParametersProfileStandardProfile:
|
||||
*s = ParametersProfileStandardProfile
|
||||
func (s *PredictionParametersProfile) UnmarshalText(data []byte) error {
|
||||
switch PredictionParametersProfile(data) {
|
||||
case PredictionParametersProfileStandardProfile:
|
||||
*s = PredictionParametersProfileStandardProfile
|
||||
return nil
|
||||
case ParametersProfileFloatProfile:
|
||||
*s = ParametersProfileFloatProfile
|
||||
case PredictionParametersProfileFloatProfile:
|
||||
*s = PredictionParametersProfileFloatProfile
|
||||
return nil
|
||||
case ParametersProfileReverseProfile:
|
||||
*s = ParametersProfileReverseProfile
|
||||
case PredictionParametersProfileReverseProfile:
|
||||
*s = PredictionParametersProfileReverseProfile
|
||||
return nil
|
||||
case ParametersProfileCustomProfile:
|
||||
*s = ParametersProfileCustomProfile
|
||||
case PredictionParametersProfileCustomProfile:
|
||||
*s = PredictionParametersProfileCustomProfile
|
||||
return nil
|
||||
default:
|
||||
return errors.Errorf("invalid value: %q", data)
|
||||
}
|
||||
}
|
||||
|
||||
// Ref: #/components/schemas/Prediction/Result
|
||||
type Result struct {
|
||||
Metadata ResultMetadata `json:"metadata"`
|
||||
Prediction []ResultPredictionItem `json:"prediction"`
|
||||
// Ref: #/components/schemas/PredictionResult
|
||||
type PredictionResult struct {
|
||||
Metadata PredictionResultMetadata `json:"metadata"`
|
||||
Prediction []PredictionResultPredictionItem `json:"prediction"`
|
||||
}
|
||||
|
||||
// GetMetadata returns the value of Metadata.
|
||||
func (s *Result) GetMetadata() ResultMetadata {
|
||||
func (s *PredictionResult) GetMetadata() PredictionResultMetadata {
|
||||
return s.Metadata
|
||||
}
|
||||
|
||||
// GetPrediction returns the value of Prediction.
|
||||
func (s *Result) GetPrediction() []ResultPredictionItem {
|
||||
func (s *PredictionResult) GetPrediction() []PredictionResultPredictionItem {
|
||||
return s.Prediction
|
||||
}
|
||||
|
||||
// SetMetadata sets the value of Metadata.
|
||||
func (s *Result) SetMetadata(val ResultMetadata) {
|
||||
func (s *PredictionResult) SetMetadata(val PredictionResultMetadata) {
|
||||
s.Metadata = val
|
||||
}
|
||||
|
||||
// SetPrediction sets the value of Prediction.
|
||||
func (s *Result) SetPrediction(val []ResultPredictionItem) {
|
||||
func (s *PredictionResult) SetPrediction(val []PredictionResultPredictionItem) {
|
||||
s.Prediction = val
|
||||
}
|
||||
|
||||
type ResultMetadata struct {
|
||||
type PredictionResultMetadata struct {
|
||||
CompleteDatetime time.Time `json:"complete_datetime"`
|
||||
StartDatetime time.Time `json:"start_datetime"`
|
||||
}
|
||||
|
||||
// GetCompleteDatetime returns the value of CompleteDatetime.
|
||||
func (s *ResultMetadata) GetCompleteDatetime() time.Time {
|
||||
func (s *PredictionResultMetadata) GetCompleteDatetime() time.Time {
|
||||
return s.CompleteDatetime
|
||||
}
|
||||
|
||||
// GetStartDatetime returns the value of StartDatetime.
|
||||
func (s *ResultMetadata) GetStartDatetime() time.Time {
|
||||
func (s *PredictionResultMetadata) GetStartDatetime() time.Time {
|
||||
return s.StartDatetime
|
||||
}
|
||||
|
||||
// SetCompleteDatetime sets the value of CompleteDatetime.
|
||||
func (s *ResultMetadata) SetCompleteDatetime(val time.Time) {
|
||||
func (s *PredictionResultMetadata) SetCompleteDatetime(val time.Time) {
|
||||
s.CompleteDatetime = val
|
||||
}
|
||||
|
||||
// SetStartDatetime sets the value of StartDatetime.
|
||||
func (s *ResultMetadata) SetStartDatetime(val time.Time) {
|
||||
func (s *PredictionResultMetadata) SetStartDatetime(val time.Time) {
|
||||
s.StartDatetime = val
|
||||
}
|
||||
|
||||
type ResultPredictionItem struct {
|
||||
Stage ResultPredictionItemStage `json:"stage"`
|
||||
Trajectory []ResultPredictionItemTrajectoryItem `json:"trajectory"`
|
||||
type PredictionResultPredictionItem struct {
|
||||
Stage PredictionResultPredictionItemStage `json:"stage"`
|
||||
Trajectory []PredictionResultPredictionItemTrajectoryItem `json:"trajectory"`
|
||||
}
|
||||
|
||||
// GetStage returns the value of Stage.
|
||||
func (s *ResultPredictionItem) GetStage() ResultPredictionItemStage {
|
||||
func (s *PredictionResultPredictionItem) GetStage() PredictionResultPredictionItemStage {
|
||||
return s.Stage
|
||||
}
|
||||
|
||||
// GetTrajectory returns the value of Trajectory.
|
||||
func (s *ResultPredictionItem) GetTrajectory() []ResultPredictionItemTrajectoryItem {
|
||||
func (s *PredictionResultPredictionItem) GetTrajectory() []PredictionResultPredictionItemTrajectoryItem {
|
||||
return s.Trajectory
|
||||
}
|
||||
|
||||
// SetStage sets the value of Stage.
|
||||
func (s *ResultPredictionItem) SetStage(val ResultPredictionItemStage) {
|
||||
func (s *PredictionResultPredictionItem) SetStage(val PredictionResultPredictionItemStage) {
|
||||
s.Stage = val
|
||||
}
|
||||
|
||||
// SetTrajectory sets the value of Trajectory.
|
||||
func (s *ResultPredictionItem) SetTrajectory(val []ResultPredictionItemTrajectoryItem) {
|
||||
func (s *PredictionResultPredictionItem) SetTrajectory(val []PredictionResultPredictionItemTrajectoryItem) {
|
||||
s.Trajectory = val
|
||||
}
|
||||
|
||||
type ResultPredictionItemStage string
|
||||
type PredictionResultPredictionItemStage string
|
||||
|
||||
const (
|
||||
ResultPredictionItemStageAscent ResultPredictionItemStage = "ascent"
|
||||
ResultPredictionItemStageDescent ResultPredictionItemStage = "descent"
|
||||
PredictionResultPredictionItemStageAscent PredictionResultPredictionItemStage = "ascent"
|
||||
PredictionResultPredictionItemStageDescent PredictionResultPredictionItemStage = "descent"
|
||||
)
|
||||
|
||||
// AllValues returns all ResultPredictionItemStage values.
|
||||
func (ResultPredictionItemStage) AllValues() []ResultPredictionItemStage {
|
||||
return []ResultPredictionItemStage{
|
||||
ResultPredictionItemStageAscent,
|
||||
ResultPredictionItemStageDescent,
|
||||
// AllValues returns all PredictionResultPredictionItemStage values.
|
||||
func (PredictionResultPredictionItemStage) AllValues() []PredictionResultPredictionItemStage {
|
||||
return []PredictionResultPredictionItemStage{
|
||||
PredictionResultPredictionItemStageAscent,
|
||||
PredictionResultPredictionItemStageDescent,
|
||||
}
|
||||
}
|
||||
|
||||
// MarshalText implements encoding.TextMarshaler.
|
||||
func (s ResultPredictionItemStage) MarshalText() ([]byte, error) {
|
||||
func (s PredictionResultPredictionItemStage) MarshalText() ([]byte, error) {
|
||||
switch s {
|
||||
case ResultPredictionItemStageAscent:
|
||||
case PredictionResultPredictionItemStageAscent:
|
||||
return []byte(s), nil
|
||||
case ResultPredictionItemStageDescent:
|
||||
case PredictionResultPredictionItemStageDescent:
|
||||
return []byte(s), nil
|
||||
default:
|
||||
return nil, errors.Errorf("invalid value: %q", s)
|
||||
|
|
@ -751,17 +751,17 @@ func (s ResultPredictionItemStage) MarshalText() ([]byte, error) {
|
|||
}
|
||||
|
||||
// UnmarshalText implements encoding.TextUnmarshaler.
|
||||
func (s *ResultPredictionItemStage) UnmarshalText(data []byte) error {
|
||||
switch ResultPredictionItemStage(data) {
|
||||
case ResultPredictionItemStageAscent:
|
||||
*s = ResultPredictionItemStageAscent
|
||||
func (s *PredictionResultPredictionItemStage) UnmarshalText(data []byte) error {
|
||||
switch PredictionResultPredictionItemStage(data) {
|
||||
case PredictionResultPredictionItemStageAscent:
|
||||
*s = PredictionResultPredictionItemStageAscent
|
||||
return nil
|
||||
case ResultPredictionItemStageDescent:
|
||||
*s = ResultPredictionItemStageDescent
|
||||
case PredictionResultPredictionItemStageDescent:
|
||||
*s = PredictionResultPredictionItemStageDescent
|
||||
return nil
|
||||
default:
|
||||
return errors.Errorf("invalid value: %q", data)
|
||||
}
|
||||
}
|
||||
|
||||
type ResultPredictionItemTrajectoryItem struct{}
|
||||
type PredictionResultPredictionItemTrajectoryItem struct{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue