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

import (
	"fmt"
	v20220901s "github.com/Azure/azure-service-operator/v2/api/storage/v1api20220901storage"
	"github.com/Azure/azure-service-operator/v2/internal/reflecthelpers"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions"
	"github.com/pkg/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"sigs.k8s.io/controller-runtime/pkg/conversion"
	"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)

// +kubebuilder:object:root=true
// +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"
// Generator information:
// - Generated from: /storage/resource-manager/Microsoft.Storage/stable/2022-09-01/table.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}
type StorageAccountsTableServicesTable struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              StorageAccounts_TableServices_Table_Spec   `json:"spec,omitempty"`
	Status            StorageAccounts_TableServices_Table_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &StorageAccountsTableServicesTable{}

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

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

var _ conversion.Convertible = &StorageAccountsTableServicesTable{}

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

	return table.AssignProperties_From_StorageAccountsTableServicesTable(source)
}

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

	return table.AssignProperties_To_StorageAccountsTableServicesTable(destination)
}

// +kubebuilder:webhook:path=/mutate-storage-azure-com-v1api20220901-storageaccountstableservicestable,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=storage.azure.com,resources=storageaccountstableservicestables,verbs=create;update,versions=v1api20220901,name=default.v1api20220901.storageaccountstableservicestables.storage.azure.com,admissionReviewVersions=v1

var _ admission.Defaulter = &StorageAccountsTableServicesTable{}

// Default applies defaults to the StorageAccountsTableServicesTable resource
func (table *StorageAccountsTableServicesTable) Default() {
	table.defaultImpl()
	var temp any = table
	if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok {
		runtimeDefaulter.CustomDefault()
	}
}

// defaultAzureName defaults the Azure name of the resource to the Kubernetes name
func (table *StorageAccountsTableServicesTable) defaultAzureName() {
	if table.Spec.AzureName == "" {
		table.Spec.AzureName = table.Name
	}
}

// defaultImpl applies the code generated defaults to the StorageAccountsTableServicesTable resource
func (table *StorageAccountsTableServicesTable) defaultImpl() { table.defaultAzureName() }

var _ genruntime.ImportableResource = &StorageAccountsTableServicesTable{}

// InitializeSpec initializes the spec for this resource from the given status
func (table *StorageAccountsTableServicesTable) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*StorageAccounts_TableServices_Table_STATUS); ok {
		return table.Spec.Initialize_From_StorageAccounts_TableServices_Table_STATUS(s)
	}

	return fmt.Errorf("expected Status of type StorageAccounts_TableServices_Table_STATUS but received %T instead", status)
}

var _ genruntime.KubernetesResource = &StorageAccountsTableServicesTable{}

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

// GetAPIVersion returns the ARM API version of the resource. This is always "2022-09-01"
func (table StorageAccountsTableServicesTable) GetAPIVersion() string {
	return string(APIVersion_Value)
}

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.Storage/storageAccounts/tableServices/tables"
func (table *StorageAccountsTableServicesTable) GetType() string {
	return "Microsoft.Storage/storageAccounts/tableServices/tables"
}

// NewEmptyStatus returns a new empty (blank) status
func (table *StorageAccountsTableServicesTable) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &StorageAccounts_TableServices_Table_STATUS{}
}

// Owner returns the ResourceReference of the owner
func (table *StorageAccountsTableServicesTable) Owner() *genruntime.ResourceReference {
	group, kind := genruntime.LookupOwnerGroupKind(table.Spec)
	return table.Spec.Owner.AsResourceReference(group, kind)
}

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

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

	table.Status = st
	return nil
}

// +kubebuilder:webhook:path=/validate-storage-azure-com-v1api20220901-storageaccountstableservicestable,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=storage.azure.com,resources=storageaccountstableservicestables,verbs=create;update,versions=v1api20220901,name=validate.v1api20220901.storageaccountstableservicestables.storage.azure.com,admissionReviewVersions=v1

var _ admission.Validator = &StorageAccountsTableServicesTable{}

// ValidateCreate validates the creation of the resource
func (table *StorageAccountsTableServicesTable) ValidateCreate() (admission.Warnings, error) {
	validations := table.createValidations()
	var temp any = table
	if runtimeValidator, ok := temp.(genruntime.Validator); ok {
		validations = append(validations, runtimeValidator.CreateValidations()...)
	}
	return genruntime.ValidateCreate(validations)
}

// ValidateDelete validates the deletion of the resource
func (table *StorageAccountsTableServicesTable) ValidateDelete() (admission.Warnings, error) {
	validations := table.deleteValidations()
	var temp any = table
	if runtimeValidator, ok := temp.(genruntime.Validator); ok {
		validations = append(validations, runtimeValidator.DeleteValidations()...)
	}
	return genruntime.ValidateDelete(validations)
}

