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

	if o == nil {
		return nil
	}

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

	id := s.ID.Hex()
	o.ID = &id
	if s.Algorithm != nil {
		o.Algorithm = s.Algorithm
	}
	if s.Certificate != nil {
		o.Certificate = s.Certificate
	}
	if s.CommonName != nil {
		o.CommonName = s.CommonName
	}
	if s.ExpirationDate != nil {
		o.ExpirationDate = s.ExpirationDate
	}
	if s.Key != nil {
		o.Key = s.Key
	}
	if s.MigrationsLog != nil {
		o.MigrationsLog = s.MigrationsLog
	}
	if s.Organization != nil {
		o.Organization = s.Organization
	}
	if s.SerialNumber != nil {
		o.SerialNumber = s.SerialNumber
	}
	if s.Type != nil {
		o.Type = s.Type
	}
	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 *SparseAuthority) SetBSON(raw bson.Raw) error {
	if o == nil {
		return nil
	}
	s := &mongoAttributesSparseAuthority{}
	if err := raw.Unmarshal(s); err != nil {
		return err
	}
	id := s.ID.Hex()
	o.ID = &id
	if s.Algorithm != nil {
		o.Algorithm = s.Algorithm
	}
	if s.Certificate != nil {
		o.Certificate = s.Certificate
	}
	if s.CommonName != nil {
		o.CommonName = s.CommonName
	}
	if s.ExpirationDate != nil {
		o.ExpirationDate = s.ExpirationDate
	}
	if s.Key != nil {
		o.Key = s.Key
	}
	if s.MigrationsLog != nil {
		o.MigrationsLog = s.MigrationsLog
	}
	if s.Organization != nil {
		o.Organization = s.Organization
	}
	if s.SerialNumber != nil {
		o.SerialNumber = s.SerialNumber
	}
	if s.Type != nil {
		o.Type = s.Type
	}
	if s.ZHash != nil {
		o.ZHash = s.ZHash
	}
	if s.Zone != nil {
		o.Zone = s.Zone
	}
	return nil
}
func ( o * SparseAuthority ) SetBSON ( raw bson . Raw ) error { if o == nil { return nil } s := & mongoAttributesSparseAuthority { } if err := raw . Unmarshal ( s ) ; err != nil { return err } id := s . ID . Hex ( ) o . ID = & id if s . Algorithm != nil { o . Algorithm = s . Algorithm } if s . Certificate != nil { o . Certificate = s . Certificate } if s . CommonName != nil { o . CommonName = s . CommonName } if s . ExpirationDate != nil { o . ExpirationDate = s . ExpirationDate } if s . Key != nil { o . Key = s . Key } if s . MigrationsLog != nil { o . MigrationsLog = s . MigrationsLog } if s . Organization != nil { o . Organization = s . Organization } if s . SerialNumber != nil { o . SerialNumber = s . SerialNumber } if s . Type != nil { o . Type = s . Type } 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 .