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

	if o == nil {
		return nil
	}

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

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