// ValidateUpdate validates an update of the resource
func (table *StorageAccountsTableServicesTable) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
	validations := table.updateValidations()
	var temp any = table
	if runtimeValidator, ok := temp.(genruntime.Validator); ok {
		validations = append(validations, runtimeValidator.UpdateValidations()...)
	}
	return genruntime.ValidateUpdate(old, validations)
}

// createValidations validates the creation of the resource
func (table *StorageAccountsTableServicesTable) createValidations() []func() (admission.Warnings, error) {
	return []func() (admission.Warnings, error){table.validateResourceReferences, table.validateOwnerReference}
}

// deleteValidations validates the deletion of the resource
func (table *StorageAccountsTableServicesTable) deleteValidations() []func() (admission.Warnings, error) {
	return nil
}

// updateValidations validates the update of the resource
func (table *StorageAccountsTableServicesTable) updateValidations() []func(old runtime.Object) (admission.Warnings, error) {
	return []func(old runtime.Object) (admission.Warnings, error){
		func(old runtime.Object) (admission.Warnings, error) {
			return table.validateResourceReferences()
		},
		table.validateWriteOnceProperties,
		func(old runtime.Object) (admission.Warnings, error) {
			return table.validateOwnerReference()
		},
	}
}

// validateOwnerReference validates the owner field
func (table *StorageAccountsTableServicesTable) validateOwnerReference() (admission.Warnings, error) {
	return genruntime.ValidateOwner(table)
}

// validateResourceReferences validates all resource references
func (table *StorageAccountsTableServicesTable) validateResourceReferences() (admission.Warnings, error) {
	refs, err := reflecthelpers.FindResourceReferences(&table.Spec)
	if err != nil {
		return nil, err
	}
	return genruntime.ValidateResourceReferences(refs)
}

// validateWriteOnceProperties validates all WriteOnce properties
func (table *StorageAccountsTableServicesTable) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) {
	oldObj, ok := old.(*StorageAccountsTableServicesTable)
	if !ok {
		return nil, nil
	}

	return genruntime.ValidateWriteOnceProperties(oldObj, table)
}

// AssignProperties_From_StorageAccountsTableServicesTable populates our StorageAccountsTableServicesTable from the provided source StorageAccountsTableServicesTable
func (table *StorageAccountsTableServicesTable) AssignProperties_From_StorageAccountsTableServicesTable(source *v20220901s.StorageAccountsTableServicesTable) error {

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

	// Spec
	var spec StorageAccounts_TableServices_Table_Spec
	err := spec.AssignProperties_From_StorageAccounts_TableServices_Table_Spec(&source.Spec)
	if err != nil {
		return errors.Wrap(err, "calling AssignProperties_From_StorageAccounts_TableServices_Table_Spec() to populate field Spec")
	}
	table.Spec = spec

	// Status
	var status StorageAccounts_TableServices_Table_STATUS
	err = status.AssignProperties_From_StorageAccounts_TableServices_Table_STATUS(&source.Status)
	if err != nil {
		return errors.Wrap(err, "calling AssignProperties_From_StorageAccounts_TableServices_Table_STATUS() to populate field Status")
	}
	table.Status = status

	// No error
	return nil
}

// AssignProperties_To_StorageAccountsTableServicesTable populates the provided destination StorageAccountsTableServicesTable from our StorageAccountsTableServicesTable
func (table *StorageAccountsTableServicesTable) AssignProperties_To_StorageAccountsTableServicesTable(destination *v20220901s.StorageAccountsTableServicesTable) error {

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

	// Spec
	var spec v20220901s.StorageAccounts_TableServices_Table_Spec
	err := table.Spec.AssignProperties_To_StorageAccounts_TableServices_Table_Spec(&spec)
	if err != nil {
		return errors.Wrap(err, "calling AssignProperties_To_StorageAccounts_TableServices_Table_Spec() to populate field Spec")
	}
	destination.Spec = spec

	// Status
	var status v20220901s.StorageAccounts_TableServices_Table_STATUS
	err = table.Status.AssignProperties_To_StorageAccounts_TableServices_Table_STATUS(&status)
	if err != nil {
		return errors.Wrap(err, "calling AssignProperties_To_StorageAccounts_TableServices_Table_STATUS() to populate field Status")
	}
	destination.Status = status

	// No error
	return nil
}

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /storage/resource-manager/Microsoft.Storage/stable/2022-09-01/table.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}
type StorageAccountsTableServicesTableList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []StorageAccountsTableServicesTable `json:"items"`
}

