// 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_AcceptedAudiences_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 AcceptedAudiences via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForAcceptedAudiences, AcceptedAudiencesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// AcceptedAudiencesGenerator returns a generator of AcceptedAudiences instances for property testing.
func AcceptedAudiencesGenerator() gopter.Gen {
	if acceptedAudiencesGenerator != nil {
		return acceptedAudiencesGenerator
	}

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

	return acceptedAudiencesGenerator
}

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

func Test_AzureSku_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 AzureSku via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForAzureSku, AzureSkuGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// AzureSkuGenerator returns a generator of AzureSku instances for property testing.
func AzureSkuGenerator() gopter.Gen {
	if azureSkuGenerator != nil {
		return azureSkuGenerator
	}

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

	return azureSkuGenerator
}

// AddIndependentPropertyGeneratorsForAzureSku is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForAzureSku(gens map[string]gopter.Gen) {
	gens["Capacity"] = gen.PtrOf(gen.Int())
	gens["Name"] = gen.PtrOf(gen.OneConstOf(
		AzureSku_Name_DevNoSLA_Standard_D11_V2,
		AzureSku_Name_DevNoSLA_Standard_E2A_V4,
		AzureSku_Name_Standard_D11_V2,
		AzureSku_Name_Standard_D12_V2,
		AzureSku_Name_Standard_D13_V2,
		AzureSku_Name_Standard_D14_V2,
		AzureSku_Name_Standard_D16D_V5,
		AzureSku_Name_Standard_D32D_V4,
		AzureSku_Name_Standard_D32D_V5,
		AzureSku_Name_Standard_DS13_V21TB_PS,
		AzureSku_Name_Standard_DS13_V22TB_PS,
		AzureSku_Name_Standard_DS14_V23TB_PS,
		AzureSku_Name_Standard_DS14_V24TB_PS,
		AzureSku_Name_Standard_E16A_V4,
		AzureSku_Name_Standard_E16Ads_V5,
		AzureSku_Name_Standard_E16As_V43TB_PS,
		AzureSku_Name_Standard_E16As_V44TB_PS,
		AzureSku_Name_Standard_E16As_V53TB_PS,
		AzureSku_Name_Standard_E16As_V54TB_PS,
		AzureSku_Name_Standard_E16D_V4,
		AzureSku_Name_Standard_E16D_V5,
		AzureSku_Name_Standard_E16S_V43TB_PS,
		AzureSku_Name_Standard_E16S_V44TB_PS,
		AzureSku_Name_Standard_E16S_V53TB_PS,
		AzureSku_Name_Standard_E16S_V54TB_PS,
		AzureSku_Name_Standard_E2A_V4,
		AzureSku_Name_Standard_E2Ads_V5,
		AzureSku_Name_Standard_E2D_V4,
		AzureSku_Name_Standard_E2D_V5,
		AzureSku_Name_Standard_E4A_V4,
		AzureSku_Name_Standard_E4Ads_V5,
		AzureSku_Name_Standard_E4D_V4,
		AzureSku_Name_Standard_E4D_V5,
		AzureSku_Name_Standard_E64I_V3,
		AzureSku_Name_Standard_E80Ids_V4,
		AzureSku_Name_Standard_E8A_V4,
		AzureSku_Name_Standard_E8Ads_V5,
		AzureSku_Name_Standard_E8As_V41TB_PS,
		AzureSku_Name_Standard_E8As_V42TB_PS,
		AzureSku_Name_Standard_E8As_V51TB_PS,
		AzureSku_Name_Standard_E8As_V52TB_PS,
		AzureSku_Name_Standard_E8D_V4,
		AzureSku_Name_Standard_E8D_V5,
		AzureSku_Name_Standard_E8S_V41TB_PS,
		AzureSku_Name_Standard_E8S_V42TB_PS,
		AzureSku_Name_Standard_E8S_V51TB_PS,
		AzureSku_Name_Standard_E8S_V52TB_PS,
		AzureSku_Name_Standard_EC16Ads_V5,
		AzureSku_Name_Standard_EC16As_V53TB_PS,
		AzureSku_Name_Standard_EC16As_V54TB_PS,
		AzureSku_Name_Standard_EC8Ads_V5,
		AzureSku_Name_Standard_EC8As_V51TB_PS,
		AzureSku_Name_Standard_EC8As_V52TB_PS,
		AzureSku_Name_Standard_L16As_V3,
		AzureSku_Name_Standard_L16S,
		AzureSku_Name_Standard_L16S_V2,
		AzureSku_Name_Standard_L16S_V3,
		AzureSku_Name_Standard_L32As_V3,
		AzureSku_Name_Standard_L32S_V3,
		AzureSku_Name_Standard_L4S,
		AzureSku_Name_Standard_L8As_V3,
		AzureSku_Name_Standard_L8S,
		AzureSku_Name_Standard_L8S_V2,
		AzureSku_Name_Standard_L8S_V3))
	gens["Tier"] = gen.PtrOf(gen.OneConstOf(AzureSku_Tier_Basic, AzureSku_Tier_Standard))
}

