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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/web/v1api20220301/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/web/v1api20220301/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,web}
// +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: /web/resource-manager/Microsoft.Web/stable/2022-03-01/WebApps.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web
type SitesSourcecontrol struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              SitesSourcecontrol_Spec   `json:"spec,omitempty"`
	Status            SitesSourcecontrol_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &SitesSourcecontrol{}

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

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

var _ conversion.Convertible = &SitesSourcecontrol{}

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

	return sourcecontrol.AssignProperties_From_SitesSourcecontrol(source)
}

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

	return sourcecontrol.AssignProperties_To_SitesSourcecontrol(destination)
}

var _ configmaps.Exporter = &SitesSourcecontrol{}

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

var _ secrets.Exporter = &SitesSourcecontrol{}

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

var _ genruntime.ImportableResource = &SitesSourcecontrol{}

// InitializeSpec initializes the spec for this resource from the given status
func (sourcecontrol *SitesSourcecontrol) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*SitesSourcecontrol_STATUS); ok {
		return sourcecontrol.Spec.Initialize_From_SitesSourcecontrol_STATUS(s)
	}

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

var _ genruntime.KubernetesResource = &SitesSourcecontrol{}

// AzureName returns the Azure name of the resource (always "web")
func (sourcecontrol *SitesSourcecontrol) AzureName() string {
	return "web"
}

// GetAPIVersion returns the ARM API version of the resource. This is always "2022-03-01"
func (sourcecontrol SitesSourcecontrol) GetAPIVersion() string {
	return "2022-03-01"
}

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.Web/sites/sourcecontrols"
func (sourcecontrol *SitesSourcecontrol) GetType() string {
	return "Microsoft.Web/sites/sourcecontrols"
}

// NewEmptyStatus returns a new empty (blank) status
func (sourcecontrol *SitesSourcecontrol) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &SitesSourcecontrol_STATUS{}
}

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

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

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

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

	sourcecontrol.Status = st
	return nil
}

// AssignProperties_From_SitesSourcecontrol populates our SitesSourcecontrol from the provided source SitesSourcecontrol
func (sourcecontrol *SitesSourcecontrol) AssignProperties_From_SitesSourcecontrol(source *storage.SitesSourcecontrol) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_SitesSourcecontrol populates the provided destination SitesSourcecontrol from our SitesSourcecontrol
func (sourcecontrol *SitesSourcecontrol) AssignProperties_To_SitesSourcecontrol(destination *storage.SitesSourcecontrol) error {

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

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

	// Status
	var status storage.SitesSourcecontrol_STATUS
	err = sourcecontrol.Status.AssignProperties_To_SitesSourcecontrol_STATUS(&status)
	if err != nil {
		return eris.Wrap(err, "calling AssignProperties_To_SitesSourcecontrol_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 (sourcecontrol *SitesSourcecontrol) OriginalGVK() *schema.GroupVersionKind {
	return &schema.GroupVersionKind{
		Group:   GroupVersion.Group,
		Version: sourcecontrol.Spec.OriginalVersion(),
		Kind:    "SitesSourcecontrol",
	}
}

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /web/resource-manager/Microsoft.Web/stable/2022-03-01/WebApps.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web
type SitesSourcecontrolList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []SitesSourcecontrol `json:"items"`
}

type SitesSourcecontrol_Spec struct {
	// Branch: Name of branch to use for deployment.
	Branch *string `json:"branch,omitempty"`

	// DeploymentRollbackEnabled: <code>true</code> to enable deployment rollback; otherwise, <code>false</code>.
	DeploymentRollbackEnabled *bool `json:"deploymentRollbackEnabled,omitempty"`

	// GitHubActionConfiguration: If GitHub Action is selected, than the associated configuration.
	GitHubActionConfiguration *GitHubActionConfiguration `json:"gitHubActionConfiguration,omitempty"`

	// IsGitHubAction: <code>true</code> if this is deployed via GitHub action.
	IsGitHubAction *bool `json:"isGitHubAction,omitempty"`

	// IsManualIntegration: <code>true</code> to limit to manual integration; <code>false</code> to enable continuous
	// integration (which configures webhooks into online repos like GitHub).
	IsManualIntegration *bool `json:"isManualIntegration,omitempty"`

	// IsMercurial: <code>true</code> for a Mercurial repository; <code>false</code> for a Git repository.
	IsMercurial *bool `json:"isMercurial,omitempty"`

	// Kind: Kind of resource.
	Kind *string `json:"kind,omitempty"`

	// OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not
	// passed directly to Azure
	OperatorSpec *SitesSourcecontrolOperatorSpec `json:"operatorSpec,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 web.azure.com/Site resource
	Owner *genruntime.KnownResourceReference `group:"web.azure.com" json:"owner,omitempty" kind:"Site"`

	// RepoUrl: Repository or source control URL.
	RepoUrl *string `json:"repoUrl,omitempty"`
}

var _ genruntime.ARMTransformer = &SitesSourcecontrol_Spec{}

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

	// Set property "Kind":
	if sourcecontrol.Kind != nil {
		kind := *sourcecontrol.Kind
		result.Kind = &kind
	}

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

	// Set property "Properties":
	if sourcecontrol.Branch != nil ||
		sourcecontrol.DeploymentRollbackEnabled != nil ||
		sourcecontrol.GitHubActionConfiguration != nil ||
		sourcecontrol.IsGitHubAction != nil ||
		sourcecontrol.IsManualIntegration != nil ||
		sourcecontrol.IsMercurial != nil ||
		sourcecontrol.RepoUrl != nil {
		result.Properties = &arm.Sites_Sourcecontrol_Properties_Spec{}
	}
	if sourcecontrol.Branch != nil {
		branch := *sourcecontrol.Branch
		result.Properties.Branch = &branch
	}
	if sourcecontrol.DeploymentRollbackEnabled != nil {
		deploymentRollbackEnabled := *sourcecontrol.DeploymentRollbackEnabled
		result.Properties.DeploymentRollbackEnabled = &deploymentRollbackEnabled
	}
	if sourcecontrol.GitHubActionConfiguration != nil {
		gitHubActionConfiguration_ARM, err := sourcecontrol.GitHubActionConfiguration.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		gitHubActionConfiguration := *gitHubActionConfiguration_ARM.(*arm.GitHubActionConfiguration)
		result.Properties.GitHubActionConfiguration = &gitHubActionConfiguration
	}
	if sourcecontrol.IsGitHubAction != nil {
		isGitHubAction := *sourcecontrol.IsGitHubAction
		result.Properties.IsGitHubAction = &isGitHubAction
	}
	if sourcecontrol.IsManualIntegration != nil {
		isManualIntegration := *sourcecontrol.IsManualIntegration
		result.Properties.IsManualIntegration = &isManualIntegration
	}
	if sourcecontrol.IsMercurial != nil {
		isMercurial := *sourcecontrol.IsMercurial
		result.Properties.IsMercurial = &isMercurial
	}
	if sourcecontrol.RepoUrl != nil {
		repoUrl := *sourcecontrol.RepoUrl
		result.Properties.RepoUrl = &repoUrl
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (sourcecontrol *SitesSourcecontrol_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.SitesSourcecontrol_Spec{}
}

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

	// Set property "Branch":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Branch != nil {
			branch := *typedInput.Properties.Branch
			sourcecontrol.Branch = &branch
		}
	}

	// Set property "DeploymentRollbackEnabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DeploymentRollbackEnabled != nil {
			deploymentRollbackEnabled := *typedInput.Properties.DeploymentRollbackEnabled
			sourcecontrol.DeploymentRollbackEnabled = &deploymentRollbackEnabled
		}
	}

	// Set property "GitHubActionConfiguration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.GitHubActionConfiguration != nil {
			var gitHubActionConfiguration1 GitHubActionConfiguration
			err := gitHubActionConfiguration1.PopulateFromARM(owner, *typedInput.Properties.GitHubActionConfiguration)
			if err != nil {
				return err
			}
			gitHubActionConfiguration := gitHubActionConfiguration1
			sourcecontrol.GitHubActionConfiguration = &gitHubActionConfiguration
		}
	}

	// Set property "IsGitHubAction":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsGitHubAction != nil {
			isGitHubAction := *typedInput.Properties.IsGitHubAction
			sourcecontrol.IsGitHubAction = &isGitHubAction
		}
	}

	// Set property "IsManualIntegration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsManualIntegration != nil {
			isManualIntegration := *typedInput.Properties.IsManualIntegration
			sourcecontrol.IsManualIntegration = &isManualIntegration
		}
	}

	// Set property "IsMercurial":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsMercurial != nil {
			isMercurial := *typedInput.Properties.IsMercurial
			sourcecontrol.IsMercurial = &isMercurial
		}
	}

	// Set property "Kind":
	if typedInput.Kind != nil {
		kind := *typedInput.Kind
		sourcecontrol.Kind = &kind
	}

	// no assignment for property "OperatorSpec"

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

	// Set property "RepoUrl":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RepoUrl != nil {
			repoUrl := *typedInput.Properties.RepoUrl
			sourcecontrol.RepoUrl = &repoUrl
		}
	}

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &SitesSourcecontrol_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.SitesSourcecontrol_Spec{}
	err := sourcecontrol.AssignProperties_To_SitesSourcecontrol_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_SitesSourcecontrol_Spec populates our SitesSourcecontrol_Spec from the provided source SitesSourcecontrol_Spec
func (sourcecontrol *SitesSourcecontrol_Spec) AssignProperties_From_SitesSourcecontrol_Spec(source *storage.SitesSourcecontrol_Spec) error {

	// Branch
	sourcecontrol.Branch = genruntime.ClonePointerToString(source.Branch)

	// DeploymentRollbackEnabled
	if source.DeploymentRollbackEnabled != nil {
		deploymentRollbackEnabled := *source.DeploymentRollbackEnabled
		sourcecontrol.DeploymentRollbackEnabled = &deploymentRollbackEnabled
	} else {
		sourcecontrol.DeploymentRollbackEnabled = nil
	}

	// GitHubActionConfiguration
	if source.GitHubActionConfiguration != nil {
		var gitHubActionConfiguration GitHubActionConfiguration
		err := gitHubActionConfiguration.AssignProperties_From_GitHubActionConfiguration(source.GitHubActionConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_GitHubActionConfiguration() to populate field GitHubActionConfiguration")
		}
		sourcecontrol.GitHubActionConfiguration = &gitHubActionConfiguration
	} else {
		sourcecontrol.GitHubActionConfiguration = nil
	}

	// IsGitHubAction
	if source.IsGitHubAction != nil {
		isGitHubAction := *source.IsGitHubAction
		sourcecontrol.IsGitHubAction = &isGitHubAction
	} else {
		sourcecontrol.IsGitHubAction = nil
	}

	// IsManualIntegration
	if source.IsManualIntegration != nil {
		isManualIntegration := *source.IsManualIntegration
		sourcecontrol.IsManualIntegration = &isManualIntegration
	} else {
		sourcecontrol.IsManualIntegration = nil
	}

	// IsMercurial
	if source.IsMercurial != nil {
		isMercurial := *source.IsMercurial
		sourcecontrol.IsMercurial = &isMercurial
	} else {
		sourcecontrol.IsMercurial = nil
	}

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

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

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

	// RepoUrl
	sourcecontrol.RepoUrl = genruntime.ClonePointerToString(source.RepoUrl)

	// No error
	return nil
}

// AssignProperties_To_SitesSourcecontrol_Spec populates the provided destination SitesSourcecontrol_Spec from our SitesSourcecontrol_Spec
func (sourcecontrol *SitesSourcecontrol_Spec) AssignProperties_To_SitesSourcecontrol_Spec(destination *storage.SitesSourcecontrol_Spec) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// Branch
	destination.Branch = genruntime.ClonePointerToString(sourcecontrol.Branch)

	// DeploymentRollbackEnabled
	if sourcecontrol.DeploymentRollbackEnabled != nil {
		deploymentRollbackEnabled := *sourcecontrol.DeploymentRollbackEnabled
		destination.DeploymentRollbackEnabled = &deploymentRollbackEnabled
	} else {
		destination.DeploymentRollbackEnabled = nil
	}

	// GitHubActionConfiguration
	if sourcecontrol.GitHubActionConfiguration != nil {
		var gitHubActionConfiguration storage.GitHubActionConfiguration
		err := sourcecontrol.GitHubActionConfiguration.AssignProperties_To_GitHubActionConfiguration(&gitHubActionConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_GitHubActionConfiguration() to populate field GitHubActionConfiguration")
		}
		destination.GitHubActionConfiguration = &gitHubActionConfiguration
	} else {
		destination.GitHubActionConfiguration = nil
	}

	// IsGitHubAction
	if sourcecontrol.IsGitHubAction != nil {
		isGitHubAction := *sourcecontrol.IsGitHubAction
		destination.IsGitHubAction = &isGitHubAction
	} else {
		destination.IsGitHubAction = nil
	}

	// IsManualIntegration
	if sourcecontrol.IsManualIntegration != nil {
		isManualIntegration := *sourcecontrol.IsManualIntegration
		destination.IsManualIntegration = &isManualIntegration
	} else {
		destination.IsManualIntegration = nil
	}

	// IsMercurial
	if sourcecontrol.IsMercurial != nil {
		isMercurial := *sourcecontrol.IsMercurial
		destination.IsMercurial = &isMercurial
	} else {
		destination.IsMercurial = nil
	}

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

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

	// OriginalVersion
	destination.OriginalVersion = sourcecontrol.OriginalVersion()

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

	// RepoUrl
	destination.RepoUrl = genruntime.ClonePointerToString(sourcecontrol.RepoUrl)

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

	// No error
	return nil
}

// Initialize_From_SitesSourcecontrol_STATUS populates our SitesSourcecontrol_Spec from the provided source SitesSourcecontrol_STATUS
func (sourcecontrol *SitesSourcecontrol_Spec) Initialize_From_SitesSourcecontrol_STATUS(source *SitesSourcecontrol_STATUS) error {

	// Branch
	sourcecontrol.Branch = genruntime.ClonePointerToString(source.Branch)

	// DeploymentRollbackEnabled
	if source.DeploymentRollbackEnabled != nil {
		deploymentRollbackEnabled := *source.DeploymentRollbackEnabled
		sourcecontrol.DeploymentRollbackEnabled = &deploymentRollbackEnabled
	} else {
		sourcecontrol.DeploymentRollbackEnabled = nil
	}

	// GitHubActionConfiguration
	if source.GitHubActionConfiguration != nil {
		var gitHubActionConfiguration GitHubActionConfiguration
		err := gitHubActionConfiguration.Initialize_From_GitHubActionConfiguration_STATUS(source.GitHubActionConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_GitHubActionConfiguration_STATUS() to populate field GitHubActionConfiguration")
		}
		sourcecontrol.GitHubActionConfiguration = &gitHubActionConfiguration
	} else {
		sourcecontrol.GitHubActionConfiguration = nil
	}

	// IsGitHubAction
	if source.IsGitHubAction != nil {
		isGitHubAction := *source.IsGitHubAction
		sourcecontrol.IsGitHubAction = &isGitHubAction
	} else {
		sourcecontrol.IsGitHubAction = nil
	}

	// IsManualIntegration
	if source.IsManualIntegration != nil {
		isManualIntegration := *source.IsManualIntegration
		sourcecontrol.IsManualIntegration = &isManualIntegration
	} else {
		sourcecontrol.IsManualIntegration = nil
	}

	// IsMercurial
	if source.IsMercurial != nil {
		isMercurial := *source.IsMercurial
		sourcecontrol.IsMercurial = &isMercurial
	} else {
		sourcecontrol.IsMercurial = nil
	}

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

	// RepoUrl
	sourcecontrol.RepoUrl = genruntime.ClonePointerToString(source.RepoUrl)

	// No error
	return nil
}

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

type SitesSourcecontrol_STATUS struct {
	// Branch: Name of branch to use for deployment.
	Branch *string `json:"branch,omitempty"`

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

	// DeploymentRollbackEnabled: <code>true</code> to enable deployment rollback; otherwise, <code>false</code>.
	DeploymentRollbackEnabled *bool `json:"deploymentRollbackEnabled,omitempty"`

	// GitHubActionConfiguration: If GitHub Action is selected, than the associated configuration.
	GitHubActionConfiguration *GitHubActionConfiguration_STATUS `json:"gitHubActionConfiguration,omitempty"`

	// Id: Resource Id.
	Id *string `json:"id,omitempty"`

	// IsGitHubAction: <code>true</code> if this is deployed via GitHub action.
	IsGitHubAction *bool `json:"isGitHubAction,omitempty"`

	// IsManualIntegration: <code>true</code> to limit to manual integration; <code>false</code> to enable continuous
	// integration (which configures webhooks into online repos like GitHub).
	IsManualIntegration *bool `json:"isManualIntegration,omitempty"`

	// IsMercurial: <code>true</code> for a Mercurial repository; <code>false</code> for a Git repository.
	IsMercurial *bool `json:"isMercurial,omitempty"`

	// Kind: Kind of resource.
	Kind *string `json:"kind,omitempty"`

	// Name: Resource Name.
	Name *string `json:"name,omitempty"`

	// RepoUrl: Repository or source control URL.
	RepoUrl *string `json:"repoUrl,omitempty"`

	// Type: Resource type.
	Type *string `json:"type,omitempty"`
}

var _ genruntime.ConvertibleStatus = &SitesSourcecontrol_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.SitesSourcecontrol_STATUS{}
	err := sourcecontrol.AssignProperties_To_SitesSourcecontrol_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
}

var _ genruntime.FromARMConverter = &SitesSourcecontrol_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (sourcecontrol *SitesSourcecontrol_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.SitesSourcecontrol_STATUS{}
}

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

	// Set property "Branch":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Branch != nil {
			branch := *typedInput.Properties.Branch
			sourcecontrol.Branch = &branch
		}
	}

	// no assignment for property "Conditions"

	// Set property "DeploymentRollbackEnabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DeploymentRollbackEnabled != nil {
			deploymentRollbackEnabled := *typedInput.Properties.DeploymentRollbackEnabled
			sourcecontrol.DeploymentRollbackEnabled = &deploymentRollbackEnabled
		}
	}

	// Set property "GitHubActionConfiguration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.GitHubActionConfiguration != nil {
			var gitHubActionConfiguration1 GitHubActionConfiguration_STATUS
			err := gitHubActionConfiguration1.PopulateFromARM(owner, *typedInput.Properties.GitHubActionConfiguration)
			if err != nil {
				return err
			}
			gitHubActionConfiguration := gitHubActionConfiguration1
			sourcecontrol.GitHubActionConfiguration = &gitHubActionConfiguration
		}
	}

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

	// Set property "IsGitHubAction":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsGitHubAction != nil {
			isGitHubAction := *typedInput.Properties.IsGitHubAction
			sourcecontrol.IsGitHubAction = &isGitHubAction
		}
	}

	// Set property "IsManualIntegration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsManualIntegration != nil {
			isManualIntegration := *typedInput.Properties.IsManualIntegration
			sourcecontrol.IsManualIntegration = &isManualIntegration
		}
	}

	// Set property "IsMercurial":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsMercurial != nil {
			isMercurial := *typedInput.Properties.IsMercurial
			sourcecontrol.IsMercurial = &isMercurial
		}
	}

	// Set property "Kind":
	if typedInput.Kind != nil {
		kind := *typedInput.Kind
		sourcecontrol.Kind = &kind
	}

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

	// Set property "RepoUrl":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RepoUrl != nil {
			repoUrl := *typedInput.Properties.RepoUrl
			sourcecontrol.RepoUrl = &repoUrl
		}
	}

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

	// No error
	return nil
}

// AssignProperties_From_SitesSourcecontrol_STATUS populates our SitesSourcecontrol_STATUS from the provided source SitesSourcecontrol_STATUS
func (sourcecontrol *SitesSourcecontrol_STATUS) AssignProperties_From_SitesSourcecontrol_STATUS(source *storage.SitesSourcecontrol_STATUS) error {

	// Branch
	sourcecontrol.Branch = genruntime.ClonePointerToString(source.Branch)

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

	// DeploymentRollbackEnabled
	if source.DeploymentRollbackEnabled != nil {
		deploymentRollbackEnabled := *source.DeploymentRollbackEnabled
		sourcecontrol.DeploymentRollbackEnabled = &deploymentRollbackEnabled
	} else {
		sourcecontrol.DeploymentRollbackEnabled = nil
	}

	// GitHubActionConfiguration
	if source.GitHubActionConfiguration != nil {
		var gitHubActionConfiguration GitHubActionConfiguration_STATUS
		err := gitHubActionConfiguration.AssignProperties_From_GitHubActionConfiguration_STATUS(source.GitHubActionConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_GitHubActionConfiguration_STATUS() to populate field GitHubActionConfiguration")
		}
		sourcecontrol.GitHubActionConfiguration = &gitHubActionConfiguration
	} else {
		sourcecontrol.GitHubActionConfiguration = nil
	}

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

	// IsGitHubAction
	if source.IsGitHubAction != nil {
		isGitHubAction := *source.IsGitHubAction
		sourcecontrol.IsGitHubAction = &isGitHubAction
	} else {
		sourcecontrol.IsGitHubAction = nil
	}

	// IsManualIntegration
	if source.IsManualIntegration != nil {
		isManualIntegration := *source.IsManualIntegration
		sourcecontrol.IsManualIntegration = &isManualIntegration
	} else {
		sourcecontrol.IsManualIntegration = nil
	}

	// IsMercurial
	if source.IsMercurial != nil {
		isMercurial := *source.IsMercurial
		sourcecontrol.IsMercurial = &isMercurial
	} else {
		sourcecontrol.IsMercurial = nil
	}

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

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

	// RepoUrl
	sourcecontrol.RepoUrl = genruntime.ClonePointerToString(source.RepoUrl)

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

	// No error
	return nil
}

// AssignProperties_To_SitesSourcecontrol_STATUS populates the provided destination SitesSourcecontrol_STATUS from our SitesSourcecontrol_STATUS
func (sourcecontrol *SitesSourcecontrol_STATUS) AssignProperties_To_SitesSourcecontrol_STATUS(destination *storage.SitesSourcecontrol_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// Branch
	destination.Branch = genruntime.ClonePointerToString(sourcecontrol.Branch)

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

	// DeploymentRollbackEnabled
	if sourcecontrol.DeploymentRollbackEnabled != nil {
		deploymentRollbackEnabled := *sourcecontrol.DeploymentRollbackEnabled
		destination.DeploymentRollbackEnabled = &deploymentRollbackEnabled
	} else {
		destination.DeploymentRollbackEnabled = nil
	}

	// GitHubActionConfiguration
	if sourcecontrol.GitHubActionConfiguration != nil {
		var gitHubActionConfiguration storage.GitHubActionConfiguration_STATUS
		err := sourcecontrol.GitHubActionConfiguration.AssignProperties_To_GitHubActionConfiguration_STATUS(&gitHubActionConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_GitHubActionConfiguration_STATUS() to populate field GitHubActionConfiguration")
		}
		destination.GitHubActionConfiguration = &gitHubActionConfiguration
	} else {
		destination.GitHubActionConfiguration = nil
	}

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

	// IsGitHubAction
	if sourcecontrol.IsGitHubAction != nil {
		isGitHubAction := *sourcecontrol.IsGitHubAction
		destination.IsGitHubAction = &isGitHubAction
	} else {
		destination.IsGitHubAction = nil
	}

	// IsManualIntegration
	if sourcecontrol.IsManualIntegration != nil {
		isManualIntegration := *sourcecontrol.IsManualIntegration
		destination.IsManualIntegration = &isManualIntegration
	} else {
		destination.IsManualIntegration = nil
	}

	// IsMercurial
	if sourcecontrol.IsMercurial != nil {
		isMercurial := *sourcecontrol.IsMercurial
		destination.IsMercurial = &isMercurial
	} else {
		destination.IsMercurial = nil
	}

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

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

	// RepoUrl
	destination.RepoUrl = genruntime.ClonePointerToString(sourcecontrol.RepoUrl)

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

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

	// No error
	return nil
}

// The GitHub action configuration.
type GitHubActionConfiguration struct {
	// CodeConfiguration: GitHub Action code configuration.
	CodeConfiguration *GitHubActionCodeConfiguration `json:"codeConfiguration,omitempty"`

	// ContainerConfiguration: GitHub Action container configuration.
	ContainerConfiguration *GitHubActionContainerConfiguration `json:"containerConfiguration,omitempty"`

	// GenerateWorkflowFile: Workflow option to determine whether the workflow file should be generated and written to the
	// repository.
	GenerateWorkflowFile *bool `json:"generateWorkflowFile,omitempty"`

	// IsLinux: This will help determine the workflow configuration to select.
	IsLinux *bool `json:"isLinux,omitempty"`
}

var _ genruntime.ARMTransformer = &GitHubActionConfiguration{}

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

	// Set property "CodeConfiguration":
	if configuration.CodeConfiguration != nil {
		codeConfiguration_ARM, err := configuration.CodeConfiguration.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		codeConfiguration := *codeConfiguration_ARM.(*arm.GitHubActionCodeConfiguration)
		result.CodeConfiguration = &codeConfiguration
	}

	// Set property "ContainerConfiguration":
	if configuration.ContainerConfiguration != nil {
		containerConfiguration_ARM, err := configuration.ContainerConfiguration.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		containerConfiguration := *containerConfiguration_ARM.(*arm.GitHubActionContainerConfiguration)
		result.ContainerConfiguration = &containerConfiguration
	}

	// Set property "GenerateWorkflowFile":
	if configuration.GenerateWorkflowFile != nil {
		generateWorkflowFile := *configuration.GenerateWorkflowFile
		result.GenerateWorkflowFile = &generateWorkflowFile
	}

	// Set property "IsLinux":
	if configuration.IsLinux != nil {
		isLinux := *configuration.IsLinux
		result.IsLinux = &isLinux
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (configuration *GitHubActionConfiguration) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.GitHubActionConfiguration{}
}

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

	// Set property "CodeConfiguration":
	if typedInput.CodeConfiguration != nil {
		var codeConfiguration1 GitHubActionCodeConfiguration
		err := codeConfiguration1.PopulateFromARM(owner, *typedInput.CodeConfiguration)
		if err != nil {
			return err
		}
		codeConfiguration := codeConfiguration1
		configuration.CodeConfiguration = &codeConfiguration
	}

	// Set property "ContainerConfiguration":
	if typedInput.ContainerConfiguration != nil {
		var containerConfiguration1 GitHubActionContainerConfiguration
		err := containerConfiguration1.PopulateFromARM(owner, *typedInput.ContainerConfiguration)
		if err != nil {
			return err
		}
		containerConfiguration := containerConfiguration1
		configuration.ContainerConfiguration = &containerConfiguration
	}

	// Set property "GenerateWorkflowFile":
	if typedInput.GenerateWorkflowFile != nil {
		generateWorkflowFile := *typedInput.GenerateWorkflowFile
		configuration.GenerateWorkflowFile = &generateWorkflowFile
	}

	// Set property "IsLinux":
	if typedInput.IsLinux != nil {
		isLinux := *typedInput.IsLinux
		configuration.IsLinux = &isLinux
	}

	// No error
	return nil
}

// AssignProperties_From_GitHubActionConfiguration populates our GitHubActionConfiguration from the provided source GitHubActionConfiguration
func (configuration *GitHubActionConfiguration) AssignProperties_From_GitHubActionConfiguration(source *storage.GitHubActionConfiguration) error {

	// CodeConfiguration
	if source.CodeConfiguration != nil {
		var codeConfiguration GitHubActionCodeConfiguration
		err := codeConfiguration.AssignProperties_From_GitHubActionCodeConfiguration(source.CodeConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_GitHubActionCodeConfiguration() to populate field CodeConfiguration")
		}
		configuration.CodeConfiguration = &codeConfiguration
	} else {
		configuration.CodeConfiguration = nil
	}

	// ContainerConfiguration
	if source.ContainerConfiguration != nil {
		var containerConfiguration GitHubActionContainerConfiguration
		err := containerConfiguration.AssignProperties_From_GitHubActionContainerConfiguration(source.ContainerConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_GitHubActionContainerConfiguration() to populate field ContainerConfiguration")
		}
		configuration.ContainerConfiguration = &containerConfiguration
	} else {
		configuration.ContainerConfiguration = nil
	}

	// GenerateWorkflowFile
	if source.GenerateWorkflowFile != nil {
		generateWorkflowFile := *source.GenerateWorkflowFile
		configuration.GenerateWorkflowFile = &generateWorkflowFile
	} else {
		configuration.GenerateWorkflowFile = nil
	}

	// IsLinux
	if source.IsLinux != nil {
		isLinux := *source.IsLinux
		configuration.IsLinux = &isLinux
	} else {
		configuration.IsLinux = nil
	}

	// No error
	return nil
}

// AssignProperties_To_GitHubActionConfiguration populates the provided destination GitHubActionConfiguration from our GitHubActionConfiguration
func (configuration *GitHubActionConfiguration) AssignProperties_To_GitHubActionConfiguration(destination *storage.GitHubActionConfiguration) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// CodeConfiguration
	if configuration.CodeConfiguration != nil {
		var codeConfiguration storage.GitHubActionCodeConfiguration
		err := configuration.CodeConfiguration.AssignProperties_To_GitHubActionCodeConfiguration(&codeConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_GitHubActionCodeConfiguration() to populate field CodeConfiguration")
		}
		destination.CodeConfiguration = &codeConfiguration
	} else {
		destination.CodeConfiguration = nil
	}

	// ContainerConfiguration
	if configuration.ContainerConfiguration != nil {
		var containerConfiguration storage.GitHubActionContainerConfiguration
		err := configuration.ContainerConfiguration.AssignProperties_To_GitHubActionContainerConfiguration(&containerConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_GitHubActionContainerConfiguration() to populate field ContainerConfiguration")
		}
		destination.ContainerConfiguration = &containerConfiguration
	} else {
		destination.ContainerConfiguration = nil
	}

	// GenerateWorkflowFile
	if configuration.GenerateWorkflowFile != nil {
		generateWorkflowFile := *configuration.GenerateWorkflowFile
		destination.GenerateWorkflowFile = &generateWorkflowFile
	} else {
		destination.GenerateWorkflowFile = nil
	}

	// IsLinux
	if configuration.IsLinux != nil {
		isLinux := *configuration.IsLinux
		destination.IsLinux = &isLinux
	} else {
		destination.IsLinux = nil
	}

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

	// No error
	return nil
}

// Initialize_From_GitHubActionConfiguration_STATUS populates our GitHubActionConfiguration from the provided source GitHubActionConfiguration_STATUS
func (configuration *GitHubActionConfiguration) Initialize_From_GitHubActionConfiguration_STATUS(source *GitHubActionConfiguration_STATUS) error {

	// CodeConfiguration
	if source.CodeConfiguration != nil {
		var codeConfiguration GitHubActionCodeConfiguration
		err := codeConfiguration.Initialize_From_GitHubActionCodeConfiguration_STATUS(source.CodeConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_GitHubActionCodeConfiguration_STATUS() to populate field CodeConfiguration")
		}
		configuration.CodeConfiguration = &codeConfiguration
	} else {
		configuration.CodeConfiguration = nil
	}

	// ContainerConfiguration
	if source.ContainerConfiguration != nil {
		var containerConfiguration GitHubActionContainerConfiguration
		err := containerConfiguration.Initialize_From_GitHubActionContainerConfiguration_STATUS(source.ContainerConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_GitHubActionContainerConfiguration_STATUS() to populate field ContainerConfiguration")
		}
		configuration.ContainerConfiguration = &containerConfiguration
	} else {
		configuration.ContainerConfiguration = nil
	}

	// GenerateWorkflowFile
	if source.GenerateWorkflowFile != nil {
		generateWorkflowFile := *source.GenerateWorkflowFile
		configuration.GenerateWorkflowFile = &generateWorkflowFile
	} else {
		configuration.GenerateWorkflowFile = nil
	}

	// IsLinux
	if source.IsLinux != nil {
		isLinux := *source.IsLinux
		configuration.IsLinux = &isLinux
	} else {
		configuration.IsLinux = nil
	}

	// No error
	return nil
}

// The GitHub action configuration.
type GitHubActionConfiguration_STATUS struct {
	// CodeConfiguration: GitHub Action code configuration.
	CodeConfiguration *GitHubActionCodeConfiguration_STATUS `json:"codeConfiguration,omitempty"`

	// ContainerConfiguration: GitHub Action container configuration.
	ContainerConfiguration *GitHubActionContainerConfiguration_STATUS `json:"containerConfiguration,omitempty"`

	// GenerateWorkflowFile: Workflow option to determine whether the workflow file should be generated and written to the
	// repository.
	GenerateWorkflowFile *bool `json:"generateWorkflowFile,omitempty"`

	// IsLinux: This will help determine the workflow configuration to select.
	IsLinux *bool `json:"isLinux,omitempty"`
}

var _ genruntime.FromARMConverter = &GitHubActionConfiguration_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (configuration *GitHubActionConfiguration_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.GitHubActionConfiguration_STATUS{}
}

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

	// Set property "CodeConfiguration":
	if typedInput.CodeConfiguration != nil {
		var codeConfiguration1 GitHubActionCodeConfiguration_STATUS
		err := codeConfiguration1.PopulateFromARM(owner, *typedInput.CodeConfiguration)
		if err != nil {
			return err
		}
		codeConfiguration := codeConfiguration1
		configuration.CodeConfiguration = &codeConfiguration
	}

	// Set property "ContainerConfiguration":
	if typedInput.ContainerConfiguration != nil {
		var containerConfiguration1 GitHubActionContainerConfiguration_STATUS
		err := containerConfiguration1.PopulateFromARM(owner, *typedInput.ContainerConfiguration)
		if err != nil {
			return err
		}
		containerConfiguration := containerConfiguration1
		configuration.ContainerConfiguration = &containerConfiguration
	}

	// Set property "GenerateWorkflowFile":
	if typedInput.GenerateWorkflowFile != nil {
		generateWorkflowFile := *typedInput.GenerateWorkflowFile
		configuration.GenerateWorkflowFile = &generateWorkflowFile
	}

	// Set property "IsLinux":
	if typedInput.IsLinux != nil {
		isLinux := *typedInput.IsLinux
		configuration.IsLinux = &isLinux
	}

	// No error
	return nil
}

// AssignProperties_From_GitHubActionConfiguration_STATUS populates our GitHubActionConfiguration_STATUS from the provided source GitHubActionConfiguration_STATUS
func (configuration *GitHubActionConfiguration_STATUS) AssignProperties_From_GitHubActionConfiguration_STATUS(source *storage.GitHubActionConfiguration_STATUS) error {

	// CodeConfiguration
	if source.CodeConfiguration != nil {
		var codeConfiguration GitHubActionCodeConfiguration_STATUS
		err := codeConfiguration.AssignProperties_From_GitHubActionCodeConfiguration_STATUS(source.CodeConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_GitHubActionCodeConfiguration_STATUS() to populate field CodeConfiguration")
		}
		configuration.CodeConfiguration = &codeConfiguration
	} else {
		configuration.CodeConfiguration = nil
	}

	// ContainerConfiguration
	if source.ContainerConfiguration != nil {
		var containerConfiguration GitHubActionContainerConfiguration_STATUS
		err := containerConfiguration.AssignProperties_From_GitHubActionContainerConfiguration_STATUS(source.ContainerConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_GitHubActionContainerConfiguration_STATUS() to populate field ContainerConfiguration")
		}
		configuration.ContainerConfiguration = &containerConfiguration
	} else {
		configuration.ContainerConfiguration = nil
	}

	// GenerateWorkflowFile
	if source.GenerateWorkflowFile != nil {
		generateWorkflowFile := *source.GenerateWorkflowFile
		configuration.GenerateWorkflowFile = &generateWorkflowFile
	} else {
		configuration.GenerateWorkflowFile = nil
	}

	// IsLinux
	if source.IsLinux != nil {
		isLinux := *source.IsLinux
		configuration.IsLinux = &isLinux
	} else {
		configuration.IsLinux = nil
	}

	// No error
	return nil
}

// AssignProperties_To_GitHubActionConfiguration_STATUS populates the provided destination GitHubActionConfiguration_STATUS from our GitHubActionConfiguration_STATUS
func (configuration *GitHubActionConfiguration_STATUS) AssignProperties_To_GitHubActionConfiguration_STATUS(destination *storage.GitHubActionConfiguration_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// CodeConfiguration
	if configuration.CodeConfiguration != nil {
		var codeConfiguration storage.GitHubActionCodeConfiguration_STATUS
		err := configuration.CodeConfiguration.AssignProperties_To_GitHubActionCodeConfiguration_STATUS(&codeConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_GitHubActionCodeConfiguration_STATUS() to populate field CodeConfiguration")
		}
		destination.CodeConfiguration = &codeConfiguration
	} else {
		destination.CodeConfiguration = nil
	}

	// ContainerConfiguration
	if configuration.ContainerConfiguration != nil {
		var containerConfiguration storage.GitHubActionContainerConfiguration_STATUS
		err := configuration.ContainerConfiguration.AssignProperties_To_GitHubActionContainerConfiguration_STATUS(&containerConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_GitHubActionContainerConfiguration_STATUS() to populate field ContainerConfiguration")
		}
		destination.ContainerConfiguration = &containerConfiguration
	} else {
		destination.ContainerConfiguration = nil
	}

	// GenerateWorkflowFile
	if configuration.GenerateWorkflowFile != nil {
		generateWorkflowFile := *configuration.GenerateWorkflowFile
		destination.GenerateWorkflowFile = &generateWorkflowFile
	} else {
		destination.GenerateWorkflowFile = nil
	}

	// IsLinux
	if configuration.IsLinux != nil {
		isLinux := *configuration.IsLinux
		destination.IsLinux = &isLinux
	} else {
		destination.IsLinux = nil
	}

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

	// No error
	return nil
}

// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure
type SitesSourcecontrolOperatorSpec struct {
	// ConfigMapExpressions: configures where to place operator written dynamic ConfigMaps (created with CEL expressions).
	ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"`

	// SecretExpressions: configures where to place operator written dynamic secrets (created with CEL expressions).
	SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"`
}

// AssignProperties_From_SitesSourcecontrolOperatorSpec populates our SitesSourcecontrolOperatorSpec from the provided source SitesSourcecontrolOperatorSpec
func (operator *SitesSourcecontrolOperatorSpec) AssignProperties_From_SitesSourcecontrolOperatorSpec(source *storage.SitesSourcecontrolOperatorSpec) error {

	// 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
	}

	// No error
	return nil
}

