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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/apimanagement/v1api20240501/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/apimanagement/v1api20240501/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,apimanagement}
// +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: /apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-01/apimapis.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}
type Api struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              Api_Spec   `json:"spec,omitempty"`
	Status            Api_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &Api{}

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

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

var _ conversion.Convertible = &Api{}

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

	return api.AssignProperties_From_Api(source)
}

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

	return api.AssignProperties_To_Api(destination)
}

var _ configmaps.Exporter = &Api{}

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

var _ secrets.Exporter = &Api{}

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

var _ genruntime.ImportableResource = &Api{}

// InitializeSpec initializes the spec for this resource from the given status
func (api *Api) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*Api_STATUS); ok {
		return api.Spec.Initialize_From_Api_STATUS(s)
	}

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

var _ genruntime.KubernetesResource = &Api{}

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

// GetAPIVersion returns the ARM API version of the resource. This is always "2024-05-01"
func (api Api) GetAPIVersion() string {
	return "2024-05-01"
}

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.ApiManagement/service/apis"
func (api *Api) GetType() string {
	return "Microsoft.ApiManagement/service/apis"
}

// NewEmptyStatus returns a new empty (blank) status
func (api *Api) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &Api_STATUS{}
}

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

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

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

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

	api.Status = st
	return nil
}

// AssignProperties_From_Api populates our Api from the provided source Api
func (api *Api) AssignProperties_From_Api(source *storage.Api) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_Api populates the provided destination Api from our Api
func (api *Api) AssignProperties_To_Api(destination *storage.Api) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-01/apimapis.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}
type ApiList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Api `json:"items"`
}

type Api_Spec struct {
	// +kubebuilder:validation:MaxLength=100
	// APIVersion: Indicates the version identifier of the API if the API is versioned
	APIVersion *string `json:"apiVersion,omitempty"`

	// +kubebuilder:validation:MaxLength=100
	// +kubebuilder:validation:MinLength=1
	// ApiRevision: Describes the revision of the API. If no value is provided, default revision 1 is created
	ApiRevision *string `json:"apiRevision,omitempty"`

	// +kubebuilder:validation:MaxLength=256
	// ApiRevisionDescription: Description of the API Revision.
	ApiRevisionDescription *string `json:"apiRevisionDescription,omitempty"`

	// ApiType: Type of API to create.
	// * `http` creates a REST API
	// * `soap` creates a SOAP pass-through API
	// * `websocket` creates websocket API
	// * `graphql` creates GraphQL API.
	// New types can be added in the future.
	ApiType *ApiCreateOrUpdateProperties_ApiType `json:"apiType,omitempty"`

	// +kubebuilder:validation:MaxLength=256
	// ApiVersionDescription: Description of the API Version.
	ApiVersionDescription *string `json:"apiVersionDescription,omitempty"`

	// ApiVersionSet: Version set details
	ApiVersionSet *ApiVersionSetContractDetails `json:"apiVersionSet,omitempty"`

	// ApiVersionSetReference: A resource identifier for the related ApiVersionSet.
	ApiVersionSetReference *genruntime.ResourceReference `armReference:"ApiVersionSetId" json:"apiVersionSetReference,omitempty"`

	// AuthenticationSettings: Collection of authentication settings included into this API.
	AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"`

	// +kubebuilder:validation:MaxLength=256
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:Pattern="^[^*#&+:<>?]+$"
	// 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"`

	// Contact: Contact information for the API.
	Contact *ApiContactInformation `json:"contact,omitempty"`

	// Description: Description of the API. May include HTML formatting tags.
	Description *string `json:"description,omitempty"`

	// +kubebuilder:validation:MaxLength=300
	// +kubebuilder:validation:MinLength=1
	// DisplayName: API name. Must be 1 to 300 characters long.
	DisplayName *string `json:"displayName,omitempty"`

	// Format: Format of the Content in which the API is getting imported. New formats can be added in the future
	Format *ApiCreateOrUpdateProperties_Format `json:"format,omitempty"`

	// IsCurrent: Indicates if API revision is current api revision.
	IsCurrent *bool `json:"isCurrent,omitempty"`

	// License: License information for the API.
	License *ApiLicenseInformation `json:"license,omitempty"`

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

	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MaxLength=400
	// +kubebuilder:validation:MinLength=0
	// Path: Relative URL uniquely identifying this API and all of its resource paths within the API Management service
	// instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public
	// URL for this API.
	Path *string `json:"path,omitempty"`

	// Protocols: Describes on which protocols the operations in this API can be invoked.
	Protocols []ApiCreateOrUpdateProperties_Protocols `json:"protocols,omitempty"`

	// +kubebuilder:validation:MaxLength=2000
	// +kubebuilder:validation:MinLength=0
	// ServiceUrl: Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long.
	ServiceUrl *string `json:"serviceUrl,omitempty"`

	// SourceApiReference: API identifier of the source API.
	SourceApiReference *genruntime.ResourceReference `armReference:"SourceApiId" json:"sourceApiReference,omitempty"`

	// SubscriptionKeyParameterNames: Protocols over which API is made available.
	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"`

	// SubscriptionRequired: Specifies whether an API or Product subscription is required for accessing the API.
	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`

	// TermsOfServiceUrl:  A URL to the Terms of Service for the API. MUST be in the format of a URL.
	TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"`

	// TranslateRequiredQueryParameters: Strategy of translating required query parameters to template ones. By default has
	// value 'template'. Possible values: 'template', 'query'
	TranslateRequiredQueryParameters *ApiCreateOrUpdateProperties_TranslateRequiredQueryParameters `json:"translateRequiredQueryParameters,omitempty"`

	// Type: Type of API.
	Type *ApiCreateOrUpdateProperties_Type `json:"type,omitempty"`

	// Value: Content value when Importing an API.
	Value *string `json:"value,omitempty"`

	// WsdlSelector: Criteria to limit import of WSDL to a subset of the document.
	WsdlSelector *ApiCreateOrUpdateProperties_WsdlSelector `json:"wsdlSelector,omitempty"`
}

var _ genruntime.ARMTransformer = &Api_Spec{}

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

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

	// Set property "Properties":
	if api.APIVersion != nil ||
		api.ApiRevision != nil ||
		api.ApiRevisionDescription != nil ||
		api.ApiType != nil ||
		api.ApiVersionDescription != nil ||
		api.ApiVersionSet != nil ||
		api.ApiVersionSetReference != nil ||
		api.AuthenticationSettings != nil ||
		api.Contact != nil ||
		api.Description != nil ||
		api.DisplayName != nil ||
		api.Format != nil ||
		api.IsCurrent != nil ||
		api.License != nil ||
		api.Path != nil ||
		api.Protocols != nil ||
		api.ServiceUrl != nil ||
		api.SourceApiReference != nil ||
		api.SubscriptionKeyParameterNames != nil ||
		api.SubscriptionRequired != nil ||
		api.TermsOfServiceUrl != nil ||
		api.TranslateRequiredQueryParameters != nil ||
		api.Type != nil ||
		api.Value != nil ||
		api.WsdlSelector != nil {
		result.Properties = &arm.ApiCreateOrUpdateProperties{}
	}
	if api.APIVersion != nil {
		apiVersion := *api.APIVersion
		result.Properties.APIVersion = &apiVersion
	}
	if api.ApiRevision != nil {
		apiRevision := *api.ApiRevision
		result.Properties.ApiRevision = &apiRevision
	}
	if api.ApiRevisionDescription != nil {
		apiRevisionDescription := *api.ApiRevisionDescription
		result.Properties.ApiRevisionDescription = &apiRevisionDescription
	}
	if api.ApiType != nil {
		var temp string
		temp = string(*api.ApiType)
		apiType := arm.ApiCreateOrUpdateProperties_ApiType(temp)
		result.Properties.ApiType = &apiType
	}
	if api.ApiVersionDescription != nil {
		apiVersionDescription := *api.ApiVersionDescription
		result.Properties.ApiVersionDescription = &apiVersionDescription
	}
	if api.ApiVersionSet != nil {
		apiVersionSet_ARM, err := api.ApiVersionSet.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		apiVersionSet := *apiVersionSet_ARM.(*arm.ApiVersionSetContractDetails)
		result.Properties.ApiVersionSet = &apiVersionSet
	}
	if api.ApiVersionSetReference != nil {
		apiVersionSetIdARMID, err := resolved.ResolvedReferences.Lookup(*api.ApiVersionSetReference)
		if err != nil {
			return nil, err
		}
		apiVersionSetId := apiVersionSetIdARMID
		result.Properties.ApiVersionSetId = &apiVersionSetId
	}
	if api.AuthenticationSettings != nil {
		authenticationSettings_ARM, err := api.AuthenticationSettings.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		authenticationSettings := *authenticationSettings_ARM.(*arm.AuthenticationSettingsContract)
		result.Properties.AuthenticationSettings = &authenticationSettings
	}
	if api.Contact != nil {
		contact_ARM, err := api.Contact.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		contact := *contact_ARM.(*arm.ApiContactInformation)
		result.Properties.Contact = &contact
	}
	if api.Description != nil {
		description := *api.Description
		result.Properties.Description = &description
	}
	if api.DisplayName != nil {
		displayName := *api.DisplayName
		result.Properties.DisplayName = &displayName
	}
	if api.Format != nil {
		var temp string
		temp = string(*api.Format)
		format := arm.ApiCreateOrUpdateProperties_Format(temp)
		result.Properties.Format = &format
	}
	if api.IsCurrent != nil {
		isCurrent := *api.IsCurrent
		result.Properties.IsCurrent = &isCurrent
	}
	if api.License != nil {
		license_ARM, err := api.License.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		license := *license_ARM.(*arm.ApiLicenseInformation)
		result.Properties.License = &license
	}
	if api.Path != nil {
		path := *api.Path
		result.Properties.Path = &path
	}
	for _, item := range api.Protocols {
		var temp string
		temp = string(item)
		result.Properties.Protocols = append(result.Properties.Protocols, arm.ApiCreateOrUpdateProperties_Protocols(temp))
	}
	if api.ServiceUrl != nil {
		serviceUrl := *api.ServiceUrl
		result.Properties.ServiceUrl = &serviceUrl
	}
	if api.SourceApiReference != nil {
		sourceApiIdARMID, err := resolved.ResolvedReferences.Lookup(*api.SourceApiReference)
		if err != nil {
			return nil, err
		}
		sourceApiId := sourceApiIdARMID
		result.Properties.SourceApiId = &sourceApiId
	}
	if api.SubscriptionKeyParameterNames != nil {
		subscriptionKeyParameterNames_ARM, err := api.SubscriptionKeyParameterNames.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		subscriptionKeyParameterNames := *subscriptionKeyParameterNames_ARM.(*arm.SubscriptionKeyParameterNamesContract)
		result.Properties.SubscriptionKeyParameterNames = &subscriptionKeyParameterNames
	}
	if api.SubscriptionRequired != nil {
		subscriptionRequired := *api.SubscriptionRequired
		result.Properties.SubscriptionRequired = &subscriptionRequired
	}
	if api.TermsOfServiceUrl != nil {
		termsOfServiceUrl := *api.TermsOfServiceUrl
		result.Properties.TermsOfServiceUrl = &termsOfServiceUrl
	}
	if api.TranslateRequiredQueryParameters != nil {
		var temp string
		temp = string(*api.TranslateRequiredQueryParameters)
		translateRequiredQueryParameters := arm.ApiCreateOrUpdateProperties_TranslateRequiredQueryParameters(temp)
		result.Properties.TranslateRequiredQueryParameters = &translateRequiredQueryParameters
	}
	if api.Type != nil {
		var temp string
		temp = string(*api.Type)
		typeVar := arm.ApiCreateOrUpdateProperties_Type(temp)
		result.Properties.Type = &typeVar
	}
	if api.Value != nil {
		value := *api.Value
		result.Properties.Value = &value
	}
	if api.WsdlSelector != nil {
		wsdlSelector_ARM, err := api.WsdlSelector.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		wsdlSelector := *wsdlSelector_ARM.(*arm.ApiCreateOrUpdateProperties_WsdlSelector)
		result.Properties.WsdlSelector = &wsdlSelector
	}
	return result, nil
}

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

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

	// Set property "APIVersion":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.APIVersion != nil {
			apiVersion := *typedInput.Properties.APIVersion
			api.APIVersion = &apiVersion
		}
	}

	// Set property "ApiRevision":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ApiRevision != nil {
			apiRevision := *typedInput.Properties.ApiRevision
			api.ApiRevision = &apiRevision
		}
	}

	// Set property "ApiRevisionDescription":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ApiRevisionDescription != nil {
			apiRevisionDescription := *typedInput.Properties.ApiRevisionDescription
			api.ApiRevisionDescription = &apiRevisionDescription
		}
	}

	// Set property "ApiType":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ApiType != nil {
			var temp string
			temp = string(*typedInput.Properties.ApiType)
			apiType := ApiCreateOrUpdateProperties_ApiType(temp)
			api.ApiType = &apiType
		}
	}

	// Set property "ApiVersionDescription":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ApiVersionDescription != nil {
			apiVersionDescription := *typedInput.Properties.ApiVersionDescription
			api.ApiVersionDescription = &apiVersionDescription
		}
	}

	// Set property "ApiVersionSet":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ApiVersionSet != nil {
			var apiVersionSet1 ApiVersionSetContractDetails
			err := apiVersionSet1.PopulateFromARM(owner, *typedInput.Properties.ApiVersionSet)
			if err != nil {
				return err
			}
			apiVersionSet := apiVersionSet1
			api.ApiVersionSet = &apiVersionSet
		}
	}

	// no assignment for property "ApiVersionSetReference"

	// Set property "AuthenticationSettings":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AuthenticationSettings != nil {
			var authenticationSettings1 AuthenticationSettingsContract
			err := authenticationSettings1.PopulateFromARM(owner, *typedInput.Properties.AuthenticationSettings)
			if err != nil {
				return err
			}
			authenticationSettings := authenticationSettings1
			api.AuthenticationSettings = &authenticationSettings
		}
	}

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

	// Set property "Contact":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Contact != nil {
			var contact1 ApiContactInformation
			err := contact1.PopulateFromARM(owner, *typedInput.Properties.Contact)
			if err != nil {
				return err
			}
			contact := contact1
			api.Contact = &contact
		}
	}

	// Set property "Description":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Description != nil {
			description := *typedInput.Properties.Description
			api.Description = &description
		}
	}

	// Set property "DisplayName":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DisplayName != nil {
			displayName := *typedInput.Properties.DisplayName
			api.DisplayName = &displayName
		}
	}

	// Set property "Format":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Format != nil {
			var temp string
			temp = string(*typedInput.Properties.Format)
			format := ApiCreateOrUpdateProperties_Format(temp)
			api.Format = &format
		}
	}

	// Set property "IsCurrent":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsCurrent != nil {
			isCurrent := *typedInput.Properties.IsCurrent
			api.IsCurrent = &isCurrent
		}
	}

	// Set property "License":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.License != nil {
			var license1 ApiLicenseInformation
			err := license1.PopulateFromARM(owner, *typedInput.Properties.License)
			if err != nil {
				return err
			}
			license := license1
			api.License = &license
		}
	}

	// no assignment for property "OperatorSpec"

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

	// Set property "Path":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Path != nil {
			path := *typedInput.Properties.Path
			api.Path = &path
		}
	}

	// Set property "Protocols":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.Protocols {
			var temp string
			temp = string(item)
			api.Protocols = append(api.Protocols, ApiCreateOrUpdateProperties_Protocols(temp))
		}
	}

	// Set property "ServiceUrl":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ServiceUrl != nil {
			serviceUrl := *typedInput.Properties.ServiceUrl
			api.ServiceUrl = &serviceUrl
		}
	}

	// no assignment for property "SourceApiReference"

	// Set property "SubscriptionKeyParameterNames":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SubscriptionKeyParameterNames != nil {
			var subscriptionKeyParameterNames1 SubscriptionKeyParameterNamesContract
			err := subscriptionKeyParameterNames1.PopulateFromARM(owner, *typedInput.Properties.SubscriptionKeyParameterNames)
			if err != nil {
				return err
			}
			subscriptionKeyParameterNames := subscriptionKeyParameterNames1
			api.SubscriptionKeyParameterNames = &subscriptionKeyParameterNames
		}
	}

	// Set property "SubscriptionRequired":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SubscriptionRequired != nil {
			subscriptionRequired := *typedInput.Properties.SubscriptionRequired
			api.SubscriptionRequired = &subscriptionRequired
		}
	}

	// Set property "TermsOfServiceUrl":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.TermsOfServiceUrl != nil {
			termsOfServiceUrl := *typedInput.Properties.TermsOfServiceUrl
			api.TermsOfServiceUrl = &termsOfServiceUrl
		}
	}

	// Set property "TranslateRequiredQueryParameters":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.TranslateRequiredQueryParameters != nil {
			var temp string
			temp = string(*typedInput.Properties.TranslateRequiredQueryParameters)
			translateRequiredQueryParameters := ApiCreateOrUpdateProperties_TranslateRequiredQueryParameters(temp)
			api.TranslateRequiredQueryParameters = &translateRequiredQueryParameters
		}
	}

	// Set property "Type":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Type != nil {
			var temp string
			temp = string(*typedInput.Properties.Type)
			typeVar := ApiCreateOrUpdateProperties_Type(temp)
			api.Type = &typeVar
		}
	}

	// Set property "Value":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Value != nil {
			value := *typedInput.Properties.Value
			api.Value = &value
		}
	}

	// Set property "WsdlSelector":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.WsdlSelector != nil {
			var wsdlSelector1 ApiCreateOrUpdateProperties_WsdlSelector
			err := wsdlSelector1.PopulateFromARM(owner, *typedInput.Properties.WsdlSelector)
			if err != nil {
				return err
			}
			wsdlSelector := wsdlSelector1
			api.WsdlSelector = &wsdlSelector
		}
	}

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &Api_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.Api_Spec{}
	err := api.AssignProperties_To_Api_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_Api_Spec populates our Api_Spec from the provided source Api_Spec
