project.go 3.3 KB

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