|
@@ -24,77 +24,97 @@ type ProjectList struct {
|
|
|
ValidateApplyV2 bool `json:"validate_apply_v2"`
|
|
ValidateApplyV2 bool `json:"validate_apply_v2"`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// Project type for entries in api responses for everything other than `GET /projects`
|
|
|
type Project struct {
|
|
type Project struct {
|
|
|
ID uint `json:"id"`
|
|
ID uint `json:"id"`
|
|
|
Name string `json:"name"`
|
|
Name string `json:"name"`
|
|
|
Roles []*Role `json:"roles"`
|
|
Roles []*Role `json:"roles"`
|
|
|
- PreviewEnvsEnabled bool `json:"preview_envs_enabled"`
|
|
|
|
|
- RDSDatabasesEnabled bool `json:"enable_rds_databases"`
|
|
|
|
|
- ManagedInfraEnabled bool `json:"managed_infra_enabled"`
|
|
|
|
|
APITokensEnabled bool `json:"api_tokens_enabled"`
|
|
APITokensEnabled bool `json:"api_tokens_enabled"`
|
|
|
- StacksEnabled bool `json:"stacks_enabled"`
|
|
|
|
|
|
|
+ AWSACKAuthEnabled bool `json:"aws_ack_auth_enabled"`
|
|
|
|
|
+ AzureEnabled bool `json:"azure_enabled"`
|
|
|
|
|
+ BetaFeaturesEnabled bool `json:"beta_features_enabled"`
|
|
|
CapiProvisionerEnabled bool `json:"capi_provisioner_enabled"`
|
|
CapiProvisionerEnabled bool `json:"capi_provisioner_enabled"`
|
|
|
DBEnabled bool `json:"db_enabled"`
|
|
DBEnabled bool `json:"db_enabled"`
|
|
|
EFSEnabled bool `json:"efs_enabled"`
|
|
EFSEnabled bool `json:"efs_enabled"`
|
|
|
|
|
+ EnableReprovision bool `json:"enable_reprovision"`
|
|
|
|
|
+ FullAddOns bool `json:"full_add_ons"`
|
|
|
GPUEnabled bool `json:"gpu_enabled"`
|
|
GPUEnabled bool `json:"gpu_enabled"`
|
|
|
- SimplifiedViewEnabled bool `json:"simplified_view_enabled"`
|
|
|
|
|
- AzureEnabled bool `json:"azure_enabled"`
|
|
|
|
|
HelmValuesEnabled bool `json:"helm_values_enabled"`
|
|
HelmValuesEnabled bool `json:"helm_values_enabled"`
|
|
|
|
|
+ ManagedInfraEnabled bool `json:"managed_infra_enabled"`
|
|
|
MultiCluster bool `json:"multi_cluster"`
|
|
MultiCluster bool `json:"multi_cluster"`
|
|
|
- FullAddOns bool `json:"full_add_ons"`
|
|
|
|
|
- EnableReprovision bool `json:"enable_reprovision"`
|
|
|
|
|
- ValidateApplyV2 bool `json:"validate_apply_v2"`
|
|
|
|
|
|
|
+ PreviewEnvsEnabled bool `json:"preview_envs_enabled"`
|
|
|
QuotaIncrease bool `json:"quota_increase"`
|
|
QuotaIncrease bool `json:"quota_increase"`
|
|
|
- BetaFeaturesEnabled bool `json:"beta_features_enabled"`
|
|
|
|
|
- AWSACKAuthEnabled bool `json:"aws_ack_auth_enabled"`
|
|
|
|
|
|
|
+ RDSDatabasesEnabled bool `json:"enable_rds_databases"`
|
|
|
|
|
+ SimplifiedViewEnabled bool `json:"simplified_view_enabled"`
|
|
|
|
|
+ SOC2ControlsEnabled bool `json:"soc2_controls_enabled"`
|
|
|
|
|
+ StacksEnabled bool `json:"stacks_enabled"`
|
|
|
|
|
+ ValidateApplyV2 bool `json:"validate_apply_v2"`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// FeatureFlags is a struct that contains old feature flag representations
|
|
|
|
|
+//
|
|
|
|
|
+// Deprecated: Add the feature flag to the `Project` struct instead and
|
|
|
|
|
+// retrieve feature flags from the `GET /projects/{project_id}` response instead
|
|
|
type FeatureFlags struct {
|
|
type FeatureFlags struct {
|
|
|
- PreviewEnvironmentsEnabled string `json:"preview_environments_enabled,omitempty"`
|
|
|
|
|
- ManagedInfraEnabled string `json:"managed_infra_enabled,omitempty"`
|
|
|
|
|
- StacksEnabled string `json:"stacks_enabled,omitempty"`
|
|
|
|
|
- ManagedDatabasesEnabled string `json:"managed_databases_enabled,omitempty"`
|
|
|
|
|
- CapiProvisionerEnabled string `json:"capi_provisioner_enabled,omitempty"`
|
|
|
|
|
- SimplifiedViewEnabled string `json:"simplified_view_enabled,omitempty"`
|
|
|
|
|
AzureEnabled bool `json:"azure_enabled,omitempty"`
|
|
AzureEnabled bool `json:"azure_enabled,omitempty"`
|
|
|
|
|
+ CapiProvisionerEnabled string `json:"capi_provisioner_enabled,omitempty"`
|
|
|
|
|
+ EnableReprovision bool `json:"enable_reprovision,omitempty"`
|
|
|
|
|
+ FullAddOns bool `json:"full_add_ons,omitempty"`
|
|
|
HelmValuesEnabled bool `json:"helm_values_enabled,omitempty"`
|
|
HelmValuesEnabled bool `json:"helm_values_enabled,omitempty"`
|
|
|
|
|
+ ManagedDatabasesEnabled string `json:"managed_databases_enabled,omitempty"`
|
|
|
|
|
+ ManagedInfraEnabled string `json:"managed_infra_enabled,omitempty"`
|
|
|
MultiCluster bool `json:"multi_cluster,omitempty"`
|
|
MultiCluster bool `json:"multi_cluster,omitempty"`
|
|
|
- FullAddOns bool `json:"full_add_ons,omitempty"`
|
|
|
|
|
- EnableReprovision bool `json:"enable_reprovision,omitempty"`
|
|
|
|
|
|
|
+ PreviewEnvironmentsEnabled string `json:"preview_environments_enabled,omitempty"`
|
|
|
|
|
+ SimplifiedViewEnabled string `json:"simplified_view_enabled,omitempty"`
|
|
|
|
|
+ StacksEnabled string `json:"stacks_enabled,omitempty"`
|
|
|
ValidateApplyV2 bool `json:"validate_apply_v2"`
|
|
ValidateApplyV2 bool `json:"validate_apply_v2"`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// CreateProjectRequest is a struct that contains the information
|
|
|
|
|
+// necessary to seed a project
|
|
|
type CreateProjectRequest struct {
|
|
type CreateProjectRequest struct {
|
|
|
Name string `json:"name" form:"required"`
|
|
Name string `json:"name" form:"required"`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// CreateProjectResponse is a struct that contains the response from a create project call
|
|
|
type CreateProjectResponse Project
|
|
type CreateProjectResponse Project
|
|
|
|
|
|
|
|
|
|
+// CreateProjectRoleRequest is a struct that contains the information needed to set a role on a user
|
|
|
type CreateProjectRoleRequest struct {
|
|
type CreateProjectRoleRequest struct {
|
|
|
Kind string `json:"kind" form:"required"`
|
|
Kind string `json:"kind" form:"required"`
|
|
|
UserID uint `json:"user_id" form:"required"`
|
|
UserID uint `json:"user_id" form:"required"`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ProjectInviteAdminRequest is a struct that contains the information needed to invite an admin to a project
|
|
|
type ProjectInviteAdminRequest struct{}
|
|
type ProjectInviteAdminRequest struct{}
|
|
|
|
|
|
|
|
|
|
+// ReadProjectResponse is a struct that contains the response from a `GET /projects/{project_id}` request
|
|
|
type ReadProjectResponse Project
|
|
type ReadProjectResponse Project
|
|
|
|
|
|
|
|
|
|
+// ListProjectsRequest is a struct that contains the information needed to make a `GET /projects` request
|
|
|
type ListProjectsRequest struct{}
|
|
type ListProjectsRequest struct{}
|
|
|
|
|
|
|
|
|
|
+// ListProjectsResponse is a struct that contains the response from a `GET /projects` request
|
|
|
type ListProjectsResponse []Project
|
|
type ListProjectsResponse []Project
|
|
|
|
|
|
|
|
|
|
+// DeleteProjectRequest is a struct that contains the information needed to make a `DELETE /projects` request
|
|
|
type DeleteProjectRequest struct {
|
|
type DeleteProjectRequest struct {
|
|
|
Name string `json:"name" form:"required"`
|
|
Name string `json:"name" form:"required"`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// DeleteProjectResponse is a struct that contains the response from a `DELETE /projects` request
|
|
|
type DeleteProjectResponse Project
|
|
type DeleteProjectResponse Project
|
|
|
|
|
|
|
|
|
|
+// ListProjectInfraResponse is a struct that contains the response from a `GET projects/{project_id}/infra` request
|
|
|
type ListProjectInfraResponse []*Infra
|
|
type ListProjectInfraResponse []*Infra
|
|
|
|
|
|
|
|
|
|
+// GetProjectPolicyResponse is a struct that contains the response from a `GET projects/{project_id}/policy` request
|
|
|
type GetProjectPolicyResponse []*PolicyDocument
|
|
type GetProjectPolicyResponse []*PolicyDocument
|
|
|
|
|
|
|
|
|
|
+// ListProjectRolesResponse is a struct that contains the response from a `GET projects/{project_id}/roles` request
|
|
|
type ListProjectRolesResponse []RoleKind
|
|
type ListProjectRolesResponse []RoleKind
|
|
|
|
|
|
|
|
|
|
+// Collaborator is a struct defining a collaborator on a project
|
|
|
type Collaborator struct {
|
|
type Collaborator struct {
|
|
|
ID uint `json:"id"`
|
|
ID uint `json:"id"`
|
|
|
Kind string `json:"kind"`
|
|
Kind string `json:"kind"`
|
|
@@ -103,48 +123,54 @@ type Collaborator struct {
|
|
|
ProjectID uint `json:"project_id"`
|
|
ProjectID uint `json:"project_id"`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ListCollaboratorsResponse is a struct that contains the response from a `GET projects/{project_id}/collaborators` request
|
|
|
type ListCollaboratorsResponse []*Collaborator
|
|
type ListCollaboratorsResponse []*Collaborator
|
|
|
|
|
|
|
|
|
|
+// UpdateRoleRequest is a struct that contains the information needed to make a `POST projects/{project_id}/roles` request
|
|
|
type UpdateRoleRequest struct {
|
|
type UpdateRoleRequest struct {
|
|
|
UserID uint `json:"user_id,required"`
|
|
UserID uint `json:"user_id,required"`
|
|
|
Kind string `json:"kind,required"`
|
|
Kind string `json:"kind,required"`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// UpdateRoleResponse is a struct that contains the response from a `POST projects/{project_id}/roles` request
|
|
|
type UpdateRoleResponse struct {
|
|
type UpdateRoleResponse struct {
|
|
|
*Role
|
|
*Role
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// DeleteRoleRequest is a struct that contains the response from a `DELETE projects/{project_id}/roles` request
|
|
|
type DeleteRoleRequest struct {
|
|
type DeleteRoleRequest struct {
|
|
|
UserID uint `schema:"user_id,required"`
|
|
UserID uint `schema:"user_id,required"`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// DeleteRoleResponse is a struct that contains the response from a `DELETE projects/{project_id}/roles` request
|
|
|
type DeleteRoleResponse struct {
|
|
type DeleteRoleResponse struct {
|
|
|
*Role
|
|
*Role
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-type GetBillingTokenResponse struct {
|
|
|
|
|
- Token string `json:"token"`
|
|
|
|
|
- TeamID string `json:"team_id"`
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
|
|
+// GetProjectBillingResponse is a struct that contains the response from a `GET projects/{project_id}/billing` request
|
|
|
type GetProjectBillingResponse struct {
|
|
type GetProjectBillingResponse struct {
|
|
|
HasBilling bool `json:"has_billing"`
|
|
HasBilling bool `json:"has_billing"`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// StepEnum is a type describing the current onboarding step
|
|
|
type StepEnum string
|
|
type StepEnum string
|
|
|
|
|
|
|
|
const (
|
|
const (
|
|
|
|
|
+ // StepConnectSource is a value describing the current onboarding step as `connect_source` (the first step)
|
|
|
StepConnectSource StepEnum = "connect_source"
|
|
StepConnectSource StepEnum = "connect_source"
|
|
|
- StepGithub StepEnum = "github"
|
|
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+// ConnectedSourceType describes the source of an onboarding
|
|
|
type ConnectedSourceType string
|
|
type ConnectedSourceType string
|
|
|
|
|
|
|
|
const (
|
|
const (
|
|
|
|
|
+ // ConnectedSourceTypeGithub is the github source
|
|
|
ConnectedSourceTypeGithub = "github"
|
|
ConnectedSourceTypeGithub = "github"
|
|
|
|
|
+ // ConnectedSourceTypeDocker is the docker source
|
|
|
ConnectedSourceTypeDocker = "docker"
|
|
ConnectedSourceTypeDocker = "docker"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+// OnboardingData is an onboarding step
|
|
|
type OnboardingData struct {
|
|
type OnboardingData struct {
|
|
|
CurrentStep StepEnum `json:"current_step"`
|
|
CurrentStep StepEnum `json:"current_step"`
|
|
|
ConnectedSource ConnectedSourceType `json:"connected_source"`
|
|
ConnectedSource ConnectedSourceType `json:"connected_source"`
|
|
@@ -161,8 +187,10 @@ type OnboardingData struct {
|
|
|
ClusterInfraProvider string `json:"cluster_infra_provider"`
|
|
ClusterInfraProvider string `json:"cluster_infra_provider"`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// UpdateOnboardingRequest is a struct that contains the information needed to make a `POST projects/{project_id}/onboarding` request
|
|
|
type UpdateOnboardingRequest OnboardingData
|
|
type UpdateOnboardingRequest OnboardingData
|
|
|
|
|
|
|
|
|
|
+// UpdateOnboardingStepRequest is a struct that contains the information needed to make a `POST projects/{project_id}/onboarding_step` request
|
|
|
type UpdateOnboardingStepRequest struct {
|
|
type UpdateOnboardingStepRequest struct {
|
|
|
Step string `json:"step" form:"required,max=255"`
|
|
Step string `json:"step" form:"required,max=255"`
|
|
|
Provider string `json:"provider"`
|
|
Provider string `json:"provider"`
|