type StorageAccounts_TableServices_Table_Spec struct {
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:MinLength=3
	// +kubebuilder:validation:Pattern="^[A-Za-z][A-Za-z0-9]{2,62}$"
	// 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"`

	// +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 storage.azure.com/StorageAccountsTableService resource
	Owner *genruntime.KnownResourceReference `group:"storage.azure.com" json:"owner,omitempty" kind:"StorageAccountsTableService"`

	// SignedIdentifiers: List of stored access policies specified on the table.
	SignedIdentifiers []TableSignedIdentifier `json:"signedIdentifiers,omitempty"`
}

var _ genruntime.ARMTransformer = &StorageAccounts_TableServices_Table_Spec{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (table *StorageAccounts_TableServices_Table_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if table == nil {
		return nil, nil
	}
	result := &StorageAccounts_TableServices_Table_Spec_ARM{}

	// Set property "Name":
	result.Name = resolved.Name

	// Set property "Properties":
	if table.SignedIdentifiers != nil {
		result.Properties = &TableProperties_ARM{}
	}
	for _, item := range table.SignedIdentifiers {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.SignedIdentifiers = append(result.Properties.SignedIdentifiers, *item_ARM.(*TableSignedIdentifier_ARM))
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (table *StorageAccounts_TableServices_Table_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &StorageAccounts_TableServices_Table_Spec_ARM{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (table *StorageAccounts_TableServices_Table_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(StorageAccounts_TableServices_Table_Spec_ARM)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected StorageAccounts_TableServices_Table_Spec_ARM, got %T", armInput)
	}

	// Set property "AzureName":
	table.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name))

	// Set property "Owner":
	table.Owner = &genruntime.KnownResourceReference{
		Name:  owner.Name,
		ARMID: owner.ARMID,
	}

	// Set property "SignedIdentifiers":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.SignedIdentifiers {
			var item1 TableSignedIdentifier
			err := item1.PopulateFromARM(owner, item)
			if err != nil {
				return err
			}
			table.SignedIdentifiers = append(table.SignedIdentifiers, item1)
		}
	}

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &StorageAccounts_TableServices_Table_Spec{}

// ConvertSpecFrom populates our StorageAccounts_TableServices_Table_Spec from the provided source
func (table *StorageAccounts_TableServices_Table_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
	src, ok := source.(*v20220901s.StorageAccounts_TableServices_Table_Spec)
	if ok {
		// Populate our instance from source
		return table.AssignProperties_From_StorageAccounts_TableServices_Table_Spec(src)
	}

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

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

	return nil
}

// ConvertSpecTo populates the provided destination from our StorageAccounts_TableServices_Table_Spec
func (table *StorageAccounts_TableServices_Table_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
	dst, ok := destination.(*v20220901s.StorageAccounts_TableServices_Table_Spec)
	if ok {
		// Populate destination from our instance
		return table.AssignProperties_To_StorageAccounts_TableServices_Table_Spec(dst)
	}

	// Convert to an intermediate form
	dst = &v20220901s.StorageAccounts_TableServices_Table_Spec{}
	err := table.AssignProperties_To_StorageAccounts_TableServices_Table_Spec(dst)
	if err != nil {
		return errors.Wrap(err, "initial step of conversion in ConvertSpecTo()")
	}

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

	return nil
}

// AssignProperties_From_StorageAccounts_TableServices_Table_Spec populates our StorageAccounts_TableServices_Table_Spec from the provided source StorageAccounts_TableServices_Table_Spec
func (table *StorageAccounts_TableServices_Table_Spec) AssignProperties_From_StorageAccounts_TableServices_Table_Spec(source *v20220901s.StorageAccounts_TableServices_Table_Spec) error {

	// AzureName
	table.AzureName = source.AzureName

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

	// SignedIdentifiers
	if source.SignedIdentifiers != nil {
		signedIdentifierList := make([]TableSignedIdentifier, len(source.SignedIdentifiers))
		for signedIdentifierIndex, signedIdentifierItem := range source.SignedIdentifiers {
			// Shadow the loop variable to avoid aliasing
			signedIdentifierItem := signedIdentifierItem
			var signedIdentifier TableSignedIdentifier
			err := signedIdentifier.AssignProperties_From_TableSignedIdentifier(&signedIdentifierItem)
			if err != nil {
				return errors.Wrap(err, "calling AssignProperties_From_TableSignedIdentifier() to populate field SignedIdentifiers")
			}
			signedIdentifierList[signedIdentifierIndex] = signedIdentifier
		}
		table.SignedIdentifiers = signedIdentifierList
	} else {
		table.SignedIdentifiers = nil
	}

	// No error
	return nil
}

// AssignProperties_To_StorageAccounts_TableServices_Table_Spec populates the provided destination StorageAccounts_TableServices_Table_Spec from our StorageAccounts_TableServices_Table_Spec
func (table *StorageAccounts_TableServices_Table_Spec) AssignProperties_To_StorageAccounts_TableServices_Table_Spec(destination *v20220901s.StorageAccounts_TableServices_Table_Spec) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// AzureName
	destination.AzureName = table.AzureName

	// OriginalVersion
	destination.OriginalVersion = table.OriginalVersion()

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

	// SignedIdentifiers
	if table.SignedIdentifiers != nil {
		signedIdentifierList := make([]v20220901s.TableSignedIdentifier, len(table.SignedIdentifiers))
		for signedIdentifierIndex, signedIdentifierItem := range table.SignedIdentifiers {
			// Shadow the loop variable to avoid aliasing
			signedIdentifierItem := signedIdentifierItem
			var signedIdentifier v20220901s.TableSignedIdentifier
			err := signedIdentifierItem.AssignProperties_To_TableSignedIdentifier(&signedIdentifier)
			if err != nil {
				return errors.Wrap(err, "calling AssignProperties_To_TableSignedIdentifier() to populate field SignedIdentifiers")
			}
			signedIdentifierList[signedIdentifierIndex] = signedIdentifier
		}
		destination.SignedIdentifiers = signedIdentifierList
	} else {
		destination.SignedIdentifiers = nil
	}

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

	// No error
	return nil
}

