project.go 3.9 KB

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