project.go 4.7 KB

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