// AssignProperties_To_SitesSourcecontrolOperatorSpec populates the provided destination SitesSourcecontrolOperatorSpec from our SitesSourcecontrolOperatorSpec
func (operator *SitesSourcecontrolOperatorSpec) AssignProperties_To_SitesSourcecontrolOperatorSpec(destination *storage.SitesSourcecontrolOperatorSpec) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// 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
	}

	// No error
	return nil
}

// The GitHub action code configuration.
type GitHubActionCodeConfiguration struct {
	// RuntimeStack: Runtime stack is used to determine the workflow file content for code base apps.
	RuntimeStack *string `json:"runtimeStack,omitempty"`

	// RuntimeVersion: Runtime version is used to determine what build version to set in the workflow file.
	RuntimeVersion *string `json:"runtimeVersion,omitempty"`
}

var _ genruntime.ARMTransformer = &GitHubActionCodeConfiguration{}

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

	// Set property "RuntimeStack":
	if configuration.RuntimeStack != nil {
		runtimeStack := *configuration.RuntimeStack
		result.RuntimeStack = &runtimeStack
	}

	// Set property "RuntimeVersion":
	if configuration.RuntimeVersion != nil {
		runtimeVersion := *configuration.RuntimeVersion
		result.RuntimeVersion = &runtimeVersion
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (configuration *GitHubActionCodeConfiguration) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.GitHubActionCodeConfiguration{}
}

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

	// Set property "RuntimeStack":
	if typedInput.RuntimeStack != nil {
		runtimeStack := *typedInput.RuntimeStack
		configuration.RuntimeStack = &runtimeStack
	}

	// Set property "RuntimeVersion":
	if typedInput.RuntimeVersion != nil {
		runtimeVersion := *typedInput.RuntimeVersion
		configuration.RuntimeVersion = &runtimeVersion
	}

	// No error
	return nil
}