func (api *Api_Spec) AssignProperties_From_Api_Spec(source *storage.Api_Spec) error {

	// APIVersion
	api.APIVersion = genruntime.ClonePointerToString(source.APIVersion)

	// ApiRevision
	api.ApiRevision = genruntime.ClonePointerToString(source.ApiRevision)

	// ApiRevisionDescription
	api.ApiRevisionDescription = genruntime.ClonePointerToString(source.ApiRevisionDescription)

	// ApiType
	if source.ApiType != nil {
		apiType := *source.ApiType
		apiTypeTemp := genruntime.ToEnum(apiType, apiCreateOrUpdateProperties_ApiType_Values)
		api.ApiType = &apiTypeTemp
	} else {
		api.ApiType = nil
	}

	// ApiVersionDescription
	api.ApiVersionDescription = genruntime.ClonePointerToString(source.ApiVersionDescription)

	// ApiVersionSet
	if source.ApiVersionSet != nil {
		var apiVersionSet ApiVersionSetContractDetails
		err := apiVersionSet.AssignProperties_From_ApiVersionSetContractDetails(source.ApiVersionSet)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ApiVersionSetContractDetails() to populate field ApiVersionSet")
		}
		api.ApiVersionSet = &apiVersionSet
	} else {
		api.ApiVersionSet = nil
	}

	// ApiVersionSetReference
	if source.ApiVersionSetReference != nil {
		apiVersionSetReference := source.ApiVersionSetReference.Copy()
		api.ApiVersionSetReference = &apiVersionSetReference
	} else {
		api.ApiVersionSetReference = nil
	}

	// AuthenticationSettings
	if source.AuthenticationSettings != nil {
		var authenticationSetting AuthenticationSettingsContract
		err := authenticationSetting.AssignProperties_From_AuthenticationSettingsContract(source.AuthenticationSettings)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AuthenticationSettingsContract() to populate field AuthenticationSettings")
		}
		api.AuthenticationSettings = &authenticationSetting
	} else {
		api.AuthenticationSettings = nil
	}

	// AzureName
	api.AzureName = source.AzureName

	// Contact
	if source.Contact != nil {
		var contact ApiContactInformation
		err := contact.AssignProperties_From_ApiContactInformation(source.Contact)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ApiContactInformation() to populate field Contact")
		}
		api.Contact = &contact
	} else {
		api.Contact = nil
	}

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

	// DisplayName
	api.DisplayName = genruntime.ClonePointerToString(source.DisplayName)

	// Format
	if source.Format != nil {
		format := *source.Format
		formatTemp := genruntime.ToEnum(format, apiCreateOrUpdateProperties_Format_Values)
		api.Format = &formatTemp
	} else {
		api.Format = nil
	}

	// IsCurrent
	if source.IsCurrent != nil {
		isCurrent := *source.IsCurrent
		api.IsCurrent = &isCurrent
	} else {
		api.IsCurrent = nil
	}

	// License
	if source.License != nil {
		var license ApiLicenseInformation
		err := license.AssignProperties_From_ApiLicenseInformation(source.License)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ApiLicenseInformation() to populate field License")
		}
		api.License = &license
	} else {
		api.License = nil
	}

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

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

	// Path
	api.Path = genruntime.ClonePointerToString(source.Path)

	// Protocols
	if source.Protocols != nil {
		protocolList := make([]ApiCreateOrUpdateProperties_Protocols, len(source.Protocols))
		for protocolIndex, protocolItem := range source.Protocols {
			protocolList[protocolIndex] = genruntime.ToEnum(protocolItem, apiCreateOrUpdateProperties_Protocols_Values)
		}
		api.Protocols = protocolList
	} else {
		api.Protocols = nil
	}

	// ServiceUrl
	api.ServiceUrl = genruntime.ClonePointerToString(source.ServiceUrl)

	// SourceApiReference
	if source.SourceApiReference != nil {
		sourceApiReference := source.SourceApiReference.Copy()
		api.SourceApiReference = &sourceApiReference
	} else {
		api.SourceApiReference = nil
	}

	// SubscriptionKeyParameterNames
	if source.SubscriptionKeyParameterNames != nil {
		var subscriptionKeyParameterName SubscriptionKeyParameterNamesContract
		err := subscriptionKeyParameterName.AssignProperties_From_SubscriptionKeyParameterNamesContract(source.SubscriptionKeyParameterNames)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubscriptionKeyParameterNamesContract() to populate field SubscriptionKeyParameterNames")
		}
		api.SubscriptionKeyParameterNames = &subscriptionKeyParameterName
	} else {
		api.SubscriptionKeyParameterNames = nil
	}

	// SubscriptionRequired
	if source.SubscriptionRequired != nil {
		subscriptionRequired := *source.SubscriptionRequired
		api.SubscriptionRequired = &subscriptionRequired
	} else {
		api.SubscriptionRequired = nil
	}

	// TermsOfServiceUrl
	api.TermsOfServiceUrl = genruntime.ClonePointerToString(source.TermsOfServiceUrl)

	// TranslateRequiredQueryParameters
	if source.TranslateRequiredQueryParameters != nil {
		translateRequiredQueryParameter := *source.TranslateRequiredQueryParameters
		translateRequiredQueryParameterTemp := genruntime.ToEnum(translateRequiredQueryParameter, apiCreateOrUpdateProperties_TranslateRequiredQueryParameters_Values)
		api.TranslateRequiredQueryParameters = &translateRequiredQueryParameterTemp
	} else {
		api.TranslateRequiredQueryParameters = nil
	}

	// Type
	if source.Type != nil {
		typeVar := *source.Type
		typeTemp := genruntime.ToEnum(typeVar, apiCreateOrUpdateProperties_Type_Values)
		api.Type = &typeTemp
	} else {
		api.Type = nil
	}

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

	// WsdlSelector
	if source.WsdlSelector != nil {
		var wsdlSelector ApiCreateOrUpdateProperties_WsdlSelector
		err := wsdlSelector.AssignProperties_From_ApiCreateOrUpdateProperties_WsdlSelector(source.WsdlSelector)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ApiCreateOrUpdateProperties_WsdlSelector() to populate field WsdlSelector")
		}
		api.WsdlSelector = &wsdlSelector
	} else {
		api.WsdlSelector = nil
	}

	// No error
	return nil
}

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

	// APIVersion
	destination.APIVersion = genruntime.ClonePointerToString(api.APIVersion)

	// ApiRevision
	destination.ApiRevision = genruntime.ClonePointerToString(api.ApiRevision)

	// ApiRevisionDescription
	destination.ApiRevisionDescription = genruntime.ClonePointerToString(api.ApiRevisionDescription)

	// ApiType
	if api.ApiType != nil {
		apiType := string(*api.ApiType)
		destination.ApiType = &apiType
	} else {
		destination.ApiType = nil
	}

	// ApiVersionDescription
	destination.ApiVersionDescription = genruntime.ClonePointerToString(api.ApiVersionDescription)

	// ApiVersionSet
	if api.ApiVersionSet != nil {
		var apiVersionSet storage.ApiVersionSetContractDetails
		err := api.ApiVersionSet.AssignProperties_To_ApiVersionSetContractDetails(&apiVersionSet)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ApiVersionSetContractDetails() to populate field ApiVersionSet")
		}
		destination.ApiVersionSet = &apiVersionSet
	} else {
		destination.ApiVersionSet = nil
	}

	// ApiVersionSetReference
	if api.ApiVersionSetReference != nil {
		apiVersionSetReference := api.ApiVersionSetReference.Copy()
		destination.ApiVersionSetReference = &apiVersionSetReference
	} else {
		destination.ApiVersionSetReference = nil
	}

	// AuthenticationSettings
	if api.AuthenticationSettings != nil {
		var authenticationSetting storage.AuthenticationSettingsContract
		err := api.AuthenticationSettings.AssignProperties_To_AuthenticationSettingsContract(&authenticationSetting)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_AuthenticationSettingsContract() to populate field AuthenticationSettings")
		}
		destination.AuthenticationSettings = &authenticationSetting
	} else {
		destination.AuthenticationSettings = nil
	}

	// AzureName
	destination.AzureName = api.AzureName

	// Contact
	if api.Contact != nil {
		var contact storage.ApiContactInformation
		err := api.Contact.AssignProperties_To_ApiContactInformation(&contact)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ApiContactInformation() to populate field Contact")
		}
		destination.Contact = &contact
	} else {
		destination.Contact = nil
	}

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

	// DisplayName
	destination.DisplayName = genruntime.ClonePointerToString(api.DisplayName)

	// Format
	if api.Format != nil {
		format := string(*api.Format)
		destination.Format = &format
	} else {
		destination.Format = nil
	}

	// IsCurrent
	if api.IsCurrent != nil {
		isCurrent := *api.IsCurrent
		destination.IsCurrent = &isCurrent
	} else {
		destination.IsCurrent = nil
	}

	// License
	if api.License != nil {
		var license storage.ApiLicenseInformation
		err := api.License.AssignProperties_To_ApiLicenseInformation(&license)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ApiLicenseInformation() to populate field License")
		}
		destination.License = &license
	} else {
		destination.License = nil
	}

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

	// OriginalVersion
	destination.OriginalVersion = api.OriginalVersion()

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

	// Path
	destination.Path = genruntime.ClonePointerToString(api.Path)

	// Protocols
	if api.Protocols != nil {
		protocolList := make([]string, len(api.Protocols))
		for protocolIndex, protocolItem := range api.Protocols {
			protocolList[protocolIndex] = string(protocolItem)
		}
		destination.Protocols = protocolList
	} else {
		destination.Protocols = nil
	}

	// ServiceUrl
	destination.ServiceUrl = genruntime.ClonePointerToString(api.ServiceUrl)

	// SourceApiReference
	if api.SourceApiReference != nil {
		sourceApiReference := api.SourceApiReference.Copy()
		destination.SourceApiReference = &sourceApiReference
	} else {
		destination.SourceApiReference = nil
	}

	// SubscriptionKeyParameterNames
	if api.SubscriptionKeyParameterNames != nil {
		var subscriptionKeyParameterName storage.SubscriptionKeyParameterNamesContract
		err := api.SubscriptionKeyParameterNames.AssignProperties_To_SubscriptionKeyParameterNamesContract(&subscriptionKeyParameterName)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubscriptionKeyParameterNamesContract() to populate field SubscriptionKeyParameterNames")
		}
		destination.SubscriptionKeyParameterNames = &subscriptionKeyParameterName
	} else {
		destination.SubscriptionKeyParameterNames = nil
	}

	// SubscriptionRequired
	if api.SubscriptionRequired != nil {
		subscriptionRequired := *api.SubscriptionRequired
		destination.SubscriptionRequired = &subscriptionRequired
	} else {
		destination.SubscriptionRequired = nil
	}

	// TermsOfServiceUrl
	destination.TermsOfServiceUrl = genruntime.ClonePointerToString(api.TermsOfServiceUrl)

	// TranslateRequiredQueryParameters
	if api.TranslateRequiredQueryParameters != nil {
		translateRequiredQueryParameter := string(*api.TranslateRequiredQueryParameters)
		destination.TranslateRequiredQueryParameters = &translateRequiredQueryParameter
	} else {
		destination.TranslateRequiredQueryParameters = nil
	}

	// Type
	if api.Type != nil {
		typeVar := string(*api.Type)
		destination.Type = &typeVar
	} else {
		destination.Type = nil
	}

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

	// WsdlSelector
	if api.WsdlSelector != nil {
		var wsdlSelector storage.ApiCreateOrUpdateProperties_WsdlSelector
		err := api.WsdlSelector.AssignProperties_To_ApiCreateOrUpdateProperties_WsdlSelector(&wsdlSelector)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ApiCreateOrUpdateProperties_WsdlSelector() to populate field WsdlSelector")
		}
		destination.WsdlSelector = &wsdlSelector
	} else {
		destination.WsdlSelector = nil
	}

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

	// No error
	return nil
}

