| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- package types
- // ProjectList type for entries in the api response on GET /projects
- type ProjectList struct {
- ID uint `json:"id"`
- Name string `json:"name"`
- // note: all of these fields should be considered deprecated
- // in an api response
- 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"`
- StacksEnabled bool `json:"stacks_enabled"`
- CapiProvisionerEnabled bool `json:"capi_provisioner_enabled"`
- BillingEnabled bool `json:"billing_enabled"`
- DBEnabled bool `json:"db_enabled"`
- SimplifiedViewEnabled bool `json:"simplified_view_enabled"`
- AzureEnabled bool `json:"azure_enabled"`
- HelmValuesEnabled bool `json:"helm_values_enabled"`
- MultiCluster bool `json:"multi_cluster"`
- FullAddOns bool `json:"full_add_ons"`
- EnableReprovision bool `json:"enable_reprovision"`
- ValidateApplyV2 bool `json:"validate_apply_v2"`
- AdvancedInfraEnabled bool `json:"advanced_infra_enabled"`
- SandboxEnabled bool `json:"sandbox_enabled"`
- AdvancedRbacEnabled bool `json:"advanced_rbac_enabled"`
- }
- // Project type for entries in api responses for everything other than `GET /projects`
- type Project struct {
- ID uint `json:"id"`
- Name string `json:"name"`
- Roles []*Role `json:"roles"`
- APITokensEnabled bool `json:"api_tokens_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"`
- BillingEnabled bool `json:"billing_enabled"`
- MetronomeEnabled bool `json:"metronome_enabled"`
- InfisicalEnabled bool `json:"infisical_enabled"`
- DBEnabled bool `json:"db_enabled"`
- EFSEnabled bool `json:"efs_enabled"`
- EnableReprovision bool `json:"enable_reprovision"`
- FullAddOns bool `json:"full_add_ons"`
- GPUEnabled bool `json:"gpu_enabled"`
- HelmValuesEnabled bool `json:"helm_values_enabled"`
- ManagedInfraEnabled bool `json:"managed_infra_enabled"`
- MultiCluster bool `json:"multi_cluster"`
- PreviewEnvsEnabled bool `json:"preview_envs_enabled"`
- QuotaIncrease bool `json:"quota_increase"`
- 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"`
- ManagedDeploymentTargetsEnabled bool `json:"managed_deployment_targets_enabled"`
- AdvancedInfraEnabled bool `json:"advanced_infra_enabled"`
- SandboxEnabled bool `json:"sandbox_enabled"`
- AdvancedRbacEnabled bool `json:"advanced_rbac_enabled"`
- // ReferralCode is a unique code that can be shared to referr other users to Porter
- ReferralCode string `json:"referral_code"`
- }
- // 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 {
- AzureEnabled bool `json:"azure_enabled,omitempty"`
- BillingEnabled bool `json:"billing_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"`
- ManagedDatabasesEnabled string `json:"managed_databases_enabled,omitempty"`
- ManagedInfraEnabled string `json:"managed_infra_enabled,omitempty"`
- MultiCluster bool `json:"multi_cluster,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"`
- ManagedDeploymentTargetsEnabled bool `json:"managed_deployment_targets_enabled"`
- AdvancedRbacEnabled bool `json:"advanced_rbac_enabled"`
- }
- // CreateProjectRequest is a struct that contains the information
- // necessary to seed a project
- type CreateProjectRequest struct {
- Name string `json:"name" form:"required"`
- }
- // CreateProjectResponse is a struct that contains the response from a create project call
- type CreateProjectResponse Project
- // CreateProjectRoleRequest is a struct that contains the information needed to set a role on a user
- type CreateProjectRoleRequest struct {
- Kind string `json:"kind" 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{}
- // ReadProjectResponse is a struct that contains the response from a `GET /projects/{project_id}` request
- type ReadProjectResponse Project
- // ListProjectsRequest is a struct that contains the information needed to make a `GET /projects` request
- type ListProjectsRequest struct{}
- // ListProjectsResponse is a struct that contains the response from a `GET /projects` request
- type ListProjectsResponse []Project
- // DeleteProjectRequest is a struct that contains the information needed to make a `DELETE /projects` request
- type DeleteProjectRequest struct {
- Name string `json:"name" form:"required"`
- }
- // DeleteProjectResponse is a struct that contains the response from a `DELETE /projects` request
- type DeleteProjectResponse Project
- // ListProjectInfraResponse is a struct that contains the response from a `GET projects/{project_id}/infra` request
- type ListProjectInfraResponse []*Infra
- // GetProjectPolicyResponse is a struct that contains the response from a `GET projects/{project_id}/policy` request
- type GetProjectPolicyResponse []*PolicyDocument
- // ListProjectRolesResponse is a struct that contains the response from a `GET projects/{project_id}/roles` request
- type ListProjectRolesResponse []RoleKind
- // Collaborator is a struct defining a collaborator on a project
- type Collaborator struct {
- ID uint `json:"id"`
- Kind string `json:"kind"`
- UserID uint `json:"user_id"`
- Email string `json:"email"`
- ProjectID uint `json:"project_id"`
- }
- // ListCollaboratorsResponse is a struct that contains the response from a `GET projects/{project_id}/collaborators` request
- type ListCollaboratorsResponse []*Collaborator
- // UpdateRoleRequest is a struct that contains the information needed to make a `POST projects/{project_id}/roles` request
- type UpdateRoleRequest struct {
- UserID uint `json:"user_id,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 {
- *Role
- }
- // DeleteRoleRequest is a struct that contains the response from a `DELETE projects/{project_id}/roles` request
- type DeleteRoleRequest struct {
- 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 {
- *Role
- }
- // GetProjectBillingResponse is a struct that contains the response from a `GET projects/{project_id}/billing` request
- type GetProjectBillingResponse struct {
- HasBilling bool `json:"has_billing"`
- }
- // StepEnum is a type describing the current onboarding step
- type StepEnum string
- const (
- // StepConnectSource is a value describing the current onboarding step as `connect_source` (the first step)
- StepConnectSource StepEnum = "connect_source"
- // StepCleanUp is a value describing the current onboarding step as `clean_up` (the last step)
- StepCleanUp StepEnum = "clean_up"
- )
- // ConnectedSourceType describes the source of an onboarding
- type ConnectedSourceType string
- const (
- // ConnectedSourceTypeGithub is the github source
- ConnectedSourceTypeGithub = "github"
- // ConnectedSourceTypeDocker is the docker source
- ConnectedSourceTypeDocker = "docker"
- )
- // OnboardingData is an onboarding step
- type OnboardingData struct {
- CurrentStep StepEnum `json:"current_step"`
- ConnectedSource ConnectedSourceType `json:"connected_source"`
- SkipRegistryConnection bool `json:"skip_registry_connection"`
- SkipResourceProvision bool `json:"skip_resource_provision"`
- RegistryConnectionID uint `json:"registry_connection_id"`
- RegistryConnectionCredentialID uint `json:"registry_connection_credential_id"`
- RegistryConnectionProvider string `json:"registry_connection_provider"`
- RegistryInfraID uint `json:"registry_infra_id"`
- RegistryInfraCredentialID uint `json:"registry_infra_credential_id"`
- RegistryInfraProvider string `json:"registry_infra_provider"`
- ClusterInfraID uint `json:"cluster_infra_id"`
- ClusterInfraCredentialID uint `json:"cluster_infra_credential_id"`
- 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
- // UpdateOnboardingStepRequest is a struct that contains the information needed to make a `POST projects/{project_id}/onboarding_step` request
- type UpdateOnboardingStepRequest struct {
- Step string `json:"step" form:"required,max=255"`
- Provider string `json:"provider"`
- CloudProviderCredentialIdentifier string `json:"cloud_provider_credential_identifier"`
- AccountId string `json:"account_id"`
- CloudformationURL string `json:"cloudformation_url"`
- ErrorMessage string `json:"error_message"`
- LoginURL string `json:"login_url"`
- Region string `json:"region"`
- ClusterName string `json:"cluster_name"`
- // ExternalId used as a 'password' for the aws assume role chain to porter-manager role
- ExternalId string `json:"external_id"`
- }
- // UpdateProjectNameRequest takes in a name to rename projects
- type UpdateProjectNameRequest struct {
- Name string `json:"name" form:"required"`
- }
|