A question refers to the comment ! And if not Ooopsy
This commit is contained in:
		@@ -9,12 +9,13 @@ import (
 | 
			
		||||
	"github.com/google/uuid"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Workspace is a struct that represents a workspace
 | 
			
		||||
type Workspace struct {
 | 
			
		||||
	utils.AbstractObject
 | 
			
		||||
	resources.ResourceSet
 | 
			
		||||
	IsContextual bool   `json:"is_contextual" bson:"is_contextual" default:"false"`
 | 
			
		||||
	Active       bool   `json:"active" bson:"active" default:"false"`
 | 
			
		||||
	Shared       string `json:"shared,omitempty" bson:"shared,omitempty"`
 | 
			
		||||
	utils.AbstractObject         // AbstractObject contains the basic fields of an object (id, name)
 | 
			
		||||
	resources.ResourceSet        // ResourceSet contains the resources of the workspace (data, datacenter, processing, storage, workflow)
 | 
			
		||||
	IsContextual          bool   `json:"is_contextual" bson:"is_contextual" default:"false"` // IsContextual is a flag that indicates if the workspace is contextual
 | 
			
		||||
	Active                bool   `json:"active" bson:"active" default:"false"`               // Active is a flag that indicates if the workspace is active
 | 
			
		||||
	Shared                string `json:"shared,omitempty" bson:"shared,omitempty"`           // Shared is the ID of the shared workspace
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (ao *Workspace) GetID() string {
 | 
			
		||||
@@ -32,11 +33,12 @@ func (d *Workspace) GetName() string {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (d *Workspace) GetAccessor(caller *tools.HTTPCaller) utils.Accessor {
 | 
			
		||||
	data := New()
 | 
			
		||||
	data.Init(utils.WORKSPACE, caller)
 | 
			
		||||
	data := New()                      // Create a new instance of the accessor
 | 
			
		||||
	data.Init(utils.WORKSPACE, caller) // Initialize the accessor with the WORKSPACE model type
 | 
			
		||||
	return data
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// New creates a new instance of the workspaceMongoAccessor from a map
 | 
			
		||||
func (dma *Workspace) Deserialize(j map[string]interface{}) utils.DBObject {
 | 
			
		||||
	b, err := json.Marshal(j)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
@@ -46,6 +48,7 @@ func (dma *Workspace) Deserialize(j map[string]interface{}) utils.DBObject {
 | 
			
		||||
	return dma
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Serialize returns the workspaceMongoAccessor as a map
 | 
			
		||||
func (dma *Workspace) Serialize() map[string]interface{} {
 | 
			
		||||
	var m map[string]interface{}
 | 
			
		||||
	b, err := json.Marshal(dma)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user