// Initialize_From_Api_STATUS populates our Api_Spec from the provided source Api_STATUS
func (api *Api_Spec) Initialize_From_Api_STATUS(source *Api_STATUS) error {

	// APIVersion
	api.APIVersion = genruntime.ClonePointerToString(source.APIVersion)

	// ApiRevision
	api.ApiRevision = genruntime.ClonePointerToString(source.ApiRevision)

	// ApiRevisionDescription
	api.ApiRevisionDescription = genruntime.ClonePointerToString(source.ApiRevisionDescription)

	// ApiVersionDescription
	api.ApiVersionDescription = genruntime.ClonePointerToString(source.ApiVersionDescription)

	// ApiVersionSet
	if source.ApiVersionSet != nil {
		var apiVersionSet ApiVersionSetContractDetails
		err := apiVersionSet.Initialize_From_ApiVersionSetContractDetails_STATUS(source.ApiVersionSet)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ApiVersionSetContractDetails_STATUS() to populate field ApiVersionSet")
		}
		api.ApiVersionSet = &apiVersionSet
	} else {
		api.ApiVersionSet = nil
	}

	// ApiVersionSetReference
	if source.ApiVersionSetId != nil {
		apiVersionSetReference := genruntime.CreateResourceReferenceFromARMID(*source.ApiVersionSetId)
		api.ApiVersionSetReference = &apiVersionSetReference
	} else {
		api.ApiVersionSetReference = nil
	}

	// AuthenticationSettings
	if source.AuthenticationSettings != nil {
		var authenticationSetting AuthenticationSettingsContract
		err := authenticationSetting.Initialize_From_AuthenticationSettingsContract_STATUS(source.AuthenticationSettings)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_AuthenticationSettingsContract_STATUS() to populate field AuthenticationSettings")
		}
		api.AuthenticationSettings = &authenticationSetting
	} else {
		api.AuthenticationSettings = nil
	}

	// Contact
	if source.Contact != nil {
		var contact ApiContactInformation
		err := contact.Initialize_From_ApiContactInformation_STATUS(source.Contact)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ApiContactInformation_STATUS() to populate field Contact")
		}
		api.Contact = &contact
	} else {
		api.Contact = nil
	}

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

	// DisplayName
	api.DisplayName = genruntime.ClonePointerToString(source.DisplayName)

	// IsCurrent
	if source.IsCurrent != nil {
		isCurrent := *source.IsCurrent
		api.IsCurrent = &isCurrent
	} else {
		api.IsCurrent = nil
	}

	// License
	if source.License != nil {
		var license ApiLicenseInformation
		err := license.Initialize_From_ApiLicenseInformation_STATUS(source.License)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ApiLicenseInformation_STATUS() to populate field License")
		}
		api.License = &license
	} else {
		api.License = nil
	}

	// Path
	api.Path = genruntime.ClonePointerToString(source.Path)

	// Protocols
	if source.Protocols != nil {
		protocolList := make([]ApiCreateOrUpdateProperties_Protocols, len(source.Protocols))
		for protocolIndex, protocolItem := range source.Protocols {
			protocol := genruntime.ToEnum(string(protocolItem), apiCreateOrUpdateProperties_Protocols_Values)
			protocolList[protocolIndex] = protocol
		}
		api.Protocols = protocolList
	} else {
		api.Protocols = nil
	}

	// ServiceUrl
	api.ServiceUrl = genruntime.ClonePointerToString(source.ServiceUrl)

	// SourceApiReference
	if source.SourceApiId != nil {
		sourceApiReference := genruntime.CreateResourceReferenceFromARMID(*source.SourceApiId)
		api.SourceApiReference = &sourceApiReference
	} else {
		api.SourceApiReference = nil
	}

	// SubscriptionKeyParameterNames
	if source.SubscriptionKeyParameterNames != nil {
		var subscriptionKeyParameterName SubscriptionKeyParameterNamesContract
		err := subscriptionKeyParameterName.Initialize_From_SubscriptionKeyParameterNamesContract_STATUS(source.SubscriptionKeyParameterNames)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_SubscriptionKeyParameterNamesContract_STATUS() to populate field SubscriptionKeyParameterNames")
		}
		api.SubscriptionKeyParameterNames = &subscriptionKeyParameterName
	} else {
		api.SubscriptionKeyParameterNames = nil
	}

	// SubscriptionRequired
	if source.SubscriptionRequired != nil {
		subscriptionRequired := *source.SubscriptionRequired
		api.SubscriptionRequired = &subscriptionRequired
	} else {
		api.SubscriptionRequired = nil
	}

	// TermsOfServiceUrl
	api.TermsOfServiceUrl = genruntime.ClonePointerToString(source.TermsOfServiceUrl)

	// Type
	if source.PropertiesType != nil {
		typeVar := genruntime.ToEnum(string(*source.PropertiesType), apiCreateOrUpdateProperties_Type_Values)
		api.Type = &typeVar
	} else {
		api.Type = nil
	}

	// No error
	return nil
}

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

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

type Api_STATUS struct {
	// APIVersion: Indicates the version identifier of the API if the API is versioned
	APIVersion *string `json:"apiVersion,omitempty"`

	// ApiRevision: Describes the revision of the API. If no value is provided, default revision 1 is created
	ApiRevision *string `json:"apiRevision,omitempty"`

	// ApiRevisionDescription: Description of the API Revision.
	ApiRevisionDescription *string `json:"apiRevisionDescription,omitempty"`

	// ApiVersionDescription: Description of the API Version.
	ApiVersionDescription *string `json:"apiVersionDescription,omitempty"`

	// ApiVersionSet: Version set details
	ApiVersionSet *ApiVersionSetContractDetails_STATUS `json:"apiVersionSet,omitempty"`

	// ApiVersionSetId: A resource identifier for the related ApiVersionSet.
	ApiVersionSetId *string `json:"apiVersionSetId,omitempty"`

	// AuthenticationSettings: Collection of authentication settings included into this API.
	AuthenticationSettings *AuthenticationSettingsContract_STATUS `json:"authenticationSettings,omitempty"`

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

	// Contact: Contact information for the API.
	Contact *ApiContactInformation_STATUS `json:"contact,omitempty"`

	// Description: Description of the API. May include HTML formatting tags.
	Description *string `json:"description,omitempty"`

	// DisplayName: API name. Must be 1 to 300 characters long.
	DisplayName *string `json:"displayName,omitempty"`

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

	// IsCurrent: Indicates if API revision is current api revision.
	IsCurrent *bool `json:"isCurrent,omitempty"`

	// IsOnline: Indicates if API revision is accessible via the gateway.
	IsOnline *bool `json:"isOnline,omitempty"`

	// License: License information for the API.
	License *ApiLicenseInformation_STATUS `json:"license,omitempty"`

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

	// Path: Relative URL uniquely identifying this API and all of its resource paths within the API Management service
	// instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public
	// URL for this API.
	Path *string `json:"path,omitempty"`

	// PropertiesType: Type of API.
	PropertiesType *ApiContractProperties_Type_STATUS `json:"properties_type,omitempty"`

	// Protocols: Describes on which protocols the operations in this API can be invoked.
	Protocols []ApiContractProperties_Protocols_STATUS `json:"protocols,omitempty"`

	// ProvisioningState: The provisioning state
	ProvisioningState *string `json:"provisioningState,omitempty"`

	// ServiceUrl: Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long.
	ServiceUrl *string `json:"serviceUrl,omitempty"`

	// SourceApiId: API identifier of the source API.
	SourceApiId *string `json:"sourceApiId,omitempty"`

	// SubscriptionKeyParameterNames: Protocols over which API is made available.
	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract_STATUS `json:"subscriptionKeyParameterNames,omitempty"`

	// SubscriptionRequired: Specifies whether an API or Product subscription is required for accessing the API.
	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`

	// TermsOfServiceUrl:  A URL to the Terms of Service for the API. MUST be in the format of a URL.
	TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"`

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

var _ genruntime.ConvertibleStatus = &Api_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.Api_STATUS{}
	err := api.AssignProperties_To_Api_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 = &Api_STATUS{}

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

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

	// Set property "APIVersion":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.APIVersion != nil {
			apiVersion := *typedInput.Properties.APIVersion
			api.APIVersion = &apiVersion
		}
	}

	// Set property "ApiRevision":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ApiRevision != nil {
			apiRevision := *typedInput.Properties.ApiRevision
			api.ApiRevision = &apiRevision
		}
	}

	// Set property "ApiRevisionDescription":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ApiRevisionDescription != nil {
			apiRevisionDescription := *typedInput.Properties.ApiRevisionDescription
			api.ApiRevisionDescription = &apiRevisionDescription
		}
	}

	// Set property "ApiVersionDescription":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ApiVersionDescription != nil {
			apiVersionDescription := *typedInput.Properties.ApiVersionDescription
			api.ApiVersionDescription = &apiVersionDescription
		}
	}

	// Set property "ApiVersionSet":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ApiVersionSet != nil {
			var apiVersionSet1 ApiVersionSetContractDetails_STATUS
			err := apiVersionSet1.PopulateFromARM(owner, *typedInput.Properties.ApiVersionSet)
			if err != nil {
				return err
			}
			apiVersionSet := apiVersionSet1
			api.ApiVersionSet = &apiVersionSet
		}
	}

	// Set property "ApiVersionSetId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ApiVersionSetId != nil {
			apiVersionSetId := *typedInput.Properties.ApiVersionSetId
			api.ApiVersionSetId = &apiVersionSetId
		}
	}

	// Set property "AuthenticationSettings":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AuthenticationSettings != nil {
			var authenticationSettings1 AuthenticationSettingsContract_STATUS
			err := authenticationSettings1.PopulateFromARM(owner, *typedInput.Properties.AuthenticationSettings)
			if err != nil {
				return err
			}
			authenticationSettings := authenticationSettings1
			api.AuthenticationSettings = &authenticationSettings
		}
	}

	// no assignment for property "Conditions"

	// Set property "Contact":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Contact != nil {
			var contact1 ApiContactInformation_STATUS
			err := contact1.PopulateFromARM(owner, *typedInput.Properties.Contact)
			if err != nil {
				return err
			}
			contact := contact1
			api.Contact = &contact
		}
	}

	// Set property "Description":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Description != nil {
			description := *typedInput.Properties.Description
			api.Description = &description
		}
	}

	// Set property "DisplayName":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DisplayName != nil {
			displayName := *typedInput.Properties.DisplayName
			api.DisplayName = &displayName
		}
	}

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

	// Set property "IsCurrent":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsCurrent != nil {
			isCurrent := *typedInput.Properties.IsCurrent
			api.IsCurrent = &isCurrent
		}
	}

	// Set property "IsOnline":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsOnline != nil {
			isOnline := *typedInput.Properties.IsOnline
			api.IsOnline = &isOnline
		}
	}

	// Set property "License":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.License != nil {
			var license1 ApiLicenseInformation_STATUS
			err := license1.PopulateFromARM(owner, *typedInput.Properties.License)
			if err != nil {
				return err
			}
			license := license1
			api.License = &license
		}
	}

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

	// Set property "Path":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Path != nil {
			path := *typedInput.Properties.Path
			api.Path = &path
		}
	}

	// Set property "PropertiesType":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Type != nil {
			var temp string
			temp = string(*typedInput.Properties.Type)
			propertiesType := ApiContractProperties_Type_STATUS(temp)
			api.PropertiesType = &propertiesType
		}
	}

	// Set property "Protocols":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.Protocols {
			var temp string
			temp = string(item)
			api.Protocols = append(api.Protocols, ApiContractProperties_Protocols_STATUS(temp))
		}
	}

	// Set property "ProvisioningState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProvisioningState != nil {
			provisioningState := *typedInput.Properties.ProvisioningState
			api.ProvisioningState = &provisioningState
		}
	}

	// Set property "ServiceUrl":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ServiceUrl != nil {
			serviceUrl := *typedInput.Properties.ServiceUrl
			api.ServiceUrl = &serviceUrl
		}
	}

	// Set property "SourceApiId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SourceApiId != nil {
			sourceApiId := *typedInput.Properties.SourceApiId
			api.SourceApiId = &sourceApiId
		}
	}

	// Set property "SubscriptionKeyParameterNames":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SubscriptionKeyParameterNames != nil {
			var subscriptionKeyParameterNames1 SubscriptionKeyParameterNamesContract_STATUS
			err := subscriptionKeyParameterNames1.PopulateFromARM(owner, *typedInput.Properties.SubscriptionKeyParameterNames)
			if err != nil {
				return err
			}
			subscriptionKeyParameterNames := subscriptionKeyParameterNames1
			api.SubscriptionKeyParameterNames = &subscriptionKeyParameterNames
		}
	}

	// Set property "SubscriptionRequired":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SubscriptionRequired != nil {
			subscriptionRequired := *typedInput.Properties.SubscriptionRequired
			api.SubscriptionRequired = &subscriptionRequired
		}
	}

	// Set property "TermsOfServiceUrl":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.TermsOfServiceUrl != nil {
			termsOfServiceUrl := *typedInput.Properties.TermsOfServiceUrl
			api.TermsOfServiceUrl = &termsOfServiceUrl
		}
	}

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

	// No error
	return nil
}

// AssignProperties_From_Api_STATUS populates our Api_STATUS from the provided source Api_STATUS
func (api *Api_STATUS) AssignProperties_From_Api_STATUS(source *storage.Api_STATUS) error {

	// APIVersion
	api.APIVersion = genruntime.ClonePointerToString(source.APIVersion)

	// ApiRevision
	api.ApiRevision = genruntime.ClonePointerToString(source.ApiRevision)

	// ApiRevisionDescription
	api.ApiRevisionDescription = genruntime.ClonePointerToString(source.ApiRevisionDescription)

	// ApiVersionDescription
	api.ApiVersionDescription = genruntime.ClonePointerToString(source.ApiVersionDescription)

	// ApiVersionSet
	if source.ApiVersionSet != nil {
		var apiVersionSet ApiVersionSetContractDetails_STATUS
		err := apiVersionSet.AssignProperties_From_ApiVersionSetContractDetails_STATUS(source.ApiVersionSet)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ApiVersionSetContractDetails_STATUS() to populate field ApiVersionSet")
		}
		api.ApiVersionSet = &apiVersionSet
	} else {
		api.ApiVersionSet = nil
	}

	// ApiVersionSetId
	api.ApiVersionSetId = genruntime.ClonePointerToString(source.ApiVersionSetId)

	// AuthenticationSettings
	if source.AuthenticationSettings != nil {
		var authenticationSetting AuthenticationSettingsContract_STATUS
		err := authenticationSetting.AssignProperties_From_AuthenticationSettingsContract_STATUS(source.AuthenticationSettings)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AuthenticationSettingsContract_STATUS() to populate field AuthenticationSettings")
		}
		api.AuthenticationSettings = &authenticationSetting
	} else {
		api.AuthenticationSettings = nil
	}

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

	// Contact
	if source.Contact != nil {
		var contact ApiContactInformation_STATUS
		err := contact.AssignProperties_From_ApiContactInformation_STATUS(source.Contact)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ApiContactInformation_STATUS() to populate field Contact")
		}
		api.Contact = &contact
	} else {
		api.Contact = nil
	}

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

	// DisplayName
	api.DisplayName = genruntime.ClonePointerToString(source.DisplayName)

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

	// IsCurrent
	if source.IsCurrent != nil {
		isCurrent := *source.IsCurrent
		api.IsCurrent = &isCurrent
	} else {
		api.IsCurrent = nil
	}

	// IsOnline
	if source.IsOnline != nil {
		isOnline := *source.IsOnline
		api.IsOnline = &isOnline
	} else {
		api.IsOnline = nil
	}

	// License
	if source.License != nil {
		var license ApiLicenseInformation_STATUS
		err := license.AssignProperties_From_ApiLicenseInformation_STATUS(source.License)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ApiLicenseInformation_STATUS() to populate field License")
		}
		api.License = &license
	} else {
		api.License = nil
	}

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

	// Path
	api.Path = genruntime.ClonePointerToString(source.Path)

	// PropertiesType
	if source.PropertiesType != nil {
		propertiesType := *source.PropertiesType
		propertiesTypeTemp := genruntime.ToEnum(propertiesType, apiContractProperties_Type_STATUS_Values)
		api.PropertiesType = &propertiesTypeTemp
	} else {
		api.PropertiesType = nil
	}

	// Protocols
	if source.Protocols != nil {
		protocolList := make([]ApiContractProperties_Protocols_STATUS, len(source.Protocols))
		for protocolIndex, protocolItem := range source.Protocols {
			protocolList[protocolIndex] = genruntime.ToEnum(protocolItem, apiContractProperties_Protocols_STATUS_Values)
		}
		api.Protocols = protocolList
	} else {
		api.Protocols = nil
	}

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

	// ServiceUrl
	api.ServiceUrl = genruntime.ClonePointerToString(source.ServiceUrl)

	// SourceApiId
	api.SourceApiId = genruntime.ClonePointerToString(source.SourceApiId)

	// SubscriptionKeyParameterNames
	if source.SubscriptionKeyParameterNames != nil {
		var subscriptionKeyParameterName SubscriptionKeyParameterNamesContract_STATUS
		err := subscriptionKeyParameterName.AssignProperties_From_SubscriptionKeyParameterNamesContract_STATUS(source.SubscriptionKeyParameterNames)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubscriptionKeyParameterNamesContract_STATUS() to populate field SubscriptionKeyParameterNames")
		}
		api.SubscriptionKeyParameterNames = &subscriptionKeyParameterName
	} else {
		api.SubscriptionKeyParameterNames = nil
	}

	// SubscriptionRequired
	if source.SubscriptionRequired != nil {
		subscriptionRequired := *source.SubscriptionRequired
		api.SubscriptionRequired = &subscriptionRequired
	} else {
		api.SubscriptionRequired = nil
	}

	// TermsOfServiceUrl
	api.TermsOfServiceUrl = genruntime.ClonePointerToString(source.TermsOfServiceUrl)

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

	// No error
	return nil
}

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

	// APIVersion
	destination.APIVersion = genruntime.ClonePointerToString(api.APIVersion)

	// ApiRevision
	destination.ApiRevision = genruntime.ClonePointerToString(api.ApiRevision)

	// ApiRevisionDescription
	destination.ApiRevisionDescription = genruntime.ClonePointerToString(api.ApiRevisionDescription)

	// ApiVersionDescription
	destination.ApiVersionDescription = genruntime.ClonePointerToString(api.ApiVersionDescription)

	// ApiVersionSet
	if api.ApiVersionSet != nil {
		var apiVersionSet storage.ApiVersionSetContractDetails_STATUS
		err := api.ApiVersionSet.AssignProperties_To_ApiVersionSetContractDetails_STATUS(&apiVersionSet)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ApiVersionSetContractDetails_STATUS() to populate field ApiVersionSet")
		}
		destination.ApiVersionSet = &apiVersionSet
	} else {
		destination.ApiVersionSet = nil
	}

	// ApiVersionSetId
	destination.ApiVersionSetId = genruntime.ClonePointerToString(api.ApiVersionSetId)

	// AuthenticationSettings
	if api.AuthenticationSettings != nil {
		var authenticationSetting storage.AuthenticationSettingsContract_STATUS
		err := api.AuthenticationSettings.AssignProperties_To_AuthenticationSettingsContract_STATUS(&authenticationSetting)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_AuthenticationSettingsContract_STATUS() to populate field AuthenticationSettings")
		}
		destination.AuthenticationSettings = &authenticationSetting
	} else {
		destination.AuthenticationSettings = nil
	}

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

	// Contact
	if api.Contact != nil {
		var contact storage.ApiContactInformation_STATUS
		err := api.Contact.AssignProperties_To_ApiContactInformation_STATUS(&contact)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ApiContactInformation_STATUS() to populate field Contact")
		}
		destination.Contact = &contact
	} else {
		destination.Contact = nil
	}

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

	// DisplayName
	destination.DisplayName = genruntime.ClonePointerToString(api.DisplayName)

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

	// IsCurrent
	if api.IsCurrent != nil {
		isCurrent := *api.IsCurrent
		destination.IsCurrent = &isCurrent
	} else {
		destination.IsCurrent = nil
	}

	// IsOnline
	if api.IsOnline != nil {
		isOnline := *api.IsOnline
		destination.IsOnline = &isOnline
	} else {
		destination.IsOnline = nil
	}

	// License
	if api.License != nil {
		var license storage.ApiLicenseInformation_STATUS
		err := api.License.AssignProperties_To_ApiLicenseInformation_STATUS(&license)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ApiLicenseInformation_STATUS() to populate field License")
		}
		destination.License = &license
	} else {
		destination.License = nil
	}

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

	// Path
	destination.Path = genruntime.ClonePointerToString(api.Path)

	// PropertiesType
	if api.PropertiesType != nil {
		propertiesType := string(*api.PropertiesType)
		destination.PropertiesType = &propertiesType
	} else {
		destination.PropertiesType = nil
	}

	// Protocols
	if api.Protocols != nil {
		protocolList := make([]string, len(api.Protocols))
		for protocolIndex, protocolItem := range api.Protocols {
			protocolList[protocolIndex] = string(protocolItem)
		}
		destination.Protocols = protocolList
	} else {
		destination.Protocols = nil
	}

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

	// ServiceUrl
	destination.ServiceUrl = genruntime.ClonePointerToString(api.ServiceUrl)

	// SourceApiId
	destination.SourceApiId = genruntime.ClonePointerToString(api.SourceApiId)

	// SubscriptionKeyParameterNames
	if api.SubscriptionKeyParameterNames != nil {
		var subscriptionKeyParameterName storage.SubscriptionKeyParameterNamesContract_STATUS
		err := api.SubscriptionKeyParameterNames.AssignProperties_To_SubscriptionKeyParameterNamesContract_STATUS(&subscriptionKeyParameterName)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubscriptionKeyParameterNamesContract_STATUS() to populate field SubscriptionKeyParameterNames")
		}
		destination.SubscriptionKeyParameterNames = &subscriptionKeyParameterName
	} else {
		destination.SubscriptionKeyParameterNames = nil
	}

	// SubscriptionRequired
	if api.SubscriptionRequired != nil {
		subscriptionRequired := *api.SubscriptionRequired
		destination.SubscriptionRequired = &subscriptionRequired
	} else {
		destination.SubscriptionRequired = nil
	}

	// TermsOfServiceUrl
	destination.TermsOfServiceUrl = genruntime.ClonePointerToString(api.TermsOfServiceUrl)

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

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"2024-05-01"}
type APIVersion string

const APIVersion_Value = APIVersion("2024-05-01")

// API contact information
type ApiContactInformation struct {
	// Email: The email address of the contact person/organization. MUST be in the format of an email address
	Email *string `json:"email,omitempty"`

	// Name: The identifying name of the contact person/organization
	Name *string `json:"name,omitempty"`

	// Url: The URL pointing to the contact information. MUST be in the format of a URL
	Url *string `json:"url,omitempty"`
}

var _ genruntime.ARMTransformer = &ApiContactInformation{}

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

	// Set property "Email":
	if information.Email != nil {
		email := *information.Email
		result.Email = &email
	}

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

	// Set property "Url":
	if information.Url != nil {
		url := *information.Url
		result.Url = &url
	}
	return result, nil
}

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

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

	// Set property "Email":
	if typedInput.Email != nil {
		email := *typedInput.Email
		information.Email = &email
	}

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

	// Set property "Url":
	if typedInput.Url != nil {
		url := *typedInput.Url
		information.Url = &url
	}

	// No error
	return nil
}

// AssignProperties_From_ApiContactInformation populates our ApiContactInformation from the provided source ApiContactInformation
func (information *ApiContactInformation) AssignProperties_From_ApiContactInformation(source *storage.ApiContactInformation) error {

	// Email
	information.Email = genruntime.ClonePointerToString(source.Email)

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

	// Url
	information.Url = genruntime.ClonePointerToString(source.Url)

	// No error
	return nil
}

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

	// Email
	destination.Email = genruntime.ClonePointerToString(information.Email)

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

	// Url
	destination.Url = genruntime.ClonePointerToString(information.Url)

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

	// No error
	return nil
}

// Initialize_From_ApiContactInformation_STATUS populates our ApiContactInformation from the provided source ApiContactInformation_STATUS
func (information *ApiContactInformation) Initialize_From_ApiContactInformation_STATUS(source *ApiContactInformation_STATUS) error {

	// Email
	information.Email = genruntime.ClonePointerToString(source.Email)

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

	// Url
	information.Url = genruntime.ClonePointerToString(source.Url)

	// No error
	return nil
}

// API contact information
type ApiContactInformation_STATUS struct {
	// Email: The email address of the contact person/organization. MUST be in the format of an email address
	Email *string `json:"email,omitempty"`

	// Name: The identifying name of the contact person/organization
	Name *string `json:"name,omitempty"`

	// Url: The URL pointing to the contact information. MUST be in the format of a URL
	Url *string `json:"url,omitempty"`
}

var _ genruntime.FromARMConverter = &ApiContactInformation_STATUS{}

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

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

	// Set property "Email":
	if typedInput.Email != nil {
		email := *typedInput.Email
		information.Email = &email
	}

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

	// Set property "Url":
	if typedInput.Url != nil {
		url := *typedInput.Url
		information.Url = &url
	}

	// No error
	return nil
}

// AssignProperties_From_ApiContactInformation_STATUS populates our ApiContactInformation_STATUS from the provided source ApiContactInformation_STATUS
func (information *ApiContactInformation_STATUS) AssignProperties_From_ApiContactInformation_STATUS(source *storage.ApiContactInformation_STATUS) error {

	// Email
	information.Email = genruntime.ClonePointerToString(source.Email)

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

	// Url
	information.Url = genruntime.ClonePointerToString(source.Url)

	// No error
	return nil
}

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

	// Email
	destination.Email = genruntime.ClonePointerToString(information.Email)

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

	// Url
	destination.Url = genruntime.ClonePointerToString(information.Url)

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

	// No error
	return nil
}

type ApiContractProperties_Protocols_STATUS string

const (
	ApiContractProperties_Protocols_STATUS_Http  = ApiContractProperties_Protocols_STATUS("http")
	ApiContractProperties_Protocols_STATUS_Https = ApiContractProperties_Protocols_STATUS("https")
	ApiContractProperties_Protocols_STATUS_Ws    = ApiContractProperties_Protocols_STATUS("ws")
	ApiContractProperties_Protocols_STATUS_Wss   = ApiContractProperties_Protocols_STATUS("wss")
)

// Mapping from string to ApiContractProperties_Protocols_STATUS
var apiContractProperties_Protocols_STATUS_Values = map[string]ApiContractProperties_Protocols_STATUS{
	"http":  ApiContractProperties_Protocols_STATUS_Http,
	"https": ApiContractProperties_Protocols_STATUS_Https,
	"ws":    ApiContractProperties_Protocols_STATUS_Ws,
	"wss":   ApiContractProperties_Protocols_STATUS_Wss,
}

type ApiContractProperties_Type_STATUS string

const (
	ApiContractProperties_Type_STATUS_Graphql   = ApiContractProperties_Type_STATUS("graphql")
	ApiContractProperties_Type_STATUS_Grpc      = ApiContractProperties_Type_STATUS("grpc")
	ApiContractProperties_Type_STATUS_Http      = ApiContractProperties_Type_STATUS("http")
	ApiContractProperties_Type_STATUS_Odata     = ApiContractProperties_Type_STATUS("odata")
	ApiContractProperties_Type_STATUS_Soap      = ApiContractProperties_Type_STATUS("soap")
	ApiContractProperties_Type_STATUS_Websocket = ApiContractProperties_Type_STATUS("websocket")
)

// Mapping from string to ApiContractProperties_Type_STATUS
var apiContractProperties_Type_STATUS_Values = map[string]ApiContractProperties_Type_STATUS{
	"graphql":   ApiContractProperties_Type_STATUS_Graphql,
	"grpc":      ApiContractProperties_Type_STATUS_Grpc,
	"http":      ApiContractProperties_Type_STATUS_Http,
	"odata":     ApiContractProperties_Type_STATUS_Odata,
	"soap":      ApiContractProperties_Type_STATUS_Soap,
	"websocket": ApiContractProperties_Type_STATUS_Websocket,
}

// +kubebuilder:validation:Enum={"graphql","grpc","http","odata","soap","websocket"}
type ApiCreateOrUpdateProperties_ApiType string

const (
	ApiCreateOrUpdateProperties_ApiType_Graphql   = ApiCreateOrUpdateProperties_ApiType("graphql")
	ApiCreateOrUpdateProperties_ApiType_Grpc      = ApiCreateOrUpdateProperties_ApiType("grpc")
	ApiCreateOrUpdateProperties_ApiType_Http      = ApiCreateOrUpdateProperties_ApiType("http")
	ApiCreateOrUpdateProperties_ApiType_Odata     = ApiCreateOrUpdateProperties_ApiType("odata")
	ApiCreateOrUpdateProperties_ApiType_Soap      = ApiCreateOrUpdateProperties_ApiType("soap")
	ApiCreateOrUpdateProperties_ApiType_Websocket = ApiCreateOrUpdateProperties_ApiType("websocket")
)

// Mapping from string to ApiCreateOrUpdateProperties_ApiType
var apiCreateOrUpdateProperties_ApiType_Values = map[string]ApiCreateOrUpdateProperties_ApiType{
	"graphql":   ApiCreateOrUpdateProperties_ApiType_Graphql,
	"grpc":      ApiCreateOrUpdateProperties_ApiType_Grpc,
	"http":      ApiCreateOrUpdateProperties_ApiType_Http,
	"odata":     ApiCreateOrUpdateProperties_ApiType_Odata,
	"soap":      ApiCreateOrUpdateProperties_ApiType_Soap,
	"websocket": ApiCreateOrUpdateProperties_ApiType_Websocket,
}

// +kubebuilder:validation:Enum={"graphql-link","grpc","grpc-link","odata","odata-link","openapi","openapi+json","openapi+json-link","openapi-link","swagger-json","swagger-link-json","wadl-link-json","wadl-xml","wsdl","wsdl-link"}
type ApiCreateOrUpdateProperties_Format string

