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

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_Domain_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 Domain via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForDomain, DomainGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// DomainGenerator returns a generator of Domain instances for property testing.
func DomainGenerator() gopter.Gen {
	if domainGenerator != nil {
		return domainGenerator
	}

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

	return domainGenerator
}

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

func Test_DomainOperatorSpec_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 DomainOperatorSpec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForDomainOperatorSpec, DomainOperatorSpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// DomainOperatorSpecGenerator returns a generator of DomainOperatorSpec instances for property testing.
func DomainOperatorSpecGenerator() gopter.Gen {
	if domainOperatorSpecGenerator != nil {
		return domainOperatorSpecGenerator
	}

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

	return domainOperatorSpecGenerator
}

func Test_Domain_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 Domain_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForDomain_STATUS, Domain_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual Domain_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 Domain_STATUS instances for property testing - lazily instantiated by Domain_STATUSGenerator()
var domain_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForDomain_STATUS(generators)
	AddRelatedPropertyGeneratorsForDomain_STATUS(generators)
	domain_STATUSGenerator = gen.Struct(reflect.TypeOf(Domain_STATUS{}), generators)

	return domain_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForDomain_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForDomain_STATUS(gens map[string]gopter.Gen) {
	gens["Endpoint"] = gen.PtrOf(gen.AlphaString())
	gens["Id"] = gen.PtrOf(gen.AlphaString())
	gens["InputSchema"] = gen.PtrOf(gen.AlphaString())
	gens["Location"] = gen.PtrOf(gen.AlphaString())
	gens["MetricResourceId"] = gen.PtrOf(gen.AlphaString())
	gens["Name"] = gen.PtrOf(gen.AlphaString())
	gens["ProvisioningState"] = gen.PtrOf(gen.AlphaString())
	gens["PublicNetworkAccess"] = gen.PtrOf(gen.AlphaString())
	gens["Tags"] = gen.MapOf(
		gen.AlphaString(),
		gen.AlphaString())
	gens["Type"] = gen.PtrOf(gen.AlphaString())
}

// AddRelatedPropertyGeneratorsForDomain_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForDomain_STATUS(gens map[string]gopter.Gen) {
	gens["InboundIpRules"] = gen.SliceOf(InboundIpRule_STATUSGenerator())
	gens["InputSchemaMapping"] = gen.PtrOf(InputSchemaMapping_STATUSGenerator())
	gens["PrivateEndpointConnections"] = gen.SliceOf(PrivateEndpointConnection_STATUS_Domain_SubResourceEmbeddedGenerator())
	gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator())
}

func Test_Domain_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 Domain_Spec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForDomain_Spec, Domain_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual Domain_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 Domain_Spec instances for property testing - lazily instantiated by Domain_SpecGenerator()
var domain_SpecGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForDomain_Spec(generators)
	AddRelatedPropertyGeneratorsForDomain_Spec(generators)
	domain_SpecGenerator = gen.Struct(reflect.TypeOf(Domain_Spec{}), generators)

	return domain_SpecGenerator
}

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

// AddRelatedPropertyGeneratorsForDomain_Spec is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForDomain_Spec(gens map[string]gopter.Gen) {
	gens["InboundIpRules"] = gen.SliceOf(InboundIpRuleGenerator())
	gens["InputSchemaMapping"] = gen.PtrOf(InputSchemaMappingGenerator())
	gens["OperatorSpec"] = gen.PtrOf(DomainOperatorSpecGenerator())
}

func Test_InboundIpRule_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 InboundIpRule via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForInboundIpRule, InboundIpRuleGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// InboundIpRuleGenerator returns a generator of InboundIpRule instances for property testing.
func InboundIpRuleGenerator() gopter.Gen {
	if inboundIpRuleGenerator != nil {
		return inboundIpRuleGenerator
	}

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

	return inboundIpRuleGenerator
}

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

func Test_InboundIpRule_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 InboundIpRule_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForInboundIpRule_STATUS, InboundIpRule_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual InboundIpRule_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 InboundIpRule_STATUS instances for property testing - lazily instantiated by
// InboundIpRule_STATUSGenerator()
var inboundIpRule_STATUSGenerator gopter.Gen

// InboundIpRule_STATUSGenerator returns a generator of InboundIpRule_STATUS instances for property testing.
func InboundIpRule_STATUSGenerator() gopter.Gen {
	if inboundIpRule_STATUSGenerator != nil {
		return inboundIpRule_STATUSGenerator
	}

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

	return inboundIpRule_STATUSGenerator
}

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

