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

import (
	"encoding/json"
	"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_ExclusionManagedRule_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 ExclusionManagedRule via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForExclusionManagedRule, ExclusionManagedRuleGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ExclusionManagedRule
	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 ExclusionManagedRule instances for property testing - lazily instantiated by
// ExclusionManagedRuleGenerator()
var exclusionManagedRuleGenerator gopter.Gen

// ExclusionManagedRuleGenerator returns a generator of ExclusionManagedRule instances for property testing.
func ExclusionManagedRuleGenerator() gopter.Gen {
	if exclusionManagedRuleGenerator != nil {
		return exclusionManagedRuleGenerator
	}

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

	return exclusionManagedRuleGenerator
}

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

func Test_ExclusionManagedRuleGroup_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 ExclusionManagedRuleGroup via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForExclusionManagedRuleGroup, ExclusionManagedRuleGroupGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ExclusionManagedRuleGroup
	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 ExclusionManagedRuleGroup instances for property testing - lazily instantiated by
// ExclusionManagedRuleGroupGenerator()
var exclusionManagedRuleGroupGenerator gopter.Gen

// ExclusionManagedRuleGroupGenerator returns a generator of ExclusionManagedRuleGroup instances for property testing.
// We first initialize exclusionManagedRuleGroupGenerator 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 ExclusionManagedRuleGroupGenerator() gopter.Gen {
	if exclusionManagedRuleGroupGenerator != nil {
		return exclusionManagedRuleGroupGenerator
	}

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForExclusionManagedRuleGroup(generators)
	AddRelatedPropertyGeneratorsForExclusionManagedRuleGroup(generators)
	exclusionManagedRuleGroupGenerator = gen.Struct(reflect.TypeOf(ExclusionManagedRuleGroup{}), generators)

	return exclusionManagedRuleGroupGenerator
}

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

// AddRelatedPropertyGeneratorsForExclusionManagedRuleGroup is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForExclusionManagedRuleGroup(gens map[string]gopter.Gen) {
	gens["Rules"] = gen.SliceOf(ExclusionManagedRuleGenerator())
}

func Test_ExclusionManagedRuleSet_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 ExclusionManagedRuleSet via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForExclusionManagedRuleSet, ExclusionManagedRuleSetGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ExclusionManagedRuleSet
	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 ExclusionManagedRuleSet instances for property testing - lazily instantiated by
// ExclusionManagedRuleSetGenerator()
var exclusionManagedRuleSetGenerator gopter.Gen

// ExclusionManagedRuleSetGenerator returns a generator of ExclusionManagedRuleSet instances for property testing.
// We first initialize exclusionManagedRuleSetGenerator 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 ExclusionManagedRuleSetGenerator() gopter.Gen {
	if exclusionManagedRuleSetGenerator != nil {
		return exclusionManagedRuleSetGenerator
	}

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForExclusionManagedRuleSet(generators)
	AddRelatedPropertyGeneratorsForExclusionManagedRuleSet(generators)
	exclusionManagedRuleSetGenerator = gen.Struct(reflect.TypeOf(ExclusionManagedRuleSet{}), generators)

	return exclusionManagedRuleSetGenerator
}

// AddIndependentPropertyGeneratorsForExclusionManagedRuleSet is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForExclusionManagedRuleSet(gens map[string]gopter.Gen) {
	gens["RuleSetType"] = gen.PtrOf(gen.AlphaString())
	gens["RuleSetVersion"] = gen.PtrOf(gen.AlphaString())
}

// AddRelatedPropertyGeneratorsForExclusionManagedRuleSet is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForExclusionManagedRuleSet(gens map[string]gopter.Gen) {
	gens["RuleGroups"] = gen.SliceOf(ExclusionManagedRuleGroupGenerator())
}

func Test_GroupByUserSession_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 GroupByUserSession via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForGroupByUserSession, GroupByUserSessionGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual GroupByUserSession
	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 GroupByUserSession instances for property testing - lazily instantiated by GroupByUserSessionGenerator()
var groupByUserSessionGenerator gopter.Gen

