project.go 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. RDSDatabasesEnabled bool `json:"enable_rds_databases"`
  8. ManagedInfraEnabled bool `json:"managed_infra_enabled"`
  9. APITokensEnabled bool `json:"api_tokens_enabled"`
  10. StacksEnabled bool `json:"stacks_enabled"`
  11. }
  12. type FeatureFlags struct {
  13. PreviewEnvironmentsEnabled string `json:"preview_environments_enabled,omitempty"`
  14. ManagedInfraEnabled string `json:"managed_infra_enabled,omitempty"`
  15. StacksEnabled string `json:"stacks_enabled,omitempty"`
  16. ManagedDatabasesEnabled string `json:"managed_databases_enabled,omitempty"`
  17. }
  18. type CreateProjectRequest struct {
  19. Name string `json:"name" form:"required"`
  20. }
  21. type CreateProjectResponse Project
  22. type CreateProjectRoleRequest struct {
  23. Kind string `json:"kind" form:"required"`
  24. UserID uint `json:"user_id" form:"required"`
  25. }
  26. type ReadProjectResponse Project
  27. type ListProjectsRequest struct{}
  28. type ListProjectsResponse []Project
  29. type DeleteProjectRequest struct {
  30. Name string `json:"name" form:"required"`
  31. }
  32. type DeleteProjectResponse Project
  33. type ListProjectInfraResponse []*Infra
  34. type GetProjectPolicyResponse []*PolicyDocument
  35. type ListProjectRolesResponse []RoleKind
  36. type Collaborator struct {
  37. ID uint `json:"id"`
  38. Kind string `json:"kind"`
  39. UserID uint `json:"user_id"`
  40. Email string `json:"email"`
  41. ProjectID uint `json:"project_id"`
  42. }
  43. type ListCollaboratorsResponse []*Collaborator
  44. type UpdateRoleRequest struct {
  45. UserID uint `json:"user_id,required"`
  46. Kind string `json:"kind,required"`
  47. }
  48. type UpdateRoleResponse struct {
  49. *Role
  50. }
  51. type DeleteRoleRequest struct {
  52. UserID uint `schema:"user_id,required"`
  53. }
  54. type DeleteRoleResponse struct {
  55. *Role
  56. }
  57. type GetBillingTokenResponse struct {
  58. Token string `json:"token"`
  59. TeamID string `json:"team_id"`
  60. }
  61. type GetProjectBillingResponse struct {
  62. HasBilling bool `json:"has_billing"`
  63. }
  64. type StepEnum string
  65. const (
  66. StepConnectSource StepEnum = "connect_source"
  67. StepGithub StepEnum = "github"
  68. )
  69. type ConnectedSourceType string
  70. const (
  71. ConnectedSourceTypeGithub = "github"
  72. ConnectedSourceTypeDocker = "docker"
  73. )
  74. type OnboardingData struct {
  75. CurrentStep StepEnum `json:"current_step"`
  76. ConnectedSource ConnectedSourceType `json:"connected_source"`
  77. SkipRegistryConnection bool `json:"skip_registry_connection"`
  78. SkipResourceProvision bool `json:"skip_resource_provision"`
  79. RegistryConnectionID uint `json:"registry_connection_id"`
  80. RegistryConnectionCredentialID uint `json:"registry_connection_credential_id"`
  81. RegistryConnectionProvider string `json:"registry_connection_provider"`
  82. RegistryInfraID uint `json:"registry_infra_id"`
  83. RegistryInfraCredentialID uint `json:"registry_infra_credential_id"`
  84. RegistryInfraProvider string `json:"registry_infra_provider"`
  85. ClusterInfraID uint `json:"cluster_infra_id"`
  86. ClusterInfraCredentialID uint `json:"cluster_infra_credential_id"`
  87. ClusterInfraProvider string `json:"cluster_infra_provider"`
  88. }
  89. type UpdateOnboardingRequest OnboardingData