// 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_AKS_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 AKS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForAKS, AKSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForAKS(generators)
	AddRelatedPropertyGeneratorsForAKS(generators)
	aksGenerator = gen.Struct(reflect.TypeOf(AKS{}), generators)

	return aksGenerator
}

// AddIndependentPropertyGeneratorsForAKS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForAKS(gens map[string]gopter.Gen) {
	gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString())
	gens["ComputeType"] = gen.OneConstOf(AKS_ComputeType_AKS)
	gens["Description"] = gen.PtrOf(gen.AlphaString())
	gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool())
	gens["ResourceId"] = gen.PtrOf(gen.AlphaString())
}

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

func Test_AKS_Properties_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 AKS_Properties via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForAKS_Properties, AKS_PropertiesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForAKS_Properties(generators)
	AddRelatedPropertyGeneratorsForAKS_Properties(generators)
	aks_PropertiesGenerator = gen.Struct(reflect.TypeOf(AKS_Properties{}), generators)

	return aks_PropertiesGenerator
}

// AddIndependentPropertyGeneratorsForAKS_Properties is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForAKS_Properties(gens map[string]gopter.Gen) {
	gens["AgentCount"] = gen.PtrOf(gen.Int())
	gens["AgentVmSize"] = gen.PtrOf(gen.AlphaString())
	gens["ClusterFqdn"] = gen.PtrOf(gen.AlphaString())
	gens["ClusterPurpose"] = gen.PtrOf(gen.OneConstOf(AKS_Properties_ClusterPurpose_DenseProd, AKS_Properties_ClusterPurpose_DevTest, AKS_Properties_ClusterPurpose_FastProd))
	gens["LoadBalancerSubnet"] = gen.PtrOf(gen.AlphaString())
	gens["LoadBalancerType"] = gen.PtrOf(gen.OneConstOf(AKS_Properties_LoadBalancerType_InternalLoadBalancer, AKS_Properties_LoadBalancerType_PublicIp))
}

// AddRelatedPropertyGeneratorsForAKS_Properties is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForAKS_Properties(gens map[string]gopter.Gen) {
	gens["AksNetworkingConfiguration"] = gen.PtrOf(AksNetworkingConfigurationGenerator())
	gens["SslConfiguration"] = gen.PtrOf(SslConfigurationGenerator())
}

func Test_AksNetworkingConfiguration_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 AksNetworkingConfiguration via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForAksNetworkingConfiguration, AksNetworkingConfigurationGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// AksNetworkingConfigurationGenerator returns a generator of AksNetworkingConfiguration instances for property testing.
func AksNetworkingConfigurationGenerator() gopter.Gen {
	if aksNetworkingConfigurationGenerator != nil {
		return aksNetworkingConfigurationGenerator
	}

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

	return aksNetworkingConfigurationGenerator
}

// AddIndependentPropertyGeneratorsForAksNetworkingConfiguration is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForAksNetworkingConfiguration(gens map[string]gopter.Gen) {
	gens["DnsServiceIP"] = gen.PtrOf(gen.AlphaString())
	gens["DockerBridgeCidr"] = gen.PtrOf(gen.AlphaString())
	gens["ServiceCidr"] = gen.PtrOf(gen.AlphaString())
	gens["SubnetId"] = gen.PtrOf(gen.AlphaString())
}

func Test_AmlCompute_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 AmlCompute via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForAmlCompute, AmlComputeGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForAmlCompute(generators)
	AddRelatedPropertyGeneratorsForAmlCompute(generators)
	amlComputeGenerator = gen.Struct(reflect.TypeOf(AmlCompute{}), generators)

	return amlComputeGenerator
}

// AddIndependentPropertyGeneratorsForAmlCompute is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForAmlCompute(gens map[string]gopter.Gen) {
	gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString())
	gens["ComputeType"] = gen.OneConstOf(AmlCompute_ComputeType_AmlCompute)
	gens["Description"] = gen.PtrOf(gen.AlphaString())
	gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool())
	gens["ResourceId"] = gen.PtrOf(gen.AlphaString())
}

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