// GroupByUserSessionGenerator returns a generator of GroupByUserSession instances for property testing.
func GroupByUserSessionGenerator() gopter.Gen {
	if groupByUserSessionGenerator != nil {
		return groupByUserSessionGenerator
	}

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

	return groupByUserSessionGenerator
}

// AddRelatedPropertyGeneratorsForGroupByUserSession is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForGroupByUserSession(gens map[string]gopter.Gen) {
	gens["GroupByVariables"] = gen.SliceOf(GroupByVariableGenerator())
}

func Test_GroupByVariable_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 GroupByVariable via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForGroupByVariable, GroupByVariableGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual GroupByVariable
	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 GroupByVariable instances for property testing - lazily instantiated by GroupByVariableGenerator()
var groupByVariableGenerator gopter.Gen

// GroupByVariableGenerator returns a generator of GroupByVariable instances for property testing.
func GroupByVariableGenerator() gopter.Gen {
	if groupByVariableGenerator != nil {
		return groupByVariableGenerator
	}

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

	return groupByVariableGenerator
}

// AddIndependentPropertyGeneratorsForGroupByVariable is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForGroupByVariable(gens map[string]gopter.Gen) {
	gens["VariableName"] = gen.PtrOf(gen.OneConstOf(GroupByVariable_VariableName_ClientAddr, GroupByVariable_VariableName_GeoLocation, GroupByVariable_VariableName_None))
}

func Test_ManagedRuleGroupOverride_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 ManagedRuleGroupOverride via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForManagedRuleGroupOverride, ManagedRuleGroupOverrideGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ManagedRuleGroupOverride
	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 ManagedRuleGroupOverride instances for property testing - lazily instantiated by
// ManagedRuleGroupOverrideGenerator()
var managedRuleGroupOverrideGenerator gopter.Gen

// ManagedRuleGroupOverrideGenerator returns a generator of ManagedRuleGroupOverride instances for property testing.
// We first initialize managedRuleGroupOverrideGenerator 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 ManagedRuleGroupOverrideGenerator() gopter.Gen {
	if managedRuleGroupOverrideGenerator != nil {
		return managedRuleGroupOverrideGenerator
	}

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForManagedRuleGroupOverride(generators)
	AddRelatedPropertyGeneratorsForManagedRuleGroupOverride(generators)
	managedRuleGroupOverrideGenerator = gen.Struct(reflect.TypeOf(ManagedRuleGroupOverride{}), generators)

	return managedRuleGroupOverrideGenerator
}

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

// AddRelatedPropertyGeneratorsForManagedRuleGroupOverride is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForManagedRuleGroupOverride(gens map[string]gopter.Gen) {
	gens["Rules"] = gen.SliceOf(ManagedRuleOverrideGenerator())
}

func Test_ManagedRuleOverride_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 ManagedRuleOverride via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForManagedRuleOverride, ManagedRuleOverrideGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ManagedRuleOverride
	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 ManagedRuleOverride instances for property testing - lazily instantiated by
// ManagedRuleOverrideGenerator()
var managedRuleOverrideGenerator gopter.Gen

// ManagedRuleOverrideGenerator returns a generator of ManagedRuleOverride instances for property testing.
func ManagedRuleOverrideGenerator() gopter.Gen {
	if managedRuleOverrideGenerator != nil {
		return managedRuleOverrideGenerator
	}

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

	return managedRuleOverrideGenerator
}

// AddIndependentPropertyGeneratorsForManagedRuleOverride is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForManagedRuleOverride(gens map[string]gopter.Gen) {
	gens["Action"] = gen.PtrOf(gen.OneConstOf(
		ActionType_Allow,
		ActionType_AnomalyScoring,
		ActionType_Block,
		ActionType_JSChallenge,
		ActionType_Log))
	gens["RuleId"] = gen.PtrOf(gen.AlphaString())
	gens["State"] = gen.PtrOf(gen.OneConstOf(ManagedRuleOverride_State_Disabled, ManagedRuleOverride_State_Enabled))
}

func Test_ManagedRuleSet_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 ManagedRuleSet via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForManagedRuleSet, ManagedRuleSetGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ManagedRuleSet
	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 ManagedRuleSet instances for property testing - lazily instantiated by ManagedRuleSetGenerator()
var managedRuleSetGenerator gopter.Gen

