github.com/kyma-incubator/compass/components/director@v0.0.0-20230623144113-d764f56ff805/internal/model/formation.go (about) 1 package model 2 3 import ( 4 "encoding/json" 5 6 "github.com/kyma-incubator/compass/components/director/pkg/pagination" 7 ) 8 9 // DefaultTemplateName will be used as default formation template name if no other options are provided 10 const DefaultTemplateName = "Side-by-Side Extensibility with Kyma" 11 12 // FormationState represents the possible states a formation can be in 13 type FormationState string 14 15 const ( 16 // InitialFormationState indicates that nothing has been done with the formation 17 InitialFormationState FormationState = "INITIAL" 18 // ReadyFormationState indicates that the formation is in a ready state 19 ReadyFormationState FormationState = "READY" 20 // CreateErrorFormationState indicates that an error occurred during the creation of the formation 21 CreateErrorFormationState FormationState = "CREATE_ERROR" 22 // DeleteErrorFormationState indicates that an error occurred during the deletion of the formation 23 DeleteErrorFormationState FormationState = "DELETE_ERROR" 24 // DeletingFormationState indicates that the formation is in deleting state 25 DeletingFormationState FormationState = "DELETING" 26 ) 27 28 // FormationOperation defines the kind of operation done on a given formation 29 type FormationOperation string 30 31 const ( 32 // AssignFormation represents the assign operation done on a given formation 33 AssignFormation FormationOperation = "assign" 34 // UnassignFormation represents the unassign operation done on a given formation 35 UnassignFormation FormationOperation = "unassign" 36 // CreateFormation represents the create operation on a given formation 37 CreateFormation FormationOperation = "createFormation" 38 // DeleteFormation represents the delete operation on a given formation 39 DeleteFormation FormationOperation = "deleteFormation" 40 ) 41 42 // Formation missing godoc 43 type Formation struct { 44 ID string 45 TenantID string 46 FormationTemplateID string 47 Name string 48 State FormationState 49 Error json.RawMessage 50 } 51 52 // FormationPage contains Formation data with page info 53 type FormationPage struct { 54 Data []*Formation 55 PageInfo *pagination.Page 56 TotalCount int 57 }