Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove terraform-related code #604

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Remove terraform-related code #604

wants to merge 1 commit into from

Conversation

K-Phoen
Copy link
Member

@K-Phoen K-Phoen commented Oct 18, 2024

We can revert this once we decide to finish Terraform codegen.

We can revert this once we decide to finish Terraform codegen.
@K-Phoen K-Phoen self-assigned this Oct 18, 2024
@K-Phoen K-Phoen requested a review from a team as a code owner October 18, 2024 22:18
Copy link

Note: in addition to the changes introduced by this PR, the diff includes unreleased changes living in main.

🔎 Changes to grafana-foundation-sdk@next+cog-v0.0.x

diff --git a/go/accesspolicy/accesspolicy_builder_gen.go b/go/accesspolicy/accesspolicy_builder_gen.go
index 19c05cec..e883121b 100644
--- a/go/accesspolicy/accesspolicy_builder_gen.go
+++ b/go/accesspolicy/accesspolicy_builder_gen.go
@@ -26,14 +26,8 @@ func NewAccessPolicyBuilder() *AccessPolicyBuilder {
 }
 
 func (builder *AccessPolicyBuilder) Build() (AccessPolicy, error) {
-	var errs cog.BuildErrors
-
-	for _, err := range builder.errors {
-		errs = append(errs, cog.MakeBuildErrors("AccessPolicy", err)...)
-	}
-
-	if len(errs) != 0 {
-		return AccessPolicy{}, errs
+	if err := builder.internal.Validate(); err != nil {
+		return AccessPolicy{}, err
 	}
 
 	return *builder.internal, nil
diff --git a/go/accesspolicy/accessrule_builder_gen.go b/go/accesspolicy/accessrule_builder_gen.go
index 22d0720e..102adae2 100644
--- a/go/accesspolicy/accessrule_builder_gen.go
+++ b/go/accesspolicy/accessrule_builder_gen.go
@@ -26,14 +26,8 @@ func NewAccessRuleBuilder() *AccessRuleBuilder {
 }
 
 func (builder *AccessRuleBuilder) Build() (AccessRule, error) {
-	var errs cog.BuildErrors
-
-	for _, err := range builder.errors {
-		errs = append(errs, cog.MakeBuildErrors("AccessRule", err)...)
-	}
-
-	if len(errs) != 0 {
-		return AccessRule{}, errs
+	if err := builder.internal.Validate(); err != nil {
+		return AccessRule{}, err
 	}
 
 	return *builder.internal, nil
diff --git a/go/accesspolicy/resourceref_builder_gen.go b/go/accesspolicy/resourceref_builder_gen.go
index 5d6b5263..c14f9572 100644
--- a/go/accesspolicy/resourceref_builder_gen.go
+++ b/go/accesspolicy/resourceref_builder_gen.go
@@ -26,14 +26,8 @@ func NewResourceRefBuilder() *ResourceRefBuilder {
 }
 
 func (builder *ResourceRefBuilder) Build() (ResourceRef, error) {
-	var errs cog.BuildErrors
-
-	for _, err := range builder.errors {
-		errs = append(errs, cog.MakeBuildErrors("ResourceRef", err)...)
-	}
-
-	if len(errs) != 0 {
-		return ResourceRef{}, errs
+	if err := builder.internal.Validate(); err != nil {
+		return ResourceRef{}, err
 	}
 
 	return *builder.internal, nil
diff --git a/go/accesspolicy/roleref_builder_gen.go b/go/accesspolicy/roleref_builder_gen.go
index de2d256c..ca66f18f 100644
--- a/go/accesspolicy/roleref_builder_gen.go
+++ b/go/accesspolicy/roleref_builder_gen.go
@@ -26,14 +26,8 @@ func NewRoleRefBuilder() *RoleRefBuilder {
 }
 
 func (builder *RoleRefBuilder) Build() (RoleRef, error) {
-	var errs cog.BuildErrors
-
-	for _, err := range builder.errors {
-		errs = append(errs, cog.MakeBuildErrors("RoleRef", err)...)
-	}
-
-	if len(errs) != 0 {
-		return RoleRef{}, errs
+	if err := builder.internal.Validate(); err != nil {
+		return RoleRef{}, err
 	}
 
 	return *builder.internal, nil
diff --git a/go/accesspolicy/types_gen.go b/go/accesspolicy/types_gen.go
index f6932d94..cbb8efd2 100644
--- a/go/accesspolicy/types_gen.go
+++ b/go/accesspolicy/types_gen.go
@@ -2,6 +2,15 @@
 
 package accesspolicy
 
+import (
+	"encoding/json"
+	"errors"
+	"fmt"
+	"strconv"
+
+	cog "github.com/grafana/grafana-foundation-sdk/go/cog"
+)
+
 type AccessPolicy struct {
 	// The scope where these policies should apply
 	Scope ResourceRef `json:"scope"`
@@ -12,6 +21,86 @@ type AccessPolicy struct {
 	Rules []AccessRule `json:"rules"`
 }
 
+func (resource *AccessPolicy) UnmarshalJSONStrict(raw []byte) error {
+	if raw == nil {
+		return nil
+	}
+	var errs cog.BuildErrors
+
+	fields := make(map[string]json.RawMessage)
+	if err := json.Unmarshal(raw, &fields); err != nil {
+		return err
+	}
+	// Field "scope"
+	if fields["scope"] != nil {
+		if string(fields["scope"]) != "null" {
+
+			resource.Scope = ResourceRef{}
+			if err := resource.Scope.UnmarshalJSONStrict(fields["scope"]); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("scope", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("scope", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "scope")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("scope", errors.New("required field is missing from input"))...)
+	}
+	// Field "role"
+	if fields["role"] != nil {
+		if string(fields["role"]) != "null" {
+
+			resource.Role = RoleRef{}
+			if err := resource.Role.UnmarshalJSONStrict(fields["role"]); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("role", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("role", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "role")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("role", errors.New("required field is missing from input"))...)
+	}
+	// Field "rules"
+	if fields["rules"] != nil {
+		if string(fields["rules"]) != "null" {
+
+			partialArray := []json.RawMessage{}
+			if err := json.Unmarshal(fields["rules"], &partialArray); err != nil {
+				return err
+			}
+
+			for i1 := range partialArray {
+				var result1 AccessRule
+
+				result1 = AccessRule{}
+				if err := result1.UnmarshalJSONStrict(partialArray[i1]); err != nil {
+					errs = append(errs, cog.MakeBuildErrors("rules["+strconv.Itoa(i1)+"]", err)...)
+				}
+				resource.Rules = append(resource.Rules, result1)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("rules", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "rules")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("rules", errors.New("required field is missing from input"))...)
+	}
+
+	for field := range fields {
+		errs = append(errs, cog.MakeBuildErrors("AccessPolicy", fmt.Errorf("unexpected field '%s'", field))...)
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 func (resource AccessPolicy) Equals(other AccessPolicy) bool {
 	if !resource.Scope.Equals(other.Scope) {
 		return false
@@ -33,6 +122,30 @@ func (resource AccessPolicy) Equals(other AccessPolicy) bool {
 	return true
 }
 
+// Validate checks any constraint that may be defined for this type
+// and returns all violations.
+func (resource AccessPolicy) Validate() error {
+	var errs cog.BuildErrors
+	if err := resource.Scope.Validate(); err != nil {
+		errs = append(errs, cog.MakeBuildErrors("scope", err)...)
+	}
+	if err := resource.Role.Validate(); err != nil {
+		errs = append(errs, cog.MakeBuildErrors("role", err)...)
+	}
+
+	for i1 := range resource.Rules {
+		if err := resource.Rules[i1].Validate(); err != nil {
+			errs = append(errs, cog.MakeBuildErrors("rules["+strconv.Itoa(i1)+"]", err)...)
+		}
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 type RoleRef struct {
 	// Policies can apply to roles, teams, or users
 	// Applying policies to individual users is supported, but discouraged
@@ -41,6 +154,70 @@ type RoleRef struct {
 	Xname string      `json:"xname"`
 }
 
+func (resource *RoleRef) UnmarshalJSONStrict(raw []byte) error {
+	if raw == nil {
+		return nil
+	}
+	var errs cog.BuildErrors
+
+	fields := make(map[string]json.RawMessage)
+	if err := json.Unmarshal(raw, &fields); err != nil {
+		return err
+	}
+	// Field "kind"
+	if fields["kind"] != nil {
+		if string(fields["kind"]) != "null" {
+			if err := json.Unmarshal(fields["kind"], &resource.Kind); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("kind", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("kind", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "kind")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("kind", errors.New("required field is missing from input"))...)
+	}
+	// Field "name"
+	if fields["name"] != nil {
+		if string(fields["name"]) != "null" {
+			if err := json.Unmarshal(fields["name"], &resource.Name); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("name", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("name", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "name")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("name", errors.New("required field is missing from input"))...)
+	}
+	// Field "xname"
+	if fields["xname"] != nil {
+		if string(fields["xname"]) != "null" {
+			if err := json.Unmarshal(fields["xname"], &resource.Xname); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("xname", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("xname", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "xname")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("xname", errors.New("required field is missing from input"))...)
+	}
+
+	for field := range fields {
+		errs = append(errs, cog.MakeBuildErrors("RoleRef", fmt.Errorf("unexpected field '%s'", field))...)
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 func (resource RoleRef) Equals(other RoleRef) bool {
 	if resource.Kind != other.Kind {
 		return false
@@ -55,11 +232,67 @@ func (resource RoleRef) Equals(other RoleRef) bool {
 	return true
 }
 
+// Validate checks any constraint that may be defined for this type
+// and returns all violations.
+func (resource RoleRef) Validate() error {
+	return nil
+}
+
 type ResourceRef struct {
 	Kind string `json:"kind"`
 	Name string `json:"name"`
 }
 
+func (resource *ResourceRef) UnmarshalJSONStrict(raw []byte) error {
+	if raw == nil {
+		return nil
+	}
+	var errs cog.BuildErrors
+
+	fields := make(map[string]json.RawMessage)
+	if err := json.Unmarshal(raw, &fields); err != nil {
+		return err
+	}
+	// Field "kind"
+	if fields["kind"] != nil {
+		if string(fields["kind"]) != "null" {
+			if err := json.Unmarshal(fields["kind"], &resource.Kind); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("kind", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("kind", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "kind")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("kind", errors.New("required field is missing from input"))...)
+	}
+	// Field "name"
+	if fields["name"] != nil {
+		if string(fields["name"]) != "null" {
+			if err := json.Unmarshal(fields["name"], &resource.Name); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("name", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("name", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "name")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("name", errors.New("required field is missing from input"))...)
+	}
+
+	for field := range fields {
+		errs = append(errs, cog.MakeBuildErrors("ResourceRef", fmt.Errorf("unexpected field '%s'", field))...)
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 func (resource ResourceRef) Equals(other ResourceRef) bool {
 	if resource.Kind != other.Kind {
 		return false
@@ -71,6 +304,12 @@ func (resource ResourceRef) Equals(other ResourceRef) bool {
 	return true
 }
 
+// Validate checks any constraint that may be defined for this type
+// and returns all violations.
+func (resource ResourceRef) Validate() error {
+	return nil
+}
+
 type AccessRule struct {
 	// The kind this rule applies to (dashboards, alert, etc)
 	Kind string `json:"kind"`
@@ -81,6 +320,67 @@ type AccessRule struct {
 	Target *string `json:"target,omitempty"`
 }
 
+func (resource *AccessRule) UnmarshalJSONStrict(raw []byte) error {
+	if raw == nil {
+		return nil
+	}
+	var errs cog.BuildErrors
+
+	fields := make(map[string]json.RawMessage)
+	if err := json.Unmarshal(raw, &fields); err != nil {
+		return err
+	}
+	// Field "kind"
+	if fields["kind"] != nil {
+		if string(fields["kind"]) != "null" {
+			if err := json.Unmarshal(fields["kind"], &resource.Kind); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("kind", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("kind", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "kind")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("kind", errors.New("required field is missing from input"))...)
+	}
+	// Field "verb"
+	if fields["verb"] != nil {
+		if string(fields["verb"]) != "null" {
+			if err := json.Unmarshal(fields["verb"], &resource.Verb); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("verb", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("verb", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "verb")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("verb", errors.New("required field is missing from input"))...)
+	}
+	// Field "target"
+	if fields["target"] != nil {
+		if string(fields["target"]) != "null" {
+			if err := json.Unmarshal(fields["target"], &resource.Target); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("target", err)...)
+			}
+
+		}
+		delete(fields, "target")
+
+	}
+
+	for field := range fields {
+		errs = append(errs, cog.MakeBuildErrors("AccessRule", fmt.Errorf("unexpected field '%s'", field))...)
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 func (resource AccessRule) Equals(other AccessRule) bool {
 	if resource.Kind != other.Kind {
 		return false
@@ -101,6 +401,12 @@ func (resource AccessRule) Equals(other AccessRule) bool {
 	return true
 }
 
+// Validate checks any constraint that may be defined for this type
+// and returns all violations.
+func (resource AccessRule) Validate() error {
+	return nil
+}
+
 type RoleRefKind string
 
 const (
diff --git a/go/alerting/contactpoint_builder_gen.go b/go/alerting/contactpoint_builder_gen.go
index 4c4895ee..caf67580 100644
--- a/go/alerting/contactpoint_builder_gen.go
+++ b/go/alerting/contactpoint_builder_gen.go
@@ -3,8 +3,6 @@
 package alerting
 
 import (
-	"errors"
-
 	cog "github.com/grafana/grafana-foundation-sdk/go/cog"
 )
 
@@ -30,14 +28,8 @@ func NewContactPointBuilder() *ContactPointBuilder {
 }
 
 func (builder *ContactPointBuilder) Build() (ContactPoint, error) {
-	var errs cog.BuildErrors
-
-	for _, err := range builder.errors {
-		errs = append(errs, cog.MakeBuildErrors("ContactPoint", err)...)
-	}
-
-	if len(errs) != 0 {
-		return ContactPoint{}, errs
+	if err := builder.internal.Validate(); err != nil {
+		return ContactPoint{}, err
 	}
 
 	return *builder.internal, nil
@@ -86,14 +78,6 @@ func (builder *ContactPointBuilder) Type(typeArg ContactPointType) *ContactPoint
 // EmbeddedContactPoint is the contact point type that is used
 // by grafanas embedded alertmanager implementation.
 func (builder *ContactPointBuilder) Uid(uid string) *ContactPointBuilder {
-	if !(len([]rune(uid)) >= 1) {
-		builder.errors["uid"] = cog.MakeBuildErrors("uid", errors.New("len([]rune(uid)) must be >= 1"))
-		return builder
-	}
-	if !(len([]rune(uid)) <= 40) {
-		builder.errors["uid"] = cog.MakeBuildErrors("uid", errors.New("len([]rune(uid)) must be <= 40"))
-		return builder
-	}
 	builder.internal.Uid = &uid
 
 	return builder
diff --git a/go/alerting/matcher_builder_gen.go b/go/alerting/matcher_builder_gen.go
index f76f81fc..3a20ad9c 100644
--- a/go/alerting/matcher_builder_gen.go
+++ b/go/alerting/matcher_builder_gen.go
@@ -26,14 +26,8 @@ func NewMatcherBuilder() *MatcherBuilder {
 }
 
 func (builder *MatcherBuilder) Build() (Matcher, error) {
-	var errs cog.BuildErrors
-
-	for _, err := range builder.errors {
-		errs = append(errs, cog.MakeBuildErrors("Matcher", err)...)
-	}
-
-	if len(errs) != 0 {
-		return Matcher{}, errs
+	if err := builder.internal.Validate(); err != nil {
+		return Matcher{}, err
 	}
 
 	return *builder.internal, nil
diff --git a/go/alerting/mutetiming_builder_gen.go b/go/alerting/mutetiming_builder_gen.go
index 84726ac4..02bcd748 100644
--- a/go/alerting/mutetiming_builder_gen.go
+++ b/go/alerting/mutetiming_builder_gen.go
@@ -26,14 +26,8 @@ func NewMuteTimingBuilder() *MuteTimingBuilder {
 }
 
 func (builder *MuteTimingBuilder) Build() (MuteTiming, error) {
-	var errs cog.BuildErrors
-
-	for _, err := range builder.errors {
-		errs = append(errs, cog.MakeBuildErrors("MuteTiming", err)...)
-	}
-
-	if len(errs) != 0 {
-		return MuteTiming{}, errs
+	if err := builder.internal.Validate(); err != nil {
+		return MuteTiming{}, err
 	}
 
 	return *builder.internal, nil
diff --git a/go/alerting/notificationpolicy_builder_gen.go b/go/alerting/notificationpolicy_builder_gen.go
index 6feca2c3..6819f03b 100644
--- a/go/alerting/notificationpolicy_builder_gen.go
+++ b/go/alerting/notificationpolicy_builder_gen.go
@@ -28,14 +28,8 @@ func NewNotificationPolicyBuilder() *NotificationPolicyBuilder {
 }
 
 func (builder *NotificationPolicyBuilder) Build() (NotificationPolicy, error) {
-	var errs cog.BuildErrors
-
-	for _, err := range builder.errors {
-		errs = append(errs, cog.MakeBuildErrors("NotificationPolicy", err)...)
-	}
-
-	if len(errs) != 0 {
-		return NotificationPolicy{}, errs
+	if err := builder.internal.Validate(); err != nil {
+		return NotificationPolicy{}, err
 	}
 
 	return *builder.internal, nil
diff --git a/go/alerting/notificationsettings_builder_gen.go b/go/alerting/notificationsettings_builder_gen.go
index f5f0abf0..d446acd1 100644
--- a/go/alerting/notificationsettings_builder_gen.go
+++ b/go/alerting/notificationsettings_builder_gen.go
@@ -26,14 +26,8 @@ func NewNotificationSettingsBuilder() *NotificationSettingsBuilder {
 }
 
 func (builder *NotificationSettingsBuilder) Build() (NotificationSettings, error) {
-	var errs cog.BuildErrors
-
-	for _, err := range builder.errors {
-		errs = append(errs, cog.MakeBuildErrors("NotificationSettings", err)...)
-	}
-
-	if len(errs) != 0 {
-		return NotificationSettings{}, errs
+	if err := builder.internal.Validate(); err != nil {
+		return NotificationSettings{}, err
 	}
 
 	return *builder.internal, nil
diff --git a/go/alerting/notificationtemplate_builder_gen.go b/go/alerting/notificationtemplate_builder_gen.go
index 2af7cac2..a6a519ce 100644
--- a/go/alerting/notificationtemplate_builder_gen.go
+++ b/go/alerting/notificationtemplate_builder_gen.go
@@ -26,14 +26,8 @@ func NewNotificationTemplateBuilder() *NotificationTemplateBuilder {
 }
 
 func (builder *NotificationTemplateBuilder) Build() (NotificationTemplate, error) {
-	var errs cog.BuildErrors
-
-	for _, err := range builder.errors {
-		errs = append(errs, cog.MakeBuildErrors("NotificationTemplate", err)...)
-	}
-
-	if len(errs) != 0 {
-		return NotificationTemplate{}, errs
+	if err := builder.internal.Validate(); err != nil {
+		return NotificationTemplate{}, err
 	}
 
 	return *builder.internal, nil
diff --git a/go/alerting/query_builder_gen.go b/go/alerting/query_builder_gen.go
index ac88ed77..fde0a503 100644
--- a/go/alerting/query_builder_gen.go
+++ b/go/alerting/query_builder_gen.go
@@ -28,14 +28,8 @@ func NewQueryBuilder(refId string) *QueryBuilder {
 }
 
 func (builder *QueryBuilder) Build() (Query, error) {
-	var errs cog.BuildErrors
-
-	for _, err := range builder.errors {
-		errs = append(errs, cog.MakeBuildErrors("Query", err)...)
-	}
-
-	if len(errs) != 0 {
-		return Query{}, errs
+	if err := builder.internal.Validate(); err != nil {
+		return Query{}, err
 	}
 
 	return *builder.internal, nil
diff --git a/go/alerting/recordrule_builder_gen.go b/go/alerting/recordrule_builder_gen.go
index 55e8a103..06cd5dd5 100644
--- a/go/alerting/recordrule_builder_gen.go
+++ b/go/alerting/recordrule_builder_gen.go
@@ -26,14 +26,8 @@ func NewRecordRuleBuilder() *RecordRuleBuilder {
 }
 
 func (builder *RecordRuleBuilder) Build() (RecordRule, error) {
-	var errs cog.BuildErrors
-
-	for _, err := range builder.errors {
-		errs = append(errs, cog.MakeBuildErrors("RecordRule", err)...)
-	}
-
-	if len(errs) != 0 {
-		return RecordRule{}, errs
+	if err := builder.internal.Validate(); err != nil {
+		return RecordRule{}, err
 	}
 
 	return *builder.internal, nil
diff --git a/go/alerting/rule_builder_gen.go b/go/alerting/rule_builder_gen.go
index 80c41227..325e57b9 100644
--- a/go/alerting/rule_builder_gen.go
+++ b/go/alerting/rule_builder_gen.go
@@ -3,7 +3,6 @@
 package alerting
 
 import (
-	"errors"
 	"time"
 
 	cog "github.com/grafana/grafana-foundation-sdk/go/cog"
@@ -24,28 +23,14 @@ func NewRuleBuilder(title string) *RuleBuilder {
 	}
 
 	builder.applyDefaults()
-	if !(len([]rune(title)) >= 1) {
-		builder.errors["title"] = cog.MakeBuildErrors("title", errors.New("len([]rune(title)) must be >= 1"))
-		return builder
-	}
-	if !(len([]rune(title)) <= 190) {
-		builder.errors["title"] = cog.MakeBuildErrors("title", errors.New("len([]rune(title)) must be <= 190"))
-		return builder
-	}
 	builder.internal.Title = title
 
 	return builder
 }
 
 func (builder *RuleBuilder) Build() (Rule, error) {
-	var errs cog.BuildErrors
-
-	for _, err := range builder.errors {
-		errs = append(errs, cog.MakeBuildErrors("Rule", err)...)
-	}
-
-	if len(errs) != 0 {
-		return Rule{}, errs
+	if err := builder.internal.Validate(); err != nil {
+		return Rule{}, err
 	}
 
 	return *builder.internal, nil
@@ -168,42 +153,18 @@ func (builder *RuleBuilder) Record(record cog.Builder[RecordRule]) *RuleBuilder
 }
 
 func (builder *RuleBuilder) RuleGroup(ruleGroup string) *RuleBuilder {
-	if !(len([]rune(ruleGroup)) >= 1) {
-		builder.errors["ruleGroup"] = cog.MakeBuildErrors("ruleGroup", errors.New("len([]rune(ruleGroup)) must be >= 1"))
-		return builder
-	}
-	if !(len([]rune(ruleGroup)) <= 190) {
-		builder.errors["ruleGroup"] = cog.MakeBuildErrors("ruleGroup", errors.New("len([]rune(ruleGroup)) must be <= 190"))
-		return builder
-	}
 	builder.internal.RuleGroup = ruleGroup
 
 	return builder
 }
 
 func (builder *RuleBuilder) Title(title string) *RuleBuilder {
-	if !(len([]rune(title)) >= 1) {
-		builder.errors["title"] = cog.MakeBuildErrors("title", errors.New("len([]rune(title)) must be >= 1"))
-		return builder
-	}
-	if !(len([]rune(title)) <= 190) {
-		builder.errors["title"] = cog.MakeBuildErrors("title", errors.New("len([]rune(title)) must be <= 190"))
-		return builder
-	}
 	builder.internal.Title = title
 
 	return builder
 }
 
 func (builder *RuleBuilder) Uid(uid string) *RuleBuilder {
-	if !(len([]rune(uid)) >= 1) {
-		builder.errors["uid"] = cog.MakeBuildErrors("uid", errors.New("len([]rune(uid)) must be >= 1"))
-		return builder
-	}
-	if !(len([]rune(uid)) <= 40) {
-		builder.errors["uid"] = cog.MakeBuildErrors("uid", errors.New("len([]rune(uid)) must be <= 40"))
-		return builder
-	}
 	builder.internal.Uid = &uid
 
 	return builder
diff --git a/go/alerting/rulegroup_builder_gen.go b/go/alerting/rulegroup_builder_gen.go
index 416765ec..b9c77d49 100644
--- a/go/alerting/rulegroup_builder_gen.go
+++ b/go/alerting/rulegroup_builder_gen.go
@@ -27,14 +27,8 @@ func NewRuleGroupBuilder(title string) *RuleGroupBuilder {
 }
 
 func (builder *RuleGroupBuilder) Build() (RuleGroup, error) {
-	var errs cog.BuildErrors
-
-	for _, err := range builder.errors {
-		errs = append(errs, cog.MakeBuildErrors("RuleGroup", err)...)
-	}
-
-	if len(errs) != 0 {
-		return RuleGroup{}, errs
+	if err := builder.internal.Validate(); err != nil {
+		return RuleGroup{}, err
 	}
 
 	return *builder.internal, nil
diff --git a/go/alerting/timeinterval_builder_gen.go b/go/alerting/timeinterval_builder_gen.go
index 5cb84c45..b1d3e0db 100644
--- a/go/alerting/timeinterval_builder_gen.go
+++ b/go/alerting/timeinterval_builder_gen.go
@@ -26,14 +26,8 @@ func NewTimeIntervalBuilder() *TimeIntervalBuilder {
 }
 
 func (builder *TimeIntervalBuilder) Build() (TimeInterval, error) {
-	var errs cog.BuildErrors
-
-	for _, err := range builder.errors {
-		errs = append(errs, cog.MakeBuildErrors("TimeInterval", err)...)
-	}
-
-	if len(errs) != 0 {
-		return TimeInterval{}, errs
+	if err := builder.internal.Validate(); err != nil {
+		return TimeInterval{}, err
 	}
 
 	return *builder.internal, nil
diff --git a/go/alerting/timeintervalitem_builder_gen.go b/go/alerting/timeintervalitem_builder_gen.go
index e5df78f3..a50850af 100644
--- a/go/alerting/timeintervalitem_builder_gen.go
+++ b/go/alerting/timeintervalitem_builder_gen.go
@@ -26,14 +26,8 @@ func NewTimeIntervalItemBuilder() *TimeIntervalItemBuilder {
 }
 
 func (builder *TimeIntervalItemBuilder) Build() (TimeIntervalItem, error) {
-	var errs cog.BuildErrors
-
-	for _, err := range builder.errors {
-		errs = append(errs, cog.MakeBuildErrors("TimeIntervalItem", err)...)
-	}
-
-	if len(errs) != 0 {
-		return TimeIntervalItem{}, errs
+	if err := builder.internal.Validate(); err != nil {
+		return TimeIntervalItem{}, err
 	}
 
 	return *builder.internal, nil
diff --git a/go/alerting/timeintervaltimerange_builder_gen.go b/go/alerting/timeintervaltimerange_builder_gen.go
index 6a035745..03630d5d 100644
--- a/go/alerting/timeintervaltimerange_builder_gen.go
+++ b/go/alerting/timeintervaltimerange_builder_gen.go
@@ -26,14 +26,8 @@ func NewTimeIntervalTimeRangeBuilder() *TimeIntervalTimeRangeBuilder {
 }
 
 func (builder *TimeIntervalTimeRangeBuilder) Build() (TimeIntervalTimeRange, error) {
-	var errs cog.BuildErrors
-
-	for _, err := range builder.errors {
-		errs = append(errs, cog.MakeBuildErrors("TimeIntervalTimeRange", err)...)
-	}
-
-	if len(errs) != 0 {
-		return TimeIntervalTimeRange{}, errs
+	if err := builder.internal.Validate(); err != nil {
+		return TimeIntervalTimeRange{}, err
 	}
 
 	return *builder.internal, nil
diff --git a/go/alerting/types_gen.go b/go/alerting/types_gen.go
index 29299769..92b03254 100644
--- a/go/alerting/types_gen.go
+++ b/go/alerting/types_gen.go
@@ -4,7 +4,9 @@ package alerting
 
 import (
 	"encoding/json"
+	"errors"
 	"fmt"
+	"strconv"
 	"time"
 
 	cog "github.com/grafana/grafana-foundation-sdk/go/cog"
@@ -65,6 +67,89 @@ func (resource *Query) UnmarshalJSON(raw []byte) error {
 	return nil
 }
 
+func (resource *Query) UnmarshalJSONStrict(raw []byte) error {
+	if raw == nil {
+		return nil
+	}
+	var errs cog.BuildErrors
+
+	fields := make(map[string]json.RawMessage)
+	if err := json.Unmarshal(raw, &fields); err != nil {
+		return err
+	}
+	// Field "datasourceUid"
+	if fields["datasourceUid"] != nil {
+		if string(fields["datasourceUid"]) != "null" {
+			if err := json.Unmarshal(fields["datasourceUid"], &resource.DatasourceUid); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("datasourceUid", err)...)
+			}
+
+		}
+		delete(fields, "datasourceUid")
+
+	}
+	// Field "model"
+	if fields["model"] != nil {
+		if string(fields["model"]) != "null" {
+
+			dataquery, err := cog.StrictUnmarshalDataquery(fields["model"], "")
+			if err != nil {
+				errs = append(errs, cog.MakeBuildErrors("model", err)...)
+			} else {
+				resource.Model = dataquery
+			}
+
+		}
+		delete(fields, "model")
+
+	}
+	// Field "queryType"
+	if fields["queryType"] != nil {
+		if string(fields["queryType"]) != "null" {
+			if err := json.Unmarshal(fields["queryType"], &resource.QueryType); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("queryType", err)...)
+			}
+
+		}
+		delete(fields, "queryType")
+
+	}
+	// Field "refId"
+	if fields["refId"] != nil {
+		if string(fields["refId"]) != "null" {
+			if err := json.Unmarshal(fields["refId"], &resource.RefId); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("refId", err)...)
+			}
+
+		}
+		delete(fields, "refId")
+
+	}
+	// Field "relativeTimeRange"
+	if fields["relativeTimeRange"] != nil {
+		if string(fields["relativeTimeRange"]) != "null" {
+
+			resource.RelativeTimeRange = &RelativeTimeRange{}
+			if err := resource.RelativeTimeRange.UnmarshalJSONStrict(fields["relativeTimeRange"]); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("relativeTimeRange", err)...)
+			}
+
+		}
+		delete(fields, "relativeTimeRange")
+
+	}
+
+	for field := range fields {
+		errs = append(errs, cog.MakeBuildErrors("Query", fmt.Errorf("unexpected field '%s'", field))...)
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 func (resource Query) Equals(other Query) bool {
 	if resource.DatasourceUid == nil && other.DatasourceUid != nil || resource.DatasourceUid != nil && other.DatasourceUid == nil {
 		return false
@@ -115,6 +200,28 @@ func (resource Query) Equals(other Query) bool {
 	return true
 }
 
+// Validate checks any constraint that may be defined for this type
+// and returns all violations.
+func (resource Query) Validate() error {
+	var errs cog.BuildErrors
+	if resource.Model != nil {
+		if err := resource.Model.Validate(); err != nil {
+			errs = append(errs, cog.MakeBuildErrors("model", err)...)
+		}
+	}
+	if resource.RelativeTimeRange != nil {
+		if err := resource.RelativeTimeRange.Validate(); err != nil {
+			errs = append(errs, cog.MakeBuildErrors("relativeTimeRange", err)...)
+		}
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 type RuleGroup struct {
 	FolderUid *string `json:"folderUid,omitempty"`
 	// The interval, in seconds, at which all rules in the group are evaluated.
@@ -124,6 +231,84 @@ type RuleGroup struct {
 	Title    *string   `json:"title,omitempty"`
 }
 
+func (resource *RuleGroup) UnmarshalJSONStrict(raw []byte) error {
+	if raw == nil {
+		return nil
+	}
+	var errs cog.BuildErrors
+
+	fields := make(map[string]json.RawMessage)
+	if err := json.Unmarshal(raw, &fields); err != nil {
+		return err
+	}
+	// Field "folderUid"
+	if fields["folderUid"] != nil {
+		if string(fields["folderUid"]) != "null" {
+			if err := json.Unmarshal(fields["folderUid"], &resource.FolderUid); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("folderUid", err)...)
+			}
+
+		}
+		delete(fields, "folderUid")
+
+	}
+	// Field "interval"
+	if fields["interval"] != nil {
+		if string(fields["interval"]) != "null" {
+			if err := json.Unmarshal(fields["interval"], &resource.Interval); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("interval", err)...)
+			}
+
+		}
+		delete(fields, "interval")
+
+	}
+	// Field "rules"
+	if fields["rules"] != nil {
+		if string(fields["rules"]) != "null" {
+
+			partialArray := []json.RawMessage{}
+			if err := json.Unmarshal(fields["rules"], &partialArray); err != nil {
+				return err
+			}
+
+			for i1 := range partialArray {
+				var result1 Rule
+
+				result1 = Rule{}
+				if err := result1.UnmarshalJSONStrict(partialArray[i1]); err != nil {
+					errs = append(errs, cog.MakeBuildErrors("rules["+strconv.Itoa(i1)+"]", err)...)
+				}
+				resource.Rules = append(resource.Rules, result1)
+			}
+
+		}
+		delete(fields, "rules")
+
+	}
+	// Field "title"
+	if fields["title"] != nil {
+		if string(fields["title"]) != "null" {
+			if err := json.Unmarshal(fields["title"], &resource.Title); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("title", err)...)
+			}
+
+		}
+		delete(fields, "title")
+
+	}
+
+	for field := range fields {
+		errs = append(errs, cog.MakeBuildErrors("RuleGroup", fmt.Errorf("unexpected field '%s'", field))...)
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 func (resource RuleGroup) Equals(other RuleGroup) bool {
 	if resource.FolderUid == nil && other.FolderUid != nil || resource.FolderUid != nil && other.FolderUid == nil {
 		return false
@@ -166,6 +351,24 @@ func (resource RuleGroup) Equals(other RuleGroup) bool {
 	return true
 }
 
+// Validate checks any constraint that may be defined for this type
+// and returns all violations.
+func (resource RuleGroup) Validate() error {
+	var errs cog.BuildErrors
+
+	for i1 := range resource.Rules {
+		if err := resource.Rules[i1].Validate(); err != nil {
+			errs = append(errs, cog.MakeBuildErrors("rules["+strconv.Itoa(i1)+"]", err)...)
+		}
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 type NotificationSettings struct {
 	GroupBy           []string `json:"group_by,omitempty"`
 	GroupInterval     *string  `json:"group_interval,omitempty"`
@@ -175,6 +378,99 @@ type NotificationSettings struct {
 	RepeatInterval    *string  `json:"repeat_interval,omitempty"`
 }
 
+func (resource *NotificationSettings) UnmarshalJSONStrict(raw []byte) error {
+	if raw == nil {
+		return nil
+	}
+	var errs cog.BuildErrors
+
+	fields := make(map[string]json.RawMessage)
+	if err := json.Unmarshal(raw, &fields); err != nil {
+		return err
+	}
+	// Field "group_by"
+	if fields["group_by"] != nil {
+		if string(fields["group_by"]) != "null" {
+
+			if err := json.Unmarshal(fields["group_by"], &resource.GroupBy); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("group_by", err)...)
+			}
+
+		}
+		delete(fields, "group_by")
+
+	}
+	// Field "group_interval"
+	if fields["group_interval"] != nil {
+		if string(fields["group_interval"]) != "null" {
+			if err := json.Unmarshal(fields["group_interval"], &resource.GroupInterval); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("group_interval", err)...)
+			}
+
+		}
+		delete(fields, "group_interval")
+
+	}
+	// Field "group_wait"
+	if fields["group_wait"] != nil {
+		if string(fields["group_wait"]) != "null" {
+			if err := json.Unmarshal(fields["group_wait"], &resource.GroupWait); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("group_wait", err)...)
+			}
+
+		}
+		delete(fields, "group_wait")
+
+	}
+	// Field "mute_time_intervals"
+	if fields["mute_time_intervals"] != nil {
+		if string(fields["mute_time_intervals"]) != "null" {
+
+			if err := json.Unmarshal(fields["mute_time_intervals"], &resource.MuteTimeIntervals); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("mute_time_intervals", err)...)
+			}
+
+		}
+		delete(fields, "mute_time_intervals")
+
+	}
+	// Field "receiver"
+	if fields["receiver"] != nil {
+		if string(fields["receiver"]) != "null" {
+			if err := json.Unmarshal(fields["receiver"], &resource.Receiver); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("receiver", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("receiver", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "receiver")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("receiver", errors.New("required field is missing from input"))...)
+	}
+	// Field "repeat_interval"
+	if fields["repeat_interval"] != nil {
+		if string(fields["repeat_interval"]) != "null" {
+			if err := json.Unmarshal(fields["repeat_interval"], &resource.RepeatInterval); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("repeat_interval", err)...)
+			}
+
+		}
+		delete(fields, "repeat_interval")
+
+	}
+
+	for field := range fields {
+		errs = append(errs, cog.MakeBuildErrors("NotificationSettings", fmt.Errorf("unexpected field '%s'", field))...)
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 func (resource NotificationSettings) Equals(other NotificationSettings) bool {
 
 	if len(resource.GroupBy) != len(other.GroupBy) {
@@ -230,6 +526,12 @@ func (resource NotificationSettings) Equals(other NotificationSettings) bool {
 	return true
 }
 
+// Validate checks any constraint that may be defined for this type
+// and returns all violations.
+func (resource NotificationSettings) Validate() error {
+	return nil
+}
+
 // Duration in seconds.
 type Duration int64
 
@@ -256,6 +558,100 @@ type ContactPoint struct {
 	Uid *string `json:"uid,omitempty"`
 }
 
+func (resource *ContactPoint) UnmarshalJSONStrict(raw []byte) error {
+	if raw == nil {
+		return nil
+	}
+	var errs cog.BuildErrors
+
+	fields := make(map[string]json.RawMessage)
+	if err := json.Unmarshal(raw, &fields); err != nil {
+		return err
+	}
+	// Field "disableResolveMessage"
+	if fields["disableResolveMessage"] != nil {
+		if string(fields["disableResolveMessage"]) != "null" {
+			if err := json.Unmarshal(fields["disableResolveMessage"], &resource.DisableResolveMessage); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("disableResolveMessage", err)...)
+			}
+
+		}
+		delete(fields, "disableResolveMessage")
+
+	}
+	// Field "name"
+	if fields["name"] != nil {
+		if string(fields["name"]) != "null" {
+			if err := json.Unmarshal(fields["name"], &resource.Name); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("name", err)...)
+			}
+
+		}
+		delete(fields, "name")
+
+	}
+	// Field "provenance"
+	if fields["provenance"] != nil {
+		if string(fields["provenance"]) != "null" {
+			if err := json.Unmarshal(fields["provenance"], &resource.Provenance); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("provenance", err)...)
+			}
+
+		}
+		delete(fields, "provenance")
+
+	}
+	// Field "settings"
+	if fields["settings"] != nil {
+		if string(fields["settings"]) != "null" {
+			if err := json.Unmarshal(fields["settings"], &resource.Settings); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("settings", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("settings", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "settings")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("settings", errors.New("required field is missing from input"))...)
+	}
+	// Field "type"
+	if fields["type"] != nil {
+		if string(fields["type"]) != "null" {
+			if err := json.Unmarshal(fields["type"], &resource.Type); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("type", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("type", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "type")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("type", errors.New("required field is missing from input"))...)
+	}
+	// Field "uid"
+	if fields["uid"] != nil {
+		if string(fields["uid"]) != "null" {
+			if err := json.Unmarshal(fields["uid"], &resource.Uid); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("uid", err)...)
+			}
+
+		}
+		delete(fields, "uid")
+
+	}
+
+	for field := range fields {
+		errs = append(errs, cog.MakeBuildErrors("ContactPoint", fmt.Errorf("unexpected field '%s'", field))...)
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 func (resource ContactPoint) Equals(other ContactPoint) bool {
 	if resource.DisableResolveMessage == nil && other.DisableResolveMessage != nil || resource.DisableResolveMessage != nil && other.DisableResolveMessage == nil {
 		return false
@@ -303,6 +699,32 @@ func (resource ContactPoint) Equals(other ContactPoint) bool {
 	return true
 }
 
+// Validate checks any constraint that may be defined for this type
+// and returns all violations.
+func (resource ContactPoint) Validate() error {
+	var errs cog.BuildErrors
+	if resource.Uid != nil {
+		if !(len([]rune(*resource.Uid)) >= 0x1) {
+			errs = append(errs, cog.MakeBuildErrors(
+				"uid",
+				errors.New("must be >= 1"),
+			)...)
+		}
+		if !(len([]rune(*resource.Uid)) <= 0x28) {
+			errs = append(errs, cog.MakeBuildErrors(
+				"uid",
+				errors.New("must be <= 40"),
+			)...)
+		}
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 type Json any
 
 type MatchRegexps map[string]string
@@ -322,6 +744,61 @@ type Matcher struct {
 	Value *string    `json:"Value,omitempty"`
 }
 
+func (resource *Matcher) UnmarshalJSONStrict(raw []byte) error {
+	if raw == nil {
+		return nil
+	}
+	var errs cog.BuildErrors
+
+	fields := make(map[string]json.RawMessage)
+	if err := json.Unmarshal(raw, &fields); err != nil {
+		return err
+	}
+	// Field "Name"
+	if fields["Name"] != nil {
+		if string(fields["Name"]) != "null" {
+			if err := json.Unmarshal(fields["Name"], &resource.Name); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("Name", err)...)
+			}
+
+		}
+		delete(fields, "Name")
+
+	}
+	// Field "Type"
+	if fields["Type"] != nil {
+		if string(fields["Type"]) != "null" {
+			if err := json.Unmarshal(fields["Type"], &resource.Type); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("Type", err)...)
+			}
+
+		}
+		delete(fields, "Type")
+
+	}
+	// Field "Value"
+	if fields["Value"] != nil {
+		if string(fields["Value"]) != "null" {
+			if err := json.Unmarshal(fields["Value"], &resource.Value); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("Value", err)...)
+			}
+
+		}
+		delete(fields, "Value")
+
+	}
+
+	for field := range fields {
+		errs = append(errs, cog.MakeBuildErrors("Matcher", fmt.Errorf("unexpected field '%s'", field))...)
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 func (resource Matcher) Equals(other Matcher) bool {
 	if resource.Name == nil && other.Name != nil || resource.Name != nil && other.Name == nil {
 		return false
@@ -354,6 +831,12 @@ func (resource Matcher) Equals(other Matcher) bool {
 	return true
 }
 
+// Validate checks any constraint that may be defined for this type
+// and returns all violations.
+func (resource Matcher) Validate() error {
+	return nil
+}
+
 // Matchers is a slice of Matchers that is sortable, implements Stringer, and
 // provides a Matches method to match a LabelSet against all Matchers in the
 // slice. Note that some users of Matchers might require it to be sorted.
@@ -364,6 +847,62 @@ type MuteTiming struct {
 	TimeIntervals []TimeInterval `json:"time_intervals,omitempty"`
 }
 
+func (resource *MuteTiming) UnmarshalJSONStrict(raw []byte) error {
+	if raw == nil {
+		return nil
+	}
+	var errs cog.BuildErrors
+
+	fields := make(map[string]json.RawMessage)
+	if err := json.Unmarshal(raw, &fields); err != nil {
+		return err
+	}
+	// Field "name"
+	if fields["name"] != nil {
+		if string(fields["name"]) != "null" {
+			if err := json.Unmarshal(fields["name"], &resource.Name); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("name", err)...)
+			}
+
+		}
+		delete(fields, "name")
+
+	}
+	// Field "time_intervals"
+	if fields["time_intervals"] != nil {
+		if string(fields["time_intervals"]) != "null" {
+
+			partialArray := []json.RawMessage{}
+			if err := json.Unmarshal(fields["time_intervals"], &partialArray); err != nil {
+				return err
+			}
+
+			for i1 := range partialArray {
+				var result1 TimeInterval
+
+				result1 = TimeInterval{}
+				if err := result1.UnmarshalJSONStrict(partialArray[i1]); err != nil {
+					errs = append(errs, cog.MakeBuildErrors("time_intervals["+strconv.Itoa(i1)+"]", err)...)
+				}
+				resource.TimeIntervals = append(resource.TimeIntervals, result1)
+			}
+
+		}
+		delete(fields, "time_intervals")
+
+	}
+
+	for field := range fields {
+		errs = append(errs, cog.MakeBuildErrors("MuteTiming", fmt.Errorf("unexpected field '%s'", field))...)
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 func (resource MuteTiming) Equals(other MuteTiming) bool {
 	if resource.Name == nil && other.Name != nil || resource.Name != nil && other.Name == nil {
 		return false
@@ -388,6 +927,24 @@ func (resource MuteTiming) Equals(other MuteTiming) bool {
 	return true
 }
 
+// Validate checks any constraint that may be defined for this type
+// and returns all violations.
+func (resource MuteTiming) Validate() error {
+	var errs cog.BuildErrors
+
+	for i1 := range resource.TimeIntervals {
+		if err := resource.TimeIntervals[i1].Validate(); err != nil {
+			errs = append(errs, cog.MakeBuildErrors("time_intervals["+strconv.Itoa(i1)+"]", err)...)
+		}
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 type NotificationTemplate struct {
 	Name       *string     `json:"name,omitempty"`
 	Provenance *Provenance `json:"provenance,omitempty"`
@@ -395,6 +952,72 @@ type NotificationTemplate struct {
 	Version    *string     `json:"version,omitempty"`
 }
 
+func (resource *NotificationTemplate) UnmarshalJSONStrict(raw []byte) error {
+	if raw == nil {
+		return nil
+	}
+	var errs cog.BuildErrors
+
+	fields := make(map[string]json.RawMessage)
+	if err := json.Unmarshal(raw, &fields); err != nil {
+		return err
+	}
+	// Field "name"
+	if fields["name"] != nil {
+		if string(fields["name"]) != "null" {
+			if err := json.Unmarshal(fields["name"], &resource.Name); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("name", err)...)
+			}
+
+		}
+		delete(fields, "name")
+
+	}
+	// Field "provenance"
+	if fields["provenance"] != nil {
+		if string(fields["provenance"]) != "null" {
+			if err := json.Unmarshal(fields["provenance"], &resource.Provenance); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("provenance", err)...)
+			}
+
+		}
+		delete(fields, "provenance")
+
+	}
+	// Field "template"
+	if fields["template"] != nil {
+		if string(fields["template"]) != "null" {
+			if err := json.Unmarshal(fields["template"], &resource.Template); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("template", err)...)
+			}
+
+		}
+		delete(fields, "template")
+
+	}
+	// Field "version"
+	if fields["version"] != nil {
+		if string(fields["version"]) != "null" {
+			if err := json.Unmarshal(fields["version"], &resource.Version); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("version", err)...)
+			}
+
+		}
+		delete(fields, "version")
+
+	}
+
+	for field := range fields {
+		errs = append(errs, cog.MakeBuildErrors("NotificationTemplate", fmt.Errorf("unexpected field '%s'", field))...)
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 func (resource NotificationTemplate) Equals(other NotificationTemplate) bool {
 	if resource.Name == nil && other.Name != nil || resource.Name != nil && other.Name == nil {
 		return false
@@ -436,6 +1059,12 @@ func (resource NotificationTemplate) Equals(other NotificationTemplate) bool {
 	return true
 }
 
+// Validate checks any constraint that may be defined for this type
+// and returns all violations.
+func (resource NotificationTemplate) Validate() error {
+	return nil
+}
+
 type ObjectMatcher []string
 
 type ObjectMatchers []ObjectMatcher
@@ -465,6 +1094,271 @@ type Rule struct {
 	Updated              *time.Time            `json:"updated,omitempty"`
 }
 
+func (resource *Rule) UnmarshalJSONStrict(raw []byte) error {
+	if raw == nil {
+		return nil
+	}
+	var errs cog.BuildErrors
+
+	fields := make(map[string]json.RawMessage)
+	if err := json.Unmarshal(raw, &fields); err != nil {
+		return err
+	}
+	// Field "annotations"
+	if fields["annotations"] != nil {
+		if string(fields["annotations"]) != "null" {
+
+			if err := json.Unmarshal(fields["annotations"], &resource.Annotations); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("annotations", err)...)
+			}
+
+		}
+		delete(fields, "annotations")
+
+	}
+	// Field "condition"
+	if fields["condition"] != nil {
+		if string(fields["condition"]) != "null" {
+			if err := json.Unmarshal(fields["condition"], &resource.Condition); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("condition", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("condition", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "condition")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("condition", errors.New("required field is missing from input"))...)
+	}
+	// Field "data"
+	if fields["data"] != nil {
+		if string(fields["data"]) != "null" {
+
+			partialArray := []json.RawMessage{}
+			if err := json.Unmarshal(fields["data"], &partialArray); err != nil {
+				return err
+			}
+
+			for i1 := range partialArray {
+				var result1 Query
+
+				result1 = Query{}
+				if err := result1.UnmarshalJSONStrict(partialArray[i1]); err != nil {
+					errs = append(errs, cog.MakeBuildErrors("data["+strconv.Itoa(i1)+"]", err)...)
+				}
+				resource.Data = append(resource.Data, result1)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("data", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "data")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("data", errors.New("required field is missing from input"))...)
+	}
+	// Field "execErrState"
+	if fields["execErrState"] != nil {
+		if string(fields["execErrState"]) != "null" {
+			if err := json.Unmarshal(fields["execErrState"], &resource.ExecErrState); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("execErrState", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("execErrState", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "execErrState")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("execErrState", errors.New("required field is missing from input"))...)
+	}
+	// Field "folderUID"
+	if fields["folderUID"] != nil {
+		if string(fields["folderUID"]) != "null" {
+			if err := json.Unmarshal(fields["folderUID"], &resource.FolderUID); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("folderUID", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("folderUID", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "folderUID")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("folderUID", errors.New("required field is missing from input"))...)
+	}
+	// Field "for"
+	if fields["for"] != nil {
+		if string(fields["for"]) != "null" {
+			if err := json.Unmarshal(fields["for"], &resource.For); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("for", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("for", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "for")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("for", errors.New("required field is missing from input"))...)
+	}
+	// Field "id"
+	if fields["id"] != nil {
+		if string(fields["id"]) != "null" {
+			if err := json.Unmarshal(fields["id"], &resource.Id); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("id", err)...)
+			}
+
+		}
+		delete(fields, "id")
+
+	}
+	// Field "isPaused"
+	if fields["isPaused"] != nil {
+		if string(fields["isPaused"]) != "null" {
+			if err := json.Unmarshal(fields["isPaused"], &resource.IsPaused); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("isPaused", err)...)
+			}
+
+		}
+		delete(fields, "isPaused")
+
+	}
+	// Field "labels"
+	if fields["labels"] != nil {
+		if string(fields["labels"]) != "null" {
+
+			if err := json.Unmarshal(fields["labels"], &resource.Labels); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("labels", err)...)
+			}
+
+		}
+		delete(fields, "labels")
+
+	}
+	// Field "noDataState"
+	if fields["noDataState"] != nil {
+		if string(fields["noDataState"]) != "null" {
+			if err := json.Unmarshal(fields["noDataState"], &resource.NoDataState); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("noDataState", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("noDataState", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "noDataState")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("noDataState", errors.New("required field is missing from input"))...)
+	}
+	// Field "notification_settings"
+	if fields["notification_settings"] != nil {
+		if string(fields["notification_settings"]) != "null" {
+
+			resource.NotificationSettings = &NotificationSettings{}
+			if err := resource.NotificationSettings.UnmarshalJSONStrict(fields["notification_settings"]); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("notification_settings", err)...)
+			}
+
+		}
+		delete(fields, "notification_settings")
+
+	}
+	// Field "orgID"
+	if fields["orgID"] != nil {
+		if string(fields["orgID"]) != "null" {
+			if err := json.Unmarshal(fields["orgID"], &resource.OrgID); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("orgID", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("orgID", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "orgID")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("orgID", errors.New("required field is missing from input"))...)
+	}
+	// Field "provenance"
+	if fields["provenance"] != nil {
+		if string(fields["provenance"]) != "null" {
+			if err := json.Unmarshal(fields["provenance"], &resource.Provenance); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("provenance", err)...)
+			}
+
+		}
+		delete(fields, "provenance")
+
+	}
+	// Field "record"
+	if fields["record"] != nil {
+		if string(fields["record"]) != "null" {
+
+			resource.Record = &RecordRule{}
+			if err := resource.Record.UnmarshalJSONStrict(fields["record"]); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("record", err)...)
+			}
+
+		}
+		delete(fields, "record")
+
+	}
+	// Field "ruleGroup"
+	if fields["ruleGroup"] != nil {
+		if string(fields["ruleGroup"]) != "null" {
+			if err := json.Unmarshal(fields["ruleGroup"], &resource.RuleGroup); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("ruleGroup", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("ruleGroup", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "ruleGroup")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("ruleGroup", errors.New("required field is missing from input"))...)
+	}
+	// Field "title"
+	if fields["title"] != nil {
+		if string(fields["title"]) != "null" {
+			if err := json.Unmarshal(fields["title"], &resource.Title); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("title", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("title", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "title")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("title", errors.New("required field is missing from input"))...)
+	}
+	// Field "uid"
+	if fields["uid"] != nil {
+		if string(fields["uid"]) != "null" {
+			if err := json.Unmarshal(fields["uid"], &resource.Uid); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("uid", err)...)
+			}
+
+		}
+		delete(fields, "uid")
+
+	}
+	// Field "updated"
+	if fields["updated"] != nil {
+		if string(fields["updated"]) != "null" {
+			if err := json.Unmarshal(fields["updated"], &resource.Updated); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("updated", err)...)
+			}
+
+		}
+		delete(fields, "updated")
+
+	}
+
+	for field := range fields {
+		errs = append(errs, cog.MakeBuildErrors("Rule", fmt.Errorf("unexpected field '%s'", field))...)
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 func (resource Rule) Equals(other Rule) bool {
 
 	if len(resource.Annotations) != len(other.Annotations) {
@@ -587,11 +1481,127 @@ func (resource Rule) Equals(other Rule) bool {
 	return true
 }
 
+// Validate checks any constraint that may be defined for this type
+// and returns all violations.
+func (resource Rule) Validate() error {
+	var errs cog.BuildErrors
+
+	for i1 := range resource.Data {
+		if err := resource.Data[i1].Validate(); err != nil {
+			errs = append(errs, cog.MakeBuildErrors("data["+strconv.Itoa(i1)+"]", err)...)
+		}
+	}
+	if resource.NotificationSettings != nil {
+		if err := resource.NotificationSettings.Validate(); err != nil {
+			errs = append(errs, cog.MakeBuildErrors("notification_settings", err)...)
+		}
+	}
+	if resource.Record != nil {
+		if err := resource.Record.Validate(); err != nil {
+			errs = append(errs, cog.MakeBuildErrors("record", err)...)
+		}
+	}
+	if !(len([]rune(resource.RuleGroup)) >= 0x1) {
+		errs = append(errs, cog.MakeBuildErrors(
+			"ruleGroup",
+			errors.New("must be >= 1"),
+		)...)
+	}
+	if !(len([]rune(resource.RuleGroup)) <= 0xbe) {
+		errs = append(errs, cog.MakeBuildErrors(
+			"ruleGroup",
+			errors.New("must be <= 190"),
+		)...)
+	}
+	if !(len([]rune(resource.Title)) >= 0x1) {
+		errs = append(errs, cog.MakeBuildErrors(
+			"title",
+			errors.New("must be >= 1"),
+		)...)
+	}
+	if !(len([]rune(resource.Title)) <= 0xbe) {
+		errs = append(errs, cog.MakeBuildErrors(
+			"title",
+			errors.New("must be <= 190"),
+		)...)
+	}
+	if resource.Uid != nil {
+		if !(len([]rune(*resource.Uid)) >= 0x1) {
+			errs = append(errs, cog.MakeBuildErrors(
+				"uid",
+				errors.New("must be >= 1"),
+			)...)
+		}
+		if !(len([]rune(*resource.Uid)) <= 0x28) {
+			errs = append(errs, cog.MakeBuildErrors(
+				"uid",
+				errors.New("must be <= 40"),
+			)...)
+		}
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 type RecordRule struct {
 	From   string `json:"from"`
 	Metric string `json:"metric"`
 }
 
+func (resource *RecordRule) UnmarshalJSONStrict(raw []byte) error {
+	if raw == nil {
+		return nil
+	}
+	var errs cog.BuildErrors
+
+	fields := make(map[string]json.RawMessage)
+	if err := json.Unmarshal(raw, &fields); err != nil {
+		return err
+	}
+	// Field "from"
+	if fields["from"] != nil {
+		if string(fields["from"]) != "null" {
+			if err := json.Unmarshal(fields["from"], &resource.From); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("from", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("from", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "from")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("from", errors.New("required field is missing from input"))...)
+	}
+	// Field "metric"
+	if fields["metric"] != nil {
+		if string(fields["metric"]) != "null" {
+			if err := json.Unmarshal(fields["metric"], &resource.Metric); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("metric", err)...)
+			}
+		} else {
+			errs = append(errs, cog.MakeBuildErrors("metric", errors.New("required field is null"))...)
+
+		}
+		delete(fields, "metric")
+	} else {
+		errs = append(errs, cog.MakeBuildErrors("metric", errors.New("required field is missing from input"))...)
+	}
+
+	for field := range fields {
+		errs = append(errs, cog.MakeBuildErrors("RecordRule", fmt.Errorf("unexpected field '%s'", field))...)
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 func (resource RecordRule) Equals(other RecordRule) bool {
 	if resource.From != other.From {
 		return false
@@ -603,6 +1613,12 @@ func (resource RecordRule) Equals(other RecordRule) bool {
 	return true
 }
 
+// Validate checks any constraint that may be defined for this type
+// and returns all violations.
+func (resource RecordRule) Validate() error {
+	return nil
+}
+
 // RelativeTimeRange is the per query start and end time
 // for requests.
 type RelativeTimeRange struct {
@@ -614,6 +1630,50 @@ type RelativeTimeRange struct {
 	To *Duration `json:"to,omitempty"`
 }
 
+func (resource *RelativeTimeRange) UnmarshalJSONStrict(raw []byte) error {
+	if raw == nil {
+		return nil
+	}
+	var errs cog.BuildErrors
+
+	fields := make(map[string]json.RawMessage)
+	if err := json.Unmarshal(raw, &fields); err != nil {
+		return err
+	}
+	// Field "from"
+	if fields["from"] != nil {
+		if string(fields["from"]) != "null" {
+			if err := json.Unmarshal(fields["from"], &resource.From); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("from", err)...)
+			}
+
+		}
+		delete(fields, "from")
+
+	}
+	// Field "to"
+	if fields["to"] != nil {
+		if string(fields["to"]) != "null" {
+			if err := json.Unmarshal(fields["to"], &resource.To); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("to", err)...)
+			}
+
+		}
+		delete(fields, "to")
+
+	}
+
+	for field := range fields {
+		errs = append(errs, cog.MakeBuildErrors("RelativeTimeRange", fmt.Errorf("unexpected field '%s'", field))...)
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 func (resource RelativeTimeRange) Equals(other RelativeTimeRange) bool {
 	if resource.From == nil && other.From != nil || resource.From != nil && other.From == nil {
 		return false
@@ -637,6 +1697,12 @@ func (resource RelativeTimeRange) Equals(other RelativeTimeRange) bool {
 	return true
 }
 
+// Validate checks any constraint that may be defined for this type
+// and returns all violations.
+func (resource RelativeTimeRange) Validate() error {
+	return nil
+}
+
 // A Route is a node that contains definitions of how to handle alerts. This is modified
 // from the upstream alertmanager in that it adds the ObjectMatchers property.
 type NotificationPolicy struct {
@@ -684,6 +1750,212 @@ type NotificationPolicy struct {
 	Routes []NotificationPolicy `json:"routes,omitempty"`
 }
 
+func (resource *NotificationPolicy) UnmarshalJSONStrict(raw []byte) error {
+	if raw == nil {
+		return nil
+	}
+	var errs cog.BuildErrors
+
+	fields := make(map[string]json.RawMessage)
+	if err := json.Unmarshal(raw, &fields); err != nil {
+		return err
+	}
+	// Field "active_time_intervals"
+	if fields["active_time_intervals"] != nil {
+		if string(fields["active_time_intervals"]) != "null" {
+
+			if err := json.Unmarshal(fields["active_time_intervals"], &resource.ActiveTimeIntervals); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("active_time_intervals", err)...)
+			}
+
+		}
+		delete(fields, "active_time_intervals")
+
+	}
+	// Field "continue"
+	if fields["continue"] != nil {
+		if string(fields["continue"]) != "null" {
+			if err := json.Unmarshal(fields["continue"], &resource.Continue); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("continue", err)...)
+			}
+
+		}
+		delete(fields, "continue")
+
+	}
+	// Field "group_by"
+	if fields["group_by"] != nil {
+		if string(fields["group_by"]) != "null" {
+
+			if err := json.Unmarshal(fields["group_by"], &resource.GroupBy); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("group_by", err)...)
+			}
+
+		}
+		delete(fields, "group_by")
+
+	}
+	// Field "group_interval"
+	if fields["group_interval"] != nil {
+		if string(fields["group_interval"]) != "null" {
+			if err := json.Unmarshal(fields["group_interval"], &resource.GroupInterval); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("group_interval", err)...)
+			}
+
+		}
+		delete(fields, "group_interval")
+
+	}
+	// Field "group_wait"
+	if fields["group_wait"] != nil {
+		if string(fields["group_wait"]) != "null" {
+			if err := json.Unmarshal(fields["group_wait"], &resource.GroupWait); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("group_wait", err)...)
+			}
+
+		}
+		delete(fields, "group_wait")
+
+	}
+	// Field "match"
+	if fields["match"] != nil {
+		if string(fields["match"]) != "null" {
+
+			if err := json.Unmarshal(fields["match"], &resource.Match); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("match", err)...)
+			}
+
+		}
+		delete(fields, "match")
+
+	}
+	// Field "match_re"
+	if fields["match_re"] != nil {
+		if string(fields["match_re"]) != "null" {
+
+			if err := json.Unmarshal(fields["match_re"], &resource.MatchRe); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("match_re", err)...)
+			}
+
+		}
+		delete(fields, "match_re")
+
+	}
+	// Field "matchers"
+	if fields["matchers"] != nil {
+		if string(fields["matchers"]) != "null" {
+
+			partialArray := []json.RawMessage{}
+			if err := json.Unmarshal(fields["matchers"], &partialArray); err != nil {
+				return err
+			}
+
+			for i1 := range partialArray {
+				var result1 Matcher
+
+				result1 = Matcher{}
+				if err := result1.UnmarshalJSONStrict(partialArray[i1]); err != nil {
+					errs = append(errs, cog.MakeBuildErrors("matchers["+strconv.Itoa(i1)+"]", err)...)
+				}
+				resource.Matchers = cog.ToPtr(append(*resource.Matchers, result1))
+			}
+
+		}
+		delete(fields, "matchers")
+
+	}
+	// Field "mute_time_intervals"
+	if fields["mute_time_intervals"] != nil {
+		if string(fields["mute_time_intervals"]) != "null" {
+
+			if err := json.Unmarshal(fields["mute_time_intervals"], &resource.MuteTimeIntervals); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("mute_time_intervals", err)...)
+			}
+
+		}
+		delete(fields, "mute_time_intervals")
+
+	}
+	// Field "object_matchers"
+	if fields["object_matchers"] != nil {
+		if string(fields["object_matchers"]) != "null" {
+
+			if err := json.Unmarshal(fields["object_matchers"], &resource.ObjectMatchers); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("object_matchers", err)...)
+			}
+
+		}
+		delete(fields, "object_matchers")
+
+	}
+	// Field "provenance"
+	if fields["provenance"] != nil {
+		if string(fields["provenance"]) != "null" {
+			if err := json.Unmarshal(fields["provenance"], &resource.Provenance); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("provenance", err)...)
+			}
+
+		}
+		delete(fields, "provenance")
+
+	}
+	// Field "receiver"
+	if fields["receiver"] != nil {
+		if string(fields["receiver"]) != "null" {
+			if err := json.Unmarshal(fields["receiver"], &resource.Receiver); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("receiver", err)...)
+			}
+
+		}
+		delete(fields, "receiver")
+
+	}
+	// Field "repeat_interval"
+	if fields["repeat_interval"] != nil {
+		if string(fields["repeat_interval"]) != "null" {
+			if err := json.Unmarshal(fields["repeat_interval"], &resource.RepeatInterval); err != nil {
+				errs = append(errs, cog.MakeBuildErrors("repeat_interval", err)...)
+			}
+
+		}
+		delete(fields, "repeat_interval")
+
+	}
+	// Field "routes"
+	if fields["routes"] != nil {
+		if string(fields["routes"]) != "null" {
+
+			partialArray := []json.RawMessage{}
+			if err := json.Unmarshal(fields["routes"], &partialArray); err != nil {
+				return err
+			}
+
+			for i1 := range partialArray {
+				var result1 NotificationPolicy
+
+				result1 = NotificationPolicy{}
+				if err := result1.UnmarshalJSONStrict(partialArray[i1]); err != nil {
+					errs = append(errs, cog.MakeBuildErrors("routes["+strconv.Itoa(i1)+"]", err)...)
+				}
+				resource.Routes = append(resource.Routes, result1)
+			}
+
+		}
+		delete(fields, "routes")
+
+	}
+
+	for field := range fields {
+		errs = append(errs, cog.MakeBuildErrors("NotificationPolicy", fmt.Errorf("unexpected field '%s'", field))...)
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+
+	return errs
+}
+
 func (resource NotificationPolicy) Equals(other NotificationPolicy) bool {
 
 	if len(resource.ActiveTimeIntervals) != len(other.ActiveTimeIntervals) {
@@ -848,11 +2120,85 @@ func (resource NotificationPolicy) Equals(other Notific...*[Comment body truncated]*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant