project.go 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. package types
  2. // ProjectList type for entries in the api response on GET /projects
  3. type ProjectList struct {
  4. ID uint `json:"id"`
  5. Name string `json:"name"`
  6. // note: all of these fields should be considered deprecated
  7. // in an api response
  8. Roles []Role `json:"roles"`
  9. PreviewEnvsEnabled bool `json:"preview_envs_enabled"`
  10. RDSDatabasesEnabled bool `json:"enable_rds_databases"`
  11. ManagedInfraEnabled bool `json:"managed_infra_enabled"`
  12. APITokensEnabled bool `json:"api_tokens_enabled"`
  13. StacksEnabled bool `json:"stacks_enabled"`
  14. CapiProvisionerEnabled bool `json:"capi_provisioner_enabled"`
  15. DBEnabled bool `json:"db_enabled"`
  16. SimplifiedViewEnabled bool `json:"simplified_view_enabled"`
  17. AzureEnabled bool `json:"azure_enabled"`
  18. HelmValuesEnabled bool `json:"helm_values_enabled"`
  19. MultiCluster bool `json:"multi_cluster"`
  20. FullAddOns bool `json:"full_add_ons"`
  21. EnableReprovision bool `json:"enable_reprovision"`
  22. ValidateApplyV2 bool `json:"validate_apply_v2"`
  23. }
  24. type Project struct {
  25. ID uint `json:"id"`
  26. Name string `json:"name"`
  27. Roles []*Role `json:"roles"`
  28. PreviewEnvsEnabled bool `json:"preview_envs_enabled"`
  29. RDSDatabasesEnabled bool `json:"enable_rds_databases"`
  30. ManagedInfraEnabled bool `json:"managed_infra_enabled"`
  31. APITokensEnabled bool `json:"api_tokens_enabled"`
  32. StacksEnabled bool `json:"stacks_enabled"`
  33. CapiProvisionerEnabled bool `json:"capi_provisioner_enabled"`
  34. DBEnabled bool `json:"db_enabled"`
  35. EFSEnabled bool `json:"efs_enabled"`
  36. SimplifiedViewEnabled bool `json:"simplified_view_enabled"`
  37. AzureEnabled bool `json:"azure_enabled"`
  38. HelmValuesEnabled bool `json:"helm_values_enabled"`
  39. MultiCluster bool `json:"multi_cluster"`
  40. FullAddOns bool `json:"full_add_ons"`
  41. EnableReprovision bool `json:"enable_reprovision"`
  42. ValidateApplyV2 bool `json:"validate_apply_v2"`
  43. QuotaIncrease bool `json:"quota_increase"`
  44. BetaFeaturesEnabled bool `json:"beta_features_enabled"`
  45. }
  46. type FeatureFlags struct {
  47. PreviewEnvironmentsEnabled string `json:"preview_environments_enabled,omitempty"`
  48. ManagedInfraEnabled string `json:"managed_infra_enabled,omitempty"`
  49. StacksEnabled string `json:"stacks_enabled,omitempty"`
  50. ManagedDatabasesEnabled string `json:"managed_databases_enabled,omitempty"`
  51. CapiProvisionerEnabled string `json:"capi_provisioner_enabled,omitempty"`
  52. SimplifiedViewEnabled string `json:"simplified_view_enabled,omitempty"`
  53. AzureEnabled bool `json:"azure_enabled,omitempty"`
  54. HelmValuesEnabled bool `json:"helm_values_enabled,omitempty"`
  55. MultiCluster bool `json:"multi_cluster,omitempty"`
  56. FullAddOns bool `json:"full_add_ons,omitempty"`
  57. EnableReprovision bool `json:"enable_reprovision,omitempty"`
  58. ValidateApplyV2 bool `json:"validate_apply_v2"`
  59. }
  60. type CreateProjectRequest struct {
  61. Name string `json:"name" form:"required"`
  62. }
  63. type CreateProjectResponse Project
  64. type CreateProjectRoleRequest struct {
  65. Kind string `json:"kind" form:"required"`
  66. UserID uint `json:"user_id" form:"required"`
  67. }
  68. type ProjectInviteAdminRequest struct{}
  69. type ReadProjectResponse Project
  70. type ListProjectsRequest struct{}
  71. type ListProjectsResponse []Project
  72. type DeleteProjectRequest struct {
  73. Name string `json:"name" form:"required"`
  74. }
  75. type DeleteProjectResponse Project
  76. type ListProjectInfraResponse []*Infra
  77. type GetProjectPolicyResponse []*PolicyDocument
  78. type ListProjectRolesResponse []RoleKind
  79. type Collaborator struct {
  80. ID uint `json:"id"`
  81. Kind string `json:"kind"`
  82. UserID uint `json:"user_id"`
  83. Email string `json:"email"`
  84. ProjectID uint `json:"project_id"`
  85. }
  86. type ListCollaboratorsResponse []*Collaborator
  87. type UpdateRoleRequest struct {
  88. UserID uint `json:"user_id,required"`
  89. Kind string `json:"kind,required"`
  90. }
  91. type UpdateRoleResponse struct {
  92. *Role
  93. }
  94. type DeleteRoleRequest struct {
  95. UserID uint `schema:"user_id,required"`
  96. }
  97. type DeleteRoleResponse struct {
  98. *Role
  99. }
  100. type GetBillingTokenResponse struct {
  101. Token string `json:"token"`
  102. TeamID string `json:"team_id"`
  103. }
  104. type GetProjectBillingResponse struct {
  105. HasBilling bool `json:"has_billing"`
  106. }
  107. type StepEnum string
  108. const (
  109. StepConnectSource StepEnum = "connect_source"
  110. StepGithub StepEnum = "github"
  111. )
  112. type ConnectedSourceType string
  113. const (
  114. ConnectedSourceTypeGithub = "github"
  115. ConnectedSourceTypeDocker = "docker"
  116. )
  117. type OnboardingData struct {
  118. CurrentStep StepEnum `json:"current_step"`
  119. ConnectedSource ConnectedSourceType `json:"connected_source"`
  120. SkipRegistryConnection bool `json:"skip_registry_connection"`
  121. SkipResourceProvision bool `json:"skip_resource_provision"`
  122. RegistryConnectionID uint `json:"registry_connection_id"`
  123. RegistryConnectionCredentialID uint `json:"registry_connection_credential_id"`
  124. RegistryConnectionProvider string `json:"registry_connection_provider"`
  125. RegistryInfraID uint `json:"registry_infra_id"`
  126. RegistryInfraCredentialID uint `json:"registry_infra_credential_id"`
  127. RegistryInfraProvider string `json:"registry_infra_provider"`
  128. ClusterInfraID uint `json:"cluster_infra_id"`
  129. ClusterInfraCredentialID uint `json:"cluster_infra_credential_id"`
  130. ClusterInfraProvider string `json:"cluster_infra_provider"`
  131. }
  132. type UpdateOnboardingRequest OnboardingData
  133. type UpdateOnboardingStepRequest struct {
  134. Step string `json:"step" form:"required,max=255"`
  135. Provider string `json:"provider"`
  136. AccountId string `json:"account_id"`
  137. CloudformationURL string `json:"cloudformation_url"`
  138. ErrorMessage string `json:"error_message"`
  139. LoginURL string `json:"login_url"`
  140. Region string `json:"region"`
  141. // ExternalId used as a 'password' for the aws assume role chain to porter-manager role
  142. ExternalId string `json:"external_id"`
  143. }
  144. // UpdateProjectNameRequest takes in a name to rename projects
  145. type UpdateProjectNameRequest struct {
  146. Name string `json:"name" form:"required"`
  147. }