// AssignProperties_From_GitHubActionCodeConfiguration populates our GitHubActionCodeConfiguration from the provided source GitHubActionCodeConfiguration
func (configuration *GitHubActionCodeConfiguration) AssignProperties_From_GitHubActionCodeConfiguration(source *storage.GitHubActionCodeConfiguration) error {

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

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

	// No error
	return nil
}

// AssignProperties_To_GitHubActionCodeConfiguration populates the provided destination GitHubActionCodeConfiguration from our GitHubActionCodeConfiguration
func (configuration *GitHubActionCodeConfiguration) AssignProperties_To_GitHubActionCodeConfiguration(destination *storage.GitHubActionCodeConfiguration) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

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

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

	// No error
	return nil
}

// Initialize_From_GitHubActionCodeConfiguration_STATUS populates our GitHubActionCodeConfiguration from the provided source GitHubActionCodeConfiguration_STATUS
func (configuration *GitHubActionCodeConfiguration) Initialize_From_GitHubActionCodeConfiguration_STATUS(source *GitHubActionCodeConfiguration_STATUS) error {

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

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

	// No error
	return nil
}

// The GitHub action code configuration.
type GitHubActionCodeConfiguration_STATUS struct {
	// RuntimeStack: Runtime stack is used to determine the workflow file content for code base apps.
	RuntimeStack *string `json:"runtimeStack,omitempty"`

	// RuntimeVersion: Runtime version is used to determine what build version to set in the workflow file.
	RuntimeVersion *string `json:"runtimeVersion,omitempty"`
}

var _ genruntime.FromARMConverter = &GitHubActionCodeConfiguration_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (configuration *GitHubActionCodeConfiguration_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.GitHubActionCodeConfiguration_STATUS{}
}

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

	// Set property "RuntimeStack":
	if typedInput.RuntimeStack != nil {
		runtimeStack := *typedInput.RuntimeStack
		configuration.RuntimeStack = &runtimeStack
	}

	// Set property "RuntimeVersion":
	if typedInput.RuntimeVersion != nil {
		runtimeVersion := *typedInput.RuntimeVersion
		configuration.RuntimeVersion = &runtimeVersion
	}

	// No error
	return nil
}

// AssignProperties_From_GitHubActionCodeConfiguration_STATUS populates our GitHubActionCodeConfiguration_STATUS from the provided source GitHubActionCodeConfiguration_STATUS
func (configuration *GitHubActionCodeConfiguration_STATUS) AssignProperties_From_GitHubActionCodeConfiguration_STATUS(source *storage.GitHubActionCodeConfiguration_STATUS) error {

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

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

	// No error
	return nil
}

// AssignProperties_To_GitHubActionCodeConfiguration_STATUS populates the provided destination GitHubActionCodeConfiguration_STATUS from our GitHubActionCodeConfiguration_STATUS
func (configuration *GitHubActionCodeConfiguration_STATUS) AssignProperties_To_GitHubActionCodeConfiguration_STATUS(destination *storage.GitHubActionCodeConfiguration_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

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

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

	// No error
	return nil
}

