mirror of
https://github.com/goharbor/harbor
synced 2025-04-18 16:15:49 +00:00
35 lines
736 B
Go
35 lines
736 B
Go
package model
|
|
|
|
import (
|
|
"github.com/go-openapi/strfmt"
|
|
|
|
"github.com/goharbor/harbor/src/pkg/notification/job/model"
|
|
"github.com/goharbor/harbor/src/server/v2.0/models"
|
|
)
|
|
|
|
// NotificationJob ...
|
|
type NotificationJob struct {
|
|
*model.Job
|
|
}
|
|
|
|
// ToSwagger ...
|
|
func (n *NotificationJob) ToSwagger() *models.WebhookJob {
|
|
return &models.WebhookJob{
|
|
ID: n.ID,
|
|
EventType: n.EventType,
|
|
JobDetail: n.JobDetail,
|
|
NotifyType: n.NotifyType,
|
|
PolicyID: n.PolicyID,
|
|
Status: n.Status,
|
|
CreationTime: strfmt.DateTime(n.CreationTime),
|
|
UpdateTime: strfmt.DateTime(n.UpdateTime),
|
|
}
|
|
}
|
|
|
|
// NewNotificationJob ...
|
|
func NewNotificationJob(j *model.Job) *NotificationJob {
|
|
return &NotificationJob{
|
|
Job: j,
|
|
}
|
|
}
|