project.go 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 CreateLegacyProjectRoleRequest 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 Collaborator struct {
  36. RoleUIDs []string `json:"roles"`
  37. UserID uint `json:"user_id"`
  38. Email string `json:"email"`
  39. ProjectID uint `json:"project_id"`
  40. }
  41. type ListCollaboratorsResponse []*Collaborator
  42. type UpdateCollaboratorRoleRequest struct {
  43. RoleUIDs []string `json:"roles" form:"required"`
  44. }
  45. type GetBillingTokenResponse struct {
  46. Token string `json:"token"`
  47. TeamID string `json:"team_id"`
  48. }
  49. type GetProjectBillingResponse struct {
  50. HasBilling bool `json:"has_billing"`
  51. }
  52. type StepEnum string
  53. const (
  54. StepConnectSource StepEnum = "connect_source"
  55. StepGithub StepEnum = "github"
  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. RegistryConnectionCredentialID uint `json:"registry_connection_credential_id"`
  69. RegistryConnectionProvider string `json:"registry_connection_provider"`
  70. RegistryInfraID uint `json:"registry_infra_id"`
  71. RegistryInfraCredentialID uint `json:"registry_infra_credential_id"`
  72. RegistryInfraProvider string `json:"registry_infra_provider"`
  73. ClusterInfraID uint `json:"cluster_infra_id"`
  74. ClusterInfraCredentialID uint `json:"cluster_infra_credential_id"`
  75. ClusterInfraProvider string `json:"cluster_infra_provider"`
  76. }
  77. type UpdateOnboardingRequest OnboardingData