preview_environment.go 652 B

123456789101112131415161718192021222324252627282930
  1. package models
  2. import (
  3. "github.com/porter-dev/porter/api/types"
  4. "gorm.io/gorm"
  5. )
  6. type PreviewEnvironment struct {
  7. gorm.Model
  8. GitRepoOwner string
  9. GitRepoName string
  10. Branch string
  11. NewCommentsDisabled bool
  12. EnvironmentConfigID uint
  13. EnvironmentConfig EnvironmentConfig
  14. }
  15. func (p *PreviewEnvironment) ToPreviewEnvironmentType() *types.PreviewEnvironment {
  16. return &types.PreviewEnvironment{
  17. ID: p.Model.ID,
  18. GitRepoOwner: p.GitRepoOwner,
  19. GitRepoName: p.GitRepoName,
  20. Branch: p.Branch,
  21. NewCommentsDisabled: p.NewCommentsDisabled,
  22. EnvironmentConfigID: p.EnvironmentConfigID,
  23. }
  24. }