// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1api20230301

import (
	"encoding/json"
	storage "github.com/Azure/azure-service-operator/v2/api/alertsmanagement/v1api20230301/storage"
	"github.com/google/go-cmp/cmp"
	"github.com/google/go-cmp/cmp/cmpopts"
	"github.com/kr/pretty"
	"github.com/kylelemons/godebug/diff"
	"github.com/leanovate/gopter"
	"github.com/leanovate/gopter/gen"
	"github.com/leanovate/gopter/prop"
	"os"
	"reflect"
	"testing"
)

func Test_PrometheusRule_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from PrometheusRule to PrometheusRule via AssignProperties_To_PrometheusRule & AssignProperties_From_PrometheusRule returns original",
		prop.ForAll(RunPropertyAssignmentTestForPrometheusRule, PrometheusRuleGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForPrometheusRule tests if a specific instance of PrometheusRule can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForPrometheusRule(subject PrometheusRule) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.PrometheusRule
	err := copied.AssignProperties_To_PrometheusRule(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual PrometheusRule
	err = actual.AssignProperties_From_PrometheusRule(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

func Test_PrometheusRule_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 100
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of PrometheusRule via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrometheusRule, PrometheusRuleGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

// RunJSONSerializationTestForPrometheusRule runs a test to see if a specific instance of PrometheusRule round trips to JSON and back losslessly
func RunJSONSerializationTestForPrometheusRule(subject PrometheusRule) string {
	// Serialize to JSON
	bin, err := json.Marshal(subject)
	if err != nil {
		return err.Error()
	}

	// Deserialize back into memory
	var actual PrometheusRule
	err = json.Unmarshal(bin, &actual)
	if err != nil {
		return err.Error()
	}

	// Check for outcome
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

// Generator of PrometheusRule instances for property testing - lazily instantiated by PrometheusRuleGenerator()
var prometheusRuleGenerator gopter.Gen

// PrometheusRuleGenerator returns a generator of PrometheusRule instances for property testing.
// We first initialize prometheusRuleGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func PrometheusRuleGenerator() gopter.Gen {
	if prometheusRuleGenerator != nil {
		return prometheusRuleGenerator
	}

	generators := make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForPrometheusRule(generators)
	prometheusRuleGenerator = gen.Struct(reflect.TypeOf(PrometheusRule{}), generators)

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForPrometheusRule(generators)
	AddRelatedPropertyGeneratorsForPrometheusRule(generators)
	prometheusRuleGenerator = gen.Struct(reflect.TypeOf(PrometheusRule{}), generators)

	return prometheusRuleGenerator
}

// AddIndependentPropertyGeneratorsForPrometheusRule is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForPrometheusRule(gens map[string]gopter.Gen) {
	gens["Alert"] = gen.PtrOf(gen.AlphaString())
	gens["Annotations"] = gen.MapOf(
		gen.AlphaString(),
		gen.AlphaString())
	gens["Enabled"] = gen.PtrOf(gen.Bool())
	gens["Expression"] = gen.PtrOf(gen.AlphaString())
	gens["For"] = gen.PtrOf(gen.AlphaString())
	gens["Labels"] = gen.MapOf(
		gen.AlphaString(),
		gen.AlphaString())
	gens["Record"] = gen.PtrOf(gen.AlphaString())
	gens["Severity"] = gen.PtrOf(gen.Int())
}

// AddRelatedPropertyGeneratorsForPrometheusRule is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForPrometheusRule(gens map[string]gopter.Gen) {
	gens["Actions"] = gen.SliceOf(PrometheusRuleGroupActionGenerator())
	gens["ResolveConfiguration"] = gen.PtrOf(PrometheusRuleResolveConfigurationGenerator())
}

func Test_PrometheusRuleGroup_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	parameters.MinSuccessfulTests = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from PrometheusRuleGroup to hub returns original",
		prop.ForAll(RunResourceConversionTestForPrometheusRuleGroup, PrometheusRuleGroupGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunResourceConversionTestForPrometheusRuleGroup tests if a specific instance of PrometheusRuleGroup round trips to the hub storage version and back losslessly
func RunResourceConversionTestForPrometheusRuleGroup(subject PrometheusRuleGroup) string {
	// Copy subject to make sure conversion doesn't modify it
	copied := subject.DeepCopy()

	// Convert to our hub version
	var hub storage.PrometheusRuleGroup
	err := copied.ConvertTo(&hub)
	if err != nil {
		return err.Error()
	}

	// Convert from our hub version
	var actual PrometheusRuleGroup
	err = actual.ConvertFrom(&hub)
	if err != nil {
		return err.Error()
	}

	// Compare actual with what we started with
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

func Test_PrometheusRuleGroup_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from PrometheusRuleGroup to PrometheusRuleGroup via AssignProperties_To_PrometheusRuleGroup & AssignProperties_From_PrometheusRuleGroup returns original",
		prop.ForAll(RunPropertyAssignmentTestForPrometheusRuleGroup, PrometheusRuleGroupGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForPrometheusRuleGroup tests if a specific instance of PrometheusRuleGroup can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForPrometheusRuleGroup(subject PrometheusRuleGroup) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.PrometheusRuleGroup
	err := copied.AssignProperties_To_PrometheusRuleGroup(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual PrometheusRuleGroup
	err = actual.AssignProperties_From_PrometheusRuleGroup(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

func Test_PrometheusRuleGroup_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 20
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of PrometheusRuleGroup via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrometheusRuleGroup, PrometheusRuleGroupGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

// RunJSONSerializationTestForPrometheusRuleGroup runs a test to see if a specific instance of PrometheusRuleGroup round trips to JSON and back losslessly
func RunJSONSerializationTestForPrometheusRuleGroup(subject PrometheusRuleGroup) string {
	// Serialize to JSON
	bin, err := json.Marshal(subject)
	if err != nil {
		return err.Error()
	}

	// Deserialize back into memory
	var actual PrometheusRuleGroup
	err = json.Unmarshal(bin, &actual)
	if err != nil {
		return err.Error()
	}

	// Check for outcome
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

// Generator of PrometheusRuleGroup instances for property testing - lazily instantiated by
// PrometheusRuleGroupGenerator()
var prometheusRuleGroupGenerator gopter.Gen

// PrometheusRuleGroupGenerator returns a generator of PrometheusRuleGroup instances for property testing.
func PrometheusRuleGroupGenerator() gopter.Gen {
	if prometheusRuleGroupGenerator != nil {
		return prometheusRuleGroupGenerator
	}

	generators := make(map[string]gopter.Gen)
	AddRelatedPropertyGeneratorsForPrometheusRuleGroup(generators)
	prometheusRuleGroupGenerator = gen.Struct(reflect.TypeOf(PrometheusRuleGroup{}), generators)

	return prometheusRuleGroupGenerator
}

// AddRelatedPropertyGeneratorsForPrometheusRuleGroup is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForPrometheusRuleGroup(gens map[string]gopter.Gen) {
	gens["Spec"] = PrometheusRuleGroup_SpecGenerator()
	gens["Status"] = PrometheusRuleGroup_STATUSGenerator()
}

func Test_PrometheusRuleGroupAction_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from PrometheusRuleGroupAction to PrometheusRuleGroupAction via AssignProperties_To_PrometheusRuleGroupAction & AssignProperties_From_PrometheusRuleGroupAction returns original",
		prop.ForAll(RunPropertyAssignmentTestForPrometheusRuleGroupAction, PrometheusRuleGroupActionGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForPrometheusRuleGroupAction tests if a specific instance of PrometheusRuleGroupAction can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForPrometheusRuleGroupAction(subject PrometheusRuleGroupAction) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.PrometheusRuleGroupAction
	err := copied.AssignProperties_To_PrometheusRuleGroupAction(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual PrometheusRuleGroupAction
	err = actual.AssignProperties_From_PrometheusRuleGroupAction(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

func Test_PrometheusRuleGroupAction_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 100
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of PrometheusRuleGroupAction via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrometheusRuleGroupAction, PrometheusRuleGroupActionGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

// RunJSONSerializationTestForPrometheusRuleGroupAction runs a test to see if a specific instance of PrometheusRuleGroupAction round trips to JSON and back losslessly
func RunJSONSerializationTestForPrometheusRuleGroupAction(subject PrometheusRuleGroupAction) string {
	// Serialize to JSON
	bin, err := json.Marshal(subject)
	if err != nil {
		return err.Error()
	}

	// Deserialize back into memory
	var actual PrometheusRuleGroupAction
	err = json.Unmarshal(bin, &actual)
	if err != nil {
		return err.Error()
	}

	// Check for outcome
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

// Generator of PrometheusRuleGroupAction instances for property testing - lazily instantiated by
// PrometheusRuleGroupActionGenerator()
var prometheusRuleGroupActionGenerator gopter.Gen

// PrometheusRuleGroupActionGenerator returns a generator of PrometheusRuleGroupAction instances for property testing.
func PrometheusRuleGroupActionGenerator() gopter.Gen {
	if prometheusRuleGroupActionGenerator != nil {
		return prometheusRuleGroupActionGenerator
	}

	generators := make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForPrometheusRuleGroupAction(generators)
	prometheusRuleGroupActionGenerator = gen.Struct(reflect.TypeOf(PrometheusRuleGroupAction{}), generators)

	return prometheusRuleGroupActionGenerator
}

// AddIndependentPropertyGeneratorsForPrometheusRuleGroupAction is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForPrometheusRuleGroupAction(gens map[string]gopter.Gen) {
	gens["ActionProperties"] = gen.MapOf(
		gen.AlphaString(),
		gen.AlphaString())
}

func Test_PrometheusRuleGroupAction_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from PrometheusRuleGroupAction_STATUS to PrometheusRuleGroupAction_STATUS via AssignProperties_To_PrometheusRuleGroupAction_STATUS & AssignProperties_From_PrometheusRuleGroupAction_STATUS returns original",
		prop.ForAll(RunPropertyAssignmentTestForPrometheusRuleGroupAction_STATUS, PrometheusRuleGroupAction_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForPrometheusRuleGroupAction_STATUS tests if a specific instance of PrometheusRuleGroupAction_STATUS can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForPrometheusRuleGroupAction_STATUS(subject PrometheusRuleGroupAction_STATUS) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.PrometheusRuleGroupAction_STATUS
	err := copied.AssignProperties_To_PrometheusRuleGroupAction_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual PrometheusRuleGroupAction_STATUS
	err = actual.AssignProperties_From_PrometheusRuleGroupAction_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

func Test_PrometheusRuleGroupAction_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 80
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of PrometheusRuleGroupAction_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrometheusRuleGroupAction_STATUS, PrometheusRuleGroupAction_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

// RunJSONSerializationTestForPrometheusRuleGroupAction_STATUS runs a test to see if a specific instance of PrometheusRuleGroupAction_STATUS round trips to JSON and back losslessly
func RunJSONSerializationTestForPrometheusRuleGroupAction_STATUS(subject PrometheusRuleGroupAction_STATUS) string {
	// Serialize to JSON
	bin, err := json.Marshal(subject)
	if err != nil {
		return err.Error()
	}

	// Deserialize back into memory
	var actual PrometheusRuleGroupAction_STATUS
	err = json.Unmarshal(bin, &actual)
	if err != nil {
		return err.Error()
	}

	// Check for outcome
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

// Generator of PrometheusRuleGroupAction_STATUS instances for property testing - lazily instantiated by
// PrometheusRuleGroupAction_STATUSGenerator()
var prometheusRuleGroupAction_STATUSGenerator gopter.Gen

// PrometheusRuleGroupAction_STATUSGenerator returns a generator of PrometheusRuleGroupAction_STATUS instances for property testing.
func PrometheusRuleGroupAction_STATUSGenerator() gopter.Gen {
	if prometheusRuleGroupAction_STATUSGenerator != nil {
		return prometheusRuleGroupAction_STATUSGenerator
	}

	generators := make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForPrometheusRuleGroupAction_STATUS(generators)
	prometheusRuleGroupAction_STATUSGenerator = gen.Struct(reflect.TypeOf(PrometheusRuleGroupAction_STATUS{}), generators)

	return prometheusRuleGroupAction_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForPrometheusRuleGroupAction_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForPrometheusRuleGroupAction_STATUS(gens map[string]gopter.Gen) {
	gens["ActionGroupId"] = gen.PtrOf(gen.AlphaString())
	gens["ActionProperties"] = gen.MapOf(
		gen.AlphaString(),
		gen.AlphaString())
}

func Test_PrometheusRuleGroupOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from PrometheusRuleGroupOperatorSpec to PrometheusRuleGroupOperatorSpec via AssignProperties_To_PrometheusRuleGroupOperatorSpec & AssignProperties_From_PrometheusRuleGroupOperatorSpec returns original",
		prop.ForAll(RunPropertyAssignmentTestForPrometheusRuleGroupOperatorSpec, PrometheusRuleGroupOperatorSpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForPrometheusRuleGroupOperatorSpec tests if a specific instance of PrometheusRuleGroupOperatorSpec can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForPrometheusRuleGroupOperatorSpec(subject PrometheusRuleGroupOperatorSpec) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.PrometheusRuleGroupOperatorSpec
	err := copied.AssignProperties_To_PrometheusRuleGroupOperatorSpec(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual PrometheusRuleGroupOperatorSpec
	err = actual.AssignProperties_From_PrometheusRuleGroupOperatorSpec(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

func Test_PrometheusRuleGroupOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 100
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of PrometheusRuleGroupOperatorSpec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrometheusRuleGroupOperatorSpec, PrometheusRuleGroupOperatorSpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

// RunJSONSerializationTestForPrometheusRuleGroupOperatorSpec runs a test to see if a specific instance of PrometheusRuleGroupOperatorSpec round trips to JSON and back losslessly
func RunJSONSerializationTestForPrometheusRuleGroupOperatorSpec(subject PrometheusRuleGroupOperatorSpec) string {
	// Serialize to JSON
	bin, err := json.Marshal(subject)
	if err != nil {
		return err.Error()
	}

	// Deserialize back into memory
	var actual PrometheusRuleGroupOperatorSpec
	err = json.Unmarshal(bin, &actual)
	if err != nil {
		return err.Error()
	}

	// Check for outcome
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

// Generator of PrometheusRuleGroupOperatorSpec instances for property testing - lazily instantiated by
// PrometheusRuleGroupOperatorSpecGenerator()
var prometheusRuleGroupOperatorSpecGenerator gopter.Gen

// PrometheusRuleGroupOperatorSpecGenerator returns a generator of PrometheusRuleGroupOperatorSpec instances for property testing.
func PrometheusRuleGroupOperatorSpecGenerator() gopter.Gen {
	if prometheusRuleGroupOperatorSpecGenerator != nil {
		return prometheusRuleGroupOperatorSpecGenerator
	}

	generators := make(map[string]gopter.Gen)
	prometheusRuleGroupOperatorSpecGenerator = gen.Struct(reflect.TypeOf(PrometheusRuleGroupOperatorSpec{}), generators)

	return prometheusRuleGroupOperatorSpecGenerator
}

func Test_PrometheusRuleGroup_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from PrometheusRuleGroup_STATUS to PrometheusRuleGroup_STATUS via AssignProperties_To_PrometheusRuleGroup_STATUS & AssignProperties_From_PrometheusRuleGroup_STATUS returns original",
		prop.ForAll(RunPropertyAssignmentTestForPrometheusRuleGroup_STATUS, PrometheusRuleGroup_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForPrometheusRuleGroup_STATUS tests if a specific instance of PrometheusRuleGroup_STATUS can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForPrometheusRuleGroup_STATUS(subject PrometheusRuleGroup_STATUS) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.PrometheusRuleGroup_STATUS
	err := copied.AssignProperties_To_PrometheusRuleGroup_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual PrometheusRuleGroup_STATUS
	err = actual.AssignProperties_From_PrometheusRuleGroup_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

func Test_PrometheusRuleGroup_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 80
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of PrometheusRuleGroup_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrometheusRuleGroup_STATUS, PrometheusRuleGroup_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

// RunJSONSerializationTestForPrometheusRuleGroup_STATUS runs a test to see if a specific instance of PrometheusRuleGroup_STATUS round trips to JSON and back losslessly
func RunJSONSerializationTestForPrometheusRuleGroup_STATUS(subject PrometheusRuleGroup_STATUS) string {
	// Serialize to JSON
	bin, err := json.Marshal(subject)
	if err != nil {
		return err.Error()
	}

	// Deserialize back into memory
	var actual PrometheusRuleGroup_STATUS
	err = json.Unmarshal(bin, &actual)
	if err != nil {
		return err.Error()
	}

	// Check for outcome
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

// Generator of PrometheusRuleGroup_STATUS instances for property testing - lazily instantiated by
// PrometheusRuleGroup_STATUSGenerator()
var prometheusRuleGroup_STATUSGenerator gopter.Gen

// PrometheusRuleGroup_STATUSGenerator returns a generator of PrometheusRuleGroup_STATUS instances for property testing.
// We first initialize prometheusRuleGroup_STATUSGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func PrometheusRuleGroup_STATUSGenerator() gopter.Gen {
	if prometheusRuleGroup_STATUSGenerator != nil {
		return prometheusRuleGroup_STATUSGenerator
	}

	generators := make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForPrometheusRuleGroup_STATUS(generators)
	prometheusRuleGroup_STATUSGenerator = gen.Struct(reflect.TypeOf(PrometheusRuleGroup_STATUS{}), generators)

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForPrometheusRuleGroup_STATUS(generators)
	AddRelatedPropertyGeneratorsForPrometheusRuleGroup_STATUS(generators)
	prometheusRuleGroup_STATUSGenerator = gen.Struct(reflect.TypeOf(PrometheusRuleGroup_STATUS{}), generators)

	return prometheusRuleGroup_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForPrometheusRuleGroup_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForPrometheusRuleGroup_STATUS(gens map[string]gopter.Gen) {
	gens["ClusterName"] = gen.PtrOf(gen.AlphaString())
	gens["Description"] = gen.PtrOf(gen.AlphaString())
	gens["Enabled"] = gen.PtrOf(gen.Bool())
	gens["Id"] = gen.PtrOf(gen.AlphaString())
	gens["Interval"] = gen.PtrOf(gen.AlphaString())
	gens["Location"] = gen.PtrOf(gen.AlphaString())
	gens["Name"] = gen.PtrOf(gen.AlphaString())
	gens["Scopes"] = gen.SliceOf(gen.AlphaString())
	gens["Tags"] = gen.MapOf(
		gen.AlphaString(),
		gen.AlphaString())
	gens["Type"] = gen.PtrOf(gen.AlphaString())
}

// AddRelatedPropertyGeneratorsForPrometheusRuleGroup_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForPrometheusRuleGroup_STATUS(gens map[string]gopter.Gen) {
	gens["Rules"] = gen.SliceOf(PrometheusRule_STATUSGenerator())
	gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator())
}

func Test_PrometheusRuleGroup_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from PrometheusRuleGroup_Spec to PrometheusRuleGroup_Spec via AssignProperties_To_PrometheusRuleGroup_Spec & AssignProperties_From_PrometheusRuleGroup_Spec returns original",
		prop.ForAll(RunPropertyAssignmentTestForPrometheusRuleGroup_Spec, PrometheusRuleGroup_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForPrometheusRuleGroup_Spec tests if a specific instance of PrometheusRuleGroup_Spec can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForPrometheusRuleGroup_Spec(subject PrometheusRuleGroup_Spec) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.PrometheusRuleGroup_Spec
	err := copied.AssignProperties_To_PrometheusRuleGroup_Spec(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual PrometheusRuleGroup_Spec
	err = actual.AssignProperties_From_PrometheusRuleGroup_Spec(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

func Test_PrometheusRuleGroup_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 80
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of PrometheusRuleGroup_Spec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrometheusRuleGroup_Spec, PrometheusRuleGroup_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

// RunJSONSerializationTestForPrometheusRuleGroup_Spec runs a test to see if a specific instance of PrometheusRuleGroup_Spec round trips to JSON and back losslessly
func RunJSONSerializationTestForPrometheusRuleGroup_Spec(subject PrometheusRuleGroup_Spec) string {
	// Serialize to JSON
	bin, err := json.Marshal(subject)
	if err != nil {
		return err.Error()
	}

	// Deserialize back into memory
	var actual PrometheusRuleGroup_Spec
	err = json.Unmarshal(bin, &actual)
	if err != nil {
		return err.Error()
	}

	// Check for outcome
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

// Generator of PrometheusRuleGroup_Spec instances for property testing - lazily instantiated by
// PrometheusRuleGroup_SpecGenerator()
var prometheusRuleGroup_SpecGenerator gopter.Gen

// PrometheusRuleGroup_SpecGenerator returns a generator of PrometheusRuleGroup_Spec instances for property testing.
// We first initialize prometheusRuleGroup_SpecGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func PrometheusRuleGroup_SpecGenerator() gopter.Gen {
	if prometheusRuleGroup_SpecGenerator != nil {
		return prometheusRuleGroup_SpecGenerator
	}

	generators := make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForPrometheusRuleGroup_Spec(generators)
	prometheusRuleGroup_SpecGenerator = gen.Struct(reflect.TypeOf(PrometheusRuleGroup_Spec{}), generators)

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForPrometheusRuleGroup_Spec(generators)
	AddRelatedPropertyGeneratorsForPrometheusRuleGroup_Spec(generators)
	prometheusRuleGroup_SpecGenerator = gen.Struct(reflect.TypeOf(PrometheusRuleGroup_Spec{}), generators)

	return prometheusRuleGroup_SpecGenerator
}

// AddIndependentPropertyGeneratorsForPrometheusRuleGroup_Spec is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForPrometheusRuleGroup_Spec(gens map[string]gopter.Gen) {
	gens["AzureName"] = gen.AlphaString()
	gens["ClusterName"] = gen.PtrOf(gen.AlphaString())
	gens["Description"] = gen.PtrOf(gen.AlphaString())
	gens["Enabled"] = gen.PtrOf(gen.Bool())
	gens["Interval"] = gen.PtrOf(gen.AlphaString())
	gens["Location"] = gen.PtrOf(gen.AlphaString())
	gens["Tags"] = gen.MapOf(
		gen.AlphaString(),
		gen.AlphaString())
}

// AddRelatedPropertyGeneratorsForPrometheusRuleGroup_Spec is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForPrometheusRuleGroup_Spec(gens map[string]gopter.Gen) {
	gens["OperatorSpec"] = gen.PtrOf(PrometheusRuleGroupOperatorSpecGenerator())
	gens["Rules"] = gen.SliceOf(PrometheusRuleGenerator())
}

func Test_PrometheusRuleResolveConfiguration_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from PrometheusRuleResolveConfiguration to PrometheusRuleResolveConfiguration via AssignProperties_To_PrometheusRuleResolveConfiguration & AssignProperties_From_PrometheusRuleResolveConfiguration returns original",
		prop.ForAll(RunPropertyAssignmentTestForPrometheusRuleResolveConfiguration, PrometheusRuleResolveConfigurationGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForPrometheusRuleResolveConfiguration tests if a specific instance of PrometheusRuleResolveConfiguration can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForPrometheusRuleResolveConfiguration(subject PrometheusRuleResolveConfiguration) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.PrometheusRuleResolveConfiguration
	err := copied.AssignProperties_To_PrometheusRuleResolveConfiguration(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual PrometheusRuleResolveConfiguration
	err = actual.AssignProperties_From_PrometheusRuleResolveConfiguration(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

func Test_PrometheusRuleResolveConfiguration_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 100
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of PrometheusRuleResolveConfiguration via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrometheusRuleResolveConfiguration, PrometheusRuleResolveConfigurationGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

// RunJSONSerializationTestForPrometheusRuleResolveConfiguration runs a test to see if a specific instance of PrometheusRuleResolveConfiguration round trips to JSON and back losslessly
func RunJSONSerializationTestForPrometheusRuleResolveConfiguration(subject PrometheusRuleResolveConfiguration) string {
	// Serialize to JSON
	bin, err := json.Marshal(subject)
	if err != nil {
		return err.Error()
	}

	// Deserialize back into memory
	var actual PrometheusRuleResolveConfiguration
	err = json.Unmarshal(bin, &actual)
	if err != nil {
		return err.Error()
	}

	// Check for outcome
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

// Generator of PrometheusRuleResolveConfiguration instances for property testing - lazily instantiated by
// PrometheusRuleResolveConfigurationGenerator()
var prometheusRuleResolveConfigurationGenerator gopter.Gen

// PrometheusRuleResolveConfigurationGenerator returns a generator of PrometheusRuleResolveConfiguration instances for property testing.
func PrometheusRuleResolveConfigurationGenerator() gopter.Gen {
	if prometheusRuleResolveConfigurationGenerator != nil {
		return prometheusRuleResolveConfigurationGenerator
	}

	generators := make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForPrometheusRuleResolveConfiguration(generators)
	prometheusRuleResolveConfigurationGenerator = gen.Struct(reflect.TypeOf(PrometheusRuleResolveConfiguration{}), generators)

	return prometheusRuleResolveConfigurationGenerator
}

// AddIndependentPropertyGeneratorsForPrometheusRuleResolveConfiguration is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForPrometheusRuleResolveConfiguration(gens map[string]gopter.Gen) {
	gens["AutoResolved"] = gen.PtrOf(gen.Bool())
	gens["TimeToResolve"] = gen.PtrOf(gen.AlphaString())
}

func Test_PrometheusRuleResolveConfiguration_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from PrometheusRuleResolveConfiguration_STATUS to PrometheusRuleResolveConfiguration_STATUS via AssignProperties_To_PrometheusRuleResolveConfiguration_STATUS & AssignProperties_From_PrometheusRuleResolveConfiguration_STATUS returns original",
		prop.ForAll(RunPropertyAssignmentTestForPrometheusRuleResolveConfiguration_STATUS, PrometheusRuleResolveConfiguration_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForPrometheusRuleResolveConfiguration_STATUS tests if a specific instance of PrometheusRuleResolveConfiguration_STATUS can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForPrometheusRuleResolveConfiguration_STATUS(subject PrometheusRuleResolveConfiguration_STATUS) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.PrometheusRuleResolveConfiguration_STATUS
	err := copied.AssignProperties_To_PrometheusRuleResolveConfiguration_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual PrometheusRuleResolveConfiguration_STATUS
	err = actual.AssignProperties_From_PrometheusRuleResolveConfiguration_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

func Test_PrometheusRuleResolveConfiguration_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 80
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of PrometheusRuleResolveConfiguration_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrometheusRuleResolveConfiguration_STATUS, PrometheusRuleResolveConfiguration_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

// RunJSONSerializationTestForPrometheusRuleResolveConfiguration_STATUS runs a test to see if a specific instance of PrometheusRuleResolveConfiguration_STATUS round trips to JSON and back losslessly
func RunJSONSerializationTestForPrometheusRuleResolveConfiguration_STATUS(subject PrometheusRuleResolveConfiguration_STATUS) string {
	// Serialize to JSON
	bin, err := json.Marshal(subject)
	if err != nil {
		return err.Error()
	}

	// Deserialize back into memory
	var actual PrometheusRuleResolveConfiguration_STATUS
	err = json.Unmarshal(bin, &actual)
	if err != nil {
		return err.Error()
	}

	// Check for outcome
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

// Generator of PrometheusRuleResolveConfiguration_STATUS instances for property testing - lazily instantiated by
// PrometheusRuleResolveConfiguration_STATUSGenerator()
var prometheusRuleResolveConfiguration_STATUSGenerator gopter.Gen

// PrometheusRuleResolveConfiguration_STATUSGenerator returns a generator of PrometheusRuleResolveConfiguration_STATUS instances for property testing.
func PrometheusRuleResolveConfiguration_STATUSGenerator() gopter.Gen {
	if prometheusRuleResolveConfiguration_STATUSGenerator != nil {
		return prometheusRuleResolveConfiguration_STATUSGenerator
	}

	generators := make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForPrometheusRuleResolveConfiguration_STATUS(generators)
	prometheusRuleResolveConfiguration_STATUSGenerator = gen.Struct(reflect.TypeOf(PrometheusRuleResolveConfiguration_STATUS{}), generators)

	return prometheusRuleResolveConfiguration_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForPrometheusRuleResolveConfiguration_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForPrometheusRuleResolveConfiguration_STATUS(gens map[string]gopter.Gen) {
	gens["AutoResolved"] = gen.PtrOf(gen.Bool())
	gens["TimeToResolve"] = gen.PtrOf(gen.AlphaString())
}

func Test_PrometheusRule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from PrometheusRule_STATUS to PrometheusRule_STATUS via AssignProperties_To_PrometheusRule_STATUS & AssignProperties_From_PrometheusRule_STATUS returns original",
		prop.ForAll(RunPropertyAssignmentTestForPrometheusRule_STATUS, PrometheusRule_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForPrometheusRule_STATUS tests if a specific instance of PrometheusRule_STATUS can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForPrometheusRule_STATUS(subject PrometheusRule_STATUS) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.PrometheusRule_STATUS
	err := copied.AssignProperties_To_PrometheusRule_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual PrometheusRule_STATUS
	err = actual.AssignProperties_From_PrometheusRule_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

func Test_PrometheusRule_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 80
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of PrometheusRule_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrometheusRule_STATUS, PrometheusRule_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

// RunJSONSerializationTestForPrometheusRule_STATUS runs a test to see if a specific instance of PrometheusRule_STATUS round trips to JSON and back losslessly
func RunJSONSerializationTestForPrometheusRule_STATUS(subject PrometheusRule_STATUS) string {
	// Serialize to JSON
	bin, err := json.Marshal(subject)
	if err != nil {
		return err.Error()
	}

	// Deserialize back into memory
	var actual PrometheusRule_STATUS
	err = json.Unmarshal(bin, &actual)
	if err != nil {
		return err.Error()
	}

	// Check for outcome
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

// Generator of PrometheusRule_STATUS instances for property testing - lazily instantiated by
// PrometheusRule_STATUSGenerator()
var prometheusRule_STATUSGenerator gopter.Gen

// PrometheusRule_STATUSGenerator returns a generator of PrometheusRule_STATUS instances for property testing.
// We first initialize prometheusRule_STATUSGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func PrometheusRule_STATUSGenerator() gopter.Gen {
	if prometheusRule_STATUSGenerator != nil {
		return prometheusRule_STATUSGenerator
	}

	generators := make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForPrometheusRule_STATUS(generators)
	prometheusRule_STATUSGenerator = gen.Struct(reflect.TypeOf(PrometheusRule_STATUS{}), generators)

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForPrometheusRule_STATUS(generators)
	AddRelatedPropertyGeneratorsForPrometheusRule_STATUS(generators)
	prometheusRule_STATUSGenerator = gen.Struct(reflect.TypeOf(PrometheusRule_STATUS{}), generators)

	return prometheusRule_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForPrometheusRule_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForPrometheusRule_STATUS(gens map[string]gopter.Gen) {
	gens["Alert"] = gen.PtrOf(gen.AlphaString())
	gens["Annotations"] = gen.MapOf(
		gen.AlphaString(),
		gen.AlphaString())
	gens["Enabled"] = gen.PtrOf(gen.Bool())
	gens["Expression"] = gen.PtrOf(gen.AlphaString())
	gens["For"] = gen.PtrOf(gen.AlphaString())
	gens["Labels"] = gen.MapOf(
		gen.AlphaString(),
		gen.AlphaString())
	gens["Record"] = gen.PtrOf(gen.AlphaString())
	gens["Severity"] = gen.PtrOf(gen.Int())
}

// AddRelatedPropertyGeneratorsForPrometheusRule_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForPrometheusRule_STATUS(gens map[string]gopter.Gen) {
	gens["Actions"] = gen.SliceOf(PrometheusRuleGroupAction_STATUSGenerator())
	gens["ResolveConfiguration"] = gen.PtrOf(PrometheusRuleResolveConfiguration_STATUSGenerator())
}

func Test_SystemData_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from SystemData_STATUS to SystemData_STATUS via AssignProperties_To_SystemData_STATUS & AssignProperties_From_SystemData_STATUS returns original",
		prop.ForAll(RunPropertyAssignmentTestForSystemData_STATUS, SystemData_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForSystemData_STATUS tests if a specific instance of SystemData_STATUS can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForSystemData_STATUS(subject SystemData_STATUS) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.SystemData_STATUS
	err := copied.AssignProperties_To_SystemData_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual SystemData_STATUS
	err = actual.AssignProperties_From_SystemData_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

func Test_SystemData_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 80
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of SystemData_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForSystemData_STATUS, SystemData_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

// RunJSONSerializationTestForSystemData_STATUS runs a test to see if a specific instance of SystemData_STATUS round trips to JSON and back losslessly
func RunJSONSerializationTestForSystemData_STATUS(subject SystemData_STATUS) string {
	// Serialize to JSON
	bin, err := json.Marshal(subject)
	if err != nil {
		return err.Error()
	}

	// Deserialize back into memory
	var actual SystemData_STATUS
	err = json.Unmarshal(bin, &actual)
	if err != nil {
		return err.Error()
	}

	// Check for outcome
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

// Generator of SystemData_STATUS instances for property testing - lazily instantiated by SystemData_STATUSGenerator()
var systemData_STATUSGenerator gopter.Gen

// SystemData_STATUSGenerator returns a generator of SystemData_STATUS instances for property testing.
func SystemData_STATUSGenerator() gopter.Gen {
	if systemData_STATUSGenerator != nil {
		return systemData_STATUSGenerator
	}

	generators := make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForSystemData_STATUS(generators)
	systemData_STATUSGenerator = gen.Struct(reflect.TypeOf(SystemData_STATUS{}), generators)

	return systemData_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForSystemData_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForSystemData_STATUS(gens map[string]gopter.Gen) {
	gens["CreatedAt"] = gen.PtrOf(gen.AlphaString())
	gens["CreatedBy"] = gen.PtrOf(gen.AlphaString())
	gens["CreatedByType"] = gen.PtrOf(gen.OneConstOf(
		SystemData_CreatedByType_STATUS_Application,
		SystemData_CreatedByType_STATUS_Key,
		SystemData_CreatedByType_STATUS_ManagedIdentity,
		SystemData_CreatedByType_STATUS_User))
	gens["LastModifiedAt"] = gen.PtrOf(gen.AlphaString())
	gens["LastModifiedBy"] = gen.PtrOf(gen.AlphaString())
	gens["LastModifiedByType"] = gen.PtrOf(gen.OneConstOf(
		SystemData_LastModifiedByType_STATUS_Application,
		SystemData_LastModifiedByType_STATUS_Key,
		SystemData_LastModifiedByType_STATUS_ManagedIdentity,
		SystemData_LastModifiedByType_STATUS_User))
}