// Initialize_From_StorageAccounts_TableServices_Table_STATUS populates our StorageAccounts_TableServices_Table_Spec from the provided source StorageAccounts_TableServices_Table_STATUS
func (table *StorageAccounts_TableServices_Table_Spec) Initialize_From_StorageAccounts_TableServices_Table_STATUS(source *StorageAccounts_TableServices_Table_STATUS) error {

	// SignedIdentifiers
	if source.SignedIdentifiers != nil {
		signedIdentifierList := make([]TableSignedIdentifier, len(source.SignedIdentifiers))
		for signedIdentifierIndex, signedIdentifierItem := range source.SignedIdentifiers {
			// Shadow the loop variable to avoid aliasing
			signedIdentifierItem := signedIdentifierItem
			var signedIdentifier TableSignedIdentifier
			err := signedIdentifier.Initialize_From_TableSignedIdentifier_STATUS(&signedIdentifierItem)
			if err != nil {
				return errors.Wrap(err, "calling Initialize_From_TableSignedIdentifier_STATUS() to populate field SignedIdentifiers")
			}
			signedIdentifierList[signedIdentifierIndex] = signedIdentifier
		}
		table.SignedIdentifiers = signedIdentifierList
	} else {
		table.SignedIdentifiers = nil
	}

	// No error
	return nil
}

// OriginalVersion returns the original API version used to create the resource.
func (table *StorageAccounts_TableServices_Table_Spec) OriginalVersion() string {
	return GroupVersion.Version
}

// SetAzureName sets the Azure name of the resource
func (table *StorageAccounts_TableServices_Table_Spec) SetAzureName(azureName string) {
	table.AzureName = azureName
}