const (
	ApiCreateOrUpdateProperties_Format_GraphqlLink     = ApiCreateOrUpdateProperties_Format("graphql-link")
	ApiCreateOrUpdateProperties_Format_Grpc            = ApiCreateOrUpdateProperties_Format("grpc")
	ApiCreateOrUpdateProperties_Format_GrpcLink        = ApiCreateOrUpdateProperties_Format("grpc-link")
	ApiCreateOrUpdateProperties_Format_Odata           = ApiCreateOrUpdateProperties_Format("odata")
	ApiCreateOrUpdateProperties_Format_OdataLink       = ApiCreateOrUpdateProperties_Format("odata-link")
	ApiCreateOrUpdateProperties_Format_Openapi         = ApiCreateOrUpdateProperties_Format("openapi")
	ApiCreateOrUpdateProperties_Format_OpenapiJson     = ApiCreateOrUpdateProperties_Format("openapi+json")
	ApiCreateOrUpdateProperties_Format_OpenapiJsonLink = ApiCreateOrUpdateProperties_Format("openapi+json-link")
	ApiCreateOrUpdateProperties_Format_OpenapiLink     = ApiCreateOrUpdateProperties_Format("openapi-link")
	ApiCreateOrUpdateProperties_Format_SwaggerJson     = ApiCreateOrUpdateProperties_Format("swagger-json")
	ApiCreateOrUpdateProperties_Format_SwaggerLinkJson = ApiCreateOrUpdateProperties_Format("swagger-link-json")
	ApiCreateOrUpdateProperties_Format_WadlLinkJson    = ApiCreateOrUpdateProperties_Format("wadl-link-json")
	ApiCreateOrUpdateProperties_Format_WadlXml         = ApiCreateOrUpdateProperties_Format("wadl-xml")
	ApiCreateOrUpdateProperties_Format_Wsdl            = ApiCreateOrUpdateProperties_Format("wsdl")
	ApiCreateOrUpdateProperties_Format_WsdlLink        = ApiCreateOrUpdateProperties_Format("wsdl-link")
)

// Mapping from string to ApiCreateOrUpdateProperties_Format
var apiCreateOrUpdateProperties_Format_Values = map[string]ApiCreateOrUpdateProperties_Format{
	"graphql-link":      ApiCreateOrUpdateProperties_Format_GraphqlLink,
	"grpc":              ApiCreateOrUpdateProperties_Format_Grpc,
	"grpc-link":         ApiCreateOrUpdateProperties_Format_GrpcLink,
	"odata":             ApiCreateOrUpdateProperties_Format_Odata,
	"odata-link":        ApiCreateOrUpdateProperties_Format_OdataLink,
	"openapi":           ApiCreateOrUpdateProperties_Format_Openapi,
	"openapi+json":      ApiCreateOrUpdateProperties_Format_OpenapiJson,
	"openapi+json-link": ApiCreateOrUpdateProperties_Format_OpenapiJsonLink,
	"openapi-link":      ApiCreateOrUpdateProperties_Format_OpenapiLink,
	"swagger-json":      ApiCreateOrUpdateProperties_Format_SwaggerJson,
	"swagger-link-json": ApiCreateOrUpdateProperties_Format_SwaggerLinkJson,
	"wadl-link-json":    ApiCreateOrUpdateProperties_Format_WadlLinkJson,
	"wadl-xml":          ApiCreateOrUpdateProperties_Format_WadlXml,
	"wsdl":              ApiCreateOrUpdateProperties_Format_Wsdl,
	"wsdl-link":         ApiCreateOrUpdateProperties_Format_WsdlLink,
}

// +kubebuilder:validation:Enum={"http","https","ws","wss"}
type ApiCreateOrUpdateProperties_Protocols string

const (
	ApiCreateOrUpdateProperties_Protocols_Http  = ApiCreateOrUpdateProperties_Protocols("http")
	ApiCreateOrUpdateProperties_Protocols_Https = ApiCreateOrUpdateProperties_Protocols("https")
	ApiCreateOrUpdateProperties_Protocols_Ws    = ApiCreateOrUpdateProperties_Protocols("ws")
	ApiCreateOrUpdateProperties_Protocols_Wss   = ApiCreateOrUpdateProperties_Protocols("wss")
)

// Mapping from string to ApiCreateOrUpdateProperties_Protocols
var apiCreateOrUpdateProperties_Protocols_Values = map[string]ApiCreateOrUpdateProperties_Protocols{
	"http":  ApiCreateOrUpdateProperties_Protocols_Http,
	"https": ApiCreateOrUpdateProperties_Protocols_Https,
	"ws":    ApiCreateOrUpdateProperties_Protocols_Ws,
	"wss":   ApiCreateOrUpdateProperties_Protocols_Wss,
}

// +kubebuilder:validation:Enum={"query","template"}
type ApiCreateOrUpdateProperties_TranslateRequiredQueryParameters string

const (
	ApiCreateOrUpdateProperties_TranslateRequiredQueryParameters_Query    = ApiCreateOrUpdateProperties_TranslateRequiredQueryParameters("query")
	ApiCreateOrUpdateProperties_TranslateRequiredQueryParameters_Template = ApiCreateOrUpdateProperties_TranslateRequiredQueryParameters("template")
)

// Mapping from string to ApiCreateOrUpdateProperties_TranslateRequiredQueryParameters
var apiCreateOrUpdateProperties_TranslateRequiredQueryParameters_Values = map[string]ApiCreateOrUpdateProperties_TranslateRequiredQueryParameters{
	"query":    ApiCreateOrUpdateProperties_TranslateRequiredQueryParameters_Query,
	"template": ApiCreateOrUpdateProperties_TranslateRequiredQueryParameters_Template,
}

// +kubebuilder:validation:Enum={"graphql","grpc","http","odata","soap","websocket"}
type ApiCreateOrUpdateProperties_Type string

const (
	ApiCreateOrUpdateProperties_Type_Graphql   = ApiCreateOrUpdateProperties_Type("graphql")
	ApiCreateOrUpdateProperties_Type_Grpc      = ApiCreateOrUpdateProperties_Type("grpc")
	ApiCreateOrUpdateProperties_Type_Http      = ApiCreateOrUpdateProperties_Type("http")
	ApiCreateOrUpdateProperties_Type_Odata     = ApiCreateOrUpdateProperties_Type("odata")
	ApiCreateOrUpdateProperties_Type_Soap      = ApiCreateOrUpdateProperties_Type("soap")
	ApiCreateOrUpdateProperties_Type_Websocket = ApiCreateOrUpdateProperties_Type("websocket")
)

// Mapping from string to ApiCreateOrUpdateProperties_Type
var apiCreateOrUpdateProperties_Type_Values = map[string]ApiCreateOrUpdateProperties_Type{
	"graphql":   ApiCreateOrUpdateProperties_Type_Graphql,
	"grpc":      ApiCreateOrUpdateProperties_Type_Grpc,
	"http":      ApiCreateOrUpdateProperties_Type_Http,
	"odata":     ApiCreateOrUpdateProperties_Type_Odata,
	"soap":      ApiCreateOrUpdateProperties_Type_Soap,
	"websocket": ApiCreateOrUpdateProperties_Type_Websocket,
}

type ApiCreateOrUpdateProperties_WsdlSelector struct {
	// WsdlEndpointName: Name of endpoint(port) to import from WSDL
	WsdlEndpointName *string `json:"wsdlEndpointName,omitempty"`

	// WsdlServiceName: Name of service to import from WSDL
	WsdlServiceName *string `json:"wsdlServiceName,omitempty"`
}

var _ genruntime.ARMTransformer = &ApiCreateOrUpdateProperties_WsdlSelector{}

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

	// Set property "WsdlEndpointName":
	if selector.WsdlEndpointName != nil {
		wsdlEndpointName := *selector.WsdlEndpointName
		result.WsdlEndpointName = &wsdlEndpointName
	}

	// Set property "WsdlServiceName":
	if selector.WsdlServiceName != nil {
		wsdlServiceName := *selector.WsdlServiceName
		result.WsdlServiceName = &wsdlServiceName
	}
	return result, nil
}

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

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

	// Set property "WsdlEndpointName":
	if typedInput.WsdlEndpointName != nil {
		wsdlEndpointName := *typedInput.WsdlEndpointName
		selector.WsdlEndpointName = &wsdlEndpointName
	}

	// Set property "WsdlServiceName":
	if typedInput.WsdlServiceName != nil {
		wsdlServiceName := *typedInput.WsdlServiceName
		selector.WsdlServiceName = &wsdlServiceName
	}

	// No error
	return nil
}

// AssignProperties_From_ApiCreateOrUpdateProperties_WsdlSelector populates our ApiCreateOrUpdateProperties_WsdlSelector from the provided source ApiCreateOrUpdateProperties_WsdlSelector
func (selector *ApiCreateOrUpdateProperties_WsdlSelector) AssignProperties_From_ApiCreateOrUpdateProperties_WsdlSelector(source *storage.ApiCreateOrUpdateProperties_WsdlSelector) error {

	// WsdlEndpointName
	selector.WsdlEndpointName = genruntime.ClonePointerToString(source.WsdlEndpointName)

	// WsdlServiceName
	selector.WsdlServiceName = genruntime.ClonePointerToString(source.WsdlServiceName)

	// No error
	return nil
}

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

	// WsdlEndpointName
	destination.WsdlEndpointName = genruntime.ClonePointerToString(selector.WsdlEndpointName)

	// WsdlServiceName
	destination.WsdlServiceName = genruntime.ClonePointerToString(selector.WsdlServiceName)

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

	// No error
	return nil
}

// API license information
type ApiLicenseInformation struct {
	// Name: The license name used for the API
	Name *string `json:"name,omitempty"`

	// Url: A URL to the license used for the API. MUST be in the format of a URL
	Url *string `json:"url,omitempty"`
}

var _ genruntime.ARMTransformer = &ApiLicenseInformation{}

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

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

	// Set property "Url":
	if information.Url != nil {
		url := *information.Url
		result.Url = &url
	}
	return result, nil
}

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

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

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

	// Set property "Url":
	if typedInput.Url != nil {
		url := *typedInput.Url
		information.Url = &url
	}

	// No error
	return nil
}

// AssignProperties_From_ApiLicenseInformation populates our ApiLicenseInformation from the provided source ApiLicenseInformation
func (information *ApiLicenseInformation) AssignProperties_From_ApiLicenseInformation(source *storage.ApiLicenseInformation) error {

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

	// Url
	information.Url = genruntime.ClonePointerToString(source.Url)

	// No error
	return nil
}

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

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

	// Url
	destination.Url = genruntime.ClonePointerToString(information.Url)

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

	// No error
	return nil
}

// Initialize_From_ApiLicenseInformation_STATUS populates our ApiLicenseInformation from the provided source ApiLicenseInformation_STATUS
func (information *ApiLicenseInformation) Initialize_From_ApiLicenseInformation_STATUS(source *ApiLicenseInformation_STATUS) error {

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

	// Url
	information.Url = genruntime.ClonePointerToString(source.Url)

	// No error
	return nil
}

// API license information
type ApiLicenseInformation_STATUS struct {
	// Name: The license name used for the API
	Name *string `json:"name,omitempty"`

	// Url: A URL to the license used for the API. MUST be in the format of a URL
	Url *string `json:"url,omitempty"`
}

var _ genruntime.FromARMConverter = &ApiLicenseInformation_STATUS{}

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

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

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

	// Set property "Url":
	if typedInput.Url != nil {
		url := *typedInput.Url
		information.Url = &url
	}

	// No error
	return nil
}

// AssignProperties_From_ApiLicenseInformation_STATUS populates our ApiLicenseInformation_STATUS from the provided source ApiLicenseInformation_STATUS
func (information *ApiLicenseInformation_STATUS) AssignProperties_From_ApiLicenseInformation_STATUS(source *storage.ApiLicenseInformation_STATUS) error {

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

	// Url
	information.Url = genruntime.ClonePointerToString(source.Url)

	// No error
	return nil
}

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

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

	// Url
	destination.Url = genruntime.ClonePointerToString(information.Url)

	// 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 ApiOperatorSpec 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_ApiOperatorSpec populates our ApiOperatorSpec from the provided source ApiOperatorSpec
func (operator *ApiOperatorSpec) AssignProperties_From_ApiOperatorSpec(source *storage.ApiOperatorSpec) 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_ApiOperatorSpec populates the provided destination ApiOperatorSpec from our ApiOperatorSpec
func (operator *ApiOperatorSpec) AssignProperties_To_ApiOperatorSpec(destination *storage.ApiOperatorSpec) 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
}

// An API Version Set contains the common configuration for a set of API Versions relating
type ApiVersionSetContractDetails struct {
	// Description: Description of API Version Set.
	Description *string `json:"description,omitempty"`

	// Name: The display Name of the API Version Set.
	Name *string `json:"name,omitempty"`

	// Reference: Identifier for existing API Version Set. Omit this value to create a new Version Set.
	Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"`

	// VersionHeaderName: Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.
	VersionHeaderName *string `json:"versionHeaderName,omitempty"`

	// VersionQueryName: Name of query parameter that indicates the API Version if versioningScheme is set to `query`.
	VersionQueryName *string `json:"versionQueryName,omitempty"`

	// VersioningScheme: An value that determines where the API Version identifier will be located in a HTTP request.
	VersioningScheme *ApiVersionSetContractDetails_VersioningScheme `json:"versioningScheme,omitempty"`
}

var _ genruntime.ARMTransformer = &ApiVersionSetContractDetails{}

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

	// Set property "Description":
	if details.Description != nil {
		description := *details.Description
		result.Description = &description
	}

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

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

	// Set property "VersionHeaderName":
	if details.VersionHeaderName != nil {
		versionHeaderName := *details.VersionHeaderName
		result.VersionHeaderName = &versionHeaderName
	}

	// Set property "VersionQueryName":
	if details.VersionQueryName != nil {
		versionQueryName := *details.VersionQueryName
		result.VersionQueryName = &versionQueryName
	}

	// Set property "VersioningScheme":
	if details.VersioningScheme != nil {
		var temp string
		temp = string(*details.VersioningScheme)
		versioningScheme := arm.ApiVersionSetContractDetails_VersioningScheme(temp)
		result.VersioningScheme = &versioningScheme
	}
	return result, nil
}

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

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

	// Set property "Description":
	if typedInput.Description != nil {
		description := *typedInput.Description
		details.Description = &description
	}

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

	// no assignment for property "Reference"

	// Set property "VersionHeaderName":
	if typedInput.VersionHeaderName != nil {
		versionHeaderName := *typedInput.VersionHeaderName
		details.VersionHeaderName = &versionHeaderName
	}

	// Set property "VersionQueryName":
	if typedInput.VersionQueryName != nil {
		versionQueryName := *typedInput.VersionQueryName
		details.VersionQueryName = &versionQueryName
	}

	// Set property "VersioningScheme":
	if typedInput.VersioningScheme != nil {
		var temp string
		temp = string(*typedInput.VersioningScheme)
		versioningScheme := ApiVersionSetContractDetails_VersioningScheme(temp)
		details.VersioningScheme = &versioningScheme
	}

	// No error
	return nil
}

