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

import (
	"fmt"
	storage "github.com/Azure/azure-service-operator/v2/api/insights/v1api20220615/storage"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime/core"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets"
	"github.com/rotisserie/eris"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"sigs.k8s.io/controller-runtime/pkg/conversion"
)

// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={azure,insights}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity"
// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason"
// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message"
// Storage version of v1api20180501preview.Webtest
// Generator information:
// - Generated from: /applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/webTests_API.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}
type Webtest struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              Webtest_Spec   `json:"spec,omitempty"`
	Status            Webtest_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &Webtest{}

// GetConditions returns the conditions of the resource
func (webtest *Webtest) GetConditions() conditions.Conditions {
	return webtest.Status.Conditions
}

// SetConditions sets the conditions on the resource status
func (webtest *Webtest) SetConditions(conditions conditions.Conditions) {
	webtest.Status.Conditions = conditions
}

var _ conversion.Convertible = &Webtest{}

// ConvertFrom populates our Webtest from the provided hub Webtest
func (webtest *Webtest) ConvertFrom(hub conversion.Hub) error {
	source, ok := hub.(*storage.Webtest)
	if !ok {
		return fmt.Errorf("expected insights/v1api20220615/storage/Webtest but received %T instead", hub)
	}

	return webtest.AssignProperties_From_Webtest(source)
}

// ConvertTo populates the provided hub Webtest from our Webtest
func (webtest *Webtest) ConvertTo(hub conversion.Hub) error {
	destination, ok := hub.(*storage.Webtest)
	if !ok {
		return fmt.Errorf("expected insights/v1api20220615/storage/Webtest but received %T instead", hub)
	}

	return webtest.AssignProperties_To_Webtest(destination)
}

var _ configmaps.Exporter = &Webtest{}

// ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property
func (webtest *Webtest) ConfigMapDestinationExpressions() []*core.DestinationExpression {
	if webtest.Spec.OperatorSpec == nil {
		return nil
	}
	return webtest.Spec.OperatorSpec.ConfigMapExpressions
}

var _ secrets.Exporter = &Webtest{}

// SecretDestinationExpressions returns the Spec.OperatorSpec.SecretExpressions property
func (webtest *Webtest) SecretDestinationExpressions() []*core.DestinationExpression {
	if webtest.Spec.OperatorSpec == nil {
		return nil
	}
	return webtest.Spec.OperatorSpec.SecretExpressions
}

var _ genruntime.KubernetesResource = &Webtest{}

// AzureName returns the Azure name of the resource
func (webtest *Webtest) AzureName() string {
	return webtest.Spec.AzureName
}

// GetAPIVersion returns the ARM API version of the resource. This is always "2018-05-01-preview"
func (webtest Webtest) GetAPIVersion() string {
	return "2018-05-01-preview"
}

// GetResourceScope returns the scope of the resource
func (webtest *Webtest) GetResourceScope() genruntime.ResourceScope {
	return genruntime.ResourceScopeResourceGroup
}

// GetSpec returns the specification of this resource
func (webtest *Webtest) GetSpec() genruntime.ConvertibleSpec {
	return &webtest.Spec
}

// GetStatus returns the status of this resource
func (webtest *Webtest) GetStatus() genruntime.ConvertibleStatus {
	return &webtest.Status
}

// GetSupportedOperations returns the operations supported by the resource
func (webtest *Webtest) GetSupportedOperations() []genruntime.ResourceOperation {
	return []genruntime.ResourceOperation{
		genruntime.ResourceOperationDelete,
		genruntime.ResourceOperationGet,
		genruntime.ResourceOperationPut,
	}
}

// GetType returns the ARM Type of the resource. This is always "Microsoft.Insights/webtests"
func (webtest *Webtest) GetType() string {
	return "Microsoft.Insights/webtests"
}

// NewEmptyStatus returns a new empty (blank) status
func (webtest *Webtest) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &Webtest_STATUS{}
}

// Owner returns the ResourceReference of the owner
func (webtest *Webtest) Owner() *genruntime.ResourceReference {
	if webtest.Spec.Owner == nil {
		return nil
	}

	group, kind := genruntime.LookupOwnerGroupKind(webtest.Spec)
	return webtest.Spec.Owner.AsResourceReference(group, kind)
}

// SetStatus sets the status of this resource
func (webtest *Webtest) SetStatus(status genruntime.ConvertibleStatus) error {
	// If we have exactly the right type of status, assign it
	if st, ok := status.(*Webtest_STATUS); ok {
		webtest.Status = *st
		return nil
	}

	// Convert status to required version
	var st Webtest_STATUS
	err := status.ConvertStatusTo(&st)
	if err != nil {
		return eris.Wrap(err, "failed to convert status")
	}

	webtest.Status = st
	return nil
}

