project.go 6.3 KB

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