func Test_CalloutPolicy_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 CalloutPolicy via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForCalloutPolicy, CalloutPolicyGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// CalloutPolicyGenerator returns a generator of CalloutPolicy instances for property testing.
func CalloutPolicyGenerator() gopter.Gen {
	if calloutPolicyGenerator != nil {
		return calloutPolicyGenerator
	}

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

	return calloutPolicyGenerator
}

// AddIndependentPropertyGeneratorsForCalloutPolicy is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForCalloutPolicy(gens map[string]gopter.Gen) {
	gens["CalloutType"] = gen.PtrOf(gen.OneConstOf(
		CalloutPolicy_CalloutType_Azure_Digital_Twins,
		CalloutPolicy_CalloutType_Azure_Openai,
		CalloutPolicy_CalloutType_Cosmosdb,
		CalloutPolicy_CalloutType_External_Data,
		CalloutPolicy_CalloutType_Genevametrics,
		CalloutPolicy_CalloutType_Kusto,
		CalloutPolicy_CalloutType_Mysql,
		CalloutPolicy_CalloutType_Postgresql,
		CalloutPolicy_CalloutType_Sandbox_Artifacts,
		CalloutPolicy_CalloutType_Sql,
		CalloutPolicy_CalloutType_Webapi))
	gens["CalloutUriRegex"] = gen.PtrOf(gen.AlphaString())
	gens["OutboundAccess"] = gen.PtrOf(gen.OneConstOf(CalloutPolicy_OutboundAccess_Allow, CalloutPolicy_OutboundAccess_Deny))
}

func Test_ClusterProperties_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 ClusterProperties via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForClusterProperties, ClusterPropertiesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForClusterProperties(generators)
	AddRelatedPropertyGeneratorsForClusterProperties(generators)
	clusterPropertiesGenerator = gen.Struct(reflect.TypeOf(ClusterProperties{}), generators)

	return clusterPropertiesGenerator
}

// AddIndependentPropertyGeneratorsForClusterProperties is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForClusterProperties(gens map[string]gopter.Gen) {
	gens["AllowedFqdnList"] = gen.SliceOf(gen.AlphaString())
	gens["AllowedIpRangeList"] = gen.SliceOf(gen.AlphaString())
	gens["EnableAutoStop"] = gen.PtrOf(gen.Bool())
	gens["EnableDiskEncryption"] = gen.PtrOf(gen.Bool())
	gens["EnableDoubleEncryption"] = gen.PtrOf(gen.Bool())
	gens["EnablePurge"] = gen.PtrOf(gen.Bool())
	gens["EnableStreamingIngest"] = gen.PtrOf(gen.Bool())
	gens["EngineType"] = gen.PtrOf(gen.OneConstOf(ClusterProperties_EngineType_V2, ClusterProperties_EngineType_V3))
	gens["PublicIPType"] = gen.PtrOf(gen.OneConstOf(ClusterProperties_PublicIPType_DualStack, ClusterProperties_PublicIPType_IPv4))
	gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(ClusterProperties_PublicNetworkAccess_Disabled, ClusterProperties_PublicNetworkAccess_Enabled))
	gens["RestrictOutboundNetworkAccess"] = gen.PtrOf(gen.OneConstOf(ClusterProperties_RestrictOutboundNetworkAccess_Disabled, ClusterProperties_RestrictOutboundNetworkAccess_Enabled))
	gens["VirtualClusterGraduationProperties"] = gen.PtrOf(gen.AlphaString())
}

