project.go 4.9 KB

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