// ManagedRuleSetGenerator returns a generator of ManagedRuleSet instances for property testing.
// We first initialize managedRuleSetGenerator 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 ManagedRuleSetGenerator() gopter.Gen {
	if managedRuleSetGenerator != nil {
		return managedRuleSetGenerator
	}

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForManagedRuleSet(generators)
	AddRelatedPropertyGeneratorsForManagedRuleSet(generators)
	managedRuleSetGenerator = gen.Struct(reflect.TypeOf(ManagedRuleSet{}), generators)

	return managedRuleSetGenerator
}

// AddIndependentPropertyGeneratorsForManagedRuleSet is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForManagedRuleSet(gens map[string]gopter.Gen) {
	gens["RuleSetType"] = gen.PtrOf(gen.AlphaString())
	gens["RuleSetVersion"] = gen.PtrOf(gen.AlphaString())
}

// AddRelatedPropertyGeneratorsForManagedRuleSet is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForManagedRuleSet(gens map[string]gopter.Gen) {
	gens["RuleGroupOverrides"] = gen.SliceOf(ManagedRuleGroupOverrideGenerator())
}

func Test_ManagedRulesDefinition_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 ManagedRulesDefinition via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForManagedRulesDefinition, ManagedRulesDefinitionGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ManagedRulesDefinition
	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 ManagedRulesDefinition instances for property testing - lazily instantiated by
// ManagedRulesDefinitionGenerator()
var managedRulesDefinitionGenerator gopter.Gen

// ManagedRulesDefinitionGenerator returns a generator of ManagedRulesDefinition instances for property testing.
func ManagedRulesDefinitionGenerator() gopter.Gen {
	if managedRulesDefinitionGenerator != nil {
		return managedRulesDefinitionGenerator
	}

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

	return managedRulesDefinitionGenerator
}

// AddRelatedPropertyGeneratorsForManagedRulesDefinition is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForManagedRulesDefinition(gens map[string]gopter.Gen) {
	gens["Exclusions"] = gen.SliceOf(OwaspCrsExclusionEntryGenerator())
	gens["ManagedRuleSets"] = gen.SliceOf(ManagedRuleSetGenerator())
}

func Test_MatchCondition_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 MatchCondition via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMatchCondition, MatchConditionGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual MatchCondition
	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 MatchCondition instances for property testing - lazily instantiated by MatchConditionGenerator()
var matchConditionGenerator gopter.Gen

// MatchConditionGenerator returns a generator of MatchCondition instances for property testing.
// We first initialize matchConditionGenerator 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 MatchConditionGenerator() gopter.Gen {
	if matchConditionGenerator != nil {
		return matchConditionGenerator
	}

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForMatchCondition(generators)
	AddRelatedPropertyGeneratorsForMatchCondition(generators)
	matchConditionGenerator = gen.Struct(reflect.TypeOf(MatchCondition{}), generators)

	return matchConditionGenerator
}

// AddIndependentPropertyGeneratorsForMatchCondition is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForMatchCondition(gens map[string]gopter.Gen) {
	gens["MatchValues"] = gen.SliceOf(gen.AlphaString())
	gens["NegationConditon"] = gen.PtrOf(gen.Bool())
	gens["Operator"] = gen.PtrOf(gen.OneConstOf(
		MatchCondition_Operator_Any,
		MatchCondition_Operator_BeginsWith,
		MatchCondition_Operator_Contains,
		MatchCondition_Operator_EndsWith,
		MatchCondition_Operator_Equal,
		MatchCondition_Operator_GeoMatch,
		MatchCondition_Operator_GreaterThan,
		MatchCondition_Operator_GreaterThanOrEqual,
		MatchCondition_Operator_IPMatch,
		MatchCondition_Operator_LessThan,
		MatchCondition_Operator_LessThanOrEqual,
		MatchCondition_Operator_Regex))
	gens["Transforms"] = gen.SliceOf(gen.OneConstOf(
		Transform_HtmlEntityDecode,
		Transform_Lowercase,
		Transform_RemoveNulls,
		Transform_Trim,
		Transform_Uppercase,
		Transform_UrlDecode,
		Transform_UrlEncode))
}