type StorageAccounts_TableServices_Table_STATUS struct {
	// Conditions: The observed state of the resource
	Conditions []conditions.Condition `json:"conditions,omitempty"`

	// Id: Fully qualified resource ID for the resource. Ex -
	// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	Id *string `json:"id,omitempty"`

	// Name: The name of the resource
	Name *string `json:"name,omitempty"`

	// SignedIdentifiers: List of stored access policies specified on the table.
	SignedIdentifiers []TableSignedIdentifier_STATUS `json:"signedIdentifiers,omitempty"`

	// TableName: Table name under the specified account
	TableName *string `json:"tableName,omitempty"`

	// Type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

var _ genruntime.ConvertibleStatus = &StorageAccounts_TableServices_Table_STATUS{}

// ConvertStatusFrom populates our StorageAccounts_TableServices_Table_STATUS from the provided source
func (table *StorageAccounts_TableServices_Table_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
	src, ok := source.(*v20220901s.StorageAccounts_TableServices_Table_STATUS)
	if ok {
		// Populate our instance from source
		return table.AssignProperties_From_StorageAccounts_TableServices_Table_STATUS(src)
	}

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

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

	return nil
}

// ConvertStatusTo populates the provided destination from our StorageAccounts_TableServices_Table_STATUS
func (table *StorageAccounts_TableServices_Table_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
	dst, ok := destination.(*v20220901s.StorageAccounts_TableServices_Table_STATUS)
	if ok {
		// Populate destination from our instance
		return table.AssignProperties_To_StorageAccounts_TableServices_Table_STATUS(dst)
	}

	// Convert to an intermediate form
	dst = &v20220901s.StorageAccounts_TableServices_Table_STATUS{}
	err := table.AssignProperties_To_StorageAccounts_TableServices_Table_STATUS(dst)
	if err != nil {
		return errors.Wrap(err, "initial step of conversion in ConvertStatusTo()")
	}

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

	return nil
}

var _ genruntime.FromARMConverter = &StorageAccounts_TableServices_Table_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (table *StorageAccounts_TableServices_Table_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &StorageAccounts_TableServices_Table_STATUS_ARM{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (table *StorageAccounts_TableServices_Table_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(StorageAccounts_TableServices_Table_STATUS_ARM)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected StorageAccounts_TableServices_Table_STATUS_ARM, got %T", armInput)
	}

	// no assignment for property "Conditions"

	// Set property "Id":
	if typedInput.Id != nil {
		id := *typedInput.Id
		table.Id = &id
	}

	// Set property "Name":
	if typedInput.Name != nil {
		name := *typedInput.Name
		table.Name = &name
	}

	// Set property "SignedIdentifiers":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.SignedIdentifiers {
			var item1 TableSignedIdentifier_STATUS
			err := item1.PopulateFromARM(owner, item)
			if err != nil {
				return err
			}
			table.SignedIdentifiers = append(table.SignedIdentifiers, item1)
		}
	}

	// Set property "TableName":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.TableName != nil {
			tableName := *typedInput.Properties.TableName
			table.TableName = &tableName
		}
	}

	// Set property "Type":
	if typedInput.Type != nil {
		typeVar := *typedInput.Type
		table.Type = &typeVar
	}

	// No error
	return nil
}

// AssignProperties_From_StorageAccounts_TableServices_Table_STATUS populates our StorageAccounts_TableServices_Table_STATUS from the provided source StorageAccounts_TableServices_Table_STATUS
func (table *StorageAccounts_TableServices_Table_STATUS) AssignProperties_From_StorageAccounts_TableServices_Table_STATUS(source *v20220901s.StorageAccounts_TableServices_Table_STATUS) error {

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

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

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

	// SignedIdentifiers
	if source.SignedIdentifiers != nil {
		signedIdentifierList := make([]TableSignedIdentifier_STATUS, len(source.SignedIdentifiers))
		for signedIdentifierIndex, signedIdentifierItem := range source.SignedIdentifiers {
			// Shadow the loop variable to avoid aliasing
			signedIdentifierItem := signedIdentifierItem
			var signedIdentifier TableSignedIdentifier_STATUS
			err := signedIdentifier.AssignProperties_From_TableSignedIdentifier_STATUS(&signedIdentifierItem)
			if err != nil {
				return errors.Wrap(err, "calling AssignProperties_From_TableSignedIdentifier_STATUS() to populate field SignedIdentifiers")
			}
			signedIdentifierList[signedIdentifierIndex] = signedIdentifier
		}
		table.SignedIdentifiers = signedIdentifierList
	} else {
		table.SignedIdentifiers = nil
	}

	// TableName
	table.TableName = genruntime.ClonePointerToString(source.TableName)

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

	// No error
	return nil
}

// AssignProperties_To_StorageAccounts_TableServices_Table_STATUS populates the provided destination StorageAccounts_TableServices_Table_STATUS from our StorageAccounts_TableServices_Table_STATUS
func (table *StorageAccounts_TableServices_Table_STATUS) AssignProperties_To_StorageAccounts_TableServices_Table_STATUS(destination *v20220901s.StorageAccounts_TableServices_Table_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

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

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

	// SignedIdentifiers
	if table.SignedIdentifiers != nil {
		signedIdentifierList := make([]v20220901s.TableSignedIdentifier_STATUS, len(table.SignedIdentifiers))
		for signedIdentifierIndex, signedIdentifierItem := range table.SignedIdentifiers {
			// Shadow the loop variable to avoid aliasing
			signedIdentifierItem := signedIdentifierItem
			var signedIdentifier v20220901s.TableSignedIdentifier_STATUS
			err := signedIdentifierItem.AssignProperties_To_TableSignedIdentifier_STATUS(&signedIdentifier)
			if err != nil {
				return errors.Wrap(err, "calling AssignProperties_To_TableSignedIdentifier_STATUS() to populate field SignedIdentifiers")
			}
			signedIdentifierList[signedIdentifierIndex] = signedIdentifier
		}
		destination.SignedIdentifiers = signedIdentifierList
	} else {
		destination.SignedIdentifiers = nil
	}

	// TableName
	destination.TableName = genruntime.ClonePointerToString(table.TableName)

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

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

	// No error
	return nil
}

