environment.go 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. package types
  2. type Environment struct {
  3. ID uint `json:"id"`
  4. ProjectID uint `json:"project_id"`
  5. ClusterID uint `json:"cluster_id"`
  6. GitInstallationID uint `json:"git_installation_id"`
  7. GitRepoOwner string `json:"git_repo_owner"`
  8. GitRepoName string `json:"git_repo_name"`
  9. Name string `json:"name"`
  10. }
  11. type CreateEnvironmentRequest struct {
  12. Name string `json:"name" form:"required"`
  13. }
  14. type GitHubMetadata struct {
  15. DeploymentID int64 `json:"gh_deployment_id"`
  16. PRName string `json:"gh_pr_name"`
  17. RepoName string `json:"gh_repo_name"`
  18. RepoOwner string `json:"gh_repo_owner"`
  19. CommitSHA string `json:"gh_commit_sha"`
  20. }
  21. type Deployment struct {
  22. *GitHubMetadata
  23. ID uint `json:"id"`
  24. GitInstallationID uint `json:"git_installation_id"`
  25. EnvironmentID uint `json:"environment_id"`
  26. Namespace string `json:"namespace"`
  27. Status string `json:"status"`
  28. Subdomain string `json:"subdomain"`
  29. PullRequestID uint `json:"pull_request_id"`
  30. }
  31. type CreateGHDeploymentRequest struct {
  32. Branch string `json:"branch" form:"required"`
  33. ActionID uint `json:"action_id" form:"required"`
  34. }
  35. type CreateDeploymentRequest struct {
  36. *CreateGHDeploymentRequest
  37. *GitHubMetadata
  38. Namespace string `json:"namespace" form:"required"`
  39. PullRequestID uint `json:"pull_request_id" form:"required"`
  40. }
  41. type FinalizeDeploymentRequest struct {
  42. Namespace string `json:"namespace" form:"required"`
  43. Subdomain string `json:"subdomain"`
  44. }
  45. type UpdateDeploymentRequest struct {
  46. *CreateGHDeploymentRequest
  47. CommitSHA string `json:"commit_sha" form:"required"`
  48. Namespace string `json:"namespace" form:"required"`
  49. }
  50. type DeleteDeploymentRequest struct {
  51. Namespace string `json:"namespace" form:"required"`
  52. }
  53. type GetDeploymentRequest struct {
  54. Namespace string `schema:"namespace" form:"required"`
  55. }