func Test_AmlComputeProperties_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 AmlComputeProperties via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForAmlComputeProperties, AmlComputePropertiesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForAmlComputeProperties(generators)
	AddRelatedPropertyGeneratorsForAmlComputeProperties(generators)
	amlComputePropertiesGenerator = gen.Struct(reflect.TypeOf(AmlComputeProperties{}), generators)

	return amlComputePropertiesGenerator
}

// AddIndependentPropertyGeneratorsForAmlComputeProperties is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForAmlComputeProperties(gens map[string]gopter.Gen) {
	gens["EnableNodePublicIp"] = gen.PtrOf(gen.Bool())
	gens["IsolatedNetwork"] = gen.PtrOf(gen.Bool())
	gens["OsType"] = gen.PtrOf(gen.OneConstOf(AmlComputeProperties_OsType_Linux, AmlComputeProperties_OsType_Windows))
	gens["RemoteLoginPortPublicAccess"] = gen.PtrOf(gen.OneConstOf(AmlComputeProperties_RemoteLoginPortPublicAccess_Disabled, AmlComputeProperties_RemoteLoginPortPublicAccess_Enabled, AmlComputeProperties_RemoteLoginPortPublicAccess_NotSpecified))
	gens["VmPriority"] = gen.PtrOf(gen.OneConstOf(AmlComputeProperties_VmPriority_Dedicated, AmlComputeProperties_VmPriority_LowPriority))
	gens["VmSize"] = gen.PtrOf(gen.AlphaString())
}

// AddRelatedPropertyGeneratorsForAmlComputeProperties is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForAmlComputeProperties(gens map[string]gopter.Gen) {
	gens["ScaleSettings"] = gen.PtrOf(ScaleSettingsGenerator())
	gens["Subnet"] = gen.PtrOf(ResourceIdGenerator())
	gens["UserAccountCredentials"] = gen.PtrOf(UserAccountCredentialsGenerator())
	gens["VirtualMachineImage"] = gen.PtrOf(VirtualMachineImageGenerator())
}

func Test_AssignedUser_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 AssignedUser via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForAssignedUser, AssignedUserGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// AssignedUserGenerator returns a generator of AssignedUser instances for property testing.
func AssignedUserGenerator() gopter.Gen {
	if assignedUserGenerator != nil {
		return assignedUserGenerator
	}

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

	return assignedUserGenerator
}

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

func Test_AutoPauseProperties_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 AutoPauseProperties via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForAutoPauseProperties, AutoPausePropertiesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// AutoPausePropertiesGenerator returns a generator of AutoPauseProperties instances for property testing.
func AutoPausePropertiesGenerator() gopter.Gen {
	if autoPausePropertiesGenerator != nil {
		return autoPausePropertiesGenerator
	}

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

	return autoPausePropertiesGenerator
}

// AddIndependentPropertyGeneratorsForAutoPauseProperties is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForAutoPauseProperties(gens map[string]gopter.Gen) {
	gens["DelayInMinutes"] = gen.PtrOf(gen.Int())
	gens["Enabled"] = gen.PtrOf(gen.Bool())
}

func Test_AutoScaleProperties_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 AutoScaleProperties via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForAutoScaleProperties, AutoScalePropertiesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// AutoScalePropertiesGenerator returns a generator of AutoScaleProperties instances for property testing.
func AutoScalePropertiesGenerator() gopter.Gen {
	if autoScalePropertiesGenerator != nil {
		return autoScalePropertiesGenerator
	}

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

	return autoScalePropertiesGenerator
}

// AddIndependentPropertyGeneratorsForAutoScaleProperties is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForAutoScaleProperties(gens map[string]gopter.Gen) {
	gens["Enabled"] = gen.PtrOf(gen.Bool())
	gens["MaxNodeCount"] = gen.PtrOf(gen.Int())
	gens["MinNodeCount"] = gen.PtrOf(gen.Int())
}

func Test_Compute_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 Compute via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForCompute, ComputeGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// ComputeGenerator returns a generator of Compute instances for property testing.
func ComputeGenerator() gopter.Gen {
	if computeGenerator != nil {
		return computeGenerator
	}

	generators := make(map[string]gopter.Gen)
	AddRelatedPropertyGeneratorsForCompute(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(Compute{}), props))
	}
	computeGenerator = gen.OneGenOf(gens...)

	return computeGenerator
}

