package synapse

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"context"
	"encoding/json"
	"github.com/Azure/go-autorest/autorest"
	"github.com/Azure/go-autorest/autorest/azure"
	"github.com/Azure/go-autorest/autorest/date"
	"github.com/Azure/go-autorest/autorest/to"
	"github.com/Azure/go-autorest/tracing"
	"github.com/gofrs/uuid"
	"net/http"
)

// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/synapse/mgmt/v2.0/synapse"

// AadAdminProperties workspace active directory administrator properties
type AadAdminProperties struct {
	// TenantID - Tenant ID of the workspace active directory administrator
	TenantID *string `json:"tenantId,omitempty"`
	// Login - Login of the workspace active directory administrator
	Login *string `json:"login,omitempty"`
	// AdministratorType - Workspace active directory administrator type
	AdministratorType *string `json:"administratorType,omitempty"`
	// Sid - Object ID of the workspace active directory administrator
	Sid *string `json:"sid,omitempty"`
}

// AttachedDatabaseConfiguration class representing an attached database configuration.
type AttachedDatabaseConfiguration struct {
	autorest.Response `json:"-"`
	// Location - Resource location.
	Location *string `json:"location,omitempty"`
	// AttachedDatabaseConfigurationProperties - The properties of the attached database configuration.
	*AttachedDatabaseConfigurationProperties `json:"properties,omitempty"`
	// SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData `json:"systemData,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for AttachedDatabaseConfiguration.
func (adc AttachedDatabaseConfiguration) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if adc.Location != nil {
		objectMap["location"] = adc.Location
	}
	if adc.AttachedDatabaseConfigurationProperties != nil {
		objectMap["properties"] = adc.AttachedDatabaseConfigurationProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for AttachedDatabaseConfiguration struct.
func (adc *AttachedDatabaseConfiguration) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				adc.Location = &location
			}
		case "properties":
			if v != nil {
				var attachedDatabaseConfigurationProperties AttachedDatabaseConfigurationProperties
				err = json.Unmarshal(*v, &attachedDatabaseConfigurationProperties)
				if err != nil {
					return err
				}
				adc.AttachedDatabaseConfigurationProperties = &attachedDatabaseConfigurationProperties
			}
		case "systemData":
			if v != nil {
				var systemData SystemData
				err = json.Unmarshal(*v, &systemData)
				if err != nil {
					return err
				}
				adc.SystemData = &systemData
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				adc.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				adc.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				adc.Type = &typeVar
			}
		}
	}

	return nil
}

// AttachedDatabaseConfigurationListResult the list attached database configurations operation response.
type AttachedDatabaseConfigurationListResult struct {
	autorest.Response `json:"-"`
	// Value - The list of attached database configurations.
	Value *[]AttachedDatabaseConfiguration `json:"value,omitempty"`
}

// AttachedDatabaseConfigurationProperties class representing the an attached database configuration
// properties of kind specific.
type AttachedDatabaseConfigurationProperties struct {
	// ProvisioningState - The provisioned state of the resource. Possible values include: 'ResourceProvisioningStateRunning', 'ResourceProvisioningStateCreating', 'ResourceProvisioningStateDeleting', 'ResourceProvisioningStateSucceeded', 'ResourceProvisioningStateFailed', 'ResourceProvisioningStateMoving', 'ResourceProvisioningStateCanceled'
	ProvisioningState ResourceProvisioningState `json:"provisioningState,omitempty"`
	// DatabaseName - The name of the database which you would like to attach, use * if you want to follow all current and future databases.
	DatabaseName *string `json:"databaseName,omitempty"`
	// KustoPoolResourceID - The resource id of the kusto pool where the databases you would like to attach reside.
	KustoPoolResourceID *string `json:"clusterResourceId,omitempty"`
	// AttachedDatabaseNames - READ-ONLY; The list of databases from the clusterResourceId which are currently attached to the kusto pool.
	AttachedDatabaseNames *[]string `json:"attachedDatabaseNames,omitempty"`
	// DefaultPrincipalsModificationKind - The default principals modification kind. Possible values include: 'DefaultPrincipalsModificationKindUnion', 'DefaultPrincipalsModificationKindReplace', 'DefaultPrincipalsModificationKindNone'
	DefaultPrincipalsModificationKind DefaultPrincipalsModificationKind `json:"defaultPrincipalsModificationKind,omitempty"`
	// TableLevelSharingProperties - Table level sharing specifications
	TableLevelSharingProperties *TableLevelSharingProperties `json:"tableLevelSharingProperties,omitempty"`
}

// MarshalJSON is the custom marshaler for AttachedDatabaseConfigurationProperties.
func (adcp AttachedDatabaseConfigurationProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if adcp.ProvisioningState != "" {
		objectMap["provisioningState"] = adcp.ProvisioningState
	}
	if adcp.DatabaseName != nil {
		objectMap["databaseName"] = adcp.DatabaseName
	}
	if adcp.KustoPoolResourceID != nil {
		objectMap["clusterResourceId"] = adcp.KustoPoolResourceID
	}
	if adcp.DefaultPrincipalsModificationKind != "" {
		objectMap["defaultPrincipalsModificationKind"] = adcp.DefaultPrincipalsModificationKind
	}
	if adcp.TableLevelSharingProperties != nil {
		objectMap["tableLevelSharingProperties"] = adcp.TableLevelSharingProperties
	}
	return json.Marshal(objectMap)
}

// AutoPauseProperties auto-pausing properties of a Big Data pool powered by Apache Spark
type AutoPauseProperties struct {
	// DelayInMinutes - Number of minutes of idle time before the Big Data pool is automatically paused.
	DelayInMinutes *int32 `json:"delayInMinutes,omitempty"`
	// Enabled - Whether auto-pausing is enabled for the Big Data pool.
	Enabled *bool `json:"enabled,omitempty"`
}

// AutoScaleProperties auto-scaling properties of a Big Data pool powered by Apache Spark
type AutoScaleProperties struct {
	// MinNodeCount - The minimum number of nodes the Big Data pool can support.
	MinNodeCount *int32 `json:"minNodeCount,omitempty"`
	// Enabled - Whether automatic scaling is enabled for the Big Data pool.
	Enabled *bool `json:"enabled,omitempty"`
	// MaxNodeCount - The maximum number of nodes the Big Data pool can support.
	MaxNodeCount *int32 `json:"maxNodeCount,omitempty"`
}

// AvailableRpOperation an operation that is available in this resource provider
type AvailableRpOperation struct {
	// Display - Display properties of the operation
	Display *AvailableRpOperationDisplayInfo `json:"display,omitempty"`
	// IsDataAction - Whether this operation is a data action
	IsDataAction *string `json:"isDataAction,omitempty"`
	// Name - Operation name
	Name *string `json:"name,omitempty"`
	// OperationMetaPropertyInfo - Operation properties
	*OperationMetaPropertyInfo `json:"properties,omitempty"`
	// Origin - Operation origin
	Origin *string `json:"origin,omitempty"`
}

// MarshalJSON is the custom marshaler for AvailableRpOperation.
func (aro AvailableRpOperation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if aro.Display != nil {
		objectMap["display"] = aro.Display
	}
	if aro.IsDataAction != nil {
		objectMap["isDataAction"] = aro.IsDataAction
	}
	if aro.Name != nil {
		objectMap["name"] = aro.Name
	}
	if aro.OperationMetaPropertyInfo != nil {
		objectMap["properties"] = aro.OperationMetaPropertyInfo
	}
	if aro.Origin != nil {
		objectMap["origin"] = aro.Origin
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for AvailableRpOperation struct.
func (aro *AvailableRpOperation) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "display":
			if v != nil {
				var display AvailableRpOperationDisplayInfo
				err = json.Unmarshal(*v, &display)
				if err != nil {
					return err
				}
				aro.Display = &display
			}
		case "isDataAction":
			if v != nil {
				var isDataAction string
				err = json.Unmarshal(*v, &isDataAction)
				if err != nil {
					return err
				}
				aro.IsDataAction = &isDataAction
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				aro.Name = &name
			}
		case "properties":
			if v != nil {
				var operationMetaPropertyInfo OperationMetaPropertyInfo
				err = json.Unmarshal(*v, &operationMetaPropertyInfo)
				if err != nil {
					return err
				}
				aro.OperationMetaPropertyInfo = &operationMetaPropertyInfo
			}
		case "origin":
			if v != nil {
				var origin string
				err = json.Unmarshal(*v, &origin)
				if err != nil {
					return err
				}
				aro.Origin = &origin
			}
		}
	}

	return nil
}

// AvailableRpOperationDisplayInfo description of an available operation
type AvailableRpOperationDisplayInfo struct {
	// Description - Operation description
	Description *string `json:"description,omitempty"`
	// Resource - Resource type
	Resource *string `json:"resource,omitempty"`
	// Provider - Resource provider name
	Provider *string `json:"provider,omitempty"`
	// Operation - Operation name
	Operation *string `json:"operation,omitempty"`
}

// AzureADOnlyAuthentication azure Active Directory Only Authentication Info
type AzureADOnlyAuthentication struct {
	autorest.Response `json:"-"`
	// AzureADOnlyAuthenticationProperties - azureADOnlyAuthentication resource properties
	*AzureADOnlyAuthenticationProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for AzureADOnlyAuthentication.
func (aaoa AzureADOnlyAuthentication) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if aaoa.AzureADOnlyAuthenticationProperties != nil {
		objectMap["properties"] = aaoa.AzureADOnlyAuthenticationProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for AzureADOnlyAuthentication struct.
func (aaoa *AzureADOnlyAuthentication) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var azureADOnlyAuthenticationProperties AzureADOnlyAuthenticationProperties
				err = json.Unmarshal(*v, &azureADOnlyAuthenticationProperties)
				if err != nil {
					return err
				}
				aaoa.AzureADOnlyAuthenticationProperties = &azureADOnlyAuthenticationProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				aaoa.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				aaoa.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				aaoa.Type = &typeVar
			}
		}
	}

	return nil
}

// AzureADOnlyAuthenticationListResult a list of active directory only authentications.
type AzureADOnlyAuthenticationListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]AzureADOnlyAuthentication `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for AzureADOnlyAuthenticationListResult.
func (aaoalr AzureADOnlyAuthenticationListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// AzureADOnlyAuthenticationListResultIterator provides access to a complete listing of
// AzureADOnlyAuthentication values.
type AzureADOnlyAuthenticationListResultIterator struct {
	i    int
	page AzureADOnlyAuthenticationListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *AzureADOnlyAuthenticationListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/AzureADOnlyAuthenticationListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *AzureADOnlyAuthenticationListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter AzureADOnlyAuthenticationListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter AzureADOnlyAuthenticationListResultIterator) Response() AzureADOnlyAuthenticationListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter AzureADOnlyAuthenticationListResultIterator) Value() AzureADOnlyAuthentication {
	if !iter.page.NotDone() {
		return AzureADOnlyAuthentication{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the AzureADOnlyAuthenticationListResultIterator type.
func NewAzureADOnlyAuthenticationListResultIterator(page AzureADOnlyAuthenticationListResultPage) AzureADOnlyAuthenticationListResultIterator {
	return AzureADOnlyAuthenticationListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (aaoalr AzureADOnlyAuthenticationListResult) IsEmpty() bool {
	return aaoalr.Value == nil || len(*aaoalr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (aaoalr AzureADOnlyAuthenticationListResult) hasNextLink() bool {
	return aaoalr.NextLink != nil && len(*aaoalr.NextLink) != 0
}

// azureADOnlyAuthenticationListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (aaoalr AzureADOnlyAuthenticationListResult) azureADOnlyAuthenticationListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !aaoalr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(aaoalr.NextLink)))
}

// AzureADOnlyAuthenticationListResultPage contains a page of AzureADOnlyAuthentication values.
type AzureADOnlyAuthenticationListResultPage struct {
	fn     func(context.Context, AzureADOnlyAuthenticationListResult) (AzureADOnlyAuthenticationListResult, error)
	aaoalr AzureADOnlyAuthenticationListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *AzureADOnlyAuthenticationListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/AzureADOnlyAuthenticationListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.aaoalr)
		if err != nil {
			return err
		}
		page.aaoalr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *AzureADOnlyAuthenticationListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page AzureADOnlyAuthenticationListResultPage) NotDone() bool {
	return !page.aaoalr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page AzureADOnlyAuthenticationListResultPage) Response() AzureADOnlyAuthenticationListResult {
	return page.aaoalr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page AzureADOnlyAuthenticationListResultPage) Values() []AzureADOnlyAuthentication {
	if page.aaoalr.IsEmpty() {
		return nil
	}
	return *page.aaoalr.Value
}

// Creates a new instance of the AzureADOnlyAuthenticationListResultPage type.
func NewAzureADOnlyAuthenticationListResultPage(cur AzureADOnlyAuthenticationListResult, getNextPage func(context.Context, AzureADOnlyAuthenticationListResult) (AzureADOnlyAuthenticationListResult, error)) AzureADOnlyAuthenticationListResultPage {
	return AzureADOnlyAuthenticationListResultPage{
		fn:     getNextPage,
		aaoalr: cur,
	}
}

// AzureADOnlyAuthenticationProperties properties of a active directory only authentication.
type AzureADOnlyAuthenticationProperties struct {
	// AzureADOnlyAuthentication - Azure Active Directory only Authentication enabled.
	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"`
	// State - READ-ONLY; property configuration state. Possible values include: 'StateValueConsistent', 'StateValueInConsistent', 'StateValueUpdating'
	State StateValue `json:"state,omitempty"`
	// CreationDate - READ-ONLY; property configuration date
	CreationDate *date.Time `json:"creationDate,omitempty"`
}

// MarshalJSON is the custom marshaler for AzureADOnlyAuthenticationProperties.
func (aaoap AzureADOnlyAuthenticationProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if aaoap.AzureADOnlyAuthentication != nil {
		objectMap["azureADOnlyAuthentication"] = aaoap.AzureADOnlyAuthentication
	}
	return json.Marshal(objectMap)
}

// AzureADOnlyAuthenticationsCreateFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type AzureADOnlyAuthenticationsCreateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(AzureADOnlyAuthenticationsClient) (AzureADOnlyAuthentication, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *AzureADOnlyAuthenticationsCreateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for AzureADOnlyAuthenticationsCreateFuture.Result.
func (future *AzureADOnlyAuthenticationsCreateFuture) result(client AzureADOnlyAuthenticationsClient) (aaoa AzureADOnlyAuthentication, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.AzureADOnlyAuthenticationsCreateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		aaoa.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.AzureADOnlyAuthenticationsCreateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if aaoa.Response.Response, err = future.GetResult(sender); err == nil && aaoa.Response.Response.StatusCode != http.StatusNoContent {
		aaoa, err = client.CreateResponder(aaoa.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.AzureADOnlyAuthenticationsCreateFuture", "Result", aaoa.Response.Response, "Failure responding to request")
		}
	}
	return
}

// AzureCapacity azure capacity definition.
type AzureCapacity struct {
	// ScaleType - Scale type. Possible values include: 'AzureScaleTypeAutomatic', 'AzureScaleTypeManual', 'AzureScaleTypeNone'
	ScaleType AzureScaleType `json:"scaleType,omitempty"`
	// Minimum - Minimum allowed capacity.
	Minimum *int32 `json:"minimum,omitempty"`
	// Maximum - Maximum allowed capacity.
	Maximum *int32 `json:"maximum,omitempty"`
	// Default - The default capacity that would be used.
	Default *int32 `json:"default,omitempty"`
}

// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag.
type AzureEntityResource struct {
	// Etag - READ-ONLY; Resource Etag.
	Etag *string `json:"etag,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for AzureEntityResource.
func (aer AzureEntityResource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// AzureResourceSku azure resource SKU definition.
type AzureResourceSku struct {
	// ResourceType - Resource Namespace and Type.
	ResourceType *string `json:"resourceType,omitempty"`
	// Sku - The SKU details.
	Sku *AzureSku `json:"sku,omitempty"`
	// Capacity - The number of instances of the cluster.
	Capacity *AzureCapacity `json:"capacity,omitempty"`
}

// AzureSku azure SKU definition.
type AzureSku struct {
	// Name - SKU name. Possible values include: 'SkuNameComputeoptimized', 'SkuNameStorageoptimized'
	Name SkuName `json:"name,omitempty"`
	// Capacity - The number of instances of the cluster.
	Capacity *int32 `json:"capacity,omitempty"`
	// Size - SKU size. Possible values include: 'SkuSizeExtrasmall', 'SkuSizeSmall', 'SkuSizeMedium', 'SkuSizeLarge'
	Size SkuSize `json:"size,omitempty"`
}

// BigDataPoolPatchInfo properties patch for a Big Data pool
type BigDataPoolPatchInfo struct {
	// Tags - Updated tags for the Big Data pool
	Tags map[string]*string `json:"tags"`
}

// MarshalJSON is the custom marshaler for BigDataPoolPatchInfo.
func (bdppi BigDataPoolPatchInfo) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if bdppi.Tags != nil {
		objectMap["tags"] = bdppi.Tags
	}
	return json.Marshal(objectMap)
}

// BigDataPoolResourceInfo a Big Data pool
type BigDataPoolResourceInfo struct {
	autorest.Response `json:"-"`
	// BigDataPoolResourceProperties - Big Data pool properties
	*BigDataPoolResourceProperties `json:"properties,omitempty"`
	// Tags - Resource tags.
	Tags map[string]*string `json:"tags"`
	// Location - The geo-location where the resource lives
	Location *string `json:"location,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for BigDataPoolResourceInfo.
func (bdpri BigDataPoolResourceInfo) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if bdpri.BigDataPoolResourceProperties != nil {
		objectMap["properties"] = bdpri.BigDataPoolResourceProperties
	}
	if bdpri.Tags != nil {
		objectMap["tags"] = bdpri.Tags
	}
	if bdpri.Location != nil {
		objectMap["location"] = bdpri.Location
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for BigDataPoolResourceInfo struct.
func (bdpri *BigDataPoolResourceInfo) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var bigDataPoolResourceProperties BigDataPoolResourceProperties
				err = json.Unmarshal(*v, &bigDataPoolResourceProperties)
				if err != nil {
					return err
				}
				bdpri.BigDataPoolResourceProperties = &bigDataPoolResourceProperties
			}
		case "tags":
			if v != nil {
				var tags map[string]*string
				err = json.Unmarshal(*v, &tags)
				if err != nil {
					return err
				}
				bdpri.Tags = tags
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				bdpri.Location = &location
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				bdpri.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				bdpri.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				bdpri.Type = &typeVar
			}
		}
	}

	return nil
}

// BigDataPoolResourceInfoListResult collection of Big Data pool information
type BigDataPoolResourceInfoListResult struct {
	autorest.Response `json:"-"`
	// NextLink - Link to the next page of results
	NextLink *string `json:"nextLink,omitempty"`
	// Value - List of Big Data pools
	Value *[]BigDataPoolResourceInfo `json:"value,omitempty"`
}

// BigDataPoolResourceInfoListResultIterator provides access to a complete listing of
// BigDataPoolResourceInfo values.
type BigDataPoolResourceInfoListResultIterator struct {
	i    int
	page BigDataPoolResourceInfoListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *BigDataPoolResourceInfoListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/BigDataPoolResourceInfoListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *BigDataPoolResourceInfoListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter BigDataPoolResourceInfoListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter BigDataPoolResourceInfoListResultIterator) Response() BigDataPoolResourceInfoListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter BigDataPoolResourceInfoListResultIterator) Value() BigDataPoolResourceInfo {
	if !iter.page.NotDone() {
		return BigDataPoolResourceInfo{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the BigDataPoolResourceInfoListResultIterator type.
func NewBigDataPoolResourceInfoListResultIterator(page BigDataPoolResourceInfoListResultPage) BigDataPoolResourceInfoListResultIterator {
	return BigDataPoolResourceInfoListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (bdprilr BigDataPoolResourceInfoListResult) IsEmpty() bool {
	return bdprilr.Value == nil || len(*bdprilr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (bdprilr BigDataPoolResourceInfoListResult) hasNextLink() bool {
	return bdprilr.NextLink != nil && len(*bdprilr.NextLink) != 0
}

// bigDataPoolResourceInfoListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (bdprilr BigDataPoolResourceInfoListResult) bigDataPoolResourceInfoListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !bdprilr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(bdprilr.NextLink)))
}

// BigDataPoolResourceInfoListResultPage contains a page of BigDataPoolResourceInfo values.
type BigDataPoolResourceInfoListResultPage struct {
	fn      func(context.Context, BigDataPoolResourceInfoListResult) (BigDataPoolResourceInfoListResult, error)
	bdprilr BigDataPoolResourceInfoListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *BigDataPoolResourceInfoListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/BigDataPoolResourceInfoListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.bdprilr)
		if err != nil {
			return err
		}
		page.bdprilr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *BigDataPoolResourceInfoListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page BigDataPoolResourceInfoListResultPage) NotDone() bool {
	return !page.bdprilr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page BigDataPoolResourceInfoListResultPage) Response() BigDataPoolResourceInfoListResult {
	return page.bdprilr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page BigDataPoolResourceInfoListResultPage) Values() []BigDataPoolResourceInfo {
	if page.bdprilr.IsEmpty() {
		return nil
	}
	return *page.bdprilr.Value
}

// Creates a new instance of the BigDataPoolResourceInfoListResultPage type.
func NewBigDataPoolResourceInfoListResultPage(cur BigDataPoolResourceInfoListResult, getNextPage func(context.Context, BigDataPoolResourceInfoListResult) (BigDataPoolResourceInfoListResult, error)) BigDataPoolResourceInfoListResultPage {
	return BigDataPoolResourceInfoListResultPage{
		fn:      getNextPage,
		bdprilr: cur,
	}
}

// BigDataPoolResourceProperties properties of a Big Data pool powered by Apache Spark
type BigDataPoolResourceProperties struct {
	// ProvisioningState - The state of the Big Data pool.
	ProvisioningState *string `json:"provisioningState,omitempty"`
	// AutoScale - Auto-scaling properties
	AutoScale *AutoScaleProperties `json:"autoScale,omitempty"`
	// CreationDate - READ-ONLY; The time when the Big Data pool was created.
	CreationDate *date.Time `json:"creationDate,omitempty"`
	// AutoPause - Auto-pausing properties
	AutoPause *AutoPauseProperties `json:"autoPause,omitempty"`
	// IsComputeIsolationEnabled - Whether compute isolation is required or not.
	IsComputeIsolationEnabled *bool `json:"isComputeIsolationEnabled,omitempty"`
	// SessionLevelPackagesEnabled - Whether session level packages enabled.
	SessionLevelPackagesEnabled *bool `json:"sessionLevelPackagesEnabled,omitempty"`
	// CacheSize - The cache size
	CacheSize *int32 `json:"cacheSize,omitempty"`
	// DynamicExecutorAllocation - Dynamic Executor Allocation
	DynamicExecutorAllocation *DynamicExecutorAllocation `json:"dynamicExecutorAllocation,omitempty"`
	// SparkEventsFolder - The Spark events folder
	SparkEventsFolder *string `json:"sparkEventsFolder,omitempty"`
	// NodeCount - The number of nodes in the Big Data pool.
	NodeCount *int32 `json:"nodeCount,omitempty"`
	// LibraryRequirements - Library version requirements
	LibraryRequirements *LibraryRequirements `json:"libraryRequirements,omitempty"`
	// CustomLibraries - List of custom libraries/packages associated with the spark pool.
	CustomLibraries *[]LibraryInfo `json:"customLibraries,omitempty"`
	// SparkConfigProperties - Spark configuration file to specify additional properties
	SparkConfigProperties *SparkConfigProperties `json:"sparkConfigProperties,omitempty"`
	// SparkVersion - The Apache Spark version.
	SparkVersion *string `json:"sparkVersion,omitempty"`
	// DefaultSparkLogFolder - The default folder where Spark logs will be written.
	DefaultSparkLogFolder *string `json:"defaultSparkLogFolder,omitempty"`
	// NodeSize - The level of compute power that each node in the Big Data pool has. Possible values include: 'NodeSizeNone', 'NodeSizeSmall', 'NodeSizeMedium', 'NodeSizeLarge', 'NodeSizeXLarge', 'NodeSizeXXLarge', 'NodeSizeXXXLarge'
	NodeSize NodeSize `json:"nodeSize,omitempty"`
	// NodeSizeFamily - The kind of nodes that the Big Data pool provides. Possible values include: 'NodeSizeFamilyNone', 'NodeSizeFamilyMemoryOptimized', 'NodeSizeFamilyHardwareAcceleratedFPGA', 'NodeSizeFamilyHardwareAcceleratedGPU'
	NodeSizeFamily NodeSizeFamily `json:"nodeSizeFamily,omitempty"`
	// LastSucceededTimestamp - READ-ONLY; The time when the Big Data pool was updated successfully.
	LastSucceededTimestamp *date.Time `json:"lastSucceededTimestamp,omitempty"`
}

// MarshalJSON is the custom marshaler for BigDataPoolResourceProperties.
func (bdprp BigDataPoolResourceProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if bdprp.ProvisioningState != nil {
		objectMap["provisioningState"] = bdprp.ProvisioningState
	}
	if bdprp.AutoScale != nil {
		objectMap["autoScale"] = bdprp.AutoScale
	}
	if bdprp.AutoPause != nil {
		objectMap["autoPause"] = bdprp.AutoPause
	}
	if bdprp.IsComputeIsolationEnabled != nil {
		objectMap["isComputeIsolationEnabled"] = bdprp.IsComputeIsolationEnabled
	}
	if bdprp.SessionLevelPackagesEnabled != nil {
		objectMap["sessionLevelPackagesEnabled"] = bdprp.SessionLevelPackagesEnabled
	}
	if bdprp.CacheSize != nil {
		objectMap["cacheSize"] = bdprp.CacheSize
	}
	if bdprp.DynamicExecutorAllocation != nil {
		objectMap["dynamicExecutorAllocation"] = bdprp.DynamicExecutorAllocation
	}
	if bdprp.SparkEventsFolder != nil {
		objectMap["sparkEventsFolder"] = bdprp.SparkEventsFolder
	}
	if bdprp.NodeCount != nil {
		objectMap["nodeCount"] = bdprp.NodeCount
	}
	if bdprp.LibraryRequirements != nil {
		objectMap["libraryRequirements"] = bdprp.LibraryRequirements
	}
	if bdprp.CustomLibraries != nil {
		objectMap["customLibraries"] = bdprp.CustomLibraries
	}
	if bdprp.SparkConfigProperties != nil {
		objectMap["sparkConfigProperties"] = bdprp.SparkConfigProperties
	}
	if bdprp.SparkVersion != nil {
		objectMap["sparkVersion"] = bdprp.SparkVersion
	}
	if bdprp.DefaultSparkLogFolder != nil {
		objectMap["defaultSparkLogFolder"] = bdprp.DefaultSparkLogFolder
	}
	if bdprp.NodeSize != "" {
		objectMap["nodeSize"] = bdprp.NodeSize
	}
	if bdprp.NodeSizeFamily != "" {
		objectMap["nodeSizeFamily"] = bdprp.NodeSizeFamily
	}
	return json.Marshal(objectMap)
}

// BigDataPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type BigDataPoolsCreateOrUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(BigDataPoolsClient) (BigDataPoolResourceInfo, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *BigDataPoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for BigDataPoolsCreateOrUpdateFuture.Result.
func (future *BigDataPoolsCreateOrUpdateFuture) result(client BigDataPoolsClient) (bdpri BigDataPoolResourceInfo, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.BigDataPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		bdpri.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.BigDataPoolsCreateOrUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if bdpri.Response.Response, err = future.GetResult(sender); err == nil && bdpri.Response.Response.StatusCode != http.StatusNoContent {
		bdpri, err = client.CreateOrUpdateResponder(bdpri.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.BigDataPoolsCreateOrUpdateFuture", "Result", bdpri.Response.Response, "Failure responding to request")
		}
	}
	return
}

// BigDataPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type BigDataPoolsDeleteFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(BigDataPoolsClient) (SetObject, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *BigDataPoolsDeleteFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for BigDataPoolsDeleteFuture.Result.
func (future *BigDataPoolsDeleteFuture) result(client BigDataPoolsClient) (so SetObject, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.BigDataPoolsDeleteFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		so.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.BigDataPoolsDeleteFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent {
		so, err = client.DeleteResponder(so.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.BigDataPoolsDeleteFuture", "Result", so.Response.Response, "Failure responding to request")
		}
	}
	return
}

// CheckNameAvailabilityRequest a request about whether a workspace name is available
type CheckNameAvailabilityRequest struct {
	// Name - Workspace name
	Name *string `json:"name,omitempty"`
	// Type - Type: workspace
	Type *string `json:"type,omitempty"`
}

// CheckNameAvailabilityResponse a response saying whether the workspace name is available
type CheckNameAvailabilityResponse struct {
	autorest.Response `json:"-"`
	// Message - Validation message
	Message *string `json:"message,omitempty"`
	// Available - Whether the workspace name is available
	Available *bool `json:"available,omitempty"`
	// Reason - Reason the workspace name is or is not available
	Reason *string `json:"reason,omitempty"`
	// Name - Workspace name
	Name *string `json:"name,omitempty"`
}

// CheckNameResult the result returned from a check name availability request.
type CheckNameResult struct {
	autorest.Response `json:"-"`
	// NameAvailable - Specifies a Boolean value that indicates if the name is available.
	NameAvailable *bool `json:"nameAvailable,omitempty"`
	// Name - The name that was checked.
	Name *string `json:"name,omitempty"`
	// Message - Message indicating an unavailable name due to a conflict, or a description of the naming rules that are violated.
	Message *string `json:"message,omitempty"`
	// Reason - Message providing the reason why the given name is invalid. Possible values include: 'ReasonInvalid', 'ReasonAlreadyExists'
	Reason Reason `json:"reason,omitempty"`
}

// ClusterPrincipalAssignment class representing a cluster principal assignment.
type ClusterPrincipalAssignment struct {
	autorest.Response `json:"-"`
	// ClusterPrincipalProperties - The cluster principal.
	*ClusterPrincipalProperties `json:"properties,omitempty"`
	// SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData `json:"systemData,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for ClusterPrincipalAssignment.
func (cpa ClusterPrincipalAssignment) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if cpa.ClusterPrincipalProperties != nil {
		objectMap["properties"] = cpa.ClusterPrincipalProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for ClusterPrincipalAssignment struct.
func (cpa *ClusterPrincipalAssignment) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var clusterPrincipalProperties ClusterPrincipalProperties
				err = json.Unmarshal(*v, &clusterPrincipalProperties)
				if err != nil {
					return err
				}
				cpa.ClusterPrincipalProperties = &clusterPrincipalProperties
			}
		case "systemData":
			if v != nil {
				var systemData SystemData
				err = json.Unmarshal(*v, &systemData)
				if err != nil {
					return err
				}
				cpa.SystemData = &systemData
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				cpa.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				cpa.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				cpa.Type = &typeVar
			}
		}
	}

	return nil
}

// ClusterPrincipalAssignmentCheckNameRequest a principal assignment check name availability request.
type ClusterPrincipalAssignmentCheckNameRequest struct {
	// Name - Principal Assignment resource name.
	Name *string `json:"name,omitempty"`
	// Type - The type of resource, Microsoft.Synapse/workspaces/kustoPools/principalAssignments.
	Type *string `json:"type,omitempty"`
}

// ClusterPrincipalAssignmentListResult the list Kusto cluster principal assignments operation response.
type ClusterPrincipalAssignmentListResult struct {
	autorest.Response `json:"-"`
	// Value - The list of Kusto cluster principal assignments.
	Value *[]ClusterPrincipalAssignment `json:"value,omitempty"`
}

// ClusterPrincipalProperties a class representing cluster principal property.
type ClusterPrincipalProperties struct {
	// PrincipalID - The principal ID assigned to the cluster principal. It can be a user email, application ID, or security group name.
	PrincipalID *string `json:"principalId,omitempty"`
	// Role - Cluster principal role. Possible values include: 'ClusterPrincipalRoleAllDatabasesAdmin', 'ClusterPrincipalRoleAllDatabasesViewer'
	Role ClusterPrincipalRole `json:"role,omitempty"`
	// TenantID - The tenant id of the principal
	TenantID *string `json:"tenantId,omitempty"`
	// PrincipalType - Principal type. Possible values include: 'PrincipalTypeApp', 'PrincipalTypeGroup', 'PrincipalTypeUser'
	PrincipalType PrincipalType `json:"principalType,omitempty"`
	// TenantName - READ-ONLY; The tenant name of the principal
	TenantName *string `json:"tenantName,omitempty"`
	// PrincipalName - READ-ONLY; The principal name
	PrincipalName *string `json:"principalName,omitempty"`
	// ProvisioningState - The provisioned state of the resource. Possible values include: 'ResourceProvisioningStateRunning', 'ResourceProvisioningStateCreating', 'ResourceProvisioningStateDeleting', 'ResourceProvisioningStateSucceeded', 'ResourceProvisioningStateFailed', 'ResourceProvisioningStateMoving', 'ResourceProvisioningStateCanceled'
	ProvisioningState ResourceProvisioningState `json:"provisioningState,omitempty"`
}

// MarshalJSON is the custom marshaler for ClusterPrincipalProperties.
func (cpp ClusterPrincipalProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if cpp.PrincipalID != nil {
		objectMap["principalId"] = cpp.PrincipalID
	}
	if cpp.Role != "" {
		objectMap["role"] = cpp.Role
	}
	if cpp.TenantID != nil {
		objectMap["tenantId"] = cpp.TenantID
	}
	if cpp.PrincipalType != "" {
		objectMap["principalType"] = cpp.PrincipalType
	}
	if cpp.ProvisioningState != "" {
		objectMap["provisioningState"] = cpp.ProvisioningState
	}
	return json.Marshal(objectMap)
}

// CmdkeySetup the custom setup of running cmdkey commands.
type CmdkeySetup struct {
	// CmdkeySetupTypeProperties - Cmdkey command custom setup type properties.
	*CmdkeySetupTypeProperties `json:"typeProperties,omitempty"`
	// Type - Possible values include: 'TypeBasicCustomSetupBaseTypeCustomSetupBase', 'TypeBasicCustomSetupBaseTypeCmdkeySetup', 'TypeBasicCustomSetupBaseTypeEnvironmentVariableSetup', 'TypeBasicCustomSetupBaseTypeComponentSetup'
	Type TypeBasicCustomSetupBase `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for CmdkeySetup.
func (cs CmdkeySetup) MarshalJSON() ([]byte, error) {
	cs.Type = TypeBasicCustomSetupBaseTypeCmdkeySetup
	objectMap := make(map[string]interface{})
	if cs.CmdkeySetupTypeProperties != nil {
		objectMap["typeProperties"] = cs.CmdkeySetupTypeProperties
	}
	if cs.Type != "" {
		objectMap["type"] = cs.Type
	}
	return json.Marshal(objectMap)
}

// AsCmdkeySetup is the BasicCustomSetupBase implementation for CmdkeySetup.
func (cs CmdkeySetup) AsCmdkeySetup() (*CmdkeySetup, bool) {
	return &cs, true
}

// AsEnvironmentVariableSetup is the BasicCustomSetupBase implementation for CmdkeySetup.
func (cs CmdkeySetup) AsEnvironmentVariableSetup() (*EnvironmentVariableSetup, bool) {
	return nil, false
}

// AsComponentSetup is the BasicCustomSetupBase implementation for CmdkeySetup.
func (cs CmdkeySetup) AsComponentSetup() (*ComponentSetup, bool) {
	return nil, false
}

// AsCustomSetupBase is the BasicCustomSetupBase implementation for CmdkeySetup.
func (cs CmdkeySetup) AsCustomSetupBase() (*CustomSetupBase, bool) {
	return nil, false
}

// AsBasicCustomSetupBase is the BasicCustomSetupBase implementation for CmdkeySetup.
func (cs CmdkeySetup) AsBasicCustomSetupBase() (BasicCustomSetupBase, bool) {
	return &cs, true
}

// UnmarshalJSON is the custom unmarshaler for CmdkeySetup struct.
func (cs *CmdkeySetup) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "typeProperties":
			if v != nil {
				var cmdkeySetupTypeProperties CmdkeySetupTypeProperties
				err = json.Unmarshal(*v, &cmdkeySetupTypeProperties)
				if err != nil {
					return err
				}
				cs.CmdkeySetupTypeProperties = &cmdkeySetupTypeProperties
			}
		case "type":
			if v != nil {
				var typeVar TypeBasicCustomSetupBase
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				cs.Type = typeVar
			}
		}
	}

	return nil
}

// CmdkeySetupTypeProperties cmdkey command custom setup type properties.
type CmdkeySetupTypeProperties struct {
	// TargetName - The server name of data source access.
	TargetName interface{} `json:"targetName,omitempty"`
	// UserName - The user name of data source access.
	UserName interface{} `json:"userName,omitempty"`
	// Password - The password of data source access.
	Password BasicSecretBase `json:"password,omitempty"`
}

// UnmarshalJSON is the custom unmarshaler for CmdkeySetupTypeProperties struct.
func (cstp *CmdkeySetupTypeProperties) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "targetName":
			if v != nil {
				var targetName interface{}
				err = json.Unmarshal(*v, &targetName)
				if err != nil {
					return err
				}
				cstp.TargetName = targetName
			}
		case "userName":
			if v != nil {
				var userName interface{}
				err = json.Unmarshal(*v, &userName)
				if err != nil {
					return err
				}
				cstp.UserName = userName
			}
		case "password":
			if v != nil {
				password, err := unmarshalBasicSecretBase(*v)
				if err != nil {
					return err
				}
				cstp.Password = password
			}
		}
	}

	return nil
}

// ComponentSetup the custom setup of installing 3rd party components.
type ComponentSetup struct {
	// LicensedComponentSetupTypeProperties - Install 3rd party component type properties.
	*LicensedComponentSetupTypeProperties `json:"typeProperties,omitempty"`
	// Type - Possible values include: 'TypeBasicCustomSetupBaseTypeCustomSetupBase', 'TypeBasicCustomSetupBaseTypeCmdkeySetup', 'TypeBasicCustomSetupBaseTypeEnvironmentVariableSetup', 'TypeBasicCustomSetupBaseTypeComponentSetup'
	Type TypeBasicCustomSetupBase `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for ComponentSetup.
func (cs ComponentSetup) MarshalJSON() ([]byte, error) {
	cs.Type = TypeBasicCustomSetupBaseTypeComponentSetup
	objectMap := make(map[string]interface{})
	if cs.LicensedComponentSetupTypeProperties != nil {
		objectMap["typeProperties"] = cs.LicensedComponentSetupTypeProperties
	}
	if cs.Type != "" {
		objectMap["type"] = cs.Type
	}
	return json.Marshal(objectMap)
}

// AsCmdkeySetup is the BasicCustomSetupBase implementation for ComponentSetup.
func (cs ComponentSetup) AsCmdkeySetup() (*CmdkeySetup, bool) {
	return nil, false
}

// AsEnvironmentVariableSetup is the BasicCustomSetupBase implementation for ComponentSetup.
func (cs ComponentSetup) AsEnvironmentVariableSetup() (*EnvironmentVariableSetup, bool) {
	return nil, false
}

// AsComponentSetup is the BasicCustomSetupBase implementation for ComponentSetup.
func (cs ComponentSetup) AsComponentSetup() (*ComponentSetup, bool) {
	return &cs, true
}

// AsCustomSetupBase is the BasicCustomSetupBase implementation for ComponentSetup.
func (cs ComponentSetup) AsCustomSetupBase() (*CustomSetupBase, bool) {
	return nil, false
}

// AsBasicCustomSetupBase is the BasicCustomSetupBase implementation for ComponentSetup.
func (cs ComponentSetup) AsBasicCustomSetupBase() (BasicCustomSetupBase, bool) {
	return &cs, true
}

// UnmarshalJSON is the custom unmarshaler for ComponentSetup struct.
func (cs *ComponentSetup) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "typeProperties":
			if v != nil {
				var licensedComponentSetupTypeProperties LicensedComponentSetupTypeProperties
				err = json.Unmarshal(*v, &licensedComponentSetupTypeProperties)
				if err != nil {
					return err
				}
				cs.LicensedComponentSetupTypeProperties = &licensedComponentSetupTypeProperties
			}
		case "type":
			if v != nil {
				var typeVar TypeBasicCustomSetupBase
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				cs.Type = typeVar
			}
		}
	}

	return nil
}

// CreateSQLPoolRestorePointDefinition contains the information necessary to perform a create Sql pool
// restore point operation.
type CreateSQLPoolRestorePointDefinition struct {
	// RestorePointLabel - The restore point label to apply
	RestorePointLabel *string `json:"restorePointLabel,omitempty"`
}

// CspWorkspaceAdminProperties initial workspace AAD admin properties for a CSP subscription
type CspWorkspaceAdminProperties struct {
	// InitialWorkspaceAdminObjectID - AAD object ID of initial workspace admin
	InitialWorkspaceAdminObjectID *string `json:"initialWorkspaceAdminObjectId,omitempty"`
}

// CustomerManagedKeyDetails details of the customer managed key associated with the workspace
type CustomerManagedKeyDetails struct {
	// Status - READ-ONLY; The customer managed key status on the workspace
	Status *string `json:"status,omitempty"`
	// Key - The key object of the workspace
	Key *WorkspaceKeyDetails `json:"key,omitempty"`
	// KekIdentity - Key encryption key
	KekIdentity *KekIdentityProperties `json:"kekIdentity,omitempty"`
}

// MarshalJSON is the custom marshaler for CustomerManagedKeyDetails.
func (cmkd CustomerManagedKeyDetails) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if cmkd.Key != nil {
		objectMap["key"] = cmkd.Key
	}
	if cmkd.KekIdentity != nil {
		objectMap["kekIdentity"] = cmkd.KekIdentity
	}
	return json.Marshal(objectMap)
}

// BasicCustomSetupBase the base definition of the custom setup.
type BasicCustomSetupBase interface {
	AsCmdkeySetup() (*CmdkeySetup, bool)
	AsEnvironmentVariableSetup() (*EnvironmentVariableSetup, bool)
	AsComponentSetup() (*ComponentSetup, bool)
	AsCustomSetupBase() (*CustomSetupBase, bool)
}

// CustomSetupBase the base definition of the custom setup.
type CustomSetupBase struct {
	// Type - Possible values include: 'TypeBasicCustomSetupBaseTypeCustomSetupBase', 'TypeBasicCustomSetupBaseTypeCmdkeySetup', 'TypeBasicCustomSetupBaseTypeEnvironmentVariableSetup', 'TypeBasicCustomSetupBaseTypeComponentSetup'
	Type TypeBasicCustomSetupBase `json:"type,omitempty"`
}

func unmarshalBasicCustomSetupBase(body []byte) (BasicCustomSetupBase, error) {
	var m map[string]interface{}
	err := json.Unmarshal(body, &m)
	if err != nil {
		return nil, err
	}

	switch m["type"] {
	case string(TypeBasicCustomSetupBaseTypeCmdkeySetup):
		var cs CmdkeySetup
		err := json.Unmarshal(body, &cs)
		return cs, err
	case string(TypeBasicCustomSetupBaseTypeEnvironmentVariableSetup):
		var evs EnvironmentVariableSetup
		err := json.Unmarshal(body, &evs)
		return evs, err
	case string(TypeBasicCustomSetupBaseTypeComponentSetup):
		var cs ComponentSetup
		err := json.Unmarshal(body, &cs)
		return cs, err
	default:
		var csb CustomSetupBase
		err := json.Unmarshal(body, &csb)
		return csb, err
	}
}
func unmarshalBasicCustomSetupBaseArray(body []byte) ([]BasicCustomSetupBase, error) {
	var rawMessages []*json.RawMessage
	err := json.Unmarshal(body, &rawMessages)
	if err != nil {
		return nil, err
	}

	csbArray := make([]BasicCustomSetupBase, len(rawMessages))

	for index, rawMessage := range rawMessages {
		csb, err := unmarshalBasicCustomSetupBase(*rawMessage)
		if err != nil {
			return nil, err
		}
		csbArray[index] = csb
	}
	return csbArray, nil
}

// MarshalJSON is the custom marshaler for CustomSetupBase.
func (csb CustomSetupBase) MarshalJSON() ([]byte, error) {
	csb.Type = TypeBasicCustomSetupBaseTypeCustomSetupBase
	objectMap := make(map[string]interface{})
	if csb.Type != "" {
		objectMap["type"] = csb.Type
	}
	return json.Marshal(objectMap)
}

// AsCmdkeySetup is the BasicCustomSetupBase implementation for CustomSetupBase.
func (csb CustomSetupBase) AsCmdkeySetup() (*CmdkeySetup, bool) {
	return nil, false
}

// AsEnvironmentVariableSetup is the BasicCustomSetupBase implementation for CustomSetupBase.
func (csb CustomSetupBase) AsEnvironmentVariableSetup() (*EnvironmentVariableSetup, bool) {
	return nil, false
}

// AsComponentSetup is the BasicCustomSetupBase implementation for CustomSetupBase.
func (csb CustomSetupBase) AsComponentSetup() (*ComponentSetup, bool) {
	return nil, false
}

// AsCustomSetupBase is the BasicCustomSetupBase implementation for CustomSetupBase.
func (csb CustomSetupBase) AsCustomSetupBase() (*CustomSetupBase, bool) {
	return &csb, true
}

// AsBasicCustomSetupBase is the BasicCustomSetupBase implementation for CustomSetupBase.
func (csb CustomSetupBase) AsBasicCustomSetupBase() (BasicCustomSetupBase, bool) {
	return &csb, true
}

// BasicDatabase class representing a Kusto database.
type BasicDatabase interface {
	AsReadWriteDatabase() (*ReadWriteDatabase, bool)
	AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool)
	AsDatabase() (*Database, bool)
}

// Database class representing a Kusto database.
type Database struct {
	autorest.Response `json:"-"`
	// Location - Resource location.
	Location *string `json:"location,omitempty"`
	// SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData `json:"systemData,omitempty"`
	// Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing'
	Kind Kind `json:"kind,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

func unmarshalBasicDatabase(body []byte) (BasicDatabase, error) {
	var m map[string]interface{}
	err := json.Unmarshal(body, &m)
	if err != nil {
		return nil, err
	}

	switch m["kind"] {
	case string(KindReadWrite):
		var rwd ReadWriteDatabase
		err := json.Unmarshal(body, &rwd)
		return rwd, err
	case string(KindReadOnlyFollowing):
		var rofd ReadOnlyFollowingDatabase
		err := json.Unmarshal(body, &rofd)
		return rofd, err
	default:
		var d Database
		err := json.Unmarshal(body, &d)
		return d, err
	}
}
func unmarshalBasicDatabaseArray(body []byte) ([]BasicDatabase, error) {
	var rawMessages []*json.RawMessage
	err := json.Unmarshal(body, &rawMessages)
	if err != nil {
		return nil, err
	}

	dArray := make([]BasicDatabase, len(rawMessages))

	for index, rawMessage := range rawMessages {
		d, err := unmarshalBasicDatabase(*rawMessage)
		if err != nil {
			return nil, err
		}
		dArray[index] = d
	}
	return dArray, nil
}

// MarshalJSON is the custom marshaler for Database.
func (d Database) MarshalJSON() ([]byte, error) {
	d.Kind = KindDatabase
	objectMap := make(map[string]interface{})
	if d.Location != nil {
		objectMap["location"] = d.Location
	}
	if d.Kind != "" {
		objectMap["kind"] = d.Kind
	}
	return json.Marshal(objectMap)
}

// AsReadWriteDatabase is the BasicDatabase implementation for Database.
func (d Database) AsReadWriteDatabase() (*ReadWriteDatabase, bool) {
	return nil, false
}

// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for Database.
func (d Database) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) {
	return nil, false
}

// AsDatabase is the BasicDatabase implementation for Database.
func (d Database) AsDatabase() (*Database, bool) {
	return &d, true
}

// AsBasicDatabase is the BasicDatabase implementation for Database.
func (d Database) AsBasicDatabase() (BasicDatabase, bool) {
	return &d, true
}

// DatabaseCheckNameRequest the result returned from a database check name availability request.
type DatabaseCheckNameRequest struct {
	// Name - Resource name.
	Name *string `json:"name,omitempty"`
	// Type - The type of resource, for instance Microsoft.Synapse/workspaces/kustoPools/databases. Possible values include: 'TypeMicrosoftSynapseworkspaceskustoPoolsdatabases', 'TypeMicrosoftSynapseworkspaceskustoPoolsattachedDatabaseConfigurations'
	Type Type `json:"type,omitempty"`
}

// DatabaseListResult the list Kusto databases operation response.
type DatabaseListResult struct {
	autorest.Response `json:"-"`
	// Value - The list of Kusto databases.
	Value *[]BasicDatabase `json:"value,omitempty"`
}

// UnmarshalJSON is the custom unmarshaler for DatabaseListResult struct.
func (dlr *DatabaseListResult) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "value":
			if v != nil {
				value, err := unmarshalBasicDatabaseArray(*v)
				if err != nil {
					return err
				}
				dlr.Value = &value
			}
		}
	}

	return nil
}

// DatabaseModel ...
type DatabaseModel struct {
	autorest.Response `json:"-"`
	Value             BasicDatabase `json:"value,omitempty"`
}

// UnmarshalJSON is the custom unmarshaler for DatabaseModel struct.
func (dm *DatabaseModel) UnmarshalJSON(body []byte) error {
	d, err := unmarshalBasicDatabase(body)
	if err != nil {
		return err
	}
	dm.Value = d

	return nil
}

// DatabasePrincipalAssignment class representing a database principal assignment.
type DatabasePrincipalAssignment struct {
	autorest.Response `json:"-"`
	// DatabasePrincipalProperties - The database principal.
	*DatabasePrincipalProperties `json:"properties,omitempty"`
	// SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData `json:"systemData,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for DatabasePrincipalAssignment.
func (dpa DatabasePrincipalAssignment) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if dpa.DatabasePrincipalProperties != nil {
		objectMap["properties"] = dpa.DatabasePrincipalProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for DatabasePrincipalAssignment struct.
func (dpa *DatabasePrincipalAssignment) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var databasePrincipalProperties DatabasePrincipalProperties
				err = json.Unmarshal(*v, &databasePrincipalProperties)
				if err != nil {
					return err
				}
				dpa.DatabasePrincipalProperties = &databasePrincipalProperties
			}
		case "systemData":
			if v != nil {
				var systemData SystemData
				err = json.Unmarshal(*v, &systemData)
				if err != nil {
					return err
				}
				dpa.SystemData = &systemData
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				dpa.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				dpa.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				dpa.Type = &typeVar
			}
		}
	}

	return nil
}

// DatabasePrincipalAssignmentCheckNameRequest a principal assignment check name availability request.
type DatabasePrincipalAssignmentCheckNameRequest struct {
	// Name - Principal Assignment resource name.
	Name *string `json:"name,omitempty"`
	// Type - The type of resource, Microsoft.Synapse/workspaces/kustoPools/databases/principalAssignments.
	Type *string `json:"type,omitempty"`
}

// DatabasePrincipalAssignmentListResult the list Kusto database principal assignments operation response.
type DatabasePrincipalAssignmentListResult struct {
	autorest.Response `json:"-"`
	// Value - The list of Kusto database principal assignments.
	Value *[]DatabasePrincipalAssignment `json:"value,omitempty"`
}

// DatabasePrincipalProperties a class representing database principal property.
type DatabasePrincipalProperties struct {
	// PrincipalID - The principal ID assigned to the database principal. It can be a user email, application ID, or security group name.
	PrincipalID *string `json:"principalId,omitempty"`
	// Role - Database principal role. Possible values include: 'DatabasePrincipalRoleAdmin', 'DatabasePrincipalRoleIngestor', 'DatabasePrincipalRoleMonitor', 'DatabasePrincipalRoleUser', 'DatabasePrincipalRoleUnrestrictedViewer', 'DatabasePrincipalRoleViewer'
	Role DatabasePrincipalRole `json:"role,omitempty"`
	// TenantID - The tenant id of the principal
	TenantID *string `json:"tenantId,omitempty"`
	// PrincipalType - Principal type. Possible values include: 'PrincipalTypeApp', 'PrincipalTypeGroup', 'PrincipalTypeUser'
	PrincipalType PrincipalType `json:"principalType,omitempty"`
	// TenantName - READ-ONLY; The tenant name of the principal
	TenantName *string `json:"tenantName,omitempty"`
	// PrincipalName - READ-ONLY; The principal name
	PrincipalName *string `json:"principalName,omitempty"`
	// ProvisioningState - The provisioned state of the resource. Possible values include: 'ResourceProvisioningStateRunning', 'ResourceProvisioningStateCreating', 'ResourceProvisioningStateDeleting', 'ResourceProvisioningStateSucceeded', 'ResourceProvisioningStateFailed', 'ResourceProvisioningStateMoving', 'ResourceProvisioningStateCanceled'
	ProvisioningState ResourceProvisioningState `json:"provisioningState,omitempty"`
}

// MarshalJSON is the custom marshaler for DatabasePrincipalProperties.
func (dpp DatabasePrincipalProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if dpp.PrincipalID != nil {
		objectMap["principalId"] = dpp.PrincipalID
	}
	if dpp.Role != "" {
		objectMap["role"] = dpp.Role
	}
	if dpp.TenantID != nil {
		objectMap["tenantId"] = dpp.TenantID
	}
	if dpp.PrincipalType != "" {
		objectMap["principalType"] = dpp.PrincipalType
	}
	if dpp.ProvisioningState != "" {
		objectMap["provisioningState"] = dpp.ProvisioningState
	}
	return json.Marshal(objectMap)
}

// DatabaseStatistics a class that contains database statistics information.
type DatabaseStatistics struct {
	// Size - The database size - the total size of compressed data and index in bytes.
	Size *float64 `json:"size,omitempty"`
}

// BasicDataConnection class representing a data connection.
type BasicDataConnection interface {
	AsEventHubDataConnection() (*EventHubDataConnection, bool)
	AsIotHubDataConnection() (*IotHubDataConnection, bool)
	AsEventGridDataConnection() (*EventGridDataConnection, bool)
	AsDataConnection() (*DataConnection, bool)
}

// DataConnection class representing a data connection.
type DataConnection struct {
	autorest.Response `json:"-"`
	// Location - Resource location.
	Location *string `json:"location,omitempty"`
	// SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData `json:"systemData,omitempty"`
	// Kind - Possible values include: 'KindBasicDataConnectionKindDataConnection', 'KindBasicDataConnectionKindEventHub', 'KindBasicDataConnectionKindIotHub', 'KindBasicDataConnectionKindEventGrid'
	Kind KindBasicDataConnection `json:"kind,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

func unmarshalBasicDataConnection(body []byte) (BasicDataConnection, error) {
	var m map[string]interface{}
	err := json.Unmarshal(body, &m)
	if err != nil {
		return nil, err
	}

	switch m["kind"] {
	case string(KindBasicDataConnectionKindEventHub):
		var ehdc EventHubDataConnection
		err := json.Unmarshal(body, &ehdc)
		return ehdc, err
	case string(KindBasicDataConnectionKindIotHub):
		var ihdc IotHubDataConnection
		err := json.Unmarshal(body, &ihdc)
		return ihdc, err
	case string(KindBasicDataConnectionKindEventGrid):
		var egdc EventGridDataConnection
		err := json.Unmarshal(body, &egdc)
		return egdc, err
	default:
		var dc DataConnection
		err := json.Unmarshal(body, &dc)
		return dc, err
	}
}
func unmarshalBasicDataConnectionArray(body []byte) ([]BasicDataConnection, error) {
	var rawMessages []*json.RawMessage
	err := json.Unmarshal(body, &rawMessages)
	if err != nil {
		return nil, err
	}

	dcArray := make([]BasicDataConnection, len(rawMessages))

	for index, rawMessage := range rawMessages {
		dc, err := unmarshalBasicDataConnection(*rawMessage)
		if err != nil {
			return nil, err
		}
		dcArray[index] = dc
	}
	return dcArray, nil
}

// MarshalJSON is the custom marshaler for DataConnection.
func (dc DataConnection) MarshalJSON() ([]byte, error) {
	dc.Kind = KindBasicDataConnectionKindDataConnection
	objectMap := make(map[string]interface{})
	if dc.Location != nil {
		objectMap["location"] = dc.Location
	}
	if dc.Kind != "" {
		objectMap["kind"] = dc.Kind
	}
	return json.Marshal(objectMap)
}

// AsEventHubDataConnection is the BasicDataConnection implementation for DataConnection.
func (dc DataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) {
	return nil, false
}

// AsIotHubDataConnection is the BasicDataConnection implementation for DataConnection.
func (dc DataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) {
	return nil, false
}

// AsEventGridDataConnection is the BasicDataConnection implementation for DataConnection.
func (dc DataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) {
	return nil, false
}

// AsDataConnection is the BasicDataConnection implementation for DataConnection.
func (dc DataConnection) AsDataConnection() (*DataConnection, bool) {
	return &dc, true
}

// AsBasicDataConnection is the BasicDataConnection implementation for DataConnection.
func (dc DataConnection) AsBasicDataConnection() (BasicDataConnection, bool) {
	return &dc, true
}

// DataConnectionCheckNameRequest a data connection check name availability request.
type DataConnectionCheckNameRequest struct {
	// Name - Data Connection name.
	Name *string `json:"name,omitempty"`
	// Type - The type of resource, Microsoft.Synapse/workspaces/kustoPools/databases/dataConnections.
	Type *string `json:"type,omitempty"`
}

// DataConnectionListResult the list Kusto data connections operation response.
type DataConnectionListResult struct {
	autorest.Response `json:"-"`
	// Value - The list of Kusto data connections.
	Value *[]BasicDataConnection `json:"value,omitempty"`
}

// UnmarshalJSON is the custom unmarshaler for DataConnectionListResult struct.
func (dclr *DataConnectionListResult) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "value":
			if v != nil {
				value, err := unmarshalBasicDataConnectionArray(*v)
				if err != nil {
					return err
				}
				dclr.Value = &value
			}
		}
	}

	return nil
}

// DataConnectionModel ...
type DataConnectionModel struct {
	autorest.Response `json:"-"`
	Value             BasicDataConnection `json:"value,omitempty"`
}

// UnmarshalJSON is the custom unmarshaler for DataConnectionModel struct.
func (dcm *DataConnectionModel) UnmarshalJSON(body []byte) error {
	dc, err := unmarshalBasicDataConnection(body)
	if err != nil {
		return err
	}
	dcm.Value = dc

	return nil
}

// DataConnectionValidation class representing an data connection validation.
type DataConnectionValidation struct {
	// DataConnectionName - The name of the data connection.
	DataConnectionName *string `json:"dataConnectionName,omitempty"`
	// Properties - The data connection properties to validate.
	Properties BasicDataConnection `json:"properties,omitempty"`
}

// UnmarshalJSON is the custom unmarshaler for DataConnectionValidation struct.
func (dcv *DataConnectionValidation) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "dataConnectionName":
			if v != nil {
				var dataConnectionName string
				err = json.Unmarshal(*v, &dataConnectionName)
				if err != nil {
					return err
				}
				dcv.DataConnectionName = &dataConnectionName
			}
		case "properties":
			if v != nil {
				properties, err := unmarshalBasicDataConnection(*v)
				if err != nil {
					return err
				}
				dcv.Properties = properties
			}
		}
	}

	return nil
}

// DataConnectionValidationListResult the list Kusto data connection validation result.
type DataConnectionValidationListResult struct {
	autorest.Response `json:"-"`
	// Value - The list of Kusto data connection validation errors.
	Value *[]DataConnectionValidationResult `json:"value,omitempty"`
}

// DataConnectionValidationResult the result returned from a data connection validation request.
type DataConnectionValidationResult struct {
	// ErrorMessage - A message which indicates a problem in data connection validation.
	ErrorMessage *string `json:"errorMessage,omitempty"`
}

// DataLakeStorageAccountDetails details of the data lake storage account associated with the workspace
type DataLakeStorageAccountDetails struct {
	// AccountURL - Account URL
	AccountURL *string `json:"accountUrl,omitempty"`
	// Filesystem - Filesystem name
	Filesystem *string `json:"filesystem,omitempty"`
	// ResourceID - ARM resource Id of this storage account
	ResourceID *string `json:"resourceId,omitempty"`
	// CreateManagedPrivateEndpoint - Create managed private endpoint to this storage account or not
	CreateManagedPrivateEndpoint *bool `json:"createManagedPrivateEndpoint,omitempty"`
}

// DataMaskingPolicy ...
type DataMaskingPolicy struct {
	autorest.Response `json:"-"`
	// DataMaskingPolicyProperties - The properties of the data masking policy.
	*DataMaskingPolicyProperties `json:"properties,omitempty"`
	// Location - READ-ONLY; The location of the data masking policy.
	Location *string `json:"location,omitempty"`
	// Kind - READ-ONLY; The kind of data masking policy. Metadata, used for Azure portal.
	Kind *string `json:"kind,omitempty"`
	// ManagedBy - READ-ONLY; Fully qualified resource ID of the sql pool
	ManagedBy *string `json:"managedBy,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for DataMaskingPolicy.
func (dmp DataMaskingPolicy) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if dmp.DataMaskingPolicyProperties != nil {
		objectMap["properties"] = dmp.DataMaskingPolicyProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for DataMaskingPolicy struct.
func (dmp *DataMaskingPolicy) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var dataMaskingPolicyProperties DataMaskingPolicyProperties
				err = json.Unmarshal(*v, &dataMaskingPolicyProperties)
				if err != nil {
					return err
				}
				dmp.DataMaskingPolicyProperties = &dataMaskingPolicyProperties
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				dmp.Location = &location
			}
		case "kind":
			if v != nil {
				var kind string
				err = json.Unmarshal(*v, &kind)
				if err != nil {
					return err
				}
				dmp.Kind = &kind
			}
		case "managedBy":
			if v != nil {
				var managedBy string
				err = json.Unmarshal(*v, &managedBy)
				if err != nil {
					return err
				}
				dmp.ManagedBy = &managedBy
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				dmp.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				dmp.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				dmp.Type = &typeVar
			}
		}
	}

	return nil
}

// DataMaskingPolicyProperties the properties of a database data masking policy.
type DataMaskingPolicyProperties struct {
	// DataMaskingState - The state of the data masking policy. Possible values include: 'DataMaskingStateDisabled', 'DataMaskingStateEnabled'
	DataMaskingState DataMaskingState `json:"dataMaskingState,omitempty"`
	// ExemptPrincipals - The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. The specified users receive data results without masking for all of the database queries.
	ExemptPrincipals *string `json:"exemptPrincipals,omitempty"`
	// ApplicationPrincipals - READ-ONLY; The list of the application principals. This is a legacy parameter and is no longer used.
	ApplicationPrincipals *string `json:"applicationPrincipals,omitempty"`
	// MaskingLevel - READ-ONLY; The masking level. This is a legacy parameter and is no longer used.
	MaskingLevel *string `json:"maskingLevel,omitempty"`
}

// MarshalJSON is the custom marshaler for DataMaskingPolicyProperties.
func (dmpp DataMaskingPolicyProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if dmpp.DataMaskingState != "" {
		objectMap["dataMaskingState"] = dmpp.DataMaskingState
	}
	if dmpp.ExemptPrincipals != nil {
		objectMap["exemptPrincipals"] = dmpp.ExemptPrincipals
	}
	return json.Marshal(objectMap)
}

// DataMaskingRule represents a Sql pool data masking rule.
type DataMaskingRule struct {
	autorest.Response `json:"-"`
	// DataMaskingRuleProperties - The properties of the resource.
	*DataMaskingRuleProperties `json:"properties,omitempty"`
	// Location - READ-ONLY; The location of the data masking rule.
	Location *string `json:"location,omitempty"`
	// Kind - READ-ONLY; The kind of Data Masking Rule. Metadata, used for Azure portal.
	Kind *string `json:"kind,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for DataMaskingRule.
func (dmr DataMaskingRule) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if dmr.DataMaskingRuleProperties != nil {
		objectMap["properties"] = dmr.DataMaskingRuleProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for DataMaskingRule struct.
func (dmr *DataMaskingRule) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var dataMaskingRuleProperties DataMaskingRuleProperties
				err = json.Unmarshal(*v, &dataMaskingRuleProperties)
				if err != nil {
					return err
				}
				dmr.DataMaskingRuleProperties = &dataMaskingRuleProperties
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				dmr.Location = &location
			}
		case "kind":
			if v != nil {
				var kind string
				err = json.Unmarshal(*v, &kind)
				if err != nil {
					return err
				}
				dmr.Kind = &kind
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				dmr.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				dmr.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				dmr.Type = &typeVar
			}
		}
	}

	return nil
}

// DataMaskingRuleListResult the response to a list data masking rules request.
type DataMaskingRuleListResult struct {
	autorest.Response `json:"-"`
	// Value - The list of Sql pool data masking rules.
	Value *[]DataMaskingRule `json:"value,omitempty"`
}

// DataMaskingRuleProperties the properties of a Sql pool data masking rule.
type DataMaskingRuleProperties struct {
	// ID - READ-ONLY; The rule Id.
	ID *string `json:"id,omitempty"`
	// AliasName - The alias name. This is a legacy parameter and is no longer used.
	AliasName *string `json:"aliasName,omitempty"`
	// RuleState - The rule state. Used to delete a rule. To delete an existing rule, specify the schemaName, tableName, columnName, maskingFunction, and specify ruleState as disabled. However, if the rule doesn't already exist, the rule will be created with ruleState set to enabled, regardless of the provided value of ruleState. Possible values include: 'DataMaskingRuleStateDisabled', 'DataMaskingRuleStateEnabled'
	RuleState DataMaskingRuleState `json:"ruleState,omitempty"`
	// SchemaName - The schema name on which the data masking rule is applied.
	SchemaName *string `json:"schemaName,omitempty"`
	// TableName - The table name on which the data masking rule is applied.
	TableName *string `json:"tableName,omitempty"`
	// ColumnName - The column name on which the data masking rule is applied.
	ColumnName *string `json:"columnName,omitempty"`
	// MaskingFunction - The masking function that is used for the data masking rule. Possible values include: 'DataMaskingFunctionDefault', 'DataMaskingFunctionCCN', 'DataMaskingFunctionEmail', 'DataMaskingFunctionNumber', 'DataMaskingFunctionSSN', 'DataMaskingFunctionText'
	MaskingFunction DataMaskingFunction `json:"maskingFunction,omitempty"`
	// NumberFrom - The numberFrom property of the masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.
	NumberFrom *string `json:"numberFrom,omitempty"`
	// NumberTo - The numberTo property of the data masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.
	NumberTo *string `json:"numberTo,omitempty"`
	// PrefixSize - If maskingFunction is set to Text, the number of characters to show unmasked in the beginning of the string. Otherwise, this parameter will be ignored.
	PrefixSize *string `json:"prefixSize,omitempty"`
	// SuffixSize - If maskingFunction is set to Text, the number of characters to show unmasked at the end of the string. Otherwise, this parameter will be ignored.
	SuffixSize *string `json:"suffixSize,omitempty"`
	// ReplacementString - If maskingFunction is set to Text, the character to use for masking the unexposed part of the string. Otherwise, this parameter will be ignored.
	ReplacementString *string `json:"replacementString,omitempty"`
}

// MarshalJSON is the custom marshaler for DataMaskingRuleProperties.
func (dmrp DataMaskingRuleProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if dmrp.AliasName != nil {
		objectMap["aliasName"] = dmrp.AliasName
	}
	if dmrp.RuleState != "" {
		objectMap["ruleState"] = dmrp.RuleState
	}
	if dmrp.SchemaName != nil {
		objectMap["schemaName"] = dmrp.SchemaName
	}
	if dmrp.TableName != nil {
		objectMap["tableName"] = dmrp.TableName
	}
	if dmrp.ColumnName != nil {
		objectMap["columnName"] = dmrp.ColumnName
	}
	if dmrp.MaskingFunction != "" {
		objectMap["maskingFunction"] = dmrp.MaskingFunction
	}
	if dmrp.NumberFrom != nil {
		objectMap["numberFrom"] = dmrp.NumberFrom
	}
	if dmrp.NumberTo != nil {
		objectMap["numberTo"] = dmrp.NumberTo
	}
	if dmrp.PrefixSize != nil {
		objectMap["prefixSize"] = dmrp.PrefixSize
	}
	if dmrp.SuffixSize != nil {
		objectMap["suffixSize"] = dmrp.SuffixSize
	}
	if dmrp.ReplacementString != nil {
		objectMap["replacementString"] = dmrp.ReplacementString
	}
	return json.Marshal(objectMap)
}

// DataWarehouseUserActivities user activities of a data warehouse
type DataWarehouseUserActivities struct {
	autorest.Response `json:"-"`
	// DataWarehouseUserActivitiesProperties - Resource properties.
	*DataWarehouseUserActivitiesProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for DataWarehouseUserActivities.
func (dwua DataWarehouseUserActivities) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if dwua.DataWarehouseUserActivitiesProperties != nil {
		objectMap["properties"] = dwua.DataWarehouseUserActivitiesProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for DataWarehouseUserActivities struct.
func (dwua *DataWarehouseUserActivities) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var dataWarehouseUserActivitiesProperties DataWarehouseUserActivitiesProperties
				err = json.Unmarshal(*v, &dataWarehouseUserActivitiesProperties)
				if err != nil {
					return err
				}
				dwua.DataWarehouseUserActivitiesProperties = &dataWarehouseUserActivitiesProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				dwua.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				dwua.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				dwua.Type = &typeVar
			}
		}
	}

	return nil
}

// DataWarehouseUserActivitiesProperties user activities of a data warehouse. This currently includes the
// count of running or suspended queries. For more information, please view the sys.dm_pdw_exec_requests
// dynamic management view (DMV).
type DataWarehouseUserActivitiesProperties struct {
	// ActiveQueriesCount - READ-ONLY; Count of running and suspended queries.
	ActiveQueriesCount *int32 `json:"activeQueriesCount,omitempty"`
}

// MarshalJSON is the custom marshaler for DataWarehouseUserActivitiesProperties.
func (dwuap DataWarehouseUserActivitiesProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// DedicatedSQLminimalTLSSettings dedicated Sql Minimal Tls Settings Info
type DedicatedSQLminimalTLSSettings struct {
	autorest.Response `json:"-"`
	// Location - READ-ONLY; Resource location.
	Location *string `json:"location,omitempty"`
	// DedicatedSQLminimalTLSSettingsProperties - Resource properties.
	*DedicatedSQLminimalTLSSettingsProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for DedicatedSQLminimalTLSSettings.
func (dslts DedicatedSQLminimalTLSSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if dslts.DedicatedSQLminimalTLSSettingsProperties != nil {
		objectMap["properties"] = dslts.DedicatedSQLminimalTLSSettingsProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for DedicatedSQLminimalTLSSettings struct.
func (dslts *DedicatedSQLminimalTLSSettings) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				dslts.Location = &location
			}
		case "properties":
			if v != nil {
				var dedicatedSQLminimalTLSSettingsProperties DedicatedSQLminimalTLSSettingsProperties
				err = json.Unmarshal(*v, &dedicatedSQLminimalTLSSettingsProperties)
				if err != nil {
					return err
				}
				dslts.DedicatedSQLminimalTLSSettingsProperties = &dedicatedSQLminimalTLSSettingsProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				dslts.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				dslts.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				dslts.Type = &typeVar
			}
		}
	}

	return nil
}

// DedicatedSQLminimalTLSSettingsListResult a list of the server's dedicated sql minimal tls settings.
type DedicatedSQLminimalTLSSettingsListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]DedicatedSQLminimalTLSSettings `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for DedicatedSQLminimalTLSSettingsListResult.
func (dsltslr DedicatedSQLminimalTLSSettingsListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// DedicatedSQLminimalTLSSettingsListResultIterator provides access to a complete listing of
// DedicatedSQLminimalTLSSettings values.
type DedicatedSQLminimalTLSSettingsListResultIterator struct {
	i    int
	page DedicatedSQLminimalTLSSettingsListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *DedicatedSQLminimalTLSSettingsListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedSQLminimalTLSSettingsListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *DedicatedSQLminimalTLSSettingsListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter DedicatedSQLminimalTLSSettingsListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter DedicatedSQLminimalTLSSettingsListResultIterator) Response() DedicatedSQLminimalTLSSettingsListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter DedicatedSQLminimalTLSSettingsListResultIterator) Value() DedicatedSQLminimalTLSSettings {
	if !iter.page.NotDone() {
		return DedicatedSQLminimalTLSSettings{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the DedicatedSQLminimalTLSSettingsListResultIterator type.
func NewDedicatedSQLminimalTLSSettingsListResultIterator(page DedicatedSQLminimalTLSSettingsListResultPage) DedicatedSQLminimalTLSSettingsListResultIterator {
	return DedicatedSQLminimalTLSSettingsListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (dsltslr DedicatedSQLminimalTLSSettingsListResult) IsEmpty() bool {
	return dsltslr.Value == nil || len(*dsltslr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (dsltslr DedicatedSQLminimalTLSSettingsListResult) hasNextLink() bool {
	return dsltslr.NextLink != nil && len(*dsltslr.NextLink) != 0
}

// dedicatedSQLminimalTLSSettingsListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (dsltslr DedicatedSQLminimalTLSSettingsListResult) dedicatedSQLminimalTLSSettingsListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !dsltslr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(dsltslr.NextLink)))
}

// DedicatedSQLminimalTLSSettingsListResultPage contains a page of DedicatedSQLminimalTLSSettings values.
type DedicatedSQLminimalTLSSettingsListResultPage struct {
	fn      func(context.Context, DedicatedSQLminimalTLSSettingsListResult) (DedicatedSQLminimalTLSSettingsListResult, error)
	dsltslr DedicatedSQLminimalTLSSettingsListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *DedicatedSQLminimalTLSSettingsListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedSQLminimalTLSSettingsListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.dsltslr)
		if err != nil {
			return err
		}
		page.dsltslr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *DedicatedSQLminimalTLSSettingsListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page DedicatedSQLminimalTLSSettingsListResultPage) NotDone() bool {
	return !page.dsltslr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page DedicatedSQLminimalTLSSettingsListResultPage) Response() DedicatedSQLminimalTLSSettingsListResult {
	return page.dsltslr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page DedicatedSQLminimalTLSSettingsListResultPage) Values() []DedicatedSQLminimalTLSSettings {
	if page.dsltslr.IsEmpty() {
		return nil
	}
	return *page.dsltslr.Value
}

// Creates a new instance of the DedicatedSQLminimalTLSSettingsListResultPage type.
func NewDedicatedSQLminimalTLSSettingsListResultPage(cur DedicatedSQLminimalTLSSettingsListResult, getNextPage func(context.Context, DedicatedSQLminimalTLSSettingsListResult) (DedicatedSQLminimalTLSSettingsListResult, error)) DedicatedSQLminimalTLSSettingsListResultPage {
	return DedicatedSQLminimalTLSSettingsListResultPage{
		fn:      getNextPage,
		dsltslr: cur,
	}
}

// DedicatedSQLminimalTLSSettingsPatchInfo dedicated SQL minimal tls settings patch info
type DedicatedSQLminimalTLSSettingsPatchInfo struct {
	// MinimalTLSVersion - minimal tls version
	MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"`
}

// DedicatedSQLminimalTLSSettingsProperties properties of a dedicated sql minimal tls settings.
type DedicatedSQLminimalTLSSettingsProperties struct {
	// MinimalTLSVersion - The minimal tls version of the sql server.
	MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"`
}

// DynamicExecutorAllocation dynamic Executor Allocation Properties
type DynamicExecutorAllocation struct {
	// Enabled - Indicates whether Dynamic Executor Allocation is enabled or not.
	Enabled *bool `json:"enabled,omitempty"`
	// MinExecutors - The minimum number of executors alloted
	MinExecutors *int32 `json:"minExecutors,omitempty"`
	// MaxExecutors - The maximum number of executors alloted
	MaxExecutors *int32 `json:"maxExecutors,omitempty"`
}

// EncryptionDetails details of the encryption associated with the workspace
type EncryptionDetails struct {
	// DoubleEncryptionEnabled - READ-ONLY; Double Encryption enabled
	DoubleEncryptionEnabled *bool `json:"doubleEncryptionEnabled,omitempty"`
	// Cmk - Customer Managed Key Details
	Cmk *CustomerManagedKeyDetails `json:"cmk,omitempty"`
}

// MarshalJSON is the custom marshaler for EncryptionDetails.
func (ed EncryptionDetails) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if ed.Cmk != nil {
		objectMap["cmk"] = ed.Cmk
	}
	return json.Marshal(objectMap)
}

// EncryptionProtector the server encryption protector.
type EncryptionProtector struct {
	autorest.Response `json:"-"`
	// Kind - READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience.
	Kind *string `json:"kind,omitempty"`
	// Location - READ-ONLY; Resource location.
	Location *string `json:"location,omitempty"`
	// EncryptionProtectorProperties - Resource properties.
	*EncryptionProtectorProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for EncryptionProtector.
func (ep EncryptionProtector) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if ep.EncryptionProtectorProperties != nil {
		objectMap["properties"] = ep.EncryptionProtectorProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for EncryptionProtector struct.
func (ep *EncryptionProtector) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "kind":
			if v != nil {
				var kind string
				err = json.Unmarshal(*v, &kind)
				if err != nil {
					return err
				}
				ep.Kind = &kind
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				ep.Location = &location
			}
		case "properties":
			if v != nil {
				var encryptionProtectorProperties EncryptionProtectorProperties
				err = json.Unmarshal(*v, &encryptionProtectorProperties)
				if err != nil {
					return err
				}
				ep.EncryptionProtectorProperties = &encryptionProtectorProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				ep.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				ep.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				ep.Type = &typeVar
			}
		}
	}

	return nil
}

// EncryptionProtectorListResult a list of server encryption protectors.
type EncryptionProtectorListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]EncryptionProtector `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for EncryptionProtectorListResult.
func (eplr EncryptionProtectorListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// EncryptionProtectorListResultIterator provides access to a complete listing of EncryptionProtector
// values.
type EncryptionProtectorListResultIterator struct {
	i    int
	page EncryptionProtectorListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *EncryptionProtectorListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/EncryptionProtectorListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *EncryptionProtectorListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter EncryptionProtectorListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter EncryptionProtectorListResultIterator) Response() EncryptionProtectorListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter EncryptionProtectorListResultIterator) Value() EncryptionProtector {
	if !iter.page.NotDone() {
		return EncryptionProtector{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the EncryptionProtectorListResultIterator type.
func NewEncryptionProtectorListResultIterator(page EncryptionProtectorListResultPage) EncryptionProtectorListResultIterator {
	return EncryptionProtectorListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (eplr EncryptionProtectorListResult) IsEmpty() bool {
	return eplr.Value == nil || len(*eplr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (eplr EncryptionProtectorListResult) hasNextLink() bool {
	return eplr.NextLink != nil && len(*eplr.NextLink) != 0
}

// encryptionProtectorListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (eplr EncryptionProtectorListResult) encryptionProtectorListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !eplr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(eplr.NextLink)))
}

// EncryptionProtectorListResultPage contains a page of EncryptionProtector values.
type EncryptionProtectorListResultPage struct {
	fn   func(context.Context, EncryptionProtectorListResult) (EncryptionProtectorListResult, error)
	eplr EncryptionProtectorListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *EncryptionProtectorListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/EncryptionProtectorListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.eplr)
		if err != nil {
			return err
		}
		page.eplr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *EncryptionProtectorListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page EncryptionProtectorListResultPage) NotDone() bool {
	return !page.eplr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page EncryptionProtectorListResultPage) Response() EncryptionProtectorListResult {
	return page.eplr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page EncryptionProtectorListResultPage) Values() []EncryptionProtector {
	if page.eplr.IsEmpty() {
		return nil
	}
	return *page.eplr.Value
}

// Creates a new instance of the EncryptionProtectorListResultPage type.
func NewEncryptionProtectorListResultPage(cur EncryptionProtectorListResult, getNextPage func(context.Context, EncryptionProtectorListResult) (EncryptionProtectorListResult, error)) EncryptionProtectorListResultPage {
	return EncryptionProtectorListResultPage{
		fn:   getNextPage,
		eplr: cur,
	}
}

// EncryptionProtectorProperties properties for an encryption protector execution.
type EncryptionProtectorProperties struct {
	// Subregion - READ-ONLY; Subregion of the encryption protector.
	Subregion *string `json:"subregion,omitempty"`
	// ServerKeyName - The name of the server key.
	ServerKeyName *string `json:"serverKeyName,omitempty"`
	// ServerKeyType - The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServerKeyTypeServiceManaged', 'ServerKeyTypeAzureKeyVault'
	ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"`
	// URI - READ-ONLY; The URI of the server key.
	URI *string `json:"uri,omitempty"`
	// Thumbprint - READ-ONLY; Thumbprint of the server key.
	Thumbprint *string `json:"thumbprint,omitempty"`
}

// MarshalJSON is the custom marshaler for EncryptionProtectorProperties.
func (epp EncryptionProtectorProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if epp.ServerKeyName != nil {
		objectMap["serverKeyName"] = epp.ServerKeyName
	}
	if epp.ServerKeyType != "" {
		objectMap["serverKeyType"] = epp.ServerKeyType
	}
	return json.Marshal(objectMap)
}

// EntityReference the entity reference.
type EntityReference struct {
	// Type - The type of this referenced entity. Possible values include: 'IntegrationRuntimeEntityReferenceTypeIntegrationRuntimeReference', 'IntegrationRuntimeEntityReferenceTypeLinkedServiceReference'
	Type IntegrationRuntimeEntityReferenceType `json:"type,omitempty"`
	// ReferenceName - The name of this referenced entity.
	ReferenceName *string `json:"referenceName,omitempty"`
}

// EnvironmentVariableSetup the custom setup of setting environment variable.
type EnvironmentVariableSetup struct {
	// EnvironmentVariableSetupTypeProperties - Add environment variable type properties.
	*EnvironmentVariableSetupTypeProperties `json:"typeProperties,omitempty"`
	// Type - Possible values include: 'TypeBasicCustomSetupBaseTypeCustomSetupBase', 'TypeBasicCustomSetupBaseTypeCmdkeySetup', 'TypeBasicCustomSetupBaseTypeEnvironmentVariableSetup', 'TypeBasicCustomSetupBaseTypeComponentSetup'
	Type TypeBasicCustomSetupBase `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for EnvironmentVariableSetup.
func (evs EnvironmentVariableSetup) MarshalJSON() ([]byte, error) {
	evs.Type = TypeBasicCustomSetupBaseTypeEnvironmentVariableSetup
	objectMap := make(map[string]interface{})
	if evs.EnvironmentVariableSetupTypeProperties != nil {
		objectMap["typeProperties"] = evs.EnvironmentVariableSetupTypeProperties
	}
	if evs.Type != "" {
		objectMap["type"] = evs.Type
	}
	return json.Marshal(objectMap)
}

// AsCmdkeySetup is the BasicCustomSetupBase implementation for EnvironmentVariableSetup.
func (evs EnvironmentVariableSetup) AsCmdkeySetup() (*CmdkeySetup, bool) {
	return nil, false
}

// AsEnvironmentVariableSetup is the BasicCustomSetupBase implementation for EnvironmentVariableSetup.
func (evs EnvironmentVariableSetup) AsEnvironmentVariableSetup() (*EnvironmentVariableSetup, bool) {
	return &evs, true
}

// AsComponentSetup is the BasicCustomSetupBase implementation for EnvironmentVariableSetup.
func (evs EnvironmentVariableSetup) AsComponentSetup() (*ComponentSetup, bool) {
	return nil, false
}

// AsCustomSetupBase is the BasicCustomSetupBase implementation for EnvironmentVariableSetup.
func (evs EnvironmentVariableSetup) AsCustomSetupBase() (*CustomSetupBase, bool) {
	return nil, false
}

// AsBasicCustomSetupBase is the BasicCustomSetupBase implementation for EnvironmentVariableSetup.
func (evs EnvironmentVariableSetup) AsBasicCustomSetupBase() (BasicCustomSetupBase, bool) {
	return &evs, true
}

// UnmarshalJSON is the custom unmarshaler for EnvironmentVariableSetup struct.
func (evs *EnvironmentVariableSetup) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "typeProperties":
			if v != nil {
				var environmentVariableSetupTypeProperties EnvironmentVariableSetupTypeProperties
				err = json.Unmarshal(*v, &environmentVariableSetupTypeProperties)
				if err != nil {
					return err
				}
				evs.EnvironmentVariableSetupTypeProperties = &environmentVariableSetupTypeProperties
			}
		case "type":
			if v != nil {
				var typeVar TypeBasicCustomSetupBase
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				evs.Type = typeVar
			}
		}
	}

	return nil
}

// EnvironmentVariableSetupTypeProperties environment variable custom setup type properties.
type EnvironmentVariableSetupTypeProperties struct {
	// VariableName - The name of the environment variable.
	VariableName *string `json:"variableName,omitempty"`
	// VariableValue - The value of the environment variable.
	VariableValue *string `json:"variableValue,omitempty"`
}

// ErrorAdditionalInfo the resource management error additional info.
type ErrorAdditionalInfo struct {
	// Type - READ-ONLY; The additional info type.
	Type *string `json:"type,omitempty"`
	// Info - READ-ONLY; The additional info.
	Info interface{} `json:"info,omitempty"`
}

// MarshalJSON is the custom marshaler for ErrorAdditionalInfo.
func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// ErrorDetail the error detail.
type ErrorDetail struct {
	// Code - READ-ONLY; The error code.
	Code *string `json:"code,omitempty"`
	// Message - READ-ONLY; The error message.
	Message *string `json:"message,omitempty"`
	// Target - READ-ONLY; The error target.
	Target *string `json:"target,omitempty"`
	// Details - READ-ONLY; The error details.
	Details *[]ErrorDetail `json:"details,omitempty"`
	// AdditionalInfo - READ-ONLY; The error additional info.
	AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
}

// MarshalJSON is the custom marshaler for ErrorDetail.
func (ed ErrorDetail) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for
// failed operations. (This also follows the OData error response format.).
type ErrorResponse struct {
	// Error - The error object.
	Error *ErrorDetail `json:"error,omitempty"`
}

// EventGridConnectionProperties class representing the Kusto event grid connection properties.
type EventGridConnectionProperties struct {
	// StorageAccountResourceID - The resource ID of the storage account where the data resides.
	StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"`
	// EventHubResourceID - The resource ID where the event grid is configured to send events.
	EventHubResourceID *string `json:"eventHubResourceId,omitempty"`
	// ConsumerGroup - The event hub consumer group.
	ConsumerGroup *string `json:"consumerGroup,omitempty"`
	// TableName - The table where the data should be ingested. Optionally the table information can be added to each message.
	TableName *string `json:"tableName,omitempty"`
	// MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.
	MappingRuleName *string `json:"mappingRuleName,omitempty"`
	// DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'EventGridDataFormatMULTIJSON', 'EventGridDataFormatJSON', 'EventGridDataFormatCSV', 'EventGridDataFormatTSV', 'EventGridDataFormatSCSV', 'EventGridDataFormatSOHSV', 'EventGridDataFormatPSV', 'EventGridDataFormatTXT', 'EventGridDataFormatRAW', 'EventGridDataFormatSINGLEJSON', 'EventGridDataFormatAVRO', 'EventGridDataFormatTSVE', 'EventGridDataFormatPARQUET', 'EventGridDataFormatORC', 'EventGridDataFormatAPACHEAVRO', 'EventGridDataFormatW3CLOGFILE'
	DataFormat EventGridDataFormat `json:"dataFormat,omitempty"`
	// IgnoreFirstRecord - A Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file
	IgnoreFirstRecord *bool `json:"ignoreFirstRecord,omitempty"`
	// BlobStorageEventType - The name of blob storage event type to process. Possible values include: 'BlobStorageEventTypeMicrosoftStorageBlobCreated', 'BlobStorageEventTypeMicrosoftStorageBlobRenamed'
	BlobStorageEventType BlobStorageEventType `json:"blobStorageEventType,omitempty"`
	// ProvisioningState - The provisioned state of the resource. Possible values include: 'ResourceProvisioningStateRunning', 'ResourceProvisioningStateCreating', 'ResourceProvisioningStateDeleting', 'ResourceProvisioningStateSucceeded', 'ResourceProvisioningStateFailed', 'ResourceProvisioningStateMoving', 'ResourceProvisioningStateCanceled'
	ProvisioningState ResourceProvisioningState `json:"provisioningState,omitempty"`
}

// EventGridDataConnection class representing an Event Grid data connection.
type EventGridDataConnection struct {
	// EventGridConnectionProperties - The properties of the Event Grid data connection.
	*EventGridConnectionProperties `json:"properties,omitempty"`
	// Location - Resource location.
	Location *string `json:"location,omitempty"`
	// SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData `json:"systemData,omitempty"`
	// Kind - Possible values include: 'KindBasicDataConnectionKindDataConnection', 'KindBasicDataConnectionKindEventHub', 'KindBasicDataConnectionKindIotHub', 'KindBasicDataConnectionKindEventGrid'
	Kind KindBasicDataConnection `json:"kind,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for EventGridDataConnection.
func (egdc EventGridDataConnection) MarshalJSON() ([]byte, error) {
	egdc.Kind = KindBasicDataConnectionKindEventGrid
	objectMap := make(map[string]interface{})
	if egdc.EventGridConnectionProperties != nil {
		objectMap["properties"] = egdc.EventGridConnectionProperties
	}
	if egdc.Location != nil {
		objectMap["location"] = egdc.Location
	}
	if egdc.Kind != "" {
		objectMap["kind"] = egdc.Kind
	}
	return json.Marshal(objectMap)
}

// AsEventHubDataConnection is the BasicDataConnection implementation for EventGridDataConnection.
func (egdc EventGridDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) {
	return nil, false
}

// AsIotHubDataConnection is the BasicDataConnection implementation for EventGridDataConnection.
func (egdc EventGridDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) {
	return nil, false
}

// AsEventGridDataConnection is the BasicDataConnection implementation for EventGridDataConnection.
func (egdc EventGridDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) {
	return &egdc, true
}

// AsDataConnection is the BasicDataConnection implementation for EventGridDataConnection.
func (egdc EventGridDataConnection) AsDataConnection() (*DataConnection, bool) {
	return nil, false
}

// AsBasicDataConnection is the BasicDataConnection implementation for EventGridDataConnection.
func (egdc EventGridDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) {
	return &egdc, true
}

// UnmarshalJSON is the custom unmarshaler for EventGridDataConnection struct.
func (egdc *EventGridDataConnection) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var eventGridConnectionProperties EventGridConnectionProperties
				err = json.Unmarshal(*v, &eventGridConnectionProperties)
				if err != nil {
					return err
				}
				egdc.EventGridConnectionProperties = &eventGridConnectionProperties
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				egdc.Location = &location
			}
		case "systemData":
			if v != nil {
				var systemData SystemData
				err = json.Unmarshal(*v, &systemData)
				if err != nil {
					return err
				}
				egdc.SystemData = &systemData
			}
		case "kind":
			if v != nil {
				var kind KindBasicDataConnection
				err = json.Unmarshal(*v, &kind)
				if err != nil {
					return err
				}
				egdc.Kind = kind
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				egdc.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				egdc.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				egdc.Type = &typeVar
			}
		}
	}

	return nil
}

// EventHubConnectionProperties class representing the Kusto event hub connection properties.
type EventHubConnectionProperties struct {
	// EventHubResourceID - The resource ID of the event hub to be used to create a data connection.
	EventHubResourceID *string `json:"eventHubResourceId,omitempty"`
	// ConsumerGroup - The event hub consumer group.
	ConsumerGroup *string `json:"consumerGroup,omitempty"`
	// TableName - The table where the data should be ingested. Optionally the table information can be added to each message.
	TableName *string `json:"tableName,omitempty"`
	// MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.
	MappingRuleName *string `json:"mappingRuleName,omitempty"`
	// DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'EventHubDataFormatMULTIJSON', 'EventHubDataFormatJSON', 'EventHubDataFormatCSV', 'EventHubDataFormatTSV', 'EventHubDataFormatSCSV', 'EventHubDataFormatSOHSV', 'EventHubDataFormatPSV', 'EventHubDataFormatTXT', 'EventHubDataFormatRAW', 'EventHubDataFormatSINGLEJSON', 'EventHubDataFormatAVRO', 'EventHubDataFormatTSVE', 'EventHubDataFormatPARQUET', 'EventHubDataFormatORC', 'EventHubDataFormatAPACHEAVRO', 'EventHubDataFormatW3CLOGFILE'
	DataFormat EventHubDataFormat `json:"dataFormat,omitempty"`
	// EventSystemProperties - System properties of the event hub
	EventSystemProperties *[]string `json:"eventSystemProperties,omitempty"`
	// Compression - The event hub messages compression type. Possible values include: 'CompressionNone', 'CompressionGZip'
	Compression Compression `json:"compression,omitempty"`
	// ProvisioningState - The provisioned state of the resource. Possible values include: 'ResourceProvisioningStateRunning', 'ResourceProvisioningStateCreating', 'ResourceProvisioningStateDeleting', 'ResourceProvisioningStateSucceeded', 'ResourceProvisioningStateFailed', 'ResourceProvisioningStateMoving', 'ResourceProvisioningStateCanceled'
	ProvisioningState ResourceProvisioningState `json:"provisioningState,omitempty"`
	// ManagedIdentityResourceID - The resource ID of a managed identity (system or user assigned) to be used to authenticate with event hub.
	ManagedIdentityResourceID *string `json:"managedIdentityResourceId,omitempty"`
}

// EventHubDataConnection class representing an event hub data connection.
type EventHubDataConnection struct {
	// EventHubConnectionProperties - The Event Hub data connection properties to validate.
	*EventHubConnectionProperties `json:"properties,omitempty"`
	// Location - Resource location.
	Location *string `json:"location,omitempty"`
	// SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData `json:"systemData,omitempty"`
	// Kind - Possible values include: 'KindBasicDataConnectionKindDataConnection', 'KindBasicDataConnectionKindEventHub', 'KindBasicDataConnectionKindIotHub', 'KindBasicDataConnectionKindEventGrid'
	Kind KindBasicDataConnection `json:"kind,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for EventHubDataConnection.
func (ehdc EventHubDataConnection) MarshalJSON() ([]byte, error) {
	ehdc.Kind = KindBasicDataConnectionKindEventHub
	objectMap := make(map[string]interface{})
	if ehdc.EventHubConnectionProperties != nil {
		objectMap["properties"] = ehdc.EventHubConnectionProperties
	}
	if ehdc.Location != nil {
		objectMap["location"] = ehdc.Location
	}
	if ehdc.Kind != "" {
		objectMap["kind"] = ehdc.Kind
	}
	return json.Marshal(objectMap)
}

// AsEventHubDataConnection is the BasicDataConnection implementation for EventHubDataConnection.
func (ehdc EventHubDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) {
	return &ehdc, true
}

// AsIotHubDataConnection is the BasicDataConnection implementation for EventHubDataConnection.
func (ehdc EventHubDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) {
	return nil, false
}

// AsEventGridDataConnection is the BasicDataConnection implementation for EventHubDataConnection.
func (ehdc EventHubDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) {
	return nil, false
}

// AsDataConnection is the BasicDataConnection implementation for EventHubDataConnection.
func (ehdc EventHubDataConnection) AsDataConnection() (*DataConnection, bool) {
	return nil, false
}

// AsBasicDataConnection is the BasicDataConnection implementation for EventHubDataConnection.
func (ehdc EventHubDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) {
	return &ehdc, true
}

// UnmarshalJSON is the custom unmarshaler for EventHubDataConnection struct.
func (ehdc *EventHubDataConnection) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var eventHubConnectionProperties EventHubConnectionProperties
				err = json.Unmarshal(*v, &eventHubConnectionProperties)
				if err != nil {
					return err
				}
				ehdc.EventHubConnectionProperties = &eventHubConnectionProperties
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				ehdc.Location = &location
			}
		case "systemData":
			if v != nil {
				var systemData SystemData
				err = json.Unmarshal(*v, &systemData)
				if err != nil {
					return err
				}
				ehdc.SystemData = &systemData
			}
		case "kind":
			if v != nil {
				var kind KindBasicDataConnection
				err = json.Unmarshal(*v, &kind)
				if err != nil {
					return err
				}
				ehdc.Kind = kind
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				ehdc.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				ehdc.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				ehdc.Type = &typeVar
			}
		}
	}

	return nil
}

// ExtendedServerBlobAuditingPolicy an extended server blob auditing policy.
type ExtendedServerBlobAuditingPolicy struct {
	autorest.Response `json:"-"`
	// ExtendedServerBlobAuditingPolicyProperties - Resource properties.
	*ExtendedServerBlobAuditingPolicyProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for ExtendedServerBlobAuditingPolicy.
func (esbap ExtendedServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if esbap.ExtendedServerBlobAuditingPolicyProperties != nil {
		objectMap["properties"] = esbap.ExtendedServerBlobAuditingPolicyProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for ExtendedServerBlobAuditingPolicy struct.
func (esbap *ExtendedServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var extendedServerBlobAuditingPolicyProperties ExtendedServerBlobAuditingPolicyProperties
				err = json.Unmarshal(*v, &extendedServerBlobAuditingPolicyProperties)
				if err != nil {
					return err
				}
				esbap.ExtendedServerBlobAuditingPolicyProperties = &extendedServerBlobAuditingPolicyProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				esbap.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				esbap.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				esbap.Type = &typeVar
			}
		}
	}

	return nil
}

// ExtendedServerBlobAuditingPolicyListResult a list of server extended auditing settings.
type ExtendedServerBlobAuditingPolicyListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]ExtendedServerBlobAuditingPolicy `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for ExtendedServerBlobAuditingPolicyListResult.
func (esbaplr ExtendedServerBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// ExtendedServerBlobAuditingPolicyListResultIterator provides access to a complete listing of
// ExtendedServerBlobAuditingPolicy values.
type ExtendedServerBlobAuditingPolicyListResultIterator struct {
	i    int
	page ExtendedServerBlobAuditingPolicyListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *ExtendedServerBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPolicyListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *ExtendedServerBlobAuditingPolicyListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ExtendedServerBlobAuditingPolicyListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter ExtendedServerBlobAuditingPolicyListResultIterator) Response() ExtendedServerBlobAuditingPolicyListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter ExtendedServerBlobAuditingPolicyListResultIterator) Value() ExtendedServerBlobAuditingPolicy {
	if !iter.page.NotDone() {
		return ExtendedServerBlobAuditingPolicy{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the ExtendedServerBlobAuditingPolicyListResultIterator type.
func NewExtendedServerBlobAuditingPolicyListResultIterator(page ExtendedServerBlobAuditingPolicyListResultPage) ExtendedServerBlobAuditingPolicyListResultIterator {
	return ExtendedServerBlobAuditingPolicyListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (esbaplr ExtendedServerBlobAuditingPolicyListResult) IsEmpty() bool {
	return esbaplr.Value == nil || len(*esbaplr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (esbaplr ExtendedServerBlobAuditingPolicyListResult) hasNextLink() bool {
	return esbaplr.NextLink != nil && len(*esbaplr.NextLink) != 0
}

// extendedServerBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (esbaplr ExtendedServerBlobAuditingPolicyListResult) extendedServerBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !esbaplr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(esbaplr.NextLink)))
}

// ExtendedServerBlobAuditingPolicyListResultPage contains a page of ExtendedServerBlobAuditingPolicy
// values.
type ExtendedServerBlobAuditingPolicyListResultPage struct {
	fn      func(context.Context, ExtendedServerBlobAuditingPolicyListResult) (ExtendedServerBlobAuditingPolicyListResult, error)
	esbaplr ExtendedServerBlobAuditingPolicyListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *ExtendedServerBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPolicyListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.esbaplr)
		if err != nil {
			return err
		}
		page.esbaplr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *ExtendedServerBlobAuditingPolicyListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ExtendedServerBlobAuditingPolicyListResultPage) NotDone() bool {
	return !page.esbaplr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page ExtendedServerBlobAuditingPolicyListResultPage) Response() ExtendedServerBlobAuditingPolicyListResult {
	return page.esbaplr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page ExtendedServerBlobAuditingPolicyListResultPage) Values() []ExtendedServerBlobAuditingPolicy {
	if page.esbaplr.IsEmpty() {
		return nil
	}
	return *page.esbaplr.Value
}

// Creates a new instance of the ExtendedServerBlobAuditingPolicyListResultPage type.
func NewExtendedServerBlobAuditingPolicyListResultPage(cur ExtendedServerBlobAuditingPolicyListResult, getNextPage func(context.Context, ExtendedServerBlobAuditingPolicyListResult) (ExtendedServerBlobAuditingPolicyListResult, error)) ExtendedServerBlobAuditingPolicyListResultPage {
	return ExtendedServerBlobAuditingPolicyListResultPage{
		fn:      getNextPage,
		esbaplr: cur,
	}
}

// ExtendedServerBlobAuditingPolicyProperties properties of an extended server blob auditing policy.
type ExtendedServerBlobAuditingPolicyProperties struct {
	// PredicateExpression - Specifies condition of where clause when creating an audit.
	PredicateExpression *string `json:"predicateExpression,omitempty"`
	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
	State BlobAuditingPolicyState `json:"state,omitempty"`
	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
	// Prerequisites for using managed identity authentication:
	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
	// RetentionDays - Specifies the number of days to keep in the audit logs in the storage account.
	RetentionDays *int32 `json:"retentionDays,omitempty"`
	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
	//
	// The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:
	//
	// BATCH_COMPLETED_GROUP,
	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
	// FAILED_DATABASE_AUTHENTICATION_GROUP.
	//
	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
	//
	// The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records):
	//
	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
	// BACKUP_RESTORE_GROUP
	// DATABASE_LOGOUT_GROUP
	// DATABASE_OBJECT_CHANGE_GROUP
	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
	// DATABASE_OPERATION_GROUP
	// DATABASE_PERMISSION_CHANGE_GROUP
	// DATABASE_PRINCIPAL_CHANGE_GROUP
	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
	// FAILED_DATABASE_AUTHENTICATION_GROUP
	// SCHEMA_OBJECT_ACCESS_GROUP
	// SCHEMA_OBJECT_CHANGE_GROUP
	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
	// USER_CHANGE_PASSWORD_GROUP
	// BATCH_STARTED_GROUP
	// BATCH_COMPLETED_GROUP
	//
	// These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs.
	//
	// For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups).
	//
	// For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are:
	// SELECT
	// UPDATE
	// INSERT
	// DELETE
	// EXECUTE
	// RECEIVE
	// REFERENCES
	//
	// The general form for defining an action to be audited is:
	// {action} ON {object} BY {principal}
	//
	// Note that <object> in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively.
	//
	// For example:
	// SELECT on dbo.myTable by public
	// SELECT on DATABASE::myDatabase by public
	// SELECT on SCHEMA::mySchema by public
	//
	// For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions)
	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
	// IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor.
	// In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true.
	//
	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.
	// Note that for server level audit you should use the 'master' database as {databaseName}.
	//
	// Diagnostic Settings URI format:
	// PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
	//
	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
	// QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.
	// The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`
	// IsDevopsAuditEnabled - Specifies the state of devops audit. If state is Enabled, devops logs will be sent to Azure Monitor.
	// In order to send the events to Azure Monitor, specify 'State' as 'Enabled', 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true
	//
	// When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' diagnostic logs category on the master database should also be created.
	//
	// Diagnostic Settings URI format:
	// PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
	//
	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
	IsDevopsAuditEnabled *bool `json:"isDevopsAuditEnabled,omitempty"`
}

// ExtendedSQLPoolBlobAuditingPolicy an extended Sql pool blob auditing policy.
type ExtendedSQLPoolBlobAuditingPolicy struct {
	autorest.Response `json:"-"`
	// ExtendedSQLPoolBlobAuditingPolicyProperties - Resource properties.
	*ExtendedSQLPoolBlobAuditingPolicyProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for ExtendedSQLPoolBlobAuditingPolicy.
func (espbap ExtendedSQLPoolBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if espbap.ExtendedSQLPoolBlobAuditingPolicyProperties != nil {
		objectMap["properties"] = espbap.ExtendedSQLPoolBlobAuditingPolicyProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for ExtendedSQLPoolBlobAuditingPolicy struct.
func (espbap *ExtendedSQLPoolBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var extendedSQLPoolBlobAuditingPolicyProperties ExtendedSQLPoolBlobAuditingPolicyProperties
				err = json.Unmarshal(*v, &extendedSQLPoolBlobAuditingPolicyProperties)
				if err != nil {
					return err
				}
				espbap.ExtendedSQLPoolBlobAuditingPolicyProperties = &extendedSQLPoolBlobAuditingPolicyProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				espbap.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				espbap.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				espbap.Type = &typeVar
			}
		}
	}

	return nil
}

// ExtendedSQLPoolBlobAuditingPolicyListResult a list of sql pool extended auditing settings.
type ExtendedSQLPoolBlobAuditingPolicyListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]ExtendedSQLPoolBlobAuditingPolicy `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for ExtendedSQLPoolBlobAuditingPolicyListResult.
func (espbaplr ExtendedSQLPoolBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// ExtendedSQLPoolBlobAuditingPolicyListResultIterator provides access to a complete listing of
// ExtendedSQLPoolBlobAuditingPolicy values.
type ExtendedSQLPoolBlobAuditingPolicyListResultIterator struct {
	i    int
	page ExtendedSQLPoolBlobAuditingPolicyListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *ExtendedSQLPoolBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedSQLPoolBlobAuditingPolicyListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *ExtendedSQLPoolBlobAuditingPolicyListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ExtendedSQLPoolBlobAuditingPolicyListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter ExtendedSQLPoolBlobAuditingPolicyListResultIterator) Response() ExtendedSQLPoolBlobAuditingPolicyListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter ExtendedSQLPoolBlobAuditingPolicyListResultIterator) Value() ExtendedSQLPoolBlobAuditingPolicy {
	if !iter.page.NotDone() {
		return ExtendedSQLPoolBlobAuditingPolicy{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the ExtendedSQLPoolBlobAuditingPolicyListResultIterator type.
func NewExtendedSQLPoolBlobAuditingPolicyListResultIterator(page ExtendedSQLPoolBlobAuditingPolicyListResultPage) ExtendedSQLPoolBlobAuditingPolicyListResultIterator {
	return ExtendedSQLPoolBlobAuditingPolicyListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (espbaplr ExtendedSQLPoolBlobAuditingPolicyListResult) IsEmpty() bool {
	return espbaplr.Value == nil || len(*espbaplr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (espbaplr ExtendedSQLPoolBlobAuditingPolicyListResult) hasNextLink() bool {
	return espbaplr.NextLink != nil && len(*espbaplr.NextLink) != 0
}

// extendedSQLPoolBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (espbaplr ExtendedSQLPoolBlobAuditingPolicyListResult) extendedSQLPoolBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !espbaplr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(espbaplr.NextLink)))
}

// ExtendedSQLPoolBlobAuditingPolicyListResultPage contains a page of ExtendedSQLPoolBlobAuditingPolicy
// values.
type ExtendedSQLPoolBlobAuditingPolicyListResultPage struct {
	fn       func(context.Context, ExtendedSQLPoolBlobAuditingPolicyListResult) (ExtendedSQLPoolBlobAuditingPolicyListResult, error)
	espbaplr ExtendedSQLPoolBlobAuditingPolicyListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *ExtendedSQLPoolBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedSQLPoolBlobAuditingPolicyListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.espbaplr)
		if err != nil {
			return err
		}
		page.espbaplr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *ExtendedSQLPoolBlobAuditingPolicyListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ExtendedSQLPoolBlobAuditingPolicyListResultPage) NotDone() bool {
	return !page.espbaplr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page ExtendedSQLPoolBlobAuditingPolicyListResultPage) Response() ExtendedSQLPoolBlobAuditingPolicyListResult {
	return page.espbaplr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page ExtendedSQLPoolBlobAuditingPolicyListResultPage) Values() []ExtendedSQLPoolBlobAuditingPolicy {
	if page.espbaplr.IsEmpty() {
		return nil
	}
	return *page.espbaplr.Value
}

// Creates a new instance of the ExtendedSQLPoolBlobAuditingPolicyListResultPage type.
func NewExtendedSQLPoolBlobAuditingPolicyListResultPage(cur ExtendedSQLPoolBlobAuditingPolicyListResult, getNextPage func(context.Context, ExtendedSQLPoolBlobAuditingPolicyListResult) (ExtendedSQLPoolBlobAuditingPolicyListResult, error)) ExtendedSQLPoolBlobAuditingPolicyListResultPage {
	return ExtendedSQLPoolBlobAuditingPolicyListResultPage{
		fn:       getNextPage,
		espbaplr: cur,
	}
}

// ExtendedSQLPoolBlobAuditingPolicyProperties properties of an extended Sql pool blob auditing policy.
type ExtendedSQLPoolBlobAuditingPolicyProperties struct {
	// PredicateExpression - Specifies condition of where clause when creating an audit.
	PredicateExpression *string `json:"predicateExpression,omitempty"`
	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
	State BlobAuditingPolicyState `json:"state,omitempty"`
	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
	// Prerequisites for using managed identity authentication:
	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
	// RetentionDays - Specifies the number of days to keep in the audit logs in the storage account.
	RetentionDays *int32 `json:"retentionDays,omitempty"`
	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
	//
	// The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:
	//
	// BATCH_COMPLETED_GROUP,
	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
	// FAILED_DATABASE_AUTHENTICATION_GROUP.
	//
	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
	//
	// The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records):
	//
	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
	// BACKUP_RESTORE_GROUP
	// DATABASE_LOGOUT_GROUP
	// DATABASE_OBJECT_CHANGE_GROUP
	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
	// DATABASE_OPERATION_GROUP
	// DATABASE_PERMISSION_CHANGE_GROUP
	// DATABASE_PRINCIPAL_CHANGE_GROUP
	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
	// FAILED_DATABASE_AUTHENTICATION_GROUP
	// SCHEMA_OBJECT_ACCESS_GROUP
	// SCHEMA_OBJECT_CHANGE_GROUP
	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
	// USER_CHANGE_PASSWORD_GROUP
	// BATCH_STARTED_GROUP
	// BATCH_COMPLETED_GROUP
	//
	// These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs.
	//
	// For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups).
	//
	// For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are:
	// SELECT
	// UPDATE
	// INSERT
	// DELETE
	// EXECUTE
	// RECEIVE
	// REFERENCES
	//
	// The general form for defining an action to be audited is:
	// {action} ON {object} BY {principal}
	//
	// Note that <object> in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively.
	//
	// For example:
	// SELECT on dbo.myTable by public
	// SELECT on DATABASE::myDatabase by public
	// SELECT on SCHEMA::mySchema by public
	//
	// For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions)
	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
	// IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor.
	// In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true.
	//
	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.
	// Note that for server level audit you should use the 'master' database as {databaseName}.
	//
	// Diagnostic Settings URI format:
	// PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
	//
	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
	// QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.
	// The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`
}

// FollowerDatabaseDefinition a class representing follower database request.
type FollowerDatabaseDefinition struct {
	// KustoPoolResourceID - Resource id of the cluster that follows a database owned by this cluster.
	KustoPoolResourceID *string `json:"clusterResourceId,omitempty"`
	// AttachedDatabaseConfigurationName - Resource name of the attached database configuration in the follower cluster.
	AttachedDatabaseConfigurationName *string `json:"attachedDatabaseConfigurationName,omitempty"`
	// DatabaseName - READ-ONLY; The database name owned by this cluster that was followed. * in case following all databases.
	DatabaseName *string `json:"databaseName,omitempty"`
}

// MarshalJSON is the custom marshaler for FollowerDatabaseDefinition.
func (fdd FollowerDatabaseDefinition) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if fdd.KustoPoolResourceID != nil {
		objectMap["clusterResourceId"] = fdd.KustoPoolResourceID
	}
	if fdd.AttachedDatabaseConfigurationName != nil {
		objectMap["attachedDatabaseConfigurationName"] = fdd.AttachedDatabaseConfigurationName
	}
	return json.Marshal(objectMap)
}

// FollowerDatabaseListResult the list Kusto database principals operation response.
type FollowerDatabaseListResult struct {
	autorest.Response `json:"-"`
	// Value - The list of follower database result.
	Value *[]FollowerDatabaseDefinition `json:"value,omitempty"`
}

// GeoBackupPolicy a database geo backup policy.
type GeoBackupPolicy struct {
	autorest.Response `json:"-"`
	// GeoBackupPolicyProperties - The properties of the geo backup policy.
	*GeoBackupPolicyProperties `json:"properties,omitempty"`
	// Kind - READ-ONLY; Kind of geo backup policy.  This is metadata used for the Azure portal experience.
	Kind *string `json:"kind,omitempty"`
	// Location - READ-ONLY; Backup policy location.
	Location *string `json:"location,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for GeoBackupPolicy.
func (gbp GeoBackupPolicy) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if gbp.GeoBackupPolicyProperties != nil {
		objectMap["properties"] = gbp.GeoBackupPolicyProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for GeoBackupPolicy struct.
func (gbp *GeoBackupPolicy) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var geoBackupPolicyProperties GeoBackupPolicyProperties
				err = json.Unmarshal(*v, &geoBackupPolicyProperties)
				if err != nil {
					return err
				}
				gbp.GeoBackupPolicyProperties = &geoBackupPolicyProperties
			}
		case "kind":
			if v != nil {
				var kind string
				err = json.Unmarshal(*v, &kind)
				if err != nil {
					return err
				}
				gbp.Kind = &kind
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				gbp.Location = &location
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				gbp.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				gbp.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				gbp.Type = &typeVar
			}
		}
	}

	return nil
}

// GeoBackupPolicyListResult the response to a list geo backup policies request.
type GeoBackupPolicyListResult struct {
	autorest.Response `json:"-"`
	// Value - The list of geo backup policies.
	Value *[]GeoBackupPolicy `json:"value,omitempty"`
}

// GeoBackupPolicyProperties the properties of the geo backup policy.
type GeoBackupPolicyProperties struct {
	// State - The state of the geo backup policy. Possible values include: 'GeoBackupPolicyStateDisabled', 'GeoBackupPolicyStateEnabled'
	State GeoBackupPolicyState `json:"state,omitempty"`
	// StorageType - READ-ONLY; The storage type of the geo backup policy.
	StorageType *string `json:"storageType,omitempty"`
}

// MarshalJSON is the custom marshaler for GeoBackupPolicyProperties.
func (gbpp GeoBackupPolicyProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if gbpp.State != "" {
		objectMap["state"] = gbpp.State
	}
	return json.Marshal(objectMap)
}

// GetSsisObjectMetadataRequest the request payload of get SSIS object metadata.
type GetSsisObjectMetadataRequest struct {
	// MetadataPath - Metadata path.
	MetadataPath *string `json:"metadataPath,omitempty"`
}

// BasicIntegrationRuntime azure Synapse nested object which serves as a compute resource for activities.
type BasicIntegrationRuntime interface {
	AsManagedIntegrationRuntime() (*ManagedIntegrationRuntime, bool)
	AsSelfHostedIntegrationRuntime() (*SelfHostedIntegrationRuntime, bool)
	AsIntegrationRuntime() (*IntegrationRuntime, bool)
}

// IntegrationRuntime azure Synapse nested object which serves as a compute resource for activities.
type IntegrationRuntime struct {
	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
	AdditionalProperties map[string]interface{} `json:""`
	// Description - Integration runtime description.
	Description *string `json:"description,omitempty"`
	// Type - Possible values include: 'TypeBasicIntegrationRuntimeTypeIntegrationRuntime', 'TypeBasicIntegrationRuntimeTypeManaged', 'TypeBasicIntegrationRuntimeTypeSelfHosted'
	Type TypeBasicIntegrationRuntime `json:"type,omitempty"`
}

func unmarshalBasicIntegrationRuntime(body []byte) (BasicIntegrationRuntime, error) {
	var m map[string]interface{}
	err := json.Unmarshal(body, &m)
	if err != nil {
		return nil, err
	}

	switch m["type"] {
	case string(TypeBasicIntegrationRuntimeTypeManaged):
		var mir ManagedIntegrationRuntime
		err := json.Unmarshal(body, &mir)
		return mir, err
	case string(TypeBasicIntegrationRuntimeTypeSelfHosted):
		var shir SelfHostedIntegrationRuntime
		err := json.Unmarshal(body, &shir)
		return shir, err
	default:
		var ir IntegrationRuntime
		err := json.Unmarshal(body, &ir)
		return ir, err
	}
}
func unmarshalBasicIntegrationRuntimeArray(body []byte) ([]BasicIntegrationRuntime, error) {
	var rawMessages []*json.RawMessage
	err := json.Unmarshal(body, &rawMessages)
	if err != nil {
		return nil, err
	}

	irArray := make([]BasicIntegrationRuntime, len(rawMessages))

	for index, rawMessage := range rawMessages {
		ir, err := unmarshalBasicIntegrationRuntime(*rawMessage)
		if err != nil {
			return nil, err
		}
		irArray[index] = ir
	}
	return irArray, nil
}

// MarshalJSON is the custom marshaler for IntegrationRuntime.
func (ir IntegrationRuntime) MarshalJSON() ([]byte, error) {
	ir.Type = TypeBasicIntegrationRuntimeTypeIntegrationRuntime
	objectMap := make(map[string]interface{})
	if ir.Description != nil {
		objectMap["description"] = ir.Description
	}
	if ir.Type != "" {
		objectMap["type"] = ir.Type
	}
	for k, v := range ir.AdditionalProperties {
		objectMap[k] = v
	}
	return json.Marshal(objectMap)
}

// AsManagedIntegrationRuntime is the BasicIntegrationRuntime implementation for IntegrationRuntime.
func (ir IntegrationRuntime) AsManagedIntegrationRuntime() (*ManagedIntegrationRuntime, bool) {
	return nil, false
}

// AsSelfHostedIntegrationRuntime is the BasicIntegrationRuntime implementation for IntegrationRuntime.
func (ir IntegrationRuntime) AsSelfHostedIntegrationRuntime() (*SelfHostedIntegrationRuntime, bool) {
	return nil, false
}

// AsIntegrationRuntime is the BasicIntegrationRuntime implementation for IntegrationRuntime.
func (ir IntegrationRuntime) AsIntegrationRuntime() (*IntegrationRuntime, bool) {
	return &ir, true
}

// AsBasicIntegrationRuntime is the BasicIntegrationRuntime implementation for IntegrationRuntime.
func (ir IntegrationRuntime) AsBasicIntegrationRuntime() (BasicIntegrationRuntime, bool) {
	return &ir, true
}

// UnmarshalJSON is the custom unmarshaler for IntegrationRuntime struct.
func (ir *IntegrationRuntime) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		default:
			if v != nil {
				var additionalProperties interface{}
				err = json.Unmarshal(*v, &additionalProperties)
				if err != nil {
					return err
				}
				if ir.AdditionalProperties == nil {
					ir.AdditionalProperties = make(map[string]interface{})
				}
				ir.AdditionalProperties[k] = additionalProperties
			}
		case "description":
			if v != nil {
				var description string
				err = json.Unmarshal(*v, &description)
				if err != nil {
					return err
				}
				ir.Description = &description
			}
		case "type":
			if v != nil {
				var typeVar TypeBasicIntegrationRuntime
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				ir.Type = typeVar
			}
		}
	}

	return nil
}

// IntegrationRuntimeAuthKeys the integration runtime authentication keys.
type IntegrationRuntimeAuthKeys struct {
	autorest.Response `json:"-"`
	// AuthKey1 - The primary integration runtime authentication key.
	AuthKey1 *string `json:"authKey1,omitempty"`
	// AuthKey2 - The secondary integration runtime authentication key.
	AuthKey2 *string `json:"authKey2,omitempty"`
}

// IntegrationRuntimeComputeProperties the compute resource properties for managed integration runtime.
type IntegrationRuntimeComputeProperties struct {
	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
	AdditionalProperties map[string]interface{} `json:""`
	// Location - The location for managed integration runtime. The supported regions could be found on https://docs.microsoft.com/en-us/azure/data-factory/data-factory-data-movement-activities
	Location *string `json:"location,omitempty"`
	// NodeSize - The node size requirement to managed integration runtime.
	NodeSize *string `json:"nodeSize,omitempty"`
	// NumberOfNodes - The required number of nodes for managed integration runtime.
	NumberOfNodes *int32 `json:"numberOfNodes,omitempty"`
	// MaxParallelExecutionsPerNode - Maximum parallel executions count per node for managed integration runtime.
	MaxParallelExecutionsPerNode *int32 `json:"maxParallelExecutionsPerNode,omitempty"`
	// DataFlowProperties - Data flow properties for managed integration runtime.
	DataFlowProperties *IntegrationRuntimeDataFlowProperties `json:"dataFlowProperties,omitempty"`
	// VNetProperties - VNet properties for managed integration runtime.
	VNetProperties *IntegrationRuntimeVNetProperties `json:"vNetProperties,omitempty"`
}

// MarshalJSON is the custom marshaler for IntegrationRuntimeComputeProperties.
func (ircp IntegrationRuntimeComputeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if ircp.Location != nil {
		objectMap["location"] = ircp.Location
	}
	if ircp.NodeSize != nil {
		objectMap["nodeSize"] = ircp.NodeSize
	}
	if ircp.NumberOfNodes != nil {
		objectMap["numberOfNodes"] = ircp.NumberOfNodes
	}
	if ircp.MaxParallelExecutionsPerNode != nil {
		objectMap["maxParallelExecutionsPerNode"] = ircp.MaxParallelExecutionsPerNode
	}
	if ircp.DataFlowProperties != nil {
		objectMap["dataFlowProperties"] = ircp.DataFlowProperties
	}
	if ircp.VNetProperties != nil {
		objectMap["vNetProperties"] = ircp.VNetProperties
	}
	for k, v := range ircp.AdditionalProperties {
		objectMap[k] = v
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeComputeProperties struct.
func (ircp *IntegrationRuntimeComputeProperties) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		default:
			if v != nil {
				var additionalProperties interface{}
				err = json.Unmarshal(*v, &additionalProperties)
				if err != nil {
					return err
				}
				if ircp.AdditionalProperties == nil {
					ircp.AdditionalProperties = make(map[string]interface{})
				}
				ircp.AdditionalProperties[k] = additionalProperties
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				ircp.Location = &location
			}
		case "nodeSize":
			if v != nil {
				var nodeSize string
				err = json.Unmarshal(*v, &nodeSize)
				if err != nil {
					return err
				}
				ircp.NodeSize = &nodeSize
			}
		case "numberOfNodes":
			if v != nil {
				var numberOfNodes int32
				err = json.Unmarshal(*v, &numberOfNodes)
				if err != nil {
					return err
				}
				ircp.NumberOfNodes = &numberOfNodes
			}
		case "maxParallelExecutionsPerNode":
			if v != nil {
				var maxParallelExecutionsPerNode int32
				err = json.Unmarshal(*v, &maxParallelExecutionsPerNode)
				if err != nil {
					return err
				}
				ircp.MaxParallelExecutionsPerNode = &maxParallelExecutionsPerNode
			}
		case "dataFlowProperties":
			if v != nil {
				var dataFlowProperties IntegrationRuntimeDataFlowProperties
				err = json.Unmarshal(*v, &dataFlowProperties)
				if err != nil {
					return err
				}
				ircp.DataFlowProperties = &dataFlowProperties
			}
		case "vNetProperties":
			if v != nil {
				var vNetProperties IntegrationRuntimeVNetProperties
				err = json.Unmarshal(*v, &vNetProperties)
				if err != nil {
					return err
				}
				ircp.VNetProperties = &vNetProperties
			}
		}
	}

	return nil
}

// IntegrationRuntimeConnectionInfo connection information for encrypting the on-premises data source
// credentials.
type IntegrationRuntimeConnectionInfo struct {
	autorest.Response `json:"-"`
	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
	AdditionalProperties map[string]interface{} `json:""`
	// ServiceToken - READ-ONLY; The token generated in service. Callers use this token to authenticate to integration runtime.
	ServiceToken *string `json:"serviceToken,omitempty"`
	// IdentityCertThumbprint - READ-ONLY; The integration runtime SSL certificate thumbprint. Click-Once application uses it to do server validation.
	IdentityCertThumbprint *string `json:"identityCertThumbprint,omitempty"`
	// HostServiceURI - READ-ONLY; The on-premises integration runtime host URL.
	HostServiceURI *string `json:"hostServiceUri,omitempty"`
	// Version - READ-ONLY; The integration runtime version.
	Version *string `json:"version,omitempty"`
	// PublicKey - READ-ONLY; The public key for encrypting a credential when transferring the credential to the integration runtime.
	PublicKey *string `json:"publicKey,omitempty"`
	// IsIdentityCertExprired - READ-ONLY; Whether the identity certificate is expired.
	IsIdentityCertExprired *bool `json:"isIdentityCertExprired,omitempty"`
}

// MarshalJSON is the custom marshaler for IntegrationRuntimeConnectionInfo.
func (irci IntegrationRuntimeConnectionInfo) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	for k, v := range irci.AdditionalProperties {
		objectMap[k] = v
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeConnectionInfo struct.
func (irci *IntegrationRuntimeConnectionInfo) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		default:
			if v != nil {
				var additionalProperties interface{}
				err = json.Unmarshal(*v, &additionalProperties)
				if err != nil {
					return err
				}
				if irci.AdditionalProperties == nil {
					irci.AdditionalProperties = make(map[string]interface{})
				}
				irci.AdditionalProperties[k] = additionalProperties
			}
		case "serviceToken":
			if v != nil {
				var serviceToken string
				err = json.Unmarshal(*v, &serviceToken)
				if err != nil {
					return err
				}
				irci.ServiceToken = &serviceToken
			}
		case "identityCertThumbprint":
			if v != nil {
				var identityCertThumbprint string
				err = json.Unmarshal(*v, &identityCertThumbprint)
				if err != nil {
					return err
				}
				irci.IdentityCertThumbprint = &identityCertThumbprint
			}
		case "hostServiceUri":
			if v != nil {
				var hostServiceURI string
				err = json.Unmarshal(*v, &hostServiceURI)
				if err != nil {
					return err
				}
				irci.HostServiceURI = &hostServiceURI
			}
		case "version":
			if v != nil {
				var version string
				err = json.Unmarshal(*v, &version)
				if err != nil {
					return err
				}
				irci.Version = &version
			}
		case "publicKey":
			if v != nil {
				var publicKey string
				err = json.Unmarshal(*v, &publicKey)
				if err != nil {
					return err
				}
				irci.PublicKey = &publicKey
			}
		case "isIdentityCertExprired":
			if v != nil {
				var isIdentityCertExprired bool
				err = json.Unmarshal(*v, &isIdentityCertExprired)
				if err != nil {
					return err
				}
				irci.IsIdentityCertExprired = &isIdentityCertExprired
			}
		}
	}

	return nil
}

// IntegrationRuntimeCustomSetupScriptProperties custom setup script properties for a managed dedicated
// integration runtime.
type IntegrationRuntimeCustomSetupScriptProperties struct {
	// BlobContainerURI - The URI of the Azure blob container that contains the custom setup script.
	BlobContainerURI *string `json:"blobContainerUri,omitempty"`
	// SasToken - The SAS token of the Azure blob container.
	SasToken *SecureString `json:"sasToken,omitempty"`
}

// IntegrationRuntimeDataFlowProperties data flow properties for managed integration runtime.
type IntegrationRuntimeDataFlowProperties struct {
	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
	AdditionalProperties map[string]interface{} `json:""`
	// ComputeType - Compute type of the cluster which will execute data flow job. Possible values include: 'DataFlowComputeTypeGeneral', 'DataFlowComputeTypeMemoryOptimized', 'DataFlowComputeTypeComputeOptimized'
	ComputeType DataFlowComputeType `json:"computeType,omitempty"`
	// CoreCount - Core count of the cluster which will execute data flow job. Supported values are: 8, 16, 32, 48, 80, 144 and 272.
	CoreCount *int32 `json:"coreCount,omitempty"`
	// TimeToLive - Time to live (in minutes) setting of the cluster which will execute data flow job.
	TimeToLive *int32 `json:"timeToLive,omitempty"`
	// Cleanup - Cluster will not be recycled and it will be used in next data flow activity run until TTL (time to live) is reached if this is set as false. Default is true.
	Cleanup *bool `json:"cleanup,omitempty"`
}

// MarshalJSON is the custom marshaler for IntegrationRuntimeDataFlowProperties.
func (irdfp IntegrationRuntimeDataFlowProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if irdfp.ComputeType != "" {
		objectMap["computeType"] = irdfp.ComputeType
	}
	if irdfp.CoreCount != nil {
		objectMap["coreCount"] = irdfp.CoreCount
	}
	if irdfp.TimeToLive != nil {
		objectMap["timeToLive"] = irdfp.TimeToLive
	}
	if irdfp.Cleanup != nil {
		objectMap["cleanup"] = irdfp.Cleanup
	}
	for k, v := range irdfp.AdditionalProperties {
		objectMap[k] = v
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeDataFlowProperties struct.
func (irdfp *IntegrationRuntimeDataFlowProperties) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		default:
			if v != nil {
				var additionalProperties interface{}
				err = json.Unmarshal(*v, &additionalProperties)
				if err != nil {
					return err
				}
				if irdfp.AdditionalProperties == nil {
					irdfp.AdditionalProperties = make(map[string]interface{})
				}
				irdfp.AdditionalProperties[k] = additionalProperties
			}
		case "computeType":
			if v != nil {
				var computeType DataFlowComputeType
				err = json.Unmarshal(*v, &computeType)
				if err != nil {
					return err
				}
				irdfp.ComputeType = computeType
			}
		case "coreCount":
			if v != nil {
				var coreCount int32
				err = json.Unmarshal(*v, &coreCount)
				if err != nil {
					return err
				}
				irdfp.CoreCount = &coreCount
			}
		case "timeToLive":
			if v != nil {
				var timeToLive int32
				err = json.Unmarshal(*v, &timeToLive)
				if err != nil {
					return err
				}
				irdfp.TimeToLive = &timeToLive
			}
		case "cleanup":
			if v != nil {
				var cleanup bool
				err = json.Unmarshal(*v, &cleanup)
				if err != nil {
					return err
				}
				irdfp.Cleanup = &cleanup
			}
		}
	}

	return nil
}

// IntegrationRuntimeDataProxyProperties data proxy properties for a managed dedicated integration runtime.
type IntegrationRuntimeDataProxyProperties struct {
	// ConnectVia - The self-hosted integration runtime reference.
	ConnectVia *EntityReference `json:"connectVia,omitempty"`
	// StagingLinkedService - The staging linked service reference.
	StagingLinkedService *EntityReference `json:"stagingLinkedService,omitempty"`
	// Path - The path to contain the staged data in the Blob storage.
	Path *string `json:"path,omitempty"`
}

// IntegrationRuntimeListResponse a list of integration runtime resources.
type IntegrationRuntimeListResponse struct {
	autorest.Response `json:"-"`
	// Value - List of integration runtimes.
	Value *[]IntegrationRuntimeResource `json:"value,omitempty"`
	// NextLink - The link to the next page of results, if any remaining results exist.
	NextLink *string `json:"nextLink,omitempty"`
}

// IntegrationRuntimeListResponseIterator provides access to a complete listing of
// IntegrationRuntimeResource values.
type IntegrationRuntimeListResponseIterator struct {
	i    int
	page IntegrationRuntimeListResponsePage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *IntegrationRuntimeListResponseIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeListResponseIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *IntegrationRuntimeListResponseIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter IntegrationRuntimeListResponseIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter IntegrationRuntimeListResponseIterator) Response() IntegrationRuntimeListResponse {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter IntegrationRuntimeListResponseIterator) Value() IntegrationRuntimeResource {
	if !iter.page.NotDone() {
		return IntegrationRuntimeResource{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the IntegrationRuntimeListResponseIterator type.
func NewIntegrationRuntimeListResponseIterator(page IntegrationRuntimeListResponsePage) IntegrationRuntimeListResponseIterator {
	return IntegrationRuntimeListResponseIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (irlr IntegrationRuntimeListResponse) IsEmpty() bool {
	return irlr.Value == nil || len(*irlr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (irlr IntegrationRuntimeListResponse) hasNextLink() bool {
	return irlr.NextLink != nil && len(*irlr.NextLink) != 0
}

// integrationRuntimeListResponsePreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (irlr IntegrationRuntimeListResponse) integrationRuntimeListResponsePreparer(ctx context.Context) (*http.Request, error) {
	if !irlr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(irlr.NextLink)))
}

// IntegrationRuntimeListResponsePage contains a page of IntegrationRuntimeResource values.
type IntegrationRuntimeListResponsePage struct {
	fn   func(context.Context, IntegrationRuntimeListResponse) (IntegrationRuntimeListResponse, error)
	irlr IntegrationRuntimeListResponse
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *IntegrationRuntimeListResponsePage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationRuntimeListResponsePage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.irlr)
		if err != nil {
			return err
		}
		page.irlr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *IntegrationRuntimeListResponsePage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page IntegrationRuntimeListResponsePage) NotDone() bool {
	return !page.irlr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page IntegrationRuntimeListResponsePage) Response() IntegrationRuntimeListResponse {
	return page.irlr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page IntegrationRuntimeListResponsePage) Values() []IntegrationRuntimeResource {
	if page.irlr.IsEmpty() {
		return nil
	}
	return *page.irlr.Value
}

// Creates a new instance of the IntegrationRuntimeListResponsePage type.
func NewIntegrationRuntimeListResponsePage(cur IntegrationRuntimeListResponse, getNextPage func(context.Context, IntegrationRuntimeListResponse) (IntegrationRuntimeListResponse, error)) IntegrationRuntimeListResponsePage {
	return IntegrationRuntimeListResponsePage{
		fn:   getNextPage,
		irlr: cur,
	}
}

// IntegrationRuntimeMonitoringData get monitoring data response.
type IntegrationRuntimeMonitoringData struct {
	autorest.Response `json:"-"`
	// Name - Integration runtime name.
	Name *string `json:"name,omitempty"`
	// Nodes - Integration runtime node monitoring data.
	Nodes *[]IntegrationRuntimeNodeMonitoringData `json:"nodes,omitempty"`
}

// IntegrationRuntimeNodeIPAddress the IP address of self-hosted integration runtime node.
type IntegrationRuntimeNodeIPAddress struct {
	autorest.Response `json:"-"`
	// IPAddress - READ-ONLY; The IP address of self-hosted integration runtime node.
	IPAddress *string `json:"ipAddress,omitempty"`
}

// MarshalJSON is the custom marshaler for IntegrationRuntimeNodeIPAddress.
func (irnia IntegrationRuntimeNodeIPAddress) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// IntegrationRuntimeNodeMonitoringData monitoring data for integration runtime node.
type IntegrationRuntimeNodeMonitoringData struct {
	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
	AdditionalProperties map[string]interface{} `json:""`
	// NodeName - READ-ONLY; Name of the integration runtime node.
	NodeName *string `json:"nodeName,omitempty"`
	// AvailableMemoryInMB - READ-ONLY; Available memory (MB) on the integration runtime node.
	AvailableMemoryInMB *int32 `json:"availableMemoryInMB,omitempty"`
	// CPUUtilization - READ-ONLY; CPU percentage on the integration runtime node.
	CPUUtilization *int32 `json:"cpuUtilization,omitempty"`
	// ConcurrentJobsLimit - READ-ONLY; Maximum concurrent jobs on the integration runtime node.
	ConcurrentJobsLimit *int32 `json:"concurrentJobsLimit,omitempty"`
	// ConcurrentJobsRunning - READ-ONLY; The number of jobs currently running on the integration runtime node.
	ConcurrentJobsRunning *int32 `json:"concurrentJobsRunning,omitempty"`
	// MaxConcurrentJobs - READ-ONLY; The maximum concurrent jobs in this integration runtime.
	MaxConcurrentJobs *int32 `json:"maxConcurrentJobs,omitempty"`
	// SentBytes - READ-ONLY; Sent bytes on the integration runtime node.
	SentBytes *float64 `json:"sentBytes,omitempty"`
	// ReceivedBytes - READ-ONLY; Received bytes on the integration runtime node.
	ReceivedBytes *float64 `json:"receivedBytes,omitempty"`
}

// MarshalJSON is the custom marshaler for IntegrationRuntimeNodeMonitoringData.
func (irnmd IntegrationRuntimeNodeMonitoringData) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	for k, v := range irnmd.AdditionalProperties {
		objectMap[k] = v
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeNodeMonitoringData struct.
func (irnmd *IntegrationRuntimeNodeMonitoringData) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		default:
			if v != nil {
				var additionalProperties interface{}
				err = json.Unmarshal(*v, &additionalProperties)
				if err != nil {
					return err
				}
				if irnmd.AdditionalProperties == nil {
					irnmd.AdditionalProperties = make(map[string]interface{})
				}
				irnmd.AdditionalProperties[k] = additionalProperties
			}
		case "nodeName":
			if v != nil {
				var nodeName string
				err = json.Unmarshal(*v, &nodeName)
				if err != nil {
					return err
				}
				irnmd.NodeName = &nodeName
			}
		case "availableMemoryInMB":
			if v != nil {
				var availableMemoryInMB int32
				err = json.Unmarshal(*v, &availableMemoryInMB)
				if err != nil {
					return err
				}
				irnmd.AvailableMemoryInMB = &availableMemoryInMB
			}
		case "cpuUtilization":
			if v != nil {
				var CPUUtilization int32
				err = json.Unmarshal(*v, &CPUUtilization)
				if err != nil {
					return err
				}
				irnmd.CPUUtilization = &CPUUtilization
			}
		case "concurrentJobsLimit":
			if v != nil {
				var concurrentJobsLimit int32
				err = json.Unmarshal(*v, &concurrentJobsLimit)
				if err != nil {
					return err
				}
				irnmd.ConcurrentJobsLimit = &concurrentJobsLimit
			}
		case "concurrentJobsRunning":
			if v != nil {
				var concurrentJobsRunning int32
				err = json.Unmarshal(*v, &concurrentJobsRunning)
				if err != nil {
					return err
				}
				irnmd.ConcurrentJobsRunning = &concurrentJobsRunning
			}
		case "maxConcurrentJobs":
			if v != nil {
				var maxConcurrentJobs int32
				err = json.Unmarshal(*v, &maxConcurrentJobs)
				if err != nil {
					return err
				}
				irnmd.MaxConcurrentJobs = &maxConcurrentJobs
			}
		case "sentBytes":
			if v != nil {
				var sentBytes float64
				err = json.Unmarshal(*v, &sentBytes)
				if err != nil {
					return err
				}
				irnmd.SentBytes = &sentBytes
			}
		case "receivedBytes":
			if v != nil {
				var receivedBytes float64
				err = json.Unmarshal(*v, &receivedBytes)
				if err != nil {
					return err
				}
				irnmd.ReceivedBytes = &receivedBytes
			}
		}
	}

	return nil
}

// IntegrationRuntimeObjectMetadataRefreshFuture an abstraction for monitoring and retrieving the results
// of a long-running operation.
type IntegrationRuntimeObjectMetadataRefreshFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(IntegrationRuntimeObjectMetadataClient) (SsisObjectMetadataStatusResponse, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *IntegrationRuntimeObjectMetadataRefreshFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for IntegrationRuntimeObjectMetadataRefreshFuture.Result.
func (future *IntegrationRuntimeObjectMetadataRefreshFuture) result(client IntegrationRuntimeObjectMetadataClient) (somsr SsisObjectMetadataStatusResponse, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeObjectMetadataRefreshFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		somsr.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.IntegrationRuntimeObjectMetadataRefreshFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if somsr.Response.Response, err = future.GetResult(sender); err == nil && somsr.Response.Response.StatusCode != http.StatusNoContent {
		somsr, err = client.RefreshResponder(somsr.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimeObjectMetadataRefreshFuture", "Result", somsr.Response.Response, "Failure responding to request")
		}
	}
	return
}

// IntegrationRuntimeOutboundNetworkDependenciesCategoryEndpoint azure-SSIS integration runtime outbound
// network dependency endpoints for one category.
type IntegrationRuntimeOutboundNetworkDependenciesCategoryEndpoint struct {
	// Category - The category of outbound network dependency.
	Category *string `json:"category,omitempty"`
	// Endpoints - The endpoints for outbound network dependency.
	Endpoints *[]IntegrationRuntimeOutboundNetworkDependenciesEndpoint `json:"endpoints,omitempty"`
}

// IntegrationRuntimeOutboundNetworkDependenciesEndpoint the endpoint for Azure-SSIS integration runtime
// outbound network dependency.
type IntegrationRuntimeOutboundNetworkDependenciesEndpoint struct {
	// DomainName - The domain name of endpoint.
	DomainName *string `json:"domainName,omitempty"`
	// EndpointDetails - The details of endpoint.
	EndpointDetails *[]IntegrationRuntimeOutboundNetworkDependenciesEndpointDetails `json:"endpointDetails,omitempty"`
}

// IntegrationRuntimeOutboundNetworkDependenciesEndpointDetails the details of Azure-SSIS integration
// runtime outbound network dependency endpoint.
type IntegrationRuntimeOutboundNetworkDependenciesEndpointDetails struct {
	// Port - The port of endpoint.
	Port *int32 `json:"port,omitempty"`
}

// IntegrationRuntimeOutboundNetworkDependenciesEndpointsResponse azure-SSIS integration runtime outbound
// network dependency endpoints.
type IntegrationRuntimeOutboundNetworkDependenciesEndpointsResponse struct {
	autorest.Response `json:"-"`
	// Value - The list of outbound network dependency endpoints.
	Value *[]IntegrationRuntimeOutboundNetworkDependenciesCategoryEndpoint `json:"value,omitempty"`
}

// IntegrationRuntimeRegenerateKeyParameters parameters to regenerate the authentication key.
type IntegrationRuntimeRegenerateKeyParameters struct {
	// KeyName - The name of the authentication key to regenerate. Possible values include: 'IntegrationRuntimeAuthKeyNameAuthKey1', 'IntegrationRuntimeAuthKeyNameAuthKey2'
	KeyName IntegrationRuntimeAuthKeyName `json:"keyName,omitempty"`
}

// IntegrationRuntimeResource integration runtime resource type.
type IntegrationRuntimeResource struct {
	autorest.Response `json:"-"`
	// Properties - Integration runtime properties.
	Properties BasicIntegrationRuntime `json:"properties,omitempty"`
	// Etag - READ-ONLY; Resource Etag.
	Etag *string `json:"etag,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for IntegrationRuntimeResource.
func (irr IntegrationRuntimeResource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	objectMap["properties"] = irr.Properties
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeResource struct.
func (irr *IntegrationRuntimeResource) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				properties, err := unmarshalBasicIntegrationRuntime(*v)
				if err != nil {
					return err
				}
				irr.Properties = properties
			}
		case "etag":
			if v != nil {
				var etag string
				err = json.Unmarshal(*v, &etag)
				if err != nil {
					return err
				}
				irr.Etag = &etag
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				irr.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				irr.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				irr.Type = &typeVar
			}
		}
	}

	return nil
}

// IntegrationRuntimesCreateFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type IntegrationRuntimesCreateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(IntegrationRuntimesClient) (IntegrationRuntimeResource, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *IntegrationRuntimesCreateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for IntegrationRuntimesCreateFuture.Result.
func (future *IntegrationRuntimesCreateFuture) result(client IntegrationRuntimesClient) (irr IntegrationRuntimeResource, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesCreateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		irr.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.IntegrationRuntimesCreateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if irr.Response.Response, err = future.GetResult(sender); err == nil && irr.Response.Response.StatusCode != http.StatusNoContent {
		irr, err = client.CreateResponder(irr.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesCreateFuture", "Result", irr.Response.Response, "Failure responding to request")
		}
	}
	return
}

// IntegrationRuntimesDeleteFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type IntegrationRuntimesDeleteFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(IntegrationRuntimesClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *IntegrationRuntimesDeleteFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for IntegrationRuntimesDeleteFuture.Result.
func (future *IntegrationRuntimesDeleteFuture) result(client IntegrationRuntimesClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesDeleteFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.IntegrationRuntimesDeleteFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// IntegrationRuntimesDisableInteractiveQueryFuture an abstraction for monitoring and retrieving the
// results of a long-running operation.
type IntegrationRuntimesDisableInteractiveQueryFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(IntegrationRuntimesClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *IntegrationRuntimesDisableInteractiveQueryFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for IntegrationRuntimesDisableInteractiveQueryFuture.Result.
func (future *IntegrationRuntimesDisableInteractiveQueryFuture) result(client IntegrationRuntimesClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesDisableInteractiveQueryFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.IntegrationRuntimesDisableInteractiveQueryFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// IntegrationRuntimesEnableInteractiveQueryFuture an abstraction for monitoring and retrieving the results
// of a long-running operation.
type IntegrationRuntimesEnableInteractiveQueryFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(IntegrationRuntimesClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *IntegrationRuntimesEnableInteractiveQueryFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for IntegrationRuntimesEnableInteractiveQueryFuture.Result.
func (future *IntegrationRuntimesEnableInteractiveQueryFuture) result(client IntegrationRuntimesClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesEnableInteractiveQueryFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.IntegrationRuntimesEnableInteractiveQueryFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// IntegrationRuntimeSsisCatalogInfo catalog information for managed dedicated integration runtime.
type IntegrationRuntimeSsisCatalogInfo struct {
	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
	AdditionalProperties map[string]interface{} `json:""`
	// CatalogServerEndpoint - The catalog database server URL.
	CatalogServerEndpoint *string `json:"catalogServerEndpoint,omitempty"`
	// CatalogAdminUserName - The administrator user name of catalog database.
	CatalogAdminUserName *string `json:"catalogAdminUserName,omitempty"`
	// CatalogAdminPassword - The password of the administrator user account of the catalog database.
	CatalogAdminPassword *SecureString `json:"catalogAdminPassword,omitempty"`
	// CatalogPricingTier - The pricing tier for the catalog database. The valid values could be found in https://azure.microsoft.com/en-us/pricing/details/sql-database/. Possible values include: 'IntegrationRuntimeSsisCatalogPricingTierBasic', 'IntegrationRuntimeSsisCatalogPricingTierStandard', 'IntegrationRuntimeSsisCatalogPricingTierPremium', 'IntegrationRuntimeSsisCatalogPricingTierPremiumRS'
	CatalogPricingTier IntegrationRuntimeSsisCatalogPricingTier `json:"catalogPricingTier,omitempty"`
}

// MarshalJSON is the custom marshaler for IntegrationRuntimeSsisCatalogInfo.
func (irsci IntegrationRuntimeSsisCatalogInfo) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if irsci.CatalogServerEndpoint != nil {
		objectMap["catalogServerEndpoint"] = irsci.CatalogServerEndpoint
	}
	if irsci.CatalogAdminUserName != nil {
		objectMap["catalogAdminUserName"] = irsci.CatalogAdminUserName
	}
	if irsci.CatalogAdminPassword != nil {
		objectMap["catalogAdminPassword"] = irsci.CatalogAdminPassword
	}
	if irsci.CatalogPricingTier != "" {
		objectMap["catalogPricingTier"] = irsci.CatalogPricingTier
	}
	for k, v := range irsci.AdditionalProperties {
		objectMap[k] = v
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeSsisCatalogInfo struct.
func (irsci *IntegrationRuntimeSsisCatalogInfo) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		default:
			if v != nil {
				var additionalProperties interface{}
				err = json.Unmarshal(*v, &additionalProperties)
				if err != nil {
					return err
				}
				if irsci.AdditionalProperties == nil {
					irsci.AdditionalProperties = make(map[string]interface{})
				}
				irsci.AdditionalProperties[k] = additionalProperties
			}
		case "catalogServerEndpoint":
			if v != nil {
				var catalogServerEndpoint string
				err = json.Unmarshal(*v, &catalogServerEndpoint)
				if err != nil {
					return err
				}
				irsci.CatalogServerEndpoint = &catalogServerEndpoint
			}
		case "catalogAdminUserName":
			if v != nil {
				var catalogAdminUserName string
				err = json.Unmarshal(*v, &catalogAdminUserName)
				if err != nil {
					return err
				}
				irsci.CatalogAdminUserName = &catalogAdminUserName
			}
		case "catalogAdminPassword":
			if v != nil {
				var catalogAdminPassword SecureString
				err = json.Unmarshal(*v, &catalogAdminPassword)
				if err != nil {
					return err
				}
				irsci.CatalogAdminPassword = &catalogAdminPassword
			}
		case "catalogPricingTier":
			if v != nil {
				var catalogPricingTier IntegrationRuntimeSsisCatalogPricingTier
				err = json.Unmarshal(*v, &catalogPricingTier)
				if err != nil {
					return err
				}
				irsci.CatalogPricingTier = catalogPricingTier
			}
		}
	}

	return nil
}

// IntegrationRuntimeSsisProperties SSIS properties for managed integration runtime.
type IntegrationRuntimeSsisProperties struct {
	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
	AdditionalProperties map[string]interface{} `json:""`
	// CatalogInfo - Catalog information for managed dedicated integration runtime.
	CatalogInfo *IntegrationRuntimeSsisCatalogInfo `json:"catalogInfo,omitempty"`
	// LicenseType - License type for bringing your own license scenario. Possible values include: 'IntegrationRuntimeLicenseTypeBasePrice', 'IntegrationRuntimeLicenseTypeLicenseIncluded'
	LicenseType IntegrationRuntimeLicenseType `json:"licenseType,omitempty"`
	// CustomSetupScriptProperties - Custom setup script properties for a managed dedicated integration runtime.
	CustomSetupScriptProperties *IntegrationRuntimeCustomSetupScriptProperties `json:"customSetupScriptProperties,omitempty"`
	// DataProxyProperties - Data proxy properties for a managed dedicated integration runtime.
	DataProxyProperties *IntegrationRuntimeDataProxyProperties `json:"dataProxyProperties,omitempty"`
	// Edition - The edition for the SSIS Integration Runtime. Possible values include: 'IntegrationRuntimeEditionStandard', 'IntegrationRuntimeEditionEnterprise'
	Edition IntegrationRuntimeEdition `json:"edition,omitempty"`
	// ExpressCustomSetupProperties - Custom setup without script properties for a SSIS integration runtime.
	ExpressCustomSetupProperties *[]BasicCustomSetupBase `json:"expressCustomSetupProperties,omitempty"`
}

// MarshalJSON is the custom marshaler for IntegrationRuntimeSsisProperties.
func (irsp IntegrationRuntimeSsisProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if irsp.CatalogInfo != nil {
		objectMap["catalogInfo"] = irsp.CatalogInfo
	}
	if irsp.LicenseType != "" {
		objectMap["licenseType"] = irsp.LicenseType
	}
	if irsp.CustomSetupScriptProperties != nil {
		objectMap["customSetupScriptProperties"] = irsp.CustomSetupScriptProperties
	}
	if irsp.DataProxyProperties != nil {
		objectMap["dataProxyProperties"] = irsp.DataProxyProperties
	}
	if irsp.Edition != "" {
		objectMap["edition"] = irsp.Edition
	}
	if irsp.ExpressCustomSetupProperties != nil {
		objectMap["expressCustomSetupProperties"] = irsp.ExpressCustomSetupProperties
	}
	for k, v := range irsp.AdditionalProperties {
		objectMap[k] = v
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeSsisProperties struct.
func (irsp *IntegrationRuntimeSsisProperties) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		default:
			if v != nil {
				var additionalProperties interface{}
				err = json.Unmarshal(*v, &additionalProperties)
				if err != nil {
					return err
				}
				if irsp.AdditionalProperties == nil {
					irsp.AdditionalProperties = make(map[string]interface{})
				}
				irsp.AdditionalProperties[k] = additionalProperties
			}
		case "catalogInfo":
			if v != nil {
				var catalogInfo IntegrationRuntimeSsisCatalogInfo
				err = json.Unmarshal(*v, &catalogInfo)
				if err != nil {
					return err
				}
				irsp.CatalogInfo = &catalogInfo
			}
		case "licenseType":
			if v != nil {
				var licenseType IntegrationRuntimeLicenseType
				err = json.Unmarshal(*v, &licenseType)
				if err != nil {
					return err
				}
				irsp.LicenseType = licenseType
			}
		case "customSetupScriptProperties":
			if v != nil {
				var customSetupScriptProperties IntegrationRuntimeCustomSetupScriptProperties
				err = json.Unmarshal(*v, &customSetupScriptProperties)
				if err != nil {
					return err
				}
				irsp.CustomSetupScriptProperties = &customSetupScriptProperties
			}
		case "dataProxyProperties":
			if v != nil {
				var dataProxyProperties IntegrationRuntimeDataProxyProperties
				err = json.Unmarshal(*v, &dataProxyProperties)
				if err != nil {
					return err
				}
				irsp.DataProxyProperties = &dataProxyProperties
			}
		case "edition":
			if v != nil {
				var edition IntegrationRuntimeEdition
				err = json.Unmarshal(*v, &edition)
				if err != nil {
					return err
				}
				irsp.Edition = edition
			}
		case "expressCustomSetupProperties":
			if v != nil {
				expressCustomSetupProperties, err := unmarshalBasicCustomSetupBaseArray(*v)
				if err != nil {
					return err
				}
				irsp.ExpressCustomSetupProperties = &expressCustomSetupProperties
			}
		}
	}

	return nil
}

// IntegrationRuntimesStartFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type IntegrationRuntimesStartFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(IntegrationRuntimesClient) (IntegrationRuntimeStatusResponse, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *IntegrationRuntimesStartFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for IntegrationRuntimesStartFuture.Result.
func (future *IntegrationRuntimesStartFuture) result(client IntegrationRuntimesClient) (irsr IntegrationRuntimeStatusResponse, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesStartFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		irsr.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.IntegrationRuntimesStartFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if irsr.Response.Response, err = future.GetResult(sender); err == nil && irsr.Response.Response.StatusCode != http.StatusNoContent {
		irsr, err = client.StartResponder(irsr.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesStartFuture", "Result", irsr.Response.Response, "Failure responding to request")
		}
	}
	return
}

// IntegrationRuntimesStopFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type IntegrationRuntimesStopFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(IntegrationRuntimesClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *IntegrationRuntimesStopFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for IntegrationRuntimesStopFuture.Result.
func (future *IntegrationRuntimesStopFuture) result(client IntegrationRuntimesClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.IntegrationRuntimesStopFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.IntegrationRuntimesStopFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// BasicIntegrationRuntimeStatus integration runtime status.
type BasicIntegrationRuntimeStatus interface {
	AsManagedIntegrationRuntimeStatus() (*ManagedIntegrationRuntimeStatus, bool)
	AsSelfHostedIntegrationRuntimeStatus() (*SelfHostedIntegrationRuntimeStatus, bool)
	AsIntegrationRuntimeStatus() (*IntegrationRuntimeStatus, bool)
}

// IntegrationRuntimeStatus integration runtime status.
type IntegrationRuntimeStatus struct {
	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
	AdditionalProperties map[string]interface{} `json:""`
	// DataFactoryName - READ-ONLY; The workspace name which the integration runtime belong to.
	DataFactoryName *string `json:"dataFactoryName,omitempty"`
	// State - READ-ONLY; The state of integration runtime. Possible values include: 'IntegrationRuntimeStateInitial', 'IntegrationRuntimeStateStopped', 'IntegrationRuntimeStateStarted', 'IntegrationRuntimeStateStarting', 'IntegrationRuntimeStateStopping', 'IntegrationRuntimeStateNeedRegistration', 'IntegrationRuntimeStateOnline', 'IntegrationRuntimeStateLimited', 'IntegrationRuntimeStateOffline', 'IntegrationRuntimeStateAccessDenied'
	State IntegrationRuntimeState `json:"state,omitempty"`
	// Type - Possible values include: 'TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus', 'TypeBasicIntegrationRuntimeStatusTypeManaged', 'TypeBasicIntegrationRuntimeStatusTypeSelfHosted'
	Type TypeBasicIntegrationRuntimeStatus `json:"type,omitempty"`
}

func unmarshalBasicIntegrationRuntimeStatus(body []byte) (BasicIntegrationRuntimeStatus, error) {
	var m map[string]interface{}
	err := json.Unmarshal(body, &m)
	if err != nil {
		return nil, err
	}

	switch m["type"] {
	case string(TypeBasicIntegrationRuntimeStatusTypeManaged):
		var mirs ManagedIntegrationRuntimeStatus
		err := json.Unmarshal(body, &mirs)
		return mirs, err
	case string(TypeBasicIntegrationRuntimeStatusTypeSelfHosted):
		var shirs SelfHostedIntegrationRuntimeStatus
		err := json.Unmarshal(body, &shirs)
		return shirs, err
	default:
		var irs IntegrationRuntimeStatus
		err := json.Unmarshal(body, &irs)
		return irs, err
	}
}
func unmarshalBasicIntegrationRuntimeStatusArray(body []byte) ([]BasicIntegrationRuntimeStatus, error) {
	var rawMessages []*json.RawMessage
	err := json.Unmarshal(body, &rawMessages)
	if err != nil {
		return nil, err
	}

	irsArray := make([]BasicIntegrationRuntimeStatus, len(rawMessages))

	for index, rawMessage := range rawMessages {
		irs, err := unmarshalBasicIntegrationRuntimeStatus(*rawMessage)
		if err != nil {
			return nil, err
		}
		irsArray[index] = irs
	}
	return irsArray, nil
}

// MarshalJSON is the custom marshaler for IntegrationRuntimeStatus.
func (irs IntegrationRuntimeStatus) MarshalJSON() ([]byte, error) {
	irs.Type = TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus
	objectMap := make(map[string]interface{})
	if irs.Type != "" {
		objectMap["type"] = irs.Type
	}
	for k, v := range irs.AdditionalProperties {
		objectMap[k] = v
	}
	return json.Marshal(objectMap)
}

// AsManagedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for IntegrationRuntimeStatus.
func (irs IntegrationRuntimeStatus) AsManagedIntegrationRuntimeStatus() (*ManagedIntegrationRuntimeStatus, bool) {
	return nil, false
}

// AsSelfHostedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for IntegrationRuntimeStatus.
func (irs IntegrationRuntimeStatus) AsSelfHostedIntegrationRuntimeStatus() (*SelfHostedIntegrationRuntimeStatus, bool) {
	return nil, false
}

// AsIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for IntegrationRuntimeStatus.
func (irs IntegrationRuntimeStatus) AsIntegrationRuntimeStatus() (*IntegrationRuntimeStatus, bool) {
	return &irs, true
}

// AsBasicIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for IntegrationRuntimeStatus.
func (irs IntegrationRuntimeStatus) AsBasicIntegrationRuntimeStatus() (BasicIntegrationRuntimeStatus, bool) {
	return &irs, true
}

// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeStatus struct.
func (irs *IntegrationRuntimeStatus) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		default:
			if v != nil {
				var additionalProperties interface{}
				err = json.Unmarshal(*v, &additionalProperties)
				if err != nil {
					return err
				}
				if irs.AdditionalProperties == nil {
					irs.AdditionalProperties = make(map[string]interface{})
				}
				irs.AdditionalProperties[k] = additionalProperties
			}
		case "dataFactoryName":
			if v != nil {
				var dataFactoryName string
				err = json.Unmarshal(*v, &dataFactoryName)
				if err != nil {
					return err
				}
				irs.DataFactoryName = &dataFactoryName
			}
		case "state":
			if v != nil {
				var state IntegrationRuntimeState
				err = json.Unmarshal(*v, &state)
				if err != nil {
					return err
				}
				irs.State = state
			}
		case "type":
			if v != nil {
				var typeVar TypeBasicIntegrationRuntimeStatus
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				irs.Type = typeVar
			}
		}
	}

	return nil
}

// IntegrationRuntimeStatusResponse integration runtime status response.
type IntegrationRuntimeStatusResponse struct {
	autorest.Response `json:"-"`
	// Name - READ-ONLY; The integration runtime name.
	Name *string `json:"name,omitempty"`
	// Properties - Integration runtime properties.
	Properties BasicIntegrationRuntimeStatus `json:"properties,omitempty"`
}

// MarshalJSON is the custom marshaler for IntegrationRuntimeStatusResponse.
func (irsr IntegrationRuntimeStatusResponse) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	objectMap["properties"] = irsr.Properties
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeStatusResponse struct.
func (irsr *IntegrationRuntimeStatusResponse) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				irsr.Name = &name
			}
		case "properties":
			if v != nil {
				properties, err := unmarshalBasicIntegrationRuntimeStatus(*v)
				if err != nil {
					return err
				}
				irsr.Properties = properties
			}
		}
	}

	return nil
}

// IntegrationRuntimeVNetProperties vNet properties for managed integration runtime.
type IntegrationRuntimeVNetProperties struct {
	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
	AdditionalProperties map[string]interface{} `json:""`
	// VNetID - The ID of the VNet that this integration runtime will join.
	VNetID *string `json:"vNetId,omitempty"`
	// Subnet - The name of the subnet this integration runtime will join.
	Subnet *string `json:"subnet,omitempty"`
	// PublicIPs - Resource IDs of the public IP addresses that this integration runtime will use.
	PublicIPs *[]string `json:"publicIPs,omitempty"`
	// SubnetID - The ID of subnet, to which this Azure-SSIS integration runtime will be joined.
	SubnetID *string `json:"subnetId,omitempty"`
}

// MarshalJSON is the custom marshaler for IntegrationRuntimeVNetProperties.
func (irvnp IntegrationRuntimeVNetProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if irvnp.VNetID != nil {
		objectMap["vNetId"] = irvnp.VNetID
	}
	if irvnp.Subnet != nil {
		objectMap["subnet"] = irvnp.Subnet
	}
	if irvnp.PublicIPs != nil {
		objectMap["publicIPs"] = irvnp.PublicIPs
	}
	if irvnp.SubnetID != nil {
		objectMap["subnetId"] = irvnp.SubnetID
	}
	for k, v := range irvnp.AdditionalProperties {
		objectMap[k] = v
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeVNetProperties struct.
func (irvnp *IntegrationRuntimeVNetProperties) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		default:
			if v != nil {
				var additionalProperties interface{}
				err = json.Unmarshal(*v, &additionalProperties)
				if err != nil {
					return err
				}
				if irvnp.AdditionalProperties == nil {
					irvnp.AdditionalProperties = make(map[string]interface{})
				}
				irvnp.AdditionalProperties[k] = additionalProperties
			}
		case "vNetId":
			if v != nil {
				var vNetID string
				err = json.Unmarshal(*v, &vNetID)
				if err != nil {
					return err
				}
				irvnp.VNetID = &vNetID
			}
		case "subnet":
			if v != nil {
				var subnet string
				err = json.Unmarshal(*v, &subnet)
				if err != nil {
					return err
				}
				irvnp.Subnet = &subnet
			}
		case "publicIPs":
			if v != nil {
				var publicIPs []string
				err = json.Unmarshal(*v, &publicIPs)
				if err != nil {
					return err
				}
				irvnp.PublicIPs = &publicIPs
			}
		case "subnetId":
			if v != nil {
				var subnetID string
				err = json.Unmarshal(*v, &subnetID)
				if err != nil {
					return err
				}
				irvnp.SubnetID = &subnetID
			}
		}
	}

	return nil
}

// IotHubConnectionProperties class representing the Kusto Iot hub connection properties.
type IotHubConnectionProperties struct {
	// IotHubResourceID - The resource ID of the Iot hub to be used to create a data connection.
	IotHubResourceID *string `json:"iotHubResourceId,omitempty"`
	// ConsumerGroup - The iot hub consumer group.
	ConsumerGroup *string `json:"consumerGroup,omitempty"`
	// TableName - The table where the data should be ingested. Optionally the table information can be added to each message.
	TableName *string `json:"tableName,omitempty"`
	// MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.
	MappingRuleName *string `json:"mappingRuleName,omitempty"`
	// DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'IotHubDataFormatMULTIJSON', 'IotHubDataFormatJSON', 'IotHubDataFormatCSV', 'IotHubDataFormatTSV', 'IotHubDataFormatSCSV', 'IotHubDataFormatSOHSV', 'IotHubDataFormatPSV', 'IotHubDataFormatTXT', 'IotHubDataFormatRAW', 'IotHubDataFormatSINGLEJSON', 'IotHubDataFormatAVRO', 'IotHubDataFormatTSVE', 'IotHubDataFormatPARQUET', 'IotHubDataFormatORC', 'IotHubDataFormatAPACHEAVRO', 'IotHubDataFormatW3CLOGFILE'
	DataFormat IotHubDataFormat `json:"dataFormat,omitempty"`
	// EventSystemProperties - System properties of the iot hub
	EventSystemProperties *[]string `json:"eventSystemProperties,omitempty"`
	// SharedAccessPolicyName - The name of the share access policy
	SharedAccessPolicyName *string `json:"sharedAccessPolicyName,omitempty"`
	// ProvisioningState - The provisioned state of the resource. Possible values include: 'ResourceProvisioningStateRunning', 'ResourceProvisioningStateCreating', 'ResourceProvisioningStateDeleting', 'ResourceProvisioningStateSucceeded', 'ResourceProvisioningStateFailed', 'ResourceProvisioningStateMoving', 'ResourceProvisioningStateCanceled'
	ProvisioningState ResourceProvisioningState `json:"provisioningState,omitempty"`
}

// IotHubDataConnection class representing an iot hub data connection.
type IotHubDataConnection struct {
	// IotHubConnectionProperties - The Iot Hub data connection properties.
	*IotHubConnectionProperties `json:"properties,omitempty"`
	// Location - Resource location.
	Location *string `json:"location,omitempty"`
	// SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData `json:"systemData,omitempty"`
	// Kind - Possible values include: 'KindBasicDataConnectionKindDataConnection', 'KindBasicDataConnectionKindEventHub', 'KindBasicDataConnectionKindIotHub', 'KindBasicDataConnectionKindEventGrid'
	Kind KindBasicDataConnection `json:"kind,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for IotHubDataConnection.
func (ihdc IotHubDataConnection) MarshalJSON() ([]byte, error) {
	ihdc.Kind = KindBasicDataConnectionKindIotHub
	objectMap := make(map[string]interface{})
	if ihdc.IotHubConnectionProperties != nil {
		objectMap["properties"] = ihdc.IotHubConnectionProperties
	}
	if ihdc.Location != nil {
		objectMap["location"] = ihdc.Location
	}
	if ihdc.Kind != "" {
		objectMap["kind"] = ihdc.Kind
	}
	return json.Marshal(objectMap)
}

// AsEventHubDataConnection is the BasicDataConnection implementation for IotHubDataConnection.
func (ihdc IotHubDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) {
	return nil, false
}

// AsIotHubDataConnection is the BasicDataConnection implementation for IotHubDataConnection.
func (ihdc IotHubDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) {
	return &ihdc, true
}

// AsEventGridDataConnection is the BasicDataConnection implementation for IotHubDataConnection.
func (ihdc IotHubDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) {
	return nil, false
}

// AsDataConnection is the BasicDataConnection implementation for IotHubDataConnection.
func (ihdc IotHubDataConnection) AsDataConnection() (*DataConnection, bool) {
	return nil, false
}

// AsBasicDataConnection is the BasicDataConnection implementation for IotHubDataConnection.
func (ihdc IotHubDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) {
	return &ihdc, true
}

// UnmarshalJSON is the custom unmarshaler for IotHubDataConnection struct.
func (ihdc *IotHubDataConnection) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var iotHubConnectionProperties IotHubConnectionProperties
				err = json.Unmarshal(*v, &iotHubConnectionProperties)
				if err != nil {
					return err
				}
				ihdc.IotHubConnectionProperties = &iotHubConnectionProperties
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				ihdc.Location = &location
			}
		case "systemData":
			if v != nil {
				var systemData SystemData
				err = json.Unmarshal(*v, &systemData)
				if err != nil {
					return err
				}
				ihdc.SystemData = &systemData
			}
		case "kind":
			if v != nil {
				var kind KindBasicDataConnection
				err = json.Unmarshal(*v, &kind)
				if err != nil {
					return err
				}
				ihdc.Kind = kind
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				ihdc.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				ihdc.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				ihdc.Type = &typeVar
			}
		}
	}

	return nil
}

// IPFirewallRuleInfo IP firewall rule
type IPFirewallRuleInfo struct {
	autorest.Response `json:"-"`
	// IPFirewallRuleProperties - IP firewall rule properties
	*IPFirewallRuleProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for IPFirewallRuleInfo.
func (ifri IPFirewallRuleInfo) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if ifri.IPFirewallRuleProperties != nil {
		objectMap["properties"] = ifri.IPFirewallRuleProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for IPFirewallRuleInfo struct.
func (ifri *IPFirewallRuleInfo) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var IPFirewallRuleProperties IPFirewallRuleProperties
				err = json.Unmarshal(*v, &IPFirewallRuleProperties)
				if err != nil {
					return err
				}
				ifri.IPFirewallRuleProperties = &IPFirewallRuleProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				ifri.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				ifri.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				ifri.Type = &typeVar
			}
		}
	}

	return nil
}

// IPFirewallRuleInfoListResult list of IP firewall rules
type IPFirewallRuleInfoListResult struct {
	autorest.Response `json:"-"`
	// NextLink - Link to next page of results
	NextLink *string `json:"nextLink,omitempty"`
	// Value - List of IP firewall rules
	Value *[]IPFirewallRuleInfo `json:"value,omitempty"`
}

// IPFirewallRuleInfoListResultIterator provides access to a complete listing of IPFirewallRuleInfo values.
type IPFirewallRuleInfoListResultIterator struct {
	i    int
	page IPFirewallRuleInfoListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *IPFirewallRuleInfoListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/IPFirewallRuleInfoListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *IPFirewallRuleInfoListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter IPFirewallRuleInfoListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter IPFirewallRuleInfoListResultIterator) Response() IPFirewallRuleInfoListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter IPFirewallRuleInfoListResultIterator) Value() IPFirewallRuleInfo {
	if !iter.page.NotDone() {
		return IPFirewallRuleInfo{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the IPFirewallRuleInfoListResultIterator type.
func NewIPFirewallRuleInfoListResultIterator(page IPFirewallRuleInfoListResultPage) IPFirewallRuleInfoListResultIterator {
	return IPFirewallRuleInfoListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (ifrilr IPFirewallRuleInfoListResult) IsEmpty() bool {
	return ifrilr.Value == nil || len(*ifrilr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (ifrilr IPFirewallRuleInfoListResult) hasNextLink() bool {
	return ifrilr.NextLink != nil && len(*ifrilr.NextLink) != 0
}

// iPFirewallRuleInfoListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (ifrilr IPFirewallRuleInfoListResult) iPFirewallRuleInfoListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !ifrilr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(ifrilr.NextLink)))
}

// IPFirewallRuleInfoListResultPage contains a page of IPFirewallRuleInfo values.
type IPFirewallRuleInfoListResultPage struct {
	fn     func(context.Context, IPFirewallRuleInfoListResult) (IPFirewallRuleInfoListResult, error)
	ifrilr IPFirewallRuleInfoListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *IPFirewallRuleInfoListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/IPFirewallRuleInfoListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.ifrilr)
		if err != nil {
			return err
		}
		page.ifrilr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *IPFirewallRuleInfoListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page IPFirewallRuleInfoListResultPage) NotDone() bool {
	return !page.ifrilr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page IPFirewallRuleInfoListResultPage) Response() IPFirewallRuleInfoListResult {
	return page.ifrilr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page IPFirewallRuleInfoListResultPage) Values() []IPFirewallRuleInfo {
	if page.ifrilr.IsEmpty() {
		return nil
	}
	return *page.ifrilr.Value
}

// Creates a new instance of the IPFirewallRuleInfoListResultPage type.
func NewIPFirewallRuleInfoListResultPage(cur IPFirewallRuleInfoListResult, getNextPage func(context.Context, IPFirewallRuleInfoListResult) (IPFirewallRuleInfoListResult, error)) IPFirewallRuleInfoListResultPage {
	return IPFirewallRuleInfoListResultPage{
		fn:     getNextPage,
		ifrilr: cur,
	}
}

// IPFirewallRuleProperties IP firewall rule properties
type IPFirewallRuleProperties struct {
	// EndIPAddress - The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to startIpAddress
	EndIPAddress *string `json:"endIpAddress,omitempty"`
	// ProvisioningState - READ-ONLY; Resource provisioning state. Possible values include: 'ProvisioningStateProvisioning', 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateFailed', 'ProvisioningStateDeleteError'
	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
	// StartIPAddress - The start IP address of the firewall rule. Must be IPv4 format
	StartIPAddress *string `json:"startIpAddress,omitempty"`
}

// MarshalJSON is the custom marshaler for IPFirewallRuleProperties.
func (ifrp IPFirewallRuleProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if ifrp.EndIPAddress != nil {
		objectMap["endIpAddress"] = ifrp.EndIPAddress
	}
	if ifrp.StartIPAddress != nil {
		objectMap["startIpAddress"] = ifrp.StartIPAddress
	}
	return json.Marshal(objectMap)
}

// IPFirewallRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type IPFirewallRulesCreateOrUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(IPFirewallRulesClient) (IPFirewallRuleInfo, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *IPFirewallRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for IPFirewallRulesCreateOrUpdateFuture.Result.
func (future *IPFirewallRulesCreateOrUpdateFuture) result(client IPFirewallRulesClient) (ifri IPFirewallRuleInfo, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ifri.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.IPFirewallRulesCreateOrUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if ifri.Response.Response, err = future.GetResult(sender); err == nil && ifri.Response.Response.StatusCode != http.StatusNoContent {
		ifri, err = client.CreateOrUpdateResponder(ifri.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesCreateOrUpdateFuture", "Result", ifri.Response.Response, "Failure responding to request")
		}
	}
	return
}

// IPFirewallRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type IPFirewallRulesDeleteFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(IPFirewallRulesClient) (SetObject, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *IPFirewallRulesDeleteFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for IPFirewallRulesDeleteFuture.Result.
func (future *IPFirewallRulesDeleteFuture) result(client IPFirewallRulesClient) (so SetObject, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesDeleteFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		so.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.IPFirewallRulesDeleteFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent {
		so, err = client.DeleteResponder(so.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesDeleteFuture", "Result", so.Response.Response, "Failure responding to request")
		}
	}
	return
}

// IPFirewallRulesReplaceAllFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type IPFirewallRulesReplaceAllFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(IPFirewallRulesClient) (ReplaceAllFirewallRulesOperationResponse, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *IPFirewallRulesReplaceAllFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for IPFirewallRulesReplaceAllFuture.Result.
func (future *IPFirewallRulesReplaceAllFuture) result(client IPFirewallRulesClient) (rafror ReplaceAllFirewallRulesOperationResponse, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesReplaceAllFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		rafror.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.IPFirewallRulesReplaceAllFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if rafror.Response.Response, err = future.GetResult(sender); err == nil && rafror.Response.Response.StatusCode != http.StatusNoContent {
		rafror, err = client.ReplaceAllResponder(rafror.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.IPFirewallRulesReplaceAllFuture", "Result", rafror.Response.Response, "Failure responding to request")
		}
	}
	return
}

// KekIdentityProperties key encryption key properties
type KekIdentityProperties struct {
	// UserAssignedIdentity - User assigned identity resource Id
	UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"`
	// UseSystemAssignedIdentity - Boolean specifying whether to use system assigned identity or not
	UseSystemAssignedIdentity interface{} `json:"useSystemAssignedIdentity,omitempty"`
}

// Key a workspace key
type Key struct {
	autorest.Response `json:"-"`
	// KeyProperties - Keys resource properties
	*KeyProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for Key.
func (kVar Key) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if kVar.KeyProperties != nil {
		objectMap["properties"] = kVar.KeyProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for Key struct.
func (kVar *Key) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var keyProperties KeyProperties
				err = json.Unmarshal(*v, &keyProperties)
				if err != nil {
					return err
				}
				kVar.KeyProperties = &keyProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				kVar.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				kVar.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				kVar.Type = &typeVar
			}
		}
	}

	return nil
}

// KeyInfoListResult list of keys
type KeyInfoListResult struct {
	autorest.Response `json:"-"`
	// NextLink - Link to the next page of results
	NextLink *string `json:"nextLink,omitempty"`
	// Value - List of keys
	Value *[]Key `json:"value,omitempty"`
}

// KeyInfoListResultIterator provides access to a complete listing of Key values.
type KeyInfoListResultIterator struct {
	i    int
	page KeyInfoListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *KeyInfoListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/KeyInfoListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *KeyInfoListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter KeyInfoListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter KeyInfoListResultIterator) Response() KeyInfoListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter KeyInfoListResultIterator) Value() Key {
	if !iter.page.NotDone() {
		return Key{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the KeyInfoListResultIterator type.
func NewKeyInfoListResultIterator(page KeyInfoListResultPage) KeyInfoListResultIterator {
	return KeyInfoListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (kilr KeyInfoListResult) IsEmpty() bool {
	return kilr.Value == nil || len(*kilr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (kilr KeyInfoListResult) hasNextLink() bool {
	return kilr.NextLink != nil && len(*kilr.NextLink) != 0
}

// keyInfoListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (kilr KeyInfoListResult) keyInfoListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !kilr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(kilr.NextLink)))
}

// KeyInfoListResultPage contains a page of Key values.
type KeyInfoListResultPage struct {
	fn   func(context.Context, KeyInfoListResult) (KeyInfoListResult, error)
	kilr KeyInfoListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *KeyInfoListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/KeyInfoListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.kilr)
		if err != nil {
			return err
		}
		page.kilr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *KeyInfoListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page KeyInfoListResultPage) NotDone() bool {
	return !page.kilr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page KeyInfoListResultPage) Response() KeyInfoListResult {
	return page.kilr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page KeyInfoListResultPage) Values() []Key {
	if page.kilr.IsEmpty() {
		return nil
	}
	return *page.kilr.Value
}

// Creates a new instance of the KeyInfoListResultPage type.
func NewKeyInfoListResultPage(cur KeyInfoListResult, getNextPage func(context.Context, KeyInfoListResult) (KeyInfoListResult, error)) KeyInfoListResultPage {
	return KeyInfoListResultPage{
		fn:   getNextPage,
		kilr: cur,
	}
}

// KeyProperties key properties
type KeyProperties struct {
	// IsActiveCMK - Used to activate the workspace after a customer managed key is provided.
	IsActiveCMK *bool `json:"isActiveCMK,omitempty"`
	// KeyVaultURL - The Key Vault Url of the workspace key.
	KeyVaultURL *string `json:"keyVaultUrl,omitempty"`
}

// KustoPool class representing a Kusto kusto pool.
type KustoPool struct {
	autorest.Response `json:"-"`
	// Sku - The SKU of the kusto pool.
	Sku *AzureSku `json:"sku,omitempty"`
	// KustoPoolProperties - The kusto pool properties.
	*KustoPoolProperties `json:"properties,omitempty"`
	// Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
	Etag *string `json:"etag,omitempty"`
	// SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData `json:"systemData,omitempty"`
	// Tags - Resource tags.
	Tags map[string]*string `json:"tags"`
	// Location - The geo-location where the resource lives
	Location *string `json:"location,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for KustoPool.
func (kp KustoPool) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if kp.Sku != nil {
		objectMap["sku"] = kp.Sku
	}
	if kp.KustoPoolProperties != nil {
		objectMap["properties"] = kp.KustoPoolProperties
	}
	if kp.Tags != nil {
		objectMap["tags"] = kp.Tags
	}
	if kp.Location != nil {
		objectMap["location"] = kp.Location
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for KustoPool struct.
func (kp *KustoPool) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "sku":
			if v != nil {
				var sku AzureSku
				err = json.Unmarshal(*v, &sku)
				if err != nil {
					return err
				}
				kp.Sku = &sku
			}
		case "properties":
			if v != nil {
				var kustoPoolProperties KustoPoolProperties
				err = json.Unmarshal(*v, &kustoPoolProperties)
				if err != nil {
					return err
				}
				kp.KustoPoolProperties = &kustoPoolProperties
			}
		case "etag":
			if v != nil {
				var etag string
				err = json.Unmarshal(*v, &etag)
				if err != nil {
					return err
				}
				kp.Etag = &etag
			}
		case "systemData":
			if v != nil {
				var systemData SystemData
				err = json.Unmarshal(*v, &systemData)
				if err != nil {
					return err
				}
				kp.SystemData = &systemData
			}
		case "tags":
			if v != nil {
				var tags map[string]*string
				err = json.Unmarshal(*v, &tags)
				if err != nil {
					return err
				}
				kp.Tags = tags
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				kp.Location = &location
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				kp.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				kp.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				kp.Type = &typeVar
			}
		}
	}

	return nil
}

// KustoPoolAttachedDatabaseConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving
// the results of a long-running operation.
type KustoPoolAttachedDatabaseConfigurationsCreateOrUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolAttachedDatabaseConfigurationsClient) (AttachedDatabaseConfiguration, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolAttachedDatabaseConfigurationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolAttachedDatabaseConfigurationsCreateOrUpdateFuture.Result.
func (future *KustoPoolAttachedDatabaseConfigurationsCreateOrUpdateFuture) result(client KustoPoolAttachedDatabaseConfigurationsClient) (adc AttachedDatabaseConfiguration, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolAttachedDatabaseConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		adc.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolAttachedDatabaseConfigurationsCreateOrUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if adc.Response.Response, err = future.GetResult(sender); err == nil && adc.Response.Response.StatusCode != http.StatusNoContent {
		adc, err = client.CreateOrUpdateResponder(adc.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.KustoPoolAttachedDatabaseConfigurationsCreateOrUpdateFuture", "Result", adc.Response.Response, "Failure responding to request")
		}
	}
	return
}

// KustoPoolAttachedDatabaseConfigurationsDeleteFuture an abstraction for monitoring and retrieving the
// results of a long-running operation.
type KustoPoolAttachedDatabaseConfigurationsDeleteFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolAttachedDatabaseConfigurationsClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolAttachedDatabaseConfigurationsDeleteFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolAttachedDatabaseConfigurationsDeleteFuture.Result.
func (future *KustoPoolAttachedDatabaseConfigurationsDeleteFuture) result(client KustoPoolAttachedDatabaseConfigurationsClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolAttachedDatabaseConfigurationsDeleteFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolAttachedDatabaseConfigurationsDeleteFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// KustoPoolCheckNameRequest the object sent for a kusto pool check name availability request.
type KustoPoolCheckNameRequest struct {
	// Name - Kusto Pool name.
	Name *string `json:"name,omitempty"`
	// Type - The type of resource, Microsoft.Synapse/workspaces/kustoPools.
	Type *string `json:"type,omitempty"`
}

// KustoPoolDatabasePrincipalAssignmentsCreateOrUpdateFuture an abstraction for monitoring and retrieving
// the results of a long-running operation.
type KustoPoolDatabasePrincipalAssignmentsCreateOrUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolDatabasePrincipalAssignmentsClient) (DatabasePrincipalAssignment, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolDatabasePrincipalAssignmentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolDatabasePrincipalAssignmentsCreateOrUpdateFuture.Result.
func (future *KustoPoolDatabasePrincipalAssignmentsCreateOrUpdateFuture) result(client KustoPoolDatabasePrincipalAssignmentsClient) (dpa DatabasePrincipalAssignment, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolDatabasePrincipalAssignmentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		dpa.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolDatabasePrincipalAssignmentsCreateOrUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if dpa.Response.Response, err = future.GetResult(sender); err == nil && dpa.Response.Response.StatusCode != http.StatusNoContent {
		dpa, err = client.CreateOrUpdateResponder(dpa.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.KustoPoolDatabasePrincipalAssignmentsCreateOrUpdateFuture", "Result", dpa.Response.Response, "Failure responding to request")
		}
	}
	return
}

// KustoPoolDatabasePrincipalAssignmentsDeleteFuture an abstraction for monitoring and retrieving the
// results of a long-running operation.
type KustoPoolDatabasePrincipalAssignmentsDeleteFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolDatabasePrincipalAssignmentsClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolDatabasePrincipalAssignmentsDeleteFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolDatabasePrincipalAssignmentsDeleteFuture.Result.
func (future *KustoPoolDatabasePrincipalAssignmentsDeleteFuture) result(client KustoPoolDatabasePrincipalAssignmentsClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolDatabasePrincipalAssignmentsDeleteFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolDatabasePrincipalAssignmentsDeleteFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// KustoPoolDatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type KustoPoolDatabasesCreateOrUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolDatabasesClient) (DatabaseModel, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolDatabasesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolDatabasesCreateOrUpdateFuture.Result.
func (future *KustoPoolDatabasesCreateOrUpdateFuture) result(client KustoPoolDatabasesClient) (dm DatabaseModel, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolDatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		dm.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolDatabasesCreateOrUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if dm.Response.Response, err = future.GetResult(sender); err == nil && dm.Response.Response.StatusCode != http.StatusNoContent {
		dm, err = client.CreateOrUpdateResponder(dm.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.KustoPoolDatabasesCreateOrUpdateFuture", "Result", dm.Response.Response, "Failure responding to request")
		}
	}
	return
}

// KustoPoolDatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type KustoPoolDatabasesDeleteFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolDatabasesClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolDatabasesDeleteFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolDatabasesDeleteFuture.Result.
func (future *KustoPoolDatabasesDeleteFuture) result(client KustoPoolDatabasesClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolDatabasesDeleteFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolDatabasesDeleteFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// KustoPoolDatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type KustoPoolDatabasesUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolDatabasesClient) (DatabaseModel, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolDatabasesUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolDatabasesUpdateFuture.Result.
func (future *KustoPoolDatabasesUpdateFuture) result(client KustoPoolDatabasesClient) (dm DatabaseModel, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolDatabasesUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		dm.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolDatabasesUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if dm.Response.Response, err = future.GetResult(sender); err == nil && dm.Response.Response.StatusCode != http.StatusNoContent {
		dm, err = client.UpdateResponder(dm.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.KustoPoolDatabasesUpdateFuture", "Result", dm.Response.Response, "Failure responding to request")
		}
	}
	return
}

// KustoPoolDataConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of
// a long-running operation.
type KustoPoolDataConnectionsCreateOrUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolDataConnectionsClient) (DataConnectionModel, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolDataConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolDataConnectionsCreateOrUpdateFuture.Result.
func (future *KustoPoolDataConnectionsCreateOrUpdateFuture) result(client KustoPoolDataConnectionsClient) (dcm DataConnectionModel, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolDataConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		dcm.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolDataConnectionsCreateOrUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if dcm.Response.Response, err = future.GetResult(sender); err == nil && dcm.Response.Response.StatusCode != http.StatusNoContent {
		dcm, err = client.CreateOrUpdateResponder(dcm.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.KustoPoolDataConnectionsCreateOrUpdateFuture", "Result", dcm.Response.Response, "Failure responding to request")
		}
	}
	return
}

// KustoPoolDataConnectionsDataConnectionValidationMethodFuture an abstraction for monitoring and
// retrieving the results of a long-running operation.
type KustoPoolDataConnectionsDataConnectionValidationMethodFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolDataConnectionsClient) (DataConnectionValidationListResult, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolDataConnectionsDataConnectionValidationMethodFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolDataConnectionsDataConnectionValidationMethodFuture.Result.
func (future *KustoPoolDataConnectionsDataConnectionValidationMethodFuture) result(client KustoPoolDataConnectionsClient) (dcvlr DataConnectionValidationListResult, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolDataConnectionsDataConnectionValidationMethodFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		dcvlr.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolDataConnectionsDataConnectionValidationMethodFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if dcvlr.Response.Response, err = future.GetResult(sender); err == nil && dcvlr.Response.Response.StatusCode != http.StatusNoContent {
		dcvlr, err = client.DataConnectionValidationMethodResponder(dcvlr.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.KustoPoolDataConnectionsDataConnectionValidationMethodFuture", "Result", dcvlr.Response.Response, "Failure responding to request")
		}
	}
	return
}

// KustoPoolDataConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type KustoPoolDataConnectionsDeleteFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolDataConnectionsClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolDataConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolDataConnectionsDeleteFuture.Result.
func (future *KustoPoolDataConnectionsDeleteFuture) result(client KustoPoolDataConnectionsClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolDataConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolDataConnectionsDeleteFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// KustoPoolDataConnectionsUpdateFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type KustoPoolDataConnectionsUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolDataConnectionsClient) (DataConnectionModel, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolDataConnectionsUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolDataConnectionsUpdateFuture.Result.
func (future *KustoPoolDataConnectionsUpdateFuture) result(client KustoPoolDataConnectionsClient) (dcm DataConnectionModel, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolDataConnectionsUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		dcm.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolDataConnectionsUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if dcm.Response.Response, err = future.GetResult(sender); err == nil && dcm.Response.Response.StatusCode != http.StatusNoContent {
		dcm, err = client.UpdateResponder(dcm.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.KustoPoolDataConnectionsUpdateFuture", "Result", dcm.Response.Response, "Failure responding to request")
		}
	}
	return
}

// KustoPoolListResult the list Kusto pools operation response.
type KustoPoolListResult struct {
	autorest.Response `json:"-"`
	// Value - The list of Kusto pools.
	Value *[]KustoPool `json:"value,omitempty"`
}

// KustoPoolPrincipalAssignmentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the
// results of a long-running operation.
type KustoPoolPrincipalAssignmentsCreateOrUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolPrincipalAssignmentsClient) (ClusterPrincipalAssignment, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolPrincipalAssignmentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolPrincipalAssignmentsCreateOrUpdateFuture.Result.
func (future *KustoPoolPrincipalAssignmentsCreateOrUpdateFuture) result(client KustoPoolPrincipalAssignmentsClient) (cpa ClusterPrincipalAssignment, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolPrincipalAssignmentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		cpa.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolPrincipalAssignmentsCreateOrUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if cpa.Response.Response, err = future.GetResult(sender); err == nil && cpa.Response.Response.StatusCode != http.StatusNoContent {
		cpa, err = client.CreateOrUpdateResponder(cpa.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.KustoPoolPrincipalAssignmentsCreateOrUpdateFuture", "Result", cpa.Response.Response, "Failure responding to request")
		}
	}
	return
}

// KustoPoolPrincipalAssignmentsDeleteFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type KustoPoolPrincipalAssignmentsDeleteFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolPrincipalAssignmentsClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolPrincipalAssignmentsDeleteFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolPrincipalAssignmentsDeleteFuture.Result.
func (future *KustoPoolPrincipalAssignmentsDeleteFuture) result(client KustoPoolPrincipalAssignmentsClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolPrincipalAssignmentsDeleteFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolPrincipalAssignmentsDeleteFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// KustoPoolProperties class representing the Kusto pool properties.
type KustoPoolProperties struct {
	// State - READ-ONLY; The state of the resource. Possible values include: 'StateCreating', 'StateUnavailable', 'StateRunning', 'StateDeleting', 'StateDeleted', 'StateStopping', 'StateStopped', 'StateStarting', 'StateUpdating'
	State State `json:"state,omitempty"`
	// ProvisioningState - The provisioned state of the resource. Possible values include: 'ResourceProvisioningStateRunning', 'ResourceProvisioningStateCreating', 'ResourceProvisioningStateDeleting', 'ResourceProvisioningStateSucceeded', 'ResourceProvisioningStateFailed', 'ResourceProvisioningStateMoving', 'ResourceProvisioningStateCanceled'
	ProvisioningState ResourceProvisioningState `json:"provisioningState,omitempty"`
	// URI - READ-ONLY; The Kusto Pool URI.
	URI *string `json:"uri,omitempty"`
	// DataIngestionURI - READ-ONLY; The Kusto Pool data ingestion URI.
	DataIngestionURI *string `json:"dataIngestionUri,omitempty"`
	// StateReason - READ-ONLY; The reason for the Kusto Pool's current state.
	StateReason *string `json:"stateReason,omitempty"`
	// OptimizedAutoscale - Optimized auto scale definition.
	OptimizedAutoscale *OptimizedAutoscale `json:"optimizedAutoscale,omitempty"`
	// EnableStreamingIngest - A boolean value that indicates if the streaming ingest is enabled.
	EnableStreamingIngest *bool `json:"enableStreamingIngest,omitempty"`
	// EnablePurge - A boolean value that indicates if the purge operations are enabled.
	EnablePurge *bool `json:"enablePurge,omitempty"`
	// LanguageExtensions - READ-ONLY; List of the Kusto Pool's language extensions.
	LanguageExtensions *LanguageExtensionsList `json:"languageExtensions,omitempty"`
	// WorkspaceUID - The workspace unique identifier.
	WorkspaceUID *string `json:"workspaceUID,omitempty"`
}

// MarshalJSON is the custom marshaler for KustoPoolProperties.
func (kpp KustoPoolProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if kpp.ProvisioningState != "" {
		objectMap["provisioningState"] = kpp.ProvisioningState
	}
	if kpp.OptimizedAutoscale != nil {
		objectMap["optimizedAutoscale"] = kpp.OptimizedAutoscale
	}
	if kpp.EnableStreamingIngest != nil {
		objectMap["enableStreamingIngest"] = kpp.EnableStreamingIngest
	}
	if kpp.EnablePurge != nil {
		objectMap["enablePurge"] = kpp.EnablePurge
	}
	if kpp.WorkspaceUID != nil {
		objectMap["workspaceUID"] = kpp.WorkspaceUID
	}
	return json.Marshal(objectMap)
}

// KustoPoolsAddLanguageExtensionsFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type KustoPoolsAddLanguageExtensionsFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolsClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolsAddLanguageExtensionsFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolsAddLanguageExtensionsFuture.Result.
func (future *KustoPoolsAddLanguageExtensionsFuture) result(client KustoPoolsClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolsAddLanguageExtensionsFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolsAddLanguageExtensionsFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// KustoPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type KustoPoolsCreateOrUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolsClient) (KustoPool, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolsCreateOrUpdateFuture.Result.
func (future *KustoPoolsCreateOrUpdateFuture) result(client KustoPoolsClient) (kp KustoPool, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		kp.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolsCreateOrUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if kp.Response.Response, err = future.GetResult(sender); err == nil && kp.Response.Response.StatusCode != http.StatusNoContent {
		kp, err = client.CreateOrUpdateResponder(kp.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.KustoPoolsCreateOrUpdateFuture", "Result", kp.Response.Response, "Failure responding to request")
		}
	}
	return
}

// KustoPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type KustoPoolsDeleteFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolsClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolsDeleteFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolsDeleteFuture.Result.
func (future *KustoPoolsDeleteFuture) result(client KustoPoolsClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolsDeleteFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolsDeleteFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// KustoPoolsDetachFollowerDatabasesFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type KustoPoolsDetachFollowerDatabasesFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolsClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolsDetachFollowerDatabasesFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolsDetachFollowerDatabasesFuture.Result.
func (future *KustoPoolsDetachFollowerDatabasesFuture) result(client KustoPoolsClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolsDetachFollowerDatabasesFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolsDetachFollowerDatabasesFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// KustoPoolsRemoveLanguageExtensionsFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type KustoPoolsRemoveLanguageExtensionsFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolsClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolsRemoveLanguageExtensionsFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolsRemoveLanguageExtensionsFuture.Result.
func (future *KustoPoolsRemoveLanguageExtensionsFuture) result(client KustoPoolsClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolsRemoveLanguageExtensionsFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolsRemoveLanguageExtensionsFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// KustoPoolsStartFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type KustoPoolsStartFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolsClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolsStartFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolsStartFuture.Result.
func (future *KustoPoolsStartFuture) result(client KustoPoolsClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolsStartFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolsStartFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// KustoPoolsStopFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type KustoPoolsStopFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolsClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolsStopFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolsStopFuture.Result.
func (future *KustoPoolsStopFuture) result(client KustoPoolsClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolsStopFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolsStopFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// KustoPoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type KustoPoolsUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(KustoPoolsClient) (KustoPool, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *KustoPoolsUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for KustoPoolsUpdateFuture.Result.
func (future *KustoPoolsUpdateFuture) result(client KustoPoolsClient) (kp KustoPool, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.KustoPoolsUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		kp.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.KustoPoolsUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if kp.Response.Response, err = future.GetResult(sender); err == nil && kp.Response.Response.StatusCode != http.StatusNoContent {
		kp, err = client.UpdateResponder(kp.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.KustoPoolsUpdateFuture", "Result", kp.Response.Response, "Failure responding to request")
		}
	}
	return
}

// KustoPoolUpdate class representing an update to a Kusto kusto pool.
type KustoPoolUpdate struct {
	// Tags - Resource tags.
	Tags map[string]*string `json:"tags"`
	// Sku - The SKU of the kusto pool.
	Sku *AzureSku `json:"sku,omitempty"`
	// KustoPoolProperties - The kusto pool properties.
	*KustoPoolProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for KustoPoolUpdate.
func (kpu KustoPoolUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if kpu.Tags != nil {
		objectMap["tags"] = kpu.Tags
	}
	if kpu.Sku != nil {
		objectMap["sku"] = kpu.Sku
	}
	if kpu.KustoPoolProperties != nil {
		objectMap["properties"] = kpu.KustoPoolProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for KustoPoolUpdate struct.
func (kpu *KustoPoolUpdate) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "tags":
			if v != nil {
				var tags map[string]*string
				err = json.Unmarshal(*v, &tags)
				if err != nil {
					return err
				}
				kpu.Tags = tags
			}
		case "sku":
			if v != nil {
				var sku AzureSku
				err = json.Unmarshal(*v, &sku)
				if err != nil {
					return err
				}
				kpu.Sku = &sku
			}
		case "properties":
			if v != nil {
				var kustoPoolProperties KustoPoolProperties
				err = json.Unmarshal(*v, &kustoPoolProperties)
				if err != nil {
					return err
				}
				kpu.KustoPoolProperties = &kustoPoolProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				kpu.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				kpu.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				kpu.Type = &typeVar
			}
		}
	}

	return nil
}

// LanguageExtension the language extension object.
type LanguageExtension struct {
	// LanguageExtensionName - The language extension name. Possible values include: 'LanguageExtensionNamePYTHON', 'LanguageExtensionNameR'
	LanguageExtensionName LanguageExtensionName `json:"languageExtensionName,omitempty"`
}

// LanguageExtensionsList the list of language extension objects.
type LanguageExtensionsList struct {
	autorest.Response `json:"-"`
	// Value - The list of language extensions.
	Value *[]LanguageExtension `json:"value,omitempty"`
}

// LibraryInfo library/package information of a Big Data pool powered by Apache Spark
type LibraryInfo struct {
	// Name - Name of the library.
	Name *string `json:"name,omitempty"`
	// Path - Storage blob path of library.
	Path *string `json:"path,omitempty"`
	// ContainerName - Storage blob container name.
	ContainerName *string `json:"containerName,omitempty"`
	// UploadedTimestamp - The last update time of the library.
	UploadedTimestamp *date.Time `json:"uploadedTimestamp,omitempty"`
	// Type - Type of the library.
	Type *string `json:"type,omitempty"`
	// ProvisioningStatus - READ-ONLY; Provisioning status of the library/package.
	ProvisioningStatus *string `json:"provisioningStatus,omitempty"`
	// CreatorID - READ-ONLY; Creator Id of the library/package.
	CreatorID *string `json:"creatorId,omitempty"`
}

// MarshalJSON is the custom marshaler for LibraryInfo.
func (li LibraryInfo) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if li.Name != nil {
		objectMap["name"] = li.Name
	}
	if li.Path != nil {
		objectMap["path"] = li.Path
	}
	if li.ContainerName != nil {
		objectMap["containerName"] = li.ContainerName
	}
	if li.UploadedTimestamp != nil {
		objectMap["uploadedTimestamp"] = li.UploadedTimestamp
	}
	if li.Type != nil {
		objectMap["type"] = li.Type
	}
	return json.Marshal(objectMap)
}

// LibraryListResponse a list of Library resources.
type LibraryListResponse struct {
	autorest.Response `json:"-"`
	// Value - List of Library.
	Value *[]LibraryResource `json:"value,omitempty"`
	// NextLink - The link to the next page of results, if any remaining results exist.
	NextLink *string `json:"nextLink,omitempty"`
}

// LibraryListResponseIterator provides access to a complete listing of LibraryResource values.
type LibraryListResponseIterator struct {
	i    int
	page LibraryListResponsePage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *LibraryListResponseIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/LibraryListResponseIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *LibraryListResponseIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter LibraryListResponseIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter LibraryListResponseIterator) Response() LibraryListResponse {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter LibraryListResponseIterator) Value() LibraryResource {
	if !iter.page.NotDone() {
		return LibraryResource{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the LibraryListResponseIterator type.
func NewLibraryListResponseIterator(page LibraryListResponsePage) LibraryListResponseIterator {
	return LibraryListResponseIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (llr LibraryListResponse) IsEmpty() bool {
	return llr.Value == nil || len(*llr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (llr LibraryListResponse) hasNextLink() bool {
	return llr.NextLink != nil && len(*llr.NextLink) != 0
}

// libraryListResponsePreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (llr LibraryListResponse) libraryListResponsePreparer(ctx context.Context) (*http.Request, error) {
	if !llr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(llr.NextLink)))
}

// LibraryListResponsePage contains a page of LibraryResource values.
type LibraryListResponsePage struct {
	fn  func(context.Context, LibraryListResponse) (LibraryListResponse, error)
	llr LibraryListResponse
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *LibraryListResponsePage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/LibraryListResponsePage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.llr)
		if err != nil {
			return err
		}
		page.llr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *LibraryListResponsePage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page LibraryListResponsePage) NotDone() bool {
	return !page.llr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page LibraryListResponsePage) Response() LibraryListResponse {
	return page.llr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page LibraryListResponsePage) Values() []LibraryResource {
	if page.llr.IsEmpty() {
		return nil
	}
	return *page.llr.Value
}

// Creates a new instance of the LibraryListResponsePage type.
func NewLibraryListResponsePage(cur LibraryListResponse, getNextPage func(context.Context, LibraryListResponse) (LibraryListResponse, error)) LibraryListResponsePage {
	return LibraryListResponsePage{
		fn:  getNextPage,
		llr: cur,
	}
}

// LibraryRequirements library requirements for a Big Data pool powered by Apache Spark
type LibraryRequirements struct {
	// Time - READ-ONLY; The last update time of the library requirements file.
	Time *date.Time `json:"time,omitempty"`
	// Content - The library requirements.
	Content *string `json:"content,omitempty"`
	// Filename - The filename of the library requirements file.
	Filename *string `json:"filename,omitempty"`
}

// MarshalJSON is the custom marshaler for LibraryRequirements.
func (lr LibraryRequirements) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if lr.Content != nil {
		objectMap["content"] = lr.Content
	}
	if lr.Filename != nil {
		objectMap["filename"] = lr.Filename
	}
	return json.Marshal(objectMap)
}

// LibraryResource library response details
type LibraryResource struct {
	autorest.Response `json:"-"`
	// LibraryInfo - Library/package properties.
	*LibraryInfo `json:"properties,omitempty"`
	// Etag - READ-ONLY; Resource Etag.
	Etag *string `json:"etag,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for LibraryResource.
func (lr LibraryResource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if lr.LibraryInfo != nil {
		objectMap["properties"] = lr.LibraryInfo
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for LibraryResource struct.
func (lr *LibraryResource) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var libraryInfo LibraryInfo
				err = json.Unmarshal(*v, &libraryInfo)
				if err != nil {
					return err
				}
				lr.LibraryInfo = &libraryInfo
			}
		case "etag":
			if v != nil {
				var etag string
				err = json.Unmarshal(*v, &etag)
				if err != nil {
					return err
				}
				lr.Etag = &etag
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				lr.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				lr.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				lr.Type = &typeVar
			}
		}
	}

	return nil
}

// LicensedComponentSetupTypeProperties installation of licensed component setup type properties.
type LicensedComponentSetupTypeProperties struct {
	// ComponentName - The name of the 3rd party component.
	ComponentName *string `json:"componentName,omitempty"`
	// LicenseKey - The license key to activate the component.
	LicenseKey BasicSecretBase `json:"licenseKey,omitempty"`
}

// UnmarshalJSON is the custom unmarshaler for LicensedComponentSetupTypeProperties struct.
func (lcstp *LicensedComponentSetupTypeProperties) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "componentName":
			if v != nil {
				var componentName string
				err = json.Unmarshal(*v, &componentName)
				if err != nil {
					return err
				}
				lcstp.ComponentName = &componentName
			}
		case "licenseKey":
			if v != nil {
				licenseKey, err := unmarshalBasicSecretBase(*v)
				if err != nil {
					return err
				}
				lcstp.LicenseKey = licenseKey
			}
		}
	}

	return nil
}

// LinkedIntegrationRuntime the linked integration runtime information.
type LinkedIntegrationRuntime struct {
	// Name - READ-ONLY; The name of the linked integration runtime.
	Name *string `json:"name,omitempty"`
	// SubscriptionID - READ-ONLY; The subscription ID for which the linked integration runtime belong to.
	SubscriptionID *string `json:"subscriptionId,omitempty"`
	// DataFactoryName - READ-ONLY; The name of the workspace for which the linked integration runtime belong to.
	DataFactoryName *string `json:"dataFactoryName,omitempty"`
	// DataFactoryLocation - READ-ONLY; The location of the workspace for which the linked integration runtime belong to.
	DataFactoryLocation *string `json:"dataFactoryLocation,omitempty"`
	// CreateTime - READ-ONLY; The creating time of the linked integration runtime.
	CreateTime *date.Time `json:"createTime,omitempty"`
}

// MarshalJSON is the custom marshaler for LinkedIntegrationRuntime.
func (lir LinkedIntegrationRuntime) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// LinkedIntegrationRuntimeKeyAuthorization the key authorization type integration runtime.
type LinkedIntegrationRuntimeKeyAuthorization struct {
	// Key - The key used for authorization.
	Key *SecureString `json:"key,omitempty"`
	// AuthorizationType - Possible values include: 'AuthorizationTypeLinkedIntegrationRuntimeType', 'AuthorizationTypeKey', 'AuthorizationTypeRBAC'
	AuthorizationType AuthorizationType `json:"authorizationType,omitempty"`
}

// MarshalJSON is the custom marshaler for LinkedIntegrationRuntimeKeyAuthorization.
func (lirka LinkedIntegrationRuntimeKeyAuthorization) MarshalJSON() ([]byte, error) {
	lirka.AuthorizationType = AuthorizationTypeKey
	objectMap := make(map[string]interface{})
	if lirka.Key != nil {
		objectMap["key"] = lirka.Key
	}
	if lirka.AuthorizationType != "" {
		objectMap["authorizationType"] = lirka.AuthorizationType
	}
	return json.Marshal(objectMap)
}

// AsLinkedIntegrationRuntimeKeyAuthorization is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeKeyAuthorization.
func (lirka LinkedIntegrationRuntimeKeyAuthorization) AsLinkedIntegrationRuntimeKeyAuthorization() (*LinkedIntegrationRuntimeKeyAuthorization, bool) {
	return &lirka, true
}

// AsLinkedIntegrationRuntimeRbacAuthorization is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeKeyAuthorization.
func (lirka LinkedIntegrationRuntimeKeyAuthorization) AsLinkedIntegrationRuntimeRbacAuthorization() (*LinkedIntegrationRuntimeRbacAuthorization, bool) {
	return nil, false
}

// AsLinkedIntegrationRuntimeType is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeKeyAuthorization.
func (lirka LinkedIntegrationRuntimeKeyAuthorization) AsLinkedIntegrationRuntimeType() (*LinkedIntegrationRuntimeType, bool) {
	return nil, false
}

// AsBasicLinkedIntegrationRuntimeType is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeKeyAuthorization.
func (lirka LinkedIntegrationRuntimeKeyAuthorization) AsBasicLinkedIntegrationRuntimeType() (BasicLinkedIntegrationRuntimeType, bool) {
	return &lirka, true
}

// LinkedIntegrationRuntimeRbacAuthorization the role based access control (RBAC) authorization type
// integration runtime.
type LinkedIntegrationRuntimeRbacAuthorization struct {
	// ResourceID - The resource identifier of the integration runtime to be shared.
	ResourceID *string `json:"resourceId,omitempty"`
	// AuthorizationType - Possible values include: 'AuthorizationTypeLinkedIntegrationRuntimeType', 'AuthorizationTypeKey', 'AuthorizationTypeRBAC'
	AuthorizationType AuthorizationType `json:"authorizationType,omitempty"`
}

// MarshalJSON is the custom marshaler for LinkedIntegrationRuntimeRbacAuthorization.
func (lirra LinkedIntegrationRuntimeRbacAuthorization) MarshalJSON() ([]byte, error) {
	lirra.AuthorizationType = AuthorizationTypeRBAC
	objectMap := make(map[string]interface{})
	if lirra.ResourceID != nil {
		objectMap["resourceId"] = lirra.ResourceID
	}
	if lirra.AuthorizationType != "" {
		objectMap["authorizationType"] = lirra.AuthorizationType
	}
	return json.Marshal(objectMap)
}

// AsLinkedIntegrationRuntimeKeyAuthorization is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeRbacAuthorization.
func (lirra LinkedIntegrationRuntimeRbacAuthorization) AsLinkedIntegrationRuntimeKeyAuthorization() (*LinkedIntegrationRuntimeKeyAuthorization, bool) {
	return nil, false
}

// AsLinkedIntegrationRuntimeRbacAuthorization is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeRbacAuthorization.
func (lirra LinkedIntegrationRuntimeRbacAuthorization) AsLinkedIntegrationRuntimeRbacAuthorization() (*LinkedIntegrationRuntimeRbacAuthorization, bool) {
	return &lirra, true
}

// AsLinkedIntegrationRuntimeType is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeRbacAuthorization.
func (lirra LinkedIntegrationRuntimeRbacAuthorization) AsLinkedIntegrationRuntimeType() (*LinkedIntegrationRuntimeType, bool) {
	return nil, false
}

// AsBasicLinkedIntegrationRuntimeType is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeRbacAuthorization.
func (lirra LinkedIntegrationRuntimeRbacAuthorization) AsBasicLinkedIntegrationRuntimeType() (BasicLinkedIntegrationRuntimeType, bool) {
	return &lirra, true
}

// BasicLinkedIntegrationRuntimeType the base definition of a linked integration runtime.
type BasicLinkedIntegrationRuntimeType interface {
	AsLinkedIntegrationRuntimeKeyAuthorization() (*LinkedIntegrationRuntimeKeyAuthorization, bool)
	AsLinkedIntegrationRuntimeRbacAuthorization() (*LinkedIntegrationRuntimeRbacAuthorization, bool)
	AsLinkedIntegrationRuntimeType() (*LinkedIntegrationRuntimeType, bool)
}

// LinkedIntegrationRuntimeType the base definition of a linked integration runtime.
type LinkedIntegrationRuntimeType struct {
	// AuthorizationType - Possible values include: 'AuthorizationTypeLinkedIntegrationRuntimeType', 'AuthorizationTypeKey', 'AuthorizationTypeRBAC'
	AuthorizationType AuthorizationType `json:"authorizationType,omitempty"`
}

func unmarshalBasicLinkedIntegrationRuntimeType(body []byte) (BasicLinkedIntegrationRuntimeType, error) {
	var m map[string]interface{}
	err := json.Unmarshal(body, &m)
	if err != nil {
		return nil, err
	}

	switch m["authorizationType"] {
	case string(AuthorizationTypeKey):
		var lirka LinkedIntegrationRuntimeKeyAuthorization
		err := json.Unmarshal(body, &lirka)
		return lirka, err
	case string(AuthorizationTypeRBAC):
		var lirra LinkedIntegrationRuntimeRbacAuthorization
		err := json.Unmarshal(body, &lirra)
		return lirra, err
	default:
		var lirt LinkedIntegrationRuntimeType
		err := json.Unmarshal(body, &lirt)
		return lirt, err
	}
}
func unmarshalBasicLinkedIntegrationRuntimeTypeArray(body []byte) ([]BasicLinkedIntegrationRuntimeType, error) {
	var rawMessages []*json.RawMessage
	err := json.Unmarshal(body, &rawMessages)
	if err != nil {
		return nil, err
	}

	lirtArray := make([]BasicLinkedIntegrationRuntimeType, len(rawMessages))

	for index, rawMessage := range rawMessages {
		lirt, err := unmarshalBasicLinkedIntegrationRuntimeType(*rawMessage)
		if err != nil {
			return nil, err
		}
		lirtArray[index] = lirt
	}
	return lirtArray, nil
}

// MarshalJSON is the custom marshaler for LinkedIntegrationRuntimeType.
func (lirt LinkedIntegrationRuntimeType) MarshalJSON() ([]byte, error) {
	lirt.AuthorizationType = AuthorizationTypeLinkedIntegrationRuntimeType
	objectMap := make(map[string]interface{})
	if lirt.AuthorizationType != "" {
		objectMap["authorizationType"] = lirt.AuthorizationType
	}
	return json.Marshal(objectMap)
}

// AsLinkedIntegrationRuntimeKeyAuthorization is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeType.
func (lirt LinkedIntegrationRuntimeType) AsLinkedIntegrationRuntimeKeyAuthorization() (*LinkedIntegrationRuntimeKeyAuthorization, bool) {
	return nil, false
}

// AsLinkedIntegrationRuntimeRbacAuthorization is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeType.
func (lirt LinkedIntegrationRuntimeType) AsLinkedIntegrationRuntimeRbacAuthorization() (*LinkedIntegrationRuntimeRbacAuthorization, bool) {
	return nil, false
}

// AsLinkedIntegrationRuntimeType is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeType.
func (lirt LinkedIntegrationRuntimeType) AsLinkedIntegrationRuntimeType() (*LinkedIntegrationRuntimeType, bool) {
	return &lirt, true
}

// AsBasicLinkedIntegrationRuntimeType is the BasicLinkedIntegrationRuntimeType implementation for LinkedIntegrationRuntimeType.
func (lirt LinkedIntegrationRuntimeType) AsBasicLinkedIntegrationRuntimeType() (BasicLinkedIntegrationRuntimeType, bool) {
	return &lirt, true
}

// ListAvailableRpOperation ...
type ListAvailableRpOperation struct {
	autorest.Response `json:"-"`
	Value             *[]AvailableRpOperation `json:"value,omitempty"`
}

// ListResourceSkusResult list of available SKUs for a Kusto Pool.
type ListResourceSkusResult struct {
	autorest.Response `json:"-"`
	// Value - The collection of available SKUs for an existing resource.
	Value *[]AzureResourceSku `json:"value,omitempty"`
}

// ListSQLPoolSecurityAlertPolicies a list of SQL pool security alert policies.
type ListSQLPoolSecurityAlertPolicies struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]SQLPoolSecurityAlertPolicy `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for ListSQLPoolSecurityAlertPolicies.
func (lspsap ListSQLPoolSecurityAlertPolicies) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// ListSQLPoolSecurityAlertPoliciesIterator provides access to a complete listing of
// SQLPoolSecurityAlertPolicy values.
type ListSQLPoolSecurityAlertPoliciesIterator struct {
	i    int
	page ListSQLPoolSecurityAlertPoliciesPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *ListSQLPoolSecurityAlertPoliciesIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ListSQLPoolSecurityAlertPoliciesIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *ListSQLPoolSecurityAlertPoliciesIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ListSQLPoolSecurityAlertPoliciesIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter ListSQLPoolSecurityAlertPoliciesIterator) Response() ListSQLPoolSecurityAlertPolicies {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter ListSQLPoolSecurityAlertPoliciesIterator) Value() SQLPoolSecurityAlertPolicy {
	if !iter.page.NotDone() {
		return SQLPoolSecurityAlertPolicy{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the ListSQLPoolSecurityAlertPoliciesIterator type.
func NewListSQLPoolSecurityAlertPoliciesIterator(page ListSQLPoolSecurityAlertPoliciesPage) ListSQLPoolSecurityAlertPoliciesIterator {
	return ListSQLPoolSecurityAlertPoliciesIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (lspsap ListSQLPoolSecurityAlertPolicies) IsEmpty() bool {
	return lspsap.Value == nil || len(*lspsap.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (lspsap ListSQLPoolSecurityAlertPolicies) hasNextLink() bool {
	return lspsap.NextLink != nil && len(*lspsap.NextLink) != 0
}

// listSQLPoolSecurityAlertPoliciesPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (lspsap ListSQLPoolSecurityAlertPolicies) listSQLPoolSecurityAlertPoliciesPreparer(ctx context.Context) (*http.Request, error) {
	if !lspsap.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(lspsap.NextLink)))
}

// ListSQLPoolSecurityAlertPoliciesPage contains a page of SQLPoolSecurityAlertPolicy values.
type ListSQLPoolSecurityAlertPoliciesPage struct {
	fn     func(context.Context, ListSQLPoolSecurityAlertPolicies) (ListSQLPoolSecurityAlertPolicies, error)
	lspsap ListSQLPoolSecurityAlertPolicies
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *ListSQLPoolSecurityAlertPoliciesPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ListSQLPoolSecurityAlertPoliciesPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.lspsap)
		if err != nil {
			return err
		}
		page.lspsap = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *ListSQLPoolSecurityAlertPoliciesPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ListSQLPoolSecurityAlertPoliciesPage) NotDone() bool {
	return !page.lspsap.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page ListSQLPoolSecurityAlertPoliciesPage) Response() ListSQLPoolSecurityAlertPolicies {
	return page.lspsap
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page ListSQLPoolSecurityAlertPoliciesPage) Values() []SQLPoolSecurityAlertPolicy {
	if page.lspsap.IsEmpty() {
		return nil
	}
	return *page.lspsap.Value
}

// Creates a new instance of the ListSQLPoolSecurityAlertPoliciesPage type.
func NewListSQLPoolSecurityAlertPoliciesPage(cur ListSQLPoolSecurityAlertPolicies, getNextPage func(context.Context, ListSQLPoolSecurityAlertPolicies) (ListSQLPoolSecurityAlertPolicies, error)) ListSQLPoolSecurityAlertPoliciesPage {
	return ListSQLPoolSecurityAlertPoliciesPage{
		fn:     getNextPage,
		lspsap: cur,
	}
}

// MaintenanceWindowOptions maintenance window options.
type MaintenanceWindowOptions struct {
	autorest.Response `json:"-"`
	// MaintenanceWindowOptionsProperties - Resource properties.
	*MaintenanceWindowOptionsProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for MaintenanceWindowOptions.
func (mwo MaintenanceWindowOptions) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if mwo.MaintenanceWindowOptionsProperties != nil {
		objectMap["properties"] = mwo.MaintenanceWindowOptionsProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for MaintenanceWindowOptions struct.
func (mwo *MaintenanceWindowOptions) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var maintenanceWindowOptionsProperties MaintenanceWindowOptionsProperties
				err = json.Unmarshal(*v, &maintenanceWindowOptionsProperties)
				if err != nil {
					return err
				}
				mwo.MaintenanceWindowOptionsProperties = &maintenanceWindowOptionsProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				mwo.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				mwo.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				mwo.Type = &typeVar
			}
		}
	}

	return nil
}

// MaintenanceWindowOptionsProperties maintenance window options properties.
type MaintenanceWindowOptionsProperties struct {
	// IsEnabled - Whether maintenance windows are enabled for the database.
	IsEnabled *bool `json:"isEnabled,omitempty"`
	// MaintenanceWindowCycles - Available maintenance cycles e.g. {Saturday, 0, 48*60}, {Wednesday, 0, 24*60}.
	MaintenanceWindowCycles *[]MaintenanceWindowTimeRange `json:"maintenanceWindowCycles,omitempty"`
	// MinDurationInMinutes - Minimum duration of maintenance window.
	MinDurationInMinutes *int32 `json:"minDurationInMinutes,omitempty"`
	// DefaultDurationInMinutes - Default duration for maintenance window.
	DefaultDurationInMinutes *int32 `json:"defaultDurationInMinutes,omitempty"`
	// MinCycles - Minimum number of maintenance windows cycles to be set on the database.
	MinCycles *int32 `json:"minCycles,omitempty"`
	// TimeGranularityInMinutes - Time granularity in minutes for maintenance windows.
	TimeGranularityInMinutes *int32 `json:"timeGranularityInMinutes,omitempty"`
	// AllowMultipleMaintenanceWindowsPerCycle - Whether we allow multiple maintenance windows per cycle.
	AllowMultipleMaintenanceWindowsPerCycle *bool `json:"allowMultipleMaintenanceWindowsPerCycle,omitempty"`
}

// MaintenanceWindows maintenance windows.
type MaintenanceWindows struct {
	autorest.Response `json:"-"`
	// MaintenanceWindowsProperties - Resource properties.
	*MaintenanceWindowsProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for MaintenanceWindows.
func (mw MaintenanceWindows) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if mw.MaintenanceWindowsProperties != nil {
		objectMap["properties"] = mw.MaintenanceWindowsProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for MaintenanceWindows struct.
func (mw *MaintenanceWindows) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var maintenanceWindowsProperties MaintenanceWindowsProperties
				err = json.Unmarshal(*v, &maintenanceWindowsProperties)
				if err != nil {
					return err
				}
				mw.MaintenanceWindowsProperties = &maintenanceWindowsProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				mw.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				mw.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				mw.Type = &typeVar
			}
		}
	}

	return nil
}

// MaintenanceWindowsProperties maintenance windows resource properties.
type MaintenanceWindowsProperties struct {
	TimeRanges *[]MaintenanceWindowTimeRange `json:"timeRanges,omitempty"`
}

// MaintenanceWindowTimeRange maintenance window time range.
type MaintenanceWindowTimeRange struct {
	// DayOfWeek - Day of maintenance window. Possible values include: 'DayOfWeekSunday', 'DayOfWeekMonday', 'DayOfWeekTuesday', 'DayOfWeekWednesday', 'DayOfWeekThursday', 'DayOfWeekFriday', 'DayOfWeekSaturday'
	DayOfWeek DayOfWeek `json:"dayOfWeek,omitempty"`
	// StartTime - Start time minutes offset from 12am.
	StartTime *string `json:"startTime,omitempty"`
	// Duration - Duration of maintenance window in minutes.
	Duration *string `json:"duration,omitempty"`
}

// ManagedIdentity the workspace managed identity
type ManagedIdentity struct {
	// PrincipalID - READ-ONLY; The principal ID of the workspace managed identity
	PrincipalID *string `json:"principalId,omitempty"`
	// TenantID - READ-ONLY; The tenant ID of the workspace managed identity
	TenantID *uuid.UUID `json:"tenantId,omitempty"`
	// Type - The type of managed identity for the workspace. Possible values include: 'ResourceIdentityTypeNone', 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned'
	Type ResourceIdentityType `json:"type,omitempty"`
	// UserAssignedIdentities - The user assigned managed identities.
	UserAssignedIdentities map[string]*UserAssignedManagedIdentity `json:"userAssignedIdentities"`
}

// MarshalJSON is the custom marshaler for ManagedIdentity.
func (mi ManagedIdentity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if mi.Type != "" {
		objectMap["type"] = mi.Type
	}
	if mi.UserAssignedIdentities != nil {
		objectMap["userAssignedIdentities"] = mi.UserAssignedIdentities
	}
	return json.Marshal(objectMap)
}

// ManagedIdentitySQLControlSettingsModel sql Control Settings for workspace managed identity
type ManagedIdentitySQLControlSettingsModel struct {
	autorest.Response `json:"-"`
	// ManagedIdentitySQLControlSettingsModelProperties - Sql Control Settings for workspace managed identity
	*ManagedIdentitySQLControlSettingsModelProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for ManagedIdentitySQLControlSettingsModel.
func (miscsm ManagedIdentitySQLControlSettingsModel) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if miscsm.ManagedIdentitySQLControlSettingsModelProperties != nil {
		objectMap["properties"] = miscsm.ManagedIdentitySQLControlSettingsModelProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for ManagedIdentitySQLControlSettingsModel struct.
func (miscsm *ManagedIdentitySQLControlSettingsModel) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var managedIdentitySQLControlSettingsModelProperties ManagedIdentitySQLControlSettingsModelProperties
				err = json.Unmarshal(*v, &managedIdentitySQLControlSettingsModelProperties)
				if err != nil {
					return err
				}
				miscsm.ManagedIdentitySQLControlSettingsModelProperties = &managedIdentitySQLControlSettingsModelProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				miscsm.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				miscsm.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				miscsm.Type = &typeVar
			}
		}
	}

	return nil
}

// ManagedIdentitySQLControlSettingsModelProperties sql Control Settings for workspace managed identity
type ManagedIdentitySQLControlSettingsModelProperties struct {
	// GrantSQLControlToManagedIdentity - Grant sql control to managed identity
	GrantSQLControlToManagedIdentity *ManagedIdentitySQLControlSettingsModelPropertiesGrantSQLControlToManagedIdentity `json:"grantSqlControlToManagedIdentity,omitempty"`
}

// ManagedIdentitySQLControlSettingsModelPropertiesGrantSQLControlToManagedIdentity grant sql control to
// managed identity
type ManagedIdentitySQLControlSettingsModelPropertiesGrantSQLControlToManagedIdentity struct {
	// DesiredState - Desired state. Possible values include: 'DesiredStateEnabled', 'DesiredStateDisabled'
	DesiredState DesiredState `json:"desiredState,omitempty"`
	// ActualState - READ-ONLY; Actual state. Possible values include: 'ActualStateEnabling', 'ActualStateEnabled', 'ActualStateDisabling', 'ActualStateDisabled', 'ActualStateUnknown'
	ActualState ActualState `json:"actualState,omitempty"`
}

// MarshalJSON is the custom marshaler for ManagedIdentitySQLControlSettingsModelPropertiesGrantSQLControlToManagedIdentity.
func (miscsmSctmi ManagedIdentitySQLControlSettingsModelPropertiesGrantSQLControlToManagedIdentity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if miscsmSctmi.DesiredState != "" {
		objectMap["desiredState"] = miscsmSctmi.DesiredState
	}
	return json.Marshal(objectMap)
}

// ManagedIntegrationRuntime managed integration runtime, including managed elastic and managed dedicated
// integration runtimes.
type ManagedIntegrationRuntime struct {
	// State - READ-ONLY; Integration runtime state, only valid for managed dedicated integration runtime. Possible values include: 'IntegrationRuntimeStateInitial', 'IntegrationRuntimeStateStopped', 'IntegrationRuntimeStateStarted', 'IntegrationRuntimeStateStarting', 'IntegrationRuntimeStateStopping', 'IntegrationRuntimeStateNeedRegistration', 'IntegrationRuntimeStateOnline', 'IntegrationRuntimeStateLimited', 'IntegrationRuntimeStateOffline', 'IntegrationRuntimeStateAccessDenied'
	State IntegrationRuntimeState `json:"state,omitempty"`
	// ManagedIntegrationRuntimeTypeProperties - Managed integration runtime properties.
	*ManagedIntegrationRuntimeTypeProperties `json:"typeProperties,omitempty"`
	// ManagedIntegrationRuntimeManagedVirtualNetworkReference - Managed integration runtime managed virtual network.
	*ManagedIntegrationRuntimeManagedVirtualNetworkReference `json:"managedVirtualNetwork,omitempty"`
	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
	AdditionalProperties map[string]interface{} `json:""`
	// Description - Integration runtime description.
	Description *string `json:"description,omitempty"`
	// Type - Possible values include: 'TypeBasicIntegrationRuntimeTypeIntegrationRuntime', 'TypeBasicIntegrationRuntimeTypeManaged', 'TypeBasicIntegrationRuntimeTypeSelfHosted'
	Type TypeBasicIntegrationRuntime `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for ManagedIntegrationRuntime.
func (mir ManagedIntegrationRuntime) MarshalJSON() ([]byte, error) {
	mir.Type = TypeBasicIntegrationRuntimeTypeManaged
	objectMap := make(map[string]interface{})
	if mir.ManagedIntegrationRuntimeTypeProperties != nil {
		objectMap["typeProperties"] = mir.ManagedIntegrationRuntimeTypeProperties
	}
	if mir.ManagedIntegrationRuntimeManagedVirtualNetworkReference != nil {
		objectMap["managedVirtualNetwork"] = mir.ManagedIntegrationRuntimeManagedVirtualNetworkReference
	}
	if mir.Description != nil {
		objectMap["description"] = mir.Description
	}
	if mir.Type != "" {
		objectMap["type"] = mir.Type
	}
	for k, v := range mir.AdditionalProperties {
		objectMap[k] = v
	}
	return json.Marshal(objectMap)
}

// AsManagedIntegrationRuntime is the BasicIntegrationRuntime implementation for ManagedIntegrationRuntime.
func (mir ManagedIntegrationRuntime) AsManagedIntegrationRuntime() (*ManagedIntegrationRuntime, bool) {
	return &mir, true
}

// AsSelfHostedIntegrationRuntime is the BasicIntegrationRuntime implementation for ManagedIntegrationRuntime.
func (mir ManagedIntegrationRuntime) AsSelfHostedIntegrationRuntime() (*SelfHostedIntegrationRuntime, bool) {
	return nil, false
}

// AsIntegrationRuntime is the BasicIntegrationRuntime implementation for ManagedIntegrationRuntime.
func (mir ManagedIntegrationRuntime) AsIntegrationRuntime() (*IntegrationRuntime, bool) {
	return nil, false
}

// AsBasicIntegrationRuntime is the BasicIntegrationRuntime implementation for ManagedIntegrationRuntime.
func (mir ManagedIntegrationRuntime) AsBasicIntegrationRuntime() (BasicIntegrationRuntime, bool) {
	return &mir, true
}

// UnmarshalJSON is the custom unmarshaler for ManagedIntegrationRuntime struct.
func (mir *ManagedIntegrationRuntime) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "state":
			if v != nil {
				var state IntegrationRuntimeState
				err = json.Unmarshal(*v, &state)
				if err != nil {
					return err
				}
				mir.State = state
			}
		case "typeProperties":
			if v != nil {
				var managedIntegrationRuntimeTypeProperties ManagedIntegrationRuntimeTypeProperties
				err = json.Unmarshal(*v, &managedIntegrationRuntimeTypeProperties)
				if err != nil {
					return err
				}
				mir.ManagedIntegrationRuntimeTypeProperties = &managedIntegrationRuntimeTypeProperties
			}
		case "managedVirtualNetwork":
			if v != nil {
				var managedIntegrationRuntimeManagedVirtualNetworkReference ManagedIntegrationRuntimeManagedVirtualNetworkReference
				err = json.Unmarshal(*v, &managedIntegrationRuntimeManagedVirtualNetworkReference)
				if err != nil {
					return err
				}
				mir.ManagedIntegrationRuntimeManagedVirtualNetworkReference = &managedIntegrationRuntimeManagedVirtualNetworkReference
			}
		default:
			if v != nil {
				var additionalProperties interface{}
				err = json.Unmarshal(*v, &additionalProperties)
				if err != nil {
					return err
				}
				if mir.AdditionalProperties == nil {
					mir.AdditionalProperties = make(map[string]interface{})
				}
				mir.AdditionalProperties[k] = additionalProperties
			}
		case "description":
			if v != nil {
				var description string
				err = json.Unmarshal(*v, &description)
				if err != nil {
					return err
				}
				mir.Description = &description
			}
		case "type":
			if v != nil {
				var typeVar TypeBasicIntegrationRuntime
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				mir.Type = typeVar
			}
		}
	}

	return nil
}

// ManagedIntegrationRuntimeError error definition for managed integration runtime.
type ManagedIntegrationRuntimeError struct {
	// Time - READ-ONLY; The time when the error occurred.
	Time *date.Time `json:"time,omitempty"`
	// Code - READ-ONLY; Error code.
	Code *string `json:"code,omitempty"`
	// Parameters - READ-ONLY; Managed integration runtime error parameters.
	Parameters *[]string `json:"parameters,omitempty"`
	// Message - READ-ONLY; Error message.
	Message *string `json:"message,omitempty"`
}

// MarshalJSON is the custom marshaler for ManagedIntegrationRuntimeError.
func (mire ManagedIntegrationRuntimeError) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// ManagedIntegrationRuntimeManagedVirtualNetworkReference managed integration runtime managed virtual
// network reference.
type ManagedIntegrationRuntimeManagedVirtualNetworkReference struct {
	// ReferenceName - The reference name of the managed virtual network.
	ReferenceName *string `json:"referenceName,omitempty"`
	// Type - The type of the managed virtual network.
	Type *string `json:"type,omitempty"`
	// ID - The id of the managed virtual network.
	ID *string `json:"id,omitempty"`
}

// ManagedIntegrationRuntimeNode properties of integration runtime node.
type ManagedIntegrationRuntimeNode struct {
	// NodeID - READ-ONLY; The managed integration runtime node id.
	NodeID *string `json:"nodeId,omitempty"`
	// Status - READ-ONLY; The managed integration runtime node status. Possible values include: 'ManagedIntegrationRuntimeNodeStatusStarting', 'ManagedIntegrationRuntimeNodeStatusAvailable', 'ManagedIntegrationRuntimeNodeStatusRecycling', 'ManagedIntegrationRuntimeNodeStatusUnavailable'
	Status ManagedIntegrationRuntimeNodeStatus `json:"status,omitempty"`
	// Errors - The errors that occurred on this integration runtime node.
	Errors *[]ManagedIntegrationRuntimeError `json:"errors,omitempty"`
}

// MarshalJSON is the custom marshaler for ManagedIntegrationRuntimeNode.
func (mirn ManagedIntegrationRuntimeNode) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if mirn.Errors != nil {
		objectMap["errors"] = mirn.Errors
	}
	return json.Marshal(objectMap)
}

// ManagedIntegrationRuntimeOperationResult properties of managed integration runtime operation result.
type ManagedIntegrationRuntimeOperationResult struct {
	// Type - READ-ONLY; The operation type. Could be start or stop.
	Type *string `json:"type,omitempty"`
	// StartTime - READ-ONLY; The start time of the operation.
	StartTime *date.Time `json:"startTime,omitempty"`
	// Result - READ-ONLY; The operation result.
	Result *string `json:"result,omitempty"`
	// ErrorCode - READ-ONLY; The error code.
	ErrorCode *string `json:"errorCode,omitempty"`
	// Parameters - READ-ONLY; Managed integration runtime error parameters.
	Parameters *[]string `json:"parameters,omitempty"`
	// ActivityID - READ-ONLY; The activity id for the operation request.
	ActivityID *string `json:"activityId,omitempty"`
}

// MarshalJSON is the custom marshaler for ManagedIntegrationRuntimeOperationResult.
func (miror ManagedIntegrationRuntimeOperationResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// ManagedIntegrationRuntimeStatus managed integration runtime status.
type ManagedIntegrationRuntimeStatus struct {
	// ManagedIntegrationRuntimeStatusTypeProperties - Managed integration runtime status type properties.
	*ManagedIntegrationRuntimeStatusTypeProperties `json:"typeProperties,omitempty"`
	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
	AdditionalProperties map[string]interface{} `json:""`
	// DataFactoryName - READ-ONLY; The workspace name which the integration runtime belong to.
	DataFactoryName *string `json:"dataFactoryName,omitempty"`
	// State - READ-ONLY; The state of integration runtime. Possible values include: 'IntegrationRuntimeStateInitial', 'IntegrationRuntimeStateStopped', 'IntegrationRuntimeStateStarted', 'IntegrationRuntimeStateStarting', 'IntegrationRuntimeStateStopping', 'IntegrationRuntimeStateNeedRegistration', 'IntegrationRuntimeStateOnline', 'IntegrationRuntimeStateLimited', 'IntegrationRuntimeStateOffline', 'IntegrationRuntimeStateAccessDenied'
	State IntegrationRuntimeState `json:"state,omitempty"`
	// Type - Possible values include: 'TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus', 'TypeBasicIntegrationRuntimeStatusTypeManaged', 'TypeBasicIntegrationRuntimeStatusTypeSelfHosted'
	Type TypeBasicIntegrationRuntimeStatus `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for ManagedIntegrationRuntimeStatus.
func (mirs ManagedIntegrationRuntimeStatus) MarshalJSON() ([]byte, error) {
	mirs.Type = TypeBasicIntegrationRuntimeStatusTypeManaged
	objectMap := make(map[string]interface{})
	if mirs.ManagedIntegrationRuntimeStatusTypeProperties != nil {
		objectMap["typeProperties"] = mirs.ManagedIntegrationRuntimeStatusTypeProperties
	}
	if mirs.Type != "" {
		objectMap["type"] = mirs.Type
	}
	for k, v := range mirs.AdditionalProperties {
		objectMap[k] = v
	}
	return json.Marshal(objectMap)
}

// AsManagedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for ManagedIntegrationRuntimeStatus.
func (mirs ManagedIntegrationRuntimeStatus) AsManagedIntegrationRuntimeStatus() (*ManagedIntegrationRuntimeStatus, bool) {
	return &mirs, true
}

// AsSelfHostedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for ManagedIntegrationRuntimeStatus.
func (mirs ManagedIntegrationRuntimeStatus) AsSelfHostedIntegrationRuntimeStatus() (*SelfHostedIntegrationRuntimeStatus, bool) {
	return nil, false
}

// AsIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for ManagedIntegrationRuntimeStatus.
func (mirs ManagedIntegrationRuntimeStatus) AsIntegrationRuntimeStatus() (*IntegrationRuntimeStatus, bool) {
	return nil, false
}

// AsBasicIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for ManagedIntegrationRuntimeStatus.
func (mirs ManagedIntegrationRuntimeStatus) AsBasicIntegrationRuntimeStatus() (BasicIntegrationRuntimeStatus, bool) {
	return &mirs, true
}

// UnmarshalJSON is the custom unmarshaler for ManagedIntegrationRuntimeStatus struct.
func (mirs *ManagedIntegrationRuntimeStatus) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "typeProperties":
			if v != nil {
				var managedIntegrationRuntimeStatusTypeProperties ManagedIntegrationRuntimeStatusTypeProperties
				err = json.Unmarshal(*v, &managedIntegrationRuntimeStatusTypeProperties)
				if err != nil {
					return err
				}
				mirs.ManagedIntegrationRuntimeStatusTypeProperties = &managedIntegrationRuntimeStatusTypeProperties
			}
		default:
			if v != nil {
				var additionalProperties interface{}
				err = json.Unmarshal(*v, &additionalProperties)
				if err != nil {
					return err
				}
				if mirs.AdditionalProperties == nil {
					mirs.AdditionalProperties = make(map[string]interface{})
				}
				mirs.AdditionalProperties[k] = additionalProperties
			}
		case "dataFactoryName":
			if v != nil {
				var dataFactoryName string
				err = json.Unmarshal(*v, &dataFactoryName)
				if err != nil {
					return err
				}
				mirs.DataFactoryName = &dataFactoryName
			}
		case "state":
			if v != nil {
				var state IntegrationRuntimeState
				err = json.Unmarshal(*v, &state)
				if err != nil {
					return err
				}
				mirs.State = state
			}
		case "type":
			if v != nil {
				var typeVar TypeBasicIntegrationRuntimeStatus
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				mirs.Type = typeVar
			}
		}
	}

	return nil
}

// ManagedIntegrationRuntimeStatusTypeProperties managed integration runtime status type properties.
type ManagedIntegrationRuntimeStatusTypeProperties struct {
	// CreateTime - READ-ONLY; The time at which the integration runtime was created, in ISO8601 format.
	CreateTime *date.Time `json:"createTime,omitempty"`
	// Nodes - READ-ONLY; The list of nodes for managed integration runtime.
	Nodes *[]ManagedIntegrationRuntimeNode `json:"nodes,omitempty"`
	// OtherErrors - READ-ONLY; The errors that occurred on this integration runtime.
	OtherErrors *[]ManagedIntegrationRuntimeError `json:"otherErrors,omitempty"`
	// LastOperation - READ-ONLY; The last operation result that occurred on this integration runtime.
	LastOperation *ManagedIntegrationRuntimeOperationResult `json:"lastOperation,omitempty"`
}

// MarshalJSON is the custom marshaler for ManagedIntegrationRuntimeStatusTypeProperties.
func (mirstp ManagedIntegrationRuntimeStatusTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// ManagedIntegrationRuntimeTypeProperties managed integration runtime type properties.
type ManagedIntegrationRuntimeTypeProperties struct {
	// ComputeProperties - The compute resource for managed integration runtime.
	ComputeProperties *IntegrationRuntimeComputeProperties `json:"computeProperties,omitempty"`
	// SsisProperties - SSIS properties for managed integration runtime.
	SsisProperties *IntegrationRuntimeSsisProperties `json:"ssisProperties,omitempty"`
}

// ManagedVirtualNetworkSettings managed Virtual Network Settings
type ManagedVirtualNetworkSettings struct {
	// PreventDataExfiltration - Prevent Data Exfiltration
	PreventDataExfiltration *bool `json:"preventDataExfiltration,omitempty"`
	// LinkedAccessCheckOnTargetResource - Linked Access Check On Target Resource
	LinkedAccessCheckOnTargetResource *bool `json:"linkedAccessCheckOnTargetResource,omitempty"`
	// AllowedAadTenantIdsForLinking - Allowed Aad Tenant Ids For Linking
	AllowedAadTenantIdsForLinking *[]string `json:"allowedAadTenantIdsForLinking,omitempty"`
}

// MetadataSyncConfig configuration for metadata sync
type MetadataSyncConfig struct {
	autorest.Response `json:"-"`
	// MetadataSyncConfigProperties - Metadata Sync Config properties
	*MetadataSyncConfigProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for MetadataSyncConfig.
func (msc MetadataSyncConfig) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if msc.MetadataSyncConfigProperties != nil {
		objectMap["properties"] = msc.MetadataSyncConfigProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for MetadataSyncConfig struct.
func (msc *MetadataSyncConfig) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var metadataSyncConfigProperties MetadataSyncConfigProperties
				err = json.Unmarshal(*v, &metadataSyncConfigProperties)
				if err != nil {
					return err
				}
				msc.MetadataSyncConfigProperties = &metadataSyncConfigProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				msc.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				msc.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				msc.Type = &typeVar
			}
		}
	}

	return nil
}

// MetadataSyncConfigProperties metadata Sync Config properties
type MetadataSyncConfigProperties struct {
	// Enabled - Indicates whether the metadata sync is enabled or disabled
	Enabled *bool `json:"enabled,omitempty"`
	// SyncIntervalInMinutes - The Sync Interval in minutes.
	SyncIntervalInMinutes *int32 `json:"syncIntervalInMinutes,omitempty"`
}

// Operation ...
type Operation struct {
	// Name - This is of the format {provider}/{resource}/{operation}.
	Name       *string           `json:"name,omitempty"`
	Display    *OperationDisplay `json:"display,omitempty"`
	Origin     *string           `json:"origin,omitempty"`
	Properties interface{}       `json:"properties,omitempty"`
}

// OperationDisplay ...
type OperationDisplay struct {
	Provider *string `json:"provider,omitempty"`
	// Operation - For example: read, write, delete.
	Operation   *string `json:"operation,omitempty"`
	Resource    *string `json:"resource,omitempty"`
	Description *string `json:"description,omitempty"`
}

// OperationListResult ...
type OperationListResult struct {
	autorest.Response `json:"-"`
	Value             *[]Operation `json:"value,omitempty"`
	// NextLink - READ-ONLY
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for OperationListResult.
func (olr OperationListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if olr.Value != nil {
		objectMap["value"] = olr.Value
	}
	return json.Marshal(objectMap)
}

// OperationListResultIterator provides access to a complete listing of Operation values.
type OperationListResultIterator struct {
	i    int
	page OperationListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *OperationListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter OperationListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter OperationListResultIterator) Response() OperationListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter OperationListResultIterator) Value() Operation {
	if !iter.page.NotDone() {
		return Operation{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the OperationListResultIterator type.
func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
	return OperationListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (olr OperationListResult) IsEmpty() bool {
	return olr.Value == nil || len(*olr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (olr OperationListResult) hasNextLink() bool {
	return olr.NextLink != nil && len(*olr.NextLink) != 0
}

// operationListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !olr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(olr.NextLink)))
}

// OperationListResultPage contains a page of Operation values.
type OperationListResultPage struct {
	fn  func(context.Context, OperationListResult) (OperationListResult, error)
	olr OperationListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.olr)
		if err != nil {
			return err
		}
		page.olr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *OperationListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page OperationListResultPage) NotDone() bool {
	return !page.olr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page OperationListResultPage) Response() OperationListResult {
	return page.olr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page OperationListResultPage) Values() []Operation {
	if page.olr.IsEmpty() {
		return nil
	}
	return *page.olr.Value
}

// Creates a new instance of the OperationListResultPage type.
func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
	return OperationListResultPage{
		fn:  getNextPage,
		olr: cur,
	}
}

// OperationMetaLogSpecification what is this?
type OperationMetaLogSpecification struct {
	// DisplayName - Log display name
	DisplayName *string `json:"displayName,omitempty"`
	// BlobDuration - Time range the log covers
	BlobDuration *string `json:"blobDuration,omitempty"`
	// Name - Log unique name
	Name *string `json:"name,omitempty"`
}

// OperationMetaMetricDimensionSpecification what is this?
type OperationMetaMetricDimensionSpecification struct {
	// DisplayName - Dimension display name
	DisplayName *string `json:"displayName,omitempty"`
	// Name - Dimension unique name
	Name *string `json:"name,omitempty"`
	// ToBeExportedForShoebox - Whether this metric should be exported for Shoebox
	ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"`
}

// OperationMetaMetricSpecification what is this?
type OperationMetaMetricSpecification struct {
	// SourceMdmNamespace - The source MDM namespace
	SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"`
	// DisplayName - Metric display name
	DisplayName *string `json:"displayName,omitempty"`
	// Name - Metric unique name
	Name *string `json:"name,omitempty"`
	// AggregationType - Metric aggregation type
	AggregationType *string `json:"aggregationType,omitempty"`
	// DisplayDescription - Metric description
	DisplayDescription *string `json:"displayDescription,omitempty"`
	// SourceMdmAccount - The source MDM account
	SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"`
	// EnableRegionalMdmAccount - Whether the regional MDM account is enabled
	EnableRegionalMdmAccount *bool `json:"enableRegionalMdmAccount,omitempty"`
	// Unit - Metric units
	Unit *string `json:"unit,omitempty"`
	// Dimensions - Metric dimensions
	Dimensions *[]OperationMetaMetricDimensionSpecification `json:"dimensions,omitempty"`
	// SupportsInstanceLevelAggregation - Whether the metric supports instance-level aggregation
	SupportsInstanceLevelAggregation *bool `json:"supportsInstanceLevelAggregation,omitempty"`
	// MetricFilterPattern - Metric filter
	MetricFilterPattern *string `json:"metricFilterPattern,omitempty"`
}

// OperationMetaPropertyInfo what is this?
type OperationMetaPropertyInfo struct {
	// ServiceSpecification - Operation service specification
	ServiceSpecification *OperationMetaServiceSpecification `json:"serviceSpecification,omitempty"`
}

// OperationMetaServiceSpecification what is this?
type OperationMetaServiceSpecification struct {
	// MetricSpecifications - Service metric specifications
	MetricSpecifications *[]OperationMetaMetricSpecification `json:"metricSpecifications,omitempty"`
	// LogSpecifications - Service log specifications
	LogSpecifications *[]OperationMetaLogSpecification `json:"logSpecifications,omitempty"`
}

// OperationResource an operation
type OperationResource struct {
	autorest.Response `json:"-"`
	// ID - Operation ID
	ID *string `json:"id,omitempty"`
	// Name - Operation name
	Name *string `json:"name,omitempty"`
	// Status - Operation status. Possible values include: 'OperationStatusInProgress', 'OperationStatusSucceeded', 'OperationStatusFailed', 'OperationStatusCanceled'
	Status OperationStatus `json:"status,omitempty"`
	// Properties - Operation properties
	Properties interface{} `json:"properties,omitempty"`
	// Error - Errors from the operation
	Error *ErrorDetail `json:"error,omitempty"`
	// StartTime - Operation start time
	StartTime *date.Time `json:"startTime,omitempty"`
	// EndTime - Operation start time
	EndTime *date.Time `json:"endTime,omitempty"`
	// PercentComplete - Completion percentage of the operation
	PercentComplete *float64 `json:"percentComplete,omitempty"`
}

// OptimizedAutoscale a class that contains the optimized auto scale definition.
type OptimizedAutoscale struct {
	// Version - The version of the template defined, for instance 1.
	Version *int32 `json:"version,omitempty"`
	// IsEnabled - A boolean value that indicate if the optimized autoscale feature is enabled or not.
	IsEnabled *bool `json:"isEnabled,omitempty"`
	// Minimum - Minimum allowed instances count.
	Minimum *int32 `json:"minimum,omitempty"`
	// Maximum - Maximum allowed instances count.
	Maximum *int32 `json:"maximum,omitempty"`
}

// PrivateEndpoint private endpoint details
type PrivateEndpoint struct {
	// ID - READ-ONLY; Resource id of the private endpoint.
	ID *string `json:"id,omitempty"`
}

// MarshalJSON is the custom marshaler for PrivateEndpoint.
func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// PrivateEndpointConnection a private endpoint connection
type PrivateEndpointConnection struct {
	autorest.Response `json:"-"`
	// PrivateEndpointConnectionProperties - Private endpoint connection properties.
	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for PrivateEndpointConnection.
func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if pec.PrivateEndpointConnectionProperties != nil {
		objectMap["properties"] = pec.PrivateEndpointConnectionProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct.
func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
				err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
				if err != nil {
					return err
				}
				pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				pec.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				pec.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				pec.Type = &typeVar
			}
		}
	}

	return nil
}

// PrivateEndpointConnectionForPrivateLinkHub ...
type PrivateEndpointConnectionForPrivateLinkHub struct {
	autorest.Response `json:"-"`
	Name              *string `json:"name,omitempty"`
	Type              *string `json:"type,omitempty"`
	// ID - READ-ONLY; identifier
	ID *string `json:"id,omitempty"`
	// PrivateEndpointConnectionProperties - Properties of private endpoint connection for private link hub
	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
}

// MarshalJSON is the custom marshaler for PrivateEndpointConnectionForPrivateLinkHub.
func (pecfplh PrivateEndpointConnectionForPrivateLinkHub) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if pecfplh.Name != nil {
		objectMap["name"] = pecfplh.Name
	}
	if pecfplh.Type != nil {
		objectMap["type"] = pecfplh.Type
	}
	if pecfplh.PrivateEndpointConnectionProperties != nil {
		objectMap["properties"] = pecfplh.PrivateEndpointConnectionProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnectionForPrivateLinkHub struct.
func (pecfplh *PrivateEndpointConnectionForPrivateLinkHub) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				pecfplh.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				pecfplh.Type = &typeVar
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				pecfplh.ID = &ID
			}
		case "properties":
			if v != nil {
				var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
				err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
				if err != nil {
					return err
				}
				pecfplh.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
			}
		}
	}

	return nil
}

// PrivateEndpointConnectionForPrivateLinkHubBasic private Endpoint Connection For Private Link Hub - Basic
type PrivateEndpointConnectionForPrivateLinkHubBasic struct {
	// ID - READ-ONLY; identifier
	ID *string `json:"id,omitempty"`
	// PrivateEndpointConnectionProperties - Properties of private endpoint connection for private link hub
	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
}

// MarshalJSON is the custom marshaler for PrivateEndpointConnectionForPrivateLinkHubBasic.
func (pecfplhb PrivateEndpointConnectionForPrivateLinkHubBasic) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if pecfplhb.PrivateEndpointConnectionProperties != nil {
		objectMap["properties"] = pecfplhb.PrivateEndpointConnectionProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnectionForPrivateLinkHubBasic struct.
func (pecfplhb *PrivateEndpointConnectionForPrivateLinkHubBasic) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				pecfplhb.ID = &ID
			}
		case "properties":
			if v != nil {
				var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
				err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
				if err != nil {
					return err
				}
				pecfplhb.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
			}
		}
	}

	return nil
}

// PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse ...
type PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse struct {
	autorest.Response `json:"-"`
	Value             *[]PrivateEndpointConnectionForPrivateLinkHub `json:"value,omitempty"`
	NextLink          *string                                       `json:"nextLink,omitempty"`
}

// PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator provides access to a
// complete listing of PrivateEndpointConnectionForPrivateLinkHub values.
type PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator struct {
	i    int
	page PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator) Response() PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator) Value() PrivateEndpointConnectionForPrivateLinkHub {
	if !iter.page.NotDone() {
		return PrivateEndpointConnectionForPrivateLinkHub{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator type.
func NewPrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator(page PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage) PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator {
	return PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (pecfplhRcr PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse) IsEmpty() bool {
	return pecfplhRcr.Value == nil || len(*pecfplhRcr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (pecfplhRcr PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse) hasNextLink() bool {
	return pecfplhRcr.NextLink != nil && len(*pecfplhRcr.NextLink) != 0
}

// privateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (pecfplhRcr PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse) privateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePreparer(ctx context.Context) (*http.Request, error) {
	if !pecfplhRcr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(pecfplhRcr.NextLink)))
}

// PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage contains a page of
// PrivateEndpointConnectionForPrivateLinkHub values.
type PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage struct {
	fn         func(context.Context, PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse) (PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse, error)
	pecfplhrcr PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.pecfplhrcr)
		if err != nil {
			return err
		}
		page.pecfplhrcr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage) NotDone() bool {
	return !page.pecfplhrcr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage) Response() PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse {
	return page.pecfplhrcr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage) Values() []PrivateEndpointConnectionForPrivateLinkHub {
	if page.pecfplhrcr.IsEmpty() {
		return nil
	}
	return *page.pecfplhrcr.Value
}

// Creates a new instance of the PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage type.
func NewPrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage(cur PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse, getNextPage func(context.Context, PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse) (PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse, error)) PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage {
	return PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponsePage{
		fn:         getNextPage,
		pecfplhrcr: cur,
	}
}

// PrivateEndpointConnectionList a list of private endpoint connections
type PrivateEndpointConnectionList struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]PrivateEndpointConnection `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for PrivateEndpointConnectionList.
func (pecl PrivateEndpointConnectionList) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// PrivateEndpointConnectionListIterator provides access to a complete listing of PrivateEndpointConnection
// values.
type PrivateEndpointConnectionListIterator struct {
	i    int
	page PrivateEndpointConnectionListPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *PrivateEndpointConnectionListIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *PrivateEndpointConnectionListIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter PrivateEndpointConnectionListIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter PrivateEndpointConnectionListIterator) Response() PrivateEndpointConnectionList {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter PrivateEndpointConnectionListIterator) Value() PrivateEndpointConnection {
	if !iter.page.NotDone() {
		return PrivateEndpointConnection{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the PrivateEndpointConnectionListIterator type.
func NewPrivateEndpointConnectionListIterator(page PrivateEndpointConnectionListPage) PrivateEndpointConnectionListIterator {
	return PrivateEndpointConnectionListIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (pecl PrivateEndpointConnectionList) IsEmpty() bool {
	return pecl.Value == nil || len(*pecl.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (pecl PrivateEndpointConnectionList) hasNextLink() bool {
	return pecl.NextLink != nil && len(*pecl.NextLink) != 0
}

// privateEndpointConnectionListPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (pecl PrivateEndpointConnectionList) privateEndpointConnectionListPreparer(ctx context.Context) (*http.Request, error) {
	if !pecl.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(pecl.NextLink)))
}

// PrivateEndpointConnectionListPage contains a page of PrivateEndpointConnection values.
type PrivateEndpointConnectionListPage struct {
	fn   func(context.Context, PrivateEndpointConnectionList) (PrivateEndpointConnectionList, error)
	pecl PrivateEndpointConnectionList
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *PrivateEndpointConnectionListPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.pecl)
		if err != nil {
			return err
		}
		page.pecl = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *PrivateEndpointConnectionListPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page PrivateEndpointConnectionListPage) NotDone() bool {
	return !page.pecl.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page PrivateEndpointConnectionListPage) Response() PrivateEndpointConnectionList {
	return page.pecl
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page PrivateEndpointConnectionListPage) Values() []PrivateEndpointConnection {
	if page.pecl.IsEmpty() {
		return nil
	}
	return *page.pecl.Value
}

// Creates a new instance of the PrivateEndpointConnectionListPage type.
func NewPrivateEndpointConnectionListPage(cur PrivateEndpointConnectionList, getNextPage func(context.Context, PrivateEndpointConnectionList) (PrivateEndpointConnectionList, error)) PrivateEndpointConnectionListPage {
	return PrivateEndpointConnectionListPage{
		fn:   getNextPage,
		pecl: cur,
	}
}

// PrivateEndpointConnectionProperties properties of a private endpoint connection.
type PrivateEndpointConnectionProperties struct {
	// PrivateEndpoint - The private endpoint which the connection belongs to.
	PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`
	// PrivateLinkServiceConnectionState - Connection state of the private endpoint connection.
	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
	// ProvisioningState - READ-ONLY; Provisioning state of the private endpoint connection.
	ProvisioningState *string `json:"provisioningState,omitempty"`
}

// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties.
func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if pecp.PrivateEndpoint != nil {
		objectMap["privateEndpoint"] = pecp.PrivateEndpoint
	}
	if pecp.PrivateLinkServiceConnectionState != nil {
		objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState
	}
	return json.Marshal(objectMap)
}

// PrivateEndpointConnectionsCreateFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type PrivateEndpointConnectionsCreateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *PrivateEndpointConnectionsCreateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for PrivateEndpointConnectionsCreateFuture.Result.
func (future *PrivateEndpointConnectionsCreateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsCreateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		pec.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.PrivateEndpointConnectionsCreateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent {
		pec, err = client.CreateResponder(pec.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsCreateFuture", "Result", pec.Response.Response, "Failure responding to request")
		}
	}
	return
}

// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type PrivateEndpointConnectionsDeleteFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(PrivateEndpointConnectionsClient) (OperationResource, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result.
func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (or OperationResource, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		or.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.PrivateEndpointConnectionsDeleteFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if or.Response.Response, err = future.GetResult(sender); err == nil && or.Response.Response.StatusCode != http.StatusNoContent {
		or, err = client.DeleteResponder(or.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.PrivateEndpointConnectionsDeleteFuture", "Result", or.Response.Response, "Failure responding to request")
		}
	}
	return
}

// PrivateLinkHub a privateLinkHub
type PrivateLinkHub struct {
	autorest.Response `json:"-"`
	// PrivateLinkHubProperties - PrivateLinkHub resource properties
	*PrivateLinkHubProperties `json:"properties,omitempty"`
	// Tags - Resource tags.
	Tags map[string]*string `json:"tags"`
	// Location - The geo-location where the resource lives
	Location *string `json:"location,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for PrivateLinkHub.
func (plh PrivateLinkHub) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if plh.PrivateLinkHubProperties != nil {
		objectMap["properties"] = plh.PrivateLinkHubProperties
	}
	if plh.Tags != nil {
		objectMap["tags"] = plh.Tags
	}
	if plh.Location != nil {
		objectMap["location"] = plh.Location
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for PrivateLinkHub struct.
func (plh *PrivateLinkHub) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var privateLinkHubProperties PrivateLinkHubProperties
				err = json.Unmarshal(*v, &privateLinkHubProperties)
				if err != nil {
					return err
				}
				plh.PrivateLinkHubProperties = &privateLinkHubProperties
			}
		case "tags":
			if v != nil {
				var tags map[string]*string
				err = json.Unmarshal(*v, &tags)
				if err != nil {
					return err
				}
				plh.Tags = tags
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				plh.Location = &location
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				plh.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				plh.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				plh.Type = &typeVar
			}
		}
	}

	return nil
}

// PrivateLinkHubInfoListResult list of privateLinkHubs
type PrivateLinkHubInfoListResult struct {
	autorest.Response `json:"-"`
	// NextLink - Link to the next page of results
	NextLink *string `json:"nextLink,omitempty"`
	// Value - List of privateLinkHubs
	Value *[]PrivateLinkHub `json:"value,omitempty"`
}

// PrivateLinkHubInfoListResultIterator provides access to a complete listing of PrivateLinkHub values.
type PrivateLinkHubInfoListResultIterator struct {
	i    int
	page PrivateLinkHubInfoListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *PrivateLinkHubInfoListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubInfoListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *PrivateLinkHubInfoListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter PrivateLinkHubInfoListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter PrivateLinkHubInfoListResultIterator) Response() PrivateLinkHubInfoListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter PrivateLinkHubInfoListResultIterator) Value() PrivateLinkHub {
	if !iter.page.NotDone() {
		return PrivateLinkHub{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the PrivateLinkHubInfoListResultIterator type.
func NewPrivateLinkHubInfoListResultIterator(page PrivateLinkHubInfoListResultPage) PrivateLinkHubInfoListResultIterator {
	return PrivateLinkHubInfoListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (plhilr PrivateLinkHubInfoListResult) IsEmpty() bool {
	return plhilr.Value == nil || len(*plhilr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (plhilr PrivateLinkHubInfoListResult) hasNextLink() bool {
	return plhilr.NextLink != nil && len(*plhilr.NextLink) != 0
}

// privateLinkHubInfoListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (plhilr PrivateLinkHubInfoListResult) privateLinkHubInfoListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !plhilr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(plhilr.NextLink)))
}

// PrivateLinkHubInfoListResultPage contains a page of PrivateLinkHub values.
type PrivateLinkHubInfoListResultPage struct {
	fn     func(context.Context, PrivateLinkHubInfoListResult) (PrivateLinkHubInfoListResult, error)
	plhilr PrivateLinkHubInfoListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *PrivateLinkHubInfoListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubInfoListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.plhilr)
		if err != nil {
			return err
		}
		page.plhilr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *PrivateLinkHubInfoListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page PrivateLinkHubInfoListResultPage) NotDone() bool {
	return !page.plhilr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page PrivateLinkHubInfoListResultPage) Response() PrivateLinkHubInfoListResult {
	return page.plhilr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page PrivateLinkHubInfoListResultPage) Values() []PrivateLinkHub {
	if page.plhilr.IsEmpty() {
		return nil
	}
	return *page.plhilr.Value
}

// Creates a new instance of the PrivateLinkHubInfoListResultPage type.
func NewPrivateLinkHubInfoListResultPage(cur PrivateLinkHubInfoListResult, getNextPage func(context.Context, PrivateLinkHubInfoListResult) (PrivateLinkHubInfoListResult, error)) PrivateLinkHubInfoListResultPage {
	return PrivateLinkHubInfoListResultPage{
		fn:     getNextPage,
		plhilr: cur,
	}
}

// PrivateLinkHubPatchInfo privateLinkHub patch details
type PrivateLinkHubPatchInfo struct {
	// Tags - Resource tags
	Tags map[string]*string `json:"tags"`
}

// MarshalJSON is the custom marshaler for PrivateLinkHubPatchInfo.
func (plhpi PrivateLinkHubPatchInfo) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if plhpi.Tags != nil {
		objectMap["tags"] = plhpi.Tags
	}
	return json.Marshal(objectMap)
}

// PrivateLinkHubProperties privateLinkHub properties
type PrivateLinkHubProperties struct {
	// ProvisioningState - PrivateLinkHub provisioning state
	ProvisioningState *string `json:"provisioningState,omitempty"`
	// PrivateEndpointConnections - READ-ONLY; List of private endpoint connections
	PrivateEndpointConnections *[]PrivateEndpointConnectionForPrivateLinkHubBasic `json:"privateEndpointConnections,omitempty"`
}

// MarshalJSON is the custom marshaler for PrivateLinkHubProperties.
func (plhp PrivateLinkHubProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if plhp.ProvisioningState != nil {
		objectMap["provisioningState"] = plhp.ProvisioningState
	}
	return json.Marshal(objectMap)
}

// PrivateLinkHubsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type PrivateLinkHubsDeleteFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(PrivateLinkHubsClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *PrivateLinkHubsDeleteFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for PrivateLinkHubsDeleteFuture.Result.
func (future *PrivateLinkHubsDeleteFuture) result(client PrivateLinkHubsClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsDeleteFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.PrivateLinkHubsDeleteFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// PrivateLinkResource a private link resource
type PrivateLinkResource struct {
	autorest.Response `json:"-"`
	// Properties - READ-ONLY; The private link resource properties.
	Properties *PrivateLinkResourceProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for PrivateLinkResource.
func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// PrivateLinkResourceListResult a list of private link resources
type PrivateLinkResourceListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]PrivateLinkResource `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for PrivateLinkResourceListResult.
func (plrlr PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource
// values.
type PrivateLinkResourceListResultIterator struct {
	i    int
	page PrivateLinkResourceListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *PrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *PrivateLinkResourceListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter PrivateLinkResourceListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter PrivateLinkResourceListResultIterator) Response() PrivateLinkResourceListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter PrivateLinkResourceListResultIterator) Value() PrivateLinkResource {
	if !iter.page.NotDone() {
		return PrivateLinkResource{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the PrivateLinkResourceListResultIterator type.
func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator {
	return PrivateLinkResourceListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (plrlr PrivateLinkResourceListResult) IsEmpty() bool {
	return plrlr.Value == nil || len(*plrlr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (plrlr PrivateLinkResourceListResult) hasNextLink() bool {
	return plrlr.NextLink != nil && len(*plrlr.NextLink) != 0
}

// privateLinkResourceListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (plrlr PrivateLinkResourceListResult) privateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !plrlr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(plrlr.NextLink)))
}

// PrivateLinkResourceListResultPage contains a page of PrivateLinkResource values.
type PrivateLinkResourceListResultPage struct {
	fn    func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)
	plrlr PrivateLinkResourceListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *PrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.plrlr)
		if err != nil {
			return err
		}
		page.plrlr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *PrivateLinkResourceListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page PrivateLinkResourceListResultPage) NotDone() bool {
	return !page.plrlr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page PrivateLinkResourceListResultPage) Response() PrivateLinkResourceListResult {
	return page.plrlr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page PrivateLinkResourceListResultPage) Values() []PrivateLinkResource {
	if page.plrlr.IsEmpty() {
		return nil
	}
	return *page.plrlr.Value
}

// Creates a new instance of the PrivateLinkResourceListResultPage type.
func NewPrivateLinkResourceListResultPage(cur PrivateLinkResourceListResult, getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage {
	return PrivateLinkResourceListResultPage{
		fn:    getNextPage,
		plrlr: cur,
	}
}

// PrivateLinkResourceProperties properties of a private link resource.
type PrivateLinkResourceProperties struct {
	// GroupID - READ-ONLY; The private link resource group id.
	GroupID *string `json:"groupId,omitempty"`
	// RequiredMembers - READ-ONLY; The private link resource required member names.
	RequiredMembers *[]string `json:"requiredMembers,omitempty"`
	// RequiredZoneNames - READ-ONLY; Required DNS zone names of the the private link resource.
	RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"`
}

// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties.
func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// PrivateLinkServiceConnectionState connection state details of the private endpoint
type PrivateLinkServiceConnectionState struct {
	// Status - The private link service connection status.
	Status *string `json:"status,omitempty"`
	// Description - The private link service connection description.
	Description *string `json:"description,omitempty"`
	// ActionsRequired - READ-ONLY; The actions required for private link service connection.
	ActionsRequired *string `json:"actionsRequired,omitempty"`
}

// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionState.
func (plscs PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if plscs.Status != nil {
		objectMap["status"] = plscs.Status
	}
	if plscs.Description != nil {
		objectMap["description"] = plscs.Description
	}
	return json.Marshal(objectMap)
}

// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not
// have tags and a location
type ProxyResource struct {
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for ProxyResource.
func (pr ProxyResource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// PurviewConfiguration purview Configuration
type PurviewConfiguration struct {
	// PurviewResourceID - Purview Resource ID
	PurviewResourceID *string `json:"purviewResourceId,omitempty"`
}

// QueryInterval a database query.
type QueryInterval struct {
	// IntervalStartTime - READ-ONLY; The start time of the measurement interval (ISO8601 format).
	IntervalStartTime *date.Time `json:"intervalStartTime,omitempty"`
	// ExecutionCount - READ-ONLY; The number of times the query was executed during this interval.
	ExecutionCount *float64 `json:"executionCount,omitempty"`
	// Metrics - READ-ONLY; The list of query metrics during this interval.
	Metrics *[]QueryMetric `json:"metrics,omitempty"`
}

// MarshalJSON is the custom marshaler for QueryInterval.
func (qi QueryInterval) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// QueryMetric a database query.
type QueryMetric struct {
	// Name - READ-ONLY; The name of the metric
	Name *string `json:"name,omitempty"`
	// DisplayName - READ-ONLY; The name of the metric for display in user interface
	DisplayName *string `json:"displayName,omitempty"`
	// Unit - READ-ONLY; The unit of measurement. Possible values include: 'QueryMetricUnitPercentage', 'QueryMetricUnitKB', 'QueryMetricUnitMicroseconds'
	Unit QueryMetricUnit `json:"unit,omitempty"`
	// Value - READ-ONLY; The measured value
	Value *float64 `json:"value,omitempty"`
}

// MarshalJSON is the custom marshaler for QueryMetric.
func (qm QueryMetric) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// QueryStatistic a database query.
type QueryStatistic struct {
	// QueryID - READ-ONLY; The id of the query
	QueryID *string `json:"queryId,omitempty"`
	// Intervals - READ-ONLY; The list of query intervals.
	Intervals *[]QueryInterval `json:"intervals,omitempty"`
}

// MarshalJSON is the custom marshaler for QueryStatistic.
func (qs QueryStatistic) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// ReadOnlyFollowingDatabase class representing a read only following database.
type ReadOnlyFollowingDatabase struct {
	// ReadOnlyFollowingDatabaseProperties - The database properties.
	*ReadOnlyFollowingDatabaseProperties `json:"properties,omitempty"`
	// Location - Resource location.
	Location *string `json:"location,omitempty"`
	// SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData `json:"systemData,omitempty"`
	// Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing'
	Kind Kind `json:"kind,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for ReadOnlyFollowingDatabase.
func (rofd ReadOnlyFollowingDatabase) MarshalJSON() ([]byte, error) {
	rofd.Kind = KindReadOnlyFollowing
	objectMap := make(map[string]interface{})
	if rofd.ReadOnlyFollowingDatabaseProperties != nil {
		objectMap["properties"] = rofd.ReadOnlyFollowingDatabaseProperties
	}
	if rofd.Location != nil {
		objectMap["location"] = rofd.Location
	}
	if rofd.Kind != "" {
		objectMap["kind"] = rofd.Kind
	}
	return json.Marshal(objectMap)
}

// AsReadWriteDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase.
func (rofd ReadOnlyFollowingDatabase) AsReadWriteDatabase() (*ReadWriteDatabase, bool) {
	return nil, false
}

// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase.
func (rofd ReadOnlyFollowingDatabase) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) {
	return &rofd, true
}

// AsDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase.
func (rofd ReadOnlyFollowingDatabase) AsDatabase() (*Database, bool) {
	return nil, false
}

// AsBasicDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase.
func (rofd ReadOnlyFollowingDatabase) AsBasicDatabase() (BasicDatabase, bool) {
	return &rofd, true
}

// UnmarshalJSON is the custom unmarshaler for ReadOnlyFollowingDatabase struct.
func (rofd *ReadOnlyFollowingDatabase) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var readOnlyFollowingDatabaseProperties ReadOnlyFollowingDatabaseProperties
				err = json.Unmarshal(*v, &readOnlyFollowingDatabaseProperties)
				if err != nil {
					return err
				}
				rofd.ReadOnlyFollowingDatabaseProperties = &readOnlyFollowingDatabaseProperties
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				rofd.Location = &location
			}
		case "systemData":
			if v != nil {
				var systemData SystemData
				err = json.Unmarshal(*v, &systemData)
				if err != nil {
					return err
				}
				rofd.SystemData = &systemData
			}
		case "kind":
			if v != nil {
				var kind Kind
				err = json.Unmarshal(*v, &kind)
				if err != nil {
					return err
				}
				rofd.Kind = kind
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				rofd.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				rofd.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				rofd.Type = &typeVar
			}
		}
	}

	return nil
}

// ReadOnlyFollowingDatabaseProperties class representing the Kusto database properties.
type ReadOnlyFollowingDatabaseProperties struct {
	// ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'ResourceProvisioningStateRunning', 'ResourceProvisioningStateCreating', 'ResourceProvisioningStateDeleting', 'ResourceProvisioningStateSucceeded', 'ResourceProvisioningStateFailed', 'ResourceProvisioningStateMoving', 'ResourceProvisioningStateCanceled'
	ProvisioningState ResourceProvisioningState `json:"provisioningState,omitempty"`
	// SoftDeletePeriod - READ-ONLY; The time the data should be kept before it stops being accessible to queries in TimeSpan.
	SoftDeletePeriod *string `json:"softDeletePeriod,omitempty"`
	// HotCachePeriod - The time the data should be kept in cache for fast queries in TimeSpan.
	HotCachePeriod *string `json:"hotCachePeriod,omitempty"`
	// Statistics - READ-ONLY; The statistics of the database.
	Statistics *DatabaseStatistics `json:"statistics,omitempty"`
	// LeaderClusterResourceID - READ-ONLY; The name of the leader cluster
	LeaderClusterResourceID *string `json:"leaderClusterResourceId,omitempty"`
	// AttachedDatabaseConfigurationName - READ-ONLY; The name of the attached database configuration cluster
	AttachedDatabaseConfigurationName *string `json:"attachedDatabaseConfigurationName,omitempty"`
	// PrincipalsModificationKind - READ-ONLY; The principals modification kind of the database. Possible values include: 'PrincipalsModificationKindUnion', 'PrincipalsModificationKindReplace', 'PrincipalsModificationKindNone'
	PrincipalsModificationKind PrincipalsModificationKind `json:"principalsModificationKind,omitempty"`
}

// MarshalJSON is the custom marshaler for ReadOnlyFollowingDatabaseProperties.
func (rofdp ReadOnlyFollowingDatabaseProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if rofdp.HotCachePeriod != nil {
		objectMap["hotCachePeriod"] = rofdp.HotCachePeriod
	}
	return json.Marshal(objectMap)
}

// ReadWriteDatabase class representing a read write database.
type ReadWriteDatabase struct {
	// ReadWriteDatabaseProperties - The database properties.
	*ReadWriteDatabaseProperties `json:"properties,omitempty"`
	// Location - Resource location.
	Location *string `json:"location,omitempty"`
	// SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData `json:"systemData,omitempty"`
	// Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing'
	Kind Kind `json:"kind,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for ReadWriteDatabase.
func (rwd ReadWriteDatabase) MarshalJSON() ([]byte, error) {
	rwd.Kind = KindReadWrite
	objectMap := make(map[string]interface{})
	if rwd.ReadWriteDatabaseProperties != nil {
		objectMap["properties"] = rwd.ReadWriteDatabaseProperties
	}
	if rwd.Location != nil {
		objectMap["location"] = rwd.Location
	}
	if rwd.Kind != "" {
		objectMap["kind"] = rwd.Kind
	}
	return json.Marshal(objectMap)
}

// AsReadWriteDatabase is the BasicDatabase implementation for ReadWriteDatabase.
func (rwd ReadWriteDatabase) AsReadWriteDatabase() (*ReadWriteDatabase, bool) {
	return &rwd, true
}

// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for ReadWriteDatabase.
func (rwd ReadWriteDatabase) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) {
	return nil, false
}

// AsDatabase is the BasicDatabase implementation for ReadWriteDatabase.
func (rwd ReadWriteDatabase) AsDatabase() (*Database, bool) {
	return nil, false
}

// AsBasicDatabase is the BasicDatabase implementation for ReadWriteDatabase.
func (rwd ReadWriteDatabase) AsBasicDatabase() (BasicDatabase, bool) {
	return &rwd, true
}

// UnmarshalJSON is the custom unmarshaler for ReadWriteDatabase struct.
func (rwd *ReadWriteDatabase) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var readWriteDatabaseProperties ReadWriteDatabaseProperties
				err = json.Unmarshal(*v, &readWriteDatabaseProperties)
				if err != nil {
					return err
				}
				rwd.ReadWriteDatabaseProperties = &readWriteDatabaseProperties
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				rwd.Location = &location
			}
		case "systemData":
			if v != nil {
				var systemData SystemData
				err = json.Unmarshal(*v, &systemData)
				if err != nil {
					return err
				}
				rwd.SystemData = &systemData
			}
		case "kind":
			if v != nil {
				var kind Kind
				err = json.Unmarshal(*v, &kind)
				if err != nil {
					return err
				}
				rwd.Kind = kind
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				rwd.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				rwd.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				rwd.Type = &typeVar
			}
		}
	}

	return nil
}

// ReadWriteDatabaseProperties class representing the Kusto database properties.
type ReadWriteDatabaseProperties struct {
	// ProvisioningState - The provisioned state of the resource. Possible values include: 'ResourceProvisioningStateRunning', 'ResourceProvisioningStateCreating', 'ResourceProvisioningStateDeleting', 'ResourceProvisioningStateSucceeded', 'ResourceProvisioningStateFailed', 'ResourceProvisioningStateMoving', 'ResourceProvisioningStateCanceled'
	ProvisioningState ResourceProvisioningState `json:"provisioningState,omitempty"`
	// SoftDeletePeriod - The time the data should be kept before it stops being accessible to queries in TimeSpan.
	SoftDeletePeriod *string `json:"softDeletePeriod,omitempty"`
	// HotCachePeriod - The time the data should be kept in cache for fast queries in TimeSpan.
	HotCachePeriod *string `json:"hotCachePeriod,omitempty"`
	// Statistics - The statistics of the database.
	Statistics *DatabaseStatistics `json:"statistics,omitempty"`
	// IsFollowed - READ-ONLY; Indicates whether the database is followed.
	IsFollowed *bool `json:"isFollowed,omitempty"`
}

// MarshalJSON is the custom marshaler for ReadWriteDatabaseProperties.
func (rwdp ReadWriteDatabaseProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if rwdp.ProvisioningState != "" {
		objectMap["provisioningState"] = rwdp.ProvisioningState
	}
	if rwdp.SoftDeletePeriod != nil {
		objectMap["softDeletePeriod"] = rwdp.SoftDeletePeriod
	}
	if rwdp.HotCachePeriod != nil {
		objectMap["hotCachePeriod"] = rwdp.HotCachePeriod
	}
	if rwdp.Statistics != nil {
		objectMap["statistics"] = rwdp.Statistics
	}
	return json.Marshal(objectMap)
}

// RecommendedSensitivityLabelUpdate a recommended sensitivity label update operation.
type RecommendedSensitivityLabelUpdate struct {
	// RecommendedSensitivityLabelUpdateProperties - Resource properties.
	*RecommendedSensitivityLabelUpdateProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for RecommendedSensitivityLabelUpdate.
func (rslu RecommendedSensitivityLabelUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if rslu.RecommendedSensitivityLabelUpdateProperties != nil {
		objectMap["properties"] = rslu.RecommendedSensitivityLabelUpdateProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for RecommendedSensitivityLabelUpdate struct.
func (rslu *RecommendedSensitivityLabelUpdate) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var recommendedSensitivityLabelUpdateProperties RecommendedSensitivityLabelUpdateProperties
				err = json.Unmarshal(*v, &recommendedSensitivityLabelUpdateProperties)
				if err != nil {
					return err
				}
				rslu.RecommendedSensitivityLabelUpdateProperties = &recommendedSensitivityLabelUpdateProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				rslu.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				rslu.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				rslu.Type = &typeVar
			}
		}
	}

	return nil
}

// RecommendedSensitivityLabelUpdateList a list of recommended sensitivity label update operations.
type RecommendedSensitivityLabelUpdateList struct {
	Operations *[]RecommendedSensitivityLabelUpdate `json:"operations,omitempty"`
}

// RecommendedSensitivityLabelUpdateProperties properties of an operation executed on a recommended
// sensitivity label.
type RecommendedSensitivityLabelUpdateProperties struct {
	// Op - Possible values include: 'RecommendedSensitivityLabelUpdateKindEnable', 'RecommendedSensitivityLabelUpdateKindDisable'
	Op RecommendedSensitivityLabelUpdateKind `json:"op,omitempty"`
	// Schema - Schema name of the column to update.
	Schema *string `json:"schema,omitempty"`
	// Table - Table name of the column to update.
	Table *string `json:"table,omitempty"`
	// Column - Column name to update.
	Column *string `json:"column,omitempty"`
}

// RecoverableSQLPool a recoverable sql pool
type RecoverableSQLPool struct {
	autorest.Response `json:"-"`
	// RecoverableSQLPoolProperties - The properties of a recoverable sql pool
	*RecoverableSQLPoolProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for RecoverableSQLPool.
func (rsp RecoverableSQLPool) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if rsp.RecoverableSQLPoolProperties != nil {
		objectMap["properties"] = rsp.RecoverableSQLPoolProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for RecoverableSQLPool struct.
func (rsp *RecoverableSQLPool) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var recoverableSQLPoolProperties RecoverableSQLPoolProperties
				err = json.Unmarshal(*v, &recoverableSQLPoolProperties)
				if err != nil {
					return err
				}
				rsp.RecoverableSQLPoolProperties = &recoverableSQLPoolProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				rsp.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				rsp.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				rsp.Type = &typeVar
			}
		}
	}

	return nil
}

// RecoverableSQLPoolListResult the response to a list recoverable sql pools request
type RecoverableSQLPoolListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; A list of recoverable sql pool
	Value *[]RecoverableSQLPool `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for RecoverableSQLPoolListResult.
func (rsplr RecoverableSQLPoolListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// RecoverableSQLPoolListResultIterator provides access to a complete listing of RecoverableSQLPool values.
type RecoverableSQLPoolListResultIterator struct {
	i    int
	page RecoverableSQLPoolListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *RecoverableSQLPoolListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableSQLPoolListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *RecoverableSQLPoolListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter RecoverableSQLPoolListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter RecoverableSQLPoolListResultIterator) Response() RecoverableSQLPoolListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter RecoverableSQLPoolListResultIterator) Value() RecoverableSQLPool {
	if !iter.page.NotDone() {
		return RecoverableSQLPool{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the RecoverableSQLPoolListResultIterator type.
func NewRecoverableSQLPoolListResultIterator(page RecoverableSQLPoolListResultPage) RecoverableSQLPoolListResultIterator {
	return RecoverableSQLPoolListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (rsplr RecoverableSQLPoolListResult) IsEmpty() bool {
	return rsplr.Value == nil || len(*rsplr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (rsplr RecoverableSQLPoolListResult) hasNextLink() bool {
	return rsplr.NextLink != nil && len(*rsplr.NextLink) != 0
}

// recoverableSQLPoolListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (rsplr RecoverableSQLPoolListResult) recoverableSQLPoolListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !rsplr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(rsplr.NextLink)))
}

// RecoverableSQLPoolListResultPage contains a page of RecoverableSQLPool values.
type RecoverableSQLPoolListResultPage struct {
	fn    func(context.Context, RecoverableSQLPoolListResult) (RecoverableSQLPoolListResult, error)
	rsplr RecoverableSQLPoolListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *RecoverableSQLPoolListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableSQLPoolListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.rsplr)
		if err != nil {
			return err
		}
		page.rsplr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *RecoverableSQLPoolListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page RecoverableSQLPoolListResultPage) NotDone() bool {
	return !page.rsplr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page RecoverableSQLPoolListResultPage) Response() RecoverableSQLPoolListResult {
	return page.rsplr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page RecoverableSQLPoolListResultPage) Values() []RecoverableSQLPool {
	if page.rsplr.IsEmpty() {
		return nil
	}
	return *page.rsplr.Value
}

// Creates a new instance of the RecoverableSQLPoolListResultPage type.
func NewRecoverableSQLPoolListResultPage(cur RecoverableSQLPoolListResult, getNextPage func(context.Context, RecoverableSQLPoolListResult) (RecoverableSQLPoolListResult, error)) RecoverableSQLPoolListResultPage {
	return RecoverableSQLPoolListResultPage{
		fn:    getNextPage,
		rsplr: cur,
	}
}

// RecoverableSQLPoolProperties the properties of a recoverable sql pool
type RecoverableSQLPoolProperties struct {
	// Edition - READ-ONLY; The edition of the database
	Edition *string `json:"edition,omitempty"`
	// ServiceLevelObjective - READ-ONLY; The service level objective name of the database
	ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty"`
	// ElasticPoolName - READ-ONLY; The elastic pool name of the database
	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
	// LastAvailableBackupDate - READ-ONLY; The last available backup date of the database (ISO8601 format)
	LastAvailableBackupDate *date.Time `json:"lastAvailableBackupDate,omitempty"`
}

// MarshalJSON is the custom marshaler for RecoverableSQLPoolProperties.
func (rspp RecoverableSQLPoolProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// ReplaceAllFirewallRulesOperationResponse an existing operation for replacing the firewall rules
type ReplaceAllFirewallRulesOperationResponse struct {
	autorest.Response `json:"-"`
	// OperationID - The operation ID
	OperationID *string `json:"operationId,omitempty"`
}

// ReplaceAllIPFirewallRulesRequest replace all IP firewall rules request
type ReplaceAllIPFirewallRulesRequest struct {
	// IPFirewallRules - IP firewall rule properties
	IPFirewallRules map[string]*IPFirewallRuleProperties `json:"ipFirewallRules"`
}

// MarshalJSON is the custom marshaler for ReplaceAllIPFirewallRulesRequest.
func (raifrr ReplaceAllIPFirewallRulesRequest) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if raifrr.IPFirewallRules != nil {
		objectMap["ipFirewallRules"] = raifrr.IPFirewallRules
	}
	return json.Marshal(objectMap)
}

// ReplicationLink represents a Sql pool replication link.
type ReplicationLink struct {
	autorest.Response `json:"-"`
	// Location - READ-ONLY; Location of the workspace that contains this firewall rule.
	Location *string `json:"location,omitempty"`
	// ReplicationLinkProperties - The properties representing the resource.
	*ReplicationLinkProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for ReplicationLink.
func (rl ReplicationLink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if rl.ReplicationLinkProperties != nil {
		objectMap["properties"] = rl.ReplicationLinkProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for ReplicationLink struct.
func (rl *ReplicationLink) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				rl.Location = &location
			}
		case "properties":
			if v != nil {
				var replicationLinkProperties ReplicationLinkProperties
				err = json.Unmarshal(*v, &replicationLinkProperties)
				if err != nil {
					return err
				}
				rl.ReplicationLinkProperties = &replicationLinkProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				rl.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				rl.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				rl.Type = &typeVar
			}
		}
	}

	return nil
}

// ReplicationLinkListResult represents the response to a List Sql pool replication link request.
type ReplicationLinkListResult struct {
	autorest.Response `json:"-"`
	// Value - The list of Sql pool replication links housed in the Sql pool.
	Value *[]ReplicationLink `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for ReplicationLinkListResult.
func (rllr ReplicationLinkListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if rllr.Value != nil {
		objectMap["value"] = rllr.Value
	}
	return json.Marshal(objectMap)
}

// ReplicationLinkListResultIterator provides access to a complete listing of ReplicationLink values.
type ReplicationLinkListResultIterator struct {
	i    int
	page ReplicationLinkListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *ReplicationLinkListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLinkListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *ReplicationLinkListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ReplicationLinkListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter ReplicationLinkListResultIterator) Response() ReplicationLinkListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter ReplicationLinkListResultIterator) Value() ReplicationLink {
	if !iter.page.NotDone() {
		return ReplicationLink{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the ReplicationLinkListResultIterator type.
func NewReplicationLinkListResultIterator(page ReplicationLinkListResultPage) ReplicationLinkListResultIterator {
	return ReplicationLinkListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (rllr ReplicationLinkListResult) IsEmpty() bool {
	return rllr.Value == nil || len(*rllr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (rllr ReplicationLinkListResult) hasNextLink() bool {
	return rllr.NextLink != nil && len(*rllr.NextLink) != 0
}

// replicationLinkListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (rllr ReplicationLinkListResult) replicationLinkListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !rllr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(rllr.NextLink)))
}

// ReplicationLinkListResultPage contains a page of ReplicationLink values.
type ReplicationLinkListResultPage struct {
	fn   func(context.Context, ReplicationLinkListResult) (ReplicationLinkListResult, error)
	rllr ReplicationLinkListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *ReplicationLinkListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLinkListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.rllr)
		if err != nil {
			return err
		}
		page.rllr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *ReplicationLinkListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ReplicationLinkListResultPage) NotDone() bool {
	return !page.rllr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page ReplicationLinkListResultPage) Response() ReplicationLinkListResult {
	return page.rllr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page ReplicationLinkListResultPage) Values() []ReplicationLink {
	if page.rllr.IsEmpty() {
		return nil
	}
	return *page.rllr.Value
}

// Creates a new instance of the ReplicationLinkListResultPage type.
func NewReplicationLinkListResultPage(cur ReplicationLinkListResult, getNextPage func(context.Context, ReplicationLinkListResult) (ReplicationLinkListResult, error)) ReplicationLinkListResultPage {
	return ReplicationLinkListResultPage{
		fn:   getNextPage,
		rllr: cur,
	}
}

// ReplicationLinkProperties represents the properties of a Sql pool replication link.
type ReplicationLinkProperties struct {
	// IsTerminationAllowed - READ-ONLY; Legacy value indicating whether termination is allowed.  Currently always returns true.
	IsTerminationAllowed *bool `json:"isTerminationAllowed,omitempty"`
	// ReplicationMode - READ-ONLY; Replication mode of this replication link.
	ReplicationMode *string `json:"replicationMode,omitempty"`
	// PartnerServer - READ-ONLY; The name of the workspace hosting the partner Sql pool.
	PartnerServer *string `json:"partnerServer,omitempty"`
	// PartnerDatabase - READ-ONLY; The name of the partner Sql pool.
	PartnerDatabase *string `json:"partnerDatabase,omitempty"`
	// PartnerLocation - READ-ONLY; The Azure Region of the partner Sql pool.
	PartnerLocation *string `json:"partnerLocation,omitempty"`
	// Role - READ-ONLY; The role of the Sql pool in the replication link. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary', 'ReplicationRoleNonReadableSecondary', 'ReplicationRoleSource', 'ReplicationRoleCopy'
	Role ReplicationRole `json:"role,omitempty"`
	// PartnerRole - READ-ONLY; The role of the partner Sql pool in the replication link. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary', 'ReplicationRoleNonReadableSecondary', 'ReplicationRoleSource', 'ReplicationRoleCopy'
	PartnerRole ReplicationRole `json:"partnerRole,omitempty"`
	// StartTime - READ-ONLY; The start time for the replication link.
	StartTime *date.Time `json:"startTime,omitempty"`
	// PercentComplete - READ-ONLY; The percentage of seeding complete for the replication link.
	PercentComplete *int32 `json:"percentComplete,omitempty"`
	// ReplicationState - READ-ONLY; The replication state for the replication link. Possible values include: 'ReplicationStatePENDING', 'ReplicationStateSEEDING', 'ReplicationStateCATCHUP', 'ReplicationStateSUSPENDED'
	ReplicationState ReplicationState `json:"replicationState,omitempty"`
}

// MarshalJSON is the custom marshaler for ReplicationLinkProperties.
func (rlp ReplicationLinkProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// Resource common fields that are returned in the response for all Azure Resource Manager resources
type Resource struct {
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for Resource.
func (r Resource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// ResourceMoveDefinition contains the information necessary to perform a resource move (rename).
type ResourceMoveDefinition struct {
	// ID - The target ID for the resource
	ID *string `json:"id,omitempty"`
}

// RestorableDroppedSQLPool a restorable dropped Sql pool
type RestorableDroppedSQLPool struct {
	autorest.Response `json:"-"`
	// Location - READ-ONLY; The geo-location where the resource lives
	Location *string `json:"location,omitempty"`
	// RestorableDroppedSQLPoolProperties - The properties of a restorable dropped Sql pool
	*RestorableDroppedSQLPoolProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for RestorableDroppedSQLPool.
func (rdsp RestorableDroppedSQLPool) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if rdsp.RestorableDroppedSQLPoolProperties != nil {
		objectMap["properties"] = rdsp.RestorableDroppedSQLPoolProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for RestorableDroppedSQLPool struct.
func (rdsp *RestorableDroppedSQLPool) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				rdsp.Location = &location
			}
		case "properties":
			if v != nil {
				var restorableDroppedSQLPoolProperties RestorableDroppedSQLPoolProperties
				err = json.Unmarshal(*v, &restorableDroppedSQLPoolProperties)
				if err != nil {
					return err
				}
				rdsp.RestorableDroppedSQLPoolProperties = &restorableDroppedSQLPoolProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				rdsp.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				rdsp.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				rdsp.Type = &typeVar
			}
		}
	}

	return nil
}

// RestorableDroppedSQLPoolListResult the response to a list restorable dropped Sql pools request
type RestorableDroppedSQLPoolListResult struct {
	autorest.Response `json:"-"`
	// Value - A list of restorable dropped Sql pools
	Value *[]RestorableDroppedSQLPool `json:"value,omitempty"`
}

// RestorableDroppedSQLPoolProperties the properties of a restorable dropped Sql pool
type RestorableDroppedSQLPoolProperties struct {
	// DatabaseName - READ-ONLY; The name of the database
	DatabaseName *string `json:"databaseName,omitempty"`
	// Edition - READ-ONLY; The edition of the database
	Edition *string `json:"edition,omitempty"`
	// MaxSizeBytes - READ-ONLY; The max size in bytes of the database
	MaxSizeBytes *string `json:"maxSizeBytes,omitempty"`
	// ServiceLevelObjective - READ-ONLY; The service level objective name of the database
	ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty"`
	// ElasticPoolName - READ-ONLY; The elastic pool name of the database
	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
	// CreationDate - READ-ONLY; The creation date of the database (ISO8601 format)
	CreationDate *date.Time `json:"creationDate,omitempty"`
	// DeletionDate - READ-ONLY; The deletion date of the database (ISO8601 format)
	DeletionDate *date.Time `json:"deletionDate,omitempty"`
	// EarliestRestoreDate - READ-ONLY; The earliest restore date of the database (ISO8601 format)
	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
}

// MarshalJSON is the custom marshaler for RestorableDroppedSQLPoolProperties.
func (rdspp RestorableDroppedSQLPoolProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// RestorePoint database restore points.
type RestorePoint struct {
	autorest.Response `json:"-"`
	// Location - READ-ONLY; Resource location.
	Location *string `json:"location,omitempty"`
	// RestorePointProperties - Resource properties.
	*RestorePointProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for RestorePoint.
func (rp RestorePoint) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if rp.RestorePointProperties != nil {
		objectMap["properties"] = rp.RestorePointProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for RestorePoint struct.
func (rp *RestorePoint) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				rp.Location = &location
			}
		case "properties":
			if v != nil {
				var restorePointProperties RestorePointProperties
				err = json.Unmarshal(*v, &restorePointProperties)
				if err != nil {
					return err
				}
				rp.RestorePointProperties = &restorePointProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				rp.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				rp.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				rp.Type = &typeVar
			}
		}
	}

	return nil
}

// RestorePointListResult a list of long term retention backups.
type RestorePointListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]RestorePoint `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for RestorePointListResult.
func (rplr RestorePointListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// RestorePointListResultIterator provides access to a complete listing of RestorePoint values.
type RestorePointListResultIterator struct {
	i    int
	page RestorePointListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *RestorePointListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *RestorePointListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter RestorePointListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter RestorePointListResultIterator) Response() RestorePointListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter RestorePointListResultIterator) Value() RestorePoint {
	if !iter.page.NotDone() {
		return RestorePoint{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the RestorePointListResultIterator type.
func NewRestorePointListResultIterator(page RestorePointListResultPage) RestorePointListResultIterator {
	return RestorePointListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (rplr RestorePointListResult) IsEmpty() bool {
	return rplr.Value == nil || len(*rplr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (rplr RestorePointListResult) hasNextLink() bool {
	return rplr.NextLink != nil && len(*rplr.NextLink) != 0
}

// restorePointListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (rplr RestorePointListResult) restorePointListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !rplr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(rplr.NextLink)))
}

// RestorePointListResultPage contains a page of RestorePoint values.
type RestorePointListResultPage struct {
	fn   func(context.Context, RestorePointListResult) (RestorePointListResult, error)
	rplr RestorePointListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *RestorePointListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.rplr)
		if err != nil {
			return err
		}
		page.rplr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *RestorePointListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page RestorePointListResultPage) NotDone() bool {
	return !page.rplr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page RestorePointListResultPage) Response() RestorePointListResult {
	return page.rplr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page RestorePointListResultPage) Values() []RestorePoint {
	if page.rplr.IsEmpty() {
		return nil
	}
	return *page.rplr.Value
}

// Creates a new instance of the RestorePointListResultPage type.
func NewRestorePointListResultPage(cur RestorePointListResult, getNextPage func(context.Context, RestorePointListResult) (RestorePointListResult, error)) RestorePointListResultPage {
	return RestorePointListResultPage{
		fn:   getNextPage,
		rplr: cur,
	}
}

// RestorePointProperties properties of a database restore point
type RestorePointProperties struct {
	// RestorePointType - READ-ONLY; The type of restore point. Possible values include: 'RestorePointTypeCONTINUOUS', 'RestorePointTypeDISCRETE'
	RestorePointType RestorePointType `json:"restorePointType,omitempty"`
	// EarliestRestoreDate - READ-ONLY; The earliest time to which this database can be restored
	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
	// RestorePointCreationDate - READ-ONLY; The time the backup was taken
	RestorePointCreationDate *date.Time `json:"restorePointCreationDate,omitempty"`
	// RestorePointLabel - READ-ONLY; The label of restore point for backup request by user
	RestorePointLabel *string `json:"restorePointLabel,omitempty"`
}

// MarshalJSON is the custom marshaler for RestorePointProperties.
func (rpp RestorePointProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// BasicSecretBase the base definition of a secret type.
type BasicSecretBase interface {
	AsSecureString() (*SecureString, bool)
	AsSecretBase() (*SecretBase, bool)
}

// SecretBase the base definition of a secret type.
type SecretBase struct {
	// Type - Possible values include: 'TypeBasicSecretBaseTypeSecretBase', 'TypeBasicSecretBaseTypeSecureString'
	Type TypeBasicSecretBase `json:"type,omitempty"`
}

func unmarshalBasicSecretBase(body []byte) (BasicSecretBase, error) {
	var m map[string]interface{}
	err := json.Unmarshal(body, &m)
	if err != nil {
		return nil, err
	}

	switch m["type"] {
	case string(TypeBasicSecretBaseTypeSecureString):
		var ss SecureString
		err := json.Unmarshal(body, &ss)
		return ss, err
	default:
		var sb SecretBase
		err := json.Unmarshal(body, &sb)
		return sb, err
	}
}
func unmarshalBasicSecretBaseArray(body []byte) ([]BasicSecretBase, error) {
	var rawMessages []*json.RawMessage
	err := json.Unmarshal(body, &rawMessages)
	if err != nil {
		return nil, err
	}

	sbArray := make([]BasicSecretBase, len(rawMessages))

	for index, rawMessage := range rawMessages {
		sb, err := unmarshalBasicSecretBase(*rawMessage)
		if err != nil {
			return nil, err
		}
		sbArray[index] = sb
	}
	return sbArray, nil
}

// MarshalJSON is the custom marshaler for SecretBase.
func (sb SecretBase) MarshalJSON() ([]byte, error) {
	sb.Type = TypeBasicSecretBaseTypeSecretBase
	objectMap := make(map[string]interface{})
	if sb.Type != "" {
		objectMap["type"] = sb.Type
	}
	return json.Marshal(objectMap)
}

// AsSecureString is the BasicSecretBase implementation for SecretBase.
func (sb SecretBase) AsSecureString() (*SecureString, bool) {
	return nil, false
}

// AsSecretBase is the BasicSecretBase implementation for SecretBase.
func (sb SecretBase) AsSecretBase() (*SecretBase, bool) {
	return &sb, true
}

// AsBasicSecretBase is the BasicSecretBase implementation for SecretBase.
func (sb SecretBase) AsBasicSecretBase() (BasicSecretBase, bool) {
	return &sb, true
}

// SecureString azure Synapse secure string definition. The string value will be masked with asterisks '*'
// during Get or List API calls.
type SecureString struct {
	// Value - Value of secure string.
	Value *string `json:"value,omitempty"`
	// Type - Possible values include: 'TypeBasicSecretBaseTypeSecretBase', 'TypeBasicSecretBaseTypeSecureString'
	Type TypeBasicSecretBase `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SecureString.
func (ss SecureString) MarshalJSON() ([]byte, error) {
	ss.Type = TypeBasicSecretBaseTypeSecureString
	objectMap := make(map[string]interface{})
	if ss.Value != nil {
		objectMap["value"] = ss.Value
	}
	if ss.Type != "" {
		objectMap["type"] = ss.Type
	}
	return json.Marshal(objectMap)
}

// AsSecureString is the BasicSecretBase implementation for SecureString.
func (ss SecureString) AsSecureString() (*SecureString, bool) {
	return &ss, true
}

// AsSecretBase is the BasicSecretBase implementation for SecureString.
func (ss SecureString) AsSecretBase() (*SecretBase, bool) {
	return nil, false
}

// AsBasicSecretBase is the BasicSecretBase implementation for SecureString.
func (ss SecureString) AsBasicSecretBase() (BasicSecretBase, bool) {
	return &ss, true
}

// SecurityAlertPolicyProperties properties of a security alert policy.
type SecurityAlertPolicyProperties struct {
	// State - Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific Sql pool. Possible values include: 'SecurityAlertPolicyStateNew', 'SecurityAlertPolicyStateEnabled', 'SecurityAlertPolicyStateDisabled'
	State SecurityAlertPolicyState `json:"state,omitempty"`
	// DisabledAlerts - Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action
	DisabledAlerts *[]string `json:"disabledAlerts,omitempty"`
	// EmailAddresses - Specifies an array of e-mail addresses to which the alert is sent.
	EmailAddresses *[]string `json:"emailAddresses,omitempty"`
	// EmailAccountAdmins - Specifies that the alert is sent to the account administrators.
	EmailAccountAdmins *bool `json:"emailAccountAdmins,omitempty"`
	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.
	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
	// StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account.
	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
	// RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs.
	RetentionDays *int32 `json:"retentionDays,omitempty"`
	// CreationTime - READ-ONLY; Specifies the UTC creation time of the policy.
	CreationTime *date.Time `json:"creationTime,omitempty"`
}

// MarshalJSON is the custom marshaler for SecurityAlertPolicyProperties.
func (sapp SecurityAlertPolicyProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if sapp.State != "" {
		objectMap["state"] = sapp.State
	}
	if sapp.DisabledAlerts != nil {
		objectMap["disabledAlerts"] = sapp.DisabledAlerts
	}
	if sapp.EmailAddresses != nil {
		objectMap["emailAddresses"] = sapp.EmailAddresses
	}
	if sapp.EmailAccountAdmins != nil {
		objectMap["emailAccountAdmins"] = sapp.EmailAccountAdmins
	}
	if sapp.StorageEndpoint != nil {
		objectMap["storageEndpoint"] = sapp.StorageEndpoint
	}
	if sapp.StorageAccountAccessKey != nil {
		objectMap["storageAccountAccessKey"] = sapp.StorageAccountAccessKey
	}
	if sapp.RetentionDays != nil {
		objectMap["retentionDays"] = sapp.RetentionDays
	}
	return json.Marshal(objectMap)
}

// SelfHostedIntegrationRuntime self-hosted integration runtime.
type SelfHostedIntegrationRuntime struct {
	// SelfHostedIntegrationRuntimeTypeProperties - When this property is not null, means this is a linked integration runtime. The property is used to access original integration runtime.
	*SelfHostedIntegrationRuntimeTypeProperties `json:"typeProperties,omitempty"`
	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
	AdditionalProperties map[string]interface{} `json:""`
	// Description - Integration runtime description.
	Description *string `json:"description,omitempty"`
	// Type - Possible values include: 'TypeBasicIntegrationRuntimeTypeIntegrationRuntime', 'TypeBasicIntegrationRuntimeTypeManaged', 'TypeBasicIntegrationRuntimeTypeSelfHosted'
	Type TypeBasicIntegrationRuntime `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SelfHostedIntegrationRuntime.
func (shir SelfHostedIntegrationRuntime) MarshalJSON() ([]byte, error) {
	shir.Type = TypeBasicIntegrationRuntimeTypeSelfHosted
	objectMap := make(map[string]interface{})
	if shir.SelfHostedIntegrationRuntimeTypeProperties != nil {
		objectMap["typeProperties"] = shir.SelfHostedIntegrationRuntimeTypeProperties
	}
	if shir.Description != nil {
		objectMap["description"] = shir.Description
	}
	if shir.Type != "" {
		objectMap["type"] = shir.Type
	}
	for k, v := range shir.AdditionalProperties {
		objectMap[k] = v
	}
	return json.Marshal(objectMap)
}

// AsManagedIntegrationRuntime is the BasicIntegrationRuntime implementation for SelfHostedIntegrationRuntime.
func (shir SelfHostedIntegrationRuntime) AsManagedIntegrationRuntime() (*ManagedIntegrationRuntime, bool) {
	return nil, false
}

// AsSelfHostedIntegrationRuntime is the BasicIntegrationRuntime implementation for SelfHostedIntegrationRuntime.
func (shir SelfHostedIntegrationRuntime) AsSelfHostedIntegrationRuntime() (*SelfHostedIntegrationRuntime, bool) {
	return &shir, true
}

// AsIntegrationRuntime is the BasicIntegrationRuntime implementation for SelfHostedIntegrationRuntime.
func (shir SelfHostedIntegrationRuntime) AsIntegrationRuntime() (*IntegrationRuntime, bool) {
	return nil, false
}

// AsBasicIntegrationRuntime is the BasicIntegrationRuntime implementation for SelfHostedIntegrationRuntime.
func (shir SelfHostedIntegrationRuntime) AsBasicIntegrationRuntime() (BasicIntegrationRuntime, bool) {
	return &shir, true
}

// UnmarshalJSON is the custom unmarshaler for SelfHostedIntegrationRuntime struct.
func (shir *SelfHostedIntegrationRuntime) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "typeProperties":
			if v != nil {
				var selfHostedIntegrationRuntimeTypeProperties SelfHostedIntegrationRuntimeTypeProperties
				err = json.Unmarshal(*v, &selfHostedIntegrationRuntimeTypeProperties)
				if err != nil {
					return err
				}
				shir.SelfHostedIntegrationRuntimeTypeProperties = &selfHostedIntegrationRuntimeTypeProperties
			}
		default:
			if v != nil {
				var additionalProperties interface{}
				err = json.Unmarshal(*v, &additionalProperties)
				if err != nil {
					return err
				}
				if shir.AdditionalProperties == nil {
					shir.AdditionalProperties = make(map[string]interface{})
				}
				shir.AdditionalProperties[k] = additionalProperties
			}
		case "description":
			if v != nil {
				var description string
				err = json.Unmarshal(*v, &description)
				if err != nil {
					return err
				}
				shir.Description = &description
			}
		case "type":
			if v != nil {
				var typeVar TypeBasicIntegrationRuntime
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				shir.Type = typeVar
			}
		}
	}

	return nil
}

// SelfHostedIntegrationRuntimeNode properties of Self-hosted integration runtime node.
type SelfHostedIntegrationRuntimeNode struct {
	autorest.Response `json:"-"`
	// NodeName - READ-ONLY; Name of the integration runtime node.
	NodeName *string `json:"nodeName,omitempty"`
	// MachineName - READ-ONLY; Machine name of the integration runtime node.
	MachineName *string `json:"machineName,omitempty"`
	// HostServiceURI - READ-ONLY; URI for the host machine of the integration runtime.
	HostServiceURI *string `json:"hostServiceUri,omitempty"`
	// Status - READ-ONLY; Status of the integration runtime node. Possible values include: 'SelfHostedIntegrationRuntimeNodeStatusNeedRegistration', 'SelfHostedIntegrationRuntimeNodeStatusOnline', 'SelfHostedIntegrationRuntimeNodeStatusLimited', 'SelfHostedIntegrationRuntimeNodeStatusOffline', 'SelfHostedIntegrationRuntimeNodeStatusUpgrading', 'SelfHostedIntegrationRuntimeNodeStatusInitializing', 'SelfHostedIntegrationRuntimeNodeStatusInitializeFailed'
	Status SelfHostedIntegrationRuntimeNodeStatus `json:"status,omitempty"`
	// Capabilities - READ-ONLY; The integration runtime capabilities dictionary
	Capabilities map[string]*string `json:"capabilities"`
	// VersionStatus - READ-ONLY; Status of the integration runtime node version.
	VersionStatus *string `json:"versionStatus,omitempty"`
	// Version - READ-ONLY; Version of the integration runtime node.
	Version *string `json:"version,omitempty"`
	// RegisterTime - READ-ONLY; The time at which the integration runtime node was registered in ISO8601 format.
	RegisterTime *date.Time `json:"registerTime,omitempty"`
	// LastConnectTime - READ-ONLY; The most recent time at which the integration runtime was connected in ISO8601 format.
	LastConnectTime *date.Time `json:"lastConnectTime,omitempty"`
	// ExpiryTime - READ-ONLY; The time at which the integration runtime will expire in ISO8601 format.
	ExpiryTime *date.Time `json:"expiryTime,omitempty"`
	// LastStartTime - READ-ONLY; The time the node last started up.
	LastStartTime *date.Time `json:"lastStartTime,omitempty"`
	// LastStopTime - READ-ONLY; The integration runtime node last stop time.
	LastStopTime *date.Time `json:"lastStopTime,omitempty"`
	// LastUpdateResult - READ-ONLY; The result of the last integration runtime node update. Possible values include: 'IntegrationRuntimeUpdateResultNone', 'IntegrationRuntimeUpdateResultSucceed', 'IntegrationRuntimeUpdateResultFail'
	LastUpdateResult IntegrationRuntimeUpdateResult `json:"lastUpdateResult,omitempty"`
	// LastStartUpdateTime - READ-ONLY; The last time for the integration runtime node update start.
	LastStartUpdateTime *date.Time `json:"lastStartUpdateTime,omitempty"`
	// LastEndUpdateTime - READ-ONLY; The last time for the integration runtime node update end.
	LastEndUpdateTime *date.Time `json:"lastEndUpdateTime,omitempty"`
	// IsActiveDispatcher - READ-ONLY; Indicates whether this node is the active dispatcher for integration runtime requests.
	IsActiveDispatcher *bool `json:"isActiveDispatcher,omitempty"`
	// ConcurrentJobsLimit - READ-ONLY; Maximum concurrent jobs on the integration runtime node.
	ConcurrentJobsLimit *int32 `json:"concurrentJobsLimit,omitempty"`
	// MaxConcurrentJobs - READ-ONLY; The maximum concurrent jobs in this integration runtime.
	MaxConcurrentJobs *int32 `json:"maxConcurrentJobs,omitempty"`
}

// MarshalJSON is the custom marshaler for SelfHostedIntegrationRuntimeNode.
func (shirn SelfHostedIntegrationRuntimeNode) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// SelfHostedIntegrationRuntimeStatus self-hosted integration runtime status.
type SelfHostedIntegrationRuntimeStatus struct {
	// SelfHostedIntegrationRuntimeStatusTypeProperties - Self-hosted integration runtime status type properties.
	*SelfHostedIntegrationRuntimeStatusTypeProperties `json:"typeProperties,omitempty"`
	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
	AdditionalProperties map[string]interface{} `json:""`
	// DataFactoryName - READ-ONLY; The workspace name which the integration runtime belong to.
	DataFactoryName *string `json:"dataFactoryName,omitempty"`
	// State - READ-ONLY; The state of integration runtime. Possible values include: 'IntegrationRuntimeStateInitial', 'IntegrationRuntimeStateStopped', 'IntegrationRuntimeStateStarted', 'IntegrationRuntimeStateStarting', 'IntegrationRuntimeStateStopping', 'IntegrationRuntimeStateNeedRegistration', 'IntegrationRuntimeStateOnline', 'IntegrationRuntimeStateLimited', 'IntegrationRuntimeStateOffline', 'IntegrationRuntimeStateAccessDenied'
	State IntegrationRuntimeState `json:"state,omitempty"`
	// Type - Possible values include: 'TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus', 'TypeBasicIntegrationRuntimeStatusTypeManaged', 'TypeBasicIntegrationRuntimeStatusTypeSelfHosted'
	Type TypeBasicIntegrationRuntimeStatus `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SelfHostedIntegrationRuntimeStatus.
func (shirs SelfHostedIntegrationRuntimeStatus) MarshalJSON() ([]byte, error) {
	shirs.Type = TypeBasicIntegrationRuntimeStatusTypeSelfHosted
	objectMap := make(map[string]interface{})
	if shirs.SelfHostedIntegrationRuntimeStatusTypeProperties != nil {
		objectMap["typeProperties"] = shirs.SelfHostedIntegrationRuntimeStatusTypeProperties
	}
	if shirs.Type != "" {
		objectMap["type"] = shirs.Type
	}
	for k, v := range shirs.AdditionalProperties {
		objectMap[k] = v
	}
	return json.Marshal(objectMap)
}

// AsManagedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for SelfHostedIntegrationRuntimeStatus.
func (shirs SelfHostedIntegrationRuntimeStatus) AsManagedIntegrationRuntimeStatus() (*ManagedIntegrationRuntimeStatus, bool) {
	return nil, false
}

// AsSelfHostedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for SelfHostedIntegrationRuntimeStatus.
func (shirs SelfHostedIntegrationRuntimeStatus) AsSelfHostedIntegrationRuntimeStatus() (*SelfHostedIntegrationRuntimeStatus, bool) {
	return &shirs, true
}

// AsIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for SelfHostedIntegrationRuntimeStatus.
func (shirs SelfHostedIntegrationRuntimeStatus) AsIntegrationRuntimeStatus() (*IntegrationRuntimeStatus, bool) {
	return nil, false
}

// AsBasicIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for SelfHostedIntegrationRuntimeStatus.
func (shirs SelfHostedIntegrationRuntimeStatus) AsBasicIntegrationRuntimeStatus() (BasicIntegrationRuntimeStatus, bool) {
	return &shirs, true
}

// UnmarshalJSON is the custom unmarshaler for SelfHostedIntegrationRuntimeStatus struct.
func (shirs *SelfHostedIntegrationRuntimeStatus) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "typeProperties":
			if v != nil {
				var selfHostedIntegrationRuntimeStatusTypeProperties SelfHostedIntegrationRuntimeStatusTypeProperties
				err = json.Unmarshal(*v, &selfHostedIntegrationRuntimeStatusTypeProperties)
				if err != nil {
					return err
				}
				shirs.SelfHostedIntegrationRuntimeStatusTypeProperties = &selfHostedIntegrationRuntimeStatusTypeProperties
			}
		default:
			if v != nil {
				var additionalProperties interface{}
				err = json.Unmarshal(*v, &additionalProperties)
				if err != nil {
					return err
				}
				if shirs.AdditionalProperties == nil {
					shirs.AdditionalProperties = make(map[string]interface{})
				}
				shirs.AdditionalProperties[k] = additionalProperties
			}
		case "dataFactoryName":
			if v != nil {
				var dataFactoryName string
				err = json.Unmarshal(*v, &dataFactoryName)
				if err != nil {
					return err
				}
				shirs.DataFactoryName = &dataFactoryName
			}
		case "state":
			if v != nil {
				var state IntegrationRuntimeState
				err = json.Unmarshal(*v, &state)
				if err != nil {
					return err
				}
				shirs.State = state
			}
		case "type":
			if v != nil {
				var typeVar TypeBasicIntegrationRuntimeStatus
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				shirs.Type = typeVar
			}
		}
	}

	return nil
}

// SelfHostedIntegrationRuntimeStatusTypeProperties self-hosted integration runtime status type properties.
type SelfHostedIntegrationRuntimeStatusTypeProperties struct {
	// CreateTime - READ-ONLY; The time at which the integration runtime was created, in ISO8601 format.
	CreateTime *date.Time `json:"createTime,omitempty"`
	// TaskQueueID - READ-ONLY; The task queue id of the integration runtime.
	TaskQueueID *string `json:"taskQueueId,omitempty"`
	// NodeCommunicationChannelEncryptionMode - READ-ONLY; The node communication Channel encryption mode
	NodeCommunicationChannelEncryptionMode *string `json:"nodeCommunicationChannelEncryptionMode,omitempty"`
	// InternalChannelEncryption - READ-ONLY; It is used to set the encryption mode for node-node communication channel (when more than 2 self-hosted integration runtime nodes exist). Possible values include: 'IntegrationRuntimeInternalChannelEncryptionModeNotSet', 'IntegrationRuntimeInternalChannelEncryptionModeSslEncrypted', 'IntegrationRuntimeInternalChannelEncryptionModeNotEncrypted'
	InternalChannelEncryption IntegrationRuntimeInternalChannelEncryptionMode `json:"internalChannelEncryption,omitempty"`
	// Version - READ-ONLY; Version of the integration runtime.
	Version *string `json:"version,omitempty"`
	// Nodes - The list of nodes for this integration runtime.
	Nodes *[]SelfHostedIntegrationRuntimeNode `json:"nodes,omitempty"`
	// ScheduledUpdateDate - READ-ONLY; The date at which the integration runtime will be scheduled to update, in ISO8601 format.
	ScheduledUpdateDate *date.Time `json:"scheduledUpdateDate,omitempty"`
	// UpdateDelayOffset - READ-ONLY; The time in the date scheduled by service to update the integration runtime, e.g., PT03H is 3 hours
	UpdateDelayOffset *string `json:"updateDelayOffset,omitempty"`
	// LocalTimeZoneOffset - READ-ONLY; The local time zone offset in hours.
	LocalTimeZoneOffset *string `json:"localTimeZoneOffset,omitempty"`
	// Capabilities - READ-ONLY; Object with additional information about integration runtime capabilities.
	Capabilities map[string]*string `json:"capabilities"`
	// ServiceUrls - READ-ONLY; The URLs for the services used in integration runtime backend service.
	ServiceUrls *[]string `json:"serviceUrls,omitempty"`
	// AutoUpdate - READ-ONLY; Whether Self-hosted integration runtime auto update has been turned on. Possible values include: 'IntegrationRuntimeAutoUpdateOn', 'IntegrationRuntimeAutoUpdateOff'
	AutoUpdate IntegrationRuntimeAutoUpdate `json:"autoUpdate,omitempty"`
	// VersionStatus - READ-ONLY; Status of the integration runtime version.
	VersionStatus *string `json:"versionStatus,omitempty"`
	// Links - The list of linked integration runtimes that are created to share with this integration runtime.
	Links *[]LinkedIntegrationRuntime `json:"links,omitempty"`
	// PushedVersion - READ-ONLY; The version that the integration runtime is going to update to.
	PushedVersion *string `json:"pushedVersion,omitempty"`
	// LatestVersion - READ-ONLY; The latest version on download center.
	LatestVersion *string `json:"latestVersion,omitempty"`
	// AutoUpdateETA - READ-ONLY; The estimated time when the self-hosted integration runtime will be updated.
	AutoUpdateETA *date.Time `json:"autoUpdateETA,omitempty"`
	// ServiceRegion - The service region of the integration runtime
	ServiceRegion *string `json:"serviceRegion,omitempty"`
	// NewerVersions - The newer versions on download center.
	NewerVersions *[]string `json:"newerVersions,omitempty"`
}

// MarshalJSON is the custom marshaler for SelfHostedIntegrationRuntimeStatusTypeProperties.
func (shirstp SelfHostedIntegrationRuntimeStatusTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if shirstp.Nodes != nil {
		objectMap["nodes"] = shirstp.Nodes
	}
	if shirstp.Links != nil {
		objectMap["links"] = shirstp.Links
	}
	if shirstp.ServiceRegion != nil {
		objectMap["serviceRegion"] = shirstp.ServiceRegion
	}
	if shirstp.NewerVersions != nil {
		objectMap["newerVersions"] = shirstp.NewerVersions
	}
	return json.Marshal(objectMap)
}

// SelfHostedIntegrationRuntimeTypeProperties the self-hosted integration runtime properties.
type SelfHostedIntegrationRuntimeTypeProperties struct {
	// LinkedInfo - Linked integration runtime type from data factory
	LinkedInfo BasicLinkedIntegrationRuntimeType `json:"linkedInfo,omitempty"`
}

// UnmarshalJSON is the custom unmarshaler for SelfHostedIntegrationRuntimeTypeProperties struct.
func (shirtp *SelfHostedIntegrationRuntimeTypeProperties) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "linkedInfo":
			if v != nil {
				linkedInfo, err := unmarshalBasicLinkedIntegrationRuntimeType(*v)
				if err != nil {
					return err
				}
				shirtp.LinkedInfo = linkedInfo
			}
		}
	}

	return nil
}

// SensitivityLabel a sensitivity label.
type SensitivityLabel struct {
	autorest.Response `json:"-"`
	// SensitivityLabelProperties - Resource properties.
	*SensitivityLabelProperties `json:"properties,omitempty"`
	// ManagedBy - READ-ONLY; managed by
	ManagedBy *string `json:"managedBy,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SensitivityLabel.
func (sl SensitivityLabel) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if sl.SensitivityLabelProperties != nil {
		objectMap["properties"] = sl.SensitivityLabelProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for SensitivityLabel struct.
func (sl *SensitivityLabel) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var sensitivityLabelProperties SensitivityLabelProperties
				err = json.Unmarshal(*v, &sensitivityLabelProperties)
				if err != nil {
					return err
				}
				sl.SensitivityLabelProperties = &sensitivityLabelProperties
			}
		case "managedBy":
			if v != nil {
				var managedBy string
				err = json.Unmarshal(*v, &managedBy)
				if err != nil {
					return err
				}
				sl.ManagedBy = &managedBy
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				sl.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				sl.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				sl.Type = &typeVar
			}
		}
	}

	return nil
}

// SensitivityLabelListResult a list of sensitivity labels.
type SensitivityLabelListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]SensitivityLabel `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for SensitivityLabelListResult.
func (sllr SensitivityLabelListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// SensitivityLabelListResultIterator provides access to a complete listing of SensitivityLabel values.
type SensitivityLabelListResultIterator struct {
	i    int
	page SensitivityLabelListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *SensitivityLabelListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *SensitivityLabelListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter SensitivityLabelListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter SensitivityLabelListResultIterator) Response() SensitivityLabelListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter SensitivityLabelListResultIterator) Value() SensitivityLabel {
	if !iter.page.NotDone() {
		return SensitivityLabel{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the SensitivityLabelListResultIterator type.
func NewSensitivityLabelListResultIterator(page SensitivityLabelListResultPage) SensitivityLabelListResultIterator {
	return SensitivityLabelListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (sllr SensitivityLabelListResult) IsEmpty() bool {
	return sllr.Value == nil || len(*sllr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (sllr SensitivityLabelListResult) hasNextLink() bool {
	return sllr.NextLink != nil && len(*sllr.NextLink) != 0
}

// sensitivityLabelListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (sllr SensitivityLabelListResult) sensitivityLabelListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !sllr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(sllr.NextLink)))
}

// SensitivityLabelListResultPage contains a page of SensitivityLabel values.
type SensitivityLabelListResultPage struct {
	fn   func(context.Context, SensitivityLabelListResult) (SensitivityLabelListResult, error)
	sllr SensitivityLabelListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *SensitivityLabelListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.sllr)
		if err != nil {
			return err
		}
		page.sllr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *SensitivityLabelListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page SensitivityLabelListResultPage) NotDone() bool {
	return !page.sllr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page SensitivityLabelListResultPage) Response() SensitivityLabelListResult {
	return page.sllr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page SensitivityLabelListResultPage) Values() []SensitivityLabel {
	if page.sllr.IsEmpty() {
		return nil
	}
	return *page.sllr.Value
}

// Creates a new instance of the SensitivityLabelListResultPage type.
func NewSensitivityLabelListResultPage(cur SensitivityLabelListResult, getNextPage func(context.Context, SensitivityLabelListResult) (SensitivityLabelListResult, error)) SensitivityLabelListResultPage {
	return SensitivityLabelListResultPage{
		fn:   getNextPage,
		sllr: cur,
	}
}

// SensitivityLabelProperties properties of a sensitivity label.
type SensitivityLabelProperties struct {
	// SchemaName - READ-ONLY; The schema name.
	SchemaName *string `json:"schemaName,omitempty"`
	// TableName - READ-ONLY; The table name.
	TableName *string `json:"tableName,omitempty"`
	// ColumnName - READ-ONLY; The column name.
	ColumnName *string `json:"columnName,omitempty"`
	// LabelName - The label name.
	LabelName *string `json:"labelName,omitempty"`
	// LabelID - The label ID.
	LabelID *string `json:"labelId,omitempty"`
	// InformationType - The information type.
	InformationType *string `json:"informationType,omitempty"`
	// InformationTypeID - The information type ID.
	InformationTypeID *string `json:"informationTypeId,omitempty"`
	// IsDisabled - READ-ONLY; Is sensitivity recommendation disabled. Applicable for recommended sensitivity label only. Specifies whether the sensitivity recommendation on this column is disabled (dismissed) or not.
	IsDisabled *bool `json:"isDisabled,omitempty"`
	// Rank - Possible values include: 'SensitivityLabelRankNone', 'SensitivityLabelRankLow', 'SensitivityLabelRankMedium', 'SensitivityLabelRankHigh', 'SensitivityLabelRankCritical'
	Rank SensitivityLabelRank `json:"rank,omitempty"`
}

// MarshalJSON is the custom marshaler for SensitivityLabelProperties.
func (slp SensitivityLabelProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if slp.LabelName != nil {
		objectMap["labelName"] = slp.LabelName
	}
	if slp.LabelID != nil {
		objectMap["labelId"] = slp.LabelID
	}
	if slp.InformationType != nil {
		objectMap["informationType"] = slp.InformationType
	}
	if slp.InformationTypeID != nil {
		objectMap["informationTypeId"] = slp.InformationTypeID
	}
	if slp.Rank != "" {
		objectMap["rank"] = slp.Rank
	}
	return json.Marshal(objectMap)
}

// SensitivityLabelUpdate a sensitivity label update operation.
type SensitivityLabelUpdate struct {
	// SensitivityLabelUpdateProperties - Resource properties.
	*SensitivityLabelUpdateProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SensitivityLabelUpdate.
func (slu SensitivityLabelUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if slu.SensitivityLabelUpdateProperties != nil {
		objectMap["properties"] = slu.SensitivityLabelUpdateProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for SensitivityLabelUpdate struct.
func (slu *SensitivityLabelUpdate) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var sensitivityLabelUpdateProperties SensitivityLabelUpdateProperties
				err = json.Unmarshal(*v, &sensitivityLabelUpdateProperties)
				if err != nil {
					return err
				}
				slu.SensitivityLabelUpdateProperties = &sensitivityLabelUpdateProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				slu.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				slu.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				slu.Type = &typeVar
			}
		}
	}

	return nil
}

// SensitivityLabelUpdateList a list of sensitivity label update operations.
type SensitivityLabelUpdateList struct {
	Operations *[]SensitivityLabelUpdate `json:"operations,omitempty"`
}

// SensitivityLabelUpdateProperties properties of an operation executed on a sensitivity label.
type SensitivityLabelUpdateProperties struct {
	// Op - Possible values include: 'SensitivityLabelUpdateKindSet', 'SensitivityLabelUpdateKindRemove'
	Op SensitivityLabelUpdateKind `json:"op,omitempty"`
	// Schema - Schema name of the column to update.
	Schema *string `json:"schema,omitempty"`
	// Table - Table name of the column to update.
	Table *string `json:"table,omitempty"`
	// Column - Column name to update.
	Column *string `json:"column,omitempty"`
	// SensitivityLabel - The sensitivity label information to apply on a column.
	SensitivityLabel *SensitivityLabel `json:"sensitivityLabel,omitempty"`
}

// ServerBlobAuditingPolicy a server blob auditing policy.
type ServerBlobAuditingPolicy struct {
	autorest.Response `json:"-"`
	// ServerBlobAuditingPolicyProperties - Resource properties.
	*ServerBlobAuditingPolicyProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for ServerBlobAuditingPolicy.
func (sbap ServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if sbap.ServerBlobAuditingPolicyProperties != nil {
		objectMap["properties"] = sbap.ServerBlobAuditingPolicyProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for ServerBlobAuditingPolicy struct.
func (sbap *ServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var serverBlobAuditingPolicyProperties ServerBlobAuditingPolicyProperties
				err = json.Unmarshal(*v, &serverBlobAuditingPolicyProperties)
				if err != nil {
					return err
				}
				sbap.ServerBlobAuditingPolicyProperties = &serverBlobAuditingPolicyProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				sbap.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				sbap.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				sbap.Type = &typeVar
			}
		}
	}

	return nil
}

// ServerBlobAuditingPolicyListResult a list of server auditing settings.
type ServerBlobAuditingPolicyListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]ServerBlobAuditingPolicy `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for ServerBlobAuditingPolicyListResult.
func (sbaplr ServerBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// ServerBlobAuditingPolicyListResultIterator provides access to a complete listing of
// ServerBlobAuditingPolicy values.
type ServerBlobAuditingPolicyListResultIterator struct {
	i    int
	page ServerBlobAuditingPolicyListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *ServerBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ServerBlobAuditingPolicyListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *ServerBlobAuditingPolicyListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ServerBlobAuditingPolicyListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter ServerBlobAuditingPolicyListResultIterator) Response() ServerBlobAuditingPolicyListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter ServerBlobAuditingPolicyListResultIterator) Value() ServerBlobAuditingPolicy {
	if !iter.page.NotDone() {
		return ServerBlobAuditingPolicy{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the ServerBlobAuditingPolicyListResultIterator type.
func NewServerBlobAuditingPolicyListResultIterator(page ServerBlobAuditingPolicyListResultPage) ServerBlobAuditingPolicyListResultIterator {
	return ServerBlobAuditingPolicyListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (sbaplr ServerBlobAuditingPolicyListResult) IsEmpty() bool {
	return sbaplr.Value == nil || len(*sbaplr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (sbaplr ServerBlobAuditingPolicyListResult) hasNextLink() bool {
	return sbaplr.NextLink != nil && len(*sbaplr.NextLink) != 0
}

// serverBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (sbaplr ServerBlobAuditingPolicyListResult) serverBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !sbaplr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(sbaplr.NextLink)))
}

// ServerBlobAuditingPolicyListResultPage contains a page of ServerBlobAuditingPolicy values.
type ServerBlobAuditingPolicyListResultPage struct {
	fn     func(context.Context, ServerBlobAuditingPolicyListResult) (ServerBlobAuditingPolicyListResult, error)
	sbaplr ServerBlobAuditingPolicyListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *ServerBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ServerBlobAuditingPolicyListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.sbaplr)
		if err != nil {
			return err
		}
		page.sbaplr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *ServerBlobAuditingPolicyListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ServerBlobAuditingPolicyListResultPage) NotDone() bool {
	return !page.sbaplr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page ServerBlobAuditingPolicyListResultPage) Response() ServerBlobAuditingPolicyListResult {
	return page.sbaplr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page ServerBlobAuditingPolicyListResultPage) Values() []ServerBlobAuditingPolicy {
	if page.sbaplr.IsEmpty() {
		return nil
	}
	return *page.sbaplr.Value
}

// Creates a new instance of the ServerBlobAuditingPolicyListResultPage type.
func NewServerBlobAuditingPolicyListResultPage(cur ServerBlobAuditingPolicyListResult, getNextPage func(context.Context, ServerBlobAuditingPolicyListResult) (ServerBlobAuditingPolicyListResult, error)) ServerBlobAuditingPolicyListResultPage {
	return ServerBlobAuditingPolicyListResultPage{
		fn:     getNextPage,
		sbaplr: cur,
	}
}

// ServerBlobAuditingPolicyProperties properties of a server blob auditing policy.
type ServerBlobAuditingPolicyProperties struct {
	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
	State BlobAuditingPolicyState `json:"state,omitempty"`
	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
	// Prerequisites for using managed identity authentication:
	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
	// RetentionDays - Specifies the number of days to keep in the audit logs in the storage account.
	RetentionDays *int32 `json:"retentionDays,omitempty"`
	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
	//
	// The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:
	//
	// BATCH_COMPLETED_GROUP,
	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
	// FAILED_DATABASE_AUTHENTICATION_GROUP.
	//
	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
	//
	// The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records):
	//
	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
	// BACKUP_RESTORE_GROUP
	// DATABASE_LOGOUT_GROUP
	// DATABASE_OBJECT_CHANGE_GROUP
	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
	// DATABASE_OPERATION_GROUP
	// DATABASE_PERMISSION_CHANGE_GROUP
	// DATABASE_PRINCIPAL_CHANGE_GROUP
	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
	// FAILED_DATABASE_AUTHENTICATION_GROUP
	// SCHEMA_OBJECT_ACCESS_GROUP
	// SCHEMA_OBJECT_CHANGE_GROUP
	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
	// USER_CHANGE_PASSWORD_GROUP
	// BATCH_STARTED_GROUP
	// BATCH_COMPLETED_GROUP
	//
	// These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs.
	//
	// For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups).
	//
	// For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are:
	// SELECT
	// UPDATE
	// INSERT
	// DELETE
	// EXECUTE
	// RECEIVE
	// REFERENCES
	//
	// The general form for defining an action to be audited is:
	// {action} ON {object} BY {principal}
	//
	// Note that <object> in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively.
	//
	// For example:
	// SELECT on dbo.myTable by public
	// SELECT on DATABASE::myDatabase by public
	// SELECT on SCHEMA::mySchema by public
	//
	// For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions)
	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
	// IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor.
	// In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true.
	//
	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.
	// Note that for server level audit you should use the 'master' database as {databaseName}.
	//
	// Diagnostic Settings URI format:
	// PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
	//
	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
	// QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.
	// The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`
	// IsDevopsAuditEnabled - Specifies the state of devops audit. If state is Enabled, devops logs will be sent to Azure Monitor.
	// In order to send the events to Azure Monitor, specify 'State' as 'Enabled', 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true
	//
	// When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' diagnostic logs category on the master database should also be created.
	//
	// Diagnostic Settings URI format:
	// PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
	//
	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
	IsDevopsAuditEnabled *bool `json:"isDevopsAuditEnabled,omitempty"`
}

// ServerSecurityAlertPolicy workspace managed Sql server security alert policy.
type ServerSecurityAlertPolicy struct {
	autorest.Response `json:"-"`
	// ServerSecurityAlertPolicyProperties - Resource properties.
	*ServerSecurityAlertPolicyProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for ServerSecurityAlertPolicy.
func (ssap ServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if ssap.ServerSecurityAlertPolicyProperties != nil {
		objectMap["properties"] = ssap.ServerSecurityAlertPolicyProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for ServerSecurityAlertPolicy struct.
func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var serverSecurityAlertPolicyProperties ServerSecurityAlertPolicyProperties
				err = json.Unmarshal(*v, &serverSecurityAlertPolicyProperties)
				if err != nil {
					return err
				}
				ssap.ServerSecurityAlertPolicyProperties = &serverSecurityAlertPolicyProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				ssap.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				ssap.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				ssap.Type = &typeVar
			}
		}
	}

	return nil
}

// ServerSecurityAlertPolicyListResult a list of the workspace managed sql server's security alert
// policies.
type ServerSecurityAlertPolicyListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]ServerSecurityAlertPolicy `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for ServerSecurityAlertPolicyListResult.
func (ssaplr ServerSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// ServerSecurityAlertPolicyListResultIterator provides access to a complete listing of
// ServerSecurityAlertPolicy values.
type ServerSecurityAlertPolicyListResultIterator struct {
	i    int
	page ServerSecurityAlertPolicyListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *ServerSecurityAlertPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ServerSecurityAlertPolicyListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *ServerSecurityAlertPolicyListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ServerSecurityAlertPolicyListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter ServerSecurityAlertPolicyListResultIterator) Response() ServerSecurityAlertPolicyListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter ServerSecurityAlertPolicyListResultIterator) Value() ServerSecurityAlertPolicy {
	if !iter.page.NotDone() {
		return ServerSecurityAlertPolicy{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the ServerSecurityAlertPolicyListResultIterator type.
func NewServerSecurityAlertPolicyListResultIterator(page ServerSecurityAlertPolicyListResultPage) ServerSecurityAlertPolicyListResultIterator {
	return ServerSecurityAlertPolicyListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (ssaplr ServerSecurityAlertPolicyListResult) IsEmpty() bool {
	return ssaplr.Value == nil || len(*ssaplr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (ssaplr ServerSecurityAlertPolicyListResult) hasNextLink() bool {
	return ssaplr.NextLink != nil && len(*ssaplr.NextLink) != 0
}

// serverSecurityAlertPolicyListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (ssaplr ServerSecurityAlertPolicyListResult) serverSecurityAlertPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !ssaplr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(ssaplr.NextLink)))
}

// ServerSecurityAlertPolicyListResultPage contains a page of ServerSecurityAlertPolicy values.
type ServerSecurityAlertPolicyListResultPage struct {
	fn     func(context.Context, ServerSecurityAlertPolicyListResult) (ServerSecurityAlertPolicyListResult, error)
	ssaplr ServerSecurityAlertPolicyListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *ServerSecurityAlertPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ServerSecurityAlertPolicyListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.ssaplr)
		if err != nil {
			return err
		}
		page.ssaplr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *ServerSecurityAlertPolicyListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ServerSecurityAlertPolicyListResultPage) NotDone() bool {
	return !page.ssaplr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page ServerSecurityAlertPolicyListResultPage) Response() ServerSecurityAlertPolicyListResult {
	return page.ssaplr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page ServerSecurityAlertPolicyListResultPage) Values() []ServerSecurityAlertPolicy {
	if page.ssaplr.IsEmpty() {
		return nil
	}
	return *page.ssaplr.Value
}

// Creates a new instance of the ServerSecurityAlertPolicyListResultPage type.
func NewServerSecurityAlertPolicyListResultPage(cur ServerSecurityAlertPolicyListResult, getNextPage func(context.Context, ServerSecurityAlertPolicyListResult) (ServerSecurityAlertPolicyListResult, error)) ServerSecurityAlertPolicyListResultPage {
	return ServerSecurityAlertPolicyListResultPage{
		fn:     getNextPage,
		ssaplr: cur,
	}
}

// ServerSecurityAlertPolicyProperties properties of a security alert policy.
type ServerSecurityAlertPolicyProperties struct {
	// State - Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific server. Possible values include: 'SecurityAlertPolicyStateNew', 'SecurityAlertPolicyStateEnabled', 'SecurityAlertPolicyStateDisabled'
	State SecurityAlertPolicyState `json:"state,omitempty"`
	// DisabledAlerts - Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action
	DisabledAlerts *[]string `json:"disabledAlerts,omitempty"`
	// EmailAddresses - Specifies an array of e-mail addresses to which the alert is sent.
	EmailAddresses *[]string `json:"emailAddresses,omitempty"`
	// EmailAccountAdmins - Specifies that the alert is sent to the account administrators.
	EmailAccountAdmins *bool `json:"emailAccountAdmins,omitempty"`
	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.
	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
	// StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account.
	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
	// RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs.
	RetentionDays *int32 `json:"retentionDays,omitempty"`
	// CreationTime - READ-ONLY; Specifies the UTC creation time of the policy.
	CreationTime *date.Time `json:"creationTime,omitempty"`
}

// MarshalJSON is the custom marshaler for ServerSecurityAlertPolicyProperties.
func (ssapp ServerSecurityAlertPolicyProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if ssapp.State != "" {
		objectMap["state"] = ssapp.State
	}
	if ssapp.DisabledAlerts != nil {
		objectMap["disabledAlerts"] = ssapp.DisabledAlerts
	}
	if ssapp.EmailAddresses != nil {
		objectMap["emailAddresses"] = ssapp.EmailAddresses
	}
	if ssapp.EmailAccountAdmins != nil {
		objectMap["emailAccountAdmins"] = ssapp.EmailAccountAdmins
	}
	if ssapp.StorageEndpoint != nil {
		objectMap["storageEndpoint"] = ssapp.StorageEndpoint
	}
	if ssapp.StorageAccountAccessKey != nil {
		objectMap["storageAccountAccessKey"] = ssapp.StorageAccountAccessKey
	}
	if ssapp.RetentionDays != nil {
		objectMap["retentionDays"] = ssapp.RetentionDays
	}
	return json.Marshal(objectMap)
}

// ServerUsage represents server metrics.
type ServerUsage struct {
	// Name - READ-ONLY; Name of the server usage metric.
	Name *string `json:"name,omitempty"`
	// ResourceName - READ-ONLY; The name of the resource.
	ResourceName *string `json:"resourceName,omitempty"`
	// DisplayName - READ-ONLY; The metric display name.
	DisplayName *string `json:"displayName,omitempty"`
	// CurrentValue - READ-ONLY; The current value of the metric.
	CurrentValue *float64 `json:"currentValue,omitempty"`
	// Limit - READ-ONLY; The current limit of the metric.
	Limit *float64 `json:"limit,omitempty"`
	// Unit - READ-ONLY; The units of the metric.
	Unit *string `json:"unit,omitempty"`
	// NextResetTime - READ-ONLY; The next reset time for the metric (ISO8601 format).
	NextResetTime *date.Time `json:"nextResetTime,omitempty"`
}

// MarshalJSON is the custom marshaler for ServerUsage.
func (su ServerUsage) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// ServerUsageListResult represents the response to a list server metrics request.
type ServerUsageListResult struct {
	autorest.Response `json:"-"`
	// Value - The list of server metrics for the server.
	Value *[]ServerUsage `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for ServerUsageListResult.
func (sulr ServerUsageListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if sulr.Value != nil {
		objectMap["value"] = sulr.Value
	}
	return json.Marshal(objectMap)
}

// ServerUsageListResultIterator provides access to a complete listing of ServerUsage values.
type ServerUsageListResultIterator struct {
	i    int
	page ServerUsageListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *ServerUsageListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ServerUsageListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *ServerUsageListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ServerUsageListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter ServerUsageListResultIterator) Response() ServerUsageListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter ServerUsageListResultIterator) Value() ServerUsage {
	if !iter.page.NotDone() {
		return ServerUsage{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the ServerUsageListResultIterator type.
func NewServerUsageListResultIterator(page ServerUsageListResultPage) ServerUsageListResultIterator {
	return ServerUsageListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (sulr ServerUsageListResult) IsEmpty() bool {
	return sulr.Value == nil || len(*sulr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (sulr ServerUsageListResult) hasNextLink() bool {
	return sulr.NextLink != nil && len(*sulr.NextLink) != 0
}

// serverUsageListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (sulr ServerUsageListResult) serverUsageListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !sulr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(sulr.NextLink)))
}

// ServerUsageListResultPage contains a page of ServerUsage values.
type ServerUsageListResultPage struct {
	fn   func(context.Context, ServerUsageListResult) (ServerUsageListResult, error)
	sulr ServerUsageListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *ServerUsageListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ServerUsageListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.sulr)
		if err != nil {
			return err
		}
		page.sulr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *ServerUsageListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ServerUsageListResultPage) NotDone() bool {
	return !page.sulr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page ServerUsageListResultPage) Response() ServerUsageListResult {
	return page.sulr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page ServerUsageListResultPage) Values() []ServerUsage {
	if page.sulr.IsEmpty() {
		return nil
	}
	return *page.sulr.Value
}

// Creates a new instance of the ServerUsageListResultPage type.
func NewServerUsageListResultPage(cur ServerUsageListResult, getNextPage func(context.Context, ServerUsageListResult) (ServerUsageListResult, error)) ServerUsageListResultPage {
	return ServerUsageListResultPage{
		fn:   getNextPage,
		sulr: cur,
	}
}

// ServerVulnerabilityAssessment a server vulnerability assessment.
type ServerVulnerabilityAssessment struct {
	autorest.Response `json:"-"`
	// ServerVulnerabilityAssessmentProperties - Resource properties.
	*ServerVulnerabilityAssessmentProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for ServerVulnerabilityAssessment.
func (sva ServerVulnerabilityAssessment) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if sva.ServerVulnerabilityAssessmentProperties != nil {
		objectMap["properties"] = sva.ServerVulnerabilityAssessmentProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for ServerVulnerabilityAssessment struct.
func (sva *ServerVulnerabilityAssessment) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var serverVulnerabilityAssessmentProperties ServerVulnerabilityAssessmentProperties
				err = json.Unmarshal(*v, &serverVulnerabilityAssessmentProperties)
				if err != nil {
					return err
				}
				sva.ServerVulnerabilityAssessmentProperties = &serverVulnerabilityAssessmentProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				sva.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				sva.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				sva.Type = &typeVar
			}
		}
	}

	return nil
}

// ServerVulnerabilityAssessmentListResult a list of the server's vulnerability assessments.
type ServerVulnerabilityAssessmentListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]ServerVulnerabilityAssessment `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for ServerVulnerabilityAssessmentListResult.
func (svalr ServerVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// ServerVulnerabilityAssessmentListResultIterator provides access to a complete listing of
// ServerVulnerabilityAssessment values.
type ServerVulnerabilityAssessmentListResultIterator struct {
	i    int
	page ServerVulnerabilityAssessmentListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *ServerVulnerabilityAssessmentListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *ServerVulnerabilityAssessmentListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ServerVulnerabilityAssessmentListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter ServerVulnerabilityAssessmentListResultIterator) Response() ServerVulnerabilityAssessmentListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter ServerVulnerabilityAssessmentListResultIterator) Value() ServerVulnerabilityAssessment {
	if !iter.page.NotDone() {
		return ServerVulnerabilityAssessment{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the ServerVulnerabilityAssessmentListResultIterator type.
func NewServerVulnerabilityAssessmentListResultIterator(page ServerVulnerabilityAssessmentListResultPage) ServerVulnerabilityAssessmentListResultIterator {
	return ServerVulnerabilityAssessmentListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (svalr ServerVulnerabilityAssessmentListResult) IsEmpty() bool {
	return svalr.Value == nil || len(*svalr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (svalr ServerVulnerabilityAssessmentListResult) hasNextLink() bool {
	return svalr.NextLink != nil && len(*svalr.NextLink) != 0
}

// serverVulnerabilityAssessmentListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (svalr ServerVulnerabilityAssessmentListResult) serverVulnerabilityAssessmentListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !svalr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(svalr.NextLink)))
}

// ServerVulnerabilityAssessmentListResultPage contains a page of ServerVulnerabilityAssessment values.
type ServerVulnerabilityAssessmentListResultPage struct {
	fn    func(context.Context, ServerVulnerabilityAssessmentListResult) (ServerVulnerabilityAssessmentListResult, error)
	svalr ServerVulnerabilityAssessmentListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *ServerVulnerabilityAssessmentListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.svalr)
		if err != nil {
			return err
		}
		page.svalr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *ServerVulnerabilityAssessmentListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ServerVulnerabilityAssessmentListResultPage) NotDone() bool {
	return !page.svalr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page ServerVulnerabilityAssessmentListResultPage) Response() ServerVulnerabilityAssessmentListResult {
	return page.svalr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page ServerVulnerabilityAssessmentListResultPage) Values() []ServerVulnerabilityAssessment {
	if page.svalr.IsEmpty() {
		return nil
	}
	return *page.svalr.Value
}

// Creates a new instance of the ServerVulnerabilityAssessmentListResultPage type.
func NewServerVulnerabilityAssessmentListResultPage(cur ServerVulnerabilityAssessmentListResult, getNextPage func(context.Context, ServerVulnerabilityAssessmentListResult) (ServerVulnerabilityAssessmentListResult, error)) ServerVulnerabilityAssessmentListResultPage {
	return ServerVulnerabilityAssessmentListResultPage{
		fn:    getNextPage,
		svalr: cur,
	}
}

// ServerVulnerabilityAssessmentProperties properties of a server Vulnerability Assessment.
type ServerVulnerabilityAssessmentProperties struct {
	// StorageContainerPath - A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/).
	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
	// StorageContainerSasKey - A shared access signature (SAS Key) that has read and write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required.
	StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"`
	// StorageAccountAccessKey - Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
	// RecurringScans - The recurring scans settings
	RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"`
}

// SetObject ...
type SetObject struct {
	autorest.Response `json:"-"`
	Value             interface{} `json:"value,omitempty"`
}

// Sku SQL pool SKU
type Sku struct {
	// Tier - The service tier
	Tier *string `json:"tier,omitempty"`
	// Name - The SKU name
	Name *string `json:"name,omitempty"`
	// Capacity - If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted.
	Capacity *int32 `json:"capacity,omitempty"`
}

// SkuDescription the Kusto SKU description of given resource type
type SkuDescription struct {
	// ResourceType - READ-ONLY; The resource type
	ResourceType *string `json:"resourceType,omitempty"`
	// Name - READ-ONLY; The name of the SKU
	Name *string `json:"name,omitempty"`
	// Size - READ-ONLY; The size of the SKU
	Size *string `json:"size,omitempty"`
	// Locations - READ-ONLY; The set of locations that the SKU is available
	Locations *[]string `json:"locations,omitempty"`
	// LocationInfo - READ-ONLY; Locations and zones
	LocationInfo *[]SkuLocationInfoItem `json:"locationInfo,omitempty"`
	// Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used
	Restrictions *[]interface{} `json:"restrictions,omitempty"`
}

// MarshalJSON is the custom marshaler for SkuDescription.
func (sd SkuDescription) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// SkuDescriptionList the list of the SKU descriptions
type SkuDescriptionList struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; SKU descriptions
	Value *[]SkuDescription `json:"value,omitempty"`
}

// MarshalJSON is the custom marshaler for SkuDescriptionList.
func (sdl SkuDescriptionList) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// SkuLocationInfoItem the locations and zones info for SKU.
type SkuLocationInfoItem struct {
	// Location - The available location of the SKU.
	Location *string `json:"location,omitempty"`
	// Zones - The available zone of the SKU.
	Zones *[]string `json:"zones,omitempty"`
}

// SparkConfigProperties sparkConfig Properties for a Big Data pool powered by Apache Spark
type SparkConfigProperties struct {
	// Time - READ-ONLY; The last update time of the spark config properties file.
	Time *date.Time `json:"time,omitempty"`
	// Content - The spark config properties.
	Content *string `json:"content,omitempty"`
	// Filename - The filename of the spark config properties file.
	Filename *string `json:"filename,omitempty"`
	// ConfigurationType - The type of the spark config properties file. Possible values include: 'ConfigurationTypeFile', 'ConfigurationTypeArtifact'
	ConfigurationType ConfigurationType `json:"configurationType,omitempty"`
}

// MarshalJSON is the custom marshaler for SparkConfigProperties.
func (scp SparkConfigProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if scp.Content != nil {
		objectMap["content"] = scp.Content
	}
	if scp.Filename != nil {
		objectMap["filename"] = scp.Filename
	}
	if scp.ConfigurationType != "" {
		objectMap["configurationType"] = scp.ConfigurationType
	}
	return json.Marshal(objectMap)
}

// SparkConfigurationInfo sparkConfiguration Artifact information
type SparkConfigurationInfo struct {
	// Description - Description about the SparkConfiguration.
	Description *string `json:"description,omitempty"`
	// Configs - SparkConfiguration configs.
	Configs map[string]*string `json:"configs"`
	// Annotations - Annotations for SparkConfiguration.
	Annotations *[]string `json:"annotations,omitempty"`
	// Notes - additional Notes.
	Notes *string `json:"notes,omitempty"`
	// CreatedBy - The identity that created the resource.
	CreatedBy *string `json:"createdBy,omitempty"`
	// Created - The timestamp of resource creation.
	Created *date.Time `json:"created,omitempty"`
}

// MarshalJSON is the custom marshaler for SparkConfigurationInfo.
func (sci SparkConfigurationInfo) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if sci.Description != nil {
		objectMap["description"] = sci.Description
	}
	if sci.Configs != nil {
		objectMap["configs"] = sci.Configs
	}
	if sci.Annotations != nil {
		objectMap["annotations"] = sci.Annotations
	}
	if sci.Notes != nil {
		objectMap["notes"] = sci.Notes
	}
	if sci.CreatedBy != nil {
		objectMap["createdBy"] = sci.CreatedBy
	}
	if sci.Created != nil {
		objectMap["created"] = sci.Created
	}
	return json.Marshal(objectMap)
}

// SparkConfigurationListResponse a list of SparkConfiguration resources.
type SparkConfigurationListResponse struct {
	autorest.Response `json:"-"`
	// Value - List of SparkConfiguration.
	Value *[]SparkConfigurationResource `json:"value,omitempty"`
	// NextLink - The link to the next page of results, if any remaining results exist.
	NextLink *string `json:"nextLink,omitempty"`
}

// SparkConfigurationListResponseIterator provides access to a complete listing of
// SparkConfigurationResource values.
type SparkConfigurationListResponseIterator struct {
	i    int
	page SparkConfigurationListResponsePage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *SparkConfigurationListResponseIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SparkConfigurationListResponseIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *SparkConfigurationListResponseIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter SparkConfigurationListResponseIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter SparkConfigurationListResponseIterator) Response() SparkConfigurationListResponse {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter SparkConfigurationListResponseIterator) Value() SparkConfigurationResource {
	if !iter.page.NotDone() {
		return SparkConfigurationResource{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the SparkConfigurationListResponseIterator type.
func NewSparkConfigurationListResponseIterator(page SparkConfigurationListResponsePage) SparkConfigurationListResponseIterator {
	return SparkConfigurationListResponseIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (sclr SparkConfigurationListResponse) IsEmpty() bool {
	return sclr.Value == nil || len(*sclr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (sclr SparkConfigurationListResponse) hasNextLink() bool {
	return sclr.NextLink != nil && len(*sclr.NextLink) != 0
}

// sparkConfigurationListResponsePreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (sclr SparkConfigurationListResponse) sparkConfigurationListResponsePreparer(ctx context.Context) (*http.Request, error) {
	if !sclr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(sclr.NextLink)))
}

// SparkConfigurationListResponsePage contains a page of SparkConfigurationResource values.
type SparkConfigurationListResponsePage struct {
	fn   func(context.Context, SparkConfigurationListResponse) (SparkConfigurationListResponse, error)
	sclr SparkConfigurationListResponse
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *SparkConfigurationListResponsePage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SparkConfigurationListResponsePage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.sclr)
		if err != nil {
			return err
		}
		page.sclr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *SparkConfigurationListResponsePage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page SparkConfigurationListResponsePage) NotDone() bool {
	return !page.sclr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page SparkConfigurationListResponsePage) Response() SparkConfigurationListResponse {
	return page.sclr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page SparkConfigurationListResponsePage) Values() []SparkConfigurationResource {
	if page.sclr.IsEmpty() {
		return nil
	}
	return *page.sclr.Value
}

// Creates a new instance of the SparkConfigurationListResponsePage type.
func NewSparkConfigurationListResponsePage(cur SparkConfigurationListResponse, getNextPage func(context.Context, SparkConfigurationListResponse) (SparkConfigurationListResponse, error)) SparkConfigurationListResponsePage {
	return SparkConfigurationListResponsePage{
		fn:   getNextPage,
		sclr: cur,
	}
}

// SparkConfigurationResource sparkConfiguration response details
type SparkConfigurationResource struct {
	autorest.Response `json:"-"`
	// SparkConfigurationInfo - SparkConfiguration properties.
	*SparkConfigurationInfo `json:"properties,omitempty"`
	// Etag - READ-ONLY; Resource Etag.
	Etag *string `json:"etag,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SparkConfigurationResource.
func (scr SparkConfigurationResource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if scr.SparkConfigurationInfo != nil {
		objectMap["properties"] = scr.SparkConfigurationInfo
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for SparkConfigurationResource struct.
func (scr *SparkConfigurationResource) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var sparkConfigurationInfo SparkConfigurationInfo
				err = json.Unmarshal(*v, &sparkConfigurationInfo)
				if err != nil {
					return err
				}
				scr.SparkConfigurationInfo = &sparkConfigurationInfo
			}
		case "etag":
			if v != nil {
				var etag string
				err = json.Unmarshal(*v, &etag)
				if err != nil {
					return err
				}
				scr.Etag = &etag
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				scr.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				scr.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				scr.Type = &typeVar
			}
		}
	}

	return nil
}

// SQLPool a SQL Analytics pool
type SQLPool struct {
	autorest.Response `json:"-"`
	// Sku - SQL pool SKU
	Sku *Sku `json:"sku,omitempty"`
	// SQLPoolResourceProperties - SQL pool properties
	*SQLPoolResourceProperties `json:"properties,omitempty"`
	// Tags - Resource tags.
	Tags map[string]*string `json:"tags"`
	// Location - The geo-location where the resource lives
	Location *string `json:"location,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPool.
func (sp SQLPool) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if sp.Sku != nil {
		objectMap["sku"] = sp.Sku
	}
	if sp.SQLPoolResourceProperties != nil {
		objectMap["properties"] = sp.SQLPoolResourceProperties
	}
	if sp.Tags != nil {
		objectMap["tags"] = sp.Tags
	}
	if sp.Location != nil {
		objectMap["location"] = sp.Location
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for SQLPool struct.
func (sp *SQLPool) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "sku":
			if v != nil {
				var sku Sku
				err = json.Unmarshal(*v, &sku)
				if err != nil {
					return err
				}
				sp.Sku = &sku
			}
		case "properties":
			if v != nil {
				var SQLPoolResourceProperties SQLPoolResourceProperties
				err = json.Unmarshal(*v, &SQLPoolResourceProperties)
				if err != nil {
					return err
				}
				sp.SQLPoolResourceProperties = &SQLPoolResourceProperties
			}
		case "tags":
			if v != nil {
				var tags map[string]*string
				err = json.Unmarshal(*v, &tags)
				if err != nil {
					return err
				}
				sp.Tags = tags
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				sp.Location = &location
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				sp.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				sp.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				sp.Type = &typeVar
			}
		}
	}

	return nil
}

// SQLPoolBlobAuditingPolicy a Sql pool blob auditing policy.
type SQLPoolBlobAuditingPolicy struct {
	autorest.Response `json:"-"`
	// Kind - READ-ONLY; Resource kind.
	Kind *string `json:"kind,omitempty"`
	// SQLPoolBlobAuditingPolicyProperties - Resource properties.
	*SQLPoolBlobAuditingPolicyProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolBlobAuditingPolicy.
func (spbap SQLPoolBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if spbap.SQLPoolBlobAuditingPolicyProperties != nil {
		objectMap["properties"] = spbap.SQLPoolBlobAuditingPolicyProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for SQLPoolBlobAuditingPolicy struct.
func (spbap *SQLPoolBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "kind":
			if v != nil {
				var kind string
				err = json.Unmarshal(*v, &kind)
				if err != nil {
					return err
				}
				spbap.Kind = &kind
			}
		case "properties":
			if v != nil {
				var SQLPoolBlobAuditingPolicyProperties SQLPoolBlobAuditingPolicyProperties
				err = json.Unmarshal(*v, &SQLPoolBlobAuditingPolicyProperties)
				if err != nil {
					return err
				}
				spbap.SQLPoolBlobAuditingPolicyProperties = &SQLPoolBlobAuditingPolicyProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				spbap.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				spbap.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				spbap.Type = &typeVar
			}
		}
	}

	return nil
}

// SQLPoolBlobAuditingPolicyListResult a list of Sql pool auditing settings.
type SQLPoolBlobAuditingPolicyListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]SQLPoolBlobAuditingPolicy `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolBlobAuditingPolicyListResult.
func (spbaplr SQLPoolBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// SQLPoolBlobAuditingPolicyListResultIterator provides access to a complete listing of
// SQLPoolBlobAuditingPolicy values.
type SQLPoolBlobAuditingPolicyListResultIterator struct {
	i    int
	page SQLPoolBlobAuditingPolicyListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *SQLPoolBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolBlobAuditingPolicyListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *SQLPoolBlobAuditingPolicyListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter SQLPoolBlobAuditingPolicyListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter SQLPoolBlobAuditingPolicyListResultIterator) Response() SQLPoolBlobAuditingPolicyListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter SQLPoolBlobAuditingPolicyListResultIterator) Value() SQLPoolBlobAuditingPolicy {
	if !iter.page.NotDone() {
		return SQLPoolBlobAuditingPolicy{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the SQLPoolBlobAuditingPolicyListResultIterator type.
func NewSQLPoolBlobAuditingPolicyListResultIterator(page SQLPoolBlobAuditingPolicyListResultPage) SQLPoolBlobAuditingPolicyListResultIterator {
	return SQLPoolBlobAuditingPolicyListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (spbaplr SQLPoolBlobAuditingPolicyListResult) IsEmpty() bool {
	return spbaplr.Value == nil || len(*spbaplr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (spbaplr SQLPoolBlobAuditingPolicyListResult) hasNextLink() bool {
	return spbaplr.NextLink != nil && len(*spbaplr.NextLink) != 0
}

// sQLPoolBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (spbaplr SQLPoolBlobAuditingPolicyListResult) sQLPoolBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !spbaplr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(spbaplr.NextLink)))
}

// SQLPoolBlobAuditingPolicyListResultPage contains a page of SQLPoolBlobAuditingPolicy values.
type SQLPoolBlobAuditingPolicyListResultPage struct {
	fn      func(context.Context, SQLPoolBlobAuditingPolicyListResult) (SQLPoolBlobAuditingPolicyListResult, error)
	spbaplr SQLPoolBlobAuditingPolicyListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *SQLPoolBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolBlobAuditingPolicyListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.spbaplr)
		if err != nil {
			return err
		}
		page.spbaplr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *SQLPoolBlobAuditingPolicyListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page SQLPoolBlobAuditingPolicyListResultPage) NotDone() bool {
	return !page.spbaplr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page SQLPoolBlobAuditingPolicyListResultPage) Response() SQLPoolBlobAuditingPolicyListResult {
	return page.spbaplr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page SQLPoolBlobAuditingPolicyListResultPage) Values() []SQLPoolBlobAuditingPolicy {
	if page.spbaplr.IsEmpty() {
		return nil
	}
	return *page.spbaplr.Value
}

// Creates a new instance of the SQLPoolBlobAuditingPolicyListResultPage type.
func NewSQLPoolBlobAuditingPolicyListResultPage(cur SQLPoolBlobAuditingPolicyListResult, getNextPage func(context.Context, SQLPoolBlobAuditingPolicyListResult) (SQLPoolBlobAuditingPolicyListResult, error)) SQLPoolBlobAuditingPolicyListResultPage {
	return SQLPoolBlobAuditingPolicyListResultPage{
		fn:      getNextPage,
		spbaplr: cur,
	}
}

// SQLPoolBlobAuditingPolicyProperties properties of a Sql pool blob auditing policy.
type SQLPoolBlobAuditingPolicyProperties struct {
	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
	State BlobAuditingPolicyState `json:"state,omitempty"`
	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required.
	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required.
	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
	// RetentionDays - Specifies the number of days to keep in the audit logs in the storage account.
	RetentionDays *int32 `json:"retentionDays,omitempty"`
	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
	//
	// The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:
	//
	// BATCH_COMPLETED_GROUP,
	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
	// FAILED_DATABASE_AUTHENTICATION_GROUP.
	//
	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
	//
	// The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records):
	//
	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
	// BACKUP_RESTORE_GROUP
	// DATABASE_LOGOUT_GROUP
	// DATABASE_OBJECT_CHANGE_GROUP
	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
	// DATABASE_OPERATION_GROUP
	// DATABASE_PERMISSION_CHANGE_GROUP
	// DATABASE_PRINCIPAL_CHANGE_GROUP
	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
	// FAILED_DATABASE_AUTHENTICATION_GROUP
	// SCHEMA_OBJECT_ACCESS_GROUP
	// SCHEMA_OBJECT_CHANGE_GROUP
	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
	// USER_CHANGE_PASSWORD_GROUP
	// BATCH_STARTED_GROUP
	// BATCH_COMPLETED_GROUP
	//
	// These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs.
	//
	// For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups).
	//
	// For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are:
	// SELECT
	// UPDATE
	// INSERT
	// DELETE
	// EXECUTE
	// RECEIVE
	// REFERENCES
	//
	// The general form for defining an action to be audited is:
	// {action} ON {object} BY {principal}
	//
	// Note that <object> in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively.
	//
	// For example:
	// SELECT on dbo.myTable by public
	// SELECT on DATABASE::myDatabase by public
	// SELECT on SCHEMA::mySchema by public
	//
	// For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions)
	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
	// IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor.
	// In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true.
	//
	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.
	// Note that for server level audit you should use the 'master' database as {databaseName}.
	//
	// Diagnostic Settings URI format:
	// PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
	//
	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
}

// SQLPoolBlobAuditingPolicySQLPoolOperationListResult the response to a list Sql pool operations request
type SQLPoolBlobAuditingPolicySQLPoolOperationListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]SQLPoolOperation `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolBlobAuditingPolicySQLPoolOperationListResult.
func (spbapspolr SQLPoolBlobAuditingPolicySQLPoolOperationListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// SQLPoolBlobAuditingPolicySQLPoolOperationListResultIterator provides access to a complete listing of
// SQLPoolOperation values.
type SQLPoolBlobAuditingPolicySQLPoolOperationListResultIterator struct {
	i    int
	page SQLPoolBlobAuditingPolicySQLPoolOperationListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *SQLPoolBlobAuditingPolicySQLPoolOperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolBlobAuditingPolicySQLPoolOperationListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *SQLPoolBlobAuditingPolicySQLPoolOperationListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter SQLPoolBlobAuditingPolicySQLPoolOperationListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter SQLPoolBlobAuditingPolicySQLPoolOperationListResultIterator) Response() SQLPoolBlobAuditingPolicySQLPoolOperationListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter SQLPoolBlobAuditingPolicySQLPoolOperationListResultIterator) Value() SQLPoolOperation {
	if !iter.page.NotDone() {
		return SQLPoolOperation{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the SQLPoolBlobAuditingPolicySQLPoolOperationListResultIterator type.
func NewSQLPoolBlobAuditingPolicySQLPoolOperationListResultIterator(page SQLPoolBlobAuditingPolicySQLPoolOperationListResultPage) SQLPoolBlobAuditingPolicySQLPoolOperationListResultIterator {
	return SQLPoolBlobAuditingPolicySQLPoolOperationListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (spbapspolr SQLPoolBlobAuditingPolicySQLPoolOperationListResult) IsEmpty() bool {
	return spbapspolr.Value == nil || len(*spbapspolr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (spbapspolr SQLPoolBlobAuditingPolicySQLPoolOperationListResult) hasNextLink() bool {
	return spbapspolr.NextLink != nil && len(*spbapspolr.NextLink) != 0
}

// sQLPoolBlobAuditingPolicySQLPoolOperationListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (spbapspolr SQLPoolBlobAuditingPolicySQLPoolOperationListResult) sQLPoolBlobAuditingPolicySQLPoolOperationListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !spbapspolr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(spbapspolr.NextLink)))
}

// SQLPoolBlobAuditingPolicySQLPoolOperationListResultPage contains a page of SQLPoolOperation values.
type SQLPoolBlobAuditingPolicySQLPoolOperationListResultPage struct {
	fn         func(context.Context, SQLPoolBlobAuditingPolicySQLPoolOperationListResult) (SQLPoolBlobAuditingPolicySQLPoolOperationListResult, error)
	spbapspolr SQLPoolBlobAuditingPolicySQLPoolOperationListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *SQLPoolBlobAuditingPolicySQLPoolOperationListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolBlobAuditingPolicySQLPoolOperationListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.spbapspolr)
		if err != nil {
			return err
		}
		page.spbapspolr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *SQLPoolBlobAuditingPolicySQLPoolOperationListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page SQLPoolBlobAuditingPolicySQLPoolOperationListResultPage) NotDone() bool {
	return !page.spbapspolr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page SQLPoolBlobAuditingPolicySQLPoolOperationListResultPage) Response() SQLPoolBlobAuditingPolicySQLPoolOperationListResult {
	return page.spbapspolr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page SQLPoolBlobAuditingPolicySQLPoolOperationListResultPage) Values() []SQLPoolOperation {
	if page.spbapspolr.IsEmpty() {
		return nil
	}
	return *page.spbapspolr.Value
}

// Creates a new instance of the SQLPoolBlobAuditingPolicySQLPoolOperationListResultPage type.
func NewSQLPoolBlobAuditingPolicySQLPoolOperationListResultPage(cur SQLPoolBlobAuditingPolicySQLPoolOperationListResult, getNextPage func(context.Context, SQLPoolBlobAuditingPolicySQLPoolOperationListResult) (SQLPoolBlobAuditingPolicySQLPoolOperationListResult, error)) SQLPoolBlobAuditingPolicySQLPoolOperationListResultPage {
	return SQLPoolBlobAuditingPolicySQLPoolOperationListResultPage{
		fn:         getNextPage,
		spbapspolr: cur,
	}
}

// SQLPoolColumn a Sql pool column resource.
type SQLPoolColumn struct {
	autorest.Response `json:"-"`
	// SQLPoolColumnProperties - Resource properties.
	*SQLPoolColumnProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolColumn.
func (spc SQLPoolColumn) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if spc.SQLPoolColumnProperties != nil {
		objectMap["properties"] = spc.SQLPoolColumnProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for SQLPoolColumn struct.
func (spc *SQLPoolColumn) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var SQLPoolColumnProperties SQLPoolColumnProperties
				err = json.Unmarshal(*v, &SQLPoolColumnProperties)
				if err != nil {
					return err
				}
				spc.SQLPoolColumnProperties = &SQLPoolColumnProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				spc.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				spc.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				spc.Type = &typeVar
			}
		}
	}

	return nil
}

// SQLPoolColumnListResult a list of Sql pool columns.
type SQLPoolColumnListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]SQLPoolColumn `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolColumnListResult.
func (spclr SQLPoolColumnListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// SQLPoolColumnListResultIterator provides access to a complete listing of SQLPoolColumn values.
type SQLPoolColumnListResultIterator struct {
	i    int
	page SQLPoolColumnListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *SQLPoolColumnListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolColumnListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *SQLPoolColumnListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter SQLPoolColumnListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter SQLPoolColumnListResultIterator) Response() SQLPoolColumnListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter SQLPoolColumnListResultIterator) Value() SQLPoolColumn {
	if !iter.page.NotDone() {
		return SQLPoolColumn{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the SQLPoolColumnListResultIterator type.
func NewSQLPoolColumnListResultIterator(page SQLPoolColumnListResultPage) SQLPoolColumnListResultIterator {
	return SQLPoolColumnListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (spclr SQLPoolColumnListResult) IsEmpty() bool {
	return spclr.Value == nil || len(*spclr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (spclr SQLPoolColumnListResult) hasNextLink() bool {
	return spclr.NextLink != nil && len(*spclr.NextLink) != 0
}

// sQLPoolColumnListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (spclr SQLPoolColumnListResult) sQLPoolColumnListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !spclr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(spclr.NextLink)))
}

// SQLPoolColumnListResultPage contains a page of SQLPoolColumn values.
type SQLPoolColumnListResultPage struct {
	fn    func(context.Context, SQLPoolColumnListResult) (SQLPoolColumnListResult, error)
	spclr SQLPoolColumnListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *SQLPoolColumnListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolColumnListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.spclr)
		if err != nil {
			return err
		}
		page.spclr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *SQLPoolColumnListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page SQLPoolColumnListResultPage) NotDone() bool {
	return !page.spclr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page SQLPoolColumnListResultPage) Response() SQLPoolColumnListResult {
	return page.spclr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page SQLPoolColumnListResultPage) Values() []SQLPoolColumn {
	if page.spclr.IsEmpty() {
		return nil
	}
	return *page.spclr.Value
}

// Creates a new instance of the SQLPoolColumnListResultPage type.
func NewSQLPoolColumnListResultPage(cur SQLPoolColumnListResult, getNextPage func(context.Context, SQLPoolColumnListResult) (SQLPoolColumnListResult, error)) SQLPoolColumnListResultPage {
	return SQLPoolColumnListResultPage{
		fn:    getNextPage,
		spclr: cur,
	}
}

// SQLPoolColumnProperties sql pool column properties.
type SQLPoolColumnProperties struct {
	// ColumnType - The column data type. Possible values include: 'ColumnDataTypeImage', 'ColumnDataTypeText', 'ColumnDataTypeUniqueidentifier', 'ColumnDataTypeDate', 'ColumnDataTypeTime', 'ColumnDataTypeDatetime2', 'ColumnDataTypeDatetimeoffset', 'ColumnDataTypeTinyint', 'ColumnDataTypeSmallint', 'ColumnDataTypeInt', 'ColumnDataTypeSmalldatetime', 'ColumnDataTypeReal', 'ColumnDataTypeMoney', 'ColumnDataTypeDatetime', 'ColumnDataTypeFloat', 'ColumnDataTypeSQLVariant', 'ColumnDataTypeNtext', 'ColumnDataTypeBit', 'ColumnDataTypeDecimal', 'ColumnDataTypeNumeric', 'ColumnDataTypeSmallmoney', 'ColumnDataTypeBigint', 'ColumnDataTypeHierarchyid', 'ColumnDataTypeGeometry', 'ColumnDataTypeGeography', 'ColumnDataTypeVarbinary', 'ColumnDataTypeVarchar', 'ColumnDataTypeBinary', 'ColumnDataTypeChar', 'ColumnDataTypeTimestamp', 'ColumnDataTypeNvarchar', 'ColumnDataTypeNchar', 'ColumnDataTypeXML', 'ColumnDataTypeSysname'
	ColumnType ColumnDataType `json:"columnType,omitempty"`
	// IsComputed - READ-ONLY; Indicates whether column value is computed or not
	IsComputed *bool `json:"isComputed,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolColumnProperties.
func (spcp SQLPoolColumnProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if spcp.ColumnType != "" {
		objectMap["columnType"] = spcp.ColumnType
	}
	return json.Marshal(objectMap)
}

// SQLPoolConnectionPolicy a Sql pool connection policy.
type SQLPoolConnectionPolicy struct {
	autorest.Response `json:"-"`
	// Kind - READ-ONLY; Resource kind.
	Kind *string `json:"kind,omitempty"`
	// Location - READ-ONLY; Resource location.
	Location *string `json:"location,omitempty"`
	// SQLPoolConnectionPolicyProperties - Resource properties.
	*SQLPoolConnectionPolicyProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolConnectionPolicy.
func (spcp SQLPoolConnectionPolicy) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if spcp.SQLPoolConnectionPolicyProperties != nil {
		objectMap["properties"] = spcp.SQLPoolConnectionPolicyProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for SQLPoolConnectionPolicy struct.
func (spcp *SQLPoolConnectionPolicy) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "kind":
			if v != nil {
				var kind string
				err = json.Unmarshal(*v, &kind)
				if err != nil {
					return err
				}
				spcp.Kind = &kind
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				spcp.Location = &location
			}
		case "properties":
			if v != nil {
				var SQLPoolConnectionPolicyProperties SQLPoolConnectionPolicyProperties
				err = json.Unmarshal(*v, &SQLPoolConnectionPolicyProperties)
				if err != nil {
					return err
				}
				spcp.SQLPoolConnectionPolicyProperties = &SQLPoolConnectionPolicyProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				spcp.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				spcp.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				spcp.Type = &typeVar
			}
		}
	}

	return nil
}

// SQLPoolConnectionPolicyProperties properties of a Sql pool connection policy.
type SQLPoolConnectionPolicyProperties struct {
	// SecurityEnabledAccess - The state of security access.
	SecurityEnabledAccess *string `json:"securityEnabledAccess,omitempty"`
	// ProxyDNSName - The fully qualified host name of the auditing proxy.
	ProxyDNSName *string `json:"proxyDnsName,omitempty"`
	// ProxyPort - The port number of the auditing proxy.
	ProxyPort *string `json:"proxyPort,omitempty"`
	// Visibility - The visibility of the auditing proxy.
	Visibility *string `json:"visibility,omitempty"`
	// UseServerDefault - Whether server default is enabled or disabled.
	UseServerDefault *string `json:"useServerDefault,omitempty"`
	// RedirectionState - The state of proxy redirection.
	RedirectionState *string `json:"redirectionState,omitempty"`
	// State - The connection policy state.
	State *string `json:"state,omitempty"`
}

// SQLPoolInfoListResult list of SQL pools
type SQLPoolInfoListResult struct {
	autorest.Response `json:"-"`
	// NextLink - Link to the next page of results
	NextLink *string `json:"nextLink,omitempty"`
	// Value - List of SQL pools
	Value *[]SQLPool `json:"value,omitempty"`
}

// SQLPoolInfoListResultIterator provides access to a complete listing of SQLPool values.
type SQLPoolInfoListResultIterator struct {
	i    int
	page SQLPoolInfoListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *SQLPoolInfoListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolInfoListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *SQLPoolInfoListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter SQLPoolInfoListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter SQLPoolInfoListResultIterator) Response() SQLPoolInfoListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter SQLPoolInfoListResultIterator) Value() SQLPool {
	if !iter.page.NotDone() {
		return SQLPool{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the SQLPoolInfoListResultIterator type.
func NewSQLPoolInfoListResultIterator(page SQLPoolInfoListResultPage) SQLPoolInfoListResultIterator {
	return SQLPoolInfoListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (spilr SQLPoolInfoListResult) IsEmpty() bool {
	return spilr.Value == nil || len(*spilr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (spilr SQLPoolInfoListResult) hasNextLink() bool {
	return spilr.NextLink != nil && len(*spilr.NextLink) != 0
}

// sQLPoolInfoListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (spilr SQLPoolInfoListResult) sQLPoolInfoListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !spilr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(spilr.NextLink)))
}

// SQLPoolInfoListResultPage contains a page of SQLPool values.
type SQLPoolInfoListResultPage struct {
	fn    func(context.Context, SQLPoolInfoListResult) (SQLPoolInfoListResult, error)
	spilr SQLPoolInfoListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *SQLPoolInfoListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolInfoListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.spilr)
		if err != nil {
			return err
		}
		page.spilr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *SQLPoolInfoListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page SQLPoolInfoListResultPage) NotDone() bool {
	return !page.spilr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page SQLPoolInfoListResultPage) Response() SQLPoolInfoListResult {
	return page.spilr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page SQLPoolInfoListResultPage) Values() []SQLPool {
	if page.spilr.IsEmpty() {
		return nil
	}
	return *page.spilr.Value
}

// Creates a new instance of the SQLPoolInfoListResultPage type.
func NewSQLPoolInfoListResultPage(cur SQLPoolInfoListResult, getNextPage func(context.Context, SQLPoolInfoListResult) (SQLPoolInfoListResult, error)) SQLPoolInfoListResultPage {
	return SQLPoolInfoListResultPage{
		fn:    getNextPage,
		spilr: cur,
	}
}

// SQLPoolOperation a Sql pool operation.
type SQLPoolOperation struct {
	// SQLPoolOperationProperties - Resource properties.
	*SQLPoolOperationProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolOperation.
func (spo SQLPoolOperation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if spo.SQLPoolOperationProperties != nil {
		objectMap["properties"] = spo.SQLPoolOperationProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for SQLPoolOperation struct.
func (spo *SQLPoolOperation) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var SQLPoolOperationProperties SQLPoolOperationProperties
				err = json.Unmarshal(*v, &SQLPoolOperationProperties)
				if err != nil {
					return err
				}
				spo.SQLPoolOperationProperties = &SQLPoolOperationProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				spo.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				spo.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				spo.Type = &typeVar
			}
		}
	}

	return nil
}

// SQLPoolOperationProperties the properties of a Sql pool operation.
type SQLPoolOperationProperties struct {
	// DatabaseName - READ-ONLY; The name of the Sql pool the operation is being performed on.
	DatabaseName *string `json:"databaseName,omitempty"`
	// Operation - READ-ONLY; The name of operation.
	Operation *string `json:"operation,omitempty"`
	// OperationFriendlyName - READ-ONLY; The friendly name of operation.
	OperationFriendlyName *string `json:"operationFriendlyName,omitempty"`
	// PercentComplete - READ-ONLY; The percentage of the operation completed.
	PercentComplete *int32 `json:"percentComplete,omitempty"`
	// ServerName - READ-ONLY; The name of the server.
	ServerName *string `json:"serverName,omitempty"`
	// StartTime - READ-ONLY; The operation start time.
	StartTime *date.Time `json:"startTime,omitempty"`
	// State - READ-ONLY; The operation state. Possible values include: 'ManagementOperationStatePending', 'ManagementOperationStateInProgress', 'ManagementOperationStateSucceeded', 'ManagementOperationStateFailed', 'ManagementOperationStateCancelInProgress', 'ManagementOperationStateCancelled'
	State ManagementOperationState `json:"state,omitempty"`
	// ErrorCode - READ-ONLY; The operation error code.
	ErrorCode *int32 `json:"errorCode,omitempty"`
	// ErrorDescription - READ-ONLY; The operation error description.
	ErrorDescription *string `json:"errorDescription,omitempty"`
	// ErrorSeverity - READ-ONLY; The operation error severity.
	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
	// IsUserError - READ-ONLY; Whether or not the error is a user error.
	IsUserError *bool `json:"isUserError,omitempty"`
	// EstimatedCompletionTime - READ-ONLY; The estimated completion time of the operation.
	EstimatedCompletionTime *date.Time `json:"estimatedCompletionTime,omitempty"`
	// Description - READ-ONLY; The operation description.
	Description *string `json:"description,omitempty"`
	// IsCancellable - READ-ONLY; Whether the operation can be cancelled.
	IsCancellable *bool `json:"isCancellable,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolOperationProperties.
func (spop SQLPoolOperationProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// SQLPoolPatchInfo a SQL Analytics pool patch info
type SQLPoolPatchInfo struct {
	// Tags - Resource tags.
	Tags map[string]*string `json:"tags"`
	// Location - The geo-location where the resource lives
	Location *string `json:"location,omitempty"`
	// Sku - SQL pool SKU
	Sku *Sku `json:"sku,omitempty"`
	// SQLPoolResourceProperties - SQL pool properties
	*SQLPoolResourceProperties `json:"properties,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolPatchInfo.
func (sppi SQLPoolPatchInfo) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if sppi.Tags != nil {
		objectMap["tags"] = sppi.Tags
	}
	if sppi.Location != nil {
		objectMap["location"] = sppi.Location
	}
	if sppi.Sku != nil {
		objectMap["sku"] = sppi.Sku
	}
	if sppi.SQLPoolResourceProperties != nil {
		objectMap["properties"] = sppi.SQLPoolResourceProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for SQLPoolPatchInfo struct.
func (sppi *SQLPoolPatchInfo) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "tags":
			if v != nil {
				var tags map[string]*string
				err = json.Unmarshal(*v, &tags)
				if err != nil {
					return err
				}
				sppi.Tags = tags
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				sppi.Location = &location
			}
		case "sku":
			if v != nil {
				var sku Sku
				err = json.Unmarshal(*v, &sku)
				if err != nil {
					return err
				}
				sppi.Sku = &sku
			}
		case "properties":
			if v != nil {
				var SQLPoolResourceProperties SQLPoolResourceProperties
				err = json.Unmarshal(*v, &SQLPoolResourceProperties)
				if err != nil {
					return err
				}
				sppi.SQLPoolResourceProperties = &SQLPoolResourceProperties
			}
		}
	}

	return nil
}

// SQLPoolResourceProperties properties of a SQL Analytics pool
type SQLPoolResourceProperties struct {
	// MaxSizeBytes - Maximum size in bytes
	MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"`
	// Collation - Collation mode
	Collation *string `json:"collation,omitempty"`
	// SourceDatabaseID - Source database to create from
	SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"`
	// RecoverableDatabaseID - Backup database to restore from
	RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"`
	// ProvisioningState - Resource state
	ProvisioningState *string `json:"provisioningState,omitempty"`
	// Status - READ-ONLY; Resource status
	Status *string `json:"status,omitempty"`
	// RestorePointInTime - Snapshot time to restore
	RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"`
	// CreateMode - Specifies the mode of sql pool creation.
	// Default: regular sql pool creation.
	// PointInTimeRestore: Creates a sql pool by restoring a point in time backup of an existing sql pool. sourceDatabaseId must be specified as the resource ID of the existing sql pool, and restorePointInTime must be specified.
	// Recovery: Creates a sql pool by a geo-replicated backup. sourceDatabaseId  must be specified as the recoverableDatabaseId to restore.
	// Restore: Creates a sql pool by restoring a backup of a deleted sql  pool. SourceDatabaseId should be the sql pool's original resource ID. SourceDatabaseId and sourceDatabaseDeletionDate must be specified. Possible values include: 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeRecovery', 'CreateModeRestore'
	CreateMode CreateMode `json:"createMode,omitempty"`
	// CreationDate - READ-ONLY; Date the SQL pool was created
	CreationDate *date.Time `json:"creationDate,omitempty"`
	// StorageAccountType - The storage account type used to store backups for this sql pool. Possible values include: 'StorageAccountTypeGRS', 'StorageAccountTypeLRS'
	StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"`
	// SourceDatabaseDeletionDate - Specifies the time that the sql pool was deleted
	SourceDatabaseDeletionDate *date.Time `json:"sourceDatabaseDeletionDate,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolResourceProperties.
func (sprp SQLPoolResourceProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if sprp.MaxSizeBytes != nil {
		objectMap["maxSizeBytes"] = sprp.MaxSizeBytes
	}
	if sprp.Collation != nil {
		objectMap["collation"] = sprp.Collation
	}
	if sprp.SourceDatabaseID != nil {
		objectMap["sourceDatabaseId"] = sprp.SourceDatabaseID
	}
	if sprp.RecoverableDatabaseID != nil {
		objectMap["recoverableDatabaseId"] = sprp.RecoverableDatabaseID
	}
	if sprp.ProvisioningState != nil {
		objectMap["provisioningState"] = sprp.ProvisioningState
	}
	if sprp.RestorePointInTime != nil {
		objectMap["restorePointInTime"] = sprp.RestorePointInTime
	}
	if sprp.CreateMode != "" {
		objectMap["createMode"] = sprp.CreateMode
	}
	if sprp.StorageAccountType != "" {
		objectMap["storageAccountType"] = sprp.StorageAccountType
	}
	if sprp.SourceDatabaseDeletionDate != nil {
		objectMap["sourceDatabaseDeletionDate"] = sprp.SourceDatabaseDeletionDate
	}
	return json.Marshal(objectMap)
}

// SQLPoolRestorePointsCreateFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type SQLPoolRestorePointsCreateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(SQLPoolRestorePointsClient) (RestorePoint, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *SQLPoolRestorePointsCreateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for SQLPoolRestorePointsCreateFuture.Result.
func (future *SQLPoolRestorePointsCreateFuture) result(client SQLPoolRestorePointsClient) (rp RestorePoint, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.SQLPoolRestorePointsCreateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		rp.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.SQLPoolRestorePointsCreateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent {
		rp, err = client.CreateResponder(rp.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.SQLPoolRestorePointsCreateFuture", "Result", rp.Response.Response, "Failure responding to request")
		}
	}
	return
}

// SQLPoolSchema a Sql pool schema resource.
type SQLPoolSchema struct {
	autorest.Response `json:"-"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolSchema.
func (sps SQLPoolSchema) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// SQLPoolSchemaListResult a list of Sql pool schemas.
type SQLPoolSchemaListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]SQLPoolSchema `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolSchemaListResult.
func (spslr SQLPoolSchemaListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// SQLPoolSchemaListResultIterator provides access to a complete listing of SQLPoolSchema values.
type SQLPoolSchemaListResultIterator struct {
	i    int
	page SQLPoolSchemaListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *SQLPoolSchemaListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolSchemaListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *SQLPoolSchemaListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter SQLPoolSchemaListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter SQLPoolSchemaListResultIterator) Response() SQLPoolSchemaListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter SQLPoolSchemaListResultIterator) Value() SQLPoolSchema {
	if !iter.page.NotDone() {
		return SQLPoolSchema{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the SQLPoolSchemaListResultIterator type.
func NewSQLPoolSchemaListResultIterator(page SQLPoolSchemaListResultPage) SQLPoolSchemaListResultIterator {
	return SQLPoolSchemaListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (spslr SQLPoolSchemaListResult) IsEmpty() bool {
	return spslr.Value == nil || len(*spslr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (spslr SQLPoolSchemaListResult) hasNextLink() bool {
	return spslr.NextLink != nil && len(*spslr.NextLink) != 0
}

// sQLPoolSchemaListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (spslr SQLPoolSchemaListResult) sQLPoolSchemaListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !spslr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(spslr.NextLink)))
}

// SQLPoolSchemaListResultPage contains a page of SQLPoolSchema values.
type SQLPoolSchemaListResultPage struct {
	fn    func(context.Context, SQLPoolSchemaListResult) (SQLPoolSchemaListResult, error)
	spslr SQLPoolSchemaListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *SQLPoolSchemaListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolSchemaListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.spslr)
		if err != nil {
			return err
		}
		page.spslr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *SQLPoolSchemaListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page SQLPoolSchemaListResultPage) NotDone() bool {
	return !page.spslr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page SQLPoolSchemaListResultPage) Response() SQLPoolSchemaListResult {
	return page.spslr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page SQLPoolSchemaListResultPage) Values() []SQLPoolSchema {
	if page.spslr.IsEmpty() {
		return nil
	}
	return *page.spslr.Value
}

// Creates a new instance of the SQLPoolSchemaListResultPage type.
func NewSQLPoolSchemaListResultPage(cur SQLPoolSchemaListResult, getNextPage func(context.Context, SQLPoolSchemaListResult) (SQLPoolSchemaListResult, error)) SQLPoolSchemaListResultPage {
	return SQLPoolSchemaListResultPage{
		fn:    getNextPage,
		spslr: cur,
	}
}

// SQLPoolsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type SQLPoolsCreateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(SQLPoolsClient) (SQLPool, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *SQLPoolsCreateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for SQLPoolsCreateFuture.Result.
func (future *SQLPoolsCreateFuture) result(client SQLPoolsClient) (sp SQLPool, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.SQLPoolsCreateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		sp.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.SQLPoolsCreateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if sp.Response.Response, err = future.GetResult(sender); err == nil && sp.Response.Response.StatusCode != http.StatusNoContent {
		sp, err = client.CreateResponder(sp.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.SQLPoolsCreateFuture", "Result", sp.Response.Response, "Failure responding to request")
		}
	}
	return
}

// SQLPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type SQLPoolsDeleteFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(SQLPoolsClient) (SetObject, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *SQLPoolsDeleteFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for SQLPoolsDeleteFuture.Result.
func (future *SQLPoolsDeleteFuture) result(client SQLPoolsClient) (so SetObject, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.SQLPoolsDeleteFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		so.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.SQLPoolsDeleteFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent {
		so, err = client.DeleteResponder(so.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.SQLPoolsDeleteFuture", "Result", so.Response.Response, "Failure responding to request")
		}
	}
	return
}

// SQLPoolSecurityAlertPolicy a Sql pool security alert policy.
type SQLPoolSecurityAlertPolicy struct {
	autorest.Response `json:"-"`
	// SecurityAlertPolicyProperties - Resource properties.
	*SecurityAlertPolicyProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolSecurityAlertPolicy.
func (spsap SQLPoolSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if spsap.SecurityAlertPolicyProperties != nil {
		objectMap["properties"] = spsap.SecurityAlertPolicyProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for SQLPoolSecurityAlertPolicy struct.
func (spsap *SQLPoolSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var securityAlertPolicyProperties SecurityAlertPolicyProperties
				err = json.Unmarshal(*v, &securityAlertPolicyProperties)
				if err != nil {
					return err
				}
				spsap.SecurityAlertPolicyProperties = &securityAlertPolicyProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				spsap.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				spsap.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				spsap.Type = &typeVar
			}
		}
	}

	return nil
}

// SQLPoolsPauseFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type SQLPoolsPauseFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(SQLPoolsClient) (SetObject, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *SQLPoolsPauseFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for SQLPoolsPauseFuture.Result.
func (future *SQLPoolsPauseFuture) result(client SQLPoolsClient) (so SetObject, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.SQLPoolsPauseFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		so.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.SQLPoolsPauseFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent {
		so, err = client.PauseResponder(so.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.SQLPoolsPauseFuture", "Result", so.Response.Response, "Failure responding to request")
		}
	}
	return
}

// SQLPoolsResumeFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type SQLPoolsResumeFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(SQLPoolsClient) (SetObject, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *SQLPoolsResumeFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for SQLPoolsResumeFuture.Result.
func (future *SQLPoolsResumeFuture) result(client SQLPoolsClient) (so SetObject, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.SQLPoolsResumeFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		so.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.SQLPoolsResumeFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent {
		so, err = client.ResumeResponder(so.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.SQLPoolsResumeFuture", "Result", so.Response.Response, "Failure responding to request")
		}
	}
	return
}

// SQLPoolTable a Sql pool table resource.
type SQLPoolTable struct {
	autorest.Response `json:"-"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolTable.
func (spt SQLPoolTable) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// SQLPoolTableListResult a list of Sql pool tables.
type SQLPoolTableListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]SQLPoolTable `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolTableListResult.
func (sptlr SQLPoolTableListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// SQLPoolTableListResultIterator provides access to a complete listing of SQLPoolTable values.
type SQLPoolTableListResultIterator struct {
	i    int
	page SQLPoolTableListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *SQLPoolTableListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolTableListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *SQLPoolTableListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter SQLPoolTableListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter SQLPoolTableListResultIterator) Response() SQLPoolTableListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter SQLPoolTableListResultIterator) Value() SQLPoolTable {
	if !iter.page.NotDone() {
		return SQLPoolTable{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the SQLPoolTableListResultIterator type.
func NewSQLPoolTableListResultIterator(page SQLPoolTableListResultPage) SQLPoolTableListResultIterator {
	return SQLPoolTableListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (sptlr SQLPoolTableListResult) IsEmpty() bool {
	return sptlr.Value == nil || len(*sptlr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (sptlr SQLPoolTableListResult) hasNextLink() bool {
	return sptlr.NextLink != nil && len(*sptlr.NextLink) != 0
}

// sQLPoolTableListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (sptlr SQLPoolTableListResult) sQLPoolTableListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !sptlr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(sptlr.NextLink)))
}

// SQLPoolTableListResultPage contains a page of SQLPoolTable values.
type SQLPoolTableListResultPage struct {
	fn    func(context.Context, SQLPoolTableListResult) (SQLPoolTableListResult, error)
	sptlr SQLPoolTableListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *SQLPoolTableListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolTableListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.sptlr)
		if err != nil {
			return err
		}
		page.sptlr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *SQLPoolTableListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page SQLPoolTableListResultPage) NotDone() bool {
	return !page.sptlr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page SQLPoolTableListResultPage) Response() SQLPoolTableListResult {
	return page.sptlr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page SQLPoolTableListResultPage) Values() []SQLPoolTable {
	if page.sptlr.IsEmpty() {
		return nil
	}
	return *page.sptlr.Value
}

// Creates a new instance of the SQLPoolTableListResultPage type.
func NewSQLPoolTableListResultPage(cur SQLPoolTableListResult, getNextPage func(context.Context, SQLPoolTableListResult) (SQLPoolTableListResult, error)) SQLPoolTableListResultPage {
	return SQLPoolTableListResultPage{
		fn:    getNextPage,
		sptlr: cur,
	}
}

// SQLPoolUsage the Sql pool usages.
type SQLPoolUsage struct {
	// Name - READ-ONLY; The name of the usage metric.
	Name *string `json:"name,omitempty"`
	// ResourceName - READ-ONLY; The name of the resource.
	ResourceName *string `json:"resourceName,omitempty"`
	// DisplayName - READ-ONLY; The usage metric display name.
	DisplayName *string `json:"displayName,omitempty"`
	// CurrentValue - READ-ONLY; The current value of the usage metric.
	CurrentValue *float64 `json:"currentValue,omitempty"`
	// Limit - READ-ONLY; The current limit of the usage metric.
	Limit *float64 `json:"limit,omitempty"`
	// Unit - READ-ONLY; The units of the usage metric.
	Unit *string `json:"unit,omitempty"`
	// NextResetTime - READ-ONLY; The next reset time for the usage metric (ISO8601 format).
	NextResetTime *date.Time `json:"nextResetTime,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolUsage.
func (spu SQLPoolUsage) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// SQLPoolUsageListResult the response to a list Sql pool usages request.
type SQLPoolUsageListResult struct {
	autorest.Response `json:"-"`
	// Value - The list of usages for the Sql pool.
	Value *[]SQLPoolUsage `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolUsageListResult.
func (spulr SQLPoolUsageListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if spulr.Value != nil {
		objectMap["value"] = spulr.Value
	}
	return json.Marshal(objectMap)
}

// SQLPoolUsageListResultIterator provides access to a complete listing of SQLPoolUsage values.
type SQLPoolUsageListResultIterator struct {
	i    int
	page SQLPoolUsageListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *SQLPoolUsageListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolUsageListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *SQLPoolUsageListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter SQLPoolUsageListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter SQLPoolUsageListResultIterator) Response() SQLPoolUsageListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter SQLPoolUsageListResultIterator) Value() SQLPoolUsage {
	if !iter.page.NotDone() {
		return SQLPoolUsage{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the SQLPoolUsageListResultIterator type.
func NewSQLPoolUsageListResultIterator(page SQLPoolUsageListResultPage) SQLPoolUsageListResultIterator {
	return SQLPoolUsageListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (spulr SQLPoolUsageListResult) IsEmpty() bool {
	return spulr.Value == nil || len(*spulr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (spulr SQLPoolUsageListResult) hasNextLink() bool {
	return spulr.NextLink != nil && len(*spulr.NextLink) != 0
}

// sQLPoolUsageListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (spulr SQLPoolUsageListResult) sQLPoolUsageListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !spulr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(spulr.NextLink)))
}

// SQLPoolUsageListResultPage contains a page of SQLPoolUsage values.
type SQLPoolUsageListResultPage struct {
	fn    func(context.Context, SQLPoolUsageListResult) (SQLPoolUsageListResult, error)
	spulr SQLPoolUsageListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *SQLPoolUsageListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolUsageListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.spulr)
		if err != nil {
			return err
		}
		page.spulr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *SQLPoolUsageListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page SQLPoolUsageListResultPage) NotDone() bool {
	return !page.spulr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page SQLPoolUsageListResultPage) Response() SQLPoolUsageListResult {
	return page.spulr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page SQLPoolUsageListResultPage) Values() []SQLPoolUsage {
	if page.spulr.IsEmpty() {
		return nil
	}
	return *page.spulr.Value
}

// Creates a new instance of the SQLPoolUsageListResultPage type.
func NewSQLPoolUsageListResultPage(cur SQLPoolUsageListResult, getNextPage func(context.Context, SQLPoolUsageListResult) (SQLPoolUsageListResult, error)) SQLPoolUsageListResultPage {
	return SQLPoolUsageListResultPage{
		fn:    getNextPage,
		spulr: cur,
	}
}

// SQLPoolVulnerabilityAssessment a Sql pool vulnerability assessment.
type SQLPoolVulnerabilityAssessment struct {
	autorest.Response `json:"-"`
	// SQLPoolVulnerabilityAssessmentProperties - Resource properties.
	*SQLPoolVulnerabilityAssessmentProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolVulnerabilityAssessment.
func (spva SQLPoolVulnerabilityAssessment) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if spva.SQLPoolVulnerabilityAssessmentProperties != nil {
		objectMap["properties"] = spva.SQLPoolVulnerabilityAssessmentProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for SQLPoolVulnerabilityAssessment struct.
func (spva *SQLPoolVulnerabilityAssessment) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var SQLPoolVulnerabilityAssessmentProperties SQLPoolVulnerabilityAssessmentProperties
				err = json.Unmarshal(*v, &SQLPoolVulnerabilityAssessmentProperties)
				if err != nil {
					return err
				}
				spva.SQLPoolVulnerabilityAssessmentProperties = &SQLPoolVulnerabilityAssessmentProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				spva.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				spva.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				spva.Type = &typeVar
			}
		}
	}

	return nil
}

// SQLPoolVulnerabilityAssessmentListResult a list of the Sql pool's vulnerability assessments.
type SQLPoolVulnerabilityAssessmentListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]SQLPoolVulnerabilityAssessment `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolVulnerabilityAssessmentListResult.
func (spvalr SQLPoolVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// SQLPoolVulnerabilityAssessmentListResultIterator provides access to a complete listing of
// SQLPoolVulnerabilityAssessment values.
type SQLPoolVulnerabilityAssessmentListResultIterator struct {
	i    int
	page SQLPoolVulnerabilityAssessmentListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *SQLPoolVulnerabilityAssessmentListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolVulnerabilityAssessmentListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *SQLPoolVulnerabilityAssessmentListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter SQLPoolVulnerabilityAssessmentListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter SQLPoolVulnerabilityAssessmentListResultIterator) Response() SQLPoolVulnerabilityAssessmentListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter SQLPoolVulnerabilityAssessmentListResultIterator) Value() SQLPoolVulnerabilityAssessment {
	if !iter.page.NotDone() {
		return SQLPoolVulnerabilityAssessment{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the SQLPoolVulnerabilityAssessmentListResultIterator type.
func NewSQLPoolVulnerabilityAssessmentListResultIterator(page SQLPoolVulnerabilityAssessmentListResultPage) SQLPoolVulnerabilityAssessmentListResultIterator {
	return SQLPoolVulnerabilityAssessmentListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (spvalr SQLPoolVulnerabilityAssessmentListResult) IsEmpty() bool {
	return spvalr.Value == nil || len(*spvalr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (spvalr SQLPoolVulnerabilityAssessmentListResult) hasNextLink() bool {
	return spvalr.NextLink != nil && len(*spvalr.NextLink) != 0
}

// sQLPoolVulnerabilityAssessmentListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (spvalr SQLPoolVulnerabilityAssessmentListResult) sQLPoolVulnerabilityAssessmentListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !spvalr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(spvalr.NextLink)))
}

// SQLPoolVulnerabilityAssessmentListResultPage contains a page of SQLPoolVulnerabilityAssessment values.
type SQLPoolVulnerabilityAssessmentListResultPage struct {
	fn     func(context.Context, SQLPoolVulnerabilityAssessmentListResult) (SQLPoolVulnerabilityAssessmentListResult, error)
	spvalr SQLPoolVulnerabilityAssessmentListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *SQLPoolVulnerabilityAssessmentListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolVulnerabilityAssessmentListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.spvalr)
		if err != nil {
			return err
		}
		page.spvalr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *SQLPoolVulnerabilityAssessmentListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page SQLPoolVulnerabilityAssessmentListResultPage) NotDone() bool {
	return !page.spvalr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page SQLPoolVulnerabilityAssessmentListResultPage) Response() SQLPoolVulnerabilityAssessmentListResult {
	return page.spvalr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page SQLPoolVulnerabilityAssessmentListResultPage) Values() []SQLPoolVulnerabilityAssessment {
	if page.spvalr.IsEmpty() {
		return nil
	}
	return *page.spvalr.Value
}

// Creates a new instance of the SQLPoolVulnerabilityAssessmentListResultPage type.
func NewSQLPoolVulnerabilityAssessmentListResultPage(cur SQLPoolVulnerabilityAssessmentListResult, getNextPage func(context.Context, SQLPoolVulnerabilityAssessmentListResult) (SQLPoolVulnerabilityAssessmentListResult, error)) SQLPoolVulnerabilityAssessmentListResultPage {
	return SQLPoolVulnerabilityAssessmentListResultPage{
		fn:     getNextPage,
		spvalr: cur,
	}
}

// SQLPoolVulnerabilityAssessmentProperties properties of a Sql pool Vulnerability Assessment.
type SQLPoolVulnerabilityAssessmentProperties struct {
	// StorageContainerPath - A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/).  It is required if server level vulnerability assessment policy doesn't set
	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
	// StorageContainerSasKey - A shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required.
	StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"`
	// StorageAccountAccessKey - Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
	// RecurringScans - The recurring scans settings
	RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"`
}

// SQLPoolVulnerabilityAssessmentRuleBaseline a Sql pool vulnerability assessment rule baseline.
type SQLPoolVulnerabilityAssessmentRuleBaseline struct {
	autorest.Response `json:"-"`
	// SQLPoolVulnerabilityAssessmentRuleBaselineProperties - Resource properties.
	*SQLPoolVulnerabilityAssessmentRuleBaselineProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolVulnerabilityAssessmentRuleBaseline.
func (spvarb SQLPoolVulnerabilityAssessmentRuleBaseline) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if spvarb.SQLPoolVulnerabilityAssessmentRuleBaselineProperties != nil {
		objectMap["properties"] = spvarb.SQLPoolVulnerabilityAssessmentRuleBaselineProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for SQLPoolVulnerabilityAssessmentRuleBaseline struct.
func (spvarb *SQLPoolVulnerabilityAssessmentRuleBaseline) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var SQLPoolVulnerabilityAssessmentRuleBaselineProperties SQLPoolVulnerabilityAssessmentRuleBaselineProperties
				err = json.Unmarshal(*v, &SQLPoolVulnerabilityAssessmentRuleBaselineProperties)
				if err != nil {
					return err
				}
				spvarb.SQLPoolVulnerabilityAssessmentRuleBaselineProperties = &SQLPoolVulnerabilityAssessmentRuleBaselineProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				spvarb.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				spvarb.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				spvarb.Type = &typeVar
			}
		}
	}

	return nil
}

// SQLPoolVulnerabilityAssessmentRuleBaselineItem properties for an Sql pool vulnerability assessment rule
// baseline's result.
type SQLPoolVulnerabilityAssessmentRuleBaselineItem struct {
	// Result - The rule baseline result
	Result *[]string `json:"result,omitempty"`
}

// SQLPoolVulnerabilityAssessmentRuleBaselineProperties properties of a Sql pool vulnerability assessment
// rule baseline.
type SQLPoolVulnerabilityAssessmentRuleBaselineProperties struct {
	// BaselineResults - The rule baseline result
	BaselineResults *[]SQLPoolVulnerabilityAssessmentRuleBaselineItem `json:"baselineResults,omitempty"`
}

// SQLPoolVulnerabilityAssessmentScanExportProperties properties of the export operation's result.
type SQLPoolVulnerabilityAssessmentScanExportProperties struct {
	// ExportedReportLocation - READ-ONLY; Location of the exported report (e.g. https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx).
	ExportedReportLocation *string `json:"exportedReportLocation,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolVulnerabilityAssessmentScanExportProperties.
func (spvasep SQLPoolVulnerabilityAssessmentScanExportProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// SQLPoolVulnerabilityAssessmentScansExport a Sql pool Vulnerability Assessment scan export resource.
type SQLPoolVulnerabilityAssessmentScansExport struct {
	autorest.Response `json:"-"`
	// SQLPoolVulnerabilityAssessmentScanExportProperties - Resource properties.
	*SQLPoolVulnerabilityAssessmentScanExportProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SQLPoolVulnerabilityAssessmentScansExport.
func (spvase SQLPoolVulnerabilityAssessmentScansExport) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if spvase.SQLPoolVulnerabilityAssessmentScanExportProperties != nil {
		objectMap["properties"] = spvase.SQLPoolVulnerabilityAssessmentScanExportProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for SQLPoolVulnerabilityAssessmentScansExport struct.
func (spvase *SQLPoolVulnerabilityAssessmentScansExport) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var SQLPoolVulnerabilityAssessmentScanExportProperties SQLPoolVulnerabilityAssessmentScanExportProperties
				err = json.Unmarshal(*v, &SQLPoolVulnerabilityAssessmentScanExportProperties)
				if err != nil {
					return err
				}
				spvase.SQLPoolVulnerabilityAssessmentScanExportProperties = &SQLPoolVulnerabilityAssessmentScanExportProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				spvase.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				spvase.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				spvase.Type = &typeVar
			}
		}
	}

	return nil
}

// SQLPoolVulnerabilityAssessmentScansInitiateScanFuture an abstraction for monitoring and retrieving the
// results of a long-running operation.
type SQLPoolVulnerabilityAssessmentScansInitiateScanFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(SQLPoolVulnerabilityAssessmentScansClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *SQLPoolVulnerabilityAssessmentScansInitiateScanFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for SQLPoolVulnerabilityAssessmentScansInitiateScanFuture.Result.
func (future *SQLPoolVulnerabilityAssessmentScansInitiateScanFuture) result(client SQLPoolVulnerabilityAssessmentScansClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.SQLPoolVulnerabilityAssessmentScansInitiateScanFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.SQLPoolVulnerabilityAssessmentScansInitiateScanFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// SQLPoolWorkloadClassifierCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
// of a long-running operation.
type SQLPoolWorkloadClassifierCreateOrUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(SQLPoolWorkloadClassifierClient) (WorkloadClassifier, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *SQLPoolWorkloadClassifierCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for SQLPoolWorkloadClassifierCreateOrUpdateFuture.Result.
func (future *SQLPoolWorkloadClassifierCreateOrUpdateFuture) result(client SQLPoolWorkloadClassifierClient) (wc WorkloadClassifier, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadClassifierCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		wc.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.SQLPoolWorkloadClassifierCreateOrUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if wc.Response.Response, err = future.GetResult(sender); err == nil && wc.Response.Response.StatusCode != http.StatusNoContent {
		wc, err = client.CreateOrUpdateResponder(wc.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadClassifierCreateOrUpdateFuture", "Result", wc.Response.Response, "Failure responding to request")
		}
	}
	return
}

// SQLPoolWorkloadClassifierDeleteFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type SQLPoolWorkloadClassifierDeleteFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(SQLPoolWorkloadClassifierClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *SQLPoolWorkloadClassifierDeleteFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for SQLPoolWorkloadClassifierDeleteFuture.Result.
func (future *SQLPoolWorkloadClassifierDeleteFuture) result(client SQLPoolWorkloadClassifierClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadClassifierDeleteFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.SQLPoolWorkloadClassifierDeleteFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// SQLPoolWorkloadGroupCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type SQLPoolWorkloadGroupCreateOrUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(SQLPoolWorkloadGroupClient) (WorkloadGroup, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *SQLPoolWorkloadGroupCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for SQLPoolWorkloadGroupCreateOrUpdateFuture.Result.
func (future *SQLPoolWorkloadGroupCreateOrUpdateFuture) result(client SQLPoolWorkloadGroupClient) (wg WorkloadGroup, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadGroupCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		wg.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.SQLPoolWorkloadGroupCreateOrUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if wg.Response.Response, err = future.GetResult(sender); err == nil && wg.Response.Response.StatusCode != http.StatusNoContent {
		wg, err = client.CreateOrUpdateResponder(wg.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadGroupCreateOrUpdateFuture", "Result", wg.Response.Response, "Failure responding to request")
		}
	}
	return
}

// SQLPoolWorkloadGroupDeleteFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type SQLPoolWorkloadGroupDeleteFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(SQLPoolWorkloadGroupClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *SQLPoolWorkloadGroupDeleteFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for SQLPoolWorkloadGroupDeleteFuture.Result.
func (future *SQLPoolWorkloadGroupDeleteFuture) result(client SQLPoolWorkloadGroupClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.SQLPoolWorkloadGroupDeleteFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.SQLPoolWorkloadGroupDeleteFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// SsisEnvironment ssis environment.
type SsisEnvironment struct {
	// FolderID - Folder id which contains environment.
	FolderID *int64 `json:"folderId,omitempty"`
	// Variables - Variable in environment
	Variables *[]SsisVariable `json:"variables,omitempty"`
	// ID - Metadata id.
	ID *int64 `json:"id,omitempty"`
	// Name - Metadata name.
	Name *string `json:"name,omitempty"`
	// Description - Metadata description.
	Description *string `json:"description,omitempty"`
	// Type - Possible values include: 'TypeBasicSsisObjectMetadataTypeSsisObjectMetadata', 'TypeBasicSsisObjectMetadataTypeFolder', 'TypeBasicSsisObjectMetadataTypeProject', 'TypeBasicSsisObjectMetadataTypePackage', 'TypeBasicSsisObjectMetadataTypeEnvironment'
	Type TypeBasicSsisObjectMetadata `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SsisEnvironment.
func (se SsisEnvironment) MarshalJSON() ([]byte, error) {
	se.Type = TypeBasicSsisObjectMetadataTypeEnvironment
	objectMap := make(map[string]interface{})
	if se.FolderID != nil {
		objectMap["folderId"] = se.FolderID
	}
	if se.Variables != nil {
		objectMap["variables"] = se.Variables
	}
	if se.ID != nil {
		objectMap["id"] = se.ID
	}
	if se.Name != nil {
		objectMap["name"] = se.Name
	}
	if se.Description != nil {
		objectMap["description"] = se.Description
	}
	if se.Type != "" {
		objectMap["type"] = se.Type
	}
	return json.Marshal(objectMap)
}

// AsSsisFolder is the BasicSsisObjectMetadata implementation for SsisEnvironment.
func (se SsisEnvironment) AsSsisFolder() (*SsisFolder, bool) {
	return nil, false
}

// AsSsisProject is the BasicSsisObjectMetadata implementation for SsisEnvironment.
func (se SsisEnvironment) AsSsisProject() (*SsisProject, bool) {
	return nil, false
}

// AsSsisPackage is the BasicSsisObjectMetadata implementation for SsisEnvironment.
func (se SsisEnvironment) AsSsisPackage() (*SsisPackage, bool) {
	return nil, false
}

// AsSsisEnvironment is the BasicSsisObjectMetadata implementation for SsisEnvironment.
func (se SsisEnvironment) AsSsisEnvironment() (*SsisEnvironment, bool) {
	return &se, true
}

// AsSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisEnvironment.
func (se SsisEnvironment) AsSsisObjectMetadata() (*SsisObjectMetadata, bool) {
	return nil, false
}

// AsBasicSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisEnvironment.
func (se SsisEnvironment) AsBasicSsisObjectMetadata() (BasicSsisObjectMetadata, bool) {
	return &se, true
}

// SsisEnvironmentReference ssis environment reference.
type SsisEnvironmentReference struct {
	// ID - Environment reference id.
	ID *int64 `json:"id,omitempty"`
	// EnvironmentFolderName - Environment folder name.
	EnvironmentFolderName *string `json:"environmentFolderName,omitempty"`
	// EnvironmentName - Environment name.
	EnvironmentName *string `json:"environmentName,omitempty"`
	// ReferenceType - Reference type
	ReferenceType *string `json:"referenceType,omitempty"`
}

// SsisFolder ssis folder.
type SsisFolder struct {
	// ID - Metadata id.
	ID *int64 `json:"id,omitempty"`
	// Name - Metadata name.
	Name *string `json:"name,omitempty"`
	// Description - Metadata description.
	Description *string `json:"description,omitempty"`
	// Type - Possible values include: 'TypeBasicSsisObjectMetadataTypeSsisObjectMetadata', 'TypeBasicSsisObjectMetadataTypeFolder', 'TypeBasicSsisObjectMetadataTypeProject', 'TypeBasicSsisObjectMetadataTypePackage', 'TypeBasicSsisObjectMetadataTypeEnvironment'
	Type TypeBasicSsisObjectMetadata `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SsisFolder.
func (sf SsisFolder) MarshalJSON() ([]byte, error) {
	sf.Type = TypeBasicSsisObjectMetadataTypeFolder
	objectMap := make(map[string]interface{})
	if sf.ID != nil {
		objectMap["id"] = sf.ID
	}
	if sf.Name != nil {
		objectMap["name"] = sf.Name
	}
	if sf.Description != nil {
		objectMap["description"] = sf.Description
	}
	if sf.Type != "" {
		objectMap["type"] = sf.Type
	}
	return json.Marshal(objectMap)
}

// AsSsisFolder is the BasicSsisObjectMetadata implementation for SsisFolder.
func (sf SsisFolder) AsSsisFolder() (*SsisFolder, bool) {
	return &sf, true
}

// AsSsisProject is the BasicSsisObjectMetadata implementation for SsisFolder.
func (sf SsisFolder) AsSsisProject() (*SsisProject, bool) {
	return nil, false
}

// AsSsisPackage is the BasicSsisObjectMetadata implementation for SsisFolder.
func (sf SsisFolder) AsSsisPackage() (*SsisPackage, bool) {
	return nil, false
}

// AsSsisEnvironment is the BasicSsisObjectMetadata implementation for SsisFolder.
func (sf SsisFolder) AsSsisEnvironment() (*SsisEnvironment, bool) {
	return nil, false
}

// AsSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisFolder.
func (sf SsisFolder) AsSsisObjectMetadata() (*SsisObjectMetadata, bool) {
	return nil, false
}

// AsBasicSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisFolder.
func (sf SsisFolder) AsBasicSsisObjectMetadata() (BasicSsisObjectMetadata, bool) {
	return &sf, true
}

// BasicSsisObjectMetadata SSIS object metadata.
type BasicSsisObjectMetadata interface {
	AsSsisFolder() (*SsisFolder, bool)
	AsSsisProject() (*SsisProject, bool)
	AsSsisPackage() (*SsisPackage, bool)
	AsSsisEnvironment() (*SsisEnvironment, bool)
	AsSsisObjectMetadata() (*SsisObjectMetadata, bool)
}

// SsisObjectMetadata SSIS object metadata.
type SsisObjectMetadata struct {
	// ID - Metadata id.
	ID *int64 `json:"id,omitempty"`
	// Name - Metadata name.
	Name *string `json:"name,omitempty"`
	// Description - Metadata description.
	Description *string `json:"description,omitempty"`
	// Type - Possible values include: 'TypeBasicSsisObjectMetadataTypeSsisObjectMetadata', 'TypeBasicSsisObjectMetadataTypeFolder', 'TypeBasicSsisObjectMetadataTypeProject', 'TypeBasicSsisObjectMetadataTypePackage', 'TypeBasicSsisObjectMetadataTypeEnvironment'
	Type TypeBasicSsisObjectMetadata `json:"type,omitempty"`
}

func unmarshalBasicSsisObjectMetadata(body []byte) (BasicSsisObjectMetadata, error) {
	var m map[string]interface{}
	err := json.Unmarshal(body, &m)
	if err != nil {
		return nil, err
	}

	switch m["type"] {
	case string(TypeBasicSsisObjectMetadataTypeFolder):
		var sf SsisFolder
		err := json.Unmarshal(body, &sf)
		return sf, err
	case string(TypeBasicSsisObjectMetadataTypeProject):
		var sp SsisProject
		err := json.Unmarshal(body, &sp)
		return sp, err
	case string(TypeBasicSsisObjectMetadataTypePackage):
		var sp SsisPackage
		err := json.Unmarshal(body, &sp)
		return sp, err
	case string(TypeBasicSsisObjectMetadataTypeEnvironment):
		var se SsisEnvironment
		err := json.Unmarshal(body, &se)
		return se, err
	default:
		var som SsisObjectMetadata
		err := json.Unmarshal(body, &som)
		return som, err
	}
}
func unmarshalBasicSsisObjectMetadataArray(body []byte) ([]BasicSsisObjectMetadata, error) {
	var rawMessages []*json.RawMessage
	err := json.Unmarshal(body, &rawMessages)
	if err != nil {
		return nil, err
	}

	somArray := make([]BasicSsisObjectMetadata, len(rawMessages))

	for index, rawMessage := range rawMessages {
		som, err := unmarshalBasicSsisObjectMetadata(*rawMessage)
		if err != nil {
			return nil, err
		}
		somArray[index] = som
	}
	return somArray, nil
}

// MarshalJSON is the custom marshaler for SsisObjectMetadata.
func (som SsisObjectMetadata) MarshalJSON() ([]byte, error) {
	som.Type = TypeBasicSsisObjectMetadataTypeSsisObjectMetadata
	objectMap := make(map[string]interface{})
	if som.ID != nil {
		objectMap["id"] = som.ID
	}
	if som.Name != nil {
		objectMap["name"] = som.Name
	}
	if som.Description != nil {
		objectMap["description"] = som.Description
	}
	if som.Type != "" {
		objectMap["type"] = som.Type
	}
	return json.Marshal(objectMap)
}

// AsSsisFolder is the BasicSsisObjectMetadata implementation for SsisObjectMetadata.
func (som SsisObjectMetadata) AsSsisFolder() (*SsisFolder, bool) {
	return nil, false
}

// AsSsisProject is the BasicSsisObjectMetadata implementation for SsisObjectMetadata.
func (som SsisObjectMetadata) AsSsisProject() (*SsisProject, bool) {
	return nil, false
}

// AsSsisPackage is the BasicSsisObjectMetadata implementation for SsisObjectMetadata.
func (som SsisObjectMetadata) AsSsisPackage() (*SsisPackage, bool) {
	return nil, false
}

// AsSsisEnvironment is the BasicSsisObjectMetadata implementation for SsisObjectMetadata.
func (som SsisObjectMetadata) AsSsisEnvironment() (*SsisEnvironment, bool) {
	return nil, false
}

// AsSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisObjectMetadata.
func (som SsisObjectMetadata) AsSsisObjectMetadata() (*SsisObjectMetadata, bool) {
	return &som, true
}

// AsBasicSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisObjectMetadata.
func (som SsisObjectMetadata) AsBasicSsisObjectMetadata() (BasicSsisObjectMetadata, bool) {
	return &som, true
}

// SsisObjectMetadataListResponse a list of SSIS object metadata.
type SsisObjectMetadataListResponse struct {
	autorest.Response `json:"-"`
	// Value - List of SSIS object metadata.
	Value *[]BasicSsisObjectMetadata `json:"value,omitempty"`
	// NextLink - The link to the next page of results, if any remaining results exist.
	NextLink *string `json:"nextLink,omitempty"`
}

// UnmarshalJSON is the custom unmarshaler for SsisObjectMetadataListResponse struct.
func (somlr *SsisObjectMetadataListResponse) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "value":
			if v != nil {
				value, err := unmarshalBasicSsisObjectMetadataArray(*v)
				if err != nil {
					return err
				}
				somlr.Value = &value
			}
		case "nextLink":
			if v != nil {
				var nextLink string
				err = json.Unmarshal(*v, &nextLink)
				if err != nil {
					return err
				}
				somlr.NextLink = &nextLink
			}
		}
	}

	return nil
}

// SsisObjectMetadataStatusResponse the status of the operation.
type SsisObjectMetadataStatusResponse struct {
	autorest.Response `json:"-"`
	// Status - The status of the operation.
	Status *string `json:"status,omitempty"`
	// Name - The operation name.
	Name *string `json:"name,omitempty"`
	// Properties - The operation properties.
	Properties *string `json:"properties,omitempty"`
	// Error - The operation error message.
	Error *string `json:"error,omitempty"`
}

// SsisPackage ssis Package.
type SsisPackage struct {
	// FolderID - Folder id which contains package.
	FolderID *int64 `json:"folderId,omitempty"`
	// ProjectVersion - Project version which contains package.
	ProjectVersion *int64 `json:"projectVersion,omitempty"`
	// ProjectID - Project id which contains package.
	ProjectID *int64 `json:"projectId,omitempty"`
	// Parameters - Parameters in package
	Parameters *[]SsisParameter `json:"parameters,omitempty"`
	// ID - Metadata id.
	ID *int64 `json:"id,omitempty"`
	// Name - Metadata name.
	Name *string `json:"name,omitempty"`
	// Description - Metadata description.
	Description *string `json:"description,omitempty"`
	// Type - Possible values include: 'TypeBasicSsisObjectMetadataTypeSsisObjectMetadata', 'TypeBasicSsisObjectMetadataTypeFolder', 'TypeBasicSsisObjectMetadataTypeProject', 'TypeBasicSsisObjectMetadataTypePackage', 'TypeBasicSsisObjectMetadataTypeEnvironment'
	Type TypeBasicSsisObjectMetadata `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SsisPackage.
func (sp SsisPackage) MarshalJSON() ([]byte, error) {
	sp.Type = TypeBasicSsisObjectMetadataTypePackage
	objectMap := make(map[string]interface{})
	if sp.FolderID != nil {
		objectMap["folderId"] = sp.FolderID
	}
	if sp.ProjectVersion != nil {
		objectMap["projectVersion"] = sp.ProjectVersion
	}
	if sp.ProjectID != nil {
		objectMap["projectId"] = sp.ProjectID
	}
	if sp.Parameters != nil {
		objectMap["parameters"] = sp.Parameters
	}
	if sp.ID != nil {
		objectMap["id"] = sp.ID
	}
	if sp.Name != nil {
		objectMap["name"] = sp.Name
	}
	if sp.Description != nil {
		objectMap["description"] = sp.Description
	}
	if sp.Type != "" {
		objectMap["type"] = sp.Type
	}
	return json.Marshal(objectMap)
}

// AsSsisFolder is the BasicSsisObjectMetadata implementation for SsisPackage.
func (sp SsisPackage) AsSsisFolder() (*SsisFolder, bool) {
	return nil, false
}

// AsSsisProject is the BasicSsisObjectMetadata implementation for SsisPackage.
func (sp SsisPackage) AsSsisProject() (*SsisProject, bool) {
	return nil, false
}

// AsSsisPackage is the BasicSsisObjectMetadata implementation for SsisPackage.
func (sp SsisPackage) AsSsisPackage() (*SsisPackage, bool) {
	return &sp, true
}

// AsSsisEnvironment is the BasicSsisObjectMetadata implementation for SsisPackage.
func (sp SsisPackage) AsSsisEnvironment() (*SsisEnvironment, bool) {
	return nil, false
}

// AsSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisPackage.
func (sp SsisPackage) AsSsisObjectMetadata() (*SsisObjectMetadata, bool) {
	return nil, false
}

// AsBasicSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisPackage.
func (sp SsisPackage) AsBasicSsisObjectMetadata() (BasicSsisObjectMetadata, bool) {
	return &sp, true
}

// SsisParameter ssis parameter.
type SsisParameter struct {
	// ID - Parameter id.
	ID *int64 `json:"id,omitempty"`
	// Name - Parameter name.
	Name *string `json:"name,omitempty"`
	// Description - Parameter description.
	Description *string `json:"description,omitempty"`
	// DataType - Parameter type.
	DataType *string `json:"dataType,omitempty"`
	// Required - Whether parameter is required.
	Required *bool `json:"required,omitempty"`
	// Sensitive - Whether parameter is sensitive.
	Sensitive *bool `json:"sensitive,omitempty"`
	// DesignDefaultValue - Design default value of parameter.
	DesignDefaultValue *string `json:"designDefaultValue,omitempty"`
	// DefaultValue - Default value of parameter.
	DefaultValue *string `json:"defaultValue,omitempty"`
	// SensitiveDefaultValue - Default sensitive value of parameter.
	SensitiveDefaultValue *string `json:"sensitiveDefaultValue,omitempty"`
	// ValueType - Parameter value type.
	ValueType *string `json:"valueType,omitempty"`
	// ValueSet - Parameter value set.
	ValueSet *bool `json:"valueSet,omitempty"`
	// Variable - Parameter reference variable.
	Variable *string `json:"variable,omitempty"`
}

// SsisProject ssis project.
type SsisProject struct {
	// FolderID - Folder id which contains project.
	FolderID *int64 `json:"folderId,omitempty"`
	// Version - Project version.
	Version *int64 `json:"version,omitempty"`
	// EnvironmentRefs - Environment reference in project
	EnvironmentRefs *[]SsisEnvironmentReference `json:"environmentRefs,omitempty"`
	// Parameters - Parameters in project
	Parameters *[]SsisParameter `json:"parameters,omitempty"`
	// ID - Metadata id.
	ID *int64 `json:"id,omitempty"`
	// Name - Metadata name.
	Name *string `json:"name,omitempty"`
	// Description - Metadata description.
	Description *string `json:"description,omitempty"`
	// Type - Possible values include: 'TypeBasicSsisObjectMetadataTypeSsisObjectMetadata', 'TypeBasicSsisObjectMetadataTypeFolder', 'TypeBasicSsisObjectMetadataTypeProject', 'TypeBasicSsisObjectMetadataTypePackage', 'TypeBasicSsisObjectMetadataTypeEnvironment'
	Type TypeBasicSsisObjectMetadata `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SsisProject.
func (sp SsisProject) MarshalJSON() ([]byte, error) {
	sp.Type = TypeBasicSsisObjectMetadataTypeProject
	objectMap := make(map[string]interface{})
	if sp.FolderID != nil {
		objectMap["folderId"] = sp.FolderID
	}
	if sp.Version != nil {
		objectMap["version"] = sp.Version
	}
	if sp.EnvironmentRefs != nil {
		objectMap["environmentRefs"] = sp.EnvironmentRefs
	}
	if sp.Parameters != nil {
		objectMap["parameters"] = sp.Parameters
	}
	if sp.ID != nil {
		objectMap["id"] = sp.ID
	}
	if sp.Name != nil {
		objectMap["name"] = sp.Name
	}
	if sp.Description != nil {
		objectMap["description"] = sp.Description
	}
	if sp.Type != "" {
		objectMap["type"] = sp.Type
	}
	return json.Marshal(objectMap)
}

// AsSsisFolder is the BasicSsisObjectMetadata implementation for SsisProject.
func (sp SsisProject) AsSsisFolder() (*SsisFolder, bool) {
	return nil, false
}

// AsSsisProject is the BasicSsisObjectMetadata implementation for SsisProject.
func (sp SsisProject) AsSsisProject() (*SsisProject, bool) {
	return &sp, true
}

// AsSsisPackage is the BasicSsisObjectMetadata implementation for SsisProject.
func (sp SsisProject) AsSsisPackage() (*SsisPackage, bool) {
	return nil, false
}

// AsSsisEnvironment is the BasicSsisObjectMetadata implementation for SsisProject.
func (sp SsisProject) AsSsisEnvironment() (*SsisEnvironment, bool) {
	return nil, false
}

// AsSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisProject.
func (sp SsisProject) AsSsisObjectMetadata() (*SsisObjectMetadata, bool) {
	return nil, false
}

// AsBasicSsisObjectMetadata is the BasicSsisObjectMetadata implementation for SsisProject.
func (sp SsisProject) AsBasicSsisObjectMetadata() (BasicSsisObjectMetadata, bool) {
	return &sp, true
}

// SsisVariable ssis variable.
type SsisVariable struct {
	// ID - Variable id.
	ID *int64 `json:"id,omitempty"`
	// Name - Variable name.
	Name *string `json:"name,omitempty"`
	// Description - Variable description.
	Description *string `json:"description,omitempty"`
	// DataType - Variable type.
	DataType *string `json:"dataType,omitempty"`
	// Sensitive - Whether variable is sensitive.
	Sensitive *bool `json:"sensitive,omitempty"`
	// Value - Variable value.
	Value *string `json:"value,omitempty"`
	// SensitiveValue - Variable sensitive value.
	SensitiveValue *string `json:"sensitiveValue,omitempty"`
}

// SubResource azure Synapse nested resource, which belongs to a workspace.
type SubResource struct {
	// Etag - READ-ONLY; Resource Etag.
	Etag *string `json:"etag,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for SubResource.
func (sr SubResource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// SystemData metadata pertaining to creation and last modification of the resource.
type SystemData struct {
	// CreatedBy - The identity that created the resource.
	CreatedBy *string `json:"createdBy,omitempty"`
	// CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
	CreatedByType CreatedByType `json:"createdByType,omitempty"`
	// CreatedAt - The timestamp of resource creation (UTC).
	CreatedAt *date.Time `json:"createdAt,omitempty"`
	// LastModifiedBy - The identity that last modified the resource.
	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
	// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
	LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
	// LastModifiedAt - The timestamp of resource last modification (UTC)
	LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
}

// TableLevelSharingProperties tables that will be included and excluded in the follower database
type TableLevelSharingProperties struct {
	// TablesToInclude - List of tables to include in the follower database
	TablesToInclude *[]string `json:"tablesToInclude,omitempty"`
	// TablesToExclude - List of tables to exclude from the follower database
	TablesToExclude *[]string `json:"tablesToExclude,omitempty"`
	// ExternalTablesToInclude - List of external tables to include in the follower database
	ExternalTablesToInclude *[]string `json:"externalTablesToInclude,omitempty"`
	// ExternalTablesToExclude - List of external tables exclude from the follower database
	ExternalTablesToExclude *[]string `json:"externalTablesToExclude,omitempty"`
	// MaterializedViewsToInclude - List of materialized views to include in the follower database
	MaterializedViewsToInclude *[]string `json:"materializedViewsToInclude,omitempty"`
	// MaterializedViewsToExclude - List of materialized views exclude from the follower database
	MaterializedViewsToExclude *[]string `json:"materializedViewsToExclude,omitempty"`
}

// TopQueries a database query.
type TopQueries struct {
	// AggregationFunction - READ-ONLY; The function that is used to aggregate each query's metrics. Possible values include: 'QueryAggregationFunctionMin', 'QueryAggregationFunctionMax', 'QueryAggregationFunctionAvg', 'QueryAggregationFunctionSum'
	AggregationFunction QueryAggregationFunction `json:"aggregationFunction,omitempty"`
	// ExecutionType - READ-ONLY; The execution type that is used to filter the query instances that are returned. Possible values include: 'QueryExecutionTypeAny', 'QueryExecutionTypeRegular', 'QueryExecutionTypeIrregular', 'QueryExecutionTypeAborted', 'QueryExecutionTypeException'
	ExecutionType QueryExecutionType `json:"executionType,omitempty"`
	// IntervalType - READ-ONLY; The duration of the interval (ISO8601 duration format).
	IntervalType *string `json:"intervalType,omitempty"`
	// NumberOfTopQueries - READ-ONLY; The number of requested queries.
	NumberOfTopQueries *float64 `json:"numberOfTopQueries,omitempty"`
	// ObservationStartTime - READ-ONLY; The start time for queries that are returned (ISO8601 format)
	ObservationStartTime *date.Time `json:"observationStartTime,omitempty"`
	// ObservationEndTime - READ-ONLY; The end time for queries that are returned (ISO8601 format)
	ObservationEndTime *date.Time `json:"observationEndTime,omitempty"`
	// ObservedMetric - READ-ONLY; The type of metric to use for ordering the top metrics. Possible values include: 'QueryObservedMetricTypeCPU', 'QueryObservedMetricTypeIo', 'QueryObservedMetricTypeLogio', 'QueryObservedMetricTypeDuration', 'QueryObservedMetricTypeExecutionCount'
	ObservedMetric QueryObservedMetricType `json:"observedMetric,omitempty"`
	// Queries - READ-ONLY; The list of queries.
	Queries *[]QueryStatistic `json:"queries,omitempty"`
}

// MarshalJSON is the custom marshaler for TopQueries.
func (tq TopQueries) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// TopQueriesListResult represents the response to a get top queries request.
type TopQueriesListResult struct {
	// Value - The list of top queries.
	Value *[]TopQueries `json:"value,omitempty"`
}

// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource
// which has 'tags' and a 'location'
type TrackedResource struct {
	// Tags - Resource tags.
	Tags map[string]*string `json:"tags"`
	// Location - The geo-location where the resource lives
	Location *string `json:"location,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for TrackedResource.
func (tr TrackedResource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if tr.Tags != nil {
		objectMap["tags"] = tr.Tags
	}
	if tr.Location != nil {
		objectMap["location"] = tr.Location
	}
	return json.Marshal(objectMap)
}

// TransparentDataEncryption represents a Sql pool transparent data encryption configuration.
type TransparentDataEncryption struct {
	autorest.Response `json:"-"`
	// Location - READ-ONLY; Resource location.
	Location *string `json:"location,omitempty"`
	// TransparentDataEncryptionProperties - Represents the properties of the resource.
	*TransparentDataEncryptionProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for TransparentDataEncryption.
func (tde TransparentDataEncryption) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if tde.TransparentDataEncryptionProperties != nil {
		objectMap["properties"] = tde.TransparentDataEncryptionProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for TransparentDataEncryption struct.
func (tde *TransparentDataEncryption) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				tde.Location = &location
			}
		case "properties":
			if v != nil {
				var transparentDataEncryptionProperties TransparentDataEncryptionProperties
				err = json.Unmarshal(*v, &transparentDataEncryptionProperties)
				if err != nil {
					return err
				}
				tde.TransparentDataEncryptionProperties = &transparentDataEncryptionProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				tde.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				tde.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				tde.Type = &typeVar
			}
		}
	}

	return nil
}

// TransparentDataEncryptionListResult a list of transparent data encryption configurations.
type TransparentDataEncryptionListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]TransparentDataEncryption `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for TransparentDataEncryptionListResult.
func (tdelr TransparentDataEncryptionListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// TransparentDataEncryptionListResultIterator provides access to a complete listing of
// TransparentDataEncryption values.
type TransparentDataEncryptionListResultIterator struct {
	i    int
	page TransparentDataEncryptionListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *TransparentDataEncryptionListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/TransparentDataEncryptionListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *TransparentDataEncryptionListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter TransparentDataEncryptionListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter TransparentDataEncryptionListResultIterator) Response() TransparentDataEncryptionListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter TransparentDataEncryptionListResultIterator) Value() TransparentDataEncryption {
	if !iter.page.NotDone() {
		return TransparentDataEncryption{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the TransparentDataEncryptionListResultIterator type.
func NewTransparentDataEncryptionListResultIterator(page TransparentDataEncryptionListResultPage) TransparentDataEncryptionListResultIterator {
	return TransparentDataEncryptionListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (tdelr TransparentDataEncryptionListResult) IsEmpty() bool {
	return tdelr.Value == nil || len(*tdelr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (tdelr TransparentDataEncryptionListResult) hasNextLink() bool {
	return tdelr.NextLink != nil && len(*tdelr.NextLink) != 0
}

// transparentDataEncryptionListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (tdelr TransparentDataEncryptionListResult) transparentDataEncryptionListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !tdelr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(tdelr.NextLink)))
}

// TransparentDataEncryptionListResultPage contains a page of TransparentDataEncryption values.
type TransparentDataEncryptionListResultPage struct {
	fn    func(context.Context, TransparentDataEncryptionListResult) (TransparentDataEncryptionListResult, error)
	tdelr TransparentDataEncryptionListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *TransparentDataEncryptionListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/TransparentDataEncryptionListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.tdelr)
		if err != nil {
			return err
		}
		page.tdelr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *TransparentDataEncryptionListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page TransparentDataEncryptionListResultPage) NotDone() bool {
	return !page.tdelr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page TransparentDataEncryptionListResultPage) Response() TransparentDataEncryptionListResult {
	return page.tdelr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page TransparentDataEncryptionListResultPage) Values() []TransparentDataEncryption {
	if page.tdelr.IsEmpty() {
		return nil
	}
	return *page.tdelr.Value
}

// Creates a new instance of the TransparentDataEncryptionListResultPage type.
func NewTransparentDataEncryptionListResultPage(cur TransparentDataEncryptionListResult, getNextPage func(context.Context, TransparentDataEncryptionListResult) (TransparentDataEncryptionListResult, error)) TransparentDataEncryptionListResultPage {
	return TransparentDataEncryptionListResultPage{
		fn:    getNextPage,
		tdelr: cur,
	}
}

// TransparentDataEncryptionProperties represents the properties of a database transparent data encryption.
type TransparentDataEncryptionProperties struct {
	// Status - The status of the database transparent data encryption. Possible values include: 'TransparentDataEncryptionStatusEnabled', 'TransparentDataEncryptionStatusDisabled'
	Status TransparentDataEncryptionStatus `json:"status,omitempty"`
}

// UpdateIntegrationRuntimeNodeRequest update integration runtime node request.
type UpdateIntegrationRuntimeNodeRequest struct {
	// ConcurrentJobsLimit - The number of concurrent jobs permitted to run on the integration runtime node. Values between 1 and maxConcurrentJobs(inclusive) are allowed.
	ConcurrentJobsLimit *int32 `json:"concurrentJobsLimit,omitempty"`
}

// UpdateIntegrationRuntimeRequest update integration runtime request.
type UpdateIntegrationRuntimeRequest struct {
	// AutoUpdate - Enables or disables the auto-update feature of the self-hosted integration runtime. See https://go.microsoft.com/fwlink/?linkid=854189. Possible values include: 'IntegrationRuntimeAutoUpdateOn', 'IntegrationRuntimeAutoUpdateOff'
	AutoUpdate IntegrationRuntimeAutoUpdate `json:"autoUpdate,omitempty"`
	// UpdateDelayOffset - The time offset (in hours) in the day, e.g., PT03H is 3 hours. The integration runtime auto update will happen on that time.
	UpdateDelayOffset *string `json:"updateDelayOffset,omitempty"`
}

// UserAssignedManagedIdentity user Assigned Managed Identity
type UserAssignedManagedIdentity struct {
	// ClientID - READ-ONLY; The client ID.
	ClientID *uuid.UUID `json:"clientId,omitempty"`
	// PrincipalID - READ-ONLY; The principal ID.
	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
}

// MarshalJSON is the custom marshaler for UserAssignedManagedIdentity.
func (uami UserAssignedManagedIdentity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// VirtualNetworkProfile virtual Network Profile
type VirtualNetworkProfile struct {
	// ComputeSubnetID - Subnet ID used for computes in workspace
	ComputeSubnetID *string `json:"computeSubnetId,omitempty"`
}

// VulnerabilityAssessmentRecurringScansProperties properties of a Vulnerability Assessment recurring
// scans.
type VulnerabilityAssessmentRecurringScansProperties struct {
	// IsEnabled - Recurring scans state.
	IsEnabled *bool `json:"isEnabled,omitempty"`
	// EmailSubscriptionAdmins - Specifies that the schedule scan notification will be is sent to the subscription administrators.
	EmailSubscriptionAdmins *bool `json:"emailSubscriptionAdmins,omitempty"`
	// Emails - Specifies an array of e-mail addresses to which the scan notification is sent.
	Emails *[]string `json:"emails,omitempty"`
}

// VulnerabilityAssessmentScanError properties of a vulnerability assessment scan error.
type VulnerabilityAssessmentScanError struct {
	// Code - READ-ONLY; The error code.
	Code *string `json:"code,omitempty"`
	// Message - READ-ONLY; The error message.
	Message *string `json:"message,omitempty"`
}

// MarshalJSON is the custom marshaler for VulnerabilityAssessmentScanError.
func (vase VulnerabilityAssessmentScanError) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// VulnerabilityAssessmentScanRecord a vulnerability assessment scan record.
type VulnerabilityAssessmentScanRecord struct {
	autorest.Response `json:"-"`
	// VulnerabilityAssessmentScanRecordProperties - Resource properties.
	*VulnerabilityAssessmentScanRecordProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for VulnerabilityAssessmentScanRecord.
func (vasr VulnerabilityAssessmentScanRecord) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if vasr.VulnerabilityAssessmentScanRecordProperties != nil {
		objectMap["properties"] = vasr.VulnerabilityAssessmentScanRecordProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for VulnerabilityAssessmentScanRecord struct.
func (vasr *VulnerabilityAssessmentScanRecord) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var vulnerabilityAssessmentScanRecordProperties VulnerabilityAssessmentScanRecordProperties
				err = json.Unmarshal(*v, &vulnerabilityAssessmentScanRecordProperties)
				if err != nil {
					return err
				}
				vasr.VulnerabilityAssessmentScanRecordProperties = &vulnerabilityAssessmentScanRecordProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				vasr.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				vasr.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				vasr.Type = &typeVar
			}
		}
	}

	return nil
}

// VulnerabilityAssessmentScanRecordListResult a list of vulnerability assessment scan records.
type VulnerabilityAssessmentScanRecordListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]VulnerabilityAssessmentScanRecord `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for VulnerabilityAssessmentScanRecordListResult.
func (vasrlr VulnerabilityAssessmentScanRecordListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// VulnerabilityAssessmentScanRecordListResultIterator provides access to a complete listing of
// VulnerabilityAssessmentScanRecord values.
type VulnerabilityAssessmentScanRecordListResultIterator struct {
	i    int
	page VulnerabilityAssessmentScanRecordListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *VulnerabilityAssessmentScanRecordListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/VulnerabilityAssessmentScanRecordListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *VulnerabilityAssessmentScanRecordListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter VulnerabilityAssessmentScanRecordListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter VulnerabilityAssessmentScanRecordListResultIterator) Response() VulnerabilityAssessmentScanRecordListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter VulnerabilityAssessmentScanRecordListResultIterator) Value() VulnerabilityAssessmentScanRecord {
	if !iter.page.NotDone() {
		return VulnerabilityAssessmentScanRecord{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the VulnerabilityAssessmentScanRecordListResultIterator type.
func NewVulnerabilityAssessmentScanRecordListResultIterator(page VulnerabilityAssessmentScanRecordListResultPage) VulnerabilityAssessmentScanRecordListResultIterator {
	return VulnerabilityAssessmentScanRecordListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (vasrlr VulnerabilityAssessmentScanRecordListResult) IsEmpty() bool {
	return vasrlr.Value == nil || len(*vasrlr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (vasrlr VulnerabilityAssessmentScanRecordListResult) hasNextLink() bool {
	return vasrlr.NextLink != nil && len(*vasrlr.NextLink) != 0
}

// vulnerabilityAssessmentScanRecordListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (vasrlr VulnerabilityAssessmentScanRecordListResult) vulnerabilityAssessmentScanRecordListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !vasrlr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(vasrlr.NextLink)))
}

// VulnerabilityAssessmentScanRecordListResultPage contains a page of VulnerabilityAssessmentScanRecord
// values.
type VulnerabilityAssessmentScanRecordListResultPage struct {
	fn     func(context.Context, VulnerabilityAssessmentScanRecordListResult) (VulnerabilityAssessmentScanRecordListResult, error)
	vasrlr VulnerabilityAssessmentScanRecordListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *VulnerabilityAssessmentScanRecordListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/VulnerabilityAssessmentScanRecordListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.vasrlr)
		if err != nil {
			return err
		}
		page.vasrlr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *VulnerabilityAssessmentScanRecordListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page VulnerabilityAssessmentScanRecordListResultPage) NotDone() bool {
	return !page.vasrlr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page VulnerabilityAssessmentScanRecordListResultPage) Response() VulnerabilityAssessmentScanRecordListResult {
	return page.vasrlr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page VulnerabilityAssessmentScanRecordListResultPage) Values() []VulnerabilityAssessmentScanRecord {
	if page.vasrlr.IsEmpty() {
		return nil
	}
	return *page.vasrlr.Value
}

// Creates a new instance of the VulnerabilityAssessmentScanRecordListResultPage type.
func NewVulnerabilityAssessmentScanRecordListResultPage(cur VulnerabilityAssessmentScanRecordListResult, getNextPage func(context.Context, VulnerabilityAssessmentScanRecordListResult) (VulnerabilityAssessmentScanRecordListResult, error)) VulnerabilityAssessmentScanRecordListResultPage {
	return VulnerabilityAssessmentScanRecordListResultPage{
		fn:     getNextPage,
		vasrlr: cur,
	}
}

// VulnerabilityAssessmentScanRecordProperties properties of a vulnerability assessment scan record.
type VulnerabilityAssessmentScanRecordProperties struct {
	// ScanID - READ-ONLY; The scan ID.
	ScanID *string `json:"scanId,omitempty"`
	// TriggerType - READ-ONLY; The scan trigger type. Possible values include: 'VulnerabilityAssessmentScanTriggerTypeOnDemand', 'VulnerabilityAssessmentScanTriggerTypeRecurring'
	TriggerType VulnerabilityAssessmentScanTriggerType `json:"triggerType,omitempty"`
	// State - READ-ONLY; The scan status. Possible values include: 'VulnerabilityAssessmentScanStatePassed', 'VulnerabilityAssessmentScanStateFailed', 'VulnerabilityAssessmentScanStateFailedToRun', 'VulnerabilityAssessmentScanStateInProgress'
	State VulnerabilityAssessmentScanState `json:"state,omitempty"`
	// StartTime - READ-ONLY; The scan start time (UTC).
	StartTime *date.Time `json:"startTime,omitempty"`
	// EndTime - READ-ONLY; The scan end time (UTC).
	EndTime *date.Time `json:"endTime,omitempty"`
	// Errors - READ-ONLY; The scan errors.
	Errors *[]VulnerabilityAssessmentScanError `json:"errors,omitempty"`
	// StorageContainerPath - READ-ONLY; The scan results storage container path.
	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
	// NumberOfFailedSecurityChecks - READ-ONLY; The number of failed security checks.
	NumberOfFailedSecurityChecks *int32 `json:"numberOfFailedSecurityChecks,omitempty"`
}

// MarshalJSON is the custom marshaler for VulnerabilityAssessmentScanRecordProperties.
func (vasrp VulnerabilityAssessmentScanRecordProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// WorkloadClassifier workload classifier operations for a data warehouse
type WorkloadClassifier struct {
	autorest.Response `json:"-"`
	// WorkloadClassifierProperties - Resource properties.
	*WorkloadClassifierProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for WorkloadClassifier.
func (wc WorkloadClassifier) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if wc.WorkloadClassifierProperties != nil {
		objectMap["properties"] = wc.WorkloadClassifierProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for WorkloadClassifier struct.
func (wc *WorkloadClassifier) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var workloadClassifierProperties WorkloadClassifierProperties
				err = json.Unmarshal(*v, &workloadClassifierProperties)
				if err != nil {
					return err
				}
				wc.WorkloadClassifierProperties = &workloadClassifierProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				wc.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				wc.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				wc.Type = &typeVar
			}
		}
	}

	return nil
}

// WorkloadClassifierListResult a list of workload classifiers for a workload group.
type WorkloadClassifierListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]WorkloadClassifier `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for WorkloadClassifierListResult.
func (wclr WorkloadClassifierListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// WorkloadClassifierListResultIterator provides access to a complete listing of WorkloadClassifier values.
type WorkloadClassifierListResultIterator struct {
	i    int
	page WorkloadClassifierListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *WorkloadClassifierListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadClassifierListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *WorkloadClassifierListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter WorkloadClassifierListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter WorkloadClassifierListResultIterator) Response() WorkloadClassifierListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter WorkloadClassifierListResultIterator) Value() WorkloadClassifier {
	if !iter.page.NotDone() {
		return WorkloadClassifier{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the WorkloadClassifierListResultIterator type.
func NewWorkloadClassifierListResultIterator(page WorkloadClassifierListResultPage) WorkloadClassifierListResultIterator {
	return WorkloadClassifierListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (wclr WorkloadClassifierListResult) IsEmpty() bool {
	return wclr.Value == nil || len(*wclr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (wclr WorkloadClassifierListResult) hasNextLink() bool {
	return wclr.NextLink != nil && len(*wclr.NextLink) != 0
}

// workloadClassifierListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (wclr WorkloadClassifierListResult) workloadClassifierListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !wclr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(wclr.NextLink)))
}

// WorkloadClassifierListResultPage contains a page of WorkloadClassifier values.
type WorkloadClassifierListResultPage struct {
	fn   func(context.Context, WorkloadClassifierListResult) (WorkloadClassifierListResult, error)
	wclr WorkloadClassifierListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *WorkloadClassifierListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadClassifierListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.wclr)
		if err != nil {
			return err
		}
		page.wclr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *WorkloadClassifierListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page WorkloadClassifierListResultPage) NotDone() bool {
	return !page.wclr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page WorkloadClassifierListResultPage) Response() WorkloadClassifierListResult {
	return page.wclr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page WorkloadClassifierListResultPage) Values() []WorkloadClassifier {
	if page.wclr.IsEmpty() {
		return nil
	}
	return *page.wclr.Value
}

// Creates a new instance of the WorkloadClassifierListResultPage type.
func NewWorkloadClassifierListResultPage(cur WorkloadClassifierListResult, getNextPage func(context.Context, WorkloadClassifierListResult) (WorkloadClassifierListResult, error)) WorkloadClassifierListResultPage {
	return WorkloadClassifierListResultPage{
		fn:   getNextPage,
		wclr: cur,
	}
}

// WorkloadClassifierProperties workload classifier definition. For more information look at
// sys.workload_management_workload_classifiers (DMV).
type WorkloadClassifierProperties struct {
	// MemberName - The workload classifier member name.
	MemberName *string `json:"memberName,omitempty"`
	// Label - The workload classifier label.
	Label *string `json:"label,omitempty"`
	// Context - The workload classifier context.
	Context *string `json:"context,omitempty"`
	// StartTime - The workload classifier start time for classification.
	StartTime *string `json:"startTime,omitempty"`
	// EndTime - The workload classifier end time for classification.
	EndTime *string `json:"endTime,omitempty"`
	// Importance - The workload classifier importance.
	Importance *string `json:"importance,omitempty"`
}

// WorkloadGroup workload group operations for a sql pool
type WorkloadGroup struct {
	autorest.Response `json:"-"`
	// WorkloadGroupProperties - Resource properties.
	*WorkloadGroupProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for WorkloadGroup.
func (wg WorkloadGroup) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if wg.WorkloadGroupProperties != nil {
		objectMap["properties"] = wg.WorkloadGroupProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for WorkloadGroup struct.
func (wg *WorkloadGroup) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var workloadGroupProperties WorkloadGroupProperties
				err = json.Unmarshal(*v, &workloadGroupProperties)
				if err != nil {
					return err
				}
				wg.WorkloadGroupProperties = &workloadGroupProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				wg.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				wg.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				wg.Type = &typeVar
			}
		}
	}

	return nil
}

// WorkloadGroupListResult a list of workload groups.
type WorkloadGroupListResult struct {
	autorest.Response `json:"-"`
	// Value - READ-ONLY; Array of results.
	Value *[]WorkloadGroup `json:"value,omitempty"`
	// NextLink - READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty"`
}

// MarshalJSON is the custom marshaler for WorkloadGroupListResult.
func (wglr WorkloadGroupListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// WorkloadGroupListResultIterator provides access to a complete listing of WorkloadGroup values.
type WorkloadGroupListResultIterator struct {
	i    int
	page WorkloadGroupListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *WorkloadGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadGroupListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *WorkloadGroupListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter WorkloadGroupListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter WorkloadGroupListResultIterator) Response() WorkloadGroupListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter WorkloadGroupListResultIterator) Value() WorkloadGroup {
	if !iter.page.NotDone() {
		return WorkloadGroup{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the WorkloadGroupListResultIterator type.
func NewWorkloadGroupListResultIterator(page WorkloadGroupListResultPage) WorkloadGroupListResultIterator {
	return WorkloadGroupListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (wglr WorkloadGroupListResult) IsEmpty() bool {
	return wglr.Value == nil || len(*wglr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (wglr WorkloadGroupListResult) hasNextLink() bool {
	return wglr.NextLink != nil && len(*wglr.NextLink) != 0
}

// workloadGroupListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (wglr WorkloadGroupListResult) workloadGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !wglr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(wglr.NextLink)))
}

// WorkloadGroupListResultPage contains a page of WorkloadGroup values.
type WorkloadGroupListResultPage struct {
	fn   func(context.Context, WorkloadGroupListResult) (WorkloadGroupListResult, error)
	wglr WorkloadGroupListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *WorkloadGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadGroupListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.wglr)
		if err != nil {
			return err
		}
		page.wglr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *WorkloadGroupListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page WorkloadGroupListResultPage) NotDone() bool {
	return !page.wglr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page WorkloadGroupListResultPage) Response() WorkloadGroupListResult {
	return page.wglr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page WorkloadGroupListResultPage) Values() []WorkloadGroup {
	if page.wglr.IsEmpty() {
		return nil
	}
	return *page.wglr.Value
}

// Creates a new instance of the WorkloadGroupListResultPage type.
func NewWorkloadGroupListResultPage(cur WorkloadGroupListResult, getNextPage func(context.Context, WorkloadGroupListResult) (WorkloadGroupListResult, error)) WorkloadGroupListResultPage {
	return WorkloadGroupListResultPage{
		fn:   getNextPage,
		wglr: cur,
	}
}

// WorkloadGroupProperties workload group definition. For more information look at
// sys.workload_management_workload_groups (DMV).
type WorkloadGroupProperties struct {
	// MinResourcePercent - The workload group minimum percentage resource.
	MinResourcePercent *int32 `json:"minResourcePercent,omitempty"`
	// MaxResourcePercent - The workload group cap percentage resource.
	MaxResourcePercent *int32 `json:"maxResourcePercent,omitempty"`
	// MinResourcePercentPerRequest - The workload group request minimum grant percentage.
	MinResourcePercentPerRequest *float64 `json:"minResourcePercentPerRequest,omitempty"`
	// MaxResourcePercentPerRequest - The workload group request maximum grant percentage.
	MaxResourcePercentPerRequest *float64 `json:"maxResourcePercentPerRequest,omitempty"`
	// Importance - The workload group importance level.
	Importance *string `json:"importance,omitempty"`
	// QueryExecutionTimeout - The workload group query execution timeout.
	QueryExecutionTimeout *int32 `json:"queryExecutionTimeout,omitempty"`
}

// Workspace a workspace
type Workspace struct {
	autorest.Response `json:"-"`
	// WorkspaceProperties - Workspace resource properties
	*WorkspaceProperties `json:"properties,omitempty"`
	// Identity - Identity of the workspace
	Identity *ManagedIdentity `json:"identity,omitempty"`
	// Tags - Resource tags.
	Tags map[string]*string `json:"tags"`
	// Location - The geo-location where the resource lives
	Location *string `json:"location,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for Workspace.
func (w Workspace) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if w.WorkspaceProperties != nil {
		objectMap["properties"] = w.WorkspaceProperties
	}
	if w.Identity != nil {
		objectMap["identity"] = w.Identity
	}
	if w.Tags != nil {
		objectMap["tags"] = w.Tags
	}
	if w.Location != nil {
		objectMap["location"] = w.Location
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for Workspace struct.
func (w *Workspace) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var workspaceProperties WorkspaceProperties
				err = json.Unmarshal(*v, &workspaceProperties)
				if err != nil {
					return err
				}
				w.WorkspaceProperties = &workspaceProperties
			}
		case "identity":
			if v != nil {
				var identity ManagedIdentity
				err = json.Unmarshal(*v, &identity)
				if err != nil {
					return err
				}
				w.Identity = &identity
			}
		case "tags":
			if v != nil {
				var tags map[string]*string
				err = json.Unmarshal(*v, &tags)
				if err != nil {
					return err
				}
				w.Tags = tags
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				w.Location = &location
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				w.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				w.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				w.Type = &typeVar
			}
		}
	}

	return nil
}

// WorkspaceAadAdminInfo workspace active directory administrator
type WorkspaceAadAdminInfo struct {
	autorest.Response `json:"-"`
	// AadAdminProperties - Workspace active directory administrator properties
	*AadAdminProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for WorkspaceAadAdminInfo.
func (waai WorkspaceAadAdminInfo) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if waai.AadAdminProperties != nil {
		objectMap["properties"] = waai.AadAdminProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for WorkspaceAadAdminInfo struct.
func (waai *WorkspaceAadAdminInfo) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var aadAdminProperties AadAdminProperties
				err = json.Unmarshal(*v, &aadAdminProperties)
				if err != nil {
					return err
				}
				waai.AadAdminProperties = &aadAdminProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				waai.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				waai.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				waai.Type = &typeVar
			}
		}
	}

	return nil
}

// WorkspaceAadAdminsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type WorkspaceAadAdminsCreateOrUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(WorkspaceAadAdminsClient) (WorkspaceAadAdminInfo, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *WorkspaceAadAdminsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for WorkspaceAadAdminsCreateOrUpdateFuture.Result.
func (future *WorkspaceAadAdminsCreateOrUpdateFuture) result(client WorkspaceAadAdminsClient) (waai WorkspaceAadAdminInfo, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.WorkspaceAadAdminsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		waai.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.WorkspaceAadAdminsCreateOrUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if waai.Response.Response, err = future.GetResult(sender); err == nil && waai.Response.Response.StatusCode != http.StatusNoContent {
		waai, err = client.CreateOrUpdateResponder(waai.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.WorkspaceAadAdminsCreateOrUpdateFuture", "Result", waai.Response.Response, "Failure responding to request")
		}
	}
	return
}

// WorkspaceAadAdminsDeleteFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type WorkspaceAadAdminsDeleteFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(WorkspaceAadAdminsClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *WorkspaceAadAdminsDeleteFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for WorkspaceAadAdminsDeleteFuture.Result.
func (future *WorkspaceAadAdminsDeleteFuture) result(client WorkspaceAadAdminsClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.WorkspaceAadAdminsDeleteFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.WorkspaceAadAdminsDeleteFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// WorkspaceInfoListResult list of workspaces
type WorkspaceInfoListResult struct {
	autorest.Response `json:"-"`
	// NextLink - Link to the next page of results
	NextLink *string `json:"nextLink,omitempty"`
	// Value - List of workspaces
	Value *[]Workspace `json:"value,omitempty"`
}

// WorkspaceInfoListResultIterator provides access to a complete listing of Workspace values.
type WorkspaceInfoListResultIterator struct {
	i    int
	page WorkspaceInfoListResultPage
}

// NextWithContext advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *WorkspaceInfoListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceInfoListResultIterator.NextWithContext")
		defer func() {
			sc := -1
			if iter.Response().Response.Response != nil {
				sc = iter.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	iter.i++
	if iter.i < len(iter.page.Values()) {
		return nil
	}
	err = iter.page.NextWithContext(ctx)
	if err != nil {
		iter.i--
		return err
	}
	iter.i = 0
	return nil
}

// Next advances to the next value.  If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *WorkspaceInfoListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter WorkspaceInfoListResultIterator) NotDone() bool {
	return iter.page.NotDone() && iter.i < len(iter.page.Values())
}

// Response returns the raw server response from the last page request.
func (iter WorkspaceInfoListResultIterator) Response() WorkspaceInfoListResult {
	return iter.page.Response()
}

// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter WorkspaceInfoListResultIterator) Value() Workspace {
	if !iter.page.NotDone() {
		return Workspace{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the WorkspaceInfoListResultIterator type.
func NewWorkspaceInfoListResultIterator(page WorkspaceInfoListResultPage) WorkspaceInfoListResultIterator {
	return WorkspaceInfoListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (wilr WorkspaceInfoListResult) IsEmpty() bool {
	return wilr.Value == nil || len(*wilr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (wilr WorkspaceInfoListResult) hasNextLink() bool {
	return wilr.NextLink != nil && len(*wilr.NextLink) != 0
}

// workspaceInfoListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (wilr WorkspaceInfoListResult) workspaceInfoListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !wilr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(wilr.NextLink)))
}

// WorkspaceInfoListResultPage contains a page of Workspace values.
type WorkspaceInfoListResultPage struct {
	fn   func(context.Context, WorkspaceInfoListResult) (WorkspaceInfoListResult, error)
	wilr WorkspaceInfoListResult
}

// NextWithContext advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
func (page *WorkspaceInfoListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceInfoListResultPage.NextWithContext")
		defer func() {
			sc := -1
			if page.Response().Response.Response != nil {
				sc = page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	for {
		next, err := page.fn(ctx, page.wilr)
		if err != nil {
			return err
		}
		page.wilr = next
		if !next.hasNextLink() || !next.IsEmpty() {
			break
		}
	}
	return nil
}

// Next advances to the next page of values.  If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *WorkspaceInfoListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page WorkspaceInfoListResultPage) NotDone() bool {
	return !page.wilr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page WorkspaceInfoListResultPage) Response() WorkspaceInfoListResult {
	return page.wilr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page WorkspaceInfoListResultPage) Values() []Workspace {
	if page.wilr.IsEmpty() {
		return nil
	}
	return *page.wilr.Value
}

// Creates a new instance of the WorkspaceInfoListResultPage type.
func NewWorkspaceInfoListResultPage(cur WorkspaceInfoListResult, getNextPage func(context.Context, WorkspaceInfoListResult) (WorkspaceInfoListResult, error)) WorkspaceInfoListResultPage {
	return WorkspaceInfoListResultPage{
		fn:   getNextPage,
		wilr: cur,
	}
}

// WorkspaceKeyDetails details of the customer managed key associated with the workspace
type WorkspaceKeyDetails struct {
	// Name - Workspace Key sub-resource name
	Name *string `json:"name,omitempty"`
	// KeyVaultURL - Workspace Key sub-resource key vault url
	KeyVaultURL *string `json:"keyVaultUrl,omitempty"`
}

// WorkspaceManagedIdentitySQLControlSettingsCreateOrUpdateFuture an abstraction for monitoring and
// retrieving the results of a long-running operation.
type WorkspaceManagedIdentitySQLControlSettingsCreateOrUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(WorkspaceManagedIdentitySQLControlSettingsClient) (ManagedIdentitySQLControlSettingsModel, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *WorkspaceManagedIdentitySQLControlSettingsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for WorkspaceManagedIdentitySQLControlSettingsCreateOrUpdateFuture.Result.
func (future *WorkspaceManagedIdentitySQLControlSettingsCreateOrUpdateFuture) result(client WorkspaceManagedIdentitySQLControlSettingsClient) (miscsm ManagedIdentitySQLControlSettingsModel, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedIdentitySQLControlSettingsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		miscsm.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.WorkspaceManagedIdentitySQLControlSettingsCreateOrUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if miscsm.Response.Response, err = future.GetResult(sender); err == nil && miscsm.Response.Response.StatusCode != http.StatusNoContent {
		miscsm, err = client.CreateOrUpdateResponder(miscsm.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedIdentitySQLControlSettingsCreateOrUpdateFuture", "Result", miscsm.Response.Response, "Failure responding to request")
		}
	}
	return
}

// WorkspaceManagedSQLServerBlobAuditingPoliciesCreateOrUpdateFuture an abstraction for monitoring and
// retrieving the results of a long-running operation.
type WorkspaceManagedSQLServerBlobAuditingPoliciesCreateOrUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(WorkspaceManagedSQLServerBlobAuditingPoliciesClient) (ServerBlobAuditingPolicy, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *WorkspaceManagedSQLServerBlobAuditingPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for WorkspaceManagedSQLServerBlobAuditingPoliciesCreateOrUpdateFuture.Result.
func (future *WorkspaceManagedSQLServerBlobAuditingPoliciesCreateOrUpdateFuture) result(client WorkspaceManagedSQLServerBlobAuditingPoliciesClient) (sbap ServerBlobAuditingPolicy, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		sbap.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.WorkspaceManagedSQLServerBlobAuditingPoliciesCreateOrUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if sbap.Response.Response, err = future.GetResult(sender); err == nil && sbap.Response.Response.StatusCode != http.StatusNoContent {
		sbap, err = client.CreateOrUpdateResponder(sbap.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", sbap.Response.Response, "Failure responding to request")
		}
	}
	return
}

// WorkspaceManagedSQLServerDedicatedSQLMinimalTLSSettingsUpdateFuture an abstraction for monitoring and
// retrieving the results of a long-running operation.
type WorkspaceManagedSQLServerDedicatedSQLMinimalTLSSettingsUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(WorkspaceManagedSQLServerDedicatedSQLMinimalTLSSettingsClient) (DedicatedSQLminimalTLSSettings, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *WorkspaceManagedSQLServerDedicatedSQLMinimalTLSSettingsUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for WorkspaceManagedSQLServerDedicatedSQLMinimalTLSSettingsUpdateFuture.Result.
func (future *WorkspaceManagedSQLServerDedicatedSQLMinimalTLSSettingsUpdateFuture) result(client WorkspaceManagedSQLServerDedicatedSQLMinimalTLSSettingsClient) (dslts DedicatedSQLminimalTLSSettings, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerDedicatedSQLMinimalTLSSettingsUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		dslts.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.WorkspaceManagedSQLServerDedicatedSQLMinimalTLSSettingsUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if dslts.Response.Response, err = future.GetResult(sender); err == nil && dslts.Response.Response.StatusCode != http.StatusNoContent {
		dslts, err = client.UpdateResponder(dslts.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerDedicatedSQLMinimalTLSSettingsUpdateFuture", "Result", dslts.Response.Response, "Failure responding to request")
		}
	}
	return
}

// WorkspaceManagedSQLServerEncryptionProtectorCreateOrUpdateFuture an abstraction for monitoring and
// retrieving the results of a long-running operation.
type WorkspaceManagedSQLServerEncryptionProtectorCreateOrUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(WorkspaceManagedSQLServerEncryptionProtectorClient) (EncryptionProtector, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *WorkspaceManagedSQLServerEncryptionProtectorCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for WorkspaceManagedSQLServerEncryptionProtectorCreateOrUpdateFuture.Result.
func (future *WorkspaceManagedSQLServerEncryptionProtectorCreateOrUpdateFuture) result(client WorkspaceManagedSQLServerEncryptionProtectorClient) (ep EncryptionProtector, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerEncryptionProtectorCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ep.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.WorkspaceManagedSQLServerEncryptionProtectorCreateOrUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent {
		ep, err = client.CreateOrUpdateResponder(ep.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerEncryptionProtectorCreateOrUpdateFuture", "Result", ep.Response.Response, "Failure responding to request")
		}
	}
	return
}

// WorkspaceManagedSQLServerEncryptionProtectorRevalidateFuture an abstraction for monitoring and
// retrieving the results of a long-running operation.
type WorkspaceManagedSQLServerEncryptionProtectorRevalidateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(WorkspaceManagedSQLServerEncryptionProtectorClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *WorkspaceManagedSQLServerEncryptionProtectorRevalidateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for WorkspaceManagedSQLServerEncryptionProtectorRevalidateFuture.Result.
func (future *WorkspaceManagedSQLServerEncryptionProtectorRevalidateFuture) result(client WorkspaceManagedSQLServerEncryptionProtectorClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerEncryptionProtectorRevalidateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.WorkspaceManagedSQLServerEncryptionProtectorRevalidateFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesCreateOrUpdateFuture an abstraction for monitoring
// and retrieving the results of a long-running operation.
type WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesCreateOrUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient) (ExtendedServerBlobAuditingPolicy, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesCreateOrUpdateFuture.Result.
func (future *WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesCreateOrUpdateFuture) result(client WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesClient) (esbap ExtendedServerBlobAuditingPolicy, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		esbap.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesCreateOrUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if esbap.Response.Response, err = future.GetResult(sender); err == nil && esbap.Response.Response.StatusCode != http.StatusNoContent {
		esbap, err = client.CreateOrUpdateResponder(esbap.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerExtendedBlobAuditingPoliciesCreateOrUpdateFuture", "Result", esbap.Response.Response, "Failure responding to request")
		}
	}
	return
}

// WorkspaceManagedSQLServerSecurityAlertPolicyCreateOrUpdateFuture an abstraction for monitoring and
// retrieving the results of a long-running operation.
type WorkspaceManagedSQLServerSecurityAlertPolicyCreateOrUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(WorkspaceManagedSQLServerSecurityAlertPolicyClient) (ServerSecurityAlertPolicy, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *WorkspaceManagedSQLServerSecurityAlertPolicyCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for WorkspaceManagedSQLServerSecurityAlertPolicyCreateOrUpdateFuture.Result.
func (future *WorkspaceManagedSQLServerSecurityAlertPolicyCreateOrUpdateFuture) result(client WorkspaceManagedSQLServerSecurityAlertPolicyClient) (ssap ServerSecurityAlertPolicy, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerSecurityAlertPolicyCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ssap.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.WorkspaceManagedSQLServerSecurityAlertPolicyCreateOrUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if ssap.Response.Response, err = future.GetResult(sender); err == nil && ssap.Response.Response.StatusCode != http.StatusNoContent {
		ssap, err = client.CreateOrUpdateResponder(ssap.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.WorkspaceManagedSQLServerSecurityAlertPolicyCreateOrUpdateFuture", "Result", ssap.Response.Response, "Failure responding to request")
		}
	}
	return
}

// WorkspacePatchInfo workspace patch details
type WorkspacePatchInfo struct {
	// Tags - Resource tags
	Tags map[string]*string `json:"tags"`
	// Identity - The identity of the workspace
	Identity *ManagedIdentity `json:"identity,omitempty"`
	// WorkspacePatchProperties - Workspace patch properties
	*WorkspacePatchProperties `json:"properties,omitempty"`
}

// MarshalJSON is the custom marshaler for WorkspacePatchInfo.
func (wpi WorkspacePatchInfo) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if wpi.Tags != nil {
		objectMap["tags"] = wpi.Tags
	}
	if wpi.Identity != nil {
		objectMap["identity"] = wpi.Identity
	}
	if wpi.WorkspacePatchProperties != nil {
		objectMap["properties"] = wpi.WorkspacePatchProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for WorkspacePatchInfo struct.
func (wpi *WorkspacePatchInfo) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "tags":
			if v != nil {
				var tags map[string]*string
				err = json.Unmarshal(*v, &tags)
				if err != nil {
					return err
				}
				wpi.Tags = tags
			}
		case "identity":
			if v != nil {
				var identity ManagedIdentity
				err = json.Unmarshal(*v, &identity)
				if err != nil {
					return err
				}
				wpi.Identity = &identity
			}
		case "properties":
			if v != nil {
				var workspacePatchProperties WorkspacePatchProperties
				err = json.Unmarshal(*v, &workspacePatchProperties)
				if err != nil {
					return err
				}
				wpi.WorkspacePatchProperties = &workspacePatchProperties
			}
		}
	}

	return nil
}

// WorkspacePatchProperties workspace patch properties
type WorkspacePatchProperties struct {
	// SQLAdministratorLoginPassword - SQL administrator login password
	SQLAdministratorLoginPassword *string `json:"sqlAdministratorLoginPassword,omitempty"`
	// ManagedVirtualNetworkSettings - Managed Virtual Network Settings
	ManagedVirtualNetworkSettings *ManagedVirtualNetworkSettings `json:"managedVirtualNetworkSettings,omitempty"`
	// WorkspaceRepositoryConfiguration - Git integration settings
	WorkspaceRepositoryConfiguration *WorkspaceRepositoryConfiguration `json:"workspaceRepositoryConfiguration,omitempty"`
	// PurviewConfiguration - Purview Configuration
	PurviewConfiguration *PurviewConfiguration `json:"purviewConfiguration,omitempty"`
	// ProvisioningState - READ-ONLY; Resource provisioning state
	ProvisioningState *string `json:"provisioningState,omitempty"`
	// Encryption - The encryption details of the workspace
	Encryption *EncryptionDetails `json:"encryption,omitempty"`
	// PublicNetworkAccess - Enable or Disable public network access to workspace. Possible values include: 'WorkspacePublicNetworkAccessEnabled', 'WorkspacePublicNetworkAccessDisabled'
	PublicNetworkAccess WorkspacePublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
}

// MarshalJSON is the custom marshaler for WorkspacePatchProperties.
func (wpp WorkspacePatchProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if wpp.SQLAdministratorLoginPassword != nil {
		objectMap["sqlAdministratorLoginPassword"] = wpp.SQLAdministratorLoginPassword
	}
	if wpp.ManagedVirtualNetworkSettings != nil {
		objectMap["managedVirtualNetworkSettings"] = wpp.ManagedVirtualNetworkSettings
	}
	if wpp.WorkspaceRepositoryConfiguration != nil {
		objectMap["workspaceRepositoryConfiguration"] = wpp.WorkspaceRepositoryConfiguration
	}
	if wpp.PurviewConfiguration != nil {
		objectMap["purviewConfiguration"] = wpp.PurviewConfiguration
	}
	if wpp.Encryption != nil {
		objectMap["encryption"] = wpp.Encryption
	}
	if wpp.PublicNetworkAccess != "" {
		objectMap["publicNetworkAccess"] = wpp.PublicNetworkAccess
	}
	return json.Marshal(objectMap)
}

// WorkspaceProperties workspace properties
type WorkspaceProperties struct {
	// DefaultDataLakeStorage - Workspace default data lake storage account details
	DefaultDataLakeStorage *DataLakeStorageAccountDetails `json:"defaultDataLakeStorage,omitempty"`
	// SQLAdministratorLoginPassword - SQL administrator login password
	SQLAdministratorLoginPassword *string `json:"sqlAdministratorLoginPassword,omitempty"`
	// ManagedResourceGroupName - Workspace managed resource group. The resource group name uniquely identifies the resource group within the user subscriptionId. The resource group name must be no longer than 90 characters long, and must be alphanumeric characters (Char.IsLetterOrDigit()) and '-', '_', '(', ')' and'.'. Note that the name cannot end with '.'
	ManagedResourceGroupName *string `json:"managedResourceGroupName,omitempty"`
	// ProvisioningState - READ-ONLY; Resource provisioning state
	ProvisioningState *string `json:"provisioningState,omitempty"`
	// SQLAdministratorLogin - Login for workspace SQL active directory administrator
	SQLAdministratorLogin *string `json:"sqlAdministratorLogin,omitempty"`
	// VirtualNetworkProfile - Virtual Network profile
	VirtualNetworkProfile *VirtualNetworkProfile `json:"virtualNetworkProfile,omitempty"`
	// ConnectivityEndpoints - Connectivity endpoints
	ConnectivityEndpoints map[string]*string `json:"connectivityEndpoints"`
	// ManagedVirtualNetwork - Setting this to 'default' will ensure that all compute for this workspace is in a virtual network managed on behalf of the user.
	ManagedVirtualNetwork *string `json:"managedVirtualNetwork,omitempty"`
	// PrivateEndpointConnections - Private endpoint connections to the workspace
	PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"`
	// Encryption - The encryption details of the workspace
	Encryption *EncryptionDetails `json:"encryption,omitempty"`
	// WorkspaceUID - READ-ONLY; The workspace unique identifier
	WorkspaceUID *uuid.UUID `json:"workspaceUID,omitempty"`
	// ExtraProperties - READ-ONLY; Workspace level configs and feature flags
	ExtraProperties map[string]interface{} `json:"extraProperties"`
	// ManagedVirtualNetworkSettings - Managed Virtual Network Settings
	ManagedVirtualNetworkSettings *ManagedVirtualNetworkSettings `json:"managedVirtualNetworkSettings,omitempty"`
	// WorkspaceRepositoryConfiguration - Git integration settings
	WorkspaceRepositoryConfiguration *WorkspaceRepositoryConfiguration `json:"workspaceRepositoryConfiguration,omitempty"`
	// PurviewConfiguration - Purview Configuration
	PurviewConfiguration *PurviewConfiguration `json:"purviewConfiguration,omitempty"`
	// AdlaResourceID - READ-ONLY; The ADLA resource ID.
	AdlaResourceID *string `json:"adlaResourceId,omitempty"`
	// PublicNetworkAccess - Enable or Disable public network access to workspace. Possible values include: 'WorkspacePublicNetworkAccessEnabled', 'WorkspacePublicNetworkAccessDisabled'
	PublicNetworkAccess WorkspacePublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
	// CspWorkspaceAdminProperties - Initial workspace AAD admin properties for a CSP subscription
	CspWorkspaceAdminProperties *CspWorkspaceAdminProperties `json:"cspWorkspaceAdminProperties,omitempty"`
	// Settings - READ-ONLY; Workspace settings
	Settings map[string]interface{} `json:"settings"`
	// AzureADOnlyAuthentication - Enable or Disable AzureADOnlyAuthentication on All Workspace subresource
	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"`
	// TrustedServiceBypassEnabled - Is trustedServiceBypassEnabled for the workspace
	TrustedServiceBypassEnabled *bool `json:"trustedServiceBypassEnabled,omitempty"`
}

// MarshalJSON is the custom marshaler for WorkspaceProperties.
func (wp WorkspaceProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if wp.DefaultDataLakeStorage != nil {
		objectMap["defaultDataLakeStorage"] = wp.DefaultDataLakeStorage
	}
	if wp.SQLAdministratorLoginPassword != nil {
		objectMap["sqlAdministratorLoginPassword"] = wp.SQLAdministratorLoginPassword
	}
	if wp.ManagedResourceGroupName != nil {
		objectMap["managedResourceGroupName"] = wp.ManagedResourceGroupName
	}
	if wp.SQLAdministratorLogin != nil {
		objectMap["sqlAdministratorLogin"] = wp.SQLAdministratorLogin
	}
	if wp.VirtualNetworkProfile != nil {
		objectMap["virtualNetworkProfile"] = wp.VirtualNetworkProfile
	}
	if wp.ConnectivityEndpoints != nil {
		objectMap["connectivityEndpoints"] = wp.ConnectivityEndpoints
	}
	if wp.ManagedVirtualNetwork != nil {
		objectMap["managedVirtualNetwork"] = wp.ManagedVirtualNetwork
	}
	if wp.PrivateEndpointConnections != nil {
		objectMap["privateEndpointConnections"] = wp.PrivateEndpointConnections
	}
	if wp.Encryption != nil {
		objectMap["encryption"] = wp.Encryption
	}
	if wp.ManagedVirtualNetworkSettings != nil {
		objectMap["managedVirtualNetworkSettings"] = wp.ManagedVirtualNetworkSettings
	}
	if wp.WorkspaceRepositoryConfiguration != nil {
		objectMap["workspaceRepositoryConfiguration"] = wp.WorkspaceRepositoryConfiguration
	}
	if wp.PurviewConfiguration != nil {
		objectMap["purviewConfiguration"] = wp.PurviewConfiguration
	}
	if wp.PublicNetworkAccess != "" {
		objectMap["publicNetworkAccess"] = wp.PublicNetworkAccess
	}
	if wp.CspWorkspaceAdminProperties != nil {
		objectMap["cspWorkspaceAdminProperties"] = wp.CspWorkspaceAdminProperties
	}
	if wp.AzureADOnlyAuthentication != nil {
		objectMap["azureADOnlyAuthentication"] = wp.AzureADOnlyAuthentication
	}
	if wp.TrustedServiceBypassEnabled != nil {
		objectMap["trustedServiceBypassEnabled"] = wp.TrustedServiceBypassEnabled
	}
	return json.Marshal(objectMap)
}

// WorkspaceRepositoryConfiguration git integration settings
type WorkspaceRepositoryConfiguration struct {
	// Type - Type of workspace repositoryID configuration. Example WorkspaceVSTSConfiguration, WorkspaceGitHubConfiguration
	Type *string `json:"type,omitempty"`
	// HostName - GitHub Enterprise host name. For example: https://github.mydomain.com
	HostName *string `json:"hostName,omitempty"`
	// AccountName - Account name
	AccountName *string `json:"accountName,omitempty"`
	// ProjectName - VSTS project name
	ProjectName *string `json:"projectName,omitempty"`
	// RepositoryName - Repository name
	RepositoryName *string `json:"repositoryName,omitempty"`
	// CollaborationBranch - Collaboration branch
	CollaborationBranch *string `json:"collaborationBranch,omitempty"`
	// RootFolder - Root folder to use in the repository
	RootFolder *string `json:"rootFolder,omitempty"`
	// LastCommitID - The last commit ID
	LastCommitID *string `json:"lastCommitId,omitempty"`
	// TenantID - The VSTS tenant ID
	TenantID *uuid.UUID `json:"tenantId,omitempty"`
}

// WorkspacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type WorkspacesCreateOrUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(WorkspacesClient) (Workspace, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *WorkspacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for WorkspacesCreateOrUpdateFuture.Result.
func (future *WorkspacesCreateOrUpdateFuture) result(client WorkspacesClient) (w Workspace, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.WorkspacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		w.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.WorkspacesCreateOrUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if w.Response.Response, err = future.GetResult(sender); err == nil && w.Response.Response.StatusCode != http.StatusNoContent {
		w, err = client.CreateOrUpdateResponder(w.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.WorkspacesCreateOrUpdateFuture", "Result", w.Response.Response, "Failure responding to request")
		}
	}
	return
}

// WorkspacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type WorkspacesDeleteFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(WorkspacesClient) (SetObject, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *WorkspacesDeleteFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for WorkspacesDeleteFuture.Result.
func (future *WorkspacesDeleteFuture) result(client WorkspacesClient) (so SetObject, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.WorkspacesDeleteFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		so.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.WorkspacesDeleteFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent {
		so, err = client.DeleteResponder(so.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.WorkspacesDeleteFuture", "Result", so.Response.Response, "Failure responding to request")
		}
	}
	return
}

// WorkspaceSQLAadAdminsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type WorkspaceSQLAadAdminsCreateOrUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(WorkspaceSQLAadAdminsClient) (WorkspaceAadAdminInfo, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *WorkspaceSQLAadAdminsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for WorkspaceSQLAadAdminsCreateOrUpdateFuture.Result.
func (future *WorkspaceSQLAadAdminsCreateOrUpdateFuture) result(client WorkspaceSQLAadAdminsClient) (waai WorkspaceAadAdminInfo, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.WorkspaceSQLAadAdminsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		waai.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.WorkspaceSQLAadAdminsCreateOrUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if waai.Response.Response, err = future.GetResult(sender); err == nil && waai.Response.Response.StatusCode != http.StatusNoContent {
		waai, err = client.CreateOrUpdateResponder(waai.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.WorkspaceSQLAadAdminsCreateOrUpdateFuture", "Result", waai.Response.Response, "Failure responding to request")
		}
	}
	return
}

// WorkspaceSQLAadAdminsDeleteFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type WorkspaceSQLAadAdminsDeleteFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(WorkspaceSQLAadAdminsClient) (autorest.Response, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *WorkspaceSQLAadAdminsDeleteFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for WorkspaceSQLAadAdminsDeleteFuture.Result.
func (future *WorkspaceSQLAadAdminsDeleteFuture) result(client WorkspaceSQLAadAdminsClient) (ar autorest.Response, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.WorkspaceSQLAadAdminsDeleteFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ar.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.WorkspaceSQLAadAdminsDeleteFuture")
		return
	}
	ar.Response = future.Response()
	return
}

// WorkspacesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type WorkspacesUpdateFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(WorkspacesClient) (Workspace, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *WorkspacesUpdateFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for WorkspacesUpdateFuture.Result.
func (future *WorkspacesUpdateFuture) result(client WorkspacesClient) (w Workspace, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "synapse.WorkspacesUpdateFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		w.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("synapse.WorkspacesUpdateFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if w.Response.Response, err = future.GetResult(sender); err == nil && w.Response.Response.StatusCode != http.StatusNoContent {
		w, err = client.UpdateResponder(w.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "synapse.WorkspacesUpdateFuture", "Result", w.Response.Response, "Failure responding to request")
		}
	}
	return
}