// AddRelatedPropertyGeneratorsForMatchCondition is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForMatchCondition(gens map[string]gopter.Gen) {
	gens["MatchVariables"] = gen.SliceOf(MatchVariableGenerator())
}

func Test_MatchVariable_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 MatchVariable via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMatchVariable, MatchVariableGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual MatchVariable
	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 MatchVariable instances for property testing - lazily instantiated by MatchVariableGenerator()
var matchVariableGenerator gopter.Gen

// MatchVariableGenerator returns a generator of MatchVariable instances for property testing.
func MatchVariableGenerator() gopter.Gen {
	if matchVariableGenerator != nil {
		return matchVariableGenerator
	}

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

	return matchVariableGenerator
}

// AddIndependentPropertyGeneratorsForMatchVariable is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForMatchVariable(gens map[string]gopter.Gen) {
	gens["Selector"] = gen.PtrOf(gen.AlphaString())
	gens["VariableName"] = gen.PtrOf(gen.OneConstOf(
		MatchVariable_VariableName_PostArgs,
		MatchVariable_VariableName_QueryString,
		MatchVariable_VariableName_RemoteAddr,
		MatchVariable_VariableName_RequestBody,
		MatchVariable_VariableName_RequestCookies,
		MatchVariable_VariableName_RequestHeaders,
		MatchVariable_VariableName_RequestMethod,
		MatchVariable_VariableName_RequestUri))
}

func Test_OwaspCrsExclusionEntry_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 OwaspCrsExclusionEntry via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForOwaspCrsExclusionEntry, OwaspCrsExclusionEntryGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual OwaspCrsExclusionEntry
	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 OwaspCrsExclusionEntry instances for property testing - lazily instantiated by
// OwaspCrsExclusionEntryGenerator()
var owaspCrsExclusionEntryGenerator gopter.Gen

// OwaspCrsExclusionEntryGenerator returns a generator of OwaspCrsExclusionEntry instances for property testing.
// We first initialize owaspCrsExclusionEntryGenerator 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 OwaspCrsExclusionEntryGenerator() gopter.Gen {
	if owaspCrsExclusionEntryGenerator != nil {
		return owaspCrsExclusionEntryGenerator
	}

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForOwaspCrsExclusionEntry(generators)
	AddRelatedPropertyGeneratorsForOwaspCrsExclusionEntry(generators)
	owaspCrsExclusionEntryGenerator = gen.Struct(reflect.TypeOf(OwaspCrsExclusionEntry{}), generators)

	return owaspCrsExclusionEntryGenerator
}

// AddIndependentPropertyGeneratorsForOwaspCrsExclusionEntry is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForOwaspCrsExclusionEntry(gens map[string]gopter.Gen) {
	gens["MatchVariable"] = gen.PtrOf(gen.OneConstOf(
		OwaspCrsExclusionEntry_MatchVariable_RequestArgKeys,
		OwaspCrsExclusionEntry_MatchVariable_RequestArgNames,
		OwaspCrsExclusionEntry_MatchVariable_RequestArgValues,
		OwaspCrsExclusionEntry_MatchVariable_RequestCookieKeys,
		OwaspCrsExclusionEntry_MatchVariable_RequestCookieNames,
		OwaspCrsExclusionEntry_MatchVariable_RequestCookieValues,
		OwaspCrsExclusionEntry_MatchVariable_RequestHeaderKeys,
		OwaspCrsExclusionEntry_MatchVariable_RequestHeaderNames,
		OwaspCrsExclusionEntry_MatchVariable_RequestHeaderValues))
	gens["Selector"] = gen.PtrOf(gen.AlphaString())
	gens["SelectorMatchOperator"] = gen.PtrOf(gen.OneConstOf(
		OwaspCrsExclusionEntry_SelectorMatchOperator_Contains,
		OwaspCrsExclusionEntry_SelectorMatchOperator_EndsWith,
		OwaspCrsExclusionEntry_SelectorMatchOperator_Equals,
		OwaspCrsExclusionEntry_SelectorMatchOperator_EqualsAny,
		OwaspCrsExclusionEntry_SelectorMatchOperator_StartsWith))
}

