func (o *Policy) ToSparse(fields ...string) elemental.SparseIdentifiable {

	if len(fields) == 0 {
		// nolint: goimports
		return &SparsePolicy{
			ID:                   &o.ID,
			Action:               &o.Action,
			ActiveDuration:       &o.ActiveDuration,
			ActiveSchedule:       &o.ActiveSchedule,
			AllObjectTags:        &o.AllObjectTags,
			AllSubjectTags:       &o.AllSubjectTags,
			Annotations:          &o.Annotations,
			AssociatedTags:       &o.AssociatedTags,
			CreateIdempotencyKey: &o.CreateIdempotencyKey,
			CreateTime:           &o.CreateTime,
			Description:          &o.Description,
			Disabled:             &o.Disabled,
			ExpirationTime:       &o.ExpirationTime,
			Fallback:             &o.Fallback,
			Metadata:             &o.Metadata,
			MigrationsLog:        &o.MigrationsLog,
			Name:                 &o.Name,
			Namespace:            &o.Namespace,
			NormalizedTags:       &o.NormalizedTags,
			Object:               &o.Object,
			Propagate:            &o.Propagate,
			PropagationHidden:    &o.PropagationHidden,
			Protected:            &o.Protected,
			Relation:             &o.Relation,
			Subject:              &o.Subject,
			Type:                 &o.Type,
			UpdateIdempotencyKey: &o.UpdateIdempotencyKey,
			UpdateTime:           &o.UpdateTime,
			ZHash:                &o.ZHash,
			Zone:                 &o.Zone,
		}
	}

	sp := &SparsePolicy{}
	for _, f := range fields {
		switch f {
		case "ID":
			sp.ID = &(o.ID)
		case "action":
			sp.Action = &(o.Action)
		case "activeDuration":
			sp.ActiveDuration = &(o.ActiveDuration)
		case "activeSchedule":
			sp.ActiveSchedule = &(o.ActiveSchedule)
		case "allObjectTags":
			sp.AllObjectTags = &(o.AllObjectTags)
		case "allSubjectTags":
			sp.AllSubjectTags = &(o.AllSubjectTags)
		case "annotations":
			sp.Annotations = &(o.Annotations)
		case "associatedTags":
			sp.AssociatedTags = &(o.AssociatedTags)
		case "createIdempotencyKey":
			sp.CreateIdempotencyKey = &(o.CreateIdempotencyKey)
		case "createTime":
			sp.CreateTime = &(o.CreateTime)
		case "description":
			sp.Description = &(o.Description)
		case "disabled":
			sp.Disabled = &(o.Disabled)
		case "expirationTime":
			sp.ExpirationTime = &(o.ExpirationTime)
		case "fallback":
			sp.Fallback = &(o.Fallback)
		case "metadata":
			sp.Metadata = &(o.Metadata)
		case "migrationsLog":
			sp.MigrationsLog = &(o.MigrationsLog)
		case "name":
			sp.Name = &(o.Name)
		case "namespace":
			sp.Namespace = &(o.Namespace)
		case "normalizedTags":
			sp.NormalizedTags = &(o.NormalizedTags)
		case "object":
			sp.Object = &(o.Object)
		case "propagate":
			sp.Propagate = &(o.Propagate)
		case "propagationHidden":
			sp.PropagationHidden = &(o.PropagationHidden)
		case "protected":
			sp.Protected = &(o.Protected)
		case "relation":
			sp.Relation = &(o.Relation)
		case "subject":
			sp.Subject = &(o.Subject)
		case "type":
			sp.Type = &(o.Type)
		case "updateIdempotencyKey":
			sp.UpdateIdempotencyKey = &(o.UpdateIdempotencyKey)
		case "updateTime":
			sp.UpdateTime = &(o.UpdateTime)
		case "zHash":
			sp.ZHash = &(o.ZHash)
		case "zone":
			sp.Zone = &(o.Zone)
		}
	}

	return sp
}
// ToSparse returns the sparse version of the model.
// The returned object will only contain the given fields. No field means entire field set.
ToSparse returns the sparse version of the model.
The returned object will only contain the given fields. No field means entire field set.
// ToSparse returns the sparse version of the model . // The returned object will only contain the given fields . No field means entire field set .
func (o *Policy) ToSparse(fields ...string) elemental.SparseIdentifiable {
	if len(fields) == 0 {
		return &SparsePolicy{
			ID:                   &o.ID,
			Action:               &o.Action,
			ActiveDuration:       &o.ActiveDuration,
			ActiveSchedule:       &o.ActiveSchedule,
			AllObjectTags:        &o.AllObjectTags,
			AllSubjectTags:       &o.AllSubjectTags,
			Annotations:          &o.Annotations,
			AssociatedTags:       &o.AssociatedTags,
			CreateIdempotencyKey: &o.CreateIdempotencyKey,
			CreateTime:           &o.CreateTime,
			Description:          &o.Description,
			Disabled:             &o.Disabled,
			ExpirationTime:       &o.ExpirationTime,
			Fallback:             &o.Fallback,
			Metadata:             &o.Metadata,
			MigrationsLog:        &o.MigrationsLog,
			Name:                 &o.Name,
			Namespace:            &o.Namespace,
			NormalizedTags:       &o.NormalizedTags,
			Object:               &o.Object,
			Propagate:            &o.Propagate,
			PropagationHidden:    &o.PropagationHidden,
			Protected:            &o.Protected,
			Relation:             &o.Relation,
			Subject:              &o.Subject,
			Type:                 &o.Type,
			UpdateIdempotencyKey: &o.UpdateIdempotencyKey,
			UpdateTime:           &o.UpdateTime,
			ZHash:                &o.ZHash,
			Zone:                 &o.Zone,
		}
	}
	sp := &SparsePolicy{}
	for _, f := range fields {
		switch f {
		case "ID":
			sp.ID = &(o.ID)
		case "action":
			sp.Action = &(o.Action)
		case "activeDuration":
			sp.ActiveDuration = &(o.ActiveDuration)
		case "activeSchedule":
			sp.ActiveSchedule = &(o.ActiveSchedule)
		case "allObjectTags":
			sp.AllObjectTags = &(o.AllObjectTags)
		case "allSubjectTags":
			sp.AllSubjectTags = &(o.AllSubjectTags)
		case "annotations":
			sp.Annotations = &(o.Annotations)
		case "associatedTags":
			sp.AssociatedTags = &(o.AssociatedTags)
		case "createIdempotencyKey":
			sp.CreateIdempotencyKey = &(o.CreateIdempotencyKey)
		case "createTime":
			sp.CreateTime = &(o.CreateTime)
		case "description":
			sp.Description = &(o.Description)
		case "disabled":
			sp.Disabled = &(o.Disabled)
		case "expirationTime":
			sp.ExpirationTime = &(o.ExpirationTime)
		case "fallback":
			sp.Fallback = &(o.Fallback)
		case "metadata":
			sp.Metadata = &(o.Metadata)
		case "migrationsLog":
			sp.MigrationsLog = &(o.MigrationsLog)
		case "name":
			sp.Name = &(o.Name)
		case "namespace":
			sp.Namespace = &(o.Namespace)
		case "normalizedTags":
			sp.NormalizedTags = &(o.NormalizedTags)
		case "object":
			sp.Object = &(o.Object)
		case "propagate":
			sp.Propagate = &(o.Propagate)
		case "propagationHidden":
			sp.PropagationHidden = &(o.PropagationHidden)
		case "protected":
			sp.Protected = &(o.Protected)
		case "relation":
			sp.Relation = &(o.Relation)
		case "subject":
			sp.Subject = &(o.Subject)
		case "type":
			sp.Type = &(o.Type)
		case "updateIdempotencyKey":
			sp.UpdateIdempotencyKey = &(o.UpdateIdempotencyKey)
		case "updateTime":
			sp.UpdateTime = &(o.UpdateTime)
		case "zHash":
			sp.ZHash = &(o.ZHash)
		case "zone":
			sp.Zone = &(o.Zone)
		}
	}
	return sp
}
func ( o * Policy ) ToSparse ( fields ... string ) elemental . SparseIdentifiable { if len ( fields ) == 0 { return & SparsePolicy { ID : & o . ID , Action : & o . Action , ActiveDuration : & o . ActiveDuration , ActiveSchedule : & o . ActiveSchedule , AllObjectTags : & o . AllObjectTags , AllSubjectTags : & o . AllSubjectTags , Annotations : & o . Annotations , AssociatedTags : & o . AssociatedTags , CreateIdempotencyKey : & o . CreateIdempotencyKey , CreateTime : & o . CreateTime , Description : & o . Description , Disabled : & o . Disabled , ExpirationTime : & o . ExpirationTime , Fallback : & o . Fallback , Metadata : & o . Metadata , MigrationsLog : & o . MigrationsLog , Name : & o . Name , Namespace : & o . Namespace , NormalizedTags : & o . NormalizedTags , Object : & o . Object , Propagate : & o . Propagate , PropagationHidden : & o . PropagationHidden , Protected : & o . Protected , Relation : & o . Relation , Subject : & o . Subject , Type : & o . Type , UpdateIdempotencyKey : & o . UpdateIdempotencyKey , UpdateTime : & o . UpdateTime , ZHash : & o . ZHash , Zone : & o . Zone , } } sp := & SparsePolicy { } for _ , f := range fields { switch f { case " " : sp . ID = & ( o . ID ) case " " : sp . Action = & ( o . Action ) case " " : sp . ActiveDuration = & ( o . ActiveDuration ) case " " : sp . ActiveSchedule = & ( o . ActiveSchedule ) case " " : sp . AllObjectTags = & ( o . AllObjectTags ) case " " : sp . AllSubjectTags = & ( o . AllSubjectTags ) case " " : sp . Annotations = & ( o . Annotations ) case " " : sp . AssociatedTags = & ( o . AssociatedTags ) case " " : sp . CreateIdempotencyKey = & ( o . CreateIdempotencyKey ) case " " : sp . CreateTime = & ( o . CreateTime ) case " " : sp . Description = & ( o . Description ) case " " : sp . Disabled = & ( o . Disabled ) case " " : sp . ExpirationTime = & ( o . ExpirationTime ) case " " : sp . Fallback = & ( o . Fallback ) case " " : sp . Metadata = & ( o . Metadata ) case " " : sp . MigrationsLog = & ( o . MigrationsLog ) case " " : sp . Name = & ( o . Name ) case " " : sp . Namespace = & ( o . Namespace ) case " " : sp . NormalizedTags = & ( o . NormalizedTags ) case " " : sp . Object = & ( o . Object ) case " " : sp . Propagate = & ( o . Propagate ) case " " : sp . PropagationHidden = & ( o . PropagationHidden ) case " " : sp . Protected = & ( o . Protected ) case " " : sp . Relation = & ( o . Relation ) case " " : sp . Subject = & ( o . Subject ) case " " : sp . Type = & ( o . Type ) case " " : sp . UpdateIdempotencyKey = & ( o . UpdateIdempotencyKey ) case " " : sp . UpdateTime = & ( o . UpdateTime ) case " " : sp . ZHash = & ( o . ZHash ) case " " : sp . Zone = & ( o . Zone ) } } return sp }
ToSparse returns the sparse version of the model.
ToSparse returns the sparse version of the model .
// nolint: goimports