func Test_InputSchemaMapping_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 InputSchemaMapping via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForInputSchemaMapping, InputSchemaMappingGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// InputSchemaMappingGenerator returns a generator of InputSchemaMapping instances for property testing.
func InputSchemaMappingGenerator() gopter.Gen {
	if inputSchemaMappingGenerator != nil {
		return inputSchemaMappingGenerator
	}

	generators := make(map[string]gopter.Gen)
	AddRelatedPropertyGeneratorsForInputSchemaMapping(generators)

	// handle OneOf by choosing only one field to instantiate
	var gens []gopter.Gen
	for propName, propGen := range generators {
		props := map[string]gopter.Gen{propName: propGen}
		gens = append(gens, gen.Struct(reflect.TypeOf(InputSchemaMapping{}), props))
	}
	inputSchemaMappingGenerator = gen.OneGenOf(gens...)

	return inputSchemaMappingGenerator
}

// AddRelatedPropertyGeneratorsForInputSchemaMapping is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForInputSchemaMapping(gens map[string]gopter.Gen) {
	gens["Json"] = JsonInputSchemaMappingGenerator().Map(func(it JsonInputSchemaMapping) *JsonInputSchemaMapping {
		return &it
	}) // generate one case for OneOf type
}

func Test_InputSchemaMapping_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 InputSchemaMapping_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForInputSchemaMapping_STATUS, InputSchemaMapping_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual InputSchemaMapping_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 InputSchemaMapping_STATUS instances for property testing - lazily instantiated by
// InputSchemaMapping_STATUSGenerator()
var inputSchemaMapping_STATUSGenerator gopter.Gen

// InputSchemaMapping_STATUSGenerator returns a generator of InputSchemaMapping_STATUS instances for property testing.
func InputSchemaMapping_STATUSGenerator() gopter.Gen {
	if inputSchemaMapping_STATUSGenerator != nil {
		return inputSchemaMapping_STATUSGenerator
	}

	generators := make(map[string]gopter.Gen)
	AddRelatedPropertyGeneratorsForInputSchemaMapping_STATUS(generators)

	// handle OneOf by choosing only one field to instantiate
	var gens []gopter.Gen
	for propName, propGen := range generators {
		props := map[string]gopter.Gen{propName: propGen}
		gens = append(gens, gen.Struct(reflect.TypeOf(InputSchemaMapping_STATUS{}), props))
	}
	inputSchemaMapping_STATUSGenerator = gen.OneGenOf(gens...)

	return inputSchemaMapping_STATUSGenerator
}

// AddRelatedPropertyGeneratorsForInputSchemaMapping_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForInputSchemaMapping_STATUS(gens map[string]gopter.Gen) {
	gens["Json"] = JsonInputSchemaMapping_STATUSGenerator().Map(func(it JsonInputSchemaMapping_STATUS) *JsonInputSchemaMapping_STATUS {
		return &it
	}) // generate one case for OneOf type
}

func Test_JsonField_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 JsonField via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForJsonField, JsonFieldGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// JsonFieldGenerator returns a generator of JsonField instances for property testing.
func JsonFieldGenerator() gopter.Gen {
	if jsonFieldGenerator != nil {
		return jsonFieldGenerator
	}

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

	return jsonFieldGenerator
}

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

func Test_JsonFieldWithDefault_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 JsonFieldWithDefault via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForJsonFieldWithDefault, JsonFieldWithDefaultGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// JsonFieldWithDefaultGenerator returns a generator of JsonFieldWithDefault instances for property testing.
func JsonFieldWithDefaultGenerator() gopter.Gen {
	if jsonFieldWithDefaultGenerator != nil {
		return jsonFieldWithDefaultGenerator
	}

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

	return jsonFieldWithDefaultGenerator
}

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

func Test_JsonFieldWithDefault_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 JsonFieldWithDefault_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForJsonFieldWithDefault_STATUS, JsonFieldWithDefault_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual JsonFieldWithDefault_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 JsonFieldWithDefault_STATUS instances for property testing - lazily instantiated by
// JsonFieldWithDefault_STATUSGenerator()
var jsonFieldWithDefault_STATUSGenerator gopter.Gen

// JsonFieldWithDefault_STATUSGenerator returns a generator of JsonFieldWithDefault_STATUS instances for property testing.
func JsonFieldWithDefault_STATUSGenerator() gopter.Gen {
	if jsonFieldWithDefault_STATUSGenerator != nil {
		return jsonFieldWithDefault_STATUSGenerator
	}

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

	return jsonFieldWithDefault_STATUSGenerator
}

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

