project.go 5.2 KB

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