// AddRelatedPropertyGeneratorsForOwaspCrsExclusionEntry is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForOwaspCrsExclusionEntry(gens map[string]gopter.Gen) {
	gens["ExclusionManagedRuleSets"] = gen.SliceOf(ExclusionManagedRuleSetGenerator())
}

func Test_PolicySettings_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 PolicySettings via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPolicySettings, PolicySettingsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual PolicySettings
	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 PolicySettings instances for property testing - lazily instantiated by PolicySettingsGenerator()
var policySettingsGenerator gopter.Gen

// PolicySettingsGenerator returns a generator of PolicySettings instances for property testing.
// We first initialize policySettingsGenerator 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 PolicySettingsGenerator() gopter.Gen {
	if policySettingsGenerator != nil {
		return policySettingsGenerator
	}

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForPolicySettings(generators)
	AddRelatedPropertyGeneratorsForPolicySettings(generators)
	policySettingsGenerator = gen.Struct(reflect.TypeOf(PolicySettings{}), generators)

	return policySettingsGenerator
}

// AddIndependentPropertyGeneratorsForPolicySettings is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForPolicySettings(gens map[string]gopter.Gen) {
	gens["CustomBlockResponseBody"] = gen.PtrOf(gen.AlphaString())
	gens["CustomBlockResponseStatusCode"] = gen.PtrOf(gen.Int())
	gens["FileUploadEnforcement"] = gen.PtrOf(gen.Bool())
	gens["FileUploadLimitInMb"] = gen.PtrOf(gen.Int())
	gens["JsChallengeCookieExpirationInMins"] = gen.PtrOf(gen.Int())
	gens["MaxRequestBodySizeInKb"] = gen.PtrOf(gen.Int())
	gens["Mode"] = gen.PtrOf(gen.OneConstOf(PolicySettings_Mode_Detection, PolicySettings_Mode_Prevention))
	gens["RequestBodyCheck"] = gen.PtrOf(gen.Bool())
	gens["RequestBodyEnforcement"] = gen.PtrOf(gen.Bool())
	gens["RequestBodyInspectLimitInKB"] = gen.PtrOf(gen.Int())
	gens["State"] = gen.PtrOf(gen.OneConstOf(PolicySettings_State_Disabled, PolicySettings_State_Enabled))
}

// AddRelatedPropertyGeneratorsForPolicySettings is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForPolicySettings(gens map[string]gopter.Gen) {
	gens["LogScrubbing"] = gen.PtrOf(PolicySettings_LogScrubbingGenerator())
}

func Test_PolicySettings_LogScrubbing_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 PolicySettings_LogScrubbing via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPolicySettings_LogScrubbing, PolicySettings_LogScrubbingGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual PolicySettings_LogScrubbing
	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 PolicySettings_LogScrubbing instances for property testing - lazily instantiated by
// PolicySettings_LogScrubbingGenerator()
var policySettings_LogScrubbingGenerator gopter.Gen

// PolicySettings_LogScrubbingGenerator returns a generator of PolicySettings_LogScrubbing instances for property testing.
// We first initialize policySettings_LogScrubbingGenerator 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 PolicySettings_LogScrubbingGenerator() gopter.Gen {
	if policySettings_LogScrubbingGenerator != nil {
		return policySettings_LogScrubbingGenerator
	}

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForPolicySettings_LogScrubbing(generators)
	AddRelatedPropertyGeneratorsForPolicySettings_LogScrubbing(generators)
	policySettings_LogScrubbingGenerator = gen.Struct(reflect.TypeOf(PolicySettings_LogScrubbing{}), generators)

	return policySettings_LogScrubbingGenerator
}

// AddIndependentPropertyGeneratorsForPolicySettings_LogScrubbing is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForPolicySettings_LogScrubbing(gens map[string]gopter.Gen) {
	gens["State"] = gen.PtrOf(gen.OneConstOf(PolicySettings_LogScrubbing_State_Disabled, PolicySettings_LogScrubbing_State_Enabled))
}

// AddRelatedPropertyGeneratorsForPolicySettings_LogScrubbing is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForPolicySettings_LogScrubbing(gens map[string]gopter.Gen) {
	gens["ScrubbingRules"] = gen.SliceOf(WebApplicationFirewallScrubbingRulesGenerator())
}

