project.go 6.6 KB

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