project.go 3.6 KB

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