func Test_WebApplicationFirewallCustomRule_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 WebApplicationFirewallCustomRule via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForWebApplicationFirewallCustomRule, WebApplicationFirewallCustomRuleGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual WebApplicationFirewallCustomRule
	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 WebApplicationFirewallCustomRule instances for property testing - lazily instantiated by
// WebApplicationFirewallCustomRuleGenerator()
var webApplicationFirewallCustomRuleGenerator gopter.Gen

// WebApplicationFirewallCustomRuleGenerator returns a generator of WebApplicationFirewallCustomRule instances for property testing.
// We first initialize webApplicationFirewallCustomRuleGenerator 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 WebApplicationFirewallCustomRuleGenerator() gopter.Gen {
	if webApplicationFirewallCustomRuleGenerator != nil {
		return webApplicationFirewallCustomRuleGenerator
	}

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForWebApplicationFirewallCustomRule(generators)
	AddRelatedPropertyGeneratorsForWebApplicationFirewallCustomRule(generators)
	webApplicationFirewallCustomRuleGenerator = gen.Struct(reflect.TypeOf(WebApplicationFirewallCustomRule{}), generators)

	return webApplicationFirewallCustomRuleGenerator
}

// AddIndependentPropertyGeneratorsForWebApplicationFirewallCustomRule is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForWebApplicationFirewallCustomRule(gens map[string]gopter.Gen) {
	gens["Action"] = gen.PtrOf(gen.OneConstOf(
		WebApplicationFirewallCustomRule_Action_Allow,
		WebApplicationFirewallCustomRule_Action_Block,
		WebApplicationFirewallCustomRule_Action_JSChallenge,
		WebApplicationFirewallCustomRule_Action_Log))
	gens["Name"] = gen.PtrOf(gen.AlphaString())
	gens["Priority"] = gen.PtrOf(gen.Int())
	gens["RateLimitDuration"] = gen.PtrOf(gen.OneConstOf(WebApplicationFirewallCustomRule_RateLimitDuration_FiveMins, WebApplicationFirewallCustomRule_RateLimitDuration_OneMin))
	gens["RateLimitThreshold"] = gen.PtrOf(gen.Int())
	gens["RuleType"] = gen.PtrOf(gen.OneConstOf(WebApplicationFirewallCustomRule_RuleType_Invalid, WebApplicationFirewallCustomRule_RuleType_MatchRule, WebApplicationFirewallCustomRule_RuleType_RateLimitRule))
	gens["State"] = gen.PtrOf(gen.OneConstOf(WebApplicationFirewallCustomRule_State_Disabled, WebApplicationFirewallCustomRule_State_Enabled))
}

// AddRelatedPropertyGeneratorsForWebApplicationFirewallCustomRule is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForWebApplicationFirewallCustomRule(gens map[string]gopter.Gen) {
	gens["GroupByUserSession"] = gen.SliceOf(GroupByUserSessionGenerator())
	gens["MatchConditions"] = gen.SliceOf(MatchConditionGenerator())
}

func Test_WebApplicationFirewallPolicyPropertiesFormat_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 WebApplicationFirewallPolicyPropertiesFormat via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForWebApplicationFirewallPolicyPropertiesFormat, WebApplicationFirewallPolicyPropertiesFormatGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual WebApplicationFirewallPolicyPropertiesFormat
	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 WebApplicationFirewallPolicyPropertiesFormat instances for property testing - lazily instantiated by
// WebApplicationFirewallPolicyPropertiesFormatGenerator()
var webApplicationFirewallPolicyPropertiesFormatGenerator gopter.Gen

// WebApplicationFirewallPolicyPropertiesFormatGenerator returns a generator of WebApplicationFirewallPolicyPropertiesFormat instances for property testing.
func WebApplicationFirewallPolicyPropertiesFormatGenerator() gopter.Gen {
	if webApplicationFirewallPolicyPropertiesFormatGenerator != nil {
		return webApplicationFirewallPolicyPropertiesFormatGenerator
	}

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

	return webApplicationFirewallPolicyPropertiesFormatGenerator
}

