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

	if o == nil {
		return nil
	}

	s := &mongoAttributesSparseMessage{}
	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.AssociatedTags != nil {
		o.AssociatedTags = s.AssociatedTags
	}
	if s.CreateIdempotencyKey != nil {
		o.CreateIdempotencyKey = s.CreateIdempotencyKey
	}
	if s.CreateTime != nil {
		o.CreateTime = s.CreateTime
	}
	if s.Description != nil {
		o.Description = s.Description
	}
	if s.ExpirationTime != nil {
		o.ExpirationTime = s.ExpirationTime
	}
	if s.Level != nil {
		o.Level = s.Level
	}
	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.NormalizedTags != nil {
		o.NormalizedTags = s.NormalizedTags
	}
	if s.Propagate != nil {
		o.Propagate = s.Propagate
	}
	if s.Protected != nil {
		o.Protected = s.Protected
	}
	if s.UpdateIdempotencyKey != nil {
		o.UpdateIdempotencyKey = s.UpdateIdempotencyKey
	}
	if s.UpdateTime != nil {
		o.UpdateTime = s.UpdateTime
	}
	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 *SparseMessage) SetBSON(raw bson.Raw) error {
	if o == nil {
		return nil
	}
	s := &mongoAttributesSparseMessage{}
	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.AssociatedTags != nil {
		o.AssociatedTags = s.AssociatedTags
	}
	if s.CreateIdempotencyKey != nil {
		o.CreateIdempotencyKey = s.CreateIdempotencyKey
	}
	if s.CreateTime != nil {
		o.CreateTime = s.CreateTime
	}
	if s.Description != nil {
		o.Description = s.Description
	}
	if s.ExpirationTime != nil {
		o.ExpirationTime = s.ExpirationTime
	}
	if s.Level != nil {
		o.Level = s.Level
	}
	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.NormalizedTags != nil {
		o.NormalizedTags = s.NormalizedTags
	}
	if s.Propagate != nil {
		o.Propagate = s.Propagate
	}
	if s.Protected != nil {
		o.Protected = s.Protected
	}
	if s.UpdateIdempotencyKey != nil {
		o.UpdateIdempotencyKey = s.UpdateIdempotencyKey
	}
	if s.UpdateTime != nil {
		o.UpdateTime = s.UpdateTime
	}
	if s.ZHash != nil {
		o.ZHash = s.ZHash
	}
	if s.Zone != nil {
		o.Zone = s.Zone
	}
	return nil
}
func ( o * SparseMessage ) SetBSON ( raw bson . Raw ) error { if o == nil { return nil } s := & mongoAttributesSparseMessage { } 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 . AssociatedTags != nil { o . AssociatedTags = s . AssociatedTags } if s . CreateIdempotencyKey != nil { o . CreateIdempotencyKey = s . CreateIdempotencyKey } if s . CreateTime != nil { o . CreateTime = s . CreateTime } if s . Description != nil { o . Description = s . Description } if s . ExpirationTime != nil { o . ExpirationTime = s . ExpirationTime } if s . Level != nil { o . Level = s . Level } 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 . NormalizedTags != nil { o . NormalizedTags = s . NormalizedTags } if s . Propagate != nil { o . Propagate = s . Propagate } if s . Protected != nil { o . Protected = s . Protected } if s . UpdateIdempotencyKey != nil { o . UpdateIdempotencyKey = s . UpdateIdempotencyKey } if s . UpdateTime != nil { o . UpdateTime = s . UpdateTime } 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 .