package operation

// GetOperation godoc
//
//	@Summary		GetOperation
//	@Description	Get LRO operation status check.
//	@Tags			Long-Running Operations
//	@Produce		json
//	@Param			org_id			path		string	true	"Organization ID"
//	@Param			project_id		path		string	true	"Project ID"
//	@Param			operation_id	path		string	true	"LRO ID"
//	@Success		200				{object}	OperationResponse
//	@Router			/orgs/{org_id}/projects/{project_id}/operations/{operation_id} [get]
func GetOperation() {}

// OperationResponse represents the response of the GetOperation endpoint.
type OperationResponse struct {
	Operation Operation `json:"operation"`
}

// Operation represents a long-running operation.
type Operation struct {
	ID            uint64 `json:"id" example:"123456"`
	Status        string `json:"status" enum:"PENDING,RUNNING,DONE" example:"DONE"`
	StatusMessage string `json:"status_message" example:""`
	User          string `json:"user" example:"user@example.com"`
	Progress      int    `json:"progress" example:"100"`
	CreatedAt     string `json:"created_at" example:"2022-03-22T20:13:11.285067Z"`
	StartedAt     string `json:"started_at" example:"2022-03-22T20:23:11.285067Z"`
	EndedAt       string `json:"ended_at" example:"2022-03-22T20:33:11.285067Z"`
	Error         *Error `json:"error,omitempty"`
}

// Error represents an error that can occur during processing of an operation.
type Error struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

// ListOperations godoc
//
//	@Summary		ListOperations
//	@Description	List all running LRO operations' status.
//	@Tags			Long-Running Operations
//	@Produce		json
//	@Param			org_id		path	string	true	"Organization ID"
//	@Param			project_id	path	string	true	"Project ID"
//	@Param			page		query	int		true	"Number of pages"
//	@Param			page_size	query	int		true	"Size of a page"
//	@Param			filter		query	string	false	"A filter expression that filters resources listed in the response"
//	@Success		200			{array}	Operation
//	@Router			/orgs/{org_id}/projects/{project_id}/operations [get]
func ListOperations() {}
