project.go 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. EnvGroupEnabled bool `json:"env_group_enabled"`
  16. MultiCluster bool `json:"multi_cluster"`
  17. }
  18. type FeatureFlags struct {
  19. PreviewEnvironmentsEnabled string `json:"preview_environments_enabled,omitempty"`
  20. ManagedInfraEnabled string `json:"managed_infra_enabled,omitempty"`
  21. StacksEnabled string `json:"stacks_enabled,omitempty"`
  22. ManagedDatabasesEnabled string `json:"managed_databases_enabled,omitempty"`
  23. CapiProvisionerEnabled string `json:"capi_provisioner_enabled,omitempty"`
  24. SimplifiedViewEnabled string `json:"simplified_view_enabled,omitempty"`
  25. AzureEnabled bool `json:"azure_enabled,omitempty"`
  26. HelmValuesEnabled bool `json:"helm_values_enabled,omitempty"`
  27. EnvGroupEnabled bool `json:"env_group_enabled,omitempty"`
  28. MultiCluster bool `json:"multi_cluster,omitempty"`
  29. }
  30. type CreateProjectRequest struct {
  31. Name string `json:"name" form:"required"`
  32. }
  33. type CreateProjectResponse Project
  34. type CreateProjectRoleRequest struct {
  35. Kind string `json:"kind" form:"required"`
  36. UserID uint `json:"user_id" form:"required"`
  37. }
  38. type ProjectInviteAdminRequest struct{}
  39. type ReadProjectResponse Project
  40. type ListProjectsRequest struct{}
  41. type ListProjectsResponse []Project
  42. type DeleteProjectRequest struct {
  43. Name string `json:"name" form:"required"`
  44. }
  45. type DeleteProjectResponse Project
  46. type ListProjectInfraResponse []*Infra
  47. type GetProjectPolicyResponse []*PolicyDocument
  48. type ListProjectRolesResponse []RoleKind
  49. type Collaborator struct {
  50. ID uint `json:"id"`
  51. Kind string `json:"kind"`
  52. UserID uint `json:"user_id"`
  53. Email string `json:"email"`
  54. ProjectID uint `json:"project_id"`
  55. }
  56. type ListCollaboratorsResponse []*Collaborator
  57. type UpdateRoleRequest struct {
  58. UserID uint `json:"user_id,required"`
  59. Kind string `json:"kind,required"`
  60. }
  61. type UpdateRoleResponse struct {
  62. *Role
  63. }
  64. type DeleteRoleRequest struct {
  65. UserID uint `schema:"user_id,required"`
  66. }
  67. type DeleteRoleResponse struct {
  68. *Role
  69. }
  70. type GetBillingTokenResponse struct {
  71. Token string `json:"token"`
  72. TeamID string `json:"team_id"`
  73. }
  74. type GetProjectBillingResponse struct {
  75. HasBilling bool `json:"has_billing"`
  76. }
  77. type StepEnum string
  78. const (
  79. StepConnectSource StepEnum = "connect_source"
  80. StepGithub StepEnum = "github"
  81. )
  82. type ConnectedSourceType string
  83. const (
  84. ConnectedSourceTypeGithub = "github"
  85. ConnectedSourceTypeDocker = "docker"
  86. )
  87. type OnboardingData struct {
  88. CurrentStep StepEnum `json:"current_step"`
  89. ConnectedSource ConnectedSourceType `json:"connected_source"`
  90. SkipRegistryConnection bool `json:"skip_registry_connection"`
  91. SkipResourceProvision bool `json:"skip_resource_provision"`
  92. RegistryConnectionID uint `json:"registry_connection_id"`
  93. RegistryConnectionCredentialID uint `json:"registry_connection_credential_id"`
  94. RegistryConnectionProvider string `json:"registry_connection_provider"`
  95. RegistryInfraID uint `json:"registry_infra_id"`
  96. RegistryInfraCredentialID uint `json:"registry_infra_credential_id"`
  97. RegistryInfraProvider string `json:"registry_infra_provider"`
  98. ClusterInfraID uint `json:"cluster_infra_id"`
  99. ClusterInfraCredentialID uint `json:"cluster_infra_credential_id"`
  100. ClusterInfraProvider string `json:"cluster_infra_provider"`
  101. }
  102. type UpdateOnboardingRequest OnboardingData
  103. type UpdateOnboardingStepRequest struct {
  104. Step string `json:"step" form:"required,max=255"`
  105. Provider string `json:"provider"`
  106. AccountId string `json:"account_id"`
  107. CloudformationURL string `json:"cloudformation_url"`
  108. ErrorMessage string `json:"error_message"`
  109. LoginURL string `json:"login_url"`
  110. Region string `json:"region"`
  111. // ExternalId used as a 'password' for the aws assume role chain to porter-manager role
  112. ExternalId string `json:"external_id"`
  113. }