project.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. SAMLSSOEnabled bool `json:"saml_sso_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 CreateProjectRoleRequest 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 ListProjectRolesResponse []RoleKind
  37. type Collaborator struct {
  38. ID uint `json:"id"`
  39. Kind string `json:"kind"`
  40. UserID uint `json:"user_id"`
  41. Email string `json:"email"`
  42. ProjectID uint `json:"project_id"`
  43. }
  44. type ListCollaboratorsResponse []*Collaborator
  45. type UpdateRoleRequest struct {
  46. UserID uint `json:"user_id,required"`
  47. Kind string `json:"kind,required"`
  48. }
  49. type UpdateRoleResponse struct {
  50. *Role
  51. }
  52. type DeleteRoleRequest struct {
  53. UserID uint `schema:"user_id,required"`
  54. }
  55. type DeleteRoleResponse struct {
  56. *Role
  57. }
  58. type GetBillingTokenResponse struct {
  59. Token string `json:"token"`
  60. TeamID string `json:"team_id"`
  61. }
  62. type GetProjectBillingResponse struct {
  63. HasBilling bool `json:"has_billing"`
  64. }
  65. type StepEnum string
  66. const (
  67. StepConnectSource StepEnum = "connect_source"
  68. StepGithub StepEnum = "github"
  69. )
  70. type ConnectedSourceType string
  71. const (
  72. ConnectedSourceTypeGithub = "github"
  73. ConnectedSourceTypeDocker = "docker"
  74. )
  75. type OnboardingData struct {
  76. CurrentStep StepEnum `json:"current_step"`
  77. ConnectedSource ConnectedSourceType `json:"connected_source"`
  78. SkipRegistryConnection bool `json:"skip_registry_connection"`
  79. SkipResourceProvision bool `json:"skip_resource_provision"`
  80. RegistryConnectionID uint `json:"registry_connection_id"`
  81. RegistryConnectionCredentialID uint `json:"registry_connection_credential_id"`
  82. RegistryConnectionProvider string `json:"registry_connection_provider"`
  83. RegistryInfraID uint `json:"registry_infra_id"`
  84. RegistryInfraCredentialID uint `json:"registry_infra_credential_id"`
  85. RegistryInfraProvider string `json:"registry_infra_provider"`
  86. ClusterInfraID uint `json:"cluster_infra_id"`
  87. ClusterInfraCredentialID uint `json:"cluster_infra_credential_id"`
  88. ClusterInfraProvider string `json:"cluster_infra_provider"`
  89. }
  90. type UpdateOnboardingRequest OnboardingData