project.go 6.4 KB

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