// AddRelatedPropertyGeneratorsForWebApplicationFirewallPolicyPropertiesFormat is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForWebApplicationFirewallPolicyPropertiesFormat(gens map[string]gopter.Gen) {
	gens["CustomRules"] = gen.SliceOf(WebApplicationFirewallCustomRuleGenerator())
	gens["ManagedRules"] = gen.PtrOf(ManagedRulesDefinitionGenerator())
	gens["PolicySettings"] = gen.PtrOf(PolicySettingsGenerator())
}

func Test_WebApplicationFirewallPolicy_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 WebApplicationFirewallPolicy_Spec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForWebApplicationFirewallPolicy_Spec, WebApplicationFirewallPolicy_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual WebApplicationFirewallPolicy_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 WebApplicationFirewallPolicy_Spec instances for property testing - lazily instantiated by
// WebApplicationFirewallPolicy_SpecGenerator()
var webApplicationFirewallPolicy_SpecGenerator gopter.Gen

// WebApplicationFirewallPolicy_SpecGenerator returns a generator of WebApplicationFirewallPolicy_Spec instances for property testing.
// We first initialize webApplicationFirewallPolicy_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 WebApplicationFirewallPolicy_SpecGenerator() gopter.Gen {
	if webApplicationFirewallPolicy_SpecGenerator != nil {
		return webApplicationFirewallPolicy_SpecGenerator
	}

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForWebApplicationFirewallPolicy_Spec(generators)
	AddRelatedPropertyGeneratorsForWebApplicationFirewallPolicy_Spec(generators)
	webApplicationFirewallPolicy_SpecGenerator = gen.Struct(reflect.TypeOf(WebApplicationFirewallPolicy_Spec{}), generators)

	return webApplicationFirewallPolicy_SpecGenerator
}

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

// AddRelatedPropertyGeneratorsForWebApplicationFirewallPolicy_Spec is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForWebApplicationFirewallPolicy_Spec(gens map[string]gopter.Gen) {
	gens["Properties"] = gen.PtrOf(WebApplicationFirewallPolicyPropertiesFormatGenerator())
}

func Test_WebApplicationFirewallScrubbingRules_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 WebApplicationFirewallScrubbingRules via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForWebApplicationFirewallScrubbingRules, WebApplicationFirewallScrubbingRulesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual WebApplicationFirewallScrubbingRules
	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 WebApplicationFirewallScrubbingRules instances for property testing - lazily instantiated by
// WebApplicationFirewallScrubbingRulesGenerator()
var webApplicationFirewallScrubbingRulesGenerator gopter.Gen

// WebApplicationFirewallScrubbingRulesGenerator returns a generator of WebApplicationFirewallScrubbingRules instances for property testing.
func WebApplicationFirewallScrubbingRulesGenerator() gopter.Gen {
	if webApplicationFirewallScrubbingRulesGenerator != nil {
		return webApplicationFirewallScrubbingRulesGenerator
	}

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

	return webApplicationFirewallScrubbingRulesGenerator
}

// AddIndependentPropertyGeneratorsForWebApplicationFirewallScrubbingRules is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForWebApplicationFirewallScrubbingRules(gens map[string]gopter.Gen) {
	gens["MatchVariable"] = gen.PtrOf(gen.OneConstOf(
		WebApplicationFirewallScrubbingRules_MatchVariable_RequestArgNames,
		WebApplicationFirewallScrubbingRules_MatchVariable_RequestCookieNames,
		WebApplicationFirewallScrubbingRules_MatchVariable_RequestHeaderNames,
		WebApplicationFirewallScrubbingRules_MatchVariable_RequestIPAddress,
		WebApplicationFirewallScrubbingRules_MatchVariable_RequestJSONArgNames,
		WebApplicationFirewallScrubbingRules_MatchVariable_RequestPostArgNames))
	gens["Selector"] = gen.PtrOf(gen.AlphaString())
	gens["SelectorMatchOperator"] = gen.PtrOf(gen.OneConstOf(WebApplicationFirewallScrubbingRules_SelectorMatchOperator_Equals, WebApplicationFirewallScrubbingRules_SelectorMatchOperator_EqualsAny))
	gens["State"] = gen.PtrOf(gen.OneConstOf(WebApplicationFirewallScrubbingRules_State_Disabled, WebApplicationFirewallScrubbingRules_State_Enabled))
}