// AssignProperties_From_ApiVersionSetContractDetails populates our ApiVersionSetContractDetails from the provided source ApiVersionSetContractDetails
func (details *ApiVersionSetContractDetails) AssignProperties_From_ApiVersionSetContractDetails(source *storage.ApiVersionSetContractDetails) error {

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

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

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

	// VersionHeaderName
	details.VersionHeaderName = genruntime.ClonePointerToString(source.VersionHeaderName)

	// VersionQueryName
	details.VersionQueryName = genruntime.ClonePointerToString(source.VersionQueryName)

	// VersioningScheme
	if source.VersioningScheme != nil {
		versioningScheme := *source.VersioningScheme
		versioningSchemeTemp := genruntime.ToEnum(versioningScheme, apiVersionSetContractDetails_VersioningScheme_Values)
		details.VersioningScheme = &versioningSchemeTemp
	} else {
		details.VersioningScheme = nil
	}

	// No error
	return nil
}

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

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

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

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

	// VersionHeaderName
	destination.VersionHeaderName = genruntime.ClonePointerToString(details.VersionHeaderName)

	// VersionQueryName
	destination.VersionQueryName = genruntime.ClonePointerToString(details.VersionQueryName)

	// VersioningScheme
	if details.VersioningScheme != nil {
		versioningScheme := string(*details.VersioningScheme)
		destination.VersioningScheme = &versioningScheme
	} else {
		destination.VersioningScheme = nil
	}

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

	// No error
	return nil
}

// Initialize_From_ApiVersionSetContractDetails_STATUS populates our ApiVersionSetContractDetails from the provided source ApiVersionSetContractDetails_STATUS
func (details *ApiVersionSetContractDetails) Initialize_From_ApiVersionSetContractDetails_STATUS(source *ApiVersionSetContractDetails_STATUS) error {

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

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

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

	// VersionHeaderName
	details.VersionHeaderName = genruntime.ClonePointerToString(source.VersionHeaderName)

	// VersionQueryName
	details.VersionQueryName = genruntime.ClonePointerToString(source.VersionQueryName)

	// VersioningScheme
	if source.VersioningScheme != nil {
		versioningScheme := genruntime.ToEnum(string(*source.VersioningScheme), apiVersionSetContractDetails_VersioningScheme_Values)
		details.VersioningScheme = &versioningScheme
	} else {
		details.VersioningScheme = nil
	}

	// No error
	return nil
}

// An API Version Set contains the common configuration for a set of API Versions relating
type ApiVersionSetContractDetails_STATUS struct {
	// Description: Description of API Version Set.
	Description *string `json:"description,omitempty"`

	// Id: Identifier for existing API Version Set. Omit this value to create a new Version Set.
	Id *string `json:"id,omitempty"`

	// Name: The display Name of the API Version Set.
	Name *string `json:"name,omitempty"`

	// VersionHeaderName: Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.
	VersionHeaderName *string `json:"versionHeaderName,omitempty"`

	// VersionQueryName: Name of query parameter that indicates the API Version if versioningScheme is set to `query`.
	VersionQueryName *string `json:"versionQueryName,omitempty"`

	// VersioningScheme: An value that determines where the API Version identifier will be located in a HTTP request.
	VersioningScheme *ApiVersionSetContractDetails_VersioningScheme_STATUS `json:"versioningScheme,omitempty"`
}

var _ genruntime.FromARMConverter = &ApiVersionSetContractDetails_STATUS{}

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

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

	// Set property "Description":
	if typedInput.Description != nil {
		description := *typedInput.Description
		details.Description = &description
	}

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

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

	// Set property "VersionHeaderName":
	if typedInput.VersionHeaderName != nil {
		versionHeaderName := *typedInput.VersionHeaderName
		details.VersionHeaderName = &versionHeaderName
	}

	// Set property "VersionQueryName":
	if typedInput.VersionQueryName != nil {
		versionQueryName := *typedInput.VersionQueryName
		details.VersionQueryName = &versionQueryName
	}

	// Set property "VersioningScheme":
	if typedInput.VersioningScheme != nil {
		var temp string
		temp = string(*typedInput.VersioningScheme)
		versioningScheme := ApiVersionSetContractDetails_VersioningScheme_STATUS(temp)
		details.VersioningScheme = &versioningScheme
	}

	// No error
	return nil
}

// AssignProperties_From_ApiVersionSetContractDetails_STATUS populates our ApiVersionSetContractDetails_STATUS from the provided source ApiVersionSetContractDetails_STATUS
func (details *ApiVersionSetContractDetails_STATUS) AssignProperties_From_ApiVersionSetContractDetails_STATUS(source *storage.ApiVersionSetContractDetails_STATUS) error {

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

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

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

	// VersionHeaderName
	details.VersionHeaderName = genruntime.ClonePointerToString(source.VersionHeaderName)

	// VersionQueryName
	details.VersionQueryName = genruntime.ClonePointerToString(source.VersionQueryName)

	// VersioningScheme
	if source.VersioningScheme != nil {
		versioningScheme := *source.VersioningScheme
		versioningSchemeTemp := genruntime.ToEnum(versioningScheme, apiVersionSetContractDetails_VersioningScheme_STATUS_Values)
		details.VersioningScheme = &versioningSchemeTemp
	} else {
		details.VersioningScheme = nil
	}

	// No error
	return nil
}

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

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

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

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

	// VersionHeaderName
	destination.VersionHeaderName = genruntime.ClonePointerToString(details.VersionHeaderName)

	// VersionQueryName
	destination.VersionQueryName = genruntime.ClonePointerToString(details.VersionQueryName)

	// VersioningScheme
	if details.VersioningScheme != nil {
		versioningScheme := string(*details.VersioningScheme)
		destination.VersioningScheme = &versioningScheme
	} else {
		destination.VersioningScheme = nil
	}

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

	// No error
	return nil
}

// API Authentication Settings.
type AuthenticationSettingsContract struct {
	// OAuth2: OAuth2 Authentication settings
	OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"`

	// OAuth2AuthenticationSettings: Collection of OAuth2 authentication settings included into this API.
	OAuth2AuthenticationSettings []OAuth2AuthenticationSettingsContract `json:"oAuth2AuthenticationSettings,omitempty"`

	// Openid: OpenID Connect Authentication Settings
	Openid *OpenIdAuthenticationSettingsContract `json:"openid,omitempty"`

	// OpenidAuthenticationSettings: Collection of Open ID Connect authentication settings included into this API.
	OpenidAuthenticationSettings []OpenIdAuthenticationSettingsContract `json:"openidAuthenticationSettings,omitempty"`
}

var _ genruntime.ARMTransformer = &AuthenticationSettingsContract{}

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

	// Set property "OAuth2":
	if contract.OAuth2 != nil {
		oAuth2_ARM, err := contract.OAuth2.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		oAuth2 := *oAuth2_ARM.(*arm.OAuth2AuthenticationSettingsContract)
		result.OAuth2 = &oAuth2
	}

	// Set property "OAuth2AuthenticationSettings":
	for _, item := range contract.OAuth2AuthenticationSettings {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.OAuth2AuthenticationSettings = append(result.OAuth2AuthenticationSettings, *item_ARM.(*arm.OAuth2AuthenticationSettingsContract))
	}

	// Set property "Openid":
	if contract.Openid != nil {
		openid_ARM, err := contract.Openid.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		openid := *openid_ARM.(*arm.OpenIdAuthenticationSettingsContract)
		result.Openid = &openid
	}

	// Set property "OpenidAuthenticationSettings":
	for _, item := range contract.OpenidAuthenticationSettings {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.OpenidAuthenticationSettings = append(result.OpenidAuthenticationSettings, *item_ARM.(*arm.OpenIdAuthenticationSettingsContract))
	}
	return result, nil
}

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

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

	// Set property "OAuth2":
	if typedInput.OAuth2 != nil {
		var oAuth OAuth2AuthenticationSettingsContract
		err := oAuth.PopulateFromARM(owner, *typedInput.OAuth2)
		if err != nil {
			return err
		}
		oAuth2 := oAuth
		contract.OAuth2 = &oAuth2
	}

	// Set property "OAuth2AuthenticationSettings":
	for _, item := range typedInput.OAuth2AuthenticationSettings {
		var item1 OAuth2AuthenticationSettingsContract
		err := item1.PopulateFromARM(owner, item)
		if err != nil {
			return err
		}
		contract.OAuth2AuthenticationSettings = append(contract.OAuth2AuthenticationSettings, item1)
	}

	// Set property "Openid":
	if typedInput.Openid != nil {
		var openid1 OpenIdAuthenticationSettingsContract
		err := openid1.PopulateFromARM(owner, *typedInput.Openid)
		if err != nil {
			return err
		}
		openid := openid1
		contract.Openid = &openid
	}

	// Set property "OpenidAuthenticationSettings":
	for _, item := range typedInput.OpenidAuthenticationSettings {
		var item1 OpenIdAuthenticationSettingsContract
		err := item1.PopulateFromARM(owner, item)
		if err != nil {
			return err
		}
		contract.OpenidAuthenticationSettings = append(contract.OpenidAuthenticationSettings, item1)
	}

	// No error
	return nil
}

// AssignProperties_From_AuthenticationSettingsContract populates our AuthenticationSettingsContract from the provided source AuthenticationSettingsContract
func (contract *AuthenticationSettingsContract) AssignProperties_From_AuthenticationSettingsContract(source *storage.AuthenticationSettingsContract) error {

	// OAuth2
	if source.OAuth2 != nil {
		var oAuth2 OAuth2AuthenticationSettingsContract
		err := oAuth2.AssignProperties_From_OAuth2AuthenticationSettingsContract(source.OAuth2)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_OAuth2AuthenticationSettingsContract() to populate field OAuth2")
		}
		contract.OAuth2 = &oAuth2
	} else {
		contract.OAuth2 = nil
	}

	// OAuth2AuthenticationSettings
	if source.OAuth2AuthenticationSettings != nil {
		oAuth2AuthenticationSettingList := make([]OAuth2AuthenticationSettingsContract, len(source.OAuth2AuthenticationSettings))
		for oAuth2AuthenticationSettingIndex, oAuth2AuthenticationSettingItem := range source.OAuth2AuthenticationSettings {
			var oAuth2AuthenticationSetting OAuth2AuthenticationSettingsContract
			err := oAuth2AuthenticationSetting.AssignProperties_From_OAuth2AuthenticationSettingsContract(&oAuth2AuthenticationSettingItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_OAuth2AuthenticationSettingsContract() to populate field OAuth2AuthenticationSettings")
			}
			oAuth2AuthenticationSettingList[oAuth2AuthenticationSettingIndex] = oAuth2AuthenticationSetting
		}
		contract.OAuth2AuthenticationSettings = oAuth2AuthenticationSettingList
	} else {
		contract.OAuth2AuthenticationSettings = nil
	}

	// Openid
	if source.Openid != nil {
		var openid OpenIdAuthenticationSettingsContract
		err := openid.AssignProperties_From_OpenIdAuthenticationSettingsContract(source.Openid)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_OpenIdAuthenticationSettingsContract() to populate field Openid")
		}
		contract.Openid = &openid
	} else {
		contract.Openid = nil
	}

	// OpenidAuthenticationSettings
	if source.OpenidAuthenticationSettings != nil {
		openidAuthenticationSettingList := make([]OpenIdAuthenticationSettingsContract, len(source.OpenidAuthenticationSettings))
		for openidAuthenticationSettingIndex, openidAuthenticationSettingItem := range source.OpenidAuthenticationSettings {
			var openidAuthenticationSetting OpenIdAuthenticationSettingsContract
			err := openidAuthenticationSetting.AssignProperties_From_OpenIdAuthenticationSettingsContract(&openidAuthenticationSettingItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_OpenIdAuthenticationSettingsContract() to populate field OpenidAuthenticationSettings")
			}
			openidAuthenticationSettingList[openidAuthenticationSettingIndex] = openidAuthenticationSetting
		}
		contract.OpenidAuthenticationSettings = openidAuthenticationSettingList
	} else {
		contract.OpenidAuthenticationSettings = nil
	}

	// No error
	return nil
}

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

	// OAuth2
	if contract.OAuth2 != nil {
		var oAuth2 storage.OAuth2AuthenticationSettingsContract
		err := contract.OAuth2.AssignProperties_To_OAuth2AuthenticationSettingsContract(&oAuth2)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_OAuth2AuthenticationSettingsContract() to populate field OAuth2")
		}
		destination.OAuth2 = &oAuth2
	} else {
		destination.OAuth2 = nil
	}

	// OAuth2AuthenticationSettings
	if contract.OAuth2AuthenticationSettings != nil {
		oAuth2AuthenticationSettingList := make([]storage.OAuth2AuthenticationSettingsContract, len(contract.OAuth2AuthenticationSettings))
		for oAuth2AuthenticationSettingIndex, oAuth2AuthenticationSettingItem := range contract.OAuth2AuthenticationSettings {
			var oAuth2AuthenticationSetting storage.OAuth2AuthenticationSettingsContract
			err := oAuth2AuthenticationSettingItem.AssignProperties_To_OAuth2AuthenticationSettingsContract(&oAuth2AuthenticationSetting)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_OAuth2AuthenticationSettingsContract() to populate field OAuth2AuthenticationSettings")
			}
			oAuth2AuthenticationSettingList[oAuth2AuthenticationSettingIndex] = oAuth2AuthenticationSetting
		}
		destination.OAuth2AuthenticationSettings = oAuth2AuthenticationSettingList
	} else {
		destination.OAuth2AuthenticationSettings = nil
	}

	// Openid
	if contract.Openid != nil {
		var openid storage.OpenIdAuthenticationSettingsContract
		err := contract.Openid.AssignProperties_To_OpenIdAuthenticationSettingsContract(&openid)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_OpenIdAuthenticationSettingsContract() to populate field Openid")
		}
		destination.Openid = &openid
	} else {
		destination.Openid = nil
	}

	// OpenidAuthenticationSettings
	if contract.OpenidAuthenticationSettings != nil {
		openidAuthenticationSettingList := make([]storage.OpenIdAuthenticationSettingsContract, len(contract.OpenidAuthenticationSettings))
		for openidAuthenticationSettingIndex, openidAuthenticationSettingItem := range contract.OpenidAuthenticationSettings {
			var openidAuthenticationSetting storage.OpenIdAuthenticationSettingsContract
			err := openidAuthenticationSettingItem.AssignProperties_To_OpenIdAuthenticationSettingsContract(&openidAuthenticationSetting)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_OpenIdAuthenticationSettingsContract() to populate field OpenidAuthenticationSettings")
			}
			openidAuthenticationSettingList[openidAuthenticationSettingIndex] = openidAuthenticationSetting
		}
		destination.OpenidAuthenticationSettings = openidAuthenticationSettingList
	} else {
		destination.OpenidAuthenticationSettings = nil
	}

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

	// No error
	return nil
}