// The GitHub action container configuration.
type GitHubActionContainerConfiguration struct {
	// ImageName: The image name for the build.
	ImageName *string `json:"imageName,omitempty"`

	// Password: The password used to upload the image to the container registry.
	Password *genruntime.SecretReference `json:"password,omitempty"`

	// ServerUrl: The server URL for the container registry where the build will be hosted.
	ServerUrl *string `json:"serverUrl,omitempty"`

	// Username: The username used to upload the image to the container registry.
	Username *string `json:"username,omitempty"`
}

var _ genruntime.ARMTransformer = &GitHubActionContainerConfiguration{}

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

	// Set property "ImageName":
	if configuration.ImageName != nil {
		imageName := *configuration.ImageName
		result.ImageName = &imageName
	}

	// Set property "Password":
	if configuration.Password != nil {
		passwordSecret, err := resolved.ResolvedSecrets.Lookup(*configuration.Password)
		if err != nil {
			return nil, eris.Wrap(err, "looking up secret for property Password")
		}
		password := passwordSecret
		result.Password = &password
	}

	// Set property "ServerUrl":
	if configuration.ServerUrl != nil {
		serverUrl := *configuration.ServerUrl
		result.ServerUrl = &serverUrl
	}

	// Set property "Username":
	if configuration.Username != nil {
		username := *configuration.Username
		result.Username = &username
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (configuration *GitHubActionContainerConfiguration) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.GitHubActionContainerConfiguration{}
}

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

	// Set property "ImageName":
	if typedInput.ImageName != nil {
		imageName := *typedInput.ImageName
		configuration.ImageName = &imageName
	}

	// no assignment for property "Password"

	// Set property "ServerUrl":
	if typedInput.ServerUrl != nil {
		serverUrl := *typedInput.ServerUrl
		configuration.ServerUrl = &serverUrl
	}

	// Set property "Username":
	if typedInput.Username != nil {
		username := *typedInput.Username
		configuration.Username = &username
	}

	// No error
	return nil
}

