project.go 4.0 KB

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