// AddRelatedPropertyGeneratorsForCompute is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForCompute(gens map[string]gopter.Gen) {
	gens["AKS"] = AKSGenerator().Map(func(it AKS) *AKS {
		return &it
	}) // generate one case for OneOf type
	gens["AmlCompute"] = AmlComputeGenerator().Map(func(it AmlCompute) *AmlCompute {
		return &it
	}) // generate one case for OneOf type
	gens["ComputeInstance"] = ComputeInstanceGenerator().Map(func(it ComputeInstance) *ComputeInstance {
		return &it
	}) // generate one case for OneOf type
	gens["DataFactory"] = DataFactoryGenerator().Map(func(it DataFactory) *DataFactory {
		return &it
	}) // generate one case for OneOf type
	gens["DataLakeAnalytics"] = DataLakeAnalyticsGenerator().Map(func(it DataLakeAnalytics) *DataLakeAnalytics {
		return &it
	}) // generate one case for OneOf type
	gens["Databricks"] = DatabricksGenerator().Map(func(it Databricks) *Databricks {
		return &it
	}) // generate one case for OneOf type
	gens["HDInsight"] = HDInsightGenerator().Map(func(it HDInsight) *HDInsight {
		return &it
	}) // generate one case for OneOf type
	gens["Kubernetes"] = KubernetesGenerator().Map(func(it Kubernetes) *Kubernetes {
		return &it
	}) // generate one case for OneOf type
	gens["SynapseSpark"] = SynapseSparkGenerator().Map(func(it SynapseSpark) *SynapseSpark {
		return &it
	}) // generate one case for OneOf type
	gens["VirtualMachine"] = VirtualMachineGenerator().Map(func(it VirtualMachine) *VirtualMachine {
		return &it
	}) // generate one case for OneOf type
}

func Test_ComputeInstance_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 ComputeInstance via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForComputeInstance, ComputeInstanceGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForComputeInstance(generators)
	AddRelatedPropertyGeneratorsForComputeInstance(generators)
	computeInstanceGenerator = gen.Struct(reflect.TypeOf(ComputeInstance{}), generators)

	return computeInstanceGenerator
}

// AddIndependentPropertyGeneratorsForComputeInstance is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForComputeInstance(gens map[string]gopter.Gen) {
	gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString())
	gens["ComputeType"] = gen.OneConstOf(ComputeInstance_ComputeType_ComputeInstance)
	gens["Description"] = gen.PtrOf(gen.AlphaString())
	gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool())
	gens["ResourceId"] = gen.PtrOf(gen.AlphaString())
}

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

func Test_ComputeInstanceProperties_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 ComputeInstanceProperties via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForComputeInstanceProperties, ComputeInstancePropertiesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForComputeInstanceProperties(generators)
	AddRelatedPropertyGeneratorsForComputeInstanceProperties(generators)
	computeInstancePropertiesGenerator = gen.Struct(reflect.TypeOf(ComputeInstanceProperties{}), generators)

	return computeInstancePropertiesGenerator
}

// AddIndependentPropertyGeneratorsForComputeInstanceProperties is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForComputeInstanceProperties(gens map[string]gopter.Gen) {
	gens["ApplicationSharingPolicy"] = gen.PtrOf(gen.OneConstOf(ComputeInstanceProperties_ApplicationSharingPolicy_Personal, ComputeInstanceProperties_ApplicationSharingPolicy_Shared))
	gens["ComputeInstanceAuthorizationType"] = gen.PtrOf(gen.OneConstOf(ComputeInstanceProperties_ComputeInstanceAuthorizationType_Personal))
	gens["VmSize"] = gen.PtrOf(gen.AlphaString())
}