// Initialize_From_AuthenticationSettingsContract_STATUS populates our AuthenticationSettingsContract from the provided source AuthenticationSettingsContract_STATUS
func (contract *AuthenticationSettingsContract) Initialize_From_AuthenticationSettingsContract_STATUS(source *AuthenticationSettingsContract_STATUS) error {

	// OAuth2
	if source.OAuth2 != nil {
		var oAuth2 OAuth2AuthenticationSettingsContract
		err := oAuth2.Initialize_From_OAuth2AuthenticationSettingsContract_STATUS(source.OAuth2)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_OAuth2AuthenticationSettingsContract_STATUS() to populate field OAuth2")
		}
		contract.OAuth2 = &oAuth2
	} else {
		contract.OAuth2 = nil
	}

	// OAuth2AuthenticationSettings
	if source.OAuth2AuthenticationSettings != nil {
		oAuth2AuthenticationSettingList := make([]OAuth2AuthenticationSettingsContract, len(source.OAuth2AuthenticationSettings))
		for oAuth2AuthenticationSettingIndex, oAuth2AuthenticationSettingItem := range source.OAuth2AuthenticationSettings {
			var oAuth2AuthenticationSetting OAuth2AuthenticationSettingsContract
			err := oAuth2AuthenticationSetting.Initialize_From_OAuth2AuthenticationSettingsContract_STATUS(&oAuth2AuthenticationSettingItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_OAuth2AuthenticationSettingsContract_STATUS() to populate field OAuth2AuthenticationSettings")
			}
			oAuth2AuthenticationSettingList[oAuth2AuthenticationSettingIndex] = oAuth2AuthenticationSetting
		}
		contract.OAuth2AuthenticationSettings = oAuth2AuthenticationSettingList
	} else {
		contract.OAuth2AuthenticationSettings = nil
	}

	// Openid
	if source.Openid != nil {
		var openid OpenIdAuthenticationSettingsContract
		err := openid.Initialize_From_OpenIdAuthenticationSettingsContract_STATUS(source.Openid)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_OpenIdAuthenticationSettingsContract_STATUS() to populate field Openid")
		}
		contract.Openid = &openid
	} else {
		contract.Openid = nil
	}

	// OpenidAuthenticationSettings
	if source.OpenidAuthenticationSettings != nil {
		openidAuthenticationSettingList := make([]OpenIdAuthenticationSettingsContract, len(source.OpenidAuthenticationSettings))
		for openidAuthenticationSettingIndex, openidAuthenticationSettingItem := range source.OpenidAuthenticationSettings {
			var openidAuthenticationSetting OpenIdAuthenticationSettingsContract
			err := openidAuthenticationSetting.Initialize_From_OpenIdAuthenticationSettingsContract_STATUS(&openidAuthenticationSettingItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_OpenIdAuthenticationSettingsContract_STATUS() to populate field OpenidAuthenticationSettings")
			}
			openidAuthenticationSettingList[openidAuthenticationSettingIndex] = openidAuthenticationSetting
		}
		contract.OpenidAuthenticationSettings = openidAuthenticationSettingList
	} else {
		contract.OpenidAuthenticationSettings = nil
	}

	// No error
	return nil
}

// API Authentication Settings.
type AuthenticationSettingsContract_STATUS struct {
	// OAuth2: OAuth2 Authentication settings
	OAuth2 *OAuth2AuthenticationSettingsContract_STATUS `json:"oAuth2,omitempty"`

	// OAuth2AuthenticationSettings: Collection of OAuth2 authentication settings included into this API.
	OAuth2AuthenticationSettings []OAuth2AuthenticationSettingsContract_STATUS `json:"oAuth2AuthenticationSettings,omitempty"`

	// Openid: OpenID Connect Authentication Settings
	Openid *OpenIdAuthenticationSettingsContract_STATUS `json:"openid,omitempty"`

	// OpenidAuthenticationSettings: Collection of Open ID Connect authentication settings included into this API.
	OpenidAuthenticationSettings []OpenIdAuthenticationSettingsContract_STATUS `json:"openidAuthenticationSettings,omitempty"`
}

var _ genruntime.FromARMConverter = &AuthenticationSettingsContract_STATUS{}

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

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

	// Set property "OAuth2":
	if typedInput.OAuth2 != nil {
		var oAuth OAuth2AuthenticationSettingsContract_STATUS
		err := oAuth.PopulateFromARM(owner, *typedInput.OAuth2)
		if err != nil {
			return err
		}
		oAuth2 := oAuth
		contract.OAuth2 = &oAuth2
	}

	// Set property "OAuth2AuthenticationSettings":
	for _, item := range typedInput.OAuth2AuthenticationSettings {
		var item1 OAuth2AuthenticationSettingsContract_STATUS
		err := item1.PopulateFromARM(owner, item)
		if err != nil {
			return err
		}
		contract.OAuth2AuthenticationSettings = append(contract.OAuth2AuthenticationSettings, item1)
	}

	// Set property "Openid":
	if typedInput.Openid != nil {
		var openid1 OpenIdAuthenticationSettingsContract_STATUS
		err := openid1.PopulateFromARM(owner, *typedInput.Openid)
		if err != nil {
			return err
		}
		openid := openid1
		contract.Openid = &openid
	}

	// Set property "OpenidAuthenticationSettings":
	for _, item := range typedInput.OpenidAuthenticationSettings {
		var item1 OpenIdAuthenticationSettingsContract_STATUS
		err := item1.PopulateFromARM(owner, item)
		if err != nil {
			return err
		}
		contract.OpenidAuthenticationSettings = append(contract.OpenidAuthenticationSettings, item1)
	}

	// No error
	return nil
}

// AssignProperties_From_AuthenticationSettingsContract_STATUS populates our AuthenticationSettingsContract_STATUS from the provided source AuthenticationSettingsContract_STATUS
func (contract *AuthenticationSettingsContract_STATUS) AssignProperties_From_AuthenticationSettingsContract_STATUS(source *storage.AuthenticationSettingsContract_STATUS) error {

	// OAuth2
	if source.OAuth2 != nil {
		var oAuth2 OAuth2AuthenticationSettingsContract_STATUS
		err := oAuth2.AssignProperties_From_OAuth2AuthenticationSettingsContract_STATUS(source.OAuth2)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_OAuth2AuthenticationSettingsContract_STATUS() to populate field OAuth2")
		}
		contract.OAuth2 = &oAuth2
	} else {
		contract.OAuth2 = nil
	}

	// OAuth2AuthenticationSettings
	if source.OAuth2AuthenticationSettings != nil {
		oAuth2AuthenticationSettingList := make([]OAuth2AuthenticationSettingsContract_STATUS, len(source.OAuth2AuthenticationSettings))
		for oAuth2AuthenticationSettingIndex, oAuth2AuthenticationSettingItem := range source.OAuth2AuthenticationSettings {
			var oAuth2AuthenticationSetting OAuth2AuthenticationSettingsContract_STATUS
			err := oAuth2AuthenticationSetting.AssignProperties_From_OAuth2AuthenticationSettingsContract_STATUS(&oAuth2AuthenticationSettingItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_OAuth2AuthenticationSettingsContract_STATUS() to populate field OAuth2AuthenticationSettings")
			}
			oAuth2AuthenticationSettingList[oAuth2AuthenticationSettingIndex] = oAuth2AuthenticationSetting
		}
		contract.OAuth2AuthenticationSettings = oAuth2AuthenticationSettingList
	} else {
		contract.OAuth2AuthenticationSettings = nil
	}

	// Openid
	if source.Openid != nil {
		var openid OpenIdAuthenticationSettingsContract_STATUS
		err := openid.AssignProperties_From_OpenIdAuthenticationSettingsContract_STATUS(source.Openid)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_OpenIdAuthenticationSettingsContract_STATUS() to populate field Openid")
		}
		contract.Openid = &openid
	} else {
		contract.Openid = nil
	}

	// OpenidAuthenticationSettings
	if source.OpenidAuthenticationSettings != nil {
		openidAuthenticationSettingList := make([]OpenIdAuthenticationSettingsContract_STATUS, len(source.OpenidAuthenticationSettings))
		for openidAuthenticationSettingIndex, openidAuthenticationSettingItem := range source.OpenidAuthenticationSettings {
			var openidAuthenticationSetting OpenIdAuthenticationSettingsContract_STATUS
			err := openidAuthenticationSetting.AssignProperties_From_OpenIdAuthenticationSettingsContract_STATUS(&openidAuthenticationSettingItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_OpenIdAuthenticationSettingsContract_STATUS() to populate field OpenidAuthenticationSettings")
			}
			openidAuthenticationSettingList[openidAuthenticationSettingIndex] = openidAuthenticationSetting
		}
		contract.OpenidAuthenticationSettings = openidAuthenticationSettingList
	} else {
		contract.OpenidAuthenticationSettings = nil
	}

	// No error
	return nil
}

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

	// OAuth2
	if contract.OAuth2 != nil {
		var oAuth2 storage.OAuth2AuthenticationSettingsContract_STATUS
		err := contract.OAuth2.AssignProperties_To_OAuth2AuthenticationSettingsContract_STATUS(&oAuth2)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_OAuth2AuthenticationSettingsContract_STATUS() to populate field OAuth2")
		}
		destination.OAuth2 = &oAuth2
	} else {
		destination.OAuth2 = nil
	}

	// OAuth2AuthenticationSettings
	if contract.OAuth2AuthenticationSettings != nil {
		oAuth2AuthenticationSettingList := make([]storage.OAuth2AuthenticationSettingsContract_STATUS, len(contract.OAuth2AuthenticationSettings))
		for oAuth2AuthenticationSettingIndex, oAuth2AuthenticationSettingItem := range contract.OAuth2AuthenticationSettings {
			var oAuth2AuthenticationSetting storage.OAuth2AuthenticationSettingsContract_STATUS
			err := oAuth2AuthenticationSettingItem.AssignProperties_To_OAuth2AuthenticationSettingsContract_STATUS(&oAuth2AuthenticationSetting)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_OAuth2AuthenticationSettingsContract_STATUS() to populate field OAuth2AuthenticationSettings")
			}
			oAuth2AuthenticationSettingList[oAuth2AuthenticationSettingIndex] = oAuth2AuthenticationSetting
		}
		destination.OAuth2AuthenticationSettings = oAuth2AuthenticationSettingList
	} else {
		destination.OAuth2AuthenticationSettings = nil
	}

	// Openid
	if contract.Openid != nil {
		var openid storage.OpenIdAuthenticationSettingsContract_STATUS
		err := contract.Openid.AssignProperties_To_OpenIdAuthenticationSettingsContract_STATUS(&openid)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_OpenIdAuthenticationSettingsContract_STATUS() to populate field Openid")
		}
		destination.Openid = &openid
	} else {
		destination.Openid = nil
	}

	// OpenidAuthenticationSettings
	if contract.OpenidAuthenticationSettings != nil {
		openidAuthenticationSettingList := make([]storage.OpenIdAuthenticationSettingsContract_STATUS, len(contract.OpenidAuthenticationSettings))
		for openidAuthenticationSettingIndex, openidAuthenticationSettingItem := range contract.OpenidAuthenticationSettings {
			var openidAuthenticationSetting storage.OpenIdAuthenticationSettingsContract_STATUS
			err := openidAuthenticationSettingItem.AssignProperties_To_OpenIdAuthenticationSettingsContract_STATUS(&openidAuthenticationSetting)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_OpenIdAuthenticationSettingsContract_STATUS() to populate field OpenidAuthenticationSettings")
			}
			openidAuthenticationSettingList[openidAuthenticationSettingIndex] = openidAuthenticationSetting
		}
		destination.OpenidAuthenticationSettings = openidAuthenticationSettingList
	} else {
		destination.OpenidAuthenticationSettings = nil
	}

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

	// No error
	return nil
}

// Subscription key parameter names details.
type SubscriptionKeyParameterNamesContract struct {
	// Header: Subscription key header name.
	Header *string `json:"header,omitempty"`

	// Query: Subscription key query string parameter name.
	Query *string `json:"query,omitempty"`
}

var _ genruntime.ARMTransformer = &SubscriptionKeyParameterNamesContract{}

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

	// Set property "Header":
	if contract.Header != nil {
		header := *contract.Header
		result.Header = &header
	}

	// Set property "Query":
	if contract.Query != nil {
		query := *contract.Query
		result.Query = &query
	}
	return result, nil
}

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

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

	// Set property "Header":
	if typedInput.Header != nil {
		header := *typedInput.Header
		contract.Header = &header
	}

	// Set property "Query":
	if typedInput.Query != nil {
		query := *typedInput.Query
		contract.Query = &query
	}

	// No error
	return nil
}

// AssignProperties_From_SubscriptionKeyParameterNamesContract populates our SubscriptionKeyParameterNamesContract from the provided source SubscriptionKeyParameterNamesContract
func (contract *SubscriptionKeyParameterNamesContract) AssignProperties_From_SubscriptionKeyParameterNamesContract(source *storage.SubscriptionKeyParameterNamesContract) error {

	// Header
	contract.Header = genruntime.ClonePointerToString(source.Header)

	// Query
	contract.Query = genruntime.ClonePointerToString(source.Query)

	// No error
	return nil
}

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

	// Header
	destination.Header = genruntime.ClonePointerToString(contract.Header)

	// Query
	destination.Query = genruntime.ClonePointerToString(contract.Query)

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

	// No error
	return nil
}

// Initialize_From_SubscriptionKeyParameterNamesContract_STATUS populates our SubscriptionKeyParameterNamesContract from the provided source SubscriptionKeyParameterNamesContract_STATUS
func (contract *SubscriptionKeyParameterNamesContract) Initialize_From_SubscriptionKeyParameterNamesContract_STATUS(source *SubscriptionKeyParameterNamesContract_STATUS) error {

	// Header
	contract.Header = genruntime.ClonePointerToString(source.Header)

	// Query
	contract.Query = genruntime.ClonePointerToString(source.Query)

	// No error
	return nil
}

// Subscription key parameter names details.
type SubscriptionKeyParameterNamesContract_STATUS struct {
	// Header: Subscription key header name.
	Header *string `json:"header,omitempty"`

	// Query: Subscription key query string parameter name.
	Query *string `json:"query,omitempty"`
}

var _ genruntime.FromARMConverter = &SubscriptionKeyParameterNamesContract_STATUS{}

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

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

	// Set property "Header":
	if typedInput.Header != nil {
		header := *typedInput.Header
		contract.Header = &header
	}

	// Set property "Query":
	if typedInput.Query != nil {
		query := *typedInput.Query
		contract.Query = &query
	}

	// No error
	return nil
}

// AssignProperties_From_SubscriptionKeyParameterNamesContract_STATUS populates our SubscriptionKeyParameterNamesContract_STATUS from the provided source SubscriptionKeyParameterNamesContract_STATUS
func (contract *SubscriptionKeyParameterNamesContract_STATUS) AssignProperties_From_SubscriptionKeyParameterNamesContract_STATUS(source *storage.SubscriptionKeyParameterNamesContract_STATUS) error {

	// Header
	contract.Header = genruntime.ClonePointerToString(source.Header)

	// Query
	contract.Query = genruntime.ClonePointerToString(source.Query)

	// No error
	return nil
}

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

	// Header
	destination.Header = genruntime.ClonePointerToString(contract.Header)

	// Query
	destination.Query = genruntime.ClonePointerToString(contract.Query)

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"Header","Query","Segment"}
type ApiVersionSetContractDetails_VersioningScheme string

const (
	ApiVersionSetContractDetails_VersioningScheme_Header  = ApiVersionSetContractDetails_VersioningScheme("Header")
	ApiVersionSetContractDetails_VersioningScheme_Query   = ApiVersionSetContractDetails_VersioningScheme("Query")
	ApiVersionSetContractDetails_VersioningScheme_Segment = ApiVersionSetContractDetails_VersioningScheme("Segment")
)