// AssignProperties_From_GitHubActionContainerConfiguration populates our GitHubActionContainerConfiguration from the provided source GitHubActionContainerConfiguration
func (configuration *GitHubActionContainerConfiguration) AssignProperties_From_GitHubActionContainerConfiguration(source *storage.GitHubActionContainerConfiguration) error {

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

	// Password
	if source.Password != nil {
		password := source.Password.Copy()
		configuration.Password = &password
	} else {
		configuration.Password = nil
	}

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

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

	// No error
	return nil
}

// AssignProperties_To_GitHubActionContainerConfiguration populates the provided destination GitHubActionContainerConfiguration from our GitHubActionContainerConfiguration
func (configuration *GitHubActionContainerConfiguration) AssignProperties_To_GitHubActionContainerConfiguration(destination *storage.GitHubActionContainerConfiguration) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

	// Password
	if configuration.Password != nil {
		password := configuration.Password.Copy()
		destination.Password = &password
	} else {
		destination.Password = nil
	}

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

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

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

	// No error
	return nil
}

// Initialize_From_GitHubActionContainerConfiguration_STATUS populates our GitHubActionContainerConfiguration from the provided source GitHubActionContainerConfiguration_STATUS
func (configuration *GitHubActionContainerConfiguration) Initialize_From_GitHubActionContainerConfiguration_STATUS(source *GitHubActionContainerConfiguration_STATUS) error {

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

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

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

	// No error
	return nil
}

