func (o *SparseAuthority) GetBSON() (interface{}, error) {

	if o == nil {
		return nil, nil
	}

	s := &mongoAttributesSparseAuthority{}

	if o.ID != nil {
		s.ID = bson.ObjectIdHex(*o.ID)
	}
	if o.Algorithm != nil {
		s.Algorithm = o.Algorithm
	}
	if o.Certificate != nil {
		s.Certificate = o.Certificate
	}
	if o.CommonName != nil {
		s.CommonName = o.CommonName
	}
	if o.ExpirationDate != nil {
		s.ExpirationDate = o.ExpirationDate
	}
	if o.Key != nil {
		s.Key = o.Key
	}
	if o.MigrationsLog != nil {
		s.MigrationsLog = o.MigrationsLog
	}
	if o.Organization != nil {
		s.Organization = o.Organization
	}
	if o.SerialNumber != nil {
		s.SerialNumber = o.SerialNumber
	}
	if o.Type != nil {
		s.Type = o.Type
	}
	if o.ZHash != nil {
		s.ZHash = o.ZHash
	}
	if o.Zone != nil {
		s.Zone = o.Zone
	}

	return s, nil
}
// GetBSON implements the bson marshaling interface.
// This is used to transparently convert ID to MongoDBID as ObectID.
GetBSON implements the bson marshaling interface.
This is used to transparently convert ID to MongoDBID as ObectID.
// GetBSON implements the bson marshaling interface . // This is used to transparently convert ID to MongoDBID as ObectID .
func (o *SparseAuthority) GetBSON() (interface{}, error) {
	if o == nil {
		return nil, nil
	}
	s := &mongoAttributesSparseAuthority{}
	if o.ID != nil {
		s.ID = bson.ObjectIdHex(*o.ID)
	}
	if o.Algorithm != nil {
		s.Algorithm = o.Algorithm
	}
	if o.Certificate != nil {
		s.Certificate = o.Certificate
	}
	if o.CommonName != nil {
		s.CommonName = o.CommonName
	}
	if o.ExpirationDate != nil {
		s.ExpirationDate = o.ExpirationDate
	}
	if o.Key != nil {
		s.Key = o.Key
	}
	if o.MigrationsLog != nil {
		s.MigrationsLog = o.MigrationsLog
	}
	if o.Organization != nil {
		s.Organization = o.Organization
	}
	if o.SerialNumber != nil {
		s.SerialNumber = o.SerialNumber
	}
	if o.Type != nil {
		s.Type = o.Type
	}
	if o.ZHash != nil {
		s.ZHash = o.ZHash
	}
	if o.Zone != nil {
		s.Zone = o.Zone
	}
	return s, nil
}
func ( o * SparseAuthority ) GetBSON ( ) ( interface { } , error ) { if o == nil { return nil , nil } s := & mongoAttributesSparseAuthority { } if o . ID != nil { s . ID = bson . ObjectIdHex ( * o . ID ) } if o . Algorithm != nil { s . Algorithm = o . Algorithm } if o . Certificate != nil { s . Certificate = o . Certificate } if o . CommonName != nil { s . CommonName = o . CommonName } if o . ExpirationDate != nil { s . ExpirationDate = o . ExpirationDate } if o . Key != nil { s . Key = o . Key } if o . MigrationsLog != nil { s . MigrationsLog = o . MigrationsLog } if o . Organization != nil { s . Organization = o . Organization } if o . SerialNumber != nil { s . SerialNumber = o . SerialNumber } if o . Type != nil { s . Type = o . Type } if o . ZHash != nil { s . ZHash = o . ZHash } if o . Zone != nil { s . Zone = o . Zone } return s , nil }
GetBSON implements the bson marshaling interface.
GetBSON implements the bson marshaling interface .