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

	if o == nil {
		return nil
	}

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

	id := s.ID.Hex()
	o.ID = &id
	if s.TCPFlags != nil {
		o.TCPFlags = s.TCPFlags
	}
	if s.Claims != nil {
		o.Claims = s.Claims
	}
	if s.DestinationIP != nil {
		o.DestinationIP = s.DestinationIP
	}
	if s.DestinationPort != nil {
		o.DestinationPort = s.DestinationPort
	}
	if s.DropReason != nil {
		o.DropReason = s.DropReason
	}
	if s.Encrypt != nil {
		o.Encrypt = s.Encrypt
	}
	if s.EnforcerID != nil {
		o.EnforcerID = s.EnforcerID
	}
	if s.EnforcerNamespace != nil {
		o.EnforcerNamespace = s.EnforcerNamespace
	}
	if s.Event != nil {
		o.Event = s.Event
	}
	if s.Length != nil {
		o.Length = s.Length
	}
	if s.Mark != nil {
		o.Mark = s.Mark
	}
	if s.MigrationsLog != nil {
		o.MigrationsLog = s.MigrationsLog
	}
	if s.Namespace != nil {
		o.Namespace = s.Namespace
	}
	if s.PacketID != nil {
		o.PacketID = s.PacketID
	}
	if s.Protocol != nil {
		o.Protocol = s.Protocol
	}
	if s.PuID != nil {
		o.PuID = s.PuID
	}
	if s.RawPacket != nil {
		o.RawPacket = s.RawPacket
	}
	if s.SourceIP != nil {
		o.SourceIP = s.SourceIP
	}
	if s.SourcePort != nil {
		o.SourcePort = s.SourcePort
	}
	if s.Timestamp != nil {
		o.Timestamp = s.Timestamp
	}
	if s.TriremePacket != nil {
		o.TriremePacket = s.TriremePacket
	}
	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 *SparsePacketReport) SetBSON(raw bson.Raw) error {
	if o == nil {
		return nil
	}
	s := &mongoAttributesSparsePacketReport{}
	if err := raw.Unmarshal(s); err != nil {
		return err
	}
	id := s.ID.Hex()
	o.ID = &id
	if s.TCPFlags != nil {
		o.TCPFlags = s.TCPFlags
	}
	if s.Claims != nil {
		o.Claims = s.Claims
	}
	if s.DestinationIP != nil {
		o.DestinationIP = s.DestinationIP
	}
	if s.DestinationPort != nil {
		o.DestinationPort = s.DestinationPort
	}
	if s.DropReason != nil {
		o.DropReason = s.DropReason
	}
	if s.Encrypt != nil {
		o.Encrypt = s.Encrypt
	}
	if s.EnforcerID != nil {
		o.EnforcerID = s.EnforcerID
	}
	if s.EnforcerNamespace != nil {
		o.EnforcerNamespace = s.EnforcerNamespace
	}
	if s.Event != nil {
		o.Event = s.Event
	}
	if s.Length != nil {
		o.Length = s.Length
	}
	if s.Mark != nil {
		o.Mark = s.Mark
	}
	if s.MigrationsLog != nil {
		o.MigrationsLog = s.MigrationsLog
	}
	if s.Namespace != nil {
		o.Namespace = s.Namespace
	}
	if s.PacketID != nil {
		o.PacketID = s.PacketID
	}
	if s.Protocol != nil {
		o.Protocol = s.Protocol
	}
	if s.PuID != nil {
		o.PuID = s.PuID
	}
	if s.RawPacket != nil {
		o.RawPacket = s.RawPacket
	}
	if s.SourceIP != nil {
		o.SourceIP = s.SourceIP
	}
	if s.SourcePort != nil {
		o.SourcePort = s.SourcePort
	}
	if s.Timestamp != nil {
		o.Timestamp = s.Timestamp
	}
	if s.TriremePacket != nil {
		o.TriremePacket = s.TriremePacket
	}
	if s.ZHash != nil {
		o.ZHash = s.ZHash
	}
	if s.Zone != nil {
		o.Zone = s.Zone
	}
	return nil
}
func ( o * SparsePacketReport ) SetBSON ( raw bson . Raw ) error { if o == nil { return nil } s := & mongoAttributesSparsePacketReport { } if err := raw . Unmarshal ( s ) ; err != nil { return err } id := s . ID . Hex ( ) o . ID = & id if s . TCPFlags != nil { o . TCPFlags = s . TCPFlags } if s . Claims != nil { o . Claims = s . Claims } if s . DestinationIP != nil { o . DestinationIP = s . DestinationIP } if s . DestinationPort != nil { o . DestinationPort = s . DestinationPort } if s . DropReason != nil { o . DropReason = s . DropReason } if s . Encrypt != nil { o . Encrypt = s . Encrypt } if s . EnforcerID != nil { o . EnforcerID = s . EnforcerID } if s . EnforcerNamespace != nil { o . EnforcerNamespace = s . EnforcerNamespace } if s . Event != nil { o . Event = s . Event } if s . Length != nil { o . Length = s . Length } if s . Mark != nil { o . Mark = s . Mark } if s . MigrationsLog != nil { o . MigrationsLog = s . MigrationsLog } if s . Namespace != nil { o . Namespace = s . Namespace } if s . PacketID != nil { o . PacketID = s . PacketID } if s . Protocol != nil { o . Protocol = s . Protocol } if s . PuID != nil { o . PuID = s . PuID } if s . RawPacket != nil { o . RawPacket = s . RawPacket } if s . SourceIP != nil { o . SourceIP = s . SourceIP } if s . SourcePort != nil { o . SourcePort = s . SourcePort } if s . Timestamp != nil { o . Timestamp = s . Timestamp } if s . TriremePacket != nil { o . TriremePacket = s . TriremePacket } 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 .