// Object to set Table Access Policy.
type TableSignedIdentifier struct {
	// AccessPolicy: Access policy
	AccessPolicy *TableAccessPolicy `json:"accessPolicy,omitempty"`

	// +kubebuilder:validation:Required
	// Reference: unique-64-character-value of the stored access policy.
	Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"`
}

var _ genruntime.ARMTransformer = &TableSignedIdentifier{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (identifier *TableSignedIdentifier) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if identifier == nil {
		return nil, nil
	}
	result := &TableSignedIdentifier_ARM{}

	// Set property "AccessPolicy":
	if identifier.AccessPolicy != nil {
		accessPolicy_ARM, err := (*identifier.AccessPolicy).ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		accessPolicy := *accessPolicy_ARM.(*TableAccessPolicy_ARM)
		result.AccessPolicy = &accessPolicy
	}

	// Set property "Id":
	if identifier.Reference != nil {
		referenceARMID, err := resolved.ResolvedReferences.Lookup(*identifier.Reference)
		if err != nil {
			return nil, err
		}
		reference := referenceARMID
		result.Id = &reference
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (identifier *TableSignedIdentifier) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &TableSignedIdentifier_ARM{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (identifier *TableSignedIdentifier) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(TableSignedIdentifier_ARM)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected TableSignedIdentifier_ARM, got %T", armInput)
	}

	// Set property "AccessPolicy":
	if typedInput.AccessPolicy != nil {
		var accessPolicy1 TableAccessPolicy
		err := accessPolicy1.PopulateFromARM(owner, *typedInput.AccessPolicy)
		if err != nil {
			return err
		}
		accessPolicy := accessPolicy1
		identifier.AccessPolicy = &accessPolicy
	}

	// no assignment for property "Reference"

	// No error
	return nil
}

// AssignProperties_From_TableSignedIdentifier populates our TableSignedIdentifier from the provided source TableSignedIdentifier
func (identifier *TableSignedIdentifier) AssignProperties_From_TableSignedIdentifier(source *v20220901s.TableSignedIdentifier) error {

	// AccessPolicy
	if source.AccessPolicy != nil {
		var accessPolicy TableAccessPolicy
		err := accessPolicy.AssignProperties_From_TableAccessPolicy(source.AccessPolicy)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_From_TableAccessPolicy() to populate field AccessPolicy")
		}
		identifier.AccessPolicy = &accessPolicy
	} else {
		identifier.AccessPolicy = nil
	}

	// Reference
	if source.Reference != nil {
		reference := source.Reference.Copy()
		identifier.Reference = &reference
	} else {
		identifier.Reference = nil
	}

	// No error
	return nil
}

// AssignProperties_To_TableSignedIdentifier populates the provided destination TableSignedIdentifier from our TableSignedIdentifier
func (identifier *TableSignedIdentifier) AssignProperties_To_TableSignedIdentifier(destination *v20220901s.TableSignedIdentifier) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// AccessPolicy
	if identifier.AccessPolicy != nil {
		var accessPolicy v20220901s.TableAccessPolicy
		err := identifier.AccessPolicy.AssignProperties_To_TableAccessPolicy(&accessPolicy)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_To_TableAccessPolicy() to populate field AccessPolicy")
		}
		destination.AccessPolicy = &accessPolicy
	} else {
		destination.AccessPolicy = nil
	}

	// Reference
	if identifier.Reference != nil {
		reference := identifier.Reference.Copy()
		destination.Reference = &reference
	} else {
		destination.Reference = nil
	}

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

	// No error
	return nil
}

// Initialize_From_TableSignedIdentifier_STATUS populates our TableSignedIdentifier from the provided source TableSignedIdentifier_STATUS
func (identifier *TableSignedIdentifier) Initialize_From_TableSignedIdentifier_STATUS(source *TableSignedIdentifier_STATUS) error {

	// AccessPolicy
	if source.AccessPolicy != nil {
		var accessPolicy TableAccessPolicy
		err := accessPolicy.Initialize_From_TableAccessPolicy_STATUS(source.AccessPolicy)
		if err != nil {
			return errors.Wrap(err, "calling Initialize_From_TableAccessPolicy_STATUS() to populate field AccessPolicy")
		}
		identifier.AccessPolicy = &accessPolicy
	} else {
		identifier.AccessPolicy = nil
	}

	// Reference
	if source.Id != nil {
		reference := genruntime.CreateResourceReferenceFromARMID(*source.Id)
		identifier.Reference = &reference
	} else {
		identifier.Reference = nil
	}

	// No error
	return nil
}

