project.go 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. package types
  2. type Project struct {
  3. ID uint `json:"id"`
  4. Name string `json:"name"`
  5. Roles []*Role `json:"roles"`
  6. }
  7. type CreateProjectRequest struct {
  8. Name string `json:"name" form:"required"`
  9. }
  10. type CreateProjectResponse Project
  11. type CreateProjectRoleRequest struct {
  12. Kind string `json:"kind" form:"required"`
  13. UserID uint `json:"user_id" form:"required"`
  14. }
  15. type ReadProjectResponse Project
  16. type ListProjectsRequest struct{}
  17. type ListProjectsResponse []Project
  18. type DeleteProjectRequest struct {
  19. Name string `json:"name" form:"required"`
  20. }
  21. type DeleteProjectResponse Project
  22. type ListProjectInfraResponse []*Infra
  23. type GetProjectPolicyResponse []*PolicyDocument
  24. type ListProjectRolesResponse []RoleKind
  25. type Collaborator struct {
  26. ID uint `json:"id"`
  27. Kind string `json:"kind"`
  28. UserID uint `json:"user_id"`
  29. Email string `json:"email"`
  30. ProjectID uint `json:"project_id"`
  31. }
  32. type ListCollaboratorsResponse []*Collaborator
  33. type UpdateRoleRequest struct {
  34. UserID uint `json:"user_id,required"`
  35. Kind string `json:"kind,required"`
  36. }
  37. type UpdateRoleResponse struct {
  38. *Role
  39. }
  40. type DeleteRoleRequest struct {
  41. UserID uint `schema:"user_id,required"`
  42. }
  43. type DeleteRoleResponse struct {
  44. *Role
  45. }
  46. type GetBillingTokenResponse struct {
  47. Token string `json:"token"`
  48. }
  49. type GetProjectBillingResponse struct {
  50. HasBilling bool `json:"has_billing"`
  51. }
  52. type StepEnum string
  53. const (
  54. StepGithub StepEnum = "github"
  55. StepTwo StepEnum = "step_two"
  56. )
  57. type ConnectedSourceType string
  58. const (
  59. ConnectedSourceTypeGithub = "github"
  60. ConnectedSourceTypeDocker = "docker"
  61. )
  62. type OnboardingData struct {
  63. CurrentStep StepEnum `json:"current_step"`
  64. ConnectedSource ConnectedSourceType `json:"connected_source"`
  65. SkipRegistryConnection bool `json:"skip_registry_connection"`
  66. SkipResourceProvision bool `json:"skip_resource_provision"`
  67. RegistryConnectionID uint `json:"registry_connection_id"`
  68. RegistryInfraID uint `json:"registry_infra_id"`
  69. ClusterInfraID uint `json:"cluster_infra_id"`
  70. }
  71. type UpdateOnboardingRequest OnboardingData