// AddRelatedPropertyGeneratorsForComputeInstanceProperties is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForComputeInstanceProperties(gens map[string]gopter.Gen) {
	gens["PersonalComputeInstanceSettings"] = gen.PtrOf(PersonalComputeInstanceSettingsGenerator())
	gens["SetupScripts"] = gen.PtrOf(SetupScriptsGenerator())
	gens["SshSettings"] = gen.PtrOf(ComputeInstanceSshSettingsGenerator())
	gens["Subnet"] = gen.PtrOf(ResourceIdGenerator())
}

func Test_ComputeInstanceSshSettings_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 ComputeInstanceSshSettings via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForComputeInstanceSshSettings, ComputeInstanceSshSettingsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// ComputeInstanceSshSettingsGenerator returns a generator of ComputeInstanceSshSettings instances for property testing.
func ComputeInstanceSshSettingsGenerator() gopter.Gen {
	if computeInstanceSshSettingsGenerator != nil {
		return computeInstanceSshSettingsGenerator
	}

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

	return computeInstanceSshSettingsGenerator
}

// AddIndependentPropertyGeneratorsForComputeInstanceSshSettings is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForComputeInstanceSshSettings(gens map[string]gopter.Gen) {
	gens["AdminPublicKey"] = gen.PtrOf(gen.AlphaString())
	gens["SshPublicAccess"] = gen.PtrOf(gen.OneConstOf(ComputeInstanceSshSettings_SshPublicAccess_Disabled, ComputeInstanceSshSettings_SshPublicAccess_Enabled))
}

func Test_DataFactory_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 DataFactory via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForDataFactory, DataFactoryGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// DataFactoryGenerator returns a generator of DataFactory instances for property testing.
func DataFactoryGenerator() gopter.Gen {
	if dataFactoryGenerator != nil {
		return dataFactoryGenerator
	}

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

	return dataFactoryGenerator
}

// AddIndependentPropertyGeneratorsForDataFactory is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForDataFactory(gens map[string]gopter.Gen) {
	gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString())
	gens["ComputeType"] = gen.OneConstOf(DataFactory_ComputeType_DataFactory)
	gens["Description"] = gen.PtrOf(gen.AlphaString())
	gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool())
	gens["ResourceId"] = gen.PtrOf(gen.AlphaString())
}

func Test_DataLakeAnalytics_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 DataLakeAnalytics via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForDataLakeAnalytics, DataLakeAnalyticsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForDataLakeAnalytics(generators)
	AddRelatedPropertyGeneratorsForDataLakeAnalytics(generators)
	dataLakeAnalyticsGenerator = gen.Struct(reflect.TypeOf(DataLakeAnalytics{}), generators)

	return dataLakeAnalyticsGenerator
}

// AddIndependentPropertyGeneratorsForDataLakeAnalytics is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForDataLakeAnalytics(gens map[string]gopter.Gen) {
	gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString())
	gens["ComputeType"] = gen.OneConstOf(DataLakeAnalytics_ComputeType_DataLakeAnalytics)
	gens["Description"] = gen.PtrOf(gen.AlphaString())
	gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool())
	gens["ResourceId"] = gen.PtrOf(gen.AlphaString())
}

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

func Test_DataLakeAnalytics_Properties_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 DataLakeAnalytics_Properties via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForDataLakeAnalytics_Properties, DataLakeAnalytics_PropertiesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// DataLakeAnalytics_PropertiesGenerator returns a generator of DataLakeAnalytics_Properties instances for property testing.
func DataLakeAnalytics_PropertiesGenerator() gopter.Gen {
	if dataLakeAnalytics_PropertiesGenerator != nil {
		return dataLakeAnalytics_PropertiesGenerator
	}

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

	return dataLakeAnalytics_PropertiesGenerator
}

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

func Test_Databricks_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 Databricks via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForDatabricks, DatabricksGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForDatabricks(generators)
	AddRelatedPropertyGeneratorsForDatabricks(generators)
	databricksGenerator = gen.Struct(reflect.TypeOf(Databricks{}), generators)

	return databricksGenerator
}

// AddIndependentPropertyGeneratorsForDatabricks is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForDatabricks(gens map[string]gopter.Gen) {
	gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString())
	gens["ComputeType"] = gen.OneConstOf(Databricks_ComputeType_Databricks)
	gens["Description"] = gen.PtrOf(gen.AlphaString())
	gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool())
	gens["ResourceId"] = gen.PtrOf(gen.AlphaString())
}

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

