project.go 3.6 KB

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