// Object to set Table Access Policy.
type TableSignedIdentifier_STATUS struct {
	// AccessPolicy: Access policy
	AccessPolicy *TableAccessPolicy_STATUS `json:"accessPolicy,omitempty"`

	// Id: unique-64-character-value of the stored access policy.
	Id *string `json:"id,omitempty"`
}

var _ genruntime.FromARMConverter = &TableSignedIdentifier_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (identifier *TableSignedIdentifier_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &TableSignedIdentifier_STATUS_ARM{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (identifier *TableSignedIdentifier_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(TableSignedIdentifier_STATUS_ARM)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected TableSignedIdentifier_STATUS_ARM, got %T", armInput)
	}

	// Set property "AccessPolicy":
	if typedInput.AccessPolicy != nil {
		var accessPolicy1 TableAccessPolicy_STATUS
		err := accessPolicy1.PopulateFromARM(owner, *typedInput.AccessPolicy)
		if err != nil {
			return err
		}
		accessPolicy := accessPolicy1
		identifier.AccessPolicy = &accessPolicy
	}

	// Set property "Id":
	if typedInput.Id != nil {
		id := *typedInput.Id
		identifier.Id = &id
	}

	// No error
	return nil
}

// AssignProperties_From_TableSignedIdentifier_STATUS populates our TableSignedIdentifier_STATUS from the provided source TableSignedIdentifier_STATUS
func (identifier *TableSignedIdentifier_STATUS) AssignProperties_From_TableSignedIdentifier_STATUS(source *v20220901s.TableSignedIdentifier_STATUS) error {

	// AccessPolicy
	if source.AccessPolicy != nil {
		var accessPolicy TableAccessPolicy_STATUS
		err := accessPolicy.AssignProperties_From_TableAccessPolicy_STATUS(source.AccessPolicy)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_From_TableAccessPolicy_STATUS() to populate field AccessPolicy")
		}
		identifier.AccessPolicy = &accessPolicy
	} else {
		identifier.AccessPolicy = nil
	}

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

	// No error
	return nil
}

// AssignProperties_To_TableSignedIdentifier_STATUS populates the provided destination TableSignedIdentifier_STATUS from our TableSignedIdentifier_STATUS
func (identifier *TableSignedIdentifier_STATUS) AssignProperties_To_TableSignedIdentifier_STATUS(destination *v20220901s.TableSignedIdentifier_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// AccessPolicy
	if identifier.AccessPolicy != nil {
		var accessPolicy v20220901s.TableAccessPolicy_STATUS
		err := identifier.AccessPolicy.AssignProperties_To_TableAccessPolicy_STATUS(&accessPolicy)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_To_TableAccessPolicy_STATUS() to populate field AccessPolicy")
		}
		destination.AccessPolicy = &accessPolicy
	} else {
		destination.AccessPolicy = nil
	}

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

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

	// No error
	return nil
}

// Table Access Policy Properties Object.
type TableAccessPolicy struct {
	// ExpiryTime: Expiry time of the access policy
	ExpiryTime *string `json:"expiryTime,omitempty"`

	// +kubebuilder:validation:Required
	// Permission: Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d'
	Permission *string `json:"permission,omitempty"`

	// StartTime: Start time of the access policy
	StartTime *string `json:"startTime,omitempty"`
}

