func (o *SparseProcessingUnit) SetBSON(raw bson.Raw) error {

	if o == nil {
		return nil
	}

	s := &mongoAttributesSparseProcessingUnit{}
	if err := raw.Unmarshal(s); err != nil {
		return err
	}

	id := s.ID.Hex()
	o.ID = &id
	if s.Annotations != nil {
		o.Annotations = s.Annotations
	}
	if s.Archived != nil {
		o.Archived = s.Archived
	}
	if s.AssociatedTags != nil {
		o.AssociatedTags = s.AssociatedTags
	}
	if s.ClientLocalID != nil {
		o.ClientLocalID = s.ClientLocalID
	}
	if s.CollectInfo != nil {
		o.CollectInfo = s.CollectInfo
	}
	if s.CollectedInfo != nil {
		o.CollectedInfo = s.CollectedInfo
	}
	if s.Controller != nil {
		o.Controller = s.Controller
	}
	if s.CreateIdempotencyKey != nil {
		o.CreateIdempotencyKey = s.CreateIdempotencyKey
	}
	if s.CreateTime != nil {
		o.CreateTime = s.CreateTime
	}
	if s.DatapathType != nil {
		o.DatapathType = s.DatapathType
	}
	if s.Description != nil {
		o.Description = s.Description
	}
	if s.EnforcementStatus != nil {
		o.EnforcementStatus = s.EnforcementStatus
	}
	if s.EnforcerID != nil {
		o.EnforcerID = s.EnforcerID
	}
	if s.EnforcerNamespace != nil {
		o.EnforcerNamespace = s.EnforcerNamespace
	}
	if s.Images != nil {
		o.Images = s.Images
	}
	if s.LastCollectionTime != nil {
		o.LastCollectionTime = s.LastCollectionTime
	}
	if s.LastSyncTime != nil {
		o.LastSyncTime = s.LastSyncTime
	}
	if s.Metadata != nil {
		o.Metadata = s.Metadata
	}
	if s.MigrationsLog != nil {
		o.MigrationsLog = s.MigrationsLog
	}
	if s.Name != nil {
		o.Name = s.Name
	}
	if s.Namespace != nil {
		o.Namespace = s.Namespace
	}
	if s.NativeContextID != nil {
		o.NativeContextID = s.NativeContextID
	}
	if s.NetworkServices != nil {
		o.NetworkServices = s.NetworkServices
	}
	if s.NormalizedTags != nil {
		o.NormalizedTags = s.NormalizedTags
	}
	if s.OperationalStatus != nil {
		o.OperationalStatus = s.OperationalStatus
	}
	if s.Protected != nil {
		o.Protected = s.Protected
	}
	if s.Type != nil {
		o.Type = s.Type
	}
	if s.UpdateIdempotencyKey != nil {
		o.UpdateIdempotencyKey = s.UpdateIdempotencyKey
	}
	if s.UpdateTime != nil {
		o.UpdateTime = s.UpdateTime
	}
	if s.Vulnerabilities != nil {
		o.Vulnerabilities = s.Vulnerabilities
	}
	if s.VulnerabilityLevel != nil {
		o.VulnerabilityLevel = s.VulnerabilityLevel
	}
	if s.ZHash != nil {
		o.ZHash = s.ZHash
	}
	if s.Zone != nil {
		o.Zone = s.Zone
	}

	return nil
}
// SetBSON implements the bson marshaling interface.
// This is used to transparently convert ID to MongoDBID as ObectID.
SetBSON implements the bson marshaling interface.
This is used to transparently convert ID to MongoDBID as ObectID.
// SetBSON implements the bson marshaling interface . // This is used to transparently convert ID to MongoDBID as ObectID .
func (o *SparseProcessingUnit) SetBSON(raw bson.Raw) error {
	if o == nil {
		return nil
	}
	s := &mongoAttributesSparseProcessingUnit{}
	if err := raw.Unmarshal(s); err != nil {
		return err
	}
	id := s.ID.Hex()
	o.ID = &id
	if s.Annotations != nil {
		o.Annotations = s.Annotations
	}
	if s.Archived != nil {
		o.Archived = s.Archived
	}
	if s.AssociatedTags != nil {
		o.AssociatedTags = s.AssociatedTags
	}
	if s.ClientLocalID != nil {
		o.ClientLocalID = s.ClientLocalID
	}
	if s.CollectInfo != nil {
		o.CollectInfo = s.CollectInfo
	}
	if s.CollectedInfo != nil {
		o.CollectedInfo = s.CollectedInfo
	}
	if s.Controller != nil {
		o.Controller = s.Controller
	}
	if s.CreateIdempotencyKey != nil {
		o.CreateIdempotencyKey = s.CreateIdempotencyKey
	}
	if s.CreateTime != nil {
		o.CreateTime = s.CreateTime
	}
	if s.DatapathType != nil {
		o.DatapathType = s.DatapathType
	}
	if s.Description != nil {
		o.Description = s.Description
	}
	if s.EnforcementStatus != nil {
		o.EnforcementStatus = s.EnforcementStatus
	}
	if s.EnforcerID != nil {
		o.EnforcerID = s.EnforcerID
	}
	if s.EnforcerNamespace != nil {
		o.EnforcerNamespace = s.EnforcerNamespace
	}
	if s.Images != nil {
		o.Images = s.Images
	}
	if s.LastCollectionTime != nil {
		o.LastCollectionTime = s.LastCollectionTime
	}
	if s.LastSyncTime != nil {
		o.LastSyncTime = s.LastSyncTime
	}
	if s.Metadata != nil {
		o.Metadata = s.Metadata
	}
	if s.MigrationsLog != nil {
		o.MigrationsLog = s.MigrationsLog
	}
	if s.Name != nil {
		o.Name = s.Name
	}
	if s.Namespace != nil {
		o.Namespace = s.Namespace
	}
	if s.NativeContextID != nil {
		o.NativeContextID = s.NativeContextID
	}
	if s.NetworkServices != nil {
		o.NetworkServices = s.NetworkServices
	}
	if s.NormalizedTags != nil {
		o.NormalizedTags = s.NormalizedTags
	}
	if s.OperationalStatus != nil {
		o.OperationalStatus = s.OperationalStatus
	}
	if s.Protected != nil {
		o.Protected = s.Protected
	}
	if s.Type != nil {
		o.Type = s.Type
	}
	if s.UpdateIdempotencyKey != nil {
		o.UpdateIdempotencyKey = s.UpdateIdempotencyKey
	}
	if s.UpdateTime != nil {
		o.UpdateTime = s.UpdateTime
	}
	if s.Vulnerabilities != nil {
		o.Vulnerabilities = s.Vulnerabilities
	}
	if s.VulnerabilityLevel != nil {
		o.VulnerabilityLevel = s.VulnerabilityLevel
	}
	if s.ZHash != nil {
		o.ZHash = s.ZHash
	}
	if s.Zone != nil {
		o.Zone = s.Zone
	}
	return nil
}
func ( o * SparseProcessingUnit ) SetBSON ( raw bson . Raw ) error { if o == nil { return nil } s := & mongoAttributesSparseProcessingUnit { } if err := raw . Unmarshal ( s ) ; err != nil { return err } id := s . ID . Hex ( ) o . ID = & id if s . Annotations != nil { o . Annotations = s . Annotations } if s . Archived != nil { o . Archived = s . Archived } if s . AssociatedTags != nil { o . AssociatedTags = s . AssociatedTags } if s . ClientLocalID != nil { o . ClientLocalID = s . ClientLocalID } if s . CollectInfo != nil { o . CollectInfo = s . CollectInfo } if s . CollectedInfo != nil { o . CollectedInfo = s . CollectedInfo } if s . Controller != nil { o . Controller = s . Controller } if s . CreateIdempotencyKey != nil { o . CreateIdempotencyKey = s . CreateIdempotencyKey } if s . CreateTime != nil { o . CreateTime = s . CreateTime } if s . DatapathType != nil { o . DatapathType = s . DatapathType } if s . Description != nil { o . Description = s . Description } if s . EnforcementStatus != nil { o . EnforcementStatus = s . EnforcementStatus } if s . EnforcerID != nil { o . EnforcerID = s . EnforcerID } if s . EnforcerNamespace != nil { o . EnforcerNamespace = s . EnforcerNamespace } if s . Images != nil { o . Images = s . Images } if s . LastCollectionTime != nil { o . LastCollectionTime = s . LastCollectionTime } if s . LastSyncTime != nil { o . LastSyncTime = s . LastSyncTime } if s . Metadata != nil { o . Metadata = s . Metadata } if s . MigrationsLog != nil { o . MigrationsLog = s . MigrationsLog } if s . Name != nil { o . Name = s . Name } if s . Namespace != nil { o . Namespace = s . Namespace } if s . NativeContextID != nil { o . NativeContextID = s . NativeContextID } if s . NetworkServices != nil { o . NetworkServices = s . NetworkServices } if s . NormalizedTags != nil { o . NormalizedTags = s . NormalizedTags } if s . OperationalStatus != nil { o . OperationalStatus = s . OperationalStatus } if s . Protected != nil { o . Protected = s . Protected } if s . Type != nil { o . Type = s . Type } if s . UpdateIdempotencyKey != nil { o . UpdateIdempotencyKey = s . UpdateIdempotencyKey } if s . UpdateTime != nil { o . UpdateTime = s . UpdateTime } if s . Vulnerabilities != nil { o . Vulnerabilities = s . Vulnerabilities } if s . VulnerabilityLevel != nil { o . VulnerabilityLevel = s . VulnerabilityLevel } if s . ZHash != nil { o . ZHash = s . ZHash } if s . Zone != nil { o . Zone = s . Zone } return nil }
SetBSON implements the bson marshaling interface.
SetBSON implements the bson marshaling interface .