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

	if o == nil {
		return nil, nil
	}

	s := &mongoAttributesSparsePolicy{}

	if o.ID != nil {
		s.ID = bson.ObjectIdHex(*o.ID)
	}
	if o.Action != nil {
		s.Action = o.Action
	}
	if o.ActiveDuration != nil {
		s.ActiveDuration = o.ActiveDuration
	}
	if o.ActiveSchedule != nil {
		s.ActiveSchedule = o.ActiveSchedule
	}
	if o.AllObjectTags != nil {
		s.AllObjectTags = o.AllObjectTags
	}
	if o.AllSubjectTags != nil {
		s.AllSubjectTags = o.AllSubjectTags
	}
	if o.Annotations != nil {
		s.Annotations = o.Annotations
	}
	if o.AssociatedTags != nil {
		s.AssociatedTags = o.AssociatedTags
	}
	if o.CreateIdempotencyKey != nil {
		s.CreateIdempotencyKey = o.CreateIdempotencyKey
	}
	if o.CreateTime != nil {
		s.CreateTime = o.CreateTime
	}
	if o.Description != nil {
		s.Description = o.Description
	}
	if o.Disabled != nil {
		s.Disabled = o.Disabled
	}
	if o.ExpirationTime != nil {
		s.ExpirationTime = o.ExpirationTime
	}
	if o.Fallback != nil {
		s.Fallback = o.Fallback
	}
	if o.Metadata != nil {
		s.Metadata = o.Metadata
	}
	if o.MigrationsLog != nil {
		s.MigrationsLog = o.MigrationsLog
	}
	if o.Name != nil {
		s.Name = o.Name
	}
	if o.Namespace != nil {
		s.Namespace = o.Namespace
	}
	if o.NormalizedTags != nil {
		s.NormalizedTags = o.NormalizedTags
	}
	if o.Object != nil {
		s.Object = o.Object
	}
	if o.Propagate != nil {
		s.Propagate = o.Propagate
	}
	if o.PropagationHidden != nil {
		s.PropagationHidden = o.PropagationHidden
	}
	if o.Protected != nil {
		s.Protected = o.Protected
	}
	if o.Relation != nil {
		s.Relation = o.Relation
	}
	if o.Subject != nil {
		s.Subject = o.Subject
	}
	if o.Type != nil {
		s.Type = o.Type
	}
	if o.UpdateIdempotencyKey != nil {
		s.UpdateIdempotencyKey = o.UpdateIdempotencyKey
	}
	if o.UpdateTime != nil {
		s.UpdateTime = o.UpdateTime
	}
	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 *SparsePolicy) GetBSON() (interface{}, error) {
	if o == nil {
		return nil, nil
	}
	s := &mongoAttributesSparsePolicy{}
	if o.ID != nil {
		s.ID = bson.ObjectIdHex(*o.ID)
	}
	if o.Action != nil {
		s.Action = o.Action
	}
	if o.ActiveDuration != nil {
		s.ActiveDuration = o.ActiveDuration
	}
	if o.ActiveSchedule != nil {
		s.ActiveSchedule = o.ActiveSchedule
	}
	if o.AllObjectTags != nil {
		s.AllObjectTags = o.AllObjectTags
	}
	if o.AllSubjectTags != nil {
		s.AllSubjectTags = o.AllSubjectTags
	}
	if o.Annotations != nil {
		s.Annotations = o.Annotations
	}
	if o.AssociatedTags != nil {
		s.AssociatedTags = o.AssociatedTags
	}
	if o.CreateIdempotencyKey != nil {
		s.CreateIdempotencyKey = o.CreateIdempotencyKey
	}
	if o.CreateTime != nil {
		s.CreateTime = o.CreateTime
	}
	if o.Description != nil {
		s.Description = o.Description
	}
	if o.Disabled != nil {
		s.Disabled = o.Disabled
	}
	if o.ExpirationTime != nil {
		s.ExpirationTime = o.ExpirationTime
	}
	if o.Fallback != nil {
		s.Fallback = o.Fallback
	}
	if o.Metadata != nil {
		s.Metadata = o.Metadata
	}
	if o.MigrationsLog != nil {
		s.MigrationsLog = o.MigrationsLog
	}
	if o.Name != nil {
		s.Name = o.Name
	}
	if o.Namespace != nil {
		s.Namespace = o.Namespace
	}
	if o.NormalizedTags != nil {
		s.NormalizedTags = o.NormalizedTags
	}
	if o.Object != nil {
		s.Object = o.Object
	}
	if o.Propagate != nil {
		s.Propagate = o.Propagate
	}
	if o.PropagationHidden != nil {
		s.PropagationHidden = o.PropagationHidden
	}
	if o.Protected != nil {
		s.Protected = o.Protected
	}
	if o.Relation != nil {
		s.Relation = o.Relation
	}
	if o.Subject != nil {
		s.Subject = o.Subject
	}
	if o.Type != nil {
		s.Type = o.Type
	}
	if o.UpdateIdempotencyKey != nil {
		s.UpdateIdempotencyKey = o.UpdateIdempotencyKey
	}
	if o.UpdateTime != nil {
		s.UpdateTime = o.UpdateTime
	}
	if o.ZHash != nil {
		s.ZHash = o.ZHash
	}
	if o.Zone != nil {
		s.Zone = o.Zone
	}
	return s, nil
}
func ( o * SparsePolicy ) GetBSON ( ) ( interface { } , error ) { if o == nil { return nil , nil } s := & mongoAttributesSparsePolicy { } if o . ID != nil { s . ID = bson . ObjectIdHex ( * o . ID ) } if o . Action != nil { s . Action = o . Action } if o . ActiveDuration != nil { s . ActiveDuration = o . ActiveDuration } if o . ActiveSchedule != nil { s . ActiveSchedule = o . ActiveSchedule } if o . AllObjectTags != nil { s . AllObjectTags = o . AllObjectTags } if o . AllSubjectTags != nil { s . AllSubjectTags = o . AllSubjectTags } if o . Annotations != nil { s . Annotations = o . Annotations } if o . AssociatedTags != nil { s . AssociatedTags = o . AssociatedTags } if o . CreateIdempotencyKey != nil { s . CreateIdempotencyKey = o . CreateIdempotencyKey } if o . CreateTime != nil { s . CreateTime = o . CreateTime } if o . Description != nil { s . Description = o . Description } if o . Disabled != nil { s . Disabled = o . Disabled } if o . ExpirationTime != nil { s . ExpirationTime = o . ExpirationTime } if o . Fallback != nil { s . Fallback = o . Fallback } if o . Metadata != nil { s . Metadata = o . Metadata } if o . MigrationsLog != nil { s . MigrationsLog = o . MigrationsLog } if o . Name != nil { s . Name = o . Name } if o . Namespace != nil { s . Namespace = o . Namespace } if o . NormalizedTags != nil { s . NormalizedTags = o . NormalizedTags } if o . Object != nil { s . Object = o . Object } if o . Propagate != nil { s . Propagate = o . Propagate } if o . PropagationHidden != nil { s . PropagationHidden = o . PropagationHidden } if o . Protected != nil { s . Protected = o . Protected } if o . Relation != nil { s . Relation = o . Relation } if o . Subject != nil { s . Subject = o . Subject } if o . Type != nil { s . Type = o . Type } if o . UpdateIdempotencyKey != nil { s . UpdateIdempotencyKey = o . UpdateIdempotencyKey } if o . UpdateTime != nil { s . UpdateTime = o . UpdateTime } 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 .