// AddRelatedPropertyGeneratorsForClusterProperties is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForClusterProperties(gens map[string]gopter.Gen) {
	gens["AcceptedAudiences"] = gen.SliceOf(AcceptedAudiencesGenerator())
	gens["CalloutPolicies"] = gen.SliceOf(CalloutPolicyGenerator())
	gens["KeyVaultProperties"] = gen.PtrOf(KeyVaultPropertiesGenerator())
	gens["LanguageExtensions"] = gen.PtrOf(LanguageExtensionsListGenerator())
	gens["OptimizedAutoscale"] = gen.PtrOf(OptimizedAutoscaleGenerator())
	gens["TrustedExternalTenants"] = gen.SliceOf(TrustedExternalTenantGenerator())
	gens["VirtualNetworkConfiguration"] = gen.PtrOf(VirtualNetworkConfigurationGenerator())
}

func Test_Cluster_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 Cluster_Spec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForCluster_Spec, Cluster_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual Cluster_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 Cluster_Spec instances for property testing - lazily instantiated by Cluster_SpecGenerator()
var cluster_SpecGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForCluster_Spec(generators)
	AddRelatedPropertyGeneratorsForCluster_Spec(generators)
	cluster_SpecGenerator = gen.Struct(reflect.TypeOf(Cluster_Spec{}), generators)

	return cluster_SpecGenerator
}

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

// AddRelatedPropertyGeneratorsForCluster_Spec is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForCluster_Spec(gens map[string]gopter.Gen) {
	gens["Identity"] = gen.PtrOf(IdentityGenerator())
	gens["Properties"] = gen.PtrOf(ClusterPropertiesGenerator())
	gens["Sku"] = gen.PtrOf(AzureSkuGenerator())
}

func Test_Identity_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 Identity via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForIdentity, IdentityGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForIdentity(generators)
	AddRelatedPropertyGeneratorsForIdentity(generators)
	identityGenerator = gen.Struct(reflect.TypeOf(Identity{}), generators)

	return identityGenerator
}

// AddIndependentPropertyGeneratorsForIdentity is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) {
	gens["Type"] = gen.PtrOf(gen.OneConstOf(
		Identity_Type_None,
		Identity_Type_SystemAssigned,
		Identity_Type_SystemAssignedUserAssigned,
		Identity_Type_UserAssigned))
}

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

func Test_KeyVaultProperties_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 KeyVaultProperties via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForKeyVaultProperties, KeyVaultPropertiesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// KeyVaultPropertiesGenerator returns a generator of KeyVaultProperties instances for property testing.
func KeyVaultPropertiesGenerator() gopter.Gen {
	if keyVaultPropertiesGenerator != nil {
		return keyVaultPropertiesGenerator
	}

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

	return keyVaultPropertiesGenerator
}

// AddIndependentPropertyGeneratorsForKeyVaultProperties is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForKeyVaultProperties(gens map[string]gopter.Gen) {
	gens["KeyName"] = gen.PtrOf(gen.AlphaString())
	gens["KeyVaultUri"] = gen.PtrOf(gen.AlphaString())
	gens["KeyVersion"] = gen.PtrOf(gen.AlphaString())
	gens["UserIdentity"] = gen.PtrOf(gen.AlphaString())
}

func Test_LanguageExtension_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 LanguageExtension via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForLanguageExtension, LanguageExtensionGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// LanguageExtensionGenerator returns a generator of LanguageExtension instances for property testing.
func LanguageExtensionGenerator() gopter.Gen {
	if languageExtensionGenerator != nil {
		return languageExtensionGenerator
	}

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

	return languageExtensionGenerator
}