func Test_DatabricksProperties_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 DatabricksProperties via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForDatabricksProperties, DatabricksPropertiesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// DatabricksPropertiesGenerator returns a generator of DatabricksProperties instances for property testing.
func DatabricksPropertiesGenerator() gopter.Gen {
	if databricksPropertiesGenerator != nil {
		return databricksPropertiesGenerator
	}

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

	return databricksPropertiesGenerator
}

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

func Test_HDInsight_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 HDInsight via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForHDInsight, HDInsightGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForHDInsight(generators)
	AddRelatedPropertyGeneratorsForHDInsight(generators)
	hdInsightGenerator = gen.Struct(reflect.TypeOf(HDInsight{}), generators)

	return hdInsightGenerator
}

// AddIndependentPropertyGeneratorsForHDInsight is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForHDInsight(gens map[string]gopter.Gen) {
	gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString())
	gens["ComputeType"] = gen.OneConstOf(HDInsight_ComputeType_HDInsight)
	gens["Description"] = gen.PtrOf(gen.AlphaString())
	gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool())
	gens["ResourceId"] = gen.PtrOf(gen.AlphaString())
}

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

func Test_HDInsightProperties_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 HDInsightProperties via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForHDInsightProperties, HDInsightPropertiesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForHDInsightProperties(generators)
	AddRelatedPropertyGeneratorsForHDInsightProperties(generators)
	hdInsightPropertiesGenerator = gen.Struct(reflect.TypeOf(HDInsightProperties{}), generators)

	return hdInsightPropertiesGenerator
}

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

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

func Test_InstanceTypeSchema_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 InstanceTypeSchema via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForInstanceTypeSchema, InstanceTypeSchemaGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForInstanceTypeSchema(generators)
	AddRelatedPropertyGeneratorsForInstanceTypeSchema(generators)
	instanceTypeSchemaGenerator = gen.Struct(reflect.TypeOf(InstanceTypeSchema{}), generators)

	return instanceTypeSchemaGenerator
}

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

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

func Test_InstanceTypeSchema_Resources_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 InstanceTypeSchema_Resources via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForInstanceTypeSchema_Resources, InstanceTypeSchema_ResourcesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// InstanceTypeSchema_ResourcesGenerator returns a generator of InstanceTypeSchema_Resources instances for property testing.
func InstanceTypeSchema_ResourcesGenerator() gopter.Gen {
	if instanceTypeSchema_ResourcesGenerator != nil {
		return instanceTypeSchema_ResourcesGenerator
	}

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

	return instanceTypeSchema_ResourcesGenerator
}

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

func Test_Kubernetes_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 Kubernetes via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForKubernetes, KubernetesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForKubernetes(generators)
	AddRelatedPropertyGeneratorsForKubernetes(generators)
	kubernetesGenerator = gen.Struct(reflect.TypeOf(Kubernetes{}), generators)

	return kubernetesGenerator
}

// AddIndependentPropertyGeneratorsForKubernetes is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForKubernetes(gens map[string]gopter.Gen) {
	gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString())
	gens["ComputeType"] = gen.OneConstOf(Kubernetes_ComputeType_Kubernetes)
	gens["Description"] = gen.PtrOf(gen.AlphaString())
	gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool())
	gens["ResourceId"] = gen.PtrOf(gen.AlphaString())
}

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

func Test_KubernetesProperties_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 KubernetesProperties via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForKubernetesProperties, KubernetesPropertiesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForKubernetesProperties(generators)
	AddRelatedPropertyGeneratorsForKubernetesProperties(generators)
	kubernetesPropertiesGenerator = gen.Struct(reflect.TypeOf(KubernetesProperties{}), generators)

	return kubernetesPropertiesGenerator
}