// AssignProperties_From_Webtest populates our Webtest from the provided source Webtest
func (webtest *Webtest) AssignProperties_From_Webtest(source *storage.Webtest) error {

	// ObjectMeta
	webtest.ObjectMeta = *source.ObjectMeta.DeepCopy()

	// Spec
	var spec Webtest_Spec
	err := spec.AssignProperties_From_Webtest_Spec(&source.Spec)
	if err != nil {
		return eris.Wrap(err, "calling AssignProperties_From_Webtest_Spec() to populate field Spec")
	}
	webtest.Spec = spec

	// Status
	var status Webtest_STATUS
	err = status.AssignProperties_From_Webtest_STATUS(&source.Status)
	if err != nil {
		return eris.Wrap(err, "calling AssignProperties_From_Webtest_STATUS() to populate field Status")
	}
	webtest.Status = status

	// Invoke the augmentConversionForWebtest interface (if implemented) to customize the conversion
	var webtestAsAny any = webtest
	if augmentedWebtest, ok := webtestAsAny.(augmentConversionForWebtest); ok {
		err := augmentedWebtest.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_Webtest populates the provided destination Webtest from our Webtest
func (webtest *Webtest) AssignProperties_To_Webtest(destination *storage.Webtest) error {

	// ObjectMeta
	destination.ObjectMeta = *webtest.ObjectMeta.DeepCopy()

	// Spec
	var spec storage.Webtest_Spec
	err := webtest.Spec.AssignProperties_To_Webtest_Spec(&spec)
	if err != nil {
		return eris.Wrap(err, "calling AssignProperties_To_Webtest_Spec() to populate field Spec")
	}
	destination.Spec = spec

	// Status
	var status storage.Webtest_STATUS
	err = webtest.Status.AssignProperties_To_Webtest_STATUS(&status)
	if err != nil {
		return eris.Wrap(err, "calling AssignProperties_To_Webtest_STATUS() to populate field Status")
	}
	destination.Status = status

	// Invoke the augmentConversionForWebtest interface (if implemented) to customize the conversion
	var webtestAsAny any = webtest
	if augmentedWebtest, ok := webtestAsAny.(augmentConversionForWebtest); ok {
		err := augmentedWebtest.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// OriginalGVK returns a GroupValueKind for the original API version used to create the resource
func (webtest *Webtest) OriginalGVK() *schema.GroupVersionKind {
	return &schema.GroupVersionKind{
		Group:   GroupVersion.Group,
		Version: webtest.Spec.OriginalVersion,
		Kind:    "Webtest",
	}
}

// +kubebuilder:object:root=true
// Storage version of v1api20180501preview.Webtest
// Generator information:
// - Generated from: /applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/webTests_API.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}
type WebtestList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Webtest `json:"items"`
}

// Storage version of v1api20180501preview.APIVersion
// +kubebuilder:validation:Enum={"2018-05-01-preview"}
type APIVersion string

const APIVersion_Value = APIVersion("2018-05-01-preview")

type augmentConversionForWebtest interface {
	AssignPropertiesFrom(src *storage.Webtest) error
	AssignPropertiesTo(dst *storage.Webtest) error
}

// Storage version of v1api20180501preview.Webtest_Spec
type Webtest_Spec struct {
	// AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it
	// doesn't have to be.
	AzureName       string                           `json:"azureName,omitempty"`
	Configuration   *WebTestProperties_Configuration `json:"Configuration,omitempty"`
	Description     *string                          `json:"Description,omitempty"`
	Enabled         *bool                            `json:"Enabled,omitempty"`
	Frequency       *int                             `json:"Frequency,omitempty"`
	Kind            *string                          `json:"Kind,omitempty"`
	Location        *string                          `json:"location,omitempty"`
	Locations       []WebTestGeolocation             `json:"Locations,omitempty"`
	Name            *string                          `json:"Name,omitempty"`
	OperatorSpec    *WebtestOperatorSpec             `json:"operatorSpec,omitempty"`
	OriginalVersion string                           `json:"originalVersion,omitempty"`

	// +kubebuilder:validation:Required
	// Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also
	// controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a
	// reference to a resources.azure.com/ResourceGroup resource
	Owner              *genruntime.KnownResourceReference `group:"resources.azure.com" json:"owner,omitempty" kind:"ResourceGroup"`
	PropertyBag        genruntime.PropertyBag             `json:"$propertyBag,omitempty"`
	Request            *WebTestProperties_Request         `json:"Request,omitempty"`
	RetryEnabled       *bool                              `json:"RetryEnabled,omitempty"`
	SyntheticMonitorId *string                            `json:"SyntheticMonitorId,omitempty"`
	Tags               map[string]string                  `json:"tags,omitempty"`
	Timeout            *int                               `json:"Timeout,omitempty"`
	ValidationRules    *WebTestProperties_ValidationRules `json:"ValidationRules,omitempty"`
}

var _ genruntime.ConvertibleSpec = &Webtest_Spec{}

// ConvertSpecFrom populates our Webtest_Spec from the provided source
func (webtest *Webtest_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
	src, ok := source.(*storage.Webtest_Spec)
	if ok {
		// Populate our instance from source
		return webtest.AssignProperties_From_Webtest_Spec(src)
	}

	// Convert to an intermediate form
	src = &storage.Webtest_Spec{}
	err := src.ConvertSpecFrom(source)
	if err != nil {
		return eris.Wrap(err, "initial step of conversion in ConvertSpecFrom()")
	}

	// Update our instance from src
	err = webtest.AssignProperties_From_Webtest_Spec(src)
	if err != nil {
		return eris.Wrap(err, "final step of conversion in ConvertSpecFrom()")
	}

	return nil
}

// ConvertSpecTo populates the provided destination from our Webtest_Spec
func (webtest *Webtest_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
	dst, ok := destination.(*storage.Webtest_Spec)
	if ok {
		// Populate destination from our instance
		return webtest.AssignProperties_To_Webtest_Spec(dst)
	}

	// Convert to an intermediate form
	dst = &storage.Webtest_Spec{}
	err := webtest.AssignProperties_To_Webtest_Spec(dst)
	if err != nil {
		return eris.Wrap(err, "initial step of conversion in ConvertSpecTo()")
	}

	// Update dst from our instance
	err = dst.ConvertSpecTo(destination)
	if err != nil {
		return eris.Wrap(err, "final step of conversion in ConvertSpecTo()")
	}

	return nil
}

// AssignProperties_From_Webtest_Spec populates our Webtest_Spec from the provided source Webtest_Spec
func (webtest *Webtest_Spec) AssignProperties_From_Webtest_Spec(source *storage.Webtest_Spec) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// AzureName
	webtest.AzureName = source.AzureName

	// Configuration
	if source.Configuration != nil {
		var configuration WebTestProperties_Configuration
		err := configuration.AssignProperties_From_WebTestProperties_Configuration(source.Configuration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_WebTestProperties_Configuration() to populate field Configuration")
		}
		webtest.Configuration = &configuration
	} else {
		webtest.Configuration = nil
	}

	// Description
	webtest.Description = genruntime.ClonePointerToString(source.Description)

	// Enabled
	if source.Enabled != nil {
		enabled := *source.Enabled
		webtest.Enabled = &enabled
	} else {
		webtest.Enabled = nil
	}

	// Frequency
	webtest.Frequency = genruntime.ClonePointerToInt(source.Frequency)

	// Kind
	webtest.Kind = genruntime.ClonePointerToString(source.Kind)

	// Location
	webtest.Location = genruntime.ClonePointerToString(source.Location)

	// Locations
	if source.Locations != nil {
		locationList := make([]WebTestGeolocation, len(source.Locations))
		for locationIndex, locationItem := range source.Locations {
			var location WebTestGeolocation
			err := location.AssignProperties_From_WebTestGeolocation(&locationItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_WebTestGeolocation() to populate field Locations")
			}
			locationList[locationIndex] = location
		}
		webtest.Locations = locationList
	} else {
		webtest.Locations = nil
	}

	// Name
	webtest.Name = genruntime.ClonePointerToString(source.Name)

	// OperatorSpec
	if source.OperatorSpec != nil {
		var operatorSpec WebtestOperatorSpec
		err := operatorSpec.AssignProperties_From_WebtestOperatorSpec(source.OperatorSpec)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_WebtestOperatorSpec() to populate field OperatorSpec")
		}
		webtest.OperatorSpec = &operatorSpec
	} else {
		webtest.OperatorSpec = nil
	}

	// OriginalVersion
	webtest.OriginalVersion = source.OriginalVersion

	// Owner
	if source.Owner != nil {
		owner := source.Owner.Copy()
		webtest.Owner = &owner
	} else {
		webtest.Owner = nil
	}

	// Request
	if source.Request != nil {
		var request WebTestProperties_Request
		err := request.AssignProperties_From_WebTestProperties_Request(source.Request)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_WebTestProperties_Request() to populate field Request")
		}
		webtest.Request = &request
	} else {
		webtest.Request = nil
	}

	// RetryEnabled
	if source.RetryEnabled != nil {
		retryEnabled := *source.RetryEnabled
		webtest.RetryEnabled = &retryEnabled
	} else {
		webtest.RetryEnabled = nil
	}

	// SyntheticMonitorId
	webtest.SyntheticMonitorId = genruntime.ClonePointerToString(source.SyntheticMonitorId)

	// Tags
	webtest.Tags = genruntime.CloneMapOfStringToString(source.Tags)

	// Timeout
	webtest.Timeout = genruntime.ClonePointerToInt(source.Timeout)

	// ValidationRules
	if source.ValidationRules != nil {
		var validationRule WebTestProperties_ValidationRules
		err := validationRule.AssignProperties_From_WebTestProperties_ValidationRules(source.ValidationRules)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_WebTestProperties_ValidationRules() to populate field ValidationRules")
		}
		webtest.ValidationRules = &validationRule
	} else {
		webtest.ValidationRules = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		webtest.PropertyBag = propertyBag
	} else {
		webtest.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebtest_Spec interface (if implemented) to customize the conversion
	var webtestAsAny any = webtest
	if augmentedWebtest, ok := webtestAsAny.(augmentConversionForWebtest_Spec); ok {
		err := augmentedWebtest.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_Webtest_Spec populates the provided destination Webtest_Spec from our Webtest_Spec
func (webtest *Webtest_Spec) AssignProperties_To_Webtest_Spec(destination *storage.Webtest_Spec) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(webtest.PropertyBag)

	// AzureName
	destination.AzureName = webtest.AzureName

	// Configuration
	if webtest.Configuration != nil {
		var configuration storage.WebTestProperties_Configuration
		err := webtest.Configuration.AssignProperties_To_WebTestProperties_Configuration(&configuration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_WebTestProperties_Configuration() to populate field Configuration")
		}
		destination.Configuration = &configuration
	} else {
		destination.Configuration = nil
	}

	// Description
	destination.Description = genruntime.ClonePointerToString(webtest.Description)

	// Enabled
	if webtest.Enabled != nil {
		enabled := *webtest.Enabled
		destination.Enabled = &enabled
	} else {
		destination.Enabled = nil
	}

	// Frequency
	destination.Frequency = genruntime.ClonePointerToInt(webtest.Frequency)

	// Kind
	destination.Kind = genruntime.ClonePointerToString(webtest.Kind)

	// Location
	destination.Location = genruntime.ClonePointerToString(webtest.Location)

	// Locations
	if webtest.Locations != nil {
		locationList := make([]storage.WebTestGeolocation, len(webtest.Locations))
		for locationIndex, locationItem := range webtest.Locations {
			var location storage.WebTestGeolocation
			err := locationItem.AssignProperties_To_WebTestGeolocation(&location)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_WebTestGeolocation() to populate field Locations")
			}
			locationList[locationIndex] = location
		}
		destination.Locations = locationList
	} else {
		destination.Locations = nil
	}

	// Name
	destination.Name = genruntime.ClonePointerToString(webtest.Name)

	// OperatorSpec
	if webtest.OperatorSpec != nil {
		var operatorSpec storage.WebtestOperatorSpec
		err := webtest.OperatorSpec.AssignProperties_To_WebtestOperatorSpec(&operatorSpec)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_WebtestOperatorSpec() to populate field OperatorSpec")
		}
		destination.OperatorSpec = &operatorSpec
	} else {
		destination.OperatorSpec = nil
	}

	// OriginalVersion
	destination.OriginalVersion = webtest.OriginalVersion

	// Owner
	if webtest.Owner != nil {
		owner := webtest.Owner.Copy()
		destination.Owner = &owner
	} else {
		destination.Owner = nil
	}

	// Request
	if webtest.Request != nil {
		var request storage.WebTestProperties_Request
		err := webtest.Request.AssignProperties_To_WebTestProperties_Request(&request)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_WebTestProperties_Request() to populate field Request")
		}
		destination.Request = &request
	} else {
		destination.Request = nil
	}

	// RetryEnabled
	if webtest.RetryEnabled != nil {
		retryEnabled := *webtest.RetryEnabled
		destination.RetryEnabled = &retryEnabled
	} else {
		destination.RetryEnabled = nil
	}

	// SyntheticMonitorId
	destination.SyntheticMonitorId = genruntime.ClonePointerToString(webtest.SyntheticMonitorId)

	// Tags
	destination.Tags = genruntime.CloneMapOfStringToString(webtest.Tags)

	// Timeout
	destination.Timeout = genruntime.ClonePointerToInt(webtest.Timeout)

	// ValidationRules
	if webtest.ValidationRules != nil {
		var validationRule storage.WebTestProperties_ValidationRules
		err := webtest.ValidationRules.AssignProperties_To_WebTestProperties_ValidationRules(&validationRule)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_WebTestProperties_ValidationRules() to populate field ValidationRules")
		}
		destination.ValidationRules = &validationRule
	} else {
		destination.ValidationRules = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebtest_Spec interface (if implemented) to customize the conversion
	var webtestAsAny any = webtest
	if augmentedWebtest, ok := webtestAsAny.(augmentConversionForWebtest_Spec); ok {
		err := augmentedWebtest.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20180501preview.Webtest_STATUS
type Webtest_STATUS struct {
	Conditions         []conditions.Condition                    `json:"conditions,omitempty"`
	Configuration      *WebTestProperties_Configuration_STATUS   `json:"Configuration,omitempty"`
	Description        *string                                   `json:"Description,omitempty"`
	Enabled            *bool                                     `json:"Enabled,omitempty"`
	Frequency          *int                                      `json:"Frequency,omitempty"`
	Id                 *string                                   `json:"id,omitempty"`
	Kind               *string                                   `json:"Kind,omitempty"`
	Location           *string                                   `json:"location,omitempty"`
	Locations          []WebTestGeolocation_STATUS               `json:"Locations,omitempty"`
	Name               *string                                   `json:"name,omitempty"`
	PropertiesName     *string                                   `json:"properties_name,omitempty"`
	PropertyBag        genruntime.PropertyBag                    `json:"$propertyBag,omitempty"`
	ProvisioningState  *string                                   `json:"provisioningState,omitempty"`
	Request            *WebTestProperties_Request_STATUS         `json:"Request,omitempty"`
	RetryEnabled       *bool                                     `json:"RetryEnabled,omitempty"`
	SyntheticMonitorId *string                                   `json:"SyntheticMonitorId,omitempty"`
	Tags               map[string]string                         `json:"tags,omitempty"`
	Timeout            *int                                      `json:"Timeout,omitempty"`
	Type               *string                                   `json:"type,omitempty"`
	ValidationRules    *WebTestProperties_ValidationRules_STATUS `json:"ValidationRules,omitempty"`
}

var _ genruntime.ConvertibleStatus = &Webtest_STATUS{}

// ConvertStatusFrom populates our Webtest_STATUS from the provided source
func (webtest *Webtest_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
	src, ok := source.(*storage.Webtest_STATUS)
	if ok {
		// Populate our instance from source
		return webtest.AssignProperties_From_Webtest_STATUS(src)
	}

	// Convert to an intermediate form
	src = &storage.Webtest_STATUS{}
	err := src.ConvertStatusFrom(source)
	if err != nil {
		return eris.Wrap(err, "initial step of conversion in ConvertStatusFrom()")
	}

	// Update our instance from src
	err = webtest.AssignProperties_From_Webtest_STATUS(src)
	if err != nil {
		return eris.Wrap(err, "final step of conversion in ConvertStatusFrom()")
	}

	return nil
}

// ConvertStatusTo populates the provided destination from our Webtest_STATUS
func (webtest *Webtest_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
	dst, ok := destination.(*storage.Webtest_STATUS)
	if ok {
		// Populate destination from our instance
		return webtest.AssignProperties_To_Webtest_STATUS(dst)
	}

	// Convert to an intermediate form
	dst = &storage.Webtest_STATUS{}
	err := webtest.AssignProperties_To_Webtest_STATUS(dst)
	if err != nil {
		return eris.Wrap(err, "initial step of conversion in ConvertStatusTo()")
	}

	// Update dst from our instance
	err = dst.ConvertStatusTo(destination)
	if err != nil {
		return eris.Wrap(err, "final step of conversion in ConvertStatusTo()")
	}

	return nil
}

// AssignProperties_From_Webtest_STATUS populates our Webtest_STATUS from the provided source Webtest_STATUS
func (webtest *Webtest_STATUS) AssignProperties_From_Webtest_STATUS(source *storage.Webtest_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Conditions
	webtest.Conditions = genruntime.CloneSliceOfCondition(source.Conditions)

	// Configuration
	if source.Configuration != nil {
		var configuration WebTestProperties_Configuration_STATUS
		err := configuration.AssignProperties_From_WebTestProperties_Configuration_STATUS(source.Configuration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_WebTestProperties_Configuration_STATUS() to populate field Configuration")
		}
		webtest.Configuration = &configuration
	} else {
		webtest.Configuration = nil
	}

	// Description
	webtest.Description = genruntime.ClonePointerToString(source.Description)

	// Enabled
	if source.Enabled != nil {
		enabled := *source.Enabled
		webtest.Enabled = &enabled
	} else {
		webtest.Enabled = nil
	}

	// Frequency
	webtest.Frequency = genruntime.ClonePointerToInt(source.Frequency)

	// Id
	webtest.Id = genruntime.ClonePointerToString(source.Id)

	// Kind
	webtest.Kind = genruntime.ClonePointerToString(source.Kind)

	// Location
	webtest.Location = genruntime.ClonePointerToString(source.Location)

	// Locations
	if source.Locations != nil {
		locationList := make([]WebTestGeolocation_STATUS, len(source.Locations))
		for locationIndex, locationItem := range source.Locations {
			var location WebTestGeolocation_STATUS
			err := location.AssignProperties_From_WebTestGeolocation_STATUS(&locationItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_WebTestGeolocation_STATUS() to populate field Locations")
			}
			locationList[locationIndex] = location
		}
		webtest.Locations = locationList
	} else {
		webtest.Locations = nil
	}

	// Name
	webtest.Name = genruntime.ClonePointerToString(source.Name)

	// PropertiesName
	webtest.PropertiesName = genruntime.ClonePointerToString(source.PropertiesName)

	// ProvisioningState
	webtest.ProvisioningState = genruntime.ClonePointerToString(source.ProvisioningState)

	// Request
	if source.Request != nil {
		var request WebTestProperties_Request_STATUS
		err := request.AssignProperties_From_WebTestProperties_Request_STATUS(source.Request)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_WebTestProperties_Request_STATUS() to populate field Request")
		}
		webtest.Request = &request
	} else {
		webtest.Request = nil
	}

	// RetryEnabled
	if source.RetryEnabled != nil {
		retryEnabled := *source.RetryEnabled
		webtest.RetryEnabled = &retryEnabled
	} else {
		webtest.RetryEnabled = nil
	}

	// SyntheticMonitorId
	webtest.SyntheticMonitorId = genruntime.ClonePointerToString(source.SyntheticMonitorId)

	// Tags
	webtest.Tags = genruntime.CloneMapOfStringToString(source.Tags)

	// Timeout
	webtest.Timeout = genruntime.ClonePointerToInt(source.Timeout)

	// Type
	webtest.Type = genruntime.ClonePointerToString(source.Type)

	// ValidationRules
	if source.ValidationRules != nil {
		var validationRule WebTestProperties_ValidationRules_STATUS
		err := validationRule.AssignProperties_From_WebTestProperties_ValidationRules_STATUS(source.ValidationRules)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_WebTestProperties_ValidationRules_STATUS() to populate field ValidationRules")
		}
		webtest.ValidationRules = &validationRule
	} else {
		webtest.ValidationRules = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		webtest.PropertyBag = propertyBag
	} else {
		webtest.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebtest_STATUS interface (if implemented) to customize the conversion
	var webtestAsAny any = webtest
	if augmentedWebtest, ok := webtestAsAny.(augmentConversionForWebtest_STATUS); ok {
		err := augmentedWebtest.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_Webtest_STATUS populates the provided destination Webtest_STATUS from our Webtest_STATUS
func (webtest *Webtest_STATUS) AssignProperties_To_Webtest_STATUS(destination *storage.Webtest_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(webtest.PropertyBag)

	// Conditions
	destination.Conditions = genruntime.CloneSliceOfCondition(webtest.Conditions)

	// Configuration
	if webtest.Configuration != nil {
		var configuration storage.WebTestProperties_Configuration_STATUS
		err := webtest.Configuration.AssignProperties_To_WebTestProperties_Configuration_STATUS(&configuration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_WebTestProperties_Configuration_STATUS() to populate field Configuration")
		}
		destination.Configuration = &configuration
	} else {
		destination.Configuration = nil
	}

	// Description
	destination.Description = genruntime.ClonePointerToString(webtest.Description)

	// Enabled
	if webtest.Enabled != nil {
		enabled := *webtest.Enabled
		destination.Enabled = &enabled
	} else {
		destination.Enabled = nil
	}

	// Frequency
	destination.Frequency = genruntime.ClonePointerToInt(webtest.Frequency)

	// Id
	destination.Id = genruntime.ClonePointerToString(webtest.Id)

	// Kind
	destination.Kind = genruntime.ClonePointerToString(webtest.Kind)

	// Location
	destination.Location = genruntime.ClonePointerToString(webtest.Location)

	// Locations
	if webtest.Locations != nil {
		locationList := make([]storage.WebTestGeolocation_STATUS, len(webtest.Locations))
		for locationIndex, locationItem := range webtest.Locations {
			var location storage.WebTestGeolocation_STATUS
			err := locationItem.AssignProperties_To_WebTestGeolocation_STATUS(&location)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_WebTestGeolocation_STATUS() to populate field Locations")
			}
			locationList[locationIndex] = location
		}
		destination.Locations = locationList
	} else {
		destination.Locations = nil
	}

	// Name
	destination.Name = genruntime.ClonePointerToString(webtest.Name)

	// PropertiesName
	destination.PropertiesName = genruntime.ClonePointerToString(webtest.PropertiesName)

	// ProvisioningState
	destination.ProvisioningState = genruntime.ClonePointerToString(webtest.ProvisioningState)

	// Request
	if webtest.Request != nil {
		var request storage.WebTestProperties_Request_STATUS
		err := webtest.Request.AssignProperties_To_WebTestProperties_Request_STATUS(&request)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_WebTestProperties_Request_STATUS() to populate field Request")
		}
		destination.Request = &request
	} else {
		destination.Request = nil
	}

	// RetryEnabled
	if webtest.RetryEnabled != nil {
		retryEnabled := *webtest.RetryEnabled
		destination.RetryEnabled = &retryEnabled
	} else {
		destination.RetryEnabled = nil
	}

	// SyntheticMonitorId
	destination.SyntheticMonitorId = genruntime.ClonePointerToString(webtest.SyntheticMonitorId)

	// Tags
	destination.Tags = genruntime.CloneMapOfStringToString(webtest.Tags)

	// Timeout
	destination.Timeout = genruntime.ClonePointerToInt(webtest.Timeout)

	// Type
	destination.Type = genruntime.ClonePointerToString(webtest.Type)

	// ValidationRules
	if webtest.ValidationRules != nil {
		var validationRule storage.WebTestProperties_ValidationRules_STATUS
		err := webtest.ValidationRules.AssignProperties_To_WebTestProperties_ValidationRules_STATUS(&validationRule)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_WebTestProperties_ValidationRules_STATUS() to populate field ValidationRules")
		}
		destination.ValidationRules = &validationRule
	} else {
		destination.ValidationRules = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebtest_STATUS interface (if implemented) to customize the conversion
	var webtestAsAny any = webtest
	if augmentedWebtest, ok := webtestAsAny.(augmentConversionForWebtest_STATUS); ok {
		err := augmentedWebtest.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

type augmentConversionForWebtest_Spec interface {
	AssignPropertiesFrom(src *storage.Webtest_Spec) error
	AssignPropertiesTo(dst *storage.Webtest_Spec) error
}

type augmentConversionForWebtest_STATUS interface {
	AssignPropertiesFrom(src *storage.Webtest_STATUS) error
	AssignPropertiesTo(dst *storage.Webtest_STATUS) error
}

// Storage version of v1api20180501preview.WebTestGeolocation
// Geo-physical location to run a WebTest from. You must specify one or more locations for the test to run from.
type WebTestGeolocation struct {
	Id          *string                `json:"Id,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_WebTestGeolocation populates our WebTestGeolocation from the provided source WebTestGeolocation
func (geolocation *WebTestGeolocation) AssignProperties_From_WebTestGeolocation(source *storage.WebTestGeolocation) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Id
	geolocation.Id = genruntime.ClonePointerToString(source.Id)

	// Update the property bag
	if len(propertyBag) > 0 {
		geolocation.PropertyBag = propertyBag
	} else {
		geolocation.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestGeolocation interface (if implemented) to customize the conversion
	var geolocationAsAny any = geolocation
	if augmentedGeolocation, ok := geolocationAsAny.(augmentConversionForWebTestGeolocation); ok {
		err := augmentedGeolocation.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_WebTestGeolocation populates the provided destination WebTestGeolocation from our WebTestGeolocation
func (geolocation *WebTestGeolocation) AssignProperties_To_WebTestGeolocation(destination *storage.WebTestGeolocation) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(geolocation.PropertyBag)

	// Id
	destination.Id = genruntime.ClonePointerToString(geolocation.Id)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestGeolocation interface (if implemented) to customize the conversion
	var geolocationAsAny any = geolocation
	if augmentedGeolocation, ok := geolocationAsAny.(augmentConversionForWebTestGeolocation); ok {
		err := augmentedGeolocation.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20180501preview.WebTestGeolocation_STATUS
// Geo-physical location to run a WebTest from. You must specify one or more locations for the test to run from.
type WebTestGeolocation_STATUS struct {
	Id          *string                `json:"Id,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_WebTestGeolocation_STATUS populates our WebTestGeolocation_STATUS from the provided source WebTestGeolocation_STATUS
func (geolocation *WebTestGeolocation_STATUS) AssignProperties_From_WebTestGeolocation_STATUS(source *storage.WebTestGeolocation_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Id
	geolocation.Id = genruntime.ClonePointerToString(source.Id)

	// Update the property bag
	if len(propertyBag) > 0 {
		geolocation.PropertyBag = propertyBag
	} else {
		geolocation.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestGeolocation_STATUS interface (if implemented) to customize the conversion
	var geolocationAsAny any = geolocation
	if augmentedGeolocation, ok := geolocationAsAny.(augmentConversionForWebTestGeolocation_STATUS); ok {
		err := augmentedGeolocation.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_WebTestGeolocation_STATUS populates the provided destination WebTestGeolocation_STATUS from our WebTestGeolocation_STATUS
func (geolocation *WebTestGeolocation_STATUS) AssignProperties_To_WebTestGeolocation_STATUS(destination *storage.WebTestGeolocation_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(geolocation.PropertyBag)

	// Id
	destination.Id = genruntime.ClonePointerToString(geolocation.Id)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestGeolocation_STATUS interface (if implemented) to customize the conversion
	var geolocationAsAny any = geolocation
	if augmentedGeolocation, ok := geolocationAsAny.(augmentConversionForWebTestGeolocation_STATUS); ok {
		err := augmentedGeolocation.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20180501preview.WebtestOperatorSpec
// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure
type WebtestOperatorSpec struct {
	ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"`
	PropertyBag          genruntime.PropertyBag        `json:"$propertyBag,omitempty"`
	SecretExpressions    []*core.DestinationExpression `json:"secretExpressions,omitempty"`
}

// AssignProperties_From_WebtestOperatorSpec populates our WebtestOperatorSpec from the provided source WebtestOperatorSpec
func (operator *WebtestOperatorSpec) AssignProperties_From_WebtestOperatorSpec(source *storage.WebtestOperatorSpec) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// ConfigMapExpressions
	if source.ConfigMapExpressions != nil {
		configMapExpressionList := make([]*core.DestinationExpression, len(source.ConfigMapExpressions))
		for configMapExpressionIndex, configMapExpressionItem := range source.ConfigMapExpressions {
			if configMapExpressionItem != nil {
				configMapExpression := *configMapExpressionItem.DeepCopy()
				configMapExpressionList[configMapExpressionIndex] = &configMapExpression
			} else {
				configMapExpressionList[configMapExpressionIndex] = nil
			}
		}
		operator.ConfigMapExpressions = configMapExpressionList
	} else {
		operator.ConfigMapExpressions = nil
	}

	// SecretExpressions
	if source.SecretExpressions != nil {
		secretExpressionList := make([]*core.DestinationExpression, len(source.SecretExpressions))
		for secretExpressionIndex, secretExpressionItem := range source.SecretExpressions {
			if secretExpressionItem != nil {
				secretExpression := *secretExpressionItem.DeepCopy()
				secretExpressionList[secretExpressionIndex] = &secretExpression
			} else {
				secretExpressionList[secretExpressionIndex] = nil
			}
		}
		operator.SecretExpressions = secretExpressionList
	} else {
		operator.SecretExpressions = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		operator.PropertyBag = propertyBag
	} else {
		operator.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebtestOperatorSpec interface (if implemented) to customize the conversion
	var operatorAsAny any = operator
	if augmentedOperator, ok := operatorAsAny.(augmentConversionForWebtestOperatorSpec); ok {
		err := augmentedOperator.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_WebtestOperatorSpec populates the provided destination WebtestOperatorSpec from our WebtestOperatorSpec
func (operator *WebtestOperatorSpec) AssignProperties_To_WebtestOperatorSpec(destination *storage.WebtestOperatorSpec) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(operator.PropertyBag)

	// ConfigMapExpressions
	if operator.ConfigMapExpressions != nil {
		configMapExpressionList := make([]*core.DestinationExpression, len(operator.ConfigMapExpressions))
		for configMapExpressionIndex, configMapExpressionItem := range operator.ConfigMapExpressions {
			if configMapExpressionItem != nil {
				configMapExpression := *configMapExpressionItem.DeepCopy()
				configMapExpressionList[configMapExpressionIndex] = &configMapExpression
			} else {
				configMapExpressionList[configMapExpressionIndex] = nil
			}
		}
		destination.ConfigMapExpressions = configMapExpressionList
	} else {
		destination.ConfigMapExpressions = nil
	}

	// SecretExpressions
	if operator.SecretExpressions != nil {
		secretExpressionList := make([]*core.DestinationExpression, len(operator.SecretExpressions))
		for secretExpressionIndex, secretExpressionItem := range operator.SecretExpressions {
			if secretExpressionItem != nil {
				secretExpression := *secretExpressionItem.DeepCopy()
				secretExpressionList[secretExpressionIndex] = &secretExpression
			} else {
				secretExpressionList[secretExpressionIndex] = nil
			}
		}
		destination.SecretExpressions = secretExpressionList
	} else {
		destination.SecretExpressions = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebtestOperatorSpec interface (if implemented) to customize the conversion
	var operatorAsAny any = operator
	if augmentedOperator, ok := operatorAsAny.(augmentConversionForWebtestOperatorSpec); ok {
		err := augmentedOperator.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20180501preview.WebTestProperties_Configuration
type WebTestProperties_Configuration struct {
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	WebTest     *string                `json:"WebTest,omitempty"`
}

// AssignProperties_From_WebTestProperties_Configuration populates our WebTestProperties_Configuration from the provided source WebTestProperties_Configuration
func (configuration *WebTestProperties_Configuration) AssignProperties_From_WebTestProperties_Configuration(source *storage.WebTestProperties_Configuration) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// WebTest
	configuration.WebTest = genruntime.ClonePointerToString(source.WebTest)

	// Update the property bag
	if len(propertyBag) > 0 {
		configuration.PropertyBag = propertyBag
	} else {
		configuration.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestProperties_Configuration interface (if implemented) to customize the conversion
	var configurationAsAny any = configuration
	if augmentedConfiguration, ok := configurationAsAny.(augmentConversionForWebTestProperties_Configuration); ok {
		err := augmentedConfiguration.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_WebTestProperties_Configuration populates the provided destination WebTestProperties_Configuration from our WebTestProperties_Configuration
func (configuration *WebTestProperties_Configuration) AssignProperties_To_WebTestProperties_Configuration(destination *storage.WebTestProperties_Configuration) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(configuration.PropertyBag)

	// WebTest
	destination.WebTest = genruntime.ClonePointerToString(configuration.WebTest)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestProperties_Configuration interface (if implemented) to customize the conversion
	var configurationAsAny any = configuration
	if augmentedConfiguration, ok := configurationAsAny.(augmentConversionForWebTestProperties_Configuration); ok {
		err := augmentedConfiguration.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20180501preview.WebTestProperties_Configuration_STATUS
type WebTestProperties_Configuration_STATUS struct {
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	WebTest     *string                `json:"WebTest,omitempty"`
}

// AssignProperties_From_WebTestProperties_Configuration_STATUS populates our WebTestProperties_Configuration_STATUS from the provided source WebTestProperties_Configuration_STATUS
func (configuration *WebTestProperties_Configuration_STATUS) AssignProperties_From_WebTestProperties_Configuration_STATUS(source *storage.WebTestProperties_Configuration_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// WebTest
	configuration.WebTest = genruntime.ClonePointerToString(source.WebTest)

	// Update the property bag
	if len(propertyBag) > 0 {
		configuration.PropertyBag = propertyBag
	} else {
		configuration.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestProperties_Configuration_STATUS interface (if implemented) to customize the conversion
	var configurationAsAny any = configuration
	if augmentedConfiguration, ok := configurationAsAny.(augmentConversionForWebTestProperties_Configuration_STATUS); ok {
		err := augmentedConfiguration.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_WebTestProperties_Configuration_STATUS populates the provided destination WebTestProperties_Configuration_STATUS from our WebTestProperties_Configuration_STATUS
func (configuration *WebTestProperties_Configuration_STATUS) AssignProperties_To_WebTestProperties_Configuration_STATUS(destination *storage.WebTestProperties_Configuration_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(configuration.PropertyBag)

	// WebTest
	destination.WebTest = genruntime.ClonePointerToString(configuration.WebTest)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestProperties_Configuration_STATUS interface (if implemented) to customize the conversion
	var configurationAsAny any = configuration
	if augmentedConfiguration, ok := configurationAsAny.(augmentConversionForWebTestProperties_Configuration_STATUS); ok {
		err := augmentedConfiguration.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20180501preview.WebTestProperties_Request
type WebTestProperties_Request struct {
	FollowRedirects        *bool                  `json:"FollowRedirects,omitempty"`
	Headers                []HeaderField          `json:"Headers,omitempty"`
	HttpVerb               *string                `json:"HttpVerb,omitempty"`
	ParseDependentRequests *bool                  `json:"ParseDependentRequests,omitempty"`
	PropertyBag            genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	RequestBody            *string                `json:"RequestBody,omitempty"`
	RequestUrl             *string                `json:"RequestUrl,omitempty"`
}

// AssignProperties_From_WebTestProperties_Request populates our WebTestProperties_Request from the provided source WebTestProperties_Request
func (request *WebTestProperties_Request) AssignProperties_From_WebTestProperties_Request(source *storage.WebTestProperties_Request) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// FollowRedirects
	if source.FollowRedirects != nil {
		followRedirect := *source.FollowRedirects
		request.FollowRedirects = &followRedirect
	} else {
		request.FollowRedirects = nil
	}

	// Headers
	if source.Headers != nil {
		headerList := make([]HeaderField, len(source.Headers))
		for headerIndex, headerItem := range source.Headers {
			var header HeaderField
			err := header.AssignProperties_From_HeaderField(&headerItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_HeaderField() to populate field Headers")
			}
			headerList[headerIndex] = header
		}
		request.Headers = headerList
	} else {
		request.Headers = nil
	}

	// HttpVerb
	request.HttpVerb = genruntime.ClonePointerToString(source.HttpVerb)

	// ParseDependentRequests
	if source.ParseDependentRequests != nil {
		parseDependentRequest := *source.ParseDependentRequests
		request.ParseDependentRequests = &parseDependentRequest
	} else {
		request.ParseDependentRequests = nil
	}

	// RequestBody
	request.RequestBody = genruntime.ClonePointerToString(source.RequestBody)

	// RequestUrl
	request.RequestUrl = genruntime.ClonePointerToString(source.RequestUrl)

	// Update the property bag
	if len(propertyBag) > 0 {
		request.PropertyBag = propertyBag
	} else {
		request.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestProperties_Request interface (if implemented) to customize the conversion
	var requestAsAny any = request
	if augmentedRequest, ok := requestAsAny.(augmentConversionForWebTestProperties_Request); ok {
		err := augmentedRequest.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_WebTestProperties_Request populates the provided destination WebTestProperties_Request from our WebTestProperties_Request
func (request *WebTestProperties_Request) AssignProperties_To_WebTestProperties_Request(destination *storage.WebTestProperties_Request) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(request.PropertyBag)

	// FollowRedirects
	if request.FollowRedirects != nil {
		followRedirect := *request.FollowRedirects
		destination.FollowRedirects = &followRedirect
	} else {
		destination.FollowRedirects = nil
	}

	// Headers
	if request.Headers != nil {
		headerList := make([]storage.HeaderField, len(request.Headers))
		for headerIndex, headerItem := range request.Headers {
			var header storage.HeaderField
			err := headerItem.AssignProperties_To_HeaderField(&header)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_HeaderField() to populate field Headers")
			}
			headerList[headerIndex] = header
		}
		destination.Headers = headerList
	} else {
		destination.Headers = nil
	}

	// HttpVerb
	destination.HttpVerb = genruntime.ClonePointerToString(request.HttpVerb)

	// ParseDependentRequests
	if request.ParseDependentRequests != nil {
		parseDependentRequest := *request.ParseDependentRequests
		destination.ParseDependentRequests = &parseDependentRequest
	} else {
		destination.ParseDependentRequests = nil
	}

	// RequestBody
	destination.RequestBody = genruntime.ClonePointerToString(request.RequestBody)

	// RequestUrl
	destination.RequestUrl = genruntime.ClonePointerToString(request.RequestUrl)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestProperties_Request interface (if implemented) to customize the conversion
	var requestAsAny any = request
	if augmentedRequest, ok := requestAsAny.(augmentConversionForWebTestProperties_Request); ok {
		err := augmentedRequest.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20180501preview.WebTestProperties_Request_STATUS
type WebTestProperties_Request_STATUS struct {
	FollowRedirects        *bool                  `json:"FollowRedirects,omitempty"`
	Headers                []HeaderField_STATUS   `json:"Headers,omitempty"`
	HttpVerb               *string                `json:"HttpVerb,omitempty"`
	ParseDependentRequests *bool                  `json:"ParseDependentRequests,omitempty"`
	PropertyBag            genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	RequestBody            *string                `json:"RequestBody,omitempty"`
	RequestUrl             *string                `json:"RequestUrl,omitempty"`
}

// AssignProperties_From_WebTestProperties_Request_STATUS populates our WebTestProperties_Request_STATUS from the provided source WebTestProperties_Request_STATUS
func (request *WebTestProperties_Request_STATUS) AssignProperties_From_WebTestProperties_Request_STATUS(source *storage.WebTestProperties_Request_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// FollowRedirects
	if source.FollowRedirects != nil {
		followRedirect := *source.FollowRedirects
		request.FollowRedirects = &followRedirect
	} else {
		request.FollowRedirects = nil
	}

	// Headers
	if source.Headers != nil {
		headerList := make([]HeaderField_STATUS, len(source.Headers))
		for headerIndex, headerItem := range source.Headers {
			var header HeaderField_STATUS
			err := header.AssignProperties_From_HeaderField_STATUS(&headerItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_HeaderField_STATUS() to populate field Headers")
			}
			headerList[headerIndex] = header
		}
		request.Headers = headerList
	} else {
		request.Headers = nil
	}

	// HttpVerb
	request.HttpVerb = genruntime.ClonePointerToString(source.HttpVerb)

	// ParseDependentRequests
	if source.ParseDependentRequests != nil {
		parseDependentRequest := *source.ParseDependentRequests
		request.ParseDependentRequests = &parseDependentRequest
	} else {
		request.ParseDependentRequests = nil
	}

	// RequestBody
	request.RequestBody = genruntime.ClonePointerToString(source.RequestBody)

	// RequestUrl
	request.RequestUrl = genruntime.ClonePointerToString(source.RequestUrl)

	// Update the property bag
	if len(propertyBag) > 0 {
		request.PropertyBag = propertyBag
	} else {
		request.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestProperties_Request_STATUS interface (if implemented) to customize the conversion
	var requestAsAny any = request
	if augmentedRequest, ok := requestAsAny.(augmentConversionForWebTestProperties_Request_STATUS); ok {
		err := augmentedRequest.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_WebTestProperties_Request_STATUS populates the provided destination WebTestProperties_Request_STATUS from our WebTestProperties_Request_STATUS
func (request *WebTestProperties_Request_STATUS) AssignProperties_To_WebTestProperties_Request_STATUS(destination *storage.WebTestProperties_Request_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(request.PropertyBag)

	// FollowRedirects
	if request.FollowRedirects != nil {
		followRedirect := *request.FollowRedirects
		destination.FollowRedirects = &followRedirect
	} else {
		destination.FollowRedirects = nil
	}

	// Headers
	if request.Headers != nil {
		headerList := make([]storage.HeaderField_STATUS, len(request.Headers))
		for headerIndex, headerItem := range request.Headers {
			var header storage.HeaderField_STATUS
			err := headerItem.AssignProperties_To_HeaderField_STATUS(&header)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_HeaderField_STATUS() to populate field Headers")
			}
			headerList[headerIndex] = header
		}
		destination.Headers = headerList
	} else {
		destination.Headers = nil
	}

	// HttpVerb
	destination.HttpVerb = genruntime.ClonePointerToString(request.HttpVerb)

	// ParseDependentRequests
	if request.ParseDependentRequests != nil {
		parseDependentRequest := *request.ParseDependentRequests
		destination.ParseDependentRequests = &parseDependentRequest
	} else {
		destination.ParseDependentRequests = nil
	}

	// RequestBody
	destination.RequestBody = genruntime.ClonePointerToString(request.RequestBody)

	// RequestUrl
	destination.RequestUrl = genruntime.ClonePointerToString(request.RequestUrl)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestProperties_Request_STATUS interface (if implemented) to customize the conversion
	var requestAsAny any = request
	if augmentedRequest, ok := requestAsAny.(augmentConversionForWebTestProperties_Request_STATUS); ok {
		err := augmentedRequest.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20180501preview.WebTestProperties_ValidationRules
type WebTestProperties_ValidationRules struct {
	ContentValidation             *WebTestProperties_ValidationRules_ContentValidation `json:"ContentValidation,omitempty"`
	ExpectedHttpStatusCode        *int                                                 `json:"ExpectedHttpStatusCode,omitempty"`
	IgnoreHttpsStatusCode         *bool                                                `json:"IgnoreHttpsStatusCode,omitempty"`
	PropertyBag                   genruntime.PropertyBag                               `json:"$propertyBag,omitempty"`
	SSLCertRemainingLifetimeCheck *int                                                 `json:"SSLCertRemainingLifetimeCheck,omitempty"`
	SSLCheck                      *bool                                                `json:"SSLCheck,omitempty"`
}

// AssignProperties_From_WebTestProperties_ValidationRules populates our WebTestProperties_ValidationRules from the provided source WebTestProperties_ValidationRules
func (rules *WebTestProperties_ValidationRules) AssignProperties_From_WebTestProperties_ValidationRules(source *storage.WebTestProperties_ValidationRules) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// ContentValidation
	if source.ContentValidation != nil {
		var contentValidation WebTestProperties_ValidationRules_ContentValidation
		err := contentValidation.AssignProperties_From_WebTestProperties_ValidationRules_ContentValidation(source.ContentValidation)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_WebTestProperties_ValidationRules_ContentValidation() to populate field ContentValidation")
		}
		rules.ContentValidation = &contentValidation
	} else {
		rules.ContentValidation = nil
	}

	// ExpectedHttpStatusCode
	rules.ExpectedHttpStatusCode = genruntime.ClonePointerToInt(source.ExpectedHttpStatusCode)

	// IgnoreHttpStatusCode
	if source.IgnoreHttpStatusCode != nil {
		propertyBag.Add("IgnoreHttpStatusCode", *source.IgnoreHttpStatusCode)
	} else {
		propertyBag.Remove("IgnoreHttpStatusCode")
	}

	// IgnoreHttpsStatusCode
	if propertyBag.Contains("IgnoreHttpsStatusCode") {
		var ignoreHttpsStatusCode bool
		err := propertyBag.Pull("IgnoreHttpsStatusCode", &ignoreHttpsStatusCode)
		if err != nil {
			return eris.Wrap(err, "pulling 'IgnoreHttpsStatusCode' from propertyBag")
		}

		rules.IgnoreHttpsStatusCode = &ignoreHttpsStatusCode
	} else {
		rules.IgnoreHttpsStatusCode = nil
	}

	// SSLCertRemainingLifetimeCheck
	rules.SSLCertRemainingLifetimeCheck = genruntime.ClonePointerToInt(source.SSLCertRemainingLifetimeCheck)

	// SSLCheck
	if source.SSLCheck != nil {
		sslCheck := *source.SSLCheck
		rules.SSLCheck = &sslCheck
	} else {
		rules.SSLCheck = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		rules.PropertyBag = propertyBag
	} else {
		rules.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestProperties_ValidationRules interface (if implemented) to customize the conversion
	var rulesAsAny any = rules
	if augmentedRules, ok := rulesAsAny.(augmentConversionForWebTestProperties_ValidationRules); ok {
		err := augmentedRules.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_WebTestProperties_ValidationRules populates the provided destination WebTestProperties_ValidationRules from our WebTestProperties_ValidationRules
func (rules *WebTestProperties_ValidationRules) AssignProperties_To_WebTestProperties_ValidationRules(destination *storage.WebTestProperties_ValidationRules) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(rules.PropertyBag)

	// ContentValidation
	if rules.ContentValidation != nil {
		var contentValidation storage.WebTestProperties_ValidationRules_ContentValidation
		err := rules.ContentValidation.AssignProperties_To_WebTestProperties_ValidationRules_ContentValidation(&contentValidation)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_WebTestProperties_ValidationRules_ContentValidation() to populate field ContentValidation")
		}
		destination.ContentValidation = &contentValidation
	} else {
		destination.ContentValidation = nil
	}

	// ExpectedHttpStatusCode
	destination.ExpectedHttpStatusCode = genruntime.ClonePointerToInt(rules.ExpectedHttpStatusCode)

	// IgnoreHttpStatusCode
	if propertyBag.Contains("IgnoreHttpStatusCode") {
		var ignoreHttpStatusCode bool
		err := propertyBag.Pull("IgnoreHttpStatusCode", &ignoreHttpStatusCode)
		if err != nil {
			return eris.Wrap(err, "pulling 'IgnoreHttpStatusCode' from propertyBag")
		}

		destination.IgnoreHttpStatusCode = &ignoreHttpStatusCode
	} else {
		destination.IgnoreHttpStatusCode = nil
	}

	// IgnoreHttpsStatusCode
	if rules.IgnoreHttpsStatusCode != nil {
		propertyBag.Add("IgnoreHttpsStatusCode", *rules.IgnoreHttpsStatusCode)
	} else {
		propertyBag.Remove("IgnoreHttpsStatusCode")
	}

	// SSLCertRemainingLifetimeCheck
	destination.SSLCertRemainingLifetimeCheck = genruntime.ClonePointerToInt(rules.SSLCertRemainingLifetimeCheck)

	// SSLCheck
	if rules.SSLCheck != nil {
		sslCheck := *rules.SSLCheck
		destination.SSLCheck = &sslCheck
	} else {
		destination.SSLCheck = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestProperties_ValidationRules interface (if implemented) to customize the conversion
	var rulesAsAny any = rules
	if augmentedRules, ok := rulesAsAny.(augmentConversionForWebTestProperties_ValidationRules); ok {
		err := augmentedRules.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20180501preview.WebTestProperties_ValidationRules_STATUS
type WebTestProperties_ValidationRules_STATUS struct {
	ContentValidation             *WebTestProperties_ValidationRules_ContentValidation_STATUS `json:"ContentValidation,omitempty"`
	ExpectedHttpStatusCode        *int                                                        `json:"ExpectedHttpStatusCode,omitempty"`
	IgnoreHttpsStatusCode         *bool                                                       `json:"IgnoreHttpsStatusCode,omitempty"`
	PropertyBag                   genruntime.PropertyBag                                      `json:"$propertyBag,omitempty"`
	SSLCertRemainingLifetimeCheck *int                                                        `json:"SSLCertRemainingLifetimeCheck,omitempty"`
	SSLCheck                      *bool                                                       `json:"SSLCheck,omitempty"`
}

// AssignProperties_From_WebTestProperties_ValidationRules_STATUS populates our WebTestProperties_ValidationRules_STATUS from the provided source WebTestProperties_ValidationRules_STATUS
func (rules *WebTestProperties_ValidationRules_STATUS) AssignProperties_From_WebTestProperties_ValidationRules_STATUS(source *storage.WebTestProperties_ValidationRules_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// ContentValidation
	if source.ContentValidation != nil {
		var contentValidation WebTestProperties_ValidationRules_ContentValidation_STATUS
		err := contentValidation.AssignProperties_From_WebTestProperties_ValidationRules_ContentValidation_STATUS(source.ContentValidation)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_WebTestProperties_ValidationRules_ContentValidation_STATUS() to populate field ContentValidation")
		}
		rules.ContentValidation = &contentValidation
	} else {
		rules.ContentValidation = nil
	}

	// ExpectedHttpStatusCode
	rules.ExpectedHttpStatusCode = genruntime.ClonePointerToInt(source.ExpectedHttpStatusCode)

	// IgnoreHttpStatusCode
	if source.IgnoreHttpStatusCode != nil {
		propertyBag.Add("IgnoreHttpStatusCode", *source.IgnoreHttpStatusCode)
	} else {
		propertyBag.Remove("IgnoreHttpStatusCode")
	}

	// IgnoreHttpsStatusCode
	if propertyBag.Contains("IgnoreHttpsStatusCode") {
		var ignoreHttpsStatusCode bool
		err := propertyBag.Pull("IgnoreHttpsStatusCode", &ignoreHttpsStatusCode)
		if err != nil {
			return eris.Wrap(err, "pulling 'IgnoreHttpsStatusCode' from propertyBag")
		}

		rules.IgnoreHttpsStatusCode = &ignoreHttpsStatusCode
	} else {
		rules.IgnoreHttpsStatusCode = nil
	}

	// SSLCertRemainingLifetimeCheck
	rules.SSLCertRemainingLifetimeCheck = genruntime.ClonePointerToInt(source.SSLCertRemainingLifetimeCheck)

	// SSLCheck
	if source.SSLCheck != nil {
		sslCheck := *source.SSLCheck
		rules.SSLCheck = &sslCheck
	} else {
		rules.SSLCheck = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		rules.PropertyBag = propertyBag
	} else {
		rules.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestProperties_ValidationRules_STATUS interface (if implemented) to customize the conversion
	var rulesAsAny any = rules
	if augmentedRules, ok := rulesAsAny.(augmentConversionForWebTestProperties_ValidationRules_STATUS); ok {
		err := augmentedRules.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_WebTestProperties_ValidationRules_STATUS populates the provided destination WebTestProperties_ValidationRules_STATUS from our WebTestProperties_ValidationRules_STATUS
func (rules *WebTestProperties_ValidationRules_STATUS) AssignProperties_To_WebTestProperties_ValidationRules_STATUS(destination *storage.WebTestProperties_ValidationRules_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(rules.PropertyBag)

	// ContentValidation
	if rules.ContentValidation != nil {
		var contentValidation storage.WebTestProperties_ValidationRules_ContentValidation_STATUS
		err := rules.ContentValidation.AssignProperties_To_WebTestProperties_ValidationRules_ContentValidation_STATUS(&contentValidation)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_WebTestProperties_ValidationRules_ContentValidation_STATUS() to populate field ContentValidation")
		}
		destination.ContentValidation = &contentValidation
	} else {
		destination.ContentValidation = nil
	}

	// ExpectedHttpStatusCode
	destination.ExpectedHttpStatusCode = genruntime.ClonePointerToInt(rules.ExpectedHttpStatusCode)

	// IgnoreHttpStatusCode
	if propertyBag.Contains("IgnoreHttpStatusCode") {
		var ignoreHttpStatusCode bool
		err := propertyBag.Pull("IgnoreHttpStatusCode", &ignoreHttpStatusCode)
		if err != nil {
			return eris.Wrap(err, "pulling 'IgnoreHttpStatusCode' from propertyBag")
		}

		destination.IgnoreHttpStatusCode = &ignoreHttpStatusCode
	} else {
		destination.IgnoreHttpStatusCode = nil
	}

	// IgnoreHttpsStatusCode
	if rules.IgnoreHttpsStatusCode != nil {
		propertyBag.Add("IgnoreHttpsStatusCode", *rules.IgnoreHttpsStatusCode)
	} else {
		propertyBag.Remove("IgnoreHttpsStatusCode")
	}

	// SSLCertRemainingLifetimeCheck
	destination.SSLCertRemainingLifetimeCheck = genruntime.ClonePointerToInt(rules.SSLCertRemainingLifetimeCheck)

	// SSLCheck
	if rules.SSLCheck != nil {
		sslCheck := *rules.SSLCheck
		destination.SSLCheck = &sslCheck
	} else {
		destination.SSLCheck = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestProperties_ValidationRules_STATUS interface (if implemented) to customize the conversion
	var rulesAsAny any = rules
	if augmentedRules, ok := rulesAsAny.(augmentConversionForWebTestProperties_ValidationRules_STATUS); ok {
		err := augmentedRules.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

type augmentConversionForWebTestGeolocation interface {
	AssignPropertiesFrom(src *storage.WebTestGeolocation) error
	AssignPropertiesTo(dst *storage.WebTestGeolocation) error
}

type augmentConversionForWebTestGeolocation_STATUS interface {
	AssignPropertiesFrom(src *storage.WebTestGeolocation_STATUS) error
	AssignPropertiesTo(dst *storage.WebTestGeolocation_STATUS) error
}

type augmentConversionForWebtestOperatorSpec interface {
	AssignPropertiesFrom(src *storage.WebtestOperatorSpec) error
	AssignPropertiesTo(dst *storage.WebtestOperatorSpec) error
}

type augmentConversionForWebTestProperties_Configuration interface {
	AssignPropertiesFrom(src *storage.WebTestProperties_Configuration) error
	AssignPropertiesTo(dst *storage.WebTestProperties_Configuration) error
}

type augmentConversionForWebTestProperties_Configuration_STATUS interface {
	AssignPropertiesFrom(src *storage.WebTestProperties_Configuration_STATUS) error
	AssignPropertiesTo(dst *storage.WebTestProperties_Configuration_STATUS) error
}

type augmentConversionForWebTestProperties_Request interface {
	AssignPropertiesFrom(src *storage.WebTestProperties_Request) error
	AssignPropertiesTo(dst *storage.WebTestProperties_Request) error
}

type augmentConversionForWebTestProperties_Request_STATUS interface {
	AssignPropertiesFrom(src *storage.WebTestProperties_Request_STATUS) error
	AssignPropertiesTo(dst *storage.WebTestProperties_Request_STATUS) error
}

type augmentConversionForWebTestProperties_ValidationRules interface {
	AssignPropertiesFrom(src *storage.WebTestProperties_ValidationRules) error
	AssignPropertiesTo(dst *storage.WebTestProperties_ValidationRules) error
}

type augmentConversionForWebTestProperties_ValidationRules_STATUS interface {
	AssignPropertiesFrom(src *storage.WebTestProperties_ValidationRules_STATUS) error
	AssignPropertiesTo(dst *storage.WebTestProperties_ValidationRules_STATUS) error
}

// Storage version of v1api20180501preview.HeaderField
// A header to add to the WebTest.
type HeaderField struct {
	Key         *string                `json:"key,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	Value       *string                `json:"value,omitempty"`
}

// AssignProperties_From_HeaderField populates our HeaderField from the provided source HeaderField
func (field *HeaderField) AssignProperties_From_HeaderField(source *storage.HeaderField) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Key
	field.Key = genruntime.ClonePointerToString(source.Key)

	// Value
	field.Value = genruntime.ClonePointerToString(source.Value)

	// Update the property bag
	if len(propertyBag) > 0 {
		field.PropertyBag = propertyBag
	} else {
		field.PropertyBag = nil
	}

	// Invoke the augmentConversionForHeaderField interface (if implemented) to customize the conversion
	var fieldAsAny any = field
	if augmentedField, ok := fieldAsAny.(augmentConversionForHeaderField); ok {
		err := augmentedField.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_HeaderField populates the provided destination HeaderField from our HeaderField
func (field *HeaderField) AssignProperties_To_HeaderField(destination *storage.HeaderField) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(field.PropertyBag)

	// Key
	destination.Key = genruntime.ClonePointerToString(field.Key)

	// Value
	destination.Value = genruntime.ClonePointerToString(field.Value)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForHeaderField interface (if implemented) to customize the conversion
	var fieldAsAny any = field
	if augmentedField, ok := fieldAsAny.(augmentConversionForHeaderField); ok {
		err := augmentedField.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20180501preview.HeaderField_STATUS
// A header to add to the WebTest.
type HeaderField_STATUS struct {
	Key         *string                `json:"key,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	Value       *string                `json:"value,omitempty"`
}

// AssignProperties_From_HeaderField_STATUS populates our HeaderField_STATUS from the provided source HeaderField_STATUS
func (field *HeaderField_STATUS) AssignProperties_From_HeaderField_STATUS(source *storage.HeaderField_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Key
	field.Key = genruntime.ClonePointerToString(source.Key)

	// Value
	field.Value = genruntime.ClonePointerToString(source.Value)

	// Update the property bag
	if len(propertyBag) > 0 {
		field.PropertyBag = propertyBag
	} else {
		field.PropertyBag = nil
	}

	// Invoke the augmentConversionForHeaderField_STATUS interface (if implemented) to customize the conversion
	var fieldAsAny any = field
	if augmentedField, ok := fieldAsAny.(augmentConversionForHeaderField_STATUS); ok {
		err := augmentedField.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_HeaderField_STATUS populates the provided destination HeaderField_STATUS from our HeaderField_STATUS
func (field *HeaderField_STATUS) AssignProperties_To_HeaderField_STATUS(destination *storage.HeaderField_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(field.PropertyBag)

	// Key
	destination.Key = genruntime.ClonePointerToString(field.Key)

	// Value
	destination.Value = genruntime.ClonePointerToString(field.Value)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForHeaderField_STATUS interface (if implemented) to customize the conversion
	var fieldAsAny any = field
	if augmentedField, ok := fieldAsAny.(augmentConversionForHeaderField_STATUS); ok {
		err := augmentedField.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20180501preview.WebTestProperties_ValidationRules_ContentValidation
type WebTestProperties_ValidationRules_ContentValidation struct {
	ContentMatch    *string                `json:"ContentMatch,omitempty"`
	IgnoreCase      *bool                  `json:"IgnoreCase,omitempty"`
	PassIfTextFound *bool                  `json:"PassIfTextFound,omitempty"`
	PropertyBag     genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_WebTestProperties_ValidationRules_ContentValidation populates our WebTestProperties_ValidationRules_ContentValidation from the provided source WebTestProperties_ValidationRules_ContentValidation
func (validation *WebTestProperties_ValidationRules_ContentValidation) AssignProperties_From_WebTestProperties_ValidationRules_ContentValidation(source *storage.WebTestProperties_ValidationRules_ContentValidation) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// ContentMatch
	validation.ContentMatch = genruntime.ClonePointerToString(source.ContentMatch)

	// IgnoreCase
	if source.IgnoreCase != nil {
		ignoreCase := *source.IgnoreCase
		validation.IgnoreCase = &ignoreCase
	} else {
		validation.IgnoreCase = nil
	}

	// PassIfTextFound
	if source.PassIfTextFound != nil {
		passIfTextFound := *source.PassIfTextFound
		validation.PassIfTextFound = &passIfTextFound
	} else {
		validation.PassIfTextFound = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		validation.PropertyBag = propertyBag
	} else {
		validation.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestProperties_ValidationRules_ContentValidation interface (if implemented) to customize the conversion
	var validationAsAny any = validation
	if augmentedValidation, ok := validationAsAny.(augmentConversionForWebTestProperties_ValidationRules_ContentValidation); ok {
		err := augmentedValidation.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_WebTestProperties_ValidationRules_ContentValidation populates the provided destination WebTestProperties_ValidationRules_ContentValidation from our WebTestProperties_ValidationRules_ContentValidation
func (validation *WebTestProperties_ValidationRules_ContentValidation) AssignProperties_To_WebTestProperties_ValidationRules_ContentValidation(destination *storage.WebTestProperties_ValidationRules_ContentValidation) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(validation.PropertyBag)

	// ContentMatch
	destination.ContentMatch = genruntime.ClonePointerToString(validation.ContentMatch)

	// IgnoreCase
	if validation.IgnoreCase != nil {
		ignoreCase := *validation.IgnoreCase
		destination.IgnoreCase = &ignoreCase
	} else {
		destination.IgnoreCase = nil
	}

	// PassIfTextFound
	if validation.PassIfTextFound != nil {
		passIfTextFound := *validation.PassIfTextFound
		destination.PassIfTextFound = &passIfTextFound
	} else {
		destination.PassIfTextFound = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestProperties_ValidationRules_ContentValidation interface (if implemented) to customize the conversion
	var validationAsAny any = validation
	if augmentedValidation, ok := validationAsAny.(augmentConversionForWebTestProperties_ValidationRules_ContentValidation); ok {
		err := augmentedValidation.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20180501preview.WebTestProperties_ValidationRules_ContentValidation_STATUS
type WebTestProperties_ValidationRules_ContentValidation_STATUS struct {
	ContentMatch    *string                `json:"ContentMatch,omitempty"`
	IgnoreCase      *bool                  `json:"IgnoreCase,omitempty"`
	PassIfTextFound *bool                  `json:"PassIfTextFound,omitempty"`
	PropertyBag     genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_WebTestProperties_ValidationRules_ContentValidation_STATUS populates our WebTestProperties_ValidationRules_ContentValidation_STATUS from the provided source WebTestProperties_ValidationRules_ContentValidation_STATUS
func (validation *WebTestProperties_ValidationRules_ContentValidation_STATUS) AssignProperties_From_WebTestProperties_ValidationRules_ContentValidation_STATUS(source *storage.WebTestProperties_ValidationRules_ContentValidation_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// ContentMatch
	validation.ContentMatch = genruntime.ClonePointerToString(source.ContentMatch)

	// IgnoreCase
	if source.IgnoreCase != nil {
		ignoreCase := *source.IgnoreCase
		validation.IgnoreCase = &ignoreCase
	} else {
		validation.IgnoreCase = nil
	}

	// PassIfTextFound
	if source.PassIfTextFound != nil {
		passIfTextFound := *source.PassIfTextFound
		validation.PassIfTextFound = &passIfTextFound
	} else {
		validation.PassIfTextFound = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		validation.PropertyBag = propertyBag
	} else {
		validation.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestProperties_ValidationRules_ContentValidation_STATUS interface (if implemented) to customize the conversion
	var validationAsAny any = validation
	if augmentedValidation, ok := validationAsAny.(augmentConversionForWebTestProperties_ValidationRules_ContentValidation_STATUS); ok {
		err := augmentedValidation.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_WebTestProperties_ValidationRules_ContentValidation_STATUS populates the provided destination WebTestProperties_ValidationRules_ContentValidation_STATUS from our WebTestProperties_ValidationRules_ContentValidation_STATUS
func (validation *WebTestProperties_ValidationRules_ContentValidation_STATUS) AssignProperties_To_WebTestProperties_ValidationRules_ContentValidation_STATUS(destination *storage.WebTestProperties_ValidationRules_ContentValidation_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(validation.PropertyBag)

	// ContentMatch
	destination.ContentMatch = genruntime.ClonePointerToString(validation.ContentMatch)

	// IgnoreCase
	if validation.IgnoreCase != nil {
		ignoreCase := *validation.IgnoreCase
		destination.IgnoreCase = &ignoreCase
	} else {
		destination.IgnoreCase = nil
	}

	// PassIfTextFound
	if validation.PassIfTextFound != nil {
		passIfTextFound := *validation.PassIfTextFound
		destination.PassIfTextFound = &passIfTextFound
	} else {
		destination.PassIfTextFound = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForWebTestProperties_ValidationRules_ContentValidation_STATUS interface (if implemented) to customize the conversion
	var validationAsAny any = validation
	if augmentedValidation, ok := validationAsAny.(augmentConversionForWebTestProperties_ValidationRules_ContentValidation_STATUS); ok {
		err := augmentedValidation.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

type augmentConversionForHeaderField interface {
	AssignPropertiesFrom(src *storage.HeaderField) error
	AssignPropertiesTo(dst *storage.HeaderField) error
}

type augmentConversionForHeaderField_STATUS interface {
	AssignPropertiesFrom(src *storage.HeaderField_STATUS) error
	AssignPropertiesTo(dst *storage.HeaderField_STATUS) error
}

type augmentConversionForWebTestProperties_ValidationRules_ContentValidation interface {
	AssignPropertiesFrom(src *storage.WebTestProperties_ValidationRules_ContentValidation) error
	AssignPropertiesTo(dst *storage.WebTestProperties_ValidationRules_ContentValidation) error
}

type augmentConversionForWebTestProperties_ValidationRules_ContentValidation_STATUS interface {
	AssignPropertiesFrom(src *storage.WebTestProperties_ValidationRules_ContentValidation_STATUS) error
	AssignPropertiesTo(dst *storage.WebTestProperties_ValidationRules_ContentValidation_STATUS) error
}

func init() {
	SchemeBuilder.Register(&Webtest{}, &WebtestList{})
}