func Test_JsonField_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 JsonField_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForJsonField_STATUS, JsonField_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual JsonField_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 JsonField_STATUS instances for property testing - lazily instantiated by JsonField_STATUSGenerator()
var jsonField_STATUSGenerator gopter.Gen

// JsonField_STATUSGenerator returns a generator of JsonField_STATUS instances for property testing.
func JsonField_STATUSGenerator() gopter.Gen {
	if jsonField_STATUSGenerator != nil {
		return jsonField_STATUSGenerator
	}

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

	return jsonField_STATUSGenerator
}

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

func Test_JsonInputSchemaMapping_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 JsonInputSchemaMapping via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForJsonInputSchemaMapping, JsonInputSchemaMappingGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForJsonInputSchemaMapping(generators)
	AddRelatedPropertyGeneratorsForJsonInputSchemaMapping(generators)
	jsonInputSchemaMappingGenerator = gen.Struct(reflect.TypeOf(JsonInputSchemaMapping{}), generators)

	return jsonInputSchemaMappingGenerator
}

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

// AddRelatedPropertyGeneratorsForJsonInputSchemaMapping is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForJsonInputSchemaMapping(gens map[string]gopter.Gen) {
	gens["DataVersion"] = gen.PtrOf(JsonFieldWithDefaultGenerator())
	gens["EventTime"] = gen.PtrOf(JsonFieldGenerator())
	gens["EventType"] = gen.PtrOf(JsonFieldWithDefaultGenerator())
	gens["Id"] = gen.PtrOf(JsonFieldGenerator())
	gens["Subject"] = gen.PtrOf(JsonFieldWithDefaultGenerator())
	gens["Topic"] = gen.PtrOf(JsonFieldGenerator())
}

func Test_JsonInputSchemaMapping_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 JsonInputSchemaMapping_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForJsonInputSchemaMapping_STATUS, JsonInputSchemaMapping_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual JsonInputSchemaMapping_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 JsonInputSchemaMapping_STATUS instances for property testing - lazily instantiated by
// JsonInputSchemaMapping_STATUSGenerator()
var jsonInputSchemaMapping_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForJsonInputSchemaMapping_STATUS(generators)
	AddRelatedPropertyGeneratorsForJsonInputSchemaMapping_STATUS(generators)
	jsonInputSchemaMapping_STATUSGenerator = gen.Struct(reflect.TypeOf(JsonInputSchemaMapping_STATUS{}), generators)

	return jsonInputSchemaMapping_STATUSGenerator
}

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

// AddRelatedPropertyGeneratorsForJsonInputSchemaMapping_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForJsonInputSchemaMapping_STATUS(gens map[string]gopter.Gen) {
	gens["DataVersion"] = gen.PtrOf(JsonFieldWithDefault_STATUSGenerator())
	gens["EventTime"] = gen.PtrOf(JsonField_STATUSGenerator())
	gens["EventType"] = gen.PtrOf(JsonFieldWithDefault_STATUSGenerator())
	gens["Id"] = gen.PtrOf(JsonField_STATUSGenerator())
	gens["Subject"] = gen.PtrOf(JsonFieldWithDefault_STATUSGenerator())
	gens["Topic"] = gen.PtrOf(JsonField_STATUSGenerator())
}

func Test_PrivateEndpointConnection_STATUS_Domain_SubResourceEmbedded_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 PrivateEndpointConnection_STATUS_Domain_SubResourceEmbedded via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrivateEndpointConnection_STATUS_Domain_SubResourceEmbedded, PrivateEndpointConnection_STATUS_Domain_SubResourceEmbeddedGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// PrivateEndpointConnection_STATUS_Domain_SubResourceEmbeddedGenerator returns a generator of PrivateEndpointConnection_STATUS_Domain_SubResourceEmbedded instances for property testing.
func PrivateEndpointConnection_STATUS_Domain_SubResourceEmbeddedGenerator() gopter.Gen {
	if privateEndpointConnection_STATUS_Domain_SubResourceEmbeddedGenerator != nil {
		return privateEndpointConnection_STATUS_Domain_SubResourceEmbeddedGenerator
	}

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

	return privateEndpointConnection_STATUS_Domain_SubResourceEmbeddedGenerator
}

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

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.AlphaString())
	gens["LastModifiedAt"] = gen.PtrOf(gen.AlphaString())
	gens["LastModifiedBy"] = gen.PtrOf(gen.AlphaString())
	gens["LastModifiedByType"] = gen.PtrOf(gen.AlphaString())
}
