predictor/pkg/rest/oas_schemas_gen.go
2026-03-28 03:07:13 +09:00

789 lines
21 KiB
Go

// Code generated by ogen, DO NOT EDIT.
package rest
import (
"fmt"
"time"
"github.com/go-faster/errors"
"github.com/go-faster/jx"
)
func (s *ErrorStatusCode) Error() string {
return fmt.Sprintf("code %d: %+v", s.StatusCode, s.Response)
}
// Ref: #/components/schemas/Error
type Error struct {
Error ErrorError `json:"error"`
}
// GetError returns the value of Error.
func (s *Error) GetError() ErrorError {
return s.Error
}
// SetError sets the value of Error.
func (s *Error) SetError(val ErrorError) {
s.Error = val
}
type ErrorError struct {
Type string `json:"type"`
Description string `json:"description"`
}
// GetType returns the value of Type.
func (s *ErrorError) GetType() string {
return s.Type
}
// GetDescription returns the value of Description.
func (s *ErrorError) GetDescription() string {
return s.Description
}
// SetType sets the value of Type.
func (s *ErrorError) SetType(val string) {
s.Type = val
}
// SetDescription sets the value of Description.
func (s *ErrorError) SetDescription(val string) {
s.Description = 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
}
// 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
}
// 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
}
// NewOptPredictionResponseRequest returns new OptPredictionResponseRequest with value set to v.
func NewOptPredictionResponseRequest(v PredictionResponseRequest) OptPredictionResponseRequest {
return OptPredictionResponseRequest{
Value: v,
Set: true,
}
}
// OptPredictionResponseRequest is optional PredictionResponseRequest.
type OptPredictionResponseRequest struct {
Value PredictionResponseRequest
Set bool
}
// IsSet returns true if OptPredictionResponseRequest was set.
func (o OptPredictionResponseRequest) IsSet() bool { return o.Set }
// Reset unsets value.
func (o *OptPredictionResponseRequest) Reset() {
var v PredictionResponseRequest
o.Value = v
o.Set = false
}
// SetTo sets value to v.
func (o *OptPredictionResponseRequest) SetTo(v PredictionResponseRequest) {
o.Set = true
o.Value = v
}
// Get returns value and boolean that denotes whether value was set.
func (o OptPredictionResponseRequest) Get() (v PredictionResponseRequest, 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 OptPredictionResponseRequest) Or(d PredictionResponseRequest) PredictionResponseRequest {
if v, ok := o.Get(); ok {
return v
}
return d
}
// NewOptPredictionResponseWarnings returns new OptPredictionResponseWarnings with value set to v.
func NewOptPredictionResponseWarnings(v PredictionResponseWarnings) OptPredictionResponseWarnings {
return OptPredictionResponseWarnings{
Value: v,
Set: true,
}
}
// OptPredictionResponseWarnings is optional PredictionResponseWarnings.
type OptPredictionResponseWarnings struct {
Value PredictionResponseWarnings
Set bool
}
// IsSet returns true if OptPredictionResponseWarnings was set.
func (o OptPredictionResponseWarnings) IsSet() bool { return o.Set }
// Reset unsets value.
func (o *OptPredictionResponseWarnings) Reset() {
var v PredictionResponseWarnings
o.Value = v
o.Set = false
}
// SetTo sets value to v.
func (o *OptPredictionResponseWarnings) SetTo(v PredictionResponseWarnings) {
o.Set = true
o.Value = v
}
// Get returns value and boolean that denotes whether value was set.
func (o OptPredictionResponseWarnings) Get() (v PredictionResponseWarnings, 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 OptPredictionResponseWarnings) Or(d PredictionResponseWarnings) PredictionResponseWarnings {
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 PerformPredictionProfile string
const (
PerformPredictionProfileStandardProfile PerformPredictionProfile = "standard_profile"
PerformPredictionProfileFloatProfile PerformPredictionProfile = "float_profile"
)
// AllValues returns all PerformPredictionProfile values.
func (PerformPredictionProfile) AllValues() []PerformPredictionProfile {
return []PerformPredictionProfile{
PerformPredictionProfileStandardProfile,
PerformPredictionProfileFloatProfile,
}
}
// MarshalText implements encoding.TextMarshaler.
func (s PerformPredictionProfile) MarshalText() ([]byte, error) {
switch s {
case PerformPredictionProfileStandardProfile:
return []byte(s), nil
case PerformPredictionProfileFloatProfile:
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
default:
return errors.Errorf("invalid value: %q", data)
}
}
// Ref: #/components/schemas/PredictionResponse
type PredictionResponse struct {
Request OptPredictionResponseRequest `json:"request"`
Prediction []PredictionResponsePredictionItem `json:"prediction"`
Metadata PredictionResponseMetadata `json:"metadata"`
Warnings OptPredictionResponseWarnings `json:"warnings"`
}
// GetRequest returns the value of Request.
func (s *PredictionResponse) GetRequest() OptPredictionResponseRequest {
return s.Request
}
// GetPrediction returns the value of Prediction.
func (s *PredictionResponse) GetPrediction() []PredictionResponsePredictionItem {
return s.Prediction
}
// GetMetadata returns the value of Metadata.
func (s *PredictionResponse) GetMetadata() PredictionResponseMetadata {
return s.Metadata
}
// GetWarnings returns the value of Warnings.
func (s *PredictionResponse) GetWarnings() OptPredictionResponseWarnings {
return s.Warnings
}
// SetRequest sets the value of Request.
func (s *PredictionResponse) SetRequest(val OptPredictionResponseRequest) {
s.Request = val
}
// SetPrediction sets the value of Prediction.
func (s *PredictionResponse) SetPrediction(val []PredictionResponsePredictionItem) {
s.Prediction = val
}
// SetMetadata sets the value of Metadata.
func (s *PredictionResponse) SetMetadata(val PredictionResponseMetadata) {
s.Metadata = val
}
// SetWarnings sets the value of Warnings.
func (s *PredictionResponse) SetWarnings(val OptPredictionResponseWarnings) {
s.Warnings = val
}
type PredictionResponseMetadata struct {
StartDatetime time.Time `json:"start_datetime"`
CompleteDatetime time.Time `json:"complete_datetime"`
}
// GetStartDatetime returns the value of StartDatetime.
func (s *PredictionResponseMetadata) GetStartDatetime() time.Time {
return s.StartDatetime
}
// GetCompleteDatetime returns the value of CompleteDatetime.
func (s *PredictionResponseMetadata) GetCompleteDatetime() time.Time {
return s.CompleteDatetime
}
// SetStartDatetime sets the value of StartDatetime.
func (s *PredictionResponseMetadata) SetStartDatetime(val time.Time) {
s.StartDatetime = val
}
// SetCompleteDatetime sets the value of CompleteDatetime.
func (s *PredictionResponseMetadata) SetCompleteDatetime(val time.Time) {
s.CompleteDatetime = val
}
type PredictionResponsePredictionItem struct {
Stage PredictionResponsePredictionItemStage `json:"stage"`
Trajectory []PredictionResponsePredictionItemTrajectoryItem `json:"trajectory"`
}
// GetStage returns the value of Stage.
func (s *PredictionResponsePredictionItem) GetStage() PredictionResponsePredictionItemStage {
return s.Stage
}
// GetTrajectory returns the value of Trajectory.
func (s *PredictionResponsePredictionItem) GetTrajectory() []PredictionResponsePredictionItemTrajectoryItem {
return s.Trajectory
}
// SetStage sets the value of Stage.
func (s *PredictionResponsePredictionItem) SetStage(val PredictionResponsePredictionItemStage) {
s.Stage = val
}
// SetTrajectory sets the value of Trajectory.
func (s *PredictionResponsePredictionItem) SetTrajectory(val []PredictionResponsePredictionItemTrajectoryItem) {
s.Trajectory = val
}
type PredictionResponsePredictionItemStage string
const (
PredictionResponsePredictionItemStageAscent PredictionResponsePredictionItemStage = "ascent"
PredictionResponsePredictionItemStageDescent PredictionResponsePredictionItemStage = "descent"
PredictionResponsePredictionItemStageFloat PredictionResponsePredictionItemStage = "float"
)
// AllValues returns all PredictionResponsePredictionItemStage values.
func (PredictionResponsePredictionItemStage) AllValues() []PredictionResponsePredictionItemStage {
return []PredictionResponsePredictionItemStage{
PredictionResponsePredictionItemStageAscent,
PredictionResponsePredictionItemStageDescent,
PredictionResponsePredictionItemStageFloat,
}
}
// MarshalText implements encoding.TextMarshaler.
func (s PredictionResponsePredictionItemStage) MarshalText() ([]byte, error) {
switch s {
case PredictionResponsePredictionItemStageAscent:
return []byte(s), nil
case PredictionResponsePredictionItemStageDescent:
return []byte(s), nil
case PredictionResponsePredictionItemStageFloat:
return []byte(s), nil
default:
return nil, errors.Errorf("invalid value: %q", s)
}
}
// UnmarshalText implements encoding.TextUnmarshaler.
func (s *PredictionResponsePredictionItemStage) UnmarshalText(data []byte) error {
switch PredictionResponsePredictionItemStage(data) {
case PredictionResponsePredictionItemStageAscent:
*s = PredictionResponsePredictionItemStageAscent
return nil
case PredictionResponsePredictionItemStageDescent:
*s = PredictionResponsePredictionItemStageDescent
return nil
case PredictionResponsePredictionItemStageFloat:
*s = PredictionResponsePredictionItemStageFloat
return nil
default:
return errors.Errorf("invalid value: %q", data)
}
}
type PredictionResponsePredictionItemTrajectoryItem 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 *PredictionResponsePredictionItemTrajectoryItem) GetDatetime() time.Time {
return s.Datetime
}
// GetLatitude returns the value of Latitude.
func (s *PredictionResponsePredictionItemTrajectoryItem) GetLatitude() float64 {
return s.Latitude
}
// GetLongitude returns the value of Longitude.
func (s *PredictionResponsePredictionItemTrajectoryItem) GetLongitude() float64 {
return s.Longitude
}
// GetAltitude returns the value of Altitude.
func (s *PredictionResponsePredictionItemTrajectoryItem) GetAltitude() float64 {
return s.Altitude
}
// SetDatetime sets the value of Datetime.
func (s *PredictionResponsePredictionItemTrajectoryItem) SetDatetime(val time.Time) {
s.Datetime = val
}
// SetLatitude sets the value of Latitude.
func (s *PredictionResponsePredictionItemTrajectoryItem) SetLatitude(val float64) {
s.Latitude = val
}
// SetLongitude sets the value of Longitude.
func (s *PredictionResponsePredictionItemTrajectoryItem) SetLongitude(val float64) {
s.Longitude = val
}
// SetAltitude sets the value of Altitude.
func (s *PredictionResponsePredictionItemTrajectoryItem) SetAltitude(val float64) {
s.Altitude = val
}
type PredictionResponseRequest struct {
Dataset OptString `json:"dataset"`
LaunchLatitude OptFloat64 `json:"launch_latitude"`
LaunchLongitude OptFloat64 `json:"launch_longitude"`
LaunchDatetime OptString `json:"launch_datetime"`
LaunchAltitude OptFloat64 `json:"launch_altitude"`
Profile OptString `json:"profile"`
AscentRate OptFloat64 `json:"ascent_rate"`
BurstAltitude OptFloat64 `json:"burst_altitude"`
DescentRate OptFloat64 `json:"descent_rate"`
}
// GetDataset returns the value of Dataset.
func (s *PredictionResponseRequest) GetDataset() OptString {
return s.Dataset
}
// GetLaunchLatitude returns the value of LaunchLatitude.
func (s *PredictionResponseRequest) GetLaunchLatitude() OptFloat64 {
return s.LaunchLatitude
}
// GetLaunchLongitude returns the value of LaunchLongitude.
func (s *PredictionResponseRequest) GetLaunchLongitude() OptFloat64 {
return s.LaunchLongitude
}
// GetLaunchDatetime returns the value of LaunchDatetime.
func (s *PredictionResponseRequest) GetLaunchDatetime() OptString {
return s.LaunchDatetime
}
// GetLaunchAltitude returns the value of LaunchAltitude.
func (s *PredictionResponseRequest) GetLaunchAltitude() OptFloat64 {
return s.LaunchAltitude
}
// GetProfile returns the value of Profile.
func (s *PredictionResponseRequest) GetProfile() OptString {
return s.Profile
}
// GetAscentRate returns the value of AscentRate.
func (s *PredictionResponseRequest) GetAscentRate() OptFloat64 {
return s.AscentRate
}
// GetBurstAltitude returns the value of BurstAltitude.
func (s *PredictionResponseRequest) GetBurstAltitude() OptFloat64 {
return s.BurstAltitude
}
// GetDescentRate returns the value of DescentRate.
func (s *PredictionResponseRequest) GetDescentRate() OptFloat64 {
return s.DescentRate
}
// SetDataset sets the value of Dataset.
func (s *PredictionResponseRequest) SetDataset(val OptString) {
s.Dataset = val
}
// SetLaunchLatitude sets the value of LaunchLatitude.
func (s *PredictionResponseRequest) SetLaunchLatitude(val OptFloat64) {
s.LaunchLatitude = val
}
// SetLaunchLongitude sets the value of LaunchLongitude.
func (s *PredictionResponseRequest) SetLaunchLongitude(val OptFloat64) {
s.LaunchLongitude = val
}
// SetLaunchDatetime sets the value of LaunchDatetime.
func (s *PredictionResponseRequest) SetLaunchDatetime(val OptString) {
s.LaunchDatetime = val
}
// SetLaunchAltitude sets the value of LaunchAltitude.
func (s *PredictionResponseRequest) SetLaunchAltitude(val OptFloat64) {
s.LaunchAltitude = val
}
// SetProfile sets the value of Profile.
func (s *PredictionResponseRequest) SetProfile(val OptString) {
s.Profile = val
}
// SetAscentRate sets the value of AscentRate.
func (s *PredictionResponseRequest) SetAscentRate(val OptFloat64) {
s.AscentRate = val
}
// SetBurstAltitude sets the value of BurstAltitude.
func (s *PredictionResponseRequest) SetBurstAltitude(val OptFloat64) {
s.BurstAltitude = val
}
// SetDescentRate sets the value of DescentRate.
func (s *PredictionResponseRequest) SetDescentRate(val OptFloat64) {
s.DescentRate = val
}
type PredictionResponseWarnings map[string]jx.Raw
func (s *PredictionResponseWarnings) init() PredictionResponseWarnings {
m := *s
if m == nil {
m = map[string]jx.Raw{}
*s = m
}
return m
}
// Ref: #/components/schemas/ReadinessResponse
type ReadinessResponse struct {
Status ReadinessResponseStatus `json:"status"`
DatasetTime OptDateTime `json:"dataset_time"`
ErrorMessage OptString `json:"error_message"`
}
// GetStatus returns the value of Status.
func (s *ReadinessResponse) GetStatus() ReadinessResponseStatus {
return s.Status
}
// GetDatasetTime returns the value of DatasetTime.
func (s *ReadinessResponse) GetDatasetTime() OptDateTime {
return s.DatasetTime
}
// 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
}
// SetDatasetTime sets the value of DatasetTime.
func (s *ReadinessResponse) SetDatasetTime(val OptDateTime) {
s.DatasetTime = 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)
}
}