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

	if o == nil {
		return nil
	}

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

	o.ID = s.ID.Hex()
	o.Action = s.Action
	o.ActiveDuration = s.ActiveDuration
	o.ActiveSchedule = s.ActiveSchedule
	o.AllObjectTags = s.AllObjectTags
	o.AllSubjectTags = s.AllSubjectTags
	o.Annotations = s.Annotations
	o.AssociatedTags = s.AssociatedTags
	o.CreateIdempotencyKey = s.CreateIdempotencyKey
	o.CreateTime = s.CreateTime
	o.Description = s.Description
	o.Disabled = s.Disabled
	o.ExpirationTime = s.ExpirationTime
	o.Fallback = s.Fallback
	o.Metadata = s.Metadata
	o.MigrationsLog = s.MigrationsLog
	o.Name = s.Name
	o.Namespace = s.Namespace
	o.NormalizedTags = s.NormalizedTags
	o.Object = s.Object
	o.Propagate = s.Propagate
	o.PropagationHidden = s.PropagationHidden
	o.Protected = s.Protected
	o.Relation = s.Relation
	o.Subject = s.Subject
	o.Type = s.Type
	o.UpdateIdempotencyKey = s.UpdateIdempotencyKey
	o.UpdateTime = s.UpdateTime
	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 *Policy) SetBSON(raw bson.Raw) error {
	if o == nil {
		return nil
	}
	s := &mongoAttributesPolicy{}
	if err := raw.Unmarshal(s); err != nil {
		return err
	}
	o.ID = s.ID.Hex()
	o.Action = s.Action
	o.ActiveDuration = s.ActiveDuration
	o.ActiveSchedule = s.ActiveSchedule
	o.AllObjectTags = s.AllObjectTags
	o.AllSubjectTags = s.AllSubjectTags
	o.Annotations = s.Annotations
	o.AssociatedTags = s.AssociatedTags
	o.CreateIdempotencyKey = s.CreateIdempotencyKey
	o.CreateTime = s.CreateTime
	o.Description = s.Description
	o.Disabled = s.Disabled
	o.ExpirationTime = s.ExpirationTime
	o.Fallback = s.Fallback
	o.Metadata = s.Metadata
	o.MigrationsLog = s.MigrationsLog
	o.Name = s.Name
	o.Namespace = s.Namespace
	o.NormalizedTags = s.NormalizedTags
	o.Object = s.Object
	o.Propagate = s.Propagate
	o.PropagationHidden = s.PropagationHidden
	o.Protected = s.Protected
	o.Relation = s.Relation
	o.Subject = s.Subject
	o.Type = s.Type
	o.UpdateIdempotencyKey = s.UpdateIdempotencyKey
	o.UpdateTime = s.UpdateTime
	o.ZHash = s.ZHash
	o.Zone = s.Zone
	return nil
}
func ( o * Policy ) SetBSON ( raw bson . Raw ) error { if o == nil { return nil } s := & mongoAttributesPolicy { } if err := raw . Unmarshal ( s ) ; err != nil { return err } o . ID = s . ID . Hex ( ) o . Action = s . Action o . ActiveDuration = s . ActiveDuration o . ActiveSchedule = s . ActiveSchedule o . AllObjectTags = s . AllObjectTags o . AllSubjectTags = s . AllSubjectTags o . Annotations = s . Annotations o . AssociatedTags = s . AssociatedTags o . CreateIdempotencyKey = s . CreateIdempotencyKey o . CreateTime = s . CreateTime o . Description = s . Description o . Disabled = s . Disabled o . ExpirationTime = s . ExpirationTime o . Fallback = s . Fallback o . Metadata = s . Metadata o . MigrationsLog = s . MigrationsLog o . Name = s . Name o . Namespace = s . Namespace o . NormalizedTags = s . NormalizedTags o . Object = s . Object o . Propagate = s . Propagate o . PropagationHidden = s . PropagationHidden o . Protected = s . Protected o . Relation = s . Relation o . Subject = s . Subject o . Type = s . Type o . UpdateIdempotencyKey = s . UpdateIdempotencyKey o . UpdateTime = s . UpdateTime o . ZHash = s . ZHash o . Zone = s . Zone return nil }
SetBSON implements the bson marshaling interface.
SetBSON implements the bson marshaling interface .