// AddIndependentPropertyGeneratorsForKubernetesProperties is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForKubernetesProperties(gens map[string]gopter.Gen) {
	gens["DefaultInstanceType"] = gen.PtrOf(gen.AlphaString())
	gens["ExtensionInstanceReleaseTrain"] = gen.PtrOf(gen.AlphaString())
	gens["ExtensionPrincipalId"] = gen.PtrOf(gen.AlphaString())
	gens["Namespace"] = gen.PtrOf(gen.AlphaString())
	gens["RelayConnectionString"] = gen.PtrOf(gen.AlphaString())
	gens["ServiceBusConnectionString"] = gen.PtrOf(gen.AlphaString())
	gens["VcName"] = gen.PtrOf(gen.AlphaString())
}

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

func Test_PersonalComputeInstanceSettings_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 PersonalComputeInstanceSettings via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPersonalComputeInstanceSettings, PersonalComputeInstanceSettingsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// PersonalComputeInstanceSettingsGenerator returns a generator of PersonalComputeInstanceSettings instances for property testing.
func PersonalComputeInstanceSettingsGenerator() gopter.Gen {
	if personalComputeInstanceSettingsGenerator != nil {
		return personalComputeInstanceSettingsGenerator
	}

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

	return personalComputeInstanceSettingsGenerator
}

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

func Test_ResourceId_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 ResourceId via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForResourceId, ResourceIdGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// ResourceIdGenerator returns a generator of ResourceId instances for property testing.
func ResourceIdGenerator() gopter.Gen {
	if resourceIdGenerator != nil {
		return resourceIdGenerator
	}

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

	return resourceIdGenerator
}

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

func Test_ScaleSettings_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 ScaleSettings via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForScaleSettings, ScaleSettingsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// ScaleSettingsGenerator returns a generator of ScaleSettings instances for property testing.
func ScaleSettingsGenerator() gopter.Gen {
	if scaleSettingsGenerator != nil {
		return scaleSettingsGenerator
	}

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

	return scaleSettingsGenerator
}

// AddIndependentPropertyGeneratorsForScaleSettings is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForScaleSettings(gens map[string]gopter.Gen) {
	gens["MaxNodeCount"] = gen.PtrOf(gen.Int())
	gens["MinNodeCount"] = gen.PtrOf(gen.Int())
	gens["NodeIdleTimeBeforeScaleDown"] = gen.PtrOf(gen.AlphaString())
}

func Test_ScriptReference_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 ScriptReference via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForScriptReference, ScriptReferenceGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// ScriptReferenceGenerator returns a generator of ScriptReference instances for property testing.
func ScriptReferenceGenerator() gopter.Gen {
	if scriptReferenceGenerator != nil {
		return scriptReferenceGenerator
	}

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

	return scriptReferenceGenerator
}

// AddIndependentPropertyGeneratorsForScriptReference is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForScriptReference(gens map[string]gopter.Gen) {
	gens["ScriptArguments"] = gen.PtrOf(gen.AlphaString())
	gens["ScriptData"] = gen.PtrOf(gen.AlphaString())
	gens["ScriptSource"] = gen.PtrOf(gen.AlphaString())
	gens["Timeout"] = gen.PtrOf(gen.AlphaString())
}

func Test_ScriptsToExecute_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 ScriptsToExecute via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForScriptsToExecute, ScriptsToExecuteGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// ScriptsToExecuteGenerator returns a generator of ScriptsToExecute instances for property testing.
func ScriptsToExecuteGenerator() gopter.Gen {
	if scriptsToExecuteGenerator != nil {
		return scriptsToExecuteGenerator
	}

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

	return scriptsToExecuteGenerator
}

// AddRelatedPropertyGeneratorsForScriptsToExecute is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForScriptsToExecute(gens map[string]gopter.Gen) {
	gens["CreationScript"] = gen.PtrOf(ScriptReferenceGenerator())
	gens["StartupScript"] = gen.PtrOf(ScriptReferenceGenerator())
}

func Test_SetupScripts_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 SetupScripts via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForSetupScripts, SetupScriptsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// SetupScriptsGenerator returns a generator of SetupScripts instances for property testing.
func SetupScriptsGenerator() gopter.Gen {
	if setupScriptsGenerator != nil {
		return setupScriptsGenerator
	}

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

	return setupScriptsGenerator
}

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

