package common

type UpdateManifestUpdateRequest struct {
	ID             int64  `json:"id,omitempty"`
	Name           string `json:"name" validate:"required,max=255"`
	ReleaseNotes   string `json:"release_notes,omitempty" validate:"omitempty,max=32768,url"`
	Type           string `json:"type" validate:"required,oneof=standard forced"`
	Active         *bool  `json:"active,omitempty"`
	Country        string `json:"country,omitempty"`
	PowerTrain     string `json:"powertrain,omitempty"`
	Restraint      string `json:"restraint,omitempty"`
	Model          string `json:"model,omitempty"`
	Trim           string `json:"trim,omitempty"`
	Year           int    `json:"year,omitempty"`
	BodyType       string `json:"body_type,omitempty"`
	Env            string `json:"env,omitempty"`
	Rollback       bool   `json:"rollback,omitempty"`
	SUMS           string `json:"sums,omitempty"`
	UpdateDuration int    `json:"update_duration,omitempty"`
	MaxAttempts    int    `json:"max_attempts,omitempty"`
}

type CreateUpdateManifest struct {
	ID              int64              `json:"id,omitempty"`
	Name            string             `json:"name,omitempty" validate:"required,max=255"`
	Version         string             `json:"version,omitempty" validate:"max=255"`
	Description     string             `json:"description,omitempty" validate:"max=5120"`
	ReleaseNotes    string             `json:"release_notes,omitempty" validate:"omitempty,max=32768,url"`
	RollbackEnabled bool               `json:"rollback"`
	Type            string             `json:"type,omitempty" validate:"max=100"`
	ManifestType    UpdateManifestType `json:"manifest_type,omitempty" validate:"oneof=0 1 2 3 4" swaggerignore:"true"`
	Active          *bool              `json:"active,omitempty"`
	Country         string             `json:"country,omitempty"`
	PowerTrain      string             `json:"powertrain,omitempty"`
	Restraint       string             `json:"restraint,omitempty"`
	Model           string             `json:"model,omitempty"`
	Trim            string             `json:"trim,omitempty"`
	Year            int                `json:"year,omitempty"`
	BodyType        string             `json:"body_type,omitempty"`
	UpdateDuration  int                `json:"update_duration,omitempty" pg:"update_duration"` // Duration of update in minutes
	MaxAttempts     int                `json:"max_attempts,omitempty" pg:"max_attempts"`
}

type UpdateManifestArchiveRequest struct {
	IDs    []int64 `json:"ids,omitempty" validate:"required"`
	Active bool    `json:"active,omitempty"`
}
