func (er EngineResponse) GetPatches() [][]byte {
	var patches [][]byte
	for _, r := range er.PolicyResponse.Rules {
		if r.Patches != nil {
			patches = append(patches, r.Patches...)
		}
	}
	return patches
}
GetPatches returns all the patches joined
package response
import (
	"fmt"
	"time"
	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
type EngineResponse struct {
	PatchedResource unstructured.Unstructured
	PolicyResponse PolicyResponse
}
type PolicyResponse struct {
	Policy PolicySpec `json:"policy"`
	Resource ResourceSpec `json:"resource"`
	PolicyStats `json:",inline"`
	Rules []RuleResponse `json:"rules"`
	ValidationFailureAction string
}
type PolicySpec struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}
type ResourceSpec struct {
	Kind       string `json:"kind"`
	APIVersion string `json:"apiVersion"`
	Namespace  string `json:"namespace"`
	Name       string `json:"name"`
	UID string `json:"uid"`
}
func (rs ResourceSpec) GetKey() string {
	return rs.Kind + "/" + rs.Namespace + "/" + rs.Name
}
type PolicyStats struct {
	ProcessingTime time.Duration `json:"processingTime"`
	RulesAppliedCount int `json:"rulesAppliedCount"`
	RulesErrorCount int `json:"rulesErrorCount"`
	PolicyExecutionTimestamp int64 `json:"policyExecutionTimestamp"`
}
type RuleResponse struct {
	Name string `json:"name"`
	Type string `json:"type"`
	Message string `json:"message"`
	Patches [][]byte `json:"patches,omitempty"`
	Status RuleStatus `json:"status"`
	RuleStats `json:",inline"`
}
func (rr RuleResponse) ToString() string {
	return fmt.Sprintf("rule %s (%s): %v", rr.Name, rr.Type, rr.Message)
}
type RuleStats struct {
	ProcessingTime time.Duration `json:"processingTime"`
	RuleExecutionTimestamp int64 `json:"ruleExecutionTimestamp"`
}
func (er EngineResponse) IsSuccessful() bool {
	for _, r := range er.PolicyResponse.Rules {
		if r.Status == RuleStatusFail || r.Status == RuleStatusError {
			return false
		}
	}
	return true
}
func (er EngineResponse) IsFailed() bool {
	for _, r := range er.PolicyResponse.Rules {
		if r.Status == RuleStatusFail {
			return true
		}
	}
	return false
}