func Test_SslConfiguration_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 SslConfiguration via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForSslConfiguration, SslConfigurationGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// SslConfigurationGenerator returns a generator of SslConfiguration instances for property testing.
func SslConfigurationGenerator() gopter.Gen {
	if sslConfigurationGenerator != nil {
		return sslConfigurationGenerator
	}

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

	return sslConfigurationGenerator
}

// AddIndependentPropertyGeneratorsForSslConfiguration is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForSslConfiguration(gens map[string]gopter.Gen) {
	gens["Cert"] = gen.PtrOf(gen.AlphaString())
	gens["Cname"] = gen.PtrOf(gen.AlphaString())
	gens["Key"] = gen.PtrOf(gen.AlphaString())
	gens["LeafDomainLabel"] = gen.PtrOf(gen.AlphaString())
	gens["OverwriteExistingDomain"] = gen.PtrOf(gen.Bool())
	gens["Status"] = gen.PtrOf(gen.OneConstOf(SslConfiguration_Status_Auto, SslConfiguration_Status_Disabled, SslConfiguration_Status_Enabled))
}

func Test_SynapseSpark_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 SynapseSpark via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForSynapseSpark, SynapseSparkGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForSynapseSpark(generators)
	AddRelatedPropertyGeneratorsForSynapseSpark(generators)
	synapseSparkGenerator = gen.Struct(reflect.TypeOf(SynapseSpark{}), generators)

	return synapseSparkGenerator
}

// AddIndependentPropertyGeneratorsForSynapseSpark is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForSynapseSpark(gens map[string]gopter.Gen) {
	gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString())
	gens["ComputeType"] = gen.OneConstOf(SynapseSpark_ComputeType_SynapseSpark)
	gens["Description"] = gen.PtrOf(gen.AlphaString())
	gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool())
	gens["ResourceId"] = gen.PtrOf(gen.AlphaString())
}

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

func Test_SynapseSpark_Properties_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 SynapseSpark_Properties via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForSynapseSpark_Properties, SynapseSpark_PropertiesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForSynapseSpark_Properties(generators)
	AddRelatedPropertyGeneratorsForSynapseSpark_Properties(generators)
	synapseSpark_PropertiesGenerator = gen.Struct(reflect.TypeOf(SynapseSpark_Properties{}), generators)

	return synapseSpark_PropertiesGenerator
}

// AddIndependentPropertyGeneratorsForSynapseSpark_Properties is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForSynapseSpark_Properties(gens map[string]gopter.Gen) {
	gens["NodeCount"] = gen.PtrOf(gen.Int())
	gens["NodeSize"] = gen.PtrOf(gen.AlphaString())
	gens["NodeSizeFamily"] = gen.PtrOf(gen.AlphaString())
	gens["PoolName"] = gen.PtrOf(gen.AlphaString())
	gens["ResourceGroup"] = gen.PtrOf(gen.AlphaString())
	gens["SparkVersion"] = gen.PtrOf(gen.AlphaString())
	gens["SubscriptionId"] = gen.PtrOf(gen.AlphaString())
	gens["WorkspaceName"] = gen.PtrOf(gen.AlphaString())
}

// AddRelatedPropertyGeneratorsForSynapseSpark_Properties is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForSynapseSpark_Properties(gens map[string]gopter.Gen) {
	gens["AutoPauseProperties"] = gen.PtrOf(AutoPausePropertiesGenerator())
	gens["AutoScaleProperties"] = gen.PtrOf(AutoScalePropertiesGenerator())
}

func Test_UserAccountCredentials_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 UserAccountCredentials via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForUserAccountCredentials, UserAccountCredentialsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// UserAccountCredentialsGenerator returns a generator of UserAccountCredentials instances for property testing.
func UserAccountCredentialsGenerator() gopter.Gen {
	if userAccountCredentialsGenerator != nil {
		return userAccountCredentialsGenerator
	}

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

	return userAccountCredentialsGenerator
}

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

func Test_VirtualMachine_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 VirtualMachine via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForVirtualMachine, VirtualMachineGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForVirtualMachine(generators)
	AddRelatedPropertyGeneratorsForVirtualMachine(generators)
	virtualMachineGenerator = gen.Struct(reflect.TypeOf(VirtualMachine{}), generators)

	return virtualMachineGenerator
}