// The GitHub action container configuration.
type GitHubActionContainerConfiguration_STATUS struct {
	// ImageName: The image name for the build.
	ImageName *string `json:"imageName,omitempty"`

	// ServerUrl: The server URL for the container registry where the build will be hosted.
	ServerUrl *string `json:"serverUrl,omitempty"`

	// Username: The username used to upload the image to the container registry.
	Username *string `json:"username,omitempty"`
}

var _ genruntime.FromARMConverter = &GitHubActionContainerConfiguration_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (configuration *GitHubActionContainerConfiguration_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.GitHubActionContainerConfiguration_STATUS{}
}

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

	// Set property "ImageName":
	if typedInput.ImageName != nil {
		imageName := *typedInput.ImageName
		configuration.ImageName = &imageName
	}

	// Set property "ServerUrl":
	if typedInput.ServerUrl != nil {
		serverUrl := *typedInput.ServerUrl
		configuration.ServerUrl = &serverUrl
	}

	// Set property "Username":
	if typedInput.Username != nil {
		username := *typedInput.Username
		configuration.Username = &username
	}

	// No error
	return nil
}

// AssignProperties_From_GitHubActionContainerConfiguration_STATUS populates our GitHubActionContainerConfiguration_STATUS from the provided source GitHubActionContainerConfiguration_STATUS
func (configuration *GitHubActionContainerConfiguration_STATUS) AssignProperties_From_GitHubActionContainerConfiguration_STATUS(source *storage.GitHubActionContainerConfiguration_STATUS) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_GitHubActionContainerConfiguration_STATUS populates the provided destination GitHubActionContainerConfiguration_STATUS from our GitHubActionContainerConfiguration_STATUS
func (configuration *GitHubActionContainerConfiguration_STATUS) AssignProperties_To_GitHubActionContainerConfiguration_STATUS(destination *storage.GitHubActionContainerConfiguration_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

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

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

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

	// No error
	return nil
}

func init() {
	SchemeBuilder.Register(&SitesSourcecontrol{}, &SitesSourcecontrolList{})
}
