2
0

project.go 2.9 KB

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