// AddIndependentPropertyGeneratorsForVirtualMachine is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForVirtualMachine(gens map[string]gopter.Gen) {
	gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString())
	gens["ComputeType"] = gen.OneConstOf(VirtualMachine_ComputeType_VirtualMachine)
	gens["Description"] = gen.PtrOf(gen.AlphaString())
	gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool())
	gens["ResourceId"] = gen.PtrOf(gen.AlphaString())
}

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

func Test_VirtualMachineImage_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 VirtualMachineImage via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForVirtualMachineImage, VirtualMachineImageGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// VirtualMachineImageGenerator returns a generator of VirtualMachineImage instances for property testing.
func VirtualMachineImageGenerator() gopter.Gen {
	if virtualMachineImageGenerator != nil {
		return virtualMachineImageGenerator
	}

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

	return virtualMachineImageGenerator
}

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

func Test_VirtualMachineSshCredentials_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 VirtualMachineSshCredentials via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForVirtualMachineSshCredentials, VirtualMachineSshCredentialsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// VirtualMachineSshCredentialsGenerator returns a generator of VirtualMachineSshCredentials instances for property testing.
func VirtualMachineSshCredentialsGenerator() gopter.Gen {
	if virtualMachineSshCredentialsGenerator != nil {
		return virtualMachineSshCredentialsGenerator
	}

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

	return virtualMachineSshCredentialsGenerator
}

// AddIndependentPropertyGeneratorsForVirtualMachineSshCredentials is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForVirtualMachineSshCredentials(gens map[string]gopter.Gen) {
	gens["Password"] = gen.PtrOf(gen.AlphaString())
	gens["PrivateKeyData"] = gen.PtrOf(gen.AlphaString())
	gens["PublicKeyData"] = gen.PtrOf(gen.AlphaString())
	gens["Username"] = gen.PtrOf(gen.AlphaString())
}

func Test_VirtualMachine_Properties_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 VirtualMachine_Properties via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForVirtualMachine_Properties, VirtualMachine_PropertiesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForVirtualMachine_Properties(generators)
	AddRelatedPropertyGeneratorsForVirtualMachine_Properties(generators)
	virtualMachine_PropertiesGenerator = gen.Struct(reflect.TypeOf(VirtualMachine_Properties{}), generators)

	return virtualMachine_PropertiesGenerator
}

// AddIndependentPropertyGeneratorsForVirtualMachine_Properties is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForVirtualMachine_Properties(gens map[string]gopter.Gen) {
	gens["Address"] = gen.PtrOf(gen.AlphaString())
	gens["IsNotebookInstanceCompute"] = gen.PtrOf(gen.Bool())
	gens["SshPort"] = gen.PtrOf(gen.Int())
	gens["VirtualMachineSize"] = gen.PtrOf(gen.AlphaString())
}

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

func Test_WorkspacesCompute_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 WorkspacesCompute_Spec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForWorkspacesCompute_Spec, WorkspacesCompute_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual WorkspacesCompute_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 WorkspacesCompute_Spec instances for property testing - lazily instantiated by
// WorkspacesCompute_SpecGenerator()
var workspacesCompute_SpecGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForWorkspacesCompute_Spec(generators)
	AddRelatedPropertyGeneratorsForWorkspacesCompute_Spec(generators)
	workspacesCompute_SpecGenerator = gen.Struct(reflect.TypeOf(WorkspacesCompute_Spec{}), generators)

	return workspacesCompute_SpecGenerator
}

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

// AddRelatedPropertyGeneratorsForWorkspacesCompute_Spec is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForWorkspacesCompute_Spec(gens map[string]gopter.Gen) {
	gens["Identity"] = gen.PtrOf(IdentityGenerator())
	gens["Properties"] = gen.PtrOf(ComputeGenerator())
	gens["Sku"] = gen.PtrOf(SkuGenerator())
	gens["SystemData"] = gen.PtrOf(SystemDataGenerator())
}
