// Package schedule provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
package schedule

import (
	core "github.com/meshery/schemas/models/core"
)

// Schedule A schedule defines a recurring cron-based trigger for performance tests or other automated tasks.
type Schedule struct {
	// Id A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	ID *core.Uuid `db:"id" json:"id,omitempty" yaml:"id,omitempty"`

	// Name Human-readable name for the schedule.
	Name string `db:"name" json:"name" yaml:"name"`

	// UserId A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	UserId core.Uuid `db:"owner" json:"userId" yaml:"userId"`

	// CronExpression Cron expression defining the schedule's recurrence (e.g. "0 0 * * *" for daily at midnight).
	CronExpression string `db:"cron_expression" json:"cronExpression" yaml:"cronExpression"`

	// LastRun SQL null Timestamp to handle null values of time.
	LastRun core.NullTime `db:"last_run" json:"lastRun" yaml:"lastRun,omitempty"`

	// NextRun SQL null Timestamp to handle null values of time.
	NextRun   core.NullTime `db:"next_run" json:"nextRun" yaml:"nextRun,omitempty"`
	CreatedAt core.Time     `db:"created_at" json:"createdAt" yaml:"createdAt,omitempty"`
	UpdatedAt core.Time     `db:"updated_at" json:"updatedAt" yaml:"updatedAt,omitempty"`
}

// SchedulePage A paginated list of schedules.
type SchedulePage struct {
	// Page Current page number (zero-based).
	Page int `json:"page" yaml:"page"`

	// PageSize Number of schedules per page.
	PageSize int `json:"pageSize" yaml:"pageSize"`

	// TotalCount Total number of schedules across all pages.
	TotalCount int `json:"totalCount" yaml:"totalCount"`

	// Schedules The schedules of the schedulepage.
	Schedules []Schedule `json:"schedules" yaml:"schedules"`
}

// SchedulePayload Payload for upserting a schedule. Includes only client-settable fields.
type SchedulePayload struct {
	// CronExpression Cron expression defining the schedule's recurrence (e.g. "0 0 * * *" for daily at midnight).
	CronExpression string `json:"cronExpression" yaml:"cronExpression"`

	// Id A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	ID *core.Uuid `json:"id,omitempty" yaml:"id,omitempty"`

	// Name Human-readable name for the schedule.
	Name string `json:"name" yaml:"name"`

	// UserId A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	UserId *core.Uuid `json:"userId,omitempty" yaml:"userId,omitempty"`
}

// Order defines model for order.
type Order = string

// Page defines model for page.
type Page = int

// PageSize defines model for pageSize.
type PageSize = int

// ScheduleId A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
type ScheduleId = core.Uuid

// Search defines model for search.
type Search = string