var _ genruntime.ARMTransformer = &TableAccessPolicy{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (policy *TableAccessPolicy) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if policy == nil {
		return nil, nil
	}
	result := &TableAccessPolicy_ARM{}

	// Set property "ExpiryTime":
	if policy.ExpiryTime != nil {
		expiryTime := *policy.ExpiryTime
		result.ExpiryTime = &expiryTime
	}

	// Set property "Permission":
	if policy.Permission != nil {
		permission := *policy.Permission
		result.Permission = &permission
	}

	// Set property "StartTime":
	if policy.StartTime != nil {
		startTime := *policy.StartTime
		result.StartTime = &startTime
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (policy *TableAccessPolicy) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &TableAccessPolicy_ARM{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (policy *TableAccessPolicy) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(TableAccessPolicy_ARM)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected TableAccessPolicy_ARM, got %T", armInput)
	}

	// Set property "ExpiryTime":
	if typedInput.ExpiryTime != nil {
		expiryTime := *typedInput.ExpiryTime
		policy.ExpiryTime = &expiryTime
	}

	// Set property "Permission":
	if typedInput.Permission != nil {
		permission := *typedInput.Permission
		policy.Permission = &permission
	}

	// Set property "StartTime":
	if typedInput.StartTime != nil {
		startTime := *typedInput.StartTime
		policy.StartTime = &startTime
	}

	// No error
	return nil
}

// AssignProperties_From_TableAccessPolicy populates our TableAccessPolicy from the provided source TableAccessPolicy
func (policy *TableAccessPolicy) AssignProperties_From_TableAccessPolicy(source *v20220901s.TableAccessPolicy) error {

	// ExpiryTime
	policy.ExpiryTime = genruntime.ClonePointerToString(source.ExpiryTime)

	// Permission
	policy.Permission = genruntime.ClonePointerToString(source.Permission)

	// StartTime
	policy.StartTime = genruntime.ClonePointerToString(source.StartTime)

	// No error
	return nil
}

// AssignProperties_To_TableAccessPolicy populates the provided destination TableAccessPolicy from our TableAccessPolicy
func (policy *TableAccessPolicy) AssignProperties_To_TableAccessPolicy(destination *v20220901s.TableAccessPolicy) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// ExpiryTime
	destination.ExpiryTime = genruntime.ClonePointerToString(policy.ExpiryTime)

	// Permission
	destination.Permission = genruntime.ClonePointerToString(policy.Permission)

	// StartTime
	destination.StartTime = genruntime.ClonePointerToString(policy.StartTime)

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

	// No error
	return nil
}

// Initialize_From_TableAccessPolicy_STATUS populates our TableAccessPolicy from the provided source TableAccessPolicy_STATUS
func (policy *TableAccessPolicy) Initialize_From_TableAccessPolicy_STATUS(source *TableAccessPolicy_STATUS) error {

	// ExpiryTime
	policy.ExpiryTime = genruntime.ClonePointerToString(source.ExpiryTime)

	// Permission
	policy.Permission = genruntime.ClonePointerToString(source.Permission)

	// StartTime
	policy.StartTime = genruntime.ClonePointerToString(source.StartTime)

	// No error
	return nil
}

// Table Access Policy Properties Object.
type TableAccessPolicy_STATUS struct {
	// ExpiryTime: Expiry time of the access policy
	ExpiryTime *string `json:"expiryTime,omitempty"`

	// Permission: Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d'
	Permission *string `json:"permission,omitempty"`

	// StartTime: Start time of the access policy
	StartTime *string `json:"startTime,omitempty"`
}

var _ genruntime.FromARMConverter = &TableAccessPolicy_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (policy *TableAccessPolicy_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &TableAccessPolicy_STATUS_ARM{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (policy *TableAccessPolicy_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(TableAccessPolicy_STATUS_ARM)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected TableAccessPolicy_STATUS_ARM, got %T", armInput)
	}

	// Set property "ExpiryTime":
	if typedInput.ExpiryTime != nil {
		expiryTime := *typedInput.ExpiryTime
		policy.ExpiryTime = &expiryTime
	}

	// Set property "Permission":
	if typedInput.Permission != nil {
		permission := *typedInput.Permission
		policy.Permission = &permission
	}

	// Set property "StartTime":
	if typedInput.StartTime != nil {
		startTime := *typedInput.StartTime
		policy.StartTime = &startTime
	}

	// No error
	return nil
}

// AssignProperties_From_TableAccessPolicy_STATUS populates our TableAccessPolicy_STATUS from the provided source TableAccessPolicy_STATUS
func (policy *TableAccessPolicy_STATUS) AssignProperties_From_TableAccessPolicy_STATUS(source *v20220901s.TableAccessPolicy_STATUS) error {

	// ExpiryTime
	policy.ExpiryTime = genruntime.ClonePointerToString(source.ExpiryTime)

	// Permission
	policy.Permission = genruntime.ClonePointerToString(source.Permission)

	// StartTime
	policy.StartTime = genruntime.ClonePointerToString(source.StartTime)

	// No error
	return nil
}

// AssignProperties_To_TableAccessPolicy_STATUS populates the provided destination TableAccessPolicy_STATUS from our TableAccessPolicy_STATUS
func (policy *TableAccessPolicy_STATUS) AssignProperties_To_TableAccessPolicy_STATUS(destination *v20220901s.TableAccessPolicy_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// ExpiryTime
	destination.ExpiryTime = genruntime.ClonePointerToString(policy.ExpiryTime)

	// Permission
	destination.Permission = genruntime.ClonePointerToString(policy.Permission)

	// StartTime
	destination.StartTime = genruntime.ClonePointerToString(policy.StartTime)

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

	// No error
	return nil
}

func init() {
	SchemeBuilder.Register(&StorageAccountsTableServicesTable{}, &StorageAccountsTableServicesTableList{})
}