// Mapping from string to ApiVersionSetContractDetails_VersioningScheme
var apiVersionSetContractDetails_VersioningScheme_Values = map[string]ApiVersionSetContractDetails_VersioningScheme{
	"header":  ApiVersionSetContractDetails_VersioningScheme_Header,
	"query":   ApiVersionSetContractDetails_VersioningScheme_Query,
	"segment": ApiVersionSetContractDetails_VersioningScheme_Segment,
}

type ApiVersionSetContractDetails_VersioningScheme_STATUS string

const (
	ApiVersionSetContractDetails_VersioningScheme_STATUS_Header  = ApiVersionSetContractDetails_VersioningScheme_STATUS("Header")
	ApiVersionSetContractDetails_VersioningScheme_STATUS_Query   = ApiVersionSetContractDetails_VersioningScheme_STATUS("Query")
	ApiVersionSetContractDetails_VersioningScheme_STATUS_Segment = ApiVersionSetContractDetails_VersioningScheme_STATUS("Segment")
)

// Mapping from string to ApiVersionSetContractDetails_VersioningScheme_STATUS
var apiVersionSetContractDetails_VersioningScheme_STATUS_Values = map[string]ApiVersionSetContractDetails_VersioningScheme_STATUS{
	"header":  ApiVersionSetContractDetails_VersioningScheme_STATUS_Header,
	"query":   ApiVersionSetContractDetails_VersioningScheme_STATUS_Query,
	"segment": ApiVersionSetContractDetails_VersioningScheme_STATUS_Segment,
}

// API OAuth2 Authentication settings details.
type OAuth2AuthenticationSettingsContract struct {
	// AuthorizationServerId: OAuth authorization server identifier.
	AuthorizationServerId *string `json:"authorizationServerId,omitempty"`

	// Scope: operations scope.
	Scope *string `json:"scope,omitempty"`
}

var _ genruntime.ARMTransformer = &OAuth2AuthenticationSettingsContract{}

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

	// Set property "AuthorizationServerId":
	if contract.AuthorizationServerId != nil {
		authorizationServerId := *contract.AuthorizationServerId
		result.AuthorizationServerId = &authorizationServerId
	}

	// Set property "Scope":
	if contract.Scope != nil {
		scope := *contract.Scope
		result.Scope = &scope
	}
	return result, nil
}

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

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

	// Set property "AuthorizationServerId":
	if typedInput.AuthorizationServerId != nil {
		authorizationServerId := *typedInput.AuthorizationServerId
		contract.AuthorizationServerId = &authorizationServerId
	}

	// Set property "Scope":
	if typedInput.Scope != nil {
		scope := *typedInput.Scope
		contract.Scope = &scope
	}

	// No error
	return nil
}

// AssignProperties_From_OAuth2AuthenticationSettingsContract populates our OAuth2AuthenticationSettingsContract from the provided source OAuth2AuthenticationSettingsContract
func (contract *OAuth2AuthenticationSettingsContract) AssignProperties_From_OAuth2AuthenticationSettingsContract(source *storage.OAuth2AuthenticationSettingsContract) error {

	// AuthorizationServerId
	contract.AuthorizationServerId = genruntime.ClonePointerToString(source.AuthorizationServerId)

	// Scope
	contract.Scope = genruntime.ClonePointerToString(source.Scope)

	// No error
	return nil
}

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

	// AuthorizationServerId
	destination.AuthorizationServerId = genruntime.ClonePointerToString(contract.AuthorizationServerId)

	// Scope
	destination.Scope = genruntime.ClonePointerToString(contract.Scope)

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

	// No error
	return nil
}

// Initialize_From_OAuth2AuthenticationSettingsContract_STATUS populates our OAuth2AuthenticationSettingsContract from the provided source OAuth2AuthenticationSettingsContract_STATUS
func (contract *OAuth2AuthenticationSettingsContract) Initialize_From_OAuth2AuthenticationSettingsContract_STATUS(source *OAuth2AuthenticationSettingsContract_STATUS) error {

	// AuthorizationServerId
	contract.AuthorizationServerId = genruntime.ClonePointerToString(source.AuthorizationServerId)

	// Scope
	contract.Scope = genruntime.ClonePointerToString(source.Scope)

	// No error
	return nil
}

// API OAuth2 Authentication settings details.
type OAuth2AuthenticationSettingsContract_STATUS struct {
	// AuthorizationServerId: OAuth authorization server identifier.
	AuthorizationServerId *string `json:"authorizationServerId,omitempty"`

	// Scope: operations scope.
	Scope *string `json:"scope,omitempty"`
}

var _ genruntime.FromARMConverter = &OAuth2AuthenticationSettingsContract_STATUS{}

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

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

	// Set property "AuthorizationServerId":
	if typedInput.AuthorizationServerId != nil {
		authorizationServerId := *typedInput.AuthorizationServerId
		contract.AuthorizationServerId = &authorizationServerId
	}

	// Set property "Scope":
	if typedInput.Scope != nil {
		scope := *typedInput.Scope
		contract.Scope = &scope
	}

	// No error
	return nil
}

// AssignProperties_From_OAuth2AuthenticationSettingsContract_STATUS populates our OAuth2AuthenticationSettingsContract_STATUS from the provided source OAuth2AuthenticationSettingsContract_STATUS
func (contract *OAuth2AuthenticationSettingsContract_STATUS) AssignProperties_From_OAuth2AuthenticationSettingsContract_STATUS(source *storage.OAuth2AuthenticationSettingsContract_STATUS) error {

	// AuthorizationServerId
	contract.AuthorizationServerId = genruntime.ClonePointerToString(source.AuthorizationServerId)

	// Scope
	contract.Scope = genruntime.ClonePointerToString(source.Scope)

	// No error
	return nil
}

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

	// AuthorizationServerId
	destination.AuthorizationServerId = genruntime.ClonePointerToString(contract.AuthorizationServerId)

	// Scope
	destination.Scope = genruntime.ClonePointerToString(contract.Scope)

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

	// No error
	return nil
}

// API OAuth2 Authentication settings details.
type OpenIdAuthenticationSettingsContract struct {
	// BearerTokenSendingMethods: How to send token to the server.
	BearerTokenSendingMethods []BearerTokenSendingMethodsContract `json:"bearerTokenSendingMethods,omitempty"`

	// OpenidProviderId: OAuth authorization server identifier.
	OpenidProviderId *string `json:"openidProviderId,omitempty"`
}

var _ genruntime.ARMTransformer = &OpenIdAuthenticationSettingsContract{}

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

	// Set property "BearerTokenSendingMethods":
	for _, item := range contract.BearerTokenSendingMethods {
		var temp string
		temp = string(item)
		result.BearerTokenSendingMethods = append(result.BearerTokenSendingMethods, arm.BearerTokenSendingMethodsContract(temp))
	}

	// Set property "OpenidProviderId":
	if contract.OpenidProviderId != nil {
		openidProviderId := *contract.OpenidProviderId
		result.OpenidProviderId = &openidProviderId
	}
	return result, nil
}

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

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

	// Set property "BearerTokenSendingMethods":
	for _, item := range typedInput.BearerTokenSendingMethods {
		var temp string
		temp = string(item)
		contract.BearerTokenSendingMethods = append(contract.BearerTokenSendingMethods, BearerTokenSendingMethodsContract(temp))
	}

	// Set property "OpenidProviderId":
	if typedInput.OpenidProviderId != nil {
		openidProviderId := *typedInput.OpenidProviderId
		contract.OpenidProviderId = &openidProviderId
	}

	// No error
	return nil
}

// AssignProperties_From_OpenIdAuthenticationSettingsContract populates our OpenIdAuthenticationSettingsContract from the provided source OpenIdAuthenticationSettingsContract
func (contract *OpenIdAuthenticationSettingsContract) AssignProperties_From_OpenIdAuthenticationSettingsContract(source *storage.OpenIdAuthenticationSettingsContract) error {

	// BearerTokenSendingMethods
	if source.BearerTokenSendingMethods != nil {
		bearerTokenSendingMethodList := make([]BearerTokenSendingMethodsContract, len(source.BearerTokenSendingMethods))
		for bearerTokenSendingMethodIndex, bearerTokenSendingMethodItem := range source.BearerTokenSendingMethods {
			bearerTokenSendingMethodList[bearerTokenSendingMethodIndex] = genruntime.ToEnum(bearerTokenSendingMethodItem, bearerTokenSendingMethodsContract_Values)
		}
		contract.BearerTokenSendingMethods = bearerTokenSendingMethodList
	} else {
		contract.BearerTokenSendingMethods = nil
	}

	// OpenidProviderId
	contract.OpenidProviderId = genruntime.ClonePointerToString(source.OpenidProviderId)

	// No error
	return nil
}

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

	// BearerTokenSendingMethods
	if contract.BearerTokenSendingMethods != nil {
		bearerTokenSendingMethodList := make([]string, len(contract.BearerTokenSendingMethods))
		for bearerTokenSendingMethodIndex, bearerTokenSendingMethodItem := range contract.BearerTokenSendingMethods {
			bearerTokenSendingMethodList[bearerTokenSendingMethodIndex] = string(bearerTokenSendingMethodItem)
		}
		destination.BearerTokenSendingMethods = bearerTokenSendingMethodList
	} else {
		destination.BearerTokenSendingMethods = nil
	}

	// OpenidProviderId
	destination.OpenidProviderId = genruntime.ClonePointerToString(contract.OpenidProviderId)

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

	// No error
	return nil
}

// Initialize_From_OpenIdAuthenticationSettingsContract_STATUS populates our OpenIdAuthenticationSettingsContract from the provided source OpenIdAuthenticationSettingsContract_STATUS
func (contract *OpenIdAuthenticationSettingsContract) Initialize_From_OpenIdAuthenticationSettingsContract_STATUS(source *OpenIdAuthenticationSettingsContract_STATUS) error {

	// BearerTokenSendingMethods
	if source.BearerTokenSendingMethods != nil {
		bearerTokenSendingMethodList := make([]BearerTokenSendingMethodsContract, len(source.BearerTokenSendingMethods))
		for bearerTokenSendingMethodIndex, bearerTokenSendingMethodItem := range source.BearerTokenSendingMethods {
			bearerTokenSendingMethod := genruntime.ToEnum(string(bearerTokenSendingMethodItem), bearerTokenSendingMethodsContract_Values)
			bearerTokenSendingMethodList[bearerTokenSendingMethodIndex] = bearerTokenSendingMethod
		}
		contract.BearerTokenSendingMethods = bearerTokenSendingMethodList
	} else {
		contract.BearerTokenSendingMethods = nil
	}

	// OpenidProviderId
	contract.OpenidProviderId = genruntime.ClonePointerToString(source.OpenidProviderId)

	// No error
	return nil
}

// API OAuth2 Authentication settings details.
type OpenIdAuthenticationSettingsContract_STATUS struct {
	// BearerTokenSendingMethods: How to send token to the server.
	BearerTokenSendingMethods []BearerTokenSendingMethodsContract_STATUS `json:"bearerTokenSendingMethods,omitempty"`

	// OpenidProviderId: OAuth authorization server identifier.
	OpenidProviderId *string `json:"openidProviderId,omitempty"`
}

var _ genruntime.FromARMConverter = &OpenIdAuthenticationSettingsContract_STATUS{}

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

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

	// Set property "BearerTokenSendingMethods":
	for _, item := range typedInput.BearerTokenSendingMethods {
		var temp string
		temp = string(item)
		contract.BearerTokenSendingMethods = append(contract.BearerTokenSendingMethods, BearerTokenSendingMethodsContract_STATUS(temp))
	}

	// Set property "OpenidProviderId":
	if typedInput.OpenidProviderId != nil {
		openidProviderId := *typedInput.OpenidProviderId
		contract.OpenidProviderId = &openidProviderId
	}

	// No error
	return nil
}

// AssignProperties_From_OpenIdAuthenticationSettingsContract_STATUS populates our OpenIdAuthenticationSettingsContract_STATUS from the provided source OpenIdAuthenticationSettingsContract_STATUS
func (contract *OpenIdAuthenticationSettingsContract_STATUS) AssignProperties_From_OpenIdAuthenticationSettingsContract_STATUS(source *storage.OpenIdAuthenticationSettingsContract_STATUS) error {

	// BearerTokenSendingMethods
	if source.BearerTokenSendingMethods != nil {
		bearerTokenSendingMethodList := make([]BearerTokenSendingMethodsContract_STATUS, len(source.BearerTokenSendingMethods))
		for bearerTokenSendingMethodIndex, bearerTokenSendingMethodItem := range source.BearerTokenSendingMethods {
			bearerTokenSendingMethodList[bearerTokenSendingMethodIndex] = genruntime.ToEnum(bearerTokenSendingMethodItem, bearerTokenSendingMethodsContract_STATUS_Values)
		}
		contract.BearerTokenSendingMethods = bearerTokenSendingMethodList
	} else {
		contract.BearerTokenSendingMethods = nil
	}

	// OpenidProviderId
	contract.OpenidProviderId = genruntime.ClonePointerToString(source.OpenidProviderId)

	// No error
	return nil
}

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

	// BearerTokenSendingMethods
	if contract.BearerTokenSendingMethods != nil {
		bearerTokenSendingMethodList := make([]string, len(contract.BearerTokenSendingMethods))
		for bearerTokenSendingMethodIndex, bearerTokenSendingMethodItem := range contract.BearerTokenSendingMethods {
			bearerTokenSendingMethodList[bearerTokenSendingMethodIndex] = string(bearerTokenSendingMethodItem)
		}
		destination.BearerTokenSendingMethods = bearerTokenSendingMethodList
	} else {
		destination.BearerTokenSendingMethods = nil
	}

	// OpenidProviderId
	destination.OpenidProviderId = genruntime.ClonePointerToString(contract.OpenidProviderId)

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

	// No error
	return nil
}

// Form of an authorization grant, which the client uses to request the access token.
// +kubebuilder:validation:Enum={"authorizationHeader","query"}
type BearerTokenSendingMethodsContract string

const (
	BearerTokenSendingMethodsContract_AuthorizationHeader = BearerTokenSendingMethodsContract("authorizationHeader")
	BearerTokenSendingMethodsContract_Query               = BearerTokenSendingMethodsContract("query")
)

// Mapping from string to BearerTokenSendingMethodsContract
var bearerTokenSendingMethodsContract_Values = map[string]BearerTokenSendingMethodsContract{
	"authorizationheader": BearerTokenSendingMethodsContract_AuthorizationHeader,
	"query":               BearerTokenSendingMethodsContract_Query,
}

// Form of an authorization grant, which the client uses to request the access token.
type BearerTokenSendingMethodsContract_STATUS string

const (
	BearerTokenSendingMethodsContract_STATUS_AuthorizationHeader = BearerTokenSendingMethodsContract_STATUS("authorizationHeader")
	BearerTokenSendingMethodsContract_STATUS_Query               = BearerTokenSendingMethodsContract_STATUS("query")
)

// Mapping from string to BearerTokenSendingMethodsContract_STATUS
var bearerTokenSendingMethodsContract_STATUS_Values = map[string]BearerTokenSendingMethodsContract_STATUS{
	"authorizationheader": BearerTokenSendingMethodsContract_STATUS_AuthorizationHeader,
	"query":               BearerTokenSendingMethodsContract_STATUS_Query,
}

func init() {
	SchemeBuilder.Register(&Api{}, &ApiList{})
}