// AddIndependentPropertyGeneratorsForLanguageExtension is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForLanguageExtension(gens map[string]gopter.Gen) {
	gens["LanguageExtensionCustomImageName"] = gen.PtrOf(gen.AlphaString())
	gens["LanguageExtensionImageName"] = gen.PtrOf(gen.OneConstOf(
		LanguageExtensionImageName_Python3_10_8,
		LanguageExtensionImageName_Python3_10_8_DL,
		LanguageExtensionImageName_Python3_11_7,
		LanguageExtensionImageName_Python3_11_7_DL,
		LanguageExtensionImageName_Python3_6_5,
		LanguageExtensionImageName_PythonCustomImage,
		LanguageExtensionImageName_R))
	gens["LanguageExtensionName"] = gen.PtrOf(gen.OneConstOf(LanguageExtensionName_PYTHON, LanguageExtensionName_R))
}

func Test_LanguageExtensionsList_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 LanguageExtensionsList via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForLanguageExtensionsList, LanguageExtensionsListGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// LanguageExtensionsListGenerator returns a generator of LanguageExtensionsList instances for property testing.
func LanguageExtensionsListGenerator() gopter.Gen {
	if languageExtensionsListGenerator != nil {
		return languageExtensionsListGenerator
	}

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

	return languageExtensionsListGenerator
}

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

func Test_OptimizedAutoscale_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 OptimizedAutoscale via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForOptimizedAutoscale, OptimizedAutoscaleGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// OptimizedAutoscaleGenerator returns a generator of OptimizedAutoscale instances for property testing.
func OptimizedAutoscaleGenerator() gopter.Gen {
	if optimizedAutoscaleGenerator != nil {
		return optimizedAutoscaleGenerator
	}

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

	return optimizedAutoscaleGenerator
}

// AddIndependentPropertyGeneratorsForOptimizedAutoscale is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForOptimizedAutoscale(gens map[string]gopter.Gen) {
	gens["IsEnabled"] = gen.PtrOf(gen.Bool())
	gens["Maximum"] = gen.PtrOf(gen.Int())
	gens["Minimum"] = gen.PtrOf(gen.Int())
	gens["Version"] = gen.PtrOf(gen.Int())
}

func Test_TrustedExternalTenant_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 TrustedExternalTenant via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForTrustedExternalTenant, TrustedExternalTenantGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// TrustedExternalTenantGenerator returns a generator of TrustedExternalTenant instances for property testing.
func TrustedExternalTenantGenerator() gopter.Gen {
	if trustedExternalTenantGenerator != nil {
		return trustedExternalTenantGenerator
	}

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

	return trustedExternalTenantGenerator
}

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

func Test_UserAssignedIdentityDetails_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 UserAssignedIdentityDetails via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityDetails, UserAssignedIdentityDetailsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// UserAssignedIdentityDetailsGenerator returns a generator of UserAssignedIdentityDetails instances for property testing.
func UserAssignedIdentityDetailsGenerator() gopter.Gen {
	if userAssignedIdentityDetailsGenerator != nil {
		return userAssignedIdentityDetailsGenerator
	}

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

	return userAssignedIdentityDetailsGenerator
}

func Test_VirtualNetworkConfiguration_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 VirtualNetworkConfiguration via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForVirtualNetworkConfiguration, VirtualNetworkConfigurationGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// VirtualNetworkConfigurationGenerator returns a generator of VirtualNetworkConfiguration instances for property testing.
func VirtualNetworkConfigurationGenerator() gopter.Gen {
	if virtualNetworkConfigurationGenerator != nil {
		return virtualNetworkConfigurationGenerator
	}

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

	return virtualNetworkConfigurationGenerator
}

// AddIndependentPropertyGeneratorsForVirtualNetworkConfiguration is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForVirtualNetworkConfiguration(gens map[string]gopter.Gen) {
	gens["DataManagementPublicIpId"] = gen.PtrOf(gen.AlphaString())
	gens["EnginePublicIpId"] = gen.PtrOf(gen.AlphaString())
	gens["State"] = gen.PtrOf(gen.OneConstOf(VirtualNetworkConfiguration_State_Disabled, VirtualNetworkConfiguration_State_Enabled))
	gens["SubnetId"] = gen.PtrOf(gen.AlphaString())
}
