// Code generated by ogen, DO NOT EDIT. package gsn import ( "fmt" "time" "github.com/go-faster/errors" ) func (s *ErrorStatusCode) Error() string { return fmt.Sprintf("code %d: %+v", s.StatusCode, s.Response) } // Ref: #/components/schemas/Error type Error struct { Message string `json:"message"` Details OptString `json:"details"` } // GetMessage returns the value of Message. func (s *Error) GetMessage() string { return s.Message } // GetDetails returns the value of Details. func (s *Error) GetDetails() OptString { return s.Details } // SetMessage sets the value of Message. func (s *Error) SetMessage(val string) { s.Message = val } // SetDetails sets the value of Details. func (s *Error) SetDetails(val OptString) { s.Details = val } // ErrorStatusCode wraps Error with StatusCode. type ErrorStatusCode struct { StatusCode int Response Error } // GetStatusCode returns the value of StatusCode. func (s *ErrorStatusCode) GetStatusCode() int { return s.StatusCode } // GetResponse returns the value of Response. func (s *ErrorStatusCode) GetResponse() Error { return s.Response } // SetStatusCode sets the value of StatusCode. func (s *ErrorStatusCode) SetStatusCode(val int) { s.StatusCode = val } // SetResponse sets the value of Response. func (s *ErrorStatusCode) SetResponse(val Error) { s.Response = val } // NewOptBool returns new OptBool with value set to v. func NewOptBool(v bool) OptBool { return OptBool{ Value: v, Set: true, } } // OptBool is optional bool. type OptBool struct { Value bool Set bool } // IsSet returns true if OptBool was set. func (o OptBool) IsSet() bool { return o.Set } // Reset unsets value. func (o *OptBool) Reset() { var v bool o.Value = v o.Set = false } // SetTo sets value to v. func (o *OptBool) SetTo(v bool) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. func (o OptBool) Get() (v bool, ok bool) { if !o.Set { return v, false } return o.Value, true } // Or returns value if set, or given parameter if does not. func (o OptBool) Or(d bool) bool { if v, ok := o.Get(); ok { return v } return d } // NewOptDateTime returns new OptDateTime with value set to v. func NewOptDateTime(v time.Time) OptDateTime { return OptDateTime{ Value: v, Set: true, } } // OptDateTime is optional time.Time. type OptDateTime struct { Value time.Time Set bool } // IsSet returns true if OptDateTime was set. func (o OptDateTime) IsSet() bool { return o.Set } // Reset unsets value. func (o *OptDateTime) Reset() { var v time.Time o.Value = v o.Set = false } // SetTo sets value to v. func (o *OptDateTime) SetTo(v time.Time) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. func (o OptDateTime) Get() (v time.Time, ok bool) { if !o.Set { return v, false } return o.Value, true } // Or returns value if set, or given parameter if does not. func (o OptDateTime) Or(d time.Time) time.Time { if v, ok := o.Get(); ok { return v } return d } // NewOptFloat64 returns new OptFloat64 with value set to v. func NewOptFloat64(v float64) OptFloat64 { return OptFloat64{ Value: v, Set: true, } } // OptFloat64 is optional float64. type OptFloat64 struct { Value float64 Set bool } // IsSet returns true if OptFloat64 was set. func (o OptFloat64) IsSet() bool { return o.Set } // Reset unsets value. func (o *OptFloat64) Reset() { var v float64 o.Value = v o.Set = false } // SetTo sets value to v. func (o *OptFloat64) SetTo(v float64) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. func (o OptFloat64) Get() (v float64, ok bool) { if !o.Set { return v, false } return o.Value, true } // Or returns value if set, or given parameter if does not. func (o OptFloat64) Or(d float64) float64 { if v, ok := o.Get(); ok { return v } return d } // NewOptPerformPredictionFormat returns new OptPerformPredictionFormat with value set to v. func NewOptPerformPredictionFormat(v PerformPredictionFormat) OptPerformPredictionFormat { return OptPerformPredictionFormat{ Value: v, Set: true, } } // OptPerformPredictionFormat is optional PerformPredictionFormat. type OptPerformPredictionFormat struct { Value PerformPredictionFormat Set bool } // IsSet returns true if OptPerformPredictionFormat was set. func (o OptPerformPredictionFormat) IsSet() bool { return o.Set } // Reset unsets value. func (o *OptPerformPredictionFormat) Reset() { var v PerformPredictionFormat o.Value = v o.Set = false } // SetTo sets value to v. func (o *OptPerformPredictionFormat) SetTo(v PerformPredictionFormat) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. func (o OptPerformPredictionFormat) Get() (v PerformPredictionFormat, ok bool) { if !o.Set { return v, false } return o.Value, true } // Or returns value if set, or given parameter if does not. func (o OptPerformPredictionFormat) Or(d PerformPredictionFormat) PerformPredictionFormat { if v, ok := o.Get(); ok { return v } return d } // NewOptPerformPredictionProfile returns new OptPerformPredictionProfile with value set to v. func NewOptPerformPredictionProfile(v PerformPredictionProfile) OptPerformPredictionProfile { return OptPerformPredictionProfile{ Value: v, Set: true, } } // OptPerformPredictionProfile is optional PerformPredictionProfile. type OptPerformPredictionProfile struct { Value PerformPredictionProfile Set bool } // IsSet returns true if OptPerformPredictionProfile was set. func (o OptPerformPredictionProfile) IsSet() bool { return o.Set } // Reset unsets value. func (o *OptPerformPredictionProfile) Reset() { var v PerformPredictionProfile o.Value = v o.Set = false } // SetTo sets value to v. func (o *OptPerformPredictionProfile) SetTo(v PerformPredictionProfile) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. func (o OptPerformPredictionProfile) Get() (v PerformPredictionProfile, ok bool) { if !o.Set { return v, false } return o.Value, true } // Or returns value if set, or given parameter if does not. func (o OptPerformPredictionProfile) Or(d PerformPredictionProfile) PerformPredictionProfile { if v, ok := o.Get(); ok { return v } return d } // NewOptString returns new OptString with value set to v. func NewOptString(v string) OptString { return OptString{ Value: v, Set: true, } } // OptString is optional string. type OptString struct { Value string Set bool } // IsSet returns true if OptString was set. func (o OptString) IsSet() bool { return o.Set } // Reset unsets value. func (o *OptString) Reset() { var v string o.Value = v o.Set = false } // SetTo sets value to v. func (o *OptString) SetTo(v string) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. func (o OptString) Get() (v string, ok bool) { if !o.Set { return v, false } return o.Value, true } // Or returns value if set, or given parameter if does not. func (o OptString) Or(d string) string { if v, ok := o.Get(); ok { return v } return d } type PerformPredictionFormat string const ( PerformPredictionFormatJSON PerformPredictionFormat = "json" ) // AllValues returns all PerformPredictionFormat values. func (PerformPredictionFormat) AllValues() []PerformPredictionFormat { return []PerformPredictionFormat{ PerformPredictionFormatJSON, } } // MarshalText implements encoding.TextMarshaler. func (s PerformPredictionFormat) MarshalText() ([]byte, error) { switch s { case PerformPredictionFormatJSON: return []byte(s), nil default: return nil, errors.Errorf("invalid value: %q", s) } } // UnmarshalText implements encoding.TextUnmarshaler. func (s *PerformPredictionFormat) UnmarshalText(data []byte) error { switch PerformPredictionFormat(data) { case PerformPredictionFormatJSON: *s = PerformPredictionFormatJSON return nil default: return errors.Errorf("invalid value: %q", data) } } type PerformPredictionProfile string const ( PerformPredictionProfileStandardProfile PerformPredictionProfile = "standard_profile" PerformPredictionProfileFloatProfile PerformPredictionProfile = "float_profile" PerformPredictionProfileReverseProfile PerformPredictionProfile = "reverse_profile" PerformPredictionProfileCustomProfile PerformPredictionProfile = "custom_profile" ) // AllValues returns all PerformPredictionProfile values. func (PerformPredictionProfile) AllValues() []PerformPredictionProfile { return []PerformPredictionProfile{ PerformPredictionProfileStandardProfile, PerformPredictionProfileFloatProfile, PerformPredictionProfileReverseProfile, PerformPredictionProfileCustomProfile, } } // MarshalText implements encoding.TextMarshaler. func (s PerformPredictionProfile) MarshalText() ([]byte, error) { switch s { case PerformPredictionProfileStandardProfile: return []byte(s), nil case PerformPredictionProfileFloatProfile: return []byte(s), nil case PerformPredictionProfileReverseProfile: return []byte(s), nil case PerformPredictionProfileCustomProfile: return []byte(s), nil default: return nil, errors.Errorf("invalid value: %q", s) } } // UnmarshalText implements encoding.TextUnmarshaler. func (s *PerformPredictionProfile) UnmarshalText(data []byte) error { switch PerformPredictionProfile(data) { case PerformPredictionProfileStandardProfile: *s = PerformPredictionProfileStandardProfile return nil case PerformPredictionProfileFloatProfile: *s = PerformPredictionProfileFloatProfile return nil case PerformPredictionProfileReverseProfile: *s = PerformPredictionProfileReverseProfile return nil case PerformPredictionProfileCustomProfile: *s = PerformPredictionProfileCustomProfile return nil default: return errors.Errorf("invalid value: %q", data) } } type PerformPredictionSimulateStagesItem string const ( PerformPredictionSimulateStagesItemAscent PerformPredictionSimulateStagesItem = "ascent" PerformPredictionSimulateStagesItemDescent PerformPredictionSimulateStagesItem = "descent" PerformPredictionSimulateStagesItemFloat PerformPredictionSimulateStagesItem = "float" ) // AllValues returns all PerformPredictionSimulateStagesItem values. func (PerformPredictionSimulateStagesItem) AllValues() []PerformPredictionSimulateStagesItem { return []PerformPredictionSimulateStagesItem{ PerformPredictionSimulateStagesItemAscent, PerformPredictionSimulateStagesItemDescent, PerformPredictionSimulateStagesItemFloat, } } // MarshalText implements encoding.TextMarshaler. func (s PerformPredictionSimulateStagesItem) MarshalText() ([]byte, error) { switch s { case PerformPredictionSimulateStagesItemAscent: return []byte(s), nil case PerformPredictionSimulateStagesItemDescent: return []byte(s), nil case PerformPredictionSimulateStagesItemFloat: return []byte(s), nil default: return nil, errors.Errorf("invalid value: %q", s) } } // UnmarshalText implements encoding.TextUnmarshaler. func (s *PerformPredictionSimulateStagesItem) UnmarshalText(data []byte) error { switch PerformPredictionSimulateStagesItem(data) { case PerformPredictionSimulateStagesItemAscent: *s = PerformPredictionSimulateStagesItemAscent return nil case PerformPredictionSimulateStagesItemDescent: *s = PerformPredictionSimulateStagesItemDescent return nil case PerformPredictionSimulateStagesItemFloat: *s = PerformPredictionSimulateStagesItemFloat return nil default: return errors.Errorf("invalid value: %q", data) } } // Ref: #/components/schemas/PredictionResult type PredictionResult struct { Metadata PredictionResultMetadata `json:"metadata"` Prediction []PredictionResultPredictionItem `json:"prediction"` } // GetMetadata returns the value of Metadata. func (s *PredictionResult) GetMetadata() PredictionResultMetadata { return s.Metadata } // GetPrediction returns the value of Prediction. func (s *PredictionResult) GetPrediction() []PredictionResultPredictionItem { return s.Prediction } // SetMetadata sets the value of Metadata. func (s *PredictionResult) SetMetadata(val PredictionResultMetadata) { s.Metadata = val } // SetPrediction sets the value of Prediction. func (s *PredictionResult) SetPrediction(val []PredictionResultPredictionItem) { s.Prediction = val } type PredictionResultMetadata struct { CompleteDatetime time.Time `json:"complete_datetime"` StartDatetime time.Time `json:"start_datetime"` } // GetCompleteDatetime returns the value of CompleteDatetime. func (s *PredictionResultMetadata) GetCompleteDatetime() time.Time { return s.CompleteDatetime } // GetStartDatetime returns the value of StartDatetime. func (s *PredictionResultMetadata) GetStartDatetime() time.Time { return s.StartDatetime } // SetCompleteDatetime sets the value of CompleteDatetime. func (s *PredictionResultMetadata) SetCompleteDatetime(val time.Time) { s.CompleteDatetime = val } // SetStartDatetime sets the value of StartDatetime. func (s *PredictionResultMetadata) SetStartDatetime(val time.Time) { s.StartDatetime = val } type PredictionResultPredictionItem struct { Stage PredictionResultPredictionItemStage `json:"stage"` Trajectory []PredictionResultPredictionItemTrajectoryItem `json:"trajectory"` } // GetStage returns the value of Stage. func (s *PredictionResultPredictionItem) GetStage() PredictionResultPredictionItemStage { return s.Stage } // GetTrajectory returns the value of Trajectory. func (s *PredictionResultPredictionItem) GetTrajectory() []PredictionResultPredictionItemTrajectoryItem { return s.Trajectory } // SetStage sets the value of Stage. func (s *PredictionResultPredictionItem) SetStage(val PredictionResultPredictionItemStage) { s.Stage = val } // SetTrajectory sets the value of Trajectory. func (s *PredictionResultPredictionItem) SetTrajectory(val []PredictionResultPredictionItemTrajectoryItem) { s.Trajectory = val } type PredictionResultPredictionItemStage string const ( PredictionResultPredictionItemStageAscent PredictionResultPredictionItemStage = "ascent" PredictionResultPredictionItemStageDescent PredictionResultPredictionItemStage = "descent" PredictionResultPredictionItemStageFloat PredictionResultPredictionItemStage = "float" ) // AllValues returns all PredictionResultPredictionItemStage values. func (PredictionResultPredictionItemStage) AllValues() []PredictionResultPredictionItemStage { return []PredictionResultPredictionItemStage{ PredictionResultPredictionItemStageAscent, PredictionResultPredictionItemStageDescent, PredictionResultPredictionItemStageFloat, } } // MarshalText implements encoding.TextMarshaler. func (s PredictionResultPredictionItemStage) MarshalText() ([]byte, error) { switch s { case PredictionResultPredictionItemStageAscent: return []byte(s), nil case PredictionResultPredictionItemStageDescent: return []byte(s), nil case PredictionResultPredictionItemStageFloat: return []byte(s), nil default: return nil, errors.Errorf("invalid value: %q", s) } } // UnmarshalText implements encoding.TextUnmarshaler. func (s *PredictionResultPredictionItemStage) UnmarshalText(data []byte) error { switch PredictionResultPredictionItemStage(data) { case PredictionResultPredictionItemStageAscent: *s = PredictionResultPredictionItemStageAscent return nil case PredictionResultPredictionItemStageDescent: *s = PredictionResultPredictionItemStageDescent return nil case PredictionResultPredictionItemStageFloat: *s = PredictionResultPredictionItemStageFloat return nil default: return errors.Errorf("invalid value: %q", data) } } type PredictionResultPredictionItemTrajectoryItem struct { Datetime time.Time `json:"datetime"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Altitude float64 `json:"altitude"` } // GetDatetime returns the value of Datetime. func (s *PredictionResultPredictionItemTrajectoryItem) GetDatetime() time.Time { return s.Datetime } // GetLatitude returns the value of Latitude. func (s *PredictionResultPredictionItemTrajectoryItem) GetLatitude() float64 { return s.Latitude } // GetLongitude returns the value of Longitude. func (s *PredictionResultPredictionItemTrajectoryItem) GetLongitude() float64 { return s.Longitude } // GetAltitude returns the value of Altitude. func (s *PredictionResultPredictionItemTrajectoryItem) GetAltitude() float64 { return s.Altitude } // SetDatetime sets the value of Datetime. func (s *PredictionResultPredictionItemTrajectoryItem) SetDatetime(val time.Time) { s.Datetime = val } // SetLatitude sets the value of Latitude. func (s *PredictionResultPredictionItemTrajectoryItem) SetLatitude(val float64) { s.Latitude = val } // SetLongitude sets the value of Longitude. func (s *PredictionResultPredictionItemTrajectoryItem) SetLongitude(val float64) { s.Longitude = val } // SetAltitude sets the value of Altitude. func (s *PredictionResultPredictionItemTrajectoryItem) SetAltitude(val float64) { s.Altitude = val } // Ref: #/components/schemas/ReadinessResponse type ReadinessResponse struct { Status ReadinessResponseStatus `json:"status"` LastUpdate OptDateTime `json:"last_update"` IsFresh OptBool `json:"is_fresh"` ErrorMessage OptString `json:"error_message"` } // GetStatus returns the value of Status. func (s *ReadinessResponse) GetStatus() ReadinessResponseStatus { return s.Status } // GetLastUpdate returns the value of LastUpdate. func (s *ReadinessResponse) GetLastUpdate() OptDateTime { return s.LastUpdate } // GetIsFresh returns the value of IsFresh. func (s *ReadinessResponse) GetIsFresh() OptBool { return s.IsFresh } // GetErrorMessage returns the value of ErrorMessage. func (s *ReadinessResponse) GetErrorMessage() OptString { return s.ErrorMessage } // SetStatus sets the value of Status. func (s *ReadinessResponse) SetStatus(val ReadinessResponseStatus) { s.Status = val } // SetLastUpdate sets the value of LastUpdate. func (s *ReadinessResponse) SetLastUpdate(val OptDateTime) { s.LastUpdate = val } // SetIsFresh sets the value of IsFresh. func (s *ReadinessResponse) SetIsFresh(val OptBool) { s.IsFresh = val } // SetErrorMessage sets the value of ErrorMessage. func (s *ReadinessResponse) SetErrorMessage(val OptString) { s.ErrorMessage = val } type ReadinessResponseStatus string const ( ReadinessResponseStatusOk ReadinessResponseStatus = "ok" ReadinessResponseStatusNotReady ReadinessResponseStatus = "not_ready" ReadinessResponseStatusError ReadinessResponseStatus = "error" ) // AllValues returns all ReadinessResponseStatus values. func (ReadinessResponseStatus) AllValues() []ReadinessResponseStatus { return []ReadinessResponseStatus{ ReadinessResponseStatusOk, ReadinessResponseStatusNotReady, ReadinessResponseStatusError, } } // MarshalText implements encoding.TextMarshaler. func (s ReadinessResponseStatus) MarshalText() ([]byte, error) { switch s { case ReadinessResponseStatusOk: return []byte(s), nil case ReadinessResponseStatusNotReady: return []byte(s), nil case ReadinessResponseStatusError: return []byte(s), nil default: return nil, errors.Errorf("invalid value: %q", s) } } // UnmarshalText implements encoding.TextUnmarshaler. func (s *ReadinessResponseStatus) UnmarshalText(data []byte) error { switch ReadinessResponseStatus(data) { case ReadinessResponseStatusOk: *s = ReadinessResponseStatusOk return nil case ReadinessResponseStatusNotReady: *s = ReadinessResponseStatusNotReady return nil case ReadinessResponseStatusError: *s = ReadinessResponseStatusError return nil default: return errors.Errorf("invalid value: %q", data) } }