code: func (s *HorizontalPodAutoscalerGeneratorV1) StructuredGenerate() (runtime.Object, error) {
  	if err := s.validate(); err != nil {
  		return nil, err
  	}
  
  	scaler := autoscalingv1.HorizontalPodAutoscaler{
  		ObjectMeta: metav1.ObjectMeta{
  			Name: s.Name,
  		},
  		Spec: autoscalingv1.HorizontalPodAutoscalerSpec{
  			ScaleTargetRef: autoscalingv1.CrossVersionObjectReference{
  				Kind:       s.ScaleRefKind,
  				Name:       s.ScaleRefName,
  				APIVersion: s.ScaleRefAPIVersion,
  			},
  			MaxReplicas: s.MaxReplicas,
  		},
  	}
  
  	if s.MinReplicas > 0 {
  		v := int32(s.MinReplicas)
  		scaler.Spec.MinReplicas = &v
  	}
  	if s.CPUPercent >= 0 {
  		c := int32(s.CPUPercent)
  		scaler.Spec.TargetCPUUtilizationPercentage = &c
  	}
  
  	return &scaler, nil
  }
docs: // StructuredGenerate outputs a horizontal pod autoscaler object using the configured fields.