diff --git a/profiles/latest/sql/mgmt/sql/models.go b/profiles/latest/sql/mgmt/sql/models.go index 250d9c622dff..21281d393c61 100644 --- a/profiles/latest/sql/mgmt/sql/models.go +++ b/profiles/latest/sql/mgmt/sql/models.go @@ -25,15 +25,6 @@ const ( DefaultBaseURI = original.DefaultBaseURI ) -type AdvisorStatus = original.AdvisorStatus - -const ( - GA AdvisorStatus = original.GA - LimitedPublicPreview AdvisorStatus = original.LimitedPublicPreview - PrivatePreview AdvisorStatus = original.PrivatePreview - PublicPreview AdvisorStatus = original.PublicPreview -) - type AuthenticationType = original.AuthenticationType const ( @@ -41,30 +32,6 @@ const ( SQL AuthenticationType = original.SQL ) -type AutoExecuteStatus = original.AutoExecuteStatus - -const ( - Default AutoExecuteStatus = original.Default - Disabled AutoExecuteStatus = original.Disabled - Enabled AutoExecuteStatus = original.Enabled -) - -type BackupLongTermRetentionPolicyState = original.BackupLongTermRetentionPolicyState - -const ( - BackupLongTermRetentionPolicyStateDisabled BackupLongTermRetentionPolicyState = original.BackupLongTermRetentionPolicyStateDisabled - BackupLongTermRetentionPolicyStateEnabled BackupLongTermRetentionPolicyState = original.BackupLongTermRetentionPolicyStateEnabled -) - -type CapabilityStatus = original.CapabilityStatus - -const ( - CapabilityStatusAvailable CapabilityStatus = original.CapabilityStatusAvailable - CapabilityStatusDefault CapabilityStatus = original.CapabilityStatusDefault - CapabilityStatusDisabled CapabilityStatus = original.CapabilityStatusDisabled - CapabilityStatusVisible CapabilityStatus = original.CapabilityStatusVisible -) - type CheckNameAvailabilityReason = original.CheckNameAvailabilityReason const ( @@ -75,39 +42,14 @@ const ( type CreateMode = original.CreateMode const ( - CreateModeCopy CreateMode = original.CreateModeCopy - CreateModeDefault CreateMode = original.CreateModeDefault - CreateModeNonReadableSecondary CreateMode = original.CreateModeNonReadableSecondary - CreateModeOnlineSecondary CreateMode = original.CreateModeOnlineSecondary - CreateModePointInTimeRestore CreateMode = original.CreateModePointInTimeRestore - CreateModeRecovery CreateMode = original.CreateModeRecovery - CreateModeRestore CreateMode = original.CreateModeRestore - CreateModeRestoreLongTermRetentionBackup CreateMode = original.CreateModeRestoreLongTermRetentionBackup -) - -type DataMaskingFunction = original.DataMaskingFunction - -const ( - DataMaskingFunctionCCN DataMaskingFunction = original.DataMaskingFunctionCCN - DataMaskingFunctionDefault DataMaskingFunction = original.DataMaskingFunctionDefault - DataMaskingFunctionEmail DataMaskingFunction = original.DataMaskingFunctionEmail - DataMaskingFunctionNumber DataMaskingFunction = original.DataMaskingFunctionNumber - DataMaskingFunctionSSN DataMaskingFunction = original.DataMaskingFunctionSSN - DataMaskingFunctionText DataMaskingFunction = original.DataMaskingFunctionText -) - -type DataMaskingRuleState = original.DataMaskingRuleState - -const ( - DataMaskingRuleStateDisabled DataMaskingRuleState = original.DataMaskingRuleStateDisabled - DataMaskingRuleStateEnabled DataMaskingRuleState = original.DataMaskingRuleStateEnabled -) - -type DataMaskingState = original.DataMaskingState - -const ( - DataMaskingStateDisabled DataMaskingState = original.DataMaskingStateDisabled - DataMaskingStateEnabled DataMaskingState = original.DataMaskingStateEnabled + Copy CreateMode = original.Copy + Default CreateMode = original.Default + NonReadableSecondary CreateMode = original.NonReadableSecondary + OnlineSecondary CreateMode = original.OnlineSecondary + PointInTimeRestore CreateMode = original.PointInTimeRestore + Recovery CreateMode = original.Recovery + Restore CreateMode = original.Restore + RestoreLongTermRetentionBackup CreateMode = original.RestoreLongTermRetentionBackup ) type DatabaseEdition = original.DatabaseEdition @@ -129,37 +71,6 @@ const ( Web DatabaseEdition = original.Web ) -type DisasterRecoveryConfigurationAutoFailover = original.DisasterRecoveryConfigurationAutoFailover - -const ( - Off DisasterRecoveryConfigurationAutoFailover = original.Off - On DisasterRecoveryConfigurationAutoFailover = original.On -) - -type DisasterRecoveryConfigurationFailoverPolicy = original.DisasterRecoveryConfigurationFailoverPolicy - -const ( - Automatic DisasterRecoveryConfigurationFailoverPolicy = original.Automatic - Manual DisasterRecoveryConfigurationFailoverPolicy = original.Manual -) - -type DisasterRecoveryConfigurationRole = original.DisasterRecoveryConfigurationRole - -const ( - None DisasterRecoveryConfigurationRole = original.None - Primary DisasterRecoveryConfigurationRole = original.Primary - Secondary DisasterRecoveryConfigurationRole = original.Secondary -) - -type DisasterRecoveryConfigurationStatus = original.DisasterRecoveryConfigurationStatus - -const ( - Creating DisasterRecoveryConfigurationStatus = original.Creating - Dropping DisasterRecoveryConfigurationStatus = original.Dropping - FailingOver DisasterRecoveryConfigurationStatus = original.FailingOver - Ready DisasterRecoveryConfigurationStatus = original.Ready -) - type ElasticPoolEdition = original.ElasticPoolEdition const ( @@ -173,79 +84,9 @@ const ( type ElasticPoolState = original.ElasticPoolState const ( - ElasticPoolStateCreating ElasticPoolState = original.ElasticPoolStateCreating - ElasticPoolStateDisabled ElasticPoolState = original.ElasticPoolStateDisabled - ElasticPoolStateReady ElasticPoolState = original.ElasticPoolStateReady -) - -type GeoBackupPolicyState = original.GeoBackupPolicyState - -const ( - GeoBackupPolicyStateDisabled GeoBackupPolicyState = original.GeoBackupPolicyStateDisabled - GeoBackupPolicyStateEnabled GeoBackupPolicyState = original.GeoBackupPolicyStateEnabled -) - -type MaxSizeUnits = original.MaxSizeUnits - -const ( - Gigabytes MaxSizeUnits = original.Gigabytes - Megabytes MaxSizeUnits = original.Megabytes - Petabytes MaxSizeUnits = original.Petabytes - Terabytes MaxSizeUnits = original.Terabytes -) - -type PerformanceLevelUnit = original.PerformanceLevelUnit - -const ( - DTU PerformanceLevelUnit = original.DTU -) - -type PrimaryAggregationType = original.PrimaryAggregationType - -const ( - PrimaryAggregationTypeAverage PrimaryAggregationType = original.PrimaryAggregationTypeAverage - PrimaryAggregationTypeCount PrimaryAggregationType = original.PrimaryAggregationTypeCount - PrimaryAggregationTypeMaximum PrimaryAggregationType = original.PrimaryAggregationTypeMaximum - PrimaryAggregationTypeMinimum PrimaryAggregationType = original.PrimaryAggregationTypeMinimum - PrimaryAggregationTypeNone PrimaryAggregationType = original.PrimaryAggregationTypeNone - PrimaryAggregationTypeTotal PrimaryAggregationType = original.PrimaryAggregationTypeTotal -) - -type QueryAggregationFunction = original.QueryAggregationFunction - -const ( - Avg QueryAggregationFunction = original.Avg - Max QueryAggregationFunction = original.Max - Min QueryAggregationFunction = original.Min - Sum QueryAggregationFunction = original.Sum -) - -type QueryExecutionType = original.QueryExecutionType - -const ( - Aborted QueryExecutionType = original.Aborted - Any QueryExecutionType = original.Any - Exception QueryExecutionType = original.Exception - Irregular QueryExecutionType = original.Irregular - Regular QueryExecutionType = original.Regular -) - -type QueryMetricUnit = original.QueryMetricUnit - -const ( - KB QueryMetricUnit = original.KB - Microseconds QueryMetricUnit = original.Microseconds - Percentage QueryMetricUnit = original.Percentage -) - -type QueryObservedMetricType = original.QueryObservedMetricType - -const ( - CPU QueryObservedMetricType = original.CPU - Duration QueryObservedMetricType = original.Duration - ExecutionCount QueryObservedMetricType = original.ExecutionCount - Io QueryObservedMetricType = original.Io - Logio QueryObservedMetricType = original.Logio + Creating ElasticPoolState = original.Creating + Disabled ElasticPoolState = original.Disabled + Ready ElasticPoolState = original.Ready ) type ReadScale = original.ReadScale @@ -307,13 +148,6 @@ const ( SUSPENDED ReplicationState = original.SUSPENDED ) -type RestorePointType = original.RestorePointType - -const ( - CONTINUOUS RestorePointType = original.CONTINUOUS - DISCRETE RestorePointType = original.DISCRETE -) - type SampleName = original.SampleName const ( @@ -342,28 +176,6 @@ const ( SecurityAlertPolicyUseServerDefaultEnabled SecurityAlertPolicyUseServerDefault = original.SecurityAlertPolicyUseServerDefaultEnabled ) -type ServerConnectionType = original.ServerConnectionType - -const ( - ServerConnectionTypeDefault ServerConnectionType = original.ServerConnectionTypeDefault - ServerConnectionTypeProxy ServerConnectionType = original.ServerConnectionTypeProxy - ServerConnectionTypeRedirect ServerConnectionType = original.ServerConnectionTypeRedirect -) - -type ServerState = original.ServerState - -const ( - ServerStateDisabled ServerState = original.ServerStateDisabled - ServerStateReady ServerState = original.ServerStateReady -) - -type ServerVersion = original.ServerVersion - -const ( - OneTwoFullStopZero ServerVersion = original.OneTwoFullStopZero - TwoFullStopZero ServerVersion = original.TwoFullStopZero -) - type ServiceObjectiveName = original.ServiceObjectiveName const ( @@ -455,70 +267,16 @@ const ( TransparentDataEncryptionStatusEnabled TransparentDataEncryptionStatus = original.TransparentDataEncryptionStatusEnabled ) -type UnitDefinitionType = original.UnitDefinitionType - -const ( - Bytes UnitDefinitionType = original.Bytes - BytesPerSecond UnitDefinitionType = original.BytesPerSecond - Count UnitDefinitionType = original.Count - CountPerSecond UnitDefinitionType = original.CountPerSecond - Percent UnitDefinitionType = original.Percent - Seconds UnitDefinitionType = original.Seconds -) - -type UnitType = original.UnitType - -const ( - UnitTypeBytes UnitType = original.UnitTypeBytes - UnitTypeBytesPerSecond UnitType = original.UnitTypeBytesPerSecond - UnitTypeCount UnitType = original.UnitTypeCount - UnitTypeCountPerSecond UnitType = original.UnitTypeCountPerSecond - UnitTypePercent UnitType = original.UnitTypePercent - UnitTypeSeconds UnitType = original.UnitTypeSeconds -) - -type Advisor = original.Advisor -type AdvisorListResult = original.AdvisorListResult -type AdvisorProperties = original.AdvisorProperties -type BackupLongTermRetentionPoliciesClient = original.BackupLongTermRetentionPoliciesClient -type BackupLongTermRetentionPoliciesCreateOrUpdateFuture = original.BackupLongTermRetentionPoliciesCreateOrUpdateFuture -type BackupLongTermRetentionPolicy = original.BackupLongTermRetentionPolicy -type BackupLongTermRetentionPolicyListResult = original.BackupLongTermRetentionPolicyListResult -type BackupLongTermRetentionPolicyProperties = original.BackupLongTermRetentionPolicyProperties -type BackupLongTermRetentionVault = original.BackupLongTermRetentionVault -type BackupLongTermRetentionVaultListResult = original.BackupLongTermRetentionVaultListResult -type BackupLongTermRetentionVaultProperties = original.BackupLongTermRetentionVaultProperties -type BackupLongTermRetentionVaultsClient = original.BackupLongTermRetentionVaultsClient -type BackupLongTermRetentionVaultsCreateOrUpdateFuture = original.BackupLongTermRetentionVaultsCreateOrUpdateFuture type BaseClient = original.BaseClient -type CapabilitiesClient = original.CapabilitiesClient type CheckNameAvailabilityRequest = original.CheckNameAvailabilityRequest type CheckNameAvailabilityResponse = original.CheckNameAvailabilityResponse -type DataMaskingPoliciesClient = original.DataMaskingPoliciesClient -type DataMaskingPolicy = original.DataMaskingPolicy -type DataMaskingPolicyProperties = original.DataMaskingPolicyProperties -type DataMaskingRule = original.DataMaskingRule -type DataMaskingRuleListResult = original.DataMaskingRuleListResult -type DataMaskingRuleProperties = original.DataMaskingRuleProperties -type DataMaskingRulesClient = original.DataMaskingRulesClient type Database = original.Database -type DatabaseAdvisorsClient = original.DatabaseAdvisorsClient -type DatabaseConnectionPoliciesClient = original.DatabaseConnectionPoliciesClient -type DatabaseConnectionPolicy = original.DatabaseConnectionPolicy -type DatabaseConnectionPolicyProperties = original.DatabaseConnectionPolicyProperties type DatabaseListResult = original.DatabaseListResult type DatabaseProperties = original.DatabaseProperties type DatabaseSecurityAlertPolicy = original.DatabaseSecurityAlertPolicy type DatabaseSecurityAlertPolicyProperties = original.DatabaseSecurityAlertPolicyProperties -type DatabaseTableAuditingPoliciesClient = original.DatabaseTableAuditingPoliciesClient -type DatabaseTableAuditingPolicy = original.DatabaseTableAuditingPolicy -type DatabaseTableAuditingPolicyListResult = original.DatabaseTableAuditingPolicyListResult -type DatabaseTableAuditingPolicyProperties = original.DatabaseTableAuditingPolicyProperties type DatabaseThreatDetectionPoliciesClient = original.DatabaseThreatDetectionPoliciesClient type DatabaseUpdate = original.DatabaseUpdate -type DatabaseUsage = original.DatabaseUsage -type DatabaseUsageListResult = original.DatabaseUsageListResult -type DatabaseUsagesClient = original.DatabaseUsagesClient type DatabasesClient = original.DatabasesClient type DatabasesCreateImportOperationFuture = original.DatabasesCreateImportOperationFuture type DatabasesCreateOrUpdateFuture = original.DatabasesCreateOrUpdateFuture @@ -527,15 +285,6 @@ type DatabasesImportFuture = original.DatabasesImportFuture type DatabasesPauseFuture = original.DatabasesPauseFuture type DatabasesResumeFuture = original.DatabasesResumeFuture type DatabasesUpdateFuture = original.DatabasesUpdateFuture -type DisasterRecoveryConfiguration = original.DisasterRecoveryConfiguration -type DisasterRecoveryConfigurationListResult = original.DisasterRecoveryConfigurationListResult -type DisasterRecoveryConfigurationProperties = original.DisasterRecoveryConfigurationProperties -type DisasterRecoveryConfigurationsClient = original.DisasterRecoveryConfigurationsClient -type DisasterRecoveryConfigurationsCreateOrUpdateFuture = original.DisasterRecoveryConfigurationsCreateOrUpdateFuture -type DisasterRecoveryConfigurationsDeleteFuture = original.DisasterRecoveryConfigurationsDeleteFuture -type DisasterRecoveryConfigurationsFailoverAllowDataLossFuture = original.DisasterRecoveryConfigurationsFailoverAllowDataLossFuture -type DisasterRecoveryConfigurationsFailoverFuture = original.DisasterRecoveryConfigurationsFailoverFuture -type EditionCapability = original.EditionCapability type ElasticPool = original.ElasticPool type ElasticPoolActivitiesClient = original.ElasticPoolActivitiesClient type ElasticPoolActivity = original.ElasticPoolActivity @@ -545,57 +294,24 @@ type ElasticPoolDatabaseActivitiesClient = original.ElasticPoolDatabaseActivitie type ElasticPoolDatabaseActivity = original.ElasticPoolDatabaseActivity type ElasticPoolDatabaseActivityListResult = original.ElasticPoolDatabaseActivityListResult type ElasticPoolDatabaseActivityProperties = original.ElasticPoolDatabaseActivityProperties -type ElasticPoolDtuCapability = original.ElasticPoolDtuCapability -type ElasticPoolEditionCapability = original.ElasticPoolEditionCapability type ElasticPoolListResult = original.ElasticPoolListResult -type ElasticPoolPerDatabaseMaxDtuCapability = original.ElasticPoolPerDatabaseMaxDtuCapability -type ElasticPoolPerDatabaseMinDtuCapability = original.ElasticPoolPerDatabaseMinDtuCapability type ElasticPoolProperties = original.ElasticPoolProperties type ElasticPoolUpdate = original.ElasticPoolUpdate type ElasticPoolsClient = original.ElasticPoolsClient type ElasticPoolsCreateOrUpdateFuture = original.ElasticPoolsCreateOrUpdateFuture type ElasticPoolsUpdateFuture = original.ElasticPoolsUpdateFuture type ExportRequest = original.ExportRequest -type ExtensionListResult = original.ExtensionListResult -type ExtensionsClient = original.ExtensionsClient type FirewallRule = original.FirewallRule type FirewallRuleListResult = original.FirewallRuleListResult type FirewallRuleProperties = original.FirewallRuleProperties type FirewallRulesClient = original.FirewallRulesClient -type GeoBackupPoliciesClient = original.GeoBackupPoliciesClient -type GeoBackupPolicy = original.GeoBackupPolicy -type GeoBackupPolicyListResult = original.GeoBackupPolicyListResult -type GeoBackupPolicyProperties = original.GeoBackupPolicyProperties type ImportExportResponse = original.ImportExportResponse type ImportExportResponseProperties = original.ImportExportResponseProperties type ImportExtensionProperties = original.ImportExtensionProperties type ImportExtensionRequest = original.ImportExtensionRequest type ImportRequest = original.ImportRequest -type LocationCapabilities = original.LocationCapabilities -type MaxSizeCapability = original.MaxSizeCapability -type Metric = original.Metric -type MetricAvailability = original.MetricAvailability -type MetricDefinition = original.MetricDefinition -type MetricDefinitionListResult = original.MetricDefinitionListResult -type MetricListResult = original.MetricListResult -type MetricName = original.MetricName -type MetricValue = original.MetricValue -type Operation = original.Operation -type OperationDisplay = original.OperationDisplay type OperationImpact = original.OperationImpact -type OperationListResult = original.OperationListResult -type OperationsClient = original.OperationsClient -type PerformanceLevel = original.PerformanceLevel type ProxyResource = original.ProxyResource -type QueriesClient = original.QueriesClient -type QueryInterval = original.QueryInterval -type QueryMetric = original.QueryMetric -type QueryStatistic = original.QueryStatistic -type QueryStatisticListResult = original.QueryStatisticListResult -type QueryStatisticsClient = original.QueryStatisticsClient -type QueryText = original.QueryText -type QueryTextListResult = original.QueryTextListResult -type QueryTextsClient = original.QueryTextsClient type RecommendedElasticPool = original.RecommendedElasticPool type RecommendedElasticPoolListMetricsResult = original.RecommendedElasticPoolListMetricsResult type RecommendedElasticPoolListResult = original.RecommendedElasticPoolListResult @@ -604,10 +320,6 @@ type RecommendedElasticPoolProperties = original.RecommendedElasticPoolPropertie type RecommendedElasticPoolsClient = original.RecommendedElasticPoolsClient type RecommendedIndex = original.RecommendedIndex type RecommendedIndexProperties = original.RecommendedIndexProperties -type RecoverableDatabase = original.RecoverableDatabase -type RecoverableDatabaseListResult = original.RecoverableDatabaseListResult -type RecoverableDatabaseProperties = original.RecoverableDatabaseProperties -type RecoverableDatabasesClient = original.RecoverableDatabasesClient type ReplicationLink = original.ReplicationLink type ReplicationLinkListResult = original.ReplicationLinkListResult type ReplicationLinkProperties = original.ReplicationLinkProperties @@ -615,141 +327,36 @@ type ReplicationLinksClient = original.ReplicationLinksClient type ReplicationLinksFailoverAllowDataLossFuture = original.ReplicationLinksFailoverAllowDataLossFuture type ReplicationLinksFailoverFuture = original.ReplicationLinksFailoverFuture type Resource = original.Resource -type RestorableDroppedDatabase = original.RestorableDroppedDatabase -type RestorableDroppedDatabaseListResult = original.RestorableDroppedDatabaseListResult -type RestorableDroppedDatabaseProperties = original.RestorableDroppedDatabaseProperties -type RestorableDroppedDatabasesClient = original.RestorableDroppedDatabasesClient -type RestorePoint = original.RestorePoint -type RestorePointListResult = original.RestorePointListResult -type RestorePointProperties = original.RestorePointProperties -type RestorePointsClient = original.RestorePointsClient -type Server = original.Server -type ServerAdministratorListResult = original.ServerAdministratorListResult -type ServerAdministratorProperties = original.ServerAdministratorProperties -type ServerAdvisorsClient = original.ServerAdvisorsClient -type ServerAzureADAdministrator = original.ServerAzureADAdministrator -type ServerAzureADAdministratorsClient = original.ServerAzureADAdministratorsClient -type ServerAzureADAdministratorsCreateOrUpdateFuture = original.ServerAzureADAdministratorsCreateOrUpdateFuture -type ServerAzureADAdministratorsDeleteFuture = original.ServerAzureADAdministratorsDeleteFuture -type ServerCommunicationLink = original.ServerCommunicationLink -type ServerCommunicationLinkListResult = original.ServerCommunicationLinkListResult -type ServerCommunicationLinkProperties = original.ServerCommunicationLinkProperties -type ServerCommunicationLinksClient = original.ServerCommunicationLinksClient -type ServerCommunicationLinksCreateOrUpdateFuture = original.ServerCommunicationLinksCreateOrUpdateFuture -type ServerConnectionPoliciesClient = original.ServerConnectionPoliciesClient -type ServerConnectionPolicy = original.ServerConnectionPolicy -type ServerConnectionPolicyProperties = original.ServerConnectionPolicyProperties -type ServerListResult = original.ServerListResult -type ServerProperties = original.ServerProperties -type ServerTableAuditingPoliciesClient = original.ServerTableAuditingPoliciesClient -type ServerTableAuditingPolicy = original.ServerTableAuditingPolicy -type ServerTableAuditingPolicyListResult = original.ServerTableAuditingPolicyListResult -type ServerTableAuditingPolicyProperties = original.ServerTableAuditingPolicyProperties -type ServerUpdate = original.ServerUpdate -type ServerUsage = original.ServerUsage -type ServerUsageListResult = original.ServerUsageListResult -type ServerUsagesClient = original.ServerUsagesClient -type ServerVersionCapability = original.ServerVersionCapability type ServersClient = original.ServersClient -type ServiceObjective = original.ServiceObjective -type ServiceObjectiveCapability = original.ServiceObjectiveCapability -type ServiceObjectiveListResult = original.ServiceObjectiveListResult -type ServiceObjectiveProperties = original.ServiceObjectiveProperties -type ServiceObjectivesClient = original.ServiceObjectivesClient type ServiceTierAdvisor = original.ServiceTierAdvisor type ServiceTierAdvisorListResult = original.ServiceTierAdvisorListResult type ServiceTierAdvisorProperties = original.ServiceTierAdvisorProperties type ServiceTierAdvisorsClient = original.ServiceTierAdvisorsClient type SloUsageMetric = original.SloUsageMetric -type TableAuditingPolicyProperties = original.TableAuditingPolicyProperties -type TopQueries = original.TopQueries -type TopQueriesListResult = original.TopQueriesListResult type TrackedResource = original.TrackedResource type TransparentDataEncryption = original.TransparentDataEncryption type TransparentDataEncryptionActivitiesClient = original.TransparentDataEncryptionActivitiesClient type TransparentDataEncryptionActivity = original.TransparentDataEncryptionActivity type TransparentDataEncryptionActivityListResult = original.TransparentDataEncryptionActivityListResult type TransparentDataEncryptionActivityProperties = original.TransparentDataEncryptionActivityProperties -type TransparentDataEncryptionConfigurationsClient = original.TransparentDataEncryptionConfigurationsClient -type TransparentDataEncryptionListResult = original.TransparentDataEncryptionListResult type TransparentDataEncryptionProperties = original.TransparentDataEncryptionProperties type TransparentDataEncryptionsClient = original.TransparentDataEncryptionsClient func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } -func NewBackupLongTermRetentionPoliciesClient(subscriptionID string) BackupLongTermRetentionPoliciesClient { - return original.NewBackupLongTermRetentionPoliciesClient(subscriptionID) -} -func NewBackupLongTermRetentionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) BackupLongTermRetentionPoliciesClient { - return original.NewBackupLongTermRetentionPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewBackupLongTermRetentionVaultsClient(subscriptionID string) BackupLongTermRetentionVaultsClient { - return original.NewBackupLongTermRetentionVaultsClient(subscriptionID) -} -func NewBackupLongTermRetentionVaultsClientWithBaseURI(baseURI string, subscriptionID string) BackupLongTermRetentionVaultsClient { - return original.NewBackupLongTermRetentionVaultsClientWithBaseURI(baseURI, subscriptionID) -} -func NewCapabilitiesClient(subscriptionID string) CapabilitiesClient { - return original.NewCapabilitiesClient(subscriptionID) -} -func NewCapabilitiesClientWithBaseURI(baseURI string, subscriptionID string) CapabilitiesClient { - return original.NewCapabilitiesClientWithBaseURI(baseURI, subscriptionID) -} -func NewDataMaskingPoliciesClient(subscriptionID string) DataMaskingPoliciesClient { - return original.NewDataMaskingPoliciesClient(subscriptionID) -} -func NewDataMaskingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DataMaskingPoliciesClient { - return original.NewDataMaskingPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewDataMaskingRulesClient(subscriptionID string) DataMaskingRulesClient { - return original.NewDataMaskingRulesClient(subscriptionID) -} -func NewDataMaskingRulesClientWithBaseURI(baseURI string, subscriptionID string) DataMaskingRulesClient { - return original.NewDataMaskingRulesClientWithBaseURI(baseURI, subscriptionID) -} -func NewDatabaseAdvisorsClient(subscriptionID string) DatabaseAdvisorsClient { - return original.NewDatabaseAdvisorsClient(subscriptionID) -} -func NewDatabaseAdvisorsClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAdvisorsClient { - return original.NewDatabaseAdvisorsClientWithBaseURI(baseURI, subscriptionID) -} -func NewDatabaseConnectionPoliciesClient(subscriptionID string) DatabaseConnectionPoliciesClient { - return original.NewDatabaseConnectionPoliciesClient(subscriptionID) -} -func NewDatabaseConnectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseConnectionPoliciesClient { - return original.NewDatabaseConnectionPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewDatabaseTableAuditingPoliciesClient(subscriptionID string) DatabaseTableAuditingPoliciesClient { - return original.NewDatabaseTableAuditingPoliciesClient(subscriptionID) -} -func NewDatabaseTableAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseTableAuditingPoliciesClient { - return original.NewDatabaseTableAuditingPoliciesClientWithBaseURI(baseURI, subscriptionID) -} func NewDatabaseThreatDetectionPoliciesClient(subscriptionID string) DatabaseThreatDetectionPoliciesClient { return original.NewDatabaseThreatDetectionPoliciesClient(subscriptionID) } func NewDatabaseThreatDetectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseThreatDetectionPoliciesClient { return original.NewDatabaseThreatDetectionPoliciesClientWithBaseURI(baseURI, subscriptionID) } -func NewDatabaseUsagesClient(subscriptionID string) DatabaseUsagesClient { - return original.NewDatabaseUsagesClient(subscriptionID) -} -func NewDatabaseUsagesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseUsagesClient { - return original.NewDatabaseUsagesClientWithBaseURI(baseURI, subscriptionID) -} func NewDatabasesClient(subscriptionID string) DatabasesClient { return original.NewDatabasesClient(subscriptionID) } func NewDatabasesClientWithBaseURI(baseURI string, subscriptionID string) DatabasesClient { return original.NewDatabasesClientWithBaseURI(baseURI, subscriptionID) } -func NewDisasterRecoveryConfigurationsClient(subscriptionID string) DisasterRecoveryConfigurationsClient { - return original.NewDisasterRecoveryConfigurationsClient(subscriptionID) -} -func NewDisasterRecoveryConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) DisasterRecoveryConfigurationsClient { - return original.NewDisasterRecoveryConfigurationsClientWithBaseURI(baseURI, subscriptionID) -} func NewElasticPoolActivitiesClient(subscriptionID string) ElasticPoolActivitiesClient { return original.NewElasticPoolActivitiesClient(subscriptionID) } @@ -768,126 +375,30 @@ func NewElasticPoolsClient(subscriptionID string) ElasticPoolsClient { func NewElasticPoolsClientWithBaseURI(baseURI string, subscriptionID string) ElasticPoolsClient { return original.NewElasticPoolsClientWithBaseURI(baseURI, subscriptionID) } -func NewExtensionsClient(subscriptionID string) ExtensionsClient { - return original.NewExtensionsClient(subscriptionID) -} -func NewExtensionsClientWithBaseURI(baseURI string, subscriptionID string) ExtensionsClient { - return original.NewExtensionsClientWithBaseURI(baseURI, subscriptionID) -} func NewFirewallRulesClient(subscriptionID string) FirewallRulesClient { return original.NewFirewallRulesClient(subscriptionID) } func NewFirewallRulesClientWithBaseURI(baseURI string, subscriptionID string) FirewallRulesClient { return original.NewFirewallRulesClientWithBaseURI(baseURI, subscriptionID) } -func NewGeoBackupPoliciesClient(subscriptionID string) GeoBackupPoliciesClient { - return original.NewGeoBackupPoliciesClient(subscriptionID) -} -func NewGeoBackupPoliciesClientWithBaseURI(baseURI string, subscriptionID string) GeoBackupPoliciesClient { - return original.NewGeoBackupPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewOperationsClient(subscriptionID string) OperationsClient { - return original.NewOperationsClient(subscriptionID) -} -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) -} -func NewQueriesClient(subscriptionID string) QueriesClient { - return original.NewQueriesClient(subscriptionID) -} -func NewQueriesClientWithBaseURI(baseURI string, subscriptionID string) QueriesClient { - return original.NewQueriesClientWithBaseURI(baseURI, subscriptionID) -} -func NewQueryStatisticsClient(subscriptionID string) QueryStatisticsClient { - return original.NewQueryStatisticsClient(subscriptionID) -} -func NewQueryStatisticsClientWithBaseURI(baseURI string, subscriptionID string) QueryStatisticsClient { - return original.NewQueryStatisticsClientWithBaseURI(baseURI, subscriptionID) -} -func NewQueryTextsClient(subscriptionID string) QueryTextsClient { - return original.NewQueryTextsClient(subscriptionID) -} -func NewQueryTextsClientWithBaseURI(baseURI string, subscriptionID string) QueryTextsClient { - return original.NewQueryTextsClientWithBaseURI(baseURI, subscriptionID) -} func NewRecommendedElasticPoolsClient(subscriptionID string) RecommendedElasticPoolsClient { return original.NewRecommendedElasticPoolsClient(subscriptionID) } func NewRecommendedElasticPoolsClientWithBaseURI(baseURI string, subscriptionID string) RecommendedElasticPoolsClient { return original.NewRecommendedElasticPoolsClientWithBaseURI(baseURI, subscriptionID) } -func NewRecoverableDatabasesClient(subscriptionID string) RecoverableDatabasesClient { - return original.NewRecoverableDatabasesClient(subscriptionID) -} -func NewRecoverableDatabasesClientWithBaseURI(baseURI string, subscriptionID string) RecoverableDatabasesClient { - return original.NewRecoverableDatabasesClientWithBaseURI(baseURI, subscriptionID) -} func NewReplicationLinksClient(subscriptionID string) ReplicationLinksClient { return original.NewReplicationLinksClient(subscriptionID) } func NewReplicationLinksClientWithBaseURI(baseURI string, subscriptionID string) ReplicationLinksClient { return original.NewReplicationLinksClientWithBaseURI(baseURI, subscriptionID) } -func NewRestorableDroppedDatabasesClient(subscriptionID string) RestorableDroppedDatabasesClient { - return original.NewRestorableDroppedDatabasesClient(subscriptionID) -} -func NewRestorableDroppedDatabasesClientWithBaseURI(baseURI string, subscriptionID string) RestorableDroppedDatabasesClient { - return original.NewRestorableDroppedDatabasesClientWithBaseURI(baseURI, subscriptionID) -} -func NewRestorePointsClient(subscriptionID string) RestorePointsClient { - return original.NewRestorePointsClient(subscriptionID) -} -func NewRestorePointsClientWithBaseURI(baseURI string, subscriptionID string) RestorePointsClient { - return original.NewRestorePointsClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerAdvisorsClient(subscriptionID string) ServerAdvisorsClient { - return original.NewServerAdvisorsClient(subscriptionID) -} -func NewServerAdvisorsClientWithBaseURI(baseURI string, subscriptionID string) ServerAdvisorsClient { - return original.NewServerAdvisorsClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerAzureADAdministratorsClient(subscriptionID string) ServerAzureADAdministratorsClient { - return original.NewServerAzureADAdministratorsClient(subscriptionID) -} -func NewServerAzureADAdministratorsClientWithBaseURI(baseURI string, subscriptionID string) ServerAzureADAdministratorsClient { - return original.NewServerAzureADAdministratorsClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerCommunicationLinksClient(subscriptionID string) ServerCommunicationLinksClient { - return original.NewServerCommunicationLinksClient(subscriptionID) -} -func NewServerCommunicationLinksClientWithBaseURI(baseURI string, subscriptionID string) ServerCommunicationLinksClient { - return original.NewServerCommunicationLinksClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerConnectionPoliciesClient(subscriptionID string) ServerConnectionPoliciesClient { - return original.NewServerConnectionPoliciesClient(subscriptionID) -} -func NewServerConnectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServerConnectionPoliciesClient { - return original.NewServerConnectionPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerTableAuditingPoliciesClient(subscriptionID string) ServerTableAuditingPoliciesClient { - return original.NewServerTableAuditingPoliciesClient(subscriptionID) -} -func NewServerTableAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServerTableAuditingPoliciesClient { - return original.NewServerTableAuditingPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerUsagesClient(subscriptionID string) ServerUsagesClient { - return original.NewServerUsagesClient(subscriptionID) -} -func NewServerUsagesClientWithBaseURI(baseURI string, subscriptionID string) ServerUsagesClient { - return original.NewServerUsagesClientWithBaseURI(baseURI, subscriptionID) -} func NewServersClient(subscriptionID string) ServersClient { return original.NewServersClient(subscriptionID) } func NewServersClientWithBaseURI(baseURI string, subscriptionID string) ServersClient { return original.NewServersClientWithBaseURI(baseURI, subscriptionID) } -func NewServiceObjectivesClient(subscriptionID string) ServiceObjectivesClient { - return original.NewServiceObjectivesClient(subscriptionID) -} -func NewServiceObjectivesClientWithBaseURI(baseURI string, subscriptionID string) ServiceObjectivesClient { - return original.NewServiceObjectivesClientWithBaseURI(baseURI, subscriptionID) -} func NewServiceTierAdvisorsClient(subscriptionID string) ServiceTierAdvisorsClient { return original.NewServiceTierAdvisorsClient(subscriptionID) } @@ -900,12 +411,6 @@ func NewTransparentDataEncryptionActivitiesClient(subscriptionID string) Transpa func NewTransparentDataEncryptionActivitiesClientWithBaseURI(baseURI string, subscriptionID string) TransparentDataEncryptionActivitiesClient { return original.NewTransparentDataEncryptionActivitiesClientWithBaseURI(baseURI, subscriptionID) } -func NewTransparentDataEncryptionConfigurationsClient(subscriptionID string) TransparentDataEncryptionConfigurationsClient { - return original.NewTransparentDataEncryptionConfigurationsClient(subscriptionID) -} -func NewTransparentDataEncryptionConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) TransparentDataEncryptionConfigurationsClient { - return original.NewTransparentDataEncryptionConfigurationsClientWithBaseURI(baseURI, subscriptionID) -} func NewTransparentDataEncryptionsClient(subscriptionID string) TransparentDataEncryptionsClient { return original.NewTransparentDataEncryptionsClient(subscriptionID) } @@ -915,81 +420,24 @@ func NewTransparentDataEncryptionsClientWithBaseURI(baseURI string, subscription func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } -func PossibleAdvisorStatusValues() []AdvisorStatus { - return original.PossibleAdvisorStatusValues() -} func PossibleAuthenticationTypeValues() []AuthenticationType { return original.PossibleAuthenticationTypeValues() } -func PossibleAutoExecuteStatusValues() []AutoExecuteStatus { - return original.PossibleAutoExecuteStatusValues() -} -func PossibleBackupLongTermRetentionPolicyStateValues() []BackupLongTermRetentionPolicyState { - return original.PossibleBackupLongTermRetentionPolicyStateValues() -} -func PossibleCapabilityStatusValues() []CapabilityStatus { - return original.PossibleCapabilityStatusValues() -} func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason { return original.PossibleCheckNameAvailabilityReasonValues() } func PossibleCreateModeValues() []CreateMode { return original.PossibleCreateModeValues() } -func PossibleDataMaskingFunctionValues() []DataMaskingFunction { - return original.PossibleDataMaskingFunctionValues() -} -func PossibleDataMaskingRuleStateValues() []DataMaskingRuleState { - return original.PossibleDataMaskingRuleStateValues() -} -func PossibleDataMaskingStateValues() []DataMaskingState { - return original.PossibleDataMaskingStateValues() -} func PossibleDatabaseEditionValues() []DatabaseEdition { return original.PossibleDatabaseEditionValues() } -func PossibleDisasterRecoveryConfigurationAutoFailoverValues() []DisasterRecoveryConfigurationAutoFailover { - return original.PossibleDisasterRecoveryConfigurationAutoFailoverValues() -} -func PossibleDisasterRecoveryConfigurationFailoverPolicyValues() []DisasterRecoveryConfigurationFailoverPolicy { - return original.PossibleDisasterRecoveryConfigurationFailoverPolicyValues() -} -func PossibleDisasterRecoveryConfigurationRoleValues() []DisasterRecoveryConfigurationRole { - return original.PossibleDisasterRecoveryConfigurationRoleValues() -} -func PossibleDisasterRecoveryConfigurationStatusValues() []DisasterRecoveryConfigurationStatus { - return original.PossibleDisasterRecoveryConfigurationStatusValues() -} func PossibleElasticPoolEditionValues() []ElasticPoolEdition { return original.PossibleElasticPoolEditionValues() } func PossibleElasticPoolStateValues() []ElasticPoolState { return original.PossibleElasticPoolStateValues() } -func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState { - return original.PossibleGeoBackupPolicyStateValues() -} -func PossibleMaxSizeUnitsValues() []MaxSizeUnits { - return original.PossibleMaxSizeUnitsValues() -} -func PossiblePerformanceLevelUnitValues() []PerformanceLevelUnit { - return original.PossiblePerformanceLevelUnitValues() -} -func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType { - return original.PossiblePrimaryAggregationTypeValues() -} -func PossibleQueryAggregationFunctionValues() []QueryAggregationFunction { - return original.PossibleQueryAggregationFunctionValues() -} -func PossibleQueryExecutionTypeValues() []QueryExecutionType { - return original.PossibleQueryExecutionTypeValues() -} -func PossibleQueryMetricUnitValues() []QueryMetricUnit { - return original.PossibleQueryMetricUnitValues() -} -func PossibleQueryObservedMetricTypeValues() []QueryObservedMetricType { - return original.PossibleQueryObservedMetricTypeValues() -} func PossibleReadScaleValues() []ReadScale { return original.PossibleReadScaleValues() } @@ -1008,9 +456,6 @@ func PossibleReplicationRoleValues() []ReplicationRole { func PossibleReplicationStateValues() []ReplicationState { return original.PossibleReplicationStateValues() } -func PossibleRestorePointTypeValues() []RestorePointType { - return original.PossibleRestorePointTypeValues() -} func PossibleSampleNameValues() []SampleName { return original.PossibleSampleNameValues() } @@ -1023,15 +468,6 @@ func PossibleSecurityAlertPolicyStateValues() []SecurityAlertPolicyState { func PossibleSecurityAlertPolicyUseServerDefaultValues() []SecurityAlertPolicyUseServerDefault { return original.PossibleSecurityAlertPolicyUseServerDefaultValues() } -func PossibleServerConnectionTypeValues() []ServerConnectionType { - return original.PossibleServerConnectionTypeValues() -} -func PossibleServerStateValues() []ServerState { - return original.PossibleServerStateValues() -} -func PossibleServerVersionValues() []ServerVersion { - return original.PossibleServerVersionValues() -} func PossibleServiceObjectiveNameValues() []ServiceObjectiveName { return original.PossibleServiceObjectiveNameValues() } @@ -1044,12 +480,6 @@ func PossibleTransparentDataEncryptionActivityStatusValues() []TransparentDataEn func PossibleTransparentDataEncryptionStatusValues() []TransparentDataEncryptionStatus { return original.PossibleTransparentDataEncryptionStatusValues() } -func PossibleUnitDefinitionTypeValues() []UnitDefinitionType { - return original.PossibleUnitDefinitionTypeValues() -} -func PossibleUnitTypeValues() []UnitType { - return original.PossibleUnitTypeValues() -} func UserAgent() string { return original.UserAgent() + " profiles/latest" } diff --git a/profiles/latest/sql/mgmt/sql/sqlapi/models.go b/profiles/latest/sql/mgmt/sql/sqlapi/models.go index d641097b6ea9..8a1a24d93635 100644 --- a/profiles/latest/sql/mgmt/sql/sqlapi/models.go +++ b/profiles/latest/sql/mgmt/sql/sqlapi/models.go @@ -21,42 +21,15 @@ package sqlapi import original "github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2014-04-01/sql/sqlapi" -type BackupLongTermRetentionPoliciesClientAPI = original.BackupLongTermRetentionPoliciesClientAPI -type BackupLongTermRetentionVaultsClientAPI = original.BackupLongTermRetentionVaultsClientAPI -type CapabilitiesClientAPI = original.CapabilitiesClientAPI -type DataMaskingPoliciesClientAPI = original.DataMaskingPoliciesClientAPI -type DataMaskingRulesClientAPI = original.DataMaskingRulesClientAPI -type DatabaseAdvisorsClientAPI = original.DatabaseAdvisorsClientAPI -type DatabaseConnectionPoliciesClientAPI = original.DatabaseConnectionPoliciesClientAPI -type DatabaseTableAuditingPoliciesClientAPI = original.DatabaseTableAuditingPoliciesClientAPI type DatabaseThreatDetectionPoliciesClientAPI = original.DatabaseThreatDetectionPoliciesClientAPI -type DatabaseUsagesClientAPI = original.DatabaseUsagesClientAPI type DatabasesClientAPI = original.DatabasesClientAPI -type DisasterRecoveryConfigurationsClientAPI = original.DisasterRecoveryConfigurationsClientAPI type ElasticPoolActivitiesClientAPI = original.ElasticPoolActivitiesClientAPI type ElasticPoolDatabaseActivitiesClientAPI = original.ElasticPoolDatabaseActivitiesClientAPI type ElasticPoolsClientAPI = original.ElasticPoolsClientAPI -type ExtensionsClientAPI = original.ExtensionsClientAPI type FirewallRulesClientAPI = original.FirewallRulesClientAPI -type GeoBackupPoliciesClientAPI = original.GeoBackupPoliciesClientAPI -type OperationsClientAPI = original.OperationsClientAPI -type QueriesClientAPI = original.QueriesClientAPI -type QueryStatisticsClientAPI = original.QueryStatisticsClientAPI -type QueryTextsClientAPI = original.QueryTextsClientAPI type RecommendedElasticPoolsClientAPI = original.RecommendedElasticPoolsClientAPI -type RecoverableDatabasesClientAPI = original.RecoverableDatabasesClientAPI type ReplicationLinksClientAPI = original.ReplicationLinksClientAPI -type RestorableDroppedDatabasesClientAPI = original.RestorableDroppedDatabasesClientAPI -type RestorePointsClientAPI = original.RestorePointsClientAPI -type ServerAdvisorsClientAPI = original.ServerAdvisorsClientAPI -type ServerAzureADAdministratorsClientAPI = original.ServerAzureADAdministratorsClientAPI -type ServerCommunicationLinksClientAPI = original.ServerCommunicationLinksClientAPI -type ServerConnectionPoliciesClientAPI = original.ServerConnectionPoliciesClientAPI -type ServerTableAuditingPoliciesClientAPI = original.ServerTableAuditingPoliciesClientAPI -type ServerUsagesClientAPI = original.ServerUsagesClientAPI type ServersClientAPI = original.ServersClientAPI -type ServiceObjectivesClientAPI = original.ServiceObjectivesClientAPI type ServiceTierAdvisorsClientAPI = original.ServiceTierAdvisorsClientAPI type TransparentDataEncryptionActivitiesClientAPI = original.TransparentDataEncryptionActivitiesClientAPI -type TransparentDataEncryptionConfigurationsClientAPI = original.TransparentDataEncryptionConfigurationsClientAPI type TransparentDataEncryptionsClientAPI = original.TransparentDataEncryptionsClientAPI diff --git a/profiles/preview/sql/mgmt/sql/models.go b/profiles/preview/sql/mgmt/sql/models.go index 1ef18e61db29..c236e3c00709 100644 --- a/profiles/preview/sql/mgmt/sql/models.go +++ b/profiles/preview/sql/mgmt/sql/models.go @@ -25,15 +25,6 @@ const ( DefaultBaseURI = original.DefaultBaseURI ) -type AdvisorStatus = original.AdvisorStatus - -const ( - GA AdvisorStatus = original.GA - LimitedPublicPreview AdvisorStatus = original.LimitedPublicPreview - PrivatePreview AdvisorStatus = original.PrivatePreview - PublicPreview AdvisorStatus = original.PublicPreview -) - type AuthenticationType = original.AuthenticationType const ( @@ -41,30 +32,6 @@ const ( SQL AuthenticationType = original.SQL ) -type AutoExecuteStatus = original.AutoExecuteStatus - -const ( - Default AutoExecuteStatus = original.Default - Disabled AutoExecuteStatus = original.Disabled - Enabled AutoExecuteStatus = original.Enabled -) - -type BackupLongTermRetentionPolicyState = original.BackupLongTermRetentionPolicyState - -const ( - BackupLongTermRetentionPolicyStateDisabled BackupLongTermRetentionPolicyState = original.BackupLongTermRetentionPolicyStateDisabled - BackupLongTermRetentionPolicyStateEnabled BackupLongTermRetentionPolicyState = original.BackupLongTermRetentionPolicyStateEnabled -) - -type CapabilityStatus = original.CapabilityStatus - -const ( - CapabilityStatusAvailable CapabilityStatus = original.CapabilityStatusAvailable - CapabilityStatusDefault CapabilityStatus = original.CapabilityStatusDefault - CapabilityStatusDisabled CapabilityStatus = original.CapabilityStatusDisabled - CapabilityStatusVisible CapabilityStatus = original.CapabilityStatusVisible -) - type CheckNameAvailabilityReason = original.CheckNameAvailabilityReason const ( @@ -75,39 +42,14 @@ const ( type CreateMode = original.CreateMode const ( - CreateModeCopy CreateMode = original.CreateModeCopy - CreateModeDefault CreateMode = original.CreateModeDefault - CreateModeNonReadableSecondary CreateMode = original.CreateModeNonReadableSecondary - CreateModeOnlineSecondary CreateMode = original.CreateModeOnlineSecondary - CreateModePointInTimeRestore CreateMode = original.CreateModePointInTimeRestore - CreateModeRecovery CreateMode = original.CreateModeRecovery - CreateModeRestore CreateMode = original.CreateModeRestore - CreateModeRestoreLongTermRetentionBackup CreateMode = original.CreateModeRestoreLongTermRetentionBackup -) - -type DataMaskingFunction = original.DataMaskingFunction - -const ( - DataMaskingFunctionCCN DataMaskingFunction = original.DataMaskingFunctionCCN - DataMaskingFunctionDefault DataMaskingFunction = original.DataMaskingFunctionDefault - DataMaskingFunctionEmail DataMaskingFunction = original.DataMaskingFunctionEmail - DataMaskingFunctionNumber DataMaskingFunction = original.DataMaskingFunctionNumber - DataMaskingFunctionSSN DataMaskingFunction = original.DataMaskingFunctionSSN - DataMaskingFunctionText DataMaskingFunction = original.DataMaskingFunctionText -) - -type DataMaskingRuleState = original.DataMaskingRuleState - -const ( - DataMaskingRuleStateDisabled DataMaskingRuleState = original.DataMaskingRuleStateDisabled - DataMaskingRuleStateEnabled DataMaskingRuleState = original.DataMaskingRuleStateEnabled -) - -type DataMaskingState = original.DataMaskingState - -const ( - DataMaskingStateDisabled DataMaskingState = original.DataMaskingStateDisabled - DataMaskingStateEnabled DataMaskingState = original.DataMaskingStateEnabled + Copy CreateMode = original.Copy + Default CreateMode = original.Default + NonReadableSecondary CreateMode = original.NonReadableSecondary + OnlineSecondary CreateMode = original.OnlineSecondary + PointInTimeRestore CreateMode = original.PointInTimeRestore + Recovery CreateMode = original.Recovery + Restore CreateMode = original.Restore + RestoreLongTermRetentionBackup CreateMode = original.RestoreLongTermRetentionBackup ) type DatabaseEdition = original.DatabaseEdition @@ -129,37 +71,6 @@ const ( Web DatabaseEdition = original.Web ) -type DisasterRecoveryConfigurationAutoFailover = original.DisasterRecoveryConfigurationAutoFailover - -const ( - Off DisasterRecoveryConfigurationAutoFailover = original.Off - On DisasterRecoveryConfigurationAutoFailover = original.On -) - -type DisasterRecoveryConfigurationFailoverPolicy = original.DisasterRecoveryConfigurationFailoverPolicy - -const ( - Automatic DisasterRecoveryConfigurationFailoverPolicy = original.Automatic - Manual DisasterRecoveryConfigurationFailoverPolicy = original.Manual -) - -type DisasterRecoveryConfigurationRole = original.DisasterRecoveryConfigurationRole - -const ( - None DisasterRecoveryConfigurationRole = original.None - Primary DisasterRecoveryConfigurationRole = original.Primary - Secondary DisasterRecoveryConfigurationRole = original.Secondary -) - -type DisasterRecoveryConfigurationStatus = original.DisasterRecoveryConfigurationStatus - -const ( - Creating DisasterRecoveryConfigurationStatus = original.Creating - Dropping DisasterRecoveryConfigurationStatus = original.Dropping - FailingOver DisasterRecoveryConfigurationStatus = original.FailingOver - Ready DisasterRecoveryConfigurationStatus = original.Ready -) - type ElasticPoolEdition = original.ElasticPoolEdition const ( @@ -173,79 +84,9 @@ const ( type ElasticPoolState = original.ElasticPoolState const ( - ElasticPoolStateCreating ElasticPoolState = original.ElasticPoolStateCreating - ElasticPoolStateDisabled ElasticPoolState = original.ElasticPoolStateDisabled - ElasticPoolStateReady ElasticPoolState = original.ElasticPoolStateReady -) - -type GeoBackupPolicyState = original.GeoBackupPolicyState - -const ( - GeoBackupPolicyStateDisabled GeoBackupPolicyState = original.GeoBackupPolicyStateDisabled - GeoBackupPolicyStateEnabled GeoBackupPolicyState = original.GeoBackupPolicyStateEnabled -) - -type MaxSizeUnits = original.MaxSizeUnits - -const ( - Gigabytes MaxSizeUnits = original.Gigabytes - Megabytes MaxSizeUnits = original.Megabytes - Petabytes MaxSizeUnits = original.Petabytes - Terabytes MaxSizeUnits = original.Terabytes -) - -type PerformanceLevelUnit = original.PerformanceLevelUnit - -const ( - DTU PerformanceLevelUnit = original.DTU -) - -type PrimaryAggregationType = original.PrimaryAggregationType - -const ( - PrimaryAggregationTypeAverage PrimaryAggregationType = original.PrimaryAggregationTypeAverage - PrimaryAggregationTypeCount PrimaryAggregationType = original.PrimaryAggregationTypeCount - PrimaryAggregationTypeMaximum PrimaryAggregationType = original.PrimaryAggregationTypeMaximum - PrimaryAggregationTypeMinimum PrimaryAggregationType = original.PrimaryAggregationTypeMinimum - PrimaryAggregationTypeNone PrimaryAggregationType = original.PrimaryAggregationTypeNone - PrimaryAggregationTypeTotal PrimaryAggregationType = original.PrimaryAggregationTypeTotal -) - -type QueryAggregationFunction = original.QueryAggregationFunction - -const ( - Avg QueryAggregationFunction = original.Avg - Max QueryAggregationFunction = original.Max - Min QueryAggregationFunction = original.Min - Sum QueryAggregationFunction = original.Sum -) - -type QueryExecutionType = original.QueryExecutionType - -const ( - Aborted QueryExecutionType = original.Aborted - Any QueryExecutionType = original.Any - Exception QueryExecutionType = original.Exception - Irregular QueryExecutionType = original.Irregular - Regular QueryExecutionType = original.Regular -) - -type QueryMetricUnit = original.QueryMetricUnit - -const ( - KB QueryMetricUnit = original.KB - Microseconds QueryMetricUnit = original.Microseconds - Percentage QueryMetricUnit = original.Percentage -) - -type QueryObservedMetricType = original.QueryObservedMetricType - -const ( - CPU QueryObservedMetricType = original.CPU - Duration QueryObservedMetricType = original.Duration - ExecutionCount QueryObservedMetricType = original.ExecutionCount - Io QueryObservedMetricType = original.Io - Logio QueryObservedMetricType = original.Logio + Creating ElasticPoolState = original.Creating + Disabled ElasticPoolState = original.Disabled + Ready ElasticPoolState = original.Ready ) type ReadScale = original.ReadScale @@ -307,13 +148,6 @@ const ( SUSPENDED ReplicationState = original.SUSPENDED ) -type RestorePointType = original.RestorePointType - -const ( - CONTINUOUS RestorePointType = original.CONTINUOUS - DISCRETE RestorePointType = original.DISCRETE -) - type SampleName = original.SampleName const ( @@ -342,28 +176,6 @@ const ( SecurityAlertPolicyUseServerDefaultEnabled SecurityAlertPolicyUseServerDefault = original.SecurityAlertPolicyUseServerDefaultEnabled ) -type ServerConnectionType = original.ServerConnectionType - -const ( - ServerConnectionTypeDefault ServerConnectionType = original.ServerConnectionTypeDefault - ServerConnectionTypeProxy ServerConnectionType = original.ServerConnectionTypeProxy - ServerConnectionTypeRedirect ServerConnectionType = original.ServerConnectionTypeRedirect -) - -type ServerState = original.ServerState - -const ( - ServerStateDisabled ServerState = original.ServerStateDisabled - ServerStateReady ServerState = original.ServerStateReady -) - -type ServerVersion = original.ServerVersion - -const ( - OneTwoFullStopZero ServerVersion = original.OneTwoFullStopZero - TwoFullStopZero ServerVersion = original.TwoFullStopZero -) - type ServiceObjectiveName = original.ServiceObjectiveName const ( @@ -455,70 +267,16 @@ const ( TransparentDataEncryptionStatusEnabled TransparentDataEncryptionStatus = original.TransparentDataEncryptionStatusEnabled ) -type UnitDefinitionType = original.UnitDefinitionType - -const ( - Bytes UnitDefinitionType = original.Bytes - BytesPerSecond UnitDefinitionType = original.BytesPerSecond - Count UnitDefinitionType = original.Count - CountPerSecond UnitDefinitionType = original.CountPerSecond - Percent UnitDefinitionType = original.Percent - Seconds UnitDefinitionType = original.Seconds -) - -type UnitType = original.UnitType - -const ( - UnitTypeBytes UnitType = original.UnitTypeBytes - UnitTypeBytesPerSecond UnitType = original.UnitTypeBytesPerSecond - UnitTypeCount UnitType = original.UnitTypeCount - UnitTypeCountPerSecond UnitType = original.UnitTypeCountPerSecond - UnitTypePercent UnitType = original.UnitTypePercent - UnitTypeSeconds UnitType = original.UnitTypeSeconds -) - -type Advisor = original.Advisor -type AdvisorListResult = original.AdvisorListResult -type AdvisorProperties = original.AdvisorProperties -type BackupLongTermRetentionPoliciesClient = original.BackupLongTermRetentionPoliciesClient -type BackupLongTermRetentionPoliciesCreateOrUpdateFuture = original.BackupLongTermRetentionPoliciesCreateOrUpdateFuture -type BackupLongTermRetentionPolicy = original.BackupLongTermRetentionPolicy -type BackupLongTermRetentionPolicyListResult = original.BackupLongTermRetentionPolicyListResult -type BackupLongTermRetentionPolicyProperties = original.BackupLongTermRetentionPolicyProperties -type BackupLongTermRetentionVault = original.BackupLongTermRetentionVault -type BackupLongTermRetentionVaultListResult = original.BackupLongTermRetentionVaultListResult -type BackupLongTermRetentionVaultProperties = original.BackupLongTermRetentionVaultProperties -type BackupLongTermRetentionVaultsClient = original.BackupLongTermRetentionVaultsClient -type BackupLongTermRetentionVaultsCreateOrUpdateFuture = original.BackupLongTermRetentionVaultsCreateOrUpdateFuture type BaseClient = original.BaseClient -type CapabilitiesClient = original.CapabilitiesClient type CheckNameAvailabilityRequest = original.CheckNameAvailabilityRequest type CheckNameAvailabilityResponse = original.CheckNameAvailabilityResponse -type DataMaskingPoliciesClient = original.DataMaskingPoliciesClient -type DataMaskingPolicy = original.DataMaskingPolicy -type DataMaskingPolicyProperties = original.DataMaskingPolicyProperties -type DataMaskingRule = original.DataMaskingRule -type DataMaskingRuleListResult = original.DataMaskingRuleListResult -type DataMaskingRuleProperties = original.DataMaskingRuleProperties -type DataMaskingRulesClient = original.DataMaskingRulesClient type Database = original.Database -type DatabaseAdvisorsClient = original.DatabaseAdvisorsClient -type DatabaseConnectionPoliciesClient = original.DatabaseConnectionPoliciesClient -type DatabaseConnectionPolicy = original.DatabaseConnectionPolicy -type DatabaseConnectionPolicyProperties = original.DatabaseConnectionPolicyProperties type DatabaseListResult = original.DatabaseListResult type DatabaseProperties = original.DatabaseProperties type DatabaseSecurityAlertPolicy = original.DatabaseSecurityAlertPolicy type DatabaseSecurityAlertPolicyProperties = original.DatabaseSecurityAlertPolicyProperties -type DatabaseTableAuditingPoliciesClient = original.DatabaseTableAuditingPoliciesClient -type DatabaseTableAuditingPolicy = original.DatabaseTableAuditingPolicy -type DatabaseTableAuditingPolicyListResult = original.DatabaseTableAuditingPolicyListResult -type DatabaseTableAuditingPolicyProperties = original.DatabaseTableAuditingPolicyProperties type DatabaseThreatDetectionPoliciesClient = original.DatabaseThreatDetectionPoliciesClient type DatabaseUpdate = original.DatabaseUpdate -type DatabaseUsage = original.DatabaseUsage -type DatabaseUsageListResult = original.DatabaseUsageListResult -type DatabaseUsagesClient = original.DatabaseUsagesClient type DatabasesClient = original.DatabasesClient type DatabasesCreateImportOperationFuture = original.DatabasesCreateImportOperationFuture type DatabasesCreateOrUpdateFuture = original.DatabasesCreateOrUpdateFuture @@ -527,15 +285,6 @@ type DatabasesImportFuture = original.DatabasesImportFuture type DatabasesPauseFuture = original.DatabasesPauseFuture type DatabasesResumeFuture = original.DatabasesResumeFuture type DatabasesUpdateFuture = original.DatabasesUpdateFuture -type DisasterRecoveryConfiguration = original.DisasterRecoveryConfiguration -type DisasterRecoveryConfigurationListResult = original.DisasterRecoveryConfigurationListResult -type DisasterRecoveryConfigurationProperties = original.DisasterRecoveryConfigurationProperties -type DisasterRecoveryConfigurationsClient = original.DisasterRecoveryConfigurationsClient -type DisasterRecoveryConfigurationsCreateOrUpdateFuture = original.DisasterRecoveryConfigurationsCreateOrUpdateFuture -type DisasterRecoveryConfigurationsDeleteFuture = original.DisasterRecoveryConfigurationsDeleteFuture -type DisasterRecoveryConfigurationsFailoverAllowDataLossFuture = original.DisasterRecoveryConfigurationsFailoverAllowDataLossFuture -type DisasterRecoveryConfigurationsFailoverFuture = original.DisasterRecoveryConfigurationsFailoverFuture -type EditionCapability = original.EditionCapability type ElasticPool = original.ElasticPool type ElasticPoolActivitiesClient = original.ElasticPoolActivitiesClient type ElasticPoolActivity = original.ElasticPoolActivity @@ -545,57 +294,24 @@ type ElasticPoolDatabaseActivitiesClient = original.ElasticPoolDatabaseActivitie type ElasticPoolDatabaseActivity = original.ElasticPoolDatabaseActivity type ElasticPoolDatabaseActivityListResult = original.ElasticPoolDatabaseActivityListResult type ElasticPoolDatabaseActivityProperties = original.ElasticPoolDatabaseActivityProperties -type ElasticPoolDtuCapability = original.ElasticPoolDtuCapability -type ElasticPoolEditionCapability = original.ElasticPoolEditionCapability type ElasticPoolListResult = original.ElasticPoolListResult -type ElasticPoolPerDatabaseMaxDtuCapability = original.ElasticPoolPerDatabaseMaxDtuCapability -type ElasticPoolPerDatabaseMinDtuCapability = original.ElasticPoolPerDatabaseMinDtuCapability type ElasticPoolProperties = original.ElasticPoolProperties type ElasticPoolUpdate = original.ElasticPoolUpdate type ElasticPoolsClient = original.ElasticPoolsClient type ElasticPoolsCreateOrUpdateFuture = original.ElasticPoolsCreateOrUpdateFuture type ElasticPoolsUpdateFuture = original.ElasticPoolsUpdateFuture type ExportRequest = original.ExportRequest -type ExtensionListResult = original.ExtensionListResult -type ExtensionsClient = original.ExtensionsClient type FirewallRule = original.FirewallRule type FirewallRuleListResult = original.FirewallRuleListResult type FirewallRuleProperties = original.FirewallRuleProperties type FirewallRulesClient = original.FirewallRulesClient -type GeoBackupPoliciesClient = original.GeoBackupPoliciesClient -type GeoBackupPolicy = original.GeoBackupPolicy -type GeoBackupPolicyListResult = original.GeoBackupPolicyListResult -type GeoBackupPolicyProperties = original.GeoBackupPolicyProperties type ImportExportResponse = original.ImportExportResponse type ImportExportResponseProperties = original.ImportExportResponseProperties type ImportExtensionProperties = original.ImportExtensionProperties type ImportExtensionRequest = original.ImportExtensionRequest type ImportRequest = original.ImportRequest -type LocationCapabilities = original.LocationCapabilities -type MaxSizeCapability = original.MaxSizeCapability -type Metric = original.Metric -type MetricAvailability = original.MetricAvailability -type MetricDefinition = original.MetricDefinition -type MetricDefinitionListResult = original.MetricDefinitionListResult -type MetricListResult = original.MetricListResult -type MetricName = original.MetricName -type MetricValue = original.MetricValue -type Operation = original.Operation -type OperationDisplay = original.OperationDisplay type OperationImpact = original.OperationImpact -type OperationListResult = original.OperationListResult -type OperationsClient = original.OperationsClient -type PerformanceLevel = original.PerformanceLevel type ProxyResource = original.ProxyResource -type QueriesClient = original.QueriesClient -type QueryInterval = original.QueryInterval -type QueryMetric = original.QueryMetric -type QueryStatistic = original.QueryStatistic -type QueryStatisticListResult = original.QueryStatisticListResult -type QueryStatisticsClient = original.QueryStatisticsClient -type QueryText = original.QueryText -type QueryTextListResult = original.QueryTextListResult -type QueryTextsClient = original.QueryTextsClient type RecommendedElasticPool = original.RecommendedElasticPool type RecommendedElasticPoolListMetricsResult = original.RecommendedElasticPoolListMetricsResult type RecommendedElasticPoolListResult = original.RecommendedElasticPoolListResult @@ -604,10 +320,6 @@ type RecommendedElasticPoolProperties = original.RecommendedElasticPoolPropertie type RecommendedElasticPoolsClient = original.RecommendedElasticPoolsClient type RecommendedIndex = original.RecommendedIndex type RecommendedIndexProperties = original.RecommendedIndexProperties -type RecoverableDatabase = original.RecoverableDatabase -type RecoverableDatabaseListResult = original.RecoverableDatabaseListResult -type RecoverableDatabaseProperties = original.RecoverableDatabaseProperties -type RecoverableDatabasesClient = original.RecoverableDatabasesClient type ReplicationLink = original.ReplicationLink type ReplicationLinkListResult = original.ReplicationLinkListResult type ReplicationLinkProperties = original.ReplicationLinkProperties @@ -615,141 +327,36 @@ type ReplicationLinksClient = original.ReplicationLinksClient type ReplicationLinksFailoverAllowDataLossFuture = original.ReplicationLinksFailoverAllowDataLossFuture type ReplicationLinksFailoverFuture = original.ReplicationLinksFailoverFuture type Resource = original.Resource -type RestorableDroppedDatabase = original.RestorableDroppedDatabase -type RestorableDroppedDatabaseListResult = original.RestorableDroppedDatabaseListResult -type RestorableDroppedDatabaseProperties = original.RestorableDroppedDatabaseProperties -type RestorableDroppedDatabasesClient = original.RestorableDroppedDatabasesClient -type RestorePoint = original.RestorePoint -type RestorePointListResult = original.RestorePointListResult -type RestorePointProperties = original.RestorePointProperties -type RestorePointsClient = original.RestorePointsClient -type Server = original.Server -type ServerAdministratorListResult = original.ServerAdministratorListResult -type ServerAdministratorProperties = original.ServerAdministratorProperties -type ServerAdvisorsClient = original.ServerAdvisorsClient -type ServerAzureADAdministrator = original.ServerAzureADAdministrator -type ServerAzureADAdministratorsClient = original.ServerAzureADAdministratorsClient -type ServerAzureADAdministratorsCreateOrUpdateFuture = original.ServerAzureADAdministratorsCreateOrUpdateFuture -type ServerAzureADAdministratorsDeleteFuture = original.ServerAzureADAdministratorsDeleteFuture -type ServerCommunicationLink = original.ServerCommunicationLink -type ServerCommunicationLinkListResult = original.ServerCommunicationLinkListResult -type ServerCommunicationLinkProperties = original.ServerCommunicationLinkProperties -type ServerCommunicationLinksClient = original.ServerCommunicationLinksClient -type ServerCommunicationLinksCreateOrUpdateFuture = original.ServerCommunicationLinksCreateOrUpdateFuture -type ServerConnectionPoliciesClient = original.ServerConnectionPoliciesClient -type ServerConnectionPolicy = original.ServerConnectionPolicy -type ServerConnectionPolicyProperties = original.ServerConnectionPolicyProperties -type ServerListResult = original.ServerListResult -type ServerProperties = original.ServerProperties -type ServerTableAuditingPoliciesClient = original.ServerTableAuditingPoliciesClient -type ServerTableAuditingPolicy = original.ServerTableAuditingPolicy -type ServerTableAuditingPolicyListResult = original.ServerTableAuditingPolicyListResult -type ServerTableAuditingPolicyProperties = original.ServerTableAuditingPolicyProperties -type ServerUpdate = original.ServerUpdate -type ServerUsage = original.ServerUsage -type ServerUsageListResult = original.ServerUsageListResult -type ServerUsagesClient = original.ServerUsagesClient -type ServerVersionCapability = original.ServerVersionCapability type ServersClient = original.ServersClient -type ServiceObjective = original.ServiceObjective -type ServiceObjectiveCapability = original.ServiceObjectiveCapability -type ServiceObjectiveListResult = original.ServiceObjectiveListResult -type ServiceObjectiveProperties = original.ServiceObjectiveProperties -type ServiceObjectivesClient = original.ServiceObjectivesClient type ServiceTierAdvisor = original.ServiceTierAdvisor type ServiceTierAdvisorListResult = original.ServiceTierAdvisorListResult type ServiceTierAdvisorProperties = original.ServiceTierAdvisorProperties type ServiceTierAdvisorsClient = original.ServiceTierAdvisorsClient type SloUsageMetric = original.SloUsageMetric -type TableAuditingPolicyProperties = original.TableAuditingPolicyProperties -type TopQueries = original.TopQueries -type TopQueriesListResult = original.TopQueriesListResult type TrackedResource = original.TrackedResource type TransparentDataEncryption = original.TransparentDataEncryption type TransparentDataEncryptionActivitiesClient = original.TransparentDataEncryptionActivitiesClient type TransparentDataEncryptionActivity = original.TransparentDataEncryptionActivity type TransparentDataEncryptionActivityListResult = original.TransparentDataEncryptionActivityListResult type TransparentDataEncryptionActivityProperties = original.TransparentDataEncryptionActivityProperties -type TransparentDataEncryptionConfigurationsClient = original.TransparentDataEncryptionConfigurationsClient -type TransparentDataEncryptionListResult = original.TransparentDataEncryptionListResult type TransparentDataEncryptionProperties = original.TransparentDataEncryptionProperties type TransparentDataEncryptionsClient = original.TransparentDataEncryptionsClient func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } -func NewBackupLongTermRetentionPoliciesClient(subscriptionID string) BackupLongTermRetentionPoliciesClient { - return original.NewBackupLongTermRetentionPoliciesClient(subscriptionID) -} -func NewBackupLongTermRetentionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) BackupLongTermRetentionPoliciesClient { - return original.NewBackupLongTermRetentionPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewBackupLongTermRetentionVaultsClient(subscriptionID string) BackupLongTermRetentionVaultsClient { - return original.NewBackupLongTermRetentionVaultsClient(subscriptionID) -} -func NewBackupLongTermRetentionVaultsClientWithBaseURI(baseURI string, subscriptionID string) BackupLongTermRetentionVaultsClient { - return original.NewBackupLongTermRetentionVaultsClientWithBaseURI(baseURI, subscriptionID) -} -func NewCapabilitiesClient(subscriptionID string) CapabilitiesClient { - return original.NewCapabilitiesClient(subscriptionID) -} -func NewCapabilitiesClientWithBaseURI(baseURI string, subscriptionID string) CapabilitiesClient { - return original.NewCapabilitiesClientWithBaseURI(baseURI, subscriptionID) -} -func NewDataMaskingPoliciesClient(subscriptionID string) DataMaskingPoliciesClient { - return original.NewDataMaskingPoliciesClient(subscriptionID) -} -func NewDataMaskingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DataMaskingPoliciesClient { - return original.NewDataMaskingPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewDataMaskingRulesClient(subscriptionID string) DataMaskingRulesClient { - return original.NewDataMaskingRulesClient(subscriptionID) -} -func NewDataMaskingRulesClientWithBaseURI(baseURI string, subscriptionID string) DataMaskingRulesClient { - return original.NewDataMaskingRulesClientWithBaseURI(baseURI, subscriptionID) -} -func NewDatabaseAdvisorsClient(subscriptionID string) DatabaseAdvisorsClient { - return original.NewDatabaseAdvisorsClient(subscriptionID) -} -func NewDatabaseAdvisorsClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAdvisorsClient { - return original.NewDatabaseAdvisorsClientWithBaseURI(baseURI, subscriptionID) -} -func NewDatabaseConnectionPoliciesClient(subscriptionID string) DatabaseConnectionPoliciesClient { - return original.NewDatabaseConnectionPoliciesClient(subscriptionID) -} -func NewDatabaseConnectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseConnectionPoliciesClient { - return original.NewDatabaseConnectionPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewDatabaseTableAuditingPoliciesClient(subscriptionID string) DatabaseTableAuditingPoliciesClient { - return original.NewDatabaseTableAuditingPoliciesClient(subscriptionID) -} -func NewDatabaseTableAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseTableAuditingPoliciesClient { - return original.NewDatabaseTableAuditingPoliciesClientWithBaseURI(baseURI, subscriptionID) -} func NewDatabaseThreatDetectionPoliciesClient(subscriptionID string) DatabaseThreatDetectionPoliciesClient { return original.NewDatabaseThreatDetectionPoliciesClient(subscriptionID) } func NewDatabaseThreatDetectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseThreatDetectionPoliciesClient { return original.NewDatabaseThreatDetectionPoliciesClientWithBaseURI(baseURI, subscriptionID) } -func NewDatabaseUsagesClient(subscriptionID string) DatabaseUsagesClient { - return original.NewDatabaseUsagesClient(subscriptionID) -} -func NewDatabaseUsagesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseUsagesClient { - return original.NewDatabaseUsagesClientWithBaseURI(baseURI, subscriptionID) -} func NewDatabasesClient(subscriptionID string) DatabasesClient { return original.NewDatabasesClient(subscriptionID) } func NewDatabasesClientWithBaseURI(baseURI string, subscriptionID string) DatabasesClient { return original.NewDatabasesClientWithBaseURI(baseURI, subscriptionID) } -func NewDisasterRecoveryConfigurationsClient(subscriptionID string) DisasterRecoveryConfigurationsClient { - return original.NewDisasterRecoveryConfigurationsClient(subscriptionID) -} -func NewDisasterRecoveryConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) DisasterRecoveryConfigurationsClient { - return original.NewDisasterRecoveryConfigurationsClientWithBaseURI(baseURI, subscriptionID) -} func NewElasticPoolActivitiesClient(subscriptionID string) ElasticPoolActivitiesClient { return original.NewElasticPoolActivitiesClient(subscriptionID) } @@ -768,126 +375,30 @@ func NewElasticPoolsClient(subscriptionID string) ElasticPoolsClient { func NewElasticPoolsClientWithBaseURI(baseURI string, subscriptionID string) ElasticPoolsClient { return original.NewElasticPoolsClientWithBaseURI(baseURI, subscriptionID) } -func NewExtensionsClient(subscriptionID string) ExtensionsClient { - return original.NewExtensionsClient(subscriptionID) -} -func NewExtensionsClientWithBaseURI(baseURI string, subscriptionID string) ExtensionsClient { - return original.NewExtensionsClientWithBaseURI(baseURI, subscriptionID) -} func NewFirewallRulesClient(subscriptionID string) FirewallRulesClient { return original.NewFirewallRulesClient(subscriptionID) } func NewFirewallRulesClientWithBaseURI(baseURI string, subscriptionID string) FirewallRulesClient { return original.NewFirewallRulesClientWithBaseURI(baseURI, subscriptionID) } -func NewGeoBackupPoliciesClient(subscriptionID string) GeoBackupPoliciesClient { - return original.NewGeoBackupPoliciesClient(subscriptionID) -} -func NewGeoBackupPoliciesClientWithBaseURI(baseURI string, subscriptionID string) GeoBackupPoliciesClient { - return original.NewGeoBackupPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewOperationsClient(subscriptionID string) OperationsClient { - return original.NewOperationsClient(subscriptionID) -} -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) -} -func NewQueriesClient(subscriptionID string) QueriesClient { - return original.NewQueriesClient(subscriptionID) -} -func NewQueriesClientWithBaseURI(baseURI string, subscriptionID string) QueriesClient { - return original.NewQueriesClientWithBaseURI(baseURI, subscriptionID) -} -func NewQueryStatisticsClient(subscriptionID string) QueryStatisticsClient { - return original.NewQueryStatisticsClient(subscriptionID) -} -func NewQueryStatisticsClientWithBaseURI(baseURI string, subscriptionID string) QueryStatisticsClient { - return original.NewQueryStatisticsClientWithBaseURI(baseURI, subscriptionID) -} -func NewQueryTextsClient(subscriptionID string) QueryTextsClient { - return original.NewQueryTextsClient(subscriptionID) -} -func NewQueryTextsClientWithBaseURI(baseURI string, subscriptionID string) QueryTextsClient { - return original.NewQueryTextsClientWithBaseURI(baseURI, subscriptionID) -} func NewRecommendedElasticPoolsClient(subscriptionID string) RecommendedElasticPoolsClient { return original.NewRecommendedElasticPoolsClient(subscriptionID) } func NewRecommendedElasticPoolsClientWithBaseURI(baseURI string, subscriptionID string) RecommendedElasticPoolsClient { return original.NewRecommendedElasticPoolsClientWithBaseURI(baseURI, subscriptionID) } -func NewRecoverableDatabasesClient(subscriptionID string) RecoverableDatabasesClient { - return original.NewRecoverableDatabasesClient(subscriptionID) -} -func NewRecoverableDatabasesClientWithBaseURI(baseURI string, subscriptionID string) RecoverableDatabasesClient { - return original.NewRecoverableDatabasesClientWithBaseURI(baseURI, subscriptionID) -} func NewReplicationLinksClient(subscriptionID string) ReplicationLinksClient { return original.NewReplicationLinksClient(subscriptionID) } func NewReplicationLinksClientWithBaseURI(baseURI string, subscriptionID string) ReplicationLinksClient { return original.NewReplicationLinksClientWithBaseURI(baseURI, subscriptionID) } -func NewRestorableDroppedDatabasesClient(subscriptionID string) RestorableDroppedDatabasesClient { - return original.NewRestorableDroppedDatabasesClient(subscriptionID) -} -func NewRestorableDroppedDatabasesClientWithBaseURI(baseURI string, subscriptionID string) RestorableDroppedDatabasesClient { - return original.NewRestorableDroppedDatabasesClientWithBaseURI(baseURI, subscriptionID) -} -func NewRestorePointsClient(subscriptionID string) RestorePointsClient { - return original.NewRestorePointsClient(subscriptionID) -} -func NewRestorePointsClientWithBaseURI(baseURI string, subscriptionID string) RestorePointsClient { - return original.NewRestorePointsClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerAdvisorsClient(subscriptionID string) ServerAdvisorsClient { - return original.NewServerAdvisorsClient(subscriptionID) -} -func NewServerAdvisorsClientWithBaseURI(baseURI string, subscriptionID string) ServerAdvisorsClient { - return original.NewServerAdvisorsClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerAzureADAdministratorsClient(subscriptionID string) ServerAzureADAdministratorsClient { - return original.NewServerAzureADAdministratorsClient(subscriptionID) -} -func NewServerAzureADAdministratorsClientWithBaseURI(baseURI string, subscriptionID string) ServerAzureADAdministratorsClient { - return original.NewServerAzureADAdministratorsClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerCommunicationLinksClient(subscriptionID string) ServerCommunicationLinksClient { - return original.NewServerCommunicationLinksClient(subscriptionID) -} -func NewServerCommunicationLinksClientWithBaseURI(baseURI string, subscriptionID string) ServerCommunicationLinksClient { - return original.NewServerCommunicationLinksClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerConnectionPoliciesClient(subscriptionID string) ServerConnectionPoliciesClient { - return original.NewServerConnectionPoliciesClient(subscriptionID) -} -func NewServerConnectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServerConnectionPoliciesClient { - return original.NewServerConnectionPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerTableAuditingPoliciesClient(subscriptionID string) ServerTableAuditingPoliciesClient { - return original.NewServerTableAuditingPoliciesClient(subscriptionID) -} -func NewServerTableAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServerTableAuditingPoliciesClient { - return original.NewServerTableAuditingPoliciesClientWithBaseURI(baseURI, subscriptionID) -} -func NewServerUsagesClient(subscriptionID string) ServerUsagesClient { - return original.NewServerUsagesClient(subscriptionID) -} -func NewServerUsagesClientWithBaseURI(baseURI string, subscriptionID string) ServerUsagesClient { - return original.NewServerUsagesClientWithBaseURI(baseURI, subscriptionID) -} func NewServersClient(subscriptionID string) ServersClient { return original.NewServersClient(subscriptionID) } func NewServersClientWithBaseURI(baseURI string, subscriptionID string) ServersClient { return original.NewServersClientWithBaseURI(baseURI, subscriptionID) } -func NewServiceObjectivesClient(subscriptionID string) ServiceObjectivesClient { - return original.NewServiceObjectivesClient(subscriptionID) -} -func NewServiceObjectivesClientWithBaseURI(baseURI string, subscriptionID string) ServiceObjectivesClient { - return original.NewServiceObjectivesClientWithBaseURI(baseURI, subscriptionID) -} func NewServiceTierAdvisorsClient(subscriptionID string) ServiceTierAdvisorsClient { return original.NewServiceTierAdvisorsClient(subscriptionID) } @@ -900,12 +411,6 @@ func NewTransparentDataEncryptionActivitiesClient(subscriptionID string) Transpa func NewTransparentDataEncryptionActivitiesClientWithBaseURI(baseURI string, subscriptionID string) TransparentDataEncryptionActivitiesClient { return original.NewTransparentDataEncryptionActivitiesClientWithBaseURI(baseURI, subscriptionID) } -func NewTransparentDataEncryptionConfigurationsClient(subscriptionID string) TransparentDataEncryptionConfigurationsClient { - return original.NewTransparentDataEncryptionConfigurationsClient(subscriptionID) -} -func NewTransparentDataEncryptionConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) TransparentDataEncryptionConfigurationsClient { - return original.NewTransparentDataEncryptionConfigurationsClientWithBaseURI(baseURI, subscriptionID) -} func NewTransparentDataEncryptionsClient(subscriptionID string) TransparentDataEncryptionsClient { return original.NewTransparentDataEncryptionsClient(subscriptionID) } @@ -915,81 +420,24 @@ func NewTransparentDataEncryptionsClientWithBaseURI(baseURI string, subscription func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } -func PossibleAdvisorStatusValues() []AdvisorStatus { - return original.PossibleAdvisorStatusValues() -} func PossibleAuthenticationTypeValues() []AuthenticationType { return original.PossibleAuthenticationTypeValues() } -func PossibleAutoExecuteStatusValues() []AutoExecuteStatus { - return original.PossibleAutoExecuteStatusValues() -} -func PossibleBackupLongTermRetentionPolicyStateValues() []BackupLongTermRetentionPolicyState { - return original.PossibleBackupLongTermRetentionPolicyStateValues() -} -func PossibleCapabilityStatusValues() []CapabilityStatus { - return original.PossibleCapabilityStatusValues() -} func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason { return original.PossibleCheckNameAvailabilityReasonValues() } func PossibleCreateModeValues() []CreateMode { return original.PossibleCreateModeValues() } -func PossibleDataMaskingFunctionValues() []DataMaskingFunction { - return original.PossibleDataMaskingFunctionValues() -} -func PossibleDataMaskingRuleStateValues() []DataMaskingRuleState { - return original.PossibleDataMaskingRuleStateValues() -} -func PossibleDataMaskingStateValues() []DataMaskingState { - return original.PossibleDataMaskingStateValues() -} func PossibleDatabaseEditionValues() []DatabaseEdition { return original.PossibleDatabaseEditionValues() } -func PossibleDisasterRecoveryConfigurationAutoFailoverValues() []DisasterRecoveryConfigurationAutoFailover { - return original.PossibleDisasterRecoveryConfigurationAutoFailoverValues() -} -func PossibleDisasterRecoveryConfigurationFailoverPolicyValues() []DisasterRecoveryConfigurationFailoverPolicy { - return original.PossibleDisasterRecoveryConfigurationFailoverPolicyValues() -} -func PossibleDisasterRecoveryConfigurationRoleValues() []DisasterRecoveryConfigurationRole { - return original.PossibleDisasterRecoveryConfigurationRoleValues() -} -func PossibleDisasterRecoveryConfigurationStatusValues() []DisasterRecoveryConfigurationStatus { - return original.PossibleDisasterRecoveryConfigurationStatusValues() -} func PossibleElasticPoolEditionValues() []ElasticPoolEdition { return original.PossibleElasticPoolEditionValues() } func PossibleElasticPoolStateValues() []ElasticPoolState { return original.PossibleElasticPoolStateValues() } -func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState { - return original.PossibleGeoBackupPolicyStateValues() -} -func PossibleMaxSizeUnitsValues() []MaxSizeUnits { - return original.PossibleMaxSizeUnitsValues() -} -func PossiblePerformanceLevelUnitValues() []PerformanceLevelUnit { - return original.PossiblePerformanceLevelUnitValues() -} -func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType { - return original.PossiblePrimaryAggregationTypeValues() -} -func PossibleQueryAggregationFunctionValues() []QueryAggregationFunction { - return original.PossibleQueryAggregationFunctionValues() -} -func PossibleQueryExecutionTypeValues() []QueryExecutionType { - return original.PossibleQueryExecutionTypeValues() -} -func PossibleQueryMetricUnitValues() []QueryMetricUnit { - return original.PossibleQueryMetricUnitValues() -} -func PossibleQueryObservedMetricTypeValues() []QueryObservedMetricType { - return original.PossibleQueryObservedMetricTypeValues() -} func PossibleReadScaleValues() []ReadScale { return original.PossibleReadScaleValues() } @@ -1008,9 +456,6 @@ func PossibleReplicationRoleValues() []ReplicationRole { func PossibleReplicationStateValues() []ReplicationState { return original.PossibleReplicationStateValues() } -func PossibleRestorePointTypeValues() []RestorePointType { - return original.PossibleRestorePointTypeValues() -} func PossibleSampleNameValues() []SampleName { return original.PossibleSampleNameValues() } @@ -1023,15 +468,6 @@ func PossibleSecurityAlertPolicyStateValues() []SecurityAlertPolicyState { func PossibleSecurityAlertPolicyUseServerDefaultValues() []SecurityAlertPolicyUseServerDefault { return original.PossibleSecurityAlertPolicyUseServerDefaultValues() } -func PossibleServerConnectionTypeValues() []ServerConnectionType { - return original.PossibleServerConnectionTypeValues() -} -func PossibleServerStateValues() []ServerState { - return original.PossibleServerStateValues() -} -func PossibleServerVersionValues() []ServerVersion { - return original.PossibleServerVersionValues() -} func PossibleServiceObjectiveNameValues() []ServiceObjectiveName { return original.PossibleServiceObjectiveNameValues() } @@ -1044,12 +480,6 @@ func PossibleTransparentDataEncryptionActivityStatusValues() []TransparentDataEn func PossibleTransparentDataEncryptionStatusValues() []TransparentDataEncryptionStatus { return original.PossibleTransparentDataEncryptionStatusValues() } -func PossibleUnitDefinitionTypeValues() []UnitDefinitionType { - return original.PossibleUnitDefinitionTypeValues() -} -func PossibleUnitTypeValues() []UnitType { - return original.PossibleUnitTypeValues() -} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/profiles/preview/sql/mgmt/sql/sqlapi/models.go b/profiles/preview/sql/mgmt/sql/sqlapi/models.go index d641097b6ea9..8a1a24d93635 100644 --- a/profiles/preview/sql/mgmt/sql/sqlapi/models.go +++ b/profiles/preview/sql/mgmt/sql/sqlapi/models.go @@ -21,42 +21,15 @@ package sqlapi import original "github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2014-04-01/sql/sqlapi" -type BackupLongTermRetentionPoliciesClientAPI = original.BackupLongTermRetentionPoliciesClientAPI -type BackupLongTermRetentionVaultsClientAPI = original.BackupLongTermRetentionVaultsClientAPI -type CapabilitiesClientAPI = original.CapabilitiesClientAPI -type DataMaskingPoliciesClientAPI = original.DataMaskingPoliciesClientAPI -type DataMaskingRulesClientAPI = original.DataMaskingRulesClientAPI -type DatabaseAdvisorsClientAPI = original.DatabaseAdvisorsClientAPI -type DatabaseConnectionPoliciesClientAPI = original.DatabaseConnectionPoliciesClientAPI -type DatabaseTableAuditingPoliciesClientAPI = original.DatabaseTableAuditingPoliciesClientAPI type DatabaseThreatDetectionPoliciesClientAPI = original.DatabaseThreatDetectionPoliciesClientAPI -type DatabaseUsagesClientAPI = original.DatabaseUsagesClientAPI type DatabasesClientAPI = original.DatabasesClientAPI -type DisasterRecoveryConfigurationsClientAPI = original.DisasterRecoveryConfigurationsClientAPI type ElasticPoolActivitiesClientAPI = original.ElasticPoolActivitiesClientAPI type ElasticPoolDatabaseActivitiesClientAPI = original.ElasticPoolDatabaseActivitiesClientAPI type ElasticPoolsClientAPI = original.ElasticPoolsClientAPI -type ExtensionsClientAPI = original.ExtensionsClientAPI type FirewallRulesClientAPI = original.FirewallRulesClientAPI -type GeoBackupPoliciesClientAPI = original.GeoBackupPoliciesClientAPI -type OperationsClientAPI = original.OperationsClientAPI -type QueriesClientAPI = original.QueriesClientAPI -type QueryStatisticsClientAPI = original.QueryStatisticsClientAPI -type QueryTextsClientAPI = original.QueryTextsClientAPI type RecommendedElasticPoolsClientAPI = original.RecommendedElasticPoolsClientAPI -type RecoverableDatabasesClientAPI = original.RecoverableDatabasesClientAPI type ReplicationLinksClientAPI = original.ReplicationLinksClientAPI -type RestorableDroppedDatabasesClientAPI = original.RestorableDroppedDatabasesClientAPI -type RestorePointsClientAPI = original.RestorePointsClientAPI -type ServerAdvisorsClientAPI = original.ServerAdvisorsClientAPI -type ServerAzureADAdministratorsClientAPI = original.ServerAzureADAdministratorsClientAPI -type ServerCommunicationLinksClientAPI = original.ServerCommunicationLinksClientAPI -type ServerConnectionPoliciesClientAPI = original.ServerConnectionPoliciesClientAPI -type ServerTableAuditingPoliciesClientAPI = original.ServerTableAuditingPoliciesClientAPI -type ServerUsagesClientAPI = original.ServerUsagesClientAPI type ServersClientAPI = original.ServersClientAPI -type ServiceObjectivesClientAPI = original.ServiceObjectivesClientAPI type ServiceTierAdvisorsClientAPI = original.ServiceTierAdvisorsClientAPI type TransparentDataEncryptionActivitiesClientAPI = original.TransparentDataEncryptionActivitiesClientAPI -type TransparentDataEncryptionConfigurationsClientAPI = original.TransparentDataEncryptionConfigurationsClientAPI type TransparentDataEncryptionsClientAPI = original.TransparentDataEncryptionsClientAPI diff --git a/services/sql/mgmt/2014-04-01/sql/databases.go b/services/sql/mgmt/2014-04-01/sql/databases.go index 36b2bc57c791..dcb44f215b7a 100644 --- a/services/sql/mgmt/2014-04-01/sql/databases.go +++ b/services/sql/mgmt/2014-04-01/sql/databases.go @@ -974,168 +974,6 @@ func (client DatabasesClient) ListByServerResponder(resp *http.Response) (result return } -// ListMetricDefinitions returns database metric definitions. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// databaseName - the name of the database. -func (client DatabasesClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result MetricDefinitionListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.ListMetricDefinitions") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListMetricDefinitions", nil, "Failure preparing request") - return - } - - resp, err := client.ListMetricDefinitionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListMetricDefinitions", resp, "Failure sending request") - return - } - - result, err = client.ListMetricDefinitionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListMetricDefinitions", resp, "Failure responding to request") - } - - return -} - -// ListMetricDefinitionsPreparer prepares the ListMetricDefinitions request. -func (client DatabasesClient) ListMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMetricDefinitionsSender sends the ListMetricDefinitions request. The method will close the -// http.Response Body if it receives an error. -func (client DatabasesClient) ListMetricDefinitionsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMetricDefinitionsResponder handles the response to the ListMetricDefinitions request. The method always -// closes the http.Response Body. -func (client DatabasesClient) ListMetricDefinitionsResponder(resp *http.Response) (result MetricDefinitionListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListMetrics returns database metrics. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// databaseName - the name of the database. -// filter - an OData filter expression that describes a subset of metrics to return. -func (client DatabasesClient) ListMetrics(ctx context.Context, resourceGroupName string, serverName string, databaseName string, filter string) (result MetricListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.ListMetrics") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListMetricsPreparer(ctx, resourceGroupName, serverName, databaseName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListMetrics", nil, "Failure preparing request") - return - } - - resp, err := client.ListMetricsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListMetrics", resp, "Failure sending request") - return - } - - result, err = client.ListMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "ListMetrics", resp, "Failure responding to request") - } - - return -} - -// ListMetricsPreparer prepares the ListMetrics request. -func (client DatabasesClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "$filter": autorest.Encode("query", filter), - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMetricsSender sends the ListMetrics request. The method will close the -// http.Response Body if it receives an error. -func (client DatabasesClient) ListMetricsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMetricsResponder handles the response to the ListMetrics request. The method always -// closes the http.Response Body. -func (client DatabasesClient) ListMetricsResponder(resp *http.Response) (result MetricListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - // Pause pauses a data warehouse. // Parameters: // resourceGroupName - the name of the resource group that contains the resource. You can obtain this value diff --git a/services/sql/mgmt/2014-04-01/sql/elasticpools.go b/services/sql/mgmt/2014-04-01/sql/elasticpools.go index 8b2ff84aad84..ed5ee5d537eb 100644 --- a/services/sql/mgmt/2014-04-01/sql/elasticpools.go +++ b/services/sql/mgmt/2014-04-01/sql/elasticpools.go @@ -363,168 +363,6 @@ func (client ElasticPoolsClient) ListByServerResponder(resp *http.Response) (res return } -// ListMetricDefinitions returns elastic pool metric definitions. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// elasticPoolName - the name of the elastic pool. -func (client ElasticPoolsClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result MetricDefinitionListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolsClient.ListMetricDefinitions") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, serverName, elasticPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListMetricDefinitions", nil, "Failure preparing request") - return - } - - resp, err := client.ListMetricDefinitionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListMetricDefinitions", resp, "Failure sending request") - return - } - - result, err = client.ListMetricDefinitionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListMetricDefinitions", resp, "Failure responding to request") - } - - return -} - -// ListMetricDefinitionsPreparer prepares the ListMetricDefinitions request. -func (client ElasticPoolsClient) ListMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "elasticPoolName": autorest.Encode("path", elasticPoolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMetricDefinitionsSender sends the ListMetricDefinitions request. The method will close the -// http.Response Body if it receives an error. -func (client ElasticPoolsClient) ListMetricDefinitionsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMetricDefinitionsResponder handles the response to the ListMetricDefinitions request. The method always -// closes the http.Response Body. -func (client ElasticPoolsClient) ListMetricDefinitionsResponder(resp *http.Response) (result MetricDefinitionListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListMetrics returns elastic pool metrics. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// elasticPoolName - the name of the elastic pool. -// filter - an OData filter expression that describes a subset of metrics to return. -func (client ElasticPoolsClient) ListMetrics(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, filter string) (result MetricListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolsClient.ListMetrics") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListMetricsPreparer(ctx, resourceGroupName, serverName, elasticPoolName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListMetrics", nil, "Failure preparing request") - return - } - - resp, err := client.ListMetricsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListMetrics", resp, "Failure sending request") - return - } - - result, err = client.ListMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsClient", "ListMetrics", resp, "Failure responding to request") - } - - return -} - -// ListMetricsPreparer prepares the ListMetrics request. -func (client ElasticPoolsClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "elasticPoolName": autorest.Encode("path", elasticPoolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "$filter": autorest.Encode("query", filter), - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMetricsSender sends the ListMetrics request. The method will close the -// http.Response Body if it receives an error. -func (client ElasticPoolsClient) ListMetricsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListMetricsResponder handles the response to the ListMetrics request. The method always -// closes the http.Response Body. -func (client ElasticPoolsClient) ListMetricsResponder(resp *http.Response) (result MetricListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - // Update updates an existing elastic pool. // Parameters: // resourceGroupName - the name of the resource group that contains the resource. You can obtain this value diff --git a/services/sql/mgmt/2014-04-01/sql/models.go b/services/sql/mgmt/2014-04-01/sql/models.go index c98749074733..7a19e59246e4 100644 --- a/services/sql/mgmt/2014-04-01/sql/models.go +++ b/services/sql/mgmt/2014-04-01/sql/models.go @@ -30,25 +30,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2014-04-01/sql" -// AdvisorStatus enumerates the values for advisor status. -type AdvisorStatus string - -const ( - // GA ... - GA AdvisorStatus = "GA" - // LimitedPublicPreview ... - LimitedPublicPreview AdvisorStatus = "LimitedPublicPreview" - // PrivatePreview ... - PrivatePreview AdvisorStatus = "PrivatePreview" - // PublicPreview ... - PublicPreview AdvisorStatus = "PublicPreview" -) - -// PossibleAdvisorStatusValues returns an array of possible values for the AdvisorStatus const type. -func PossibleAdvisorStatusValues() []AdvisorStatus { - return []AdvisorStatus{GA, LimitedPublicPreview, PrivatePreview, PublicPreview} -} - // AuthenticationType enumerates the values for authentication type. type AuthenticationType string @@ -64,57 +45,6 @@ func PossibleAuthenticationTypeValues() []AuthenticationType { return []AuthenticationType{ADPassword, SQL} } -// AutoExecuteStatus enumerates the values for auto execute status. -type AutoExecuteStatus string - -const ( - // Default ... - Default AutoExecuteStatus = "Default" - // Disabled ... - Disabled AutoExecuteStatus = "Disabled" - // Enabled ... - Enabled AutoExecuteStatus = "Enabled" -) - -// PossibleAutoExecuteStatusValues returns an array of possible values for the AutoExecuteStatus const type. -func PossibleAutoExecuteStatusValues() []AutoExecuteStatus { - return []AutoExecuteStatus{Default, Disabled, Enabled} -} - -// BackupLongTermRetentionPolicyState enumerates the values for backup long term retention policy state. -type BackupLongTermRetentionPolicyState string - -const ( - // BackupLongTermRetentionPolicyStateDisabled ... - BackupLongTermRetentionPolicyStateDisabled BackupLongTermRetentionPolicyState = "Disabled" - // BackupLongTermRetentionPolicyStateEnabled ... - BackupLongTermRetentionPolicyStateEnabled BackupLongTermRetentionPolicyState = "Enabled" -) - -// PossibleBackupLongTermRetentionPolicyStateValues returns an array of possible values for the BackupLongTermRetentionPolicyState const type. -func PossibleBackupLongTermRetentionPolicyStateValues() []BackupLongTermRetentionPolicyState { - return []BackupLongTermRetentionPolicyState{BackupLongTermRetentionPolicyStateDisabled, BackupLongTermRetentionPolicyStateEnabled} -} - -// CapabilityStatus enumerates the values for capability status. -type CapabilityStatus string - -const ( - // CapabilityStatusAvailable ... - CapabilityStatusAvailable CapabilityStatus = "Available" - // CapabilityStatusDefault ... - CapabilityStatusDefault CapabilityStatus = "Default" - // CapabilityStatusDisabled ... - CapabilityStatusDisabled CapabilityStatus = "Disabled" - // CapabilityStatusVisible ... - CapabilityStatusVisible CapabilityStatus = "Visible" -) - -// PossibleCapabilityStatusValues returns an array of possible values for the CapabilityStatus const type. -func PossibleCapabilityStatusValues() []CapabilityStatus { - return []CapabilityStatus{CapabilityStatusAvailable, CapabilityStatusDefault, CapabilityStatusDisabled, CapabilityStatusVisible} -} - // CheckNameAvailabilityReason enumerates the values for check name availability reason. type CheckNameAvailabilityReason string @@ -134,27 +64,27 @@ func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason { type CreateMode string const ( - // CreateModeCopy ... - CreateModeCopy CreateMode = "Copy" - // CreateModeDefault ... - CreateModeDefault CreateMode = "Default" - // CreateModeNonReadableSecondary ... - CreateModeNonReadableSecondary CreateMode = "NonReadableSecondary" - // CreateModeOnlineSecondary ... - CreateModeOnlineSecondary CreateMode = "OnlineSecondary" - // CreateModePointInTimeRestore ... - CreateModePointInTimeRestore CreateMode = "PointInTimeRestore" - // CreateModeRecovery ... - CreateModeRecovery CreateMode = "Recovery" - // CreateModeRestore ... - CreateModeRestore CreateMode = "Restore" - // CreateModeRestoreLongTermRetentionBackup ... - CreateModeRestoreLongTermRetentionBackup CreateMode = "RestoreLongTermRetentionBackup" + // Copy ... + Copy CreateMode = "Copy" + // Default ... + Default CreateMode = "Default" + // NonReadableSecondary ... + NonReadableSecondary CreateMode = "NonReadableSecondary" + // OnlineSecondary ... + OnlineSecondary CreateMode = "OnlineSecondary" + // PointInTimeRestore ... + PointInTimeRestore CreateMode = "PointInTimeRestore" + // Recovery ... + Recovery CreateMode = "Recovery" + // Restore ... + Restore CreateMode = "Restore" + // RestoreLongTermRetentionBackup ... + RestoreLongTermRetentionBackup CreateMode = "RestoreLongTermRetentionBackup" ) // PossibleCreateModeValues returns an array of possible values for the CreateMode const type. func PossibleCreateModeValues() []CreateMode { - return []CreateMode{CreateModeCopy, CreateModeDefault, CreateModeNonReadableSecondary, CreateModeOnlineSecondary, CreateModePointInTimeRestore, CreateModeRecovery, CreateModeRestore, CreateModeRestoreLongTermRetentionBackup} + return []CreateMode{Copy, Default, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, Restore, RestoreLongTermRetentionBackup} } // DatabaseEdition enumerates the values for database edition. @@ -196,127 +126,6 @@ func PossibleDatabaseEditionValues() []DatabaseEdition { return []DatabaseEdition{Basic, Business, BusinessCritical, DataWarehouse, Free, GeneralPurpose, Hyperscale, Premium, PremiumRS, Standard, Stretch, System, System2, Web} } -// DataMaskingFunction enumerates the values for data masking function. -type DataMaskingFunction string - -const ( - // DataMaskingFunctionCCN ... - DataMaskingFunctionCCN DataMaskingFunction = "CCN" - // DataMaskingFunctionDefault ... - DataMaskingFunctionDefault DataMaskingFunction = "Default" - // DataMaskingFunctionEmail ... - DataMaskingFunctionEmail DataMaskingFunction = "Email" - // DataMaskingFunctionNumber ... - DataMaskingFunctionNumber DataMaskingFunction = "Number" - // DataMaskingFunctionSSN ... - DataMaskingFunctionSSN DataMaskingFunction = "SSN" - // DataMaskingFunctionText ... - DataMaskingFunctionText DataMaskingFunction = "Text" -) - -// PossibleDataMaskingFunctionValues returns an array of possible values for the DataMaskingFunction const type. -func PossibleDataMaskingFunctionValues() []DataMaskingFunction { - return []DataMaskingFunction{DataMaskingFunctionCCN, DataMaskingFunctionDefault, DataMaskingFunctionEmail, DataMaskingFunctionNumber, DataMaskingFunctionSSN, DataMaskingFunctionText} -} - -// DataMaskingRuleState enumerates the values for data masking rule state. -type DataMaskingRuleState string - -const ( - // DataMaskingRuleStateDisabled ... - DataMaskingRuleStateDisabled DataMaskingRuleState = "Disabled" - // DataMaskingRuleStateEnabled ... - DataMaskingRuleStateEnabled DataMaskingRuleState = "Enabled" -) - -// PossibleDataMaskingRuleStateValues returns an array of possible values for the DataMaskingRuleState const type. -func PossibleDataMaskingRuleStateValues() []DataMaskingRuleState { - return []DataMaskingRuleState{DataMaskingRuleStateDisabled, DataMaskingRuleStateEnabled} -} - -// DataMaskingState enumerates the values for data masking state. -type DataMaskingState string - -const ( - // DataMaskingStateDisabled ... - DataMaskingStateDisabled DataMaskingState = "Disabled" - // DataMaskingStateEnabled ... - DataMaskingStateEnabled DataMaskingState = "Enabled" -) - -// PossibleDataMaskingStateValues returns an array of possible values for the DataMaskingState const type. -func PossibleDataMaskingStateValues() []DataMaskingState { - return []DataMaskingState{DataMaskingStateDisabled, DataMaskingStateEnabled} -} - -// DisasterRecoveryConfigurationAutoFailover enumerates the values for disaster recovery configuration auto -// failover. -type DisasterRecoveryConfigurationAutoFailover string - -const ( - // Off ... - Off DisasterRecoveryConfigurationAutoFailover = "Off" - // On ... - On DisasterRecoveryConfigurationAutoFailover = "On" -) - -// PossibleDisasterRecoveryConfigurationAutoFailoverValues returns an array of possible values for the DisasterRecoveryConfigurationAutoFailover const type. -func PossibleDisasterRecoveryConfigurationAutoFailoverValues() []DisasterRecoveryConfigurationAutoFailover { - return []DisasterRecoveryConfigurationAutoFailover{Off, On} -} - -// DisasterRecoveryConfigurationFailoverPolicy enumerates the values for disaster recovery configuration -// failover policy. -type DisasterRecoveryConfigurationFailoverPolicy string - -const ( - // Automatic ... - Automatic DisasterRecoveryConfigurationFailoverPolicy = "Automatic" - // Manual ... - Manual DisasterRecoveryConfigurationFailoverPolicy = "Manual" -) - -// PossibleDisasterRecoveryConfigurationFailoverPolicyValues returns an array of possible values for the DisasterRecoveryConfigurationFailoverPolicy const type. -func PossibleDisasterRecoveryConfigurationFailoverPolicyValues() []DisasterRecoveryConfigurationFailoverPolicy { - return []DisasterRecoveryConfigurationFailoverPolicy{Automatic, Manual} -} - -// DisasterRecoveryConfigurationRole enumerates the values for disaster recovery configuration role. -type DisasterRecoveryConfigurationRole string - -const ( - // None ... - None DisasterRecoveryConfigurationRole = "None" - // Primary ... - Primary DisasterRecoveryConfigurationRole = "Primary" - // Secondary ... - Secondary DisasterRecoveryConfigurationRole = "Secondary" -) - -// PossibleDisasterRecoveryConfigurationRoleValues returns an array of possible values for the DisasterRecoveryConfigurationRole const type. -func PossibleDisasterRecoveryConfigurationRoleValues() []DisasterRecoveryConfigurationRole { - return []DisasterRecoveryConfigurationRole{None, Primary, Secondary} -} - -// DisasterRecoveryConfigurationStatus enumerates the values for disaster recovery configuration status. -type DisasterRecoveryConfigurationStatus string - -const ( - // Creating ... - Creating DisasterRecoveryConfigurationStatus = "Creating" - // Dropping ... - Dropping DisasterRecoveryConfigurationStatus = "Dropping" - // FailingOver ... - FailingOver DisasterRecoveryConfigurationStatus = "FailingOver" - // Ready ... - Ready DisasterRecoveryConfigurationStatus = "Ready" -) - -// PossibleDisasterRecoveryConfigurationStatusValues returns an array of possible values for the DisasterRecoveryConfigurationStatus const type. -func PossibleDisasterRecoveryConfigurationStatusValues() []DisasterRecoveryConfigurationStatus { - return []DisasterRecoveryConfigurationStatus{Creating, Dropping, FailingOver, Ready} -} - // ElasticPoolEdition enumerates the values for elastic pool edition. type ElasticPoolEdition string @@ -342,165 +151,17 @@ func PossibleElasticPoolEditionValues() []ElasticPoolEdition { type ElasticPoolState string const ( - // ElasticPoolStateCreating ... - ElasticPoolStateCreating ElasticPoolState = "Creating" - // ElasticPoolStateDisabled ... - ElasticPoolStateDisabled ElasticPoolState = "Disabled" - // ElasticPoolStateReady ... - ElasticPoolStateReady ElasticPoolState = "Ready" + // Creating ... + Creating ElasticPoolState = "Creating" + // Disabled ... + Disabled ElasticPoolState = "Disabled" + // Ready ... + Ready ElasticPoolState = "Ready" ) // PossibleElasticPoolStateValues returns an array of possible values for the ElasticPoolState const type. func PossibleElasticPoolStateValues() []ElasticPoolState { - return []ElasticPoolState{ElasticPoolStateCreating, ElasticPoolStateDisabled, ElasticPoolStateReady} -} - -// GeoBackupPolicyState enumerates the values for geo backup policy state. -type GeoBackupPolicyState string - -const ( - // GeoBackupPolicyStateDisabled ... - GeoBackupPolicyStateDisabled GeoBackupPolicyState = "Disabled" - // GeoBackupPolicyStateEnabled ... - GeoBackupPolicyStateEnabled GeoBackupPolicyState = "Enabled" -) - -// PossibleGeoBackupPolicyStateValues returns an array of possible values for the GeoBackupPolicyState const type. -func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState { - return []GeoBackupPolicyState{GeoBackupPolicyStateDisabled, GeoBackupPolicyStateEnabled} -} - -// MaxSizeUnits enumerates the values for max size units. -type MaxSizeUnits string - -const ( - // Gigabytes ... - Gigabytes MaxSizeUnits = "Gigabytes" - // Megabytes ... - Megabytes MaxSizeUnits = "Megabytes" - // Petabytes ... - Petabytes MaxSizeUnits = "Petabytes" - // Terabytes ... - Terabytes MaxSizeUnits = "Terabytes" -) - -// PossibleMaxSizeUnitsValues returns an array of possible values for the MaxSizeUnits const type. -func PossibleMaxSizeUnitsValues() []MaxSizeUnits { - return []MaxSizeUnits{Gigabytes, Megabytes, Petabytes, Terabytes} -} - -// PerformanceLevelUnit enumerates the values for performance level unit. -type PerformanceLevelUnit string - -const ( - // DTU ... - DTU PerformanceLevelUnit = "DTU" -) - -// PossiblePerformanceLevelUnitValues returns an array of possible values for the PerformanceLevelUnit const type. -func PossiblePerformanceLevelUnitValues() []PerformanceLevelUnit { - return []PerformanceLevelUnit{DTU} -} - -// PrimaryAggregationType enumerates the values for primary aggregation type. -type PrimaryAggregationType string - -const ( - // PrimaryAggregationTypeAverage ... - PrimaryAggregationTypeAverage PrimaryAggregationType = "Average" - // PrimaryAggregationTypeCount ... - PrimaryAggregationTypeCount PrimaryAggregationType = "Count" - // PrimaryAggregationTypeMaximum ... - PrimaryAggregationTypeMaximum PrimaryAggregationType = "Maximum" - // PrimaryAggregationTypeMinimum ... - PrimaryAggregationTypeMinimum PrimaryAggregationType = "Minimum" - // PrimaryAggregationTypeNone ... - PrimaryAggregationTypeNone PrimaryAggregationType = "None" - // PrimaryAggregationTypeTotal ... - PrimaryAggregationTypeTotal PrimaryAggregationType = "Total" -) - -// PossiblePrimaryAggregationTypeValues returns an array of possible values for the PrimaryAggregationType const type. -func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType { - return []PrimaryAggregationType{PrimaryAggregationTypeAverage, PrimaryAggregationTypeCount, PrimaryAggregationTypeMaximum, PrimaryAggregationTypeMinimum, PrimaryAggregationTypeNone, PrimaryAggregationTypeTotal} -} - -// QueryAggregationFunction enumerates the values for query aggregation function. -type QueryAggregationFunction string - -const ( - // Avg ... - Avg QueryAggregationFunction = "avg" - // Max ... - Max QueryAggregationFunction = "max" - // Min ... - Min QueryAggregationFunction = "min" - // Sum ... - Sum QueryAggregationFunction = "sum" -) - -// PossibleQueryAggregationFunctionValues returns an array of possible values for the QueryAggregationFunction const type. -func PossibleQueryAggregationFunctionValues() []QueryAggregationFunction { - return []QueryAggregationFunction{Avg, Max, Min, Sum} -} - -// QueryExecutionType enumerates the values for query execution type. -type QueryExecutionType string - -const ( - // Aborted ... - Aborted QueryExecutionType = "aborted" - // Any ... - Any QueryExecutionType = "any" - // Exception ... - Exception QueryExecutionType = "exception" - // Irregular ... - Irregular QueryExecutionType = "irregular" - // Regular ... - Regular QueryExecutionType = "regular" -) - -// PossibleQueryExecutionTypeValues returns an array of possible values for the QueryExecutionType const type. -func PossibleQueryExecutionTypeValues() []QueryExecutionType { - return []QueryExecutionType{Aborted, Any, Exception, Irregular, Regular} -} - -// QueryMetricUnit enumerates the values for query metric unit. -type QueryMetricUnit string - -const ( - // KB ... - KB QueryMetricUnit = "KB" - // Microseconds ... - Microseconds QueryMetricUnit = "microseconds" - // Percentage ... - Percentage QueryMetricUnit = "percentage" -) - -// PossibleQueryMetricUnitValues returns an array of possible values for the QueryMetricUnit const type. -func PossibleQueryMetricUnitValues() []QueryMetricUnit { - return []QueryMetricUnit{KB, Microseconds, Percentage} -} - -// QueryObservedMetricType enumerates the values for query observed metric type. -type QueryObservedMetricType string - -const ( - // CPU ... - CPU QueryObservedMetricType = "cpu" - // Duration ... - Duration QueryObservedMetricType = "duration" - // ExecutionCount ... - ExecutionCount QueryObservedMetricType = "executionCount" - // Io ... - Io QueryObservedMetricType = "io" - // Logio ... - Logio QueryObservedMetricType = "logio" -) - -// PossibleQueryObservedMetricTypeValues returns an array of possible values for the QueryObservedMetricType const type. -func PossibleQueryObservedMetricTypeValues() []QueryObservedMetricType { - return []QueryObservedMetricType{CPU, Duration, ExecutionCount, Io, Logio} + return []ElasticPoolState{Creating, Disabled, Ready} } // ReadScale enumerates the values for read scale. @@ -627,21 +288,6 @@ func PossibleReplicationStateValues() []ReplicationState { return []ReplicationState{CATCHUP, PENDING, SEEDING, SUSPENDED} } -// RestorePointType enumerates the values for restore point type. -type RestorePointType string - -const ( - // CONTINUOUS ... - CONTINUOUS RestorePointType = "CONTINUOUS" - // DISCRETE ... - DISCRETE RestorePointType = "DISCRETE" -) - -// PossibleRestorePointTypeValues returns an array of possible values for the RestorePointType const type. -func PossibleRestorePointTypeValues() []RestorePointType { - return []RestorePointType{CONTINUOUS, DISCRETE} -} - // SampleName enumerates the values for sample name. type SampleName string @@ -702,53 +348,6 @@ func PossibleSecurityAlertPolicyUseServerDefaultValues() []SecurityAlertPolicyUs return []SecurityAlertPolicyUseServerDefault{SecurityAlertPolicyUseServerDefaultDisabled, SecurityAlertPolicyUseServerDefaultEnabled} } -// ServerConnectionType enumerates the values for server connection type. -type ServerConnectionType string - -const ( - // ServerConnectionTypeDefault ... - ServerConnectionTypeDefault ServerConnectionType = "Default" - // ServerConnectionTypeProxy ... - ServerConnectionTypeProxy ServerConnectionType = "Proxy" - // ServerConnectionTypeRedirect ... - ServerConnectionTypeRedirect ServerConnectionType = "Redirect" -) - -// PossibleServerConnectionTypeValues returns an array of possible values for the ServerConnectionType const type. -func PossibleServerConnectionTypeValues() []ServerConnectionType { - return []ServerConnectionType{ServerConnectionTypeDefault, ServerConnectionTypeProxy, ServerConnectionTypeRedirect} -} - -// ServerState enumerates the values for server state. -type ServerState string - -const ( - // ServerStateDisabled ... - ServerStateDisabled ServerState = "Disabled" - // ServerStateReady ... - ServerStateReady ServerState = "Ready" -) - -// PossibleServerStateValues returns an array of possible values for the ServerState const type. -func PossibleServerStateValues() []ServerState { - return []ServerState{ServerStateDisabled, ServerStateReady} -} - -// ServerVersion enumerates the values for server version. -type ServerVersion string - -const ( - // OneTwoFullStopZero ... - OneTwoFullStopZero ServerVersion = "12.0" - // TwoFullStopZero ... - TwoFullStopZero ServerVersion = "2.0" -) - -// PossibleServerVersionValues returns an array of possible values for the ServerVersion const type. -func PossibleServerVersionValues() []ServerVersion { - return []ServerVersion{OneTwoFullStopZero, TwoFullStopZero} -} - // ServiceObjectiveName enumerates the values for service objective name. type ServiceObjectiveName string @@ -936,61 +535,39 @@ func PossibleTransparentDataEncryptionStatusValues() []TransparentDataEncryption return []TransparentDataEncryptionStatus{TransparentDataEncryptionStatusDisabled, TransparentDataEncryptionStatusEnabled} } -// UnitDefinitionType enumerates the values for unit definition type. -type UnitDefinitionType string - -const ( - // Bytes ... - Bytes UnitDefinitionType = "Bytes" - // BytesPerSecond ... - BytesPerSecond UnitDefinitionType = "BytesPerSecond" - // Count ... - Count UnitDefinitionType = "Count" - // CountPerSecond ... - CountPerSecond UnitDefinitionType = "CountPerSecond" - // Percent ... - Percent UnitDefinitionType = "Percent" - // Seconds ... - Seconds UnitDefinitionType = "Seconds" -) - -// PossibleUnitDefinitionTypeValues returns an array of possible values for the UnitDefinitionType const type. -func PossibleUnitDefinitionTypeValues() []UnitDefinitionType { - return []UnitDefinitionType{Bytes, BytesPerSecond, Count, CountPerSecond, Percent, Seconds} +// CheckNameAvailabilityRequest a request to check whether the specified name for a resource is available. +type CheckNameAvailabilityRequest struct { + // Name - The name whose availability is to be checked. + Name *string `json:"name,omitempty"` + // Type - The type of resource that is used as the scope of the availability check. + Type *string `json:"type,omitempty"` } -// UnitType enumerates the values for unit type. -type UnitType string - -const ( - // UnitTypeBytes ... - UnitTypeBytes UnitType = "bytes" - // UnitTypeBytesPerSecond ... - UnitTypeBytesPerSecond UnitType = "bytesPerSecond" - // UnitTypeCount ... - UnitTypeCount UnitType = "count" - // UnitTypeCountPerSecond ... - UnitTypeCountPerSecond UnitType = "countPerSecond" - // UnitTypePercent ... - UnitTypePercent UnitType = "percent" - // UnitTypeSeconds ... - UnitTypeSeconds UnitType = "seconds" -) - -// PossibleUnitTypeValues returns an array of possible values for the UnitType const type. -func PossibleUnitTypeValues() []UnitType { - return []UnitType{UnitTypeBytes, UnitTypeBytesPerSecond, UnitTypeCount, UnitTypeCountPerSecond, UnitTypePercent, UnitTypeSeconds} +// CheckNameAvailabilityResponse a response indicating whether the specified name for a resource is +// available. +type CheckNameAvailabilityResponse struct { + autorest.Response `json:"-"` + // Available - READ-ONLY; True if the name is available, otherwise false. + Available *bool `json:"available,omitempty"` + // Message - READ-ONLY; A message explaining why the name is unavailable. Will be null if the name is available. + Message *string `json:"message,omitempty"` + // Name - READ-ONLY; The name whose availability was checked. + Name *string `json:"name,omitempty"` + // Reason - READ-ONLY; The reason code explaining why the name is unavailable. Will be null if the name is available. Possible values include: 'Invalid', 'AlreadyExists' + Reason CheckNameAvailabilityReason `json:"reason,omitempty"` } -// Advisor database Advisor. -type Advisor struct { +// Database represents a database. +type Database struct { autorest.Response `json:"-"` - // Kind - READ-ONLY; Resource kind. + // Kind - READ-ONLY; Kind of database. This is metadata used for the Azure portal experience. Kind *string `json:"kind,omitempty"` - // Location - READ-ONLY; Resource location. + // DatabaseProperties - The properties representing the resource. + *DatabaseProperties `json:"properties,omitempty"` + // Location - Resource location. Location *string `json:"location,omitempty"` - // AdvisorProperties - Resource properties. - *AdvisorProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -999,17 +576,23 @@ type Advisor struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for Advisor. -func (a Advisor) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for Database. +func (d Database) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if a.AdvisorProperties != nil { - objectMap["properties"] = a.AdvisorProperties + if d.DatabaseProperties != nil { + objectMap["properties"] = d.DatabaseProperties + } + if d.Location != nil { + objectMap["location"] = d.Location + } + if d.Tags != nil { + objectMap["tags"] = d.Tags } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for Advisor struct. -func (a *Advisor) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for Database struct. +func (d *Database) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1024,7 +607,16 @@ func (a *Advisor) UnmarshalJSON(body []byte) error { if err != nil { return err } - a.Kind = &kind + d.Kind = &kind + } + case "properties": + if v != nil { + var databaseProperties DatabaseProperties + err = json.Unmarshal(*v, &databaseProperties) + if err != nil { + return err + } + d.DatabaseProperties = &databaseProperties } case "location": if v != nil { @@ -1033,16 +625,16 @@ func (a *Advisor) UnmarshalJSON(body []byte) error { if err != nil { return err } - a.Location = &location + d.Location = &location } - case "properties": + case "tags": if v != nil { - var advisorProperties AdvisorProperties - err = json.Unmarshal(*v, &advisorProperties) + var tags map[string]*string + err = json.Unmarshal(*v, &tags) if err != nil { return err } - a.AdvisorProperties = &advisorProperties + d.Tags = tags } case "id": if v != nil { @@ -1051,7 +643,7 @@ func (a *Advisor) UnmarshalJSON(body []byte) error { if err != nil { return err } - a.ID = &ID + d.ID = &ID } case "name": if v != nil { @@ -1060,7 +652,7 @@ func (a *Advisor) UnmarshalJSON(body []byte) error { if err != nil { return err } - a.Name = &name + d.Name = &name } case "type": if v != nil { @@ -1069,7 +661,7 @@ func (a *Advisor) UnmarshalJSON(body []byte) error { if err != nil { return err } - a.Type = &typeVar + d.Type = &typeVar } } } @@ -1077,161 +669,168 @@ func (a *Advisor) UnmarshalJSON(body []byte) error { return nil } -// AdvisorListResult represents the response to a list advisors request. -type AdvisorListResult struct { - autorest.Response `json:"-"` - // Value - The list of advisors. - Value *[]Advisor `json:"value,omitempty"` -} - -// AdvisorProperties properties for a Database, Server or Elastic Pool Advisor. -type AdvisorProperties struct { - // AdvisorStatus - READ-ONLY; Gets the status of availability of this advisor to customers. Possible values are 'GA', 'PublicPreview', 'LimitedPublicPreview' and 'PrivatePreview'. Possible values include: 'GA', 'PublicPreview', 'LimitedPublicPreview', 'PrivatePreview' - AdvisorStatus AdvisorStatus `json:"advisorStatus,omitempty"` - // AutoExecuteValue - Gets the auto-execute status (whether to let the system execute the recommendations) of this advisor. Possible values are 'Enabled' and 'Disabled'. Possible values include: 'Enabled', 'Disabled', 'Default' - AutoExecuteValue AutoExecuteStatus `json:"autoExecuteValue,omitempty"` - // RecommendationsStatus - READ-ONLY; Gets that status of recommendations for this advisor and reason for not having any recommendations. Possible values include, but are not limited to, 'Ok' (Recommendations available), LowActivity (not enough workload to analyze), 'DbSeemsTuned' (Database is doing well), etc. - RecommendationsStatus *string `json:"recommendationsStatus,omitempty"` - // LastChecked - READ-ONLY; Gets the time when the current resource was analyzed for recommendations by this advisor. - LastChecked *date.Time `json:"lastChecked,omitempty"` -} - -// BackupLongTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type BackupLongTermRetentionPoliciesCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *BackupLongTermRetentionPoliciesCreateOrUpdateFuture) Result(client BackupLongTermRetentionPoliciesClient) (bltrp BackupLongTermRetentionPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bltrp.Response.Response, err = future.GetResult(sender); err == nil && bltrp.Response.Response.StatusCode != http.StatusNoContent { - bltrp, err = client.CreateOrUpdateResponder(bltrp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", bltrp.Response.Response, "Failure responding to request") - } - } - return -} - -// BackupLongTermRetentionPolicy a backup long term retention policy -type BackupLongTermRetentionPolicy struct { +// DatabaseListResult represents the response to a list database request. +type DatabaseListResult struct { autorest.Response `json:"-"` - // Location - READ-ONLY; The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // BackupLongTermRetentionPolicyProperties - The properties of the backup long term retention policy - *BackupLongTermRetentionPolicyProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for BackupLongTermRetentionPolicy. -func (bltrp BackupLongTermRetentionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bltrp.BackupLongTermRetentionPolicyProperties != nil { - objectMap["properties"] = bltrp.BackupLongTermRetentionPolicyProperties - } - return json.Marshal(objectMap) + // Value - The list of databases housed in the server. + Value *[]Database `json:"value,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for BackupLongTermRetentionPolicy struct. -func (bltrp *BackupLongTermRetentionPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) +// DatabaseProperties represents the properties of a database. +type DatabaseProperties struct { + // Collation - The collation of the database. If createMode is not Default, this value is ignored. + Collation *string `json:"collation,omitempty"` + // CreationDate - READ-ONLY; The creation date of the database (ISO8601 format). + CreationDate *date.Time `json:"creationDate,omitempty"` + // ContainmentState - READ-ONLY; The containment state of the database. + ContainmentState *int64 `json:"containmentState,omitempty"` + // CurrentServiceObjectiveID - READ-ONLY; The current service level objective ID of the database. This is the ID of the service level objective that is currently active. + CurrentServiceObjectiveID *uuid.UUID `json:"currentServiceObjectiveId,omitempty"` + // DatabaseID - READ-ONLY; The ID of the database. + DatabaseID *uuid.UUID `json:"databaseId,omitempty"` + // EarliestRestoreDate - READ-ONLY; This records the earliest start date and time that restore is available for this database (ISO8601 format). + EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` + // CreateMode - Specifies the mode of database creation. + // Default: regular database creation. + // Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database. + // OnlineSecondary/NonReadableSecondary: creates a database as a (readable or nonreadable) secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database. + // PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified. + // Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore. + // Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time. + // RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID. + // Copy, NonReadableSecondary, OnlineSecondary and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. Possible values include: 'Copy', 'Default', 'NonReadableSecondary', 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', 'RestoreLongTermRetentionBackup' + CreateMode CreateMode `json:"createMode,omitempty"` + // SourceDatabaseID - Conditional. If createMode is Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, or Restore, then this value is required. Specifies the resource ID of the source database. If createMode is NonReadableSecondary or OnlineSecondary, the name of the source database must be the same as the new database being created. + SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"` + // SourceDatabaseDeletionDate - Conditional. If createMode is Restore and sourceDatabaseId is the deleted database's original resource id when it existed (as opposed to its current restorable dropped database id), then this value is required. Specifies the time that the database was deleted. + SourceDatabaseDeletionDate *date.Time `json:"sourceDatabaseDeletionDate,omitempty"` + // RestorePointInTime - Conditional. If createMode is PointInTimeRestore, this value is required. If createMode is Restore, this value is optional. Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. Must be greater than or equal to the source database's earliestRestoreDate value. + RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"` + // RecoveryServicesRecoveryPointResourceID - Conditional. If createMode is RestoreLongTermRetentionBackup, then this value is required. Specifies the resource ID of the recovery point to restore from. + RecoveryServicesRecoveryPointResourceID *string `json:"recoveryServicesRecoveryPointResourceId,omitempty"` + // Edition - The edition of the database. The DatabaseEditions enumeration contains all the valid editions. If createMode is NonReadableSecondary or OnlineSecondary, this value is ignored. + // + // The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands: + // + // ```azurecli + // az sql db list-editions -l -o table + // ```` + // + // ```powershell + // Get-AzSqlServerServiceObjective -Location + // ```` + // . Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2', 'GeneralPurpose', 'BusinessCritical', 'Hyperscale' + Edition DatabaseEdition `json:"edition,omitempty"` + // MaxSizeBytes - The max size of the database expressed in bytes. If createMode is not Default, this value is ignored. To see possible values, query the capabilities API (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) referred to by operationId: "Capabilities_ListByLocation." + MaxSizeBytes *string `json:"maxSizeBytes,omitempty"` + // RequestedServiceObjectiveID - The configured service level objective ID of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of currentServiceObjectiveId property. If requestedServiceObjectiveId and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveId overrides the value of requestedServiceObjectiveName. + // + // The list of SKUs may vary by region and support offer. To determine the service objective ids that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API. + RequestedServiceObjectiveID *uuid.UUID `json:"requestedServiceObjectiveId,omitempty"` + // RequestedServiceObjectiveName - The name of the configured service level objective of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of serviceLevelObjective property. + // + // The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands: + // + // ```azurecli + // az sql db list-editions -l -o table + // ```` + // + // ```powershell + // Get-AzSqlServerServiceObjective -Location + // ```` + // . Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool' + RequestedServiceObjectiveName ServiceObjectiveName `json:"requestedServiceObjectiveName,omitempty"` + // ServiceLevelObjective - READ-ONLY; The current service level objective of the database. Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool' + ServiceLevelObjective ServiceObjectiveName `json:"serviceLevelObjective,omitempty"` + // Status - READ-ONLY; The status of the database. + Status *string `json:"status,omitempty"` + // ElasticPoolName - The name of the elastic pool the database is in. If elasticPoolName and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveName is ignored. Not supported for DataWarehouse edition. + ElasticPoolName *string `json:"elasticPoolName,omitempty"` + // DefaultSecondaryLocation - READ-ONLY; The default secondary region for this database. + DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty"` + // ServiceTierAdvisors - READ-ONLY; The list of service tier advisors for this database. Expanded property + ServiceTierAdvisors *[]ServiceTierAdvisor `json:"serviceTierAdvisors,omitempty"` + // TransparentDataEncryption - READ-ONLY; The transparent data encryption info for this database. + TransparentDataEncryption *[]TransparentDataEncryption `json:"transparentDataEncryption,omitempty"` + // RecommendedIndex - READ-ONLY; The recommended indices for this database. + RecommendedIndex *[]RecommendedIndex `json:"recommendedIndex,omitempty"` + // FailoverGroupID - READ-ONLY; The resource identifier of the failover group containing this database. + FailoverGroupID *string `json:"failoverGroupId,omitempty"` + // ReadScale - Conditional. If the database is a geo-secondary, readScale indicates whether read-only connections are allowed to this database or not. Not supported for DataWarehouse edition. Possible values include: 'ReadScaleEnabled', 'ReadScaleDisabled' + ReadScale ReadScale `json:"readScale,omitempty"` + // SampleName - Indicates the name of the sample schema to apply when creating this database. If createMode is not Default, this value is ignored. Not supported for DataWarehouse edition. Possible values include: 'AdventureWorksLT' + SampleName SampleName `json:"sampleName,omitempty"` + // ZoneRedundant - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +// DatabasesCreateImportOperationFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DatabasesCreateImportOperationFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DatabasesCreateImportOperationFuture) Result(client DatabasesClient) (ier ImportExportResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) if err != nil { - return err + err = autorest.NewErrorWithError(err, "sql.DatabasesCreateImportOperationFuture", "Result", future.Response(), "Polling failure") + return } - 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 - } - bltrp.Location = &location - } - case "properties": - if v != nil { - var backupLongTermRetentionPolicyProperties BackupLongTermRetentionPolicyProperties - err = json.Unmarshal(*v, &backupLongTermRetentionPolicyProperties) - if err != nil { - return err - } - bltrp.BackupLongTermRetentionPolicyProperties = &backupLongTermRetentionPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - bltrp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - bltrp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - bltrp.Type = &typeVar - } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.DatabasesCreateImportOperationFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent { + ier, err = client.CreateImportOperationResponder(ier.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesCreateImportOperationFuture", "Result", ier.Response.Response, "Failure responding to request") } } - - return nil + return } -// BackupLongTermRetentionPolicyListResult represents the response to a list long-term retention policies -// request. -type BackupLongTermRetentionPolicyListResult struct { - autorest.Response `json:"-"` - // Value - The list of long-term retention policies in the database. - Value *[]BackupLongTermRetentionPolicy `json:"value,omitempty"` +// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DatabasesCreateOrUpdateFuture struct { + azure.Future } -// BackupLongTermRetentionPolicyProperties the properties of a backup long term retention policy -type BackupLongTermRetentionPolicyProperties struct { - // State - The status of the backup long term retention policy. Possible values include: 'BackupLongTermRetentionPolicyStateDisabled', 'BackupLongTermRetentionPolicyStateEnabled' - State BackupLongTermRetentionPolicyState `json:"state,omitempty"` - // RecoveryServicesBackupPolicyResourceID - The azure recovery services backup protection policy resource id - RecoveryServicesBackupPolicyResourceID *string `json:"recoveryServicesBackupPolicyResourceId,omitempty"` +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DatabasesCreateOrUpdateFuture) Result(client DatabasesClient) (d Database, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.DatabasesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { + d, err = client.CreateOrUpdateResponder(d.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") + } + } + return } -// BackupLongTermRetentionVault a backup long term retention vault -type BackupLongTermRetentionVault struct { +// DatabaseSecurityAlertPolicy contains information about a database Threat Detection policy. +type DatabaseSecurityAlertPolicy struct { autorest.Response `json:"-"` - // Location - READ-ONLY; The geo-location where the resource lives + // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` - // BackupLongTermRetentionVaultProperties - The properties of the backup long term retention vault - *BackupLongTermRetentionVaultProperties `json:"properties,omitempty"` + // Kind - READ-ONLY; Resource kind. + Kind *string `json:"kind,omitempty"` + // DatabaseSecurityAlertPolicyProperties - Properties of the security alert policy. + *DatabaseSecurityAlertPolicyProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -1240,17 +839,20 @@ type BackupLongTermRetentionVault struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for BackupLongTermRetentionVault. -func (bltrv BackupLongTermRetentionVault) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for DatabaseSecurityAlertPolicy. +func (dsap DatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if bltrv.BackupLongTermRetentionVaultProperties != nil { - objectMap["properties"] = bltrv.BackupLongTermRetentionVaultProperties + if dsap.Location != nil { + objectMap["location"] = dsap.Location + } + if dsap.DatabaseSecurityAlertPolicyProperties != nil { + objectMap["properties"] = dsap.DatabaseSecurityAlertPolicyProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for BackupLongTermRetentionVault struct. -func (bltrv *BackupLongTermRetentionVault) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for DatabaseSecurityAlertPolicy struct. +func (dsap *DatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1265,16 +867,25 @@ func (bltrv *BackupLongTermRetentionVault) UnmarshalJSON(body []byte) error { if err != nil { return err } - bltrv.Location = &location + dsap.Location = &location + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dsap.Kind = &kind } case "properties": if v != nil { - var backupLongTermRetentionVaultProperties BackupLongTermRetentionVaultProperties - err = json.Unmarshal(*v, &backupLongTermRetentionVaultProperties) + var databaseSecurityAlertPolicyProperties DatabaseSecurityAlertPolicyProperties + err = json.Unmarshal(*v, &databaseSecurityAlertPolicyProperties) if err != nil { return err } - bltrv.BackupLongTermRetentionVaultProperties = &backupLongTermRetentionVaultProperties + dsap.DatabaseSecurityAlertPolicyProperties = &databaseSecurityAlertPolicyProperties } case "id": if v != nil { @@ -1283,7 +894,7 @@ func (bltrv *BackupLongTermRetentionVault) UnmarshalJSON(body []byte) error { if err != nil { return err } - bltrv.ID = &ID + dsap.ID = &ID } case "name": if v != nil { @@ -1292,7 +903,7 @@ func (bltrv *BackupLongTermRetentionVault) UnmarshalJSON(body []byte) error { if err != nil { return err } - bltrv.Name = &name + dsap.Name = &name } case "type": if v != nil { @@ -1301,7 +912,7 @@ func (bltrv *BackupLongTermRetentionVault) UnmarshalJSON(body []byte) error { if err != nil { return err } - bltrv.Type = &typeVar + dsap.Type = &typeVar } } } @@ -1309,2981 +920,165 @@ func (bltrv *BackupLongTermRetentionVault) UnmarshalJSON(body []byte) error { return nil } -// BackupLongTermRetentionVaultListResult represents the response to a list vaults request. -type BackupLongTermRetentionVaultListResult struct { - autorest.Response `json:"-"` - // Value - The list of vaults in the server. - Value *[]BackupLongTermRetentionVault `json:"value,omitempty"` -} - -// BackupLongTermRetentionVaultProperties the properties of a backup long term retention vault. -type BackupLongTermRetentionVaultProperties struct { - // RecoveryServicesVaultResourceID - The azure recovery services vault resource id - RecoveryServicesVaultResourceID *string `json:"recoveryServicesVaultResourceId,omitempty"` +// DatabaseSecurityAlertPolicyProperties properties for a database Threat Detection policy. +type DatabaseSecurityAlertPolicyProperties struct { + // State - Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. Possible values include: 'SecurityAlertPolicyStateNew', 'SecurityAlertPolicyStateEnabled', 'SecurityAlertPolicyStateDisabled' + State SecurityAlertPolicyState `json:"state,omitempty"` + // DisabledAlerts - Specifies the semicolon-separated list of alerts that are disabled, or empty string to disable no alerts. Possible values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; Data_Exfiltration; Unsafe_Action. + DisabledAlerts *string `json:"disabledAlerts,omitempty"` + // EmailAddresses - Specifies the semicolon-separated list 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. Possible values include: 'SecurityAlertPolicyEmailAccountAdminsEnabled', 'SecurityAlertPolicyEmailAccountAdminsDisabled' + EmailAccountAdmins SecurityAlertPolicyEmailAccountAdmins `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. If state is Enabled, storageEndpoint is required. + StorageEndpoint *string `json:"storageEndpoint,omitempty"` + // StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account. If state is Enabled, storageAccountAccessKey is required. + StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + // RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs. + RetentionDays *int32 `json:"retentionDays,omitempty"` + // UseServerDefault - Specifies whether to use the default server policy. Possible values include: 'SecurityAlertPolicyUseServerDefaultEnabled', 'SecurityAlertPolicyUseServerDefaultDisabled' + UseServerDefault SecurityAlertPolicyUseServerDefault `json:"useServerDefault,omitempty"` } -// BackupLongTermRetentionVaultsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type BackupLongTermRetentionVaultsCreateOrUpdateFuture struct { +// DatabasesExportFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DatabasesExportFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *BackupLongTermRetentionVaultsCreateOrUpdateFuture) Result(client BackupLongTermRetentionVaultsClient) (bltrv BackupLongTermRetentionVault, err error) { +func (future *DatabasesExportFuture) Result(client DatabasesClient) (ier ImportExportResponse, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("sql.BackupLongTermRetentionVaultsCreateOrUpdateFuture") + err = azure.NewAsyncOpIncompleteError("sql.DatabasesExportFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bltrv.Response.Response, err = future.GetResult(sender); err == nil && bltrv.Response.Response.StatusCode != http.StatusNoContent { - bltrv, err = client.CreateOrUpdateResponder(bltrv.Response.Response) + if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent { + ier, err = client.ExportResponder(ier.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsCreateOrUpdateFuture", "Result", bltrv.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", ier.Response.Response, "Failure responding to request") } } return } -// CheckNameAvailabilityRequest a request to check whether the specified name for a resource is available. -type CheckNameAvailabilityRequest struct { - // Name - The name whose availability is to be checked. - Name *string `json:"name,omitempty"` - // Type - The type of resource that is used as the scope of the availability check. - Type *string `json:"type,omitempty"` +// DatabasesImportFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DatabasesImportFuture struct { + azure.Future } -// CheckNameAvailabilityResponse a response indicating whether the specified name for a resource is -// available. -type CheckNameAvailabilityResponse struct { - autorest.Response `json:"-"` - // Available - READ-ONLY; True if the name is available, otherwise false. - Available *bool `json:"available,omitempty"` - // Message - READ-ONLY; A message explaining why the name is unavailable. Will be null if the name is available. - Message *string `json:"message,omitempty"` - // Name - READ-ONLY; The name whose availability was checked. - Name *string `json:"name,omitempty"` - // Reason - READ-ONLY; The reason code explaining why the name is unavailable. Will be null if the name is available. Possible values include: 'Invalid', 'AlreadyExists' - Reason CheckNameAvailabilityReason `json:"reason,omitempty"` -} - -// Database represents a database. -type Database struct { - autorest.Response `json:"-"` - // Kind - READ-ONLY; Kind of database. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // DatabaseProperties - The properties representing the resource. - *DatabaseProperties `json:"properties,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Database. -func (d Database) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if d.DatabaseProperties != nil { - objectMap["properties"] = d.DatabaseProperties - } - if d.Location != nil { - objectMap["location"] = d.Location - } - if d.Tags != nil { - objectMap["tags"] = d.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Database struct. -func (d *Database) 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 - } - d.Kind = &kind - } - case "properties": - if v != nil { - var databaseProperties DatabaseProperties - err = json.Unmarshal(*v, &databaseProperties) - if err != nil { - return err - } - d.DatabaseProperties = &databaseProperties - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - d.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - d.Tags = tags - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - d.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - d.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - d.Type = &typeVar - } - } - } - - return nil -} - -// DatabaseConnectionPolicy a database connection policy. -type DatabaseConnectionPolicy struct { - autorest.Response `json:"-"` - // Kind - READ-ONLY; Resource kind. - Kind *string `json:"kind,omitempty"` - // Location - READ-ONLY; Resource location. - Location *string `json:"location,omitempty"` - // DatabaseConnectionPolicyProperties - Resource properties. - *DatabaseConnectionPolicyProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for DatabaseConnectionPolicy. -func (dcp DatabaseConnectionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dcp.DatabaseConnectionPolicyProperties != nil { - objectMap["properties"] = dcp.DatabaseConnectionPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DatabaseConnectionPolicy struct. -func (dcp *DatabaseConnectionPolicy) 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 - } - dcp.Kind = &kind - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dcp.Location = &location - } - case "properties": - if v != nil { - var databaseConnectionPolicyProperties DatabaseConnectionPolicyProperties - err = json.Unmarshal(*v, &databaseConnectionPolicyProperties) - if err != nil { - return err - } - dcp.DatabaseConnectionPolicyProperties = &databaseConnectionPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dcp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dcp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dcp.Type = &typeVar - } - } - } - - return nil -} - -// DatabaseConnectionPolicyProperties properties of a database connection policy. -type DatabaseConnectionPolicyProperties 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"` -} - -// DatabaseListResult represents the response to a list database request. -type DatabaseListResult struct { - autorest.Response `json:"-"` - // Value - The list of databases housed in the server. - Value *[]Database `json:"value,omitempty"` -} - -// DatabaseProperties represents the properties of a database. -type DatabaseProperties struct { - // Collation - The collation of the database. If createMode is not Default, this value is ignored. - Collation *string `json:"collation,omitempty"` - // CreationDate - READ-ONLY; The creation date of the database (ISO8601 format). - CreationDate *date.Time `json:"creationDate,omitempty"` - // ContainmentState - READ-ONLY; The containment state of the database. - ContainmentState *int64 `json:"containmentState,omitempty"` - // CurrentServiceObjectiveID - READ-ONLY; The current service level objective ID of the database. This is the ID of the service level objective that is currently active. - CurrentServiceObjectiveID *uuid.UUID `json:"currentServiceObjectiveId,omitempty"` - // DatabaseID - READ-ONLY; The ID of the database. - DatabaseID *uuid.UUID `json:"databaseId,omitempty"` - // EarliestRestoreDate - READ-ONLY; This records the earliest start date and time that restore is available for this database (ISO8601 format). - EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` - // CreateMode - Specifies the mode of database creation. - // Default: regular database creation. - // Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database. - // OnlineSecondary/NonReadableSecondary: creates a database as a (readable or nonreadable) secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database. - // PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified. - // Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore. - // Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time. - // RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID. - // Copy, NonReadableSecondary, OnlineSecondary and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. Possible values include: 'CreateModeCopy', 'CreateModeDefault', 'CreateModeNonReadableSecondary', 'CreateModeOnlineSecondary', 'CreateModePointInTimeRestore', 'CreateModeRecovery', 'CreateModeRestore', 'CreateModeRestoreLongTermRetentionBackup' - CreateMode CreateMode `json:"createMode,omitempty"` - // SourceDatabaseID - Conditional. If createMode is Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, or Restore, then this value is required. Specifies the resource ID of the source database. If createMode is NonReadableSecondary or OnlineSecondary, the name of the source database must be the same as the new database being created. - SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"` - // SourceDatabaseDeletionDate - Conditional. If createMode is Restore and sourceDatabaseId is the deleted database's original resource id when it existed (as opposed to its current restorable dropped database id), then this value is required. Specifies the time that the database was deleted. - SourceDatabaseDeletionDate *date.Time `json:"sourceDatabaseDeletionDate,omitempty"` - // RestorePointInTime - Conditional. If createMode is PointInTimeRestore, this value is required. If createMode is Restore, this value is optional. Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. Must be greater than or equal to the source database's earliestRestoreDate value. - RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"` - // RecoveryServicesRecoveryPointResourceID - Conditional. If createMode is RestoreLongTermRetentionBackup, then this value is required. Specifies the resource ID of the recovery point to restore from. - RecoveryServicesRecoveryPointResourceID *string `json:"recoveryServicesRecoveryPointResourceId,omitempty"` - // Edition - The edition of the database. The DatabaseEditions enumeration contains all the valid editions. If createMode is NonReadableSecondary or OnlineSecondary, this value is ignored. - // - // The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands: - // - // ```azurecli - // az sql db list-editions -l -o table - // ```` - // - // ```powershell - // Get-AzSqlServerServiceObjective -Location - // ```` - // . Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2', 'GeneralPurpose', 'BusinessCritical', 'Hyperscale' - Edition DatabaseEdition `json:"edition,omitempty"` - // MaxSizeBytes - The max size of the database expressed in bytes. If createMode is not Default, this value is ignored. To see possible values, query the capabilities API (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) referred to by operationId: "Capabilities_ListByLocation." - MaxSizeBytes *string `json:"maxSizeBytes,omitempty"` - // RequestedServiceObjectiveID - The configured service level objective ID of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of currentServiceObjectiveId property. If requestedServiceObjectiveId and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveId overrides the value of requestedServiceObjectiveName. - // - // The list of SKUs may vary by region and support offer. To determine the service objective ids that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API. - RequestedServiceObjectiveID *uuid.UUID `json:"requestedServiceObjectiveId,omitempty"` - // RequestedServiceObjectiveName - The name of the configured service level objective of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of serviceLevelObjective property. - // - // The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands: - // - // ```azurecli - // az sql db list-editions -l -o table - // ```` - // - // ```powershell - // Get-AzSqlServerServiceObjective -Location - // ```` - // . Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool' - RequestedServiceObjectiveName ServiceObjectiveName `json:"requestedServiceObjectiveName,omitempty"` - // ServiceLevelObjective - READ-ONLY; The current service level objective of the database. Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool' - ServiceLevelObjective ServiceObjectiveName `json:"serviceLevelObjective,omitempty"` - // Status - READ-ONLY; The status of the database. - Status *string `json:"status,omitempty"` - // ElasticPoolName - The name of the elastic pool the database is in. If elasticPoolName and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveName is ignored. Not supported for DataWarehouse edition. - ElasticPoolName *string `json:"elasticPoolName,omitempty"` - // DefaultSecondaryLocation - READ-ONLY; The default secondary region for this database. - DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty"` - // ServiceTierAdvisors - READ-ONLY; The list of service tier advisors for this database. Expanded property - ServiceTierAdvisors *[]ServiceTierAdvisor `json:"serviceTierAdvisors,omitempty"` - // TransparentDataEncryption - READ-ONLY; The transparent data encryption info for this database. - TransparentDataEncryption *[]TransparentDataEncryption `json:"transparentDataEncryption,omitempty"` - // RecommendedIndex - READ-ONLY; The recommended indices for this database. - RecommendedIndex *[]RecommendedIndex `json:"recommendedIndex,omitempty"` - // FailoverGroupID - READ-ONLY; The resource identifier of the failover group containing this database. - FailoverGroupID *string `json:"failoverGroupId,omitempty"` - // ReadScale - Conditional. If the database is a geo-secondary, readScale indicates whether read-only connections are allowed to this database or not. Not supported for DataWarehouse edition. Possible values include: 'ReadScaleEnabled', 'ReadScaleDisabled' - ReadScale ReadScale `json:"readScale,omitempty"` - // SampleName - Indicates the name of the sample schema to apply when creating this database. If createMode is not Default, this value is ignored. Not supported for DataWarehouse edition. Possible values include: 'AdventureWorksLT' - SampleName SampleName `json:"sampleName,omitempty"` - // ZoneRedundant - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` -} - -// DatabasesCreateImportOperationFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DatabasesCreateImportOperationFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DatabasesCreateImportOperationFuture) Result(client DatabasesClient) (ier ImportExportResponse, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesCreateImportOperationFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesCreateImportOperationFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent { - ier, err = client.CreateImportOperationResponder(ier.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesCreateImportOperationFuture", "Result", ier.Response.Response, "Failure responding to request") - } - } - return -} - -// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DatabasesCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DatabasesCreateOrUpdateFuture) Result(client DatabasesClient) (d Database, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { - d, err = client.CreateOrUpdateResponder(d.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") - } - } - return -} - -// DatabaseSecurityAlertPolicy contains information about a database Threat Detection policy. -type DatabaseSecurityAlertPolicy struct { - autorest.Response `json:"-"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // Kind - READ-ONLY; Resource kind. - Kind *string `json:"kind,omitempty"` - // DatabaseSecurityAlertPolicyProperties - Properties of the security alert policy. - *DatabaseSecurityAlertPolicyProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for DatabaseSecurityAlertPolicy. -func (dsap DatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dsap.Location != nil { - objectMap["location"] = dsap.Location - } - if dsap.DatabaseSecurityAlertPolicyProperties != nil { - objectMap["properties"] = dsap.DatabaseSecurityAlertPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DatabaseSecurityAlertPolicy struct. -func (dsap *DatabaseSecurityAlertPolicy) 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 - } - dsap.Location = &location - } - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - dsap.Kind = &kind - } - case "properties": - if v != nil { - var databaseSecurityAlertPolicyProperties DatabaseSecurityAlertPolicyProperties - err = json.Unmarshal(*v, &databaseSecurityAlertPolicyProperties) - if err != nil { - return err - } - dsap.DatabaseSecurityAlertPolicyProperties = &databaseSecurityAlertPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dsap.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dsap.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dsap.Type = &typeVar - } - } - } - - return nil -} - -// DatabaseSecurityAlertPolicyProperties properties for a database Threat Detection policy. -type DatabaseSecurityAlertPolicyProperties struct { - // State - Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. Possible values include: 'SecurityAlertPolicyStateNew', 'SecurityAlertPolicyStateEnabled', 'SecurityAlertPolicyStateDisabled' - State SecurityAlertPolicyState `json:"state,omitempty"` - // DisabledAlerts - Specifies the semicolon-separated list of alerts that are disabled, or empty string to disable no alerts. Possible values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; Data_Exfiltration; Unsafe_Action. - DisabledAlerts *string `json:"disabledAlerts,omitempty"` - // EmailAddresses - Specifies the semicolon-separated list 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. Possible values include: 'SecurityAlertPolicyEmailAccountAdminsEnabled', 'SecurityAlertPolicyEmailAccountAdminsDisabled' - EmailAccountAdmins SecurityAlertPolicyEmailAccountAdmins `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. If state is Enabled, storageEndpoint is required. - StorageEndpoint *string `json:"storageEndpoint,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account. If state is Enabled, storageAccountAccessKey is required. - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` - // RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs. - RetentionDays *int32 `json:"retentionDays,omitempty"` - // UseServerDefault - Specifies whether to use the default server policy. Possible values include: 'SecurityAlertPolicyUseServerDefaultEnabled', 'SecurityAlertPolicyUseServerDefaultDisabled' - UseServerDefault SecurityAlertPolicyUseServerDefault `json:"useServerDefault,omitempty"` -} - -// DatabasesExportFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DatabasesExportFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DatabasesExportFuture) Result(client DatabasesClient) (ier ImportExportResponse, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesExportFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent { - ier, err = client.ExportResponder(ier.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", ier.Response.Response, "Failure responding to request") - } - } - return -} - -// DatabasesImportFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DatabasesImportFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DatabasesImportFuture) Result(client DatabasesClient) (ier ImportExportResponse, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesImportFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent { - ier, err = client.ImportResponder(ier.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", ier.Response.Response, "Failure responding to request") - } - } - return -} - -// DatabasesPauseFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DatabasesPauseFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DatabasesPauseFuture) Result(client DatabasesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesPauseFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesPauseFuture") - return - } - ar.Response = future.Response() - return -} - -// DatabasesResumeFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DatabasesResumeFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DatabasesResumeFuture) Result(client DatabasesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesResumeFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesResumeFuture") - return - } - ar.Response = future.Response() - return -} - -// DatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DatabasesUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DatabasesUpdateFuture) Result(client DatabasesClient) (d Database, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DatabasesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { - d, err = client.UpdateResponder(d.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", d.Response.Response, "Failure responding to request") - } - } - return -} - -// DatabaseTableAuditingPolicy a database table auditing policy. -type DatabaseTableAuditingPolicy struct { - autorest.Response `json:"-"` - // Kind - READ-ONLY; Resource kind. - Kind *string `json:"kind,omitempty"` - // Location - READ-ONLY; Resource location. - Location *string `json:"location,omitempty"` - // DatabaseTableAuditingPolicyProperties - Resource properties. - *DatabaseTableAuditingPolicyProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for DatabaseTableAuditingPolicy. -func (dtap DatabaseTableAuditingPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dtap.DatabaseTableAuditingPolicyProperties != nil { - objectMap["properties"] = dtap.DatabaseTableAuditingPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DatabaseTableAuditingPolicy struct. -func (dtap *DatabaseTableAuditingPolicy) 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 - } - dtap.Kind = &kind - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dtap.Location = &location - } - case "properties": - if v != nil { - var databaseTableAuditingPolicyProperties DatabaseTableAuditingPolicyProperties - err = json.Unmarshal(*v, &databaseTableAuditingPolicyProperties) - if err != nil { - return err - } - dtap.DatabaseTableAuditingPolicyProperties = &databaseTableAuditingPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dtap.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dtap.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dtap.Type = &typeVar - } - } - } - - return nil -} - -// DatabaseTableAuditingPolicyListResult represents the response to a list database table auditing policies -// request. -type DatabaseTableAuditingPolicyListResult struct { - autorest.Response `json:"-"` - // Value - The list of database table auditing policies. - Value *[]DatabaseTableAuditingPolicy `json:"value,omitempty"` -} - -// DatabaseTableAuditingPolicyProperties properties of a database table auditing policy. -type DatabaseTableAuditingPolicyProperties struct { - // UseServerDefault - Whether server default is enabled or disabled. - UseServerDefault *string `json:"useServerDefault,omitempty"` - // AuditingState - The state of the policy. - AuditingState *string `json:"auditingState,omitempty"` - // AuditLogsTableName - The audit logs table name. - AuditLogsTableName *string `json:"auditLogsTableName,omitempty"` - // EventTypesToAudit - Comma-separated list of event types to audit. - EventTypesToAudit *string `json:"eventTypesToAudit,omitempty"` - // FullAuditLogsTableName - The full audit logs table name. - FullAuditLogsTableName *string `json:"fullAuditLogsTableName,omitempty"` - // RetentionDays - The number of days to keep in the audit logs. - RetentionDays *string `json:"retentionDays,omitempty"` - // StorageAccountKey - The key of the auditing storage account. - StorageAccountKey *string `json:"storageAccountKey,omitempty"` - // StorageAccountName - The table storage account name - StorageAccountName *string `json:"storageAccountName,omitempty"` - // StorageAccountResourceGroupName - The table storage account resource group name - StorageAccountResourceGroupName *string `json:"storageAccountResourceGroupName,omitempty"` - // StorageAccountSecondaryKey - The secondary key of the auditing storage account. - StorageAccountSecondaryKey *string `json:"storageAccountSecondaryKey,omitempty"` - // StorageAccountSubscriptionID - The table storage subscription Id. - StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"` - // StorageTableEndpoint - The storage table endpoint. - StorageTableEndpoint *string `json:"storageTableEndpoint,omitempty"` -} - -// DatabaseUpdate represents a database update. -type DatabaseUpdate struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // DatabaseProperties - The properties representing the resource. - *DatabaseProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for DatabaseUpdate. -func (du DatabaseUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if du.Tags != nil { - objectMap["tags"] = du.Tags - } - if du.DatabaseProperties != nil { - objectMap["properties"] = du.DatabaseProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DatabaseUpdate struct. -func (du *DatabaseUpdate) 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 - } - du.Tags = tags - } - case "properties": - if v != nil { - var databaseProperties DatabaseProperties - err = json.Unmarshal(*v, &databaseProperties) - if err != nil { - return err - } - du.DatabaseProperties = &databaseProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - du.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - du.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - du.Type = &typeVar - } - } - } - - return nil -} - -// DatabaseUsage the database usages. -type DatabaseUsage 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"` -} - -// DatabaseUsageListResult the response to a list database metrics request. -type DatabaseUsageListResult struct { - autorest.Response `json:"-"` - // Value - The list of database usages for the database. - Value *[]DatabaseUsage `json:"value,omitempty"` -} - -// DataMaskingPolicy represents a database data masking policy. -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"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - 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 "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"` -} - -// DataMaskingRule represents a database 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; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - 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 database data masking rules. - Value *[]DataMaskingRule `json:"value,omitempty"` -} - -// DataMaskingRuleProperties the properties of a database 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"` -} - -// DisasterRecoveryConfiguration represents a disaster recovery configuration. -type DisasterRecoveryConfiguration struct { - autorest.Response `json:"-"` - // DisasterRecoveryConfigurationProperties - The properties representing the resource. - *DisasterRecoveryConfigurationProperties `json:"properties,omitempty"` - // Location - READ-ONLY; Location of the server that contains this disaster recovery configuration. - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for DisasterRecoveryConfiguration. -func (drc DisasterRecoveryConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if drc.DisasterRecoveryConfigurationProperties != nil { - objectMap["properties"] = drc.DisasterRecoveryConfigurationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DisasterRecoveryConfiguration struct. -func (drc *DisasterRecoveryConfiguration) 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 disasterRecoveryConfigurationProperties DisasterRecoveryConfigurationProperties - err = json.Unmarshal(*v, &disasterRecoveryConfigurationProperties) - if err != nil { - return err - } - drc.DisasterRecoveryConfigurationProperties = &disasterRecoveryConfigurationProperties - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - drc.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - drc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - drc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - drc.Type = &typeVar - } - } - } - - return nil -} - -// DisasterRecoveryConfigurationListResult represents the response to a List disaster recovery -// configuration request. -type DisasterRecoveryConfigurationListResult struct { - autorest.Response `json:"-"` - // Value - The list of disaster recovery configurations housed under the server. - Value *[]DisasterRecoveryConfiguration `json:"value,omitempty"` -} - -// DisasterRecoveryConfigurationProperties represents the properties of a disaster recovery configuration. -type DisasterRecoveryConfigurationProperties struct { - // Status - READ-ONLY; The status of the disaster recovery configuration. Possible values include: 'Creating', 'Ready', 'FailingOver', 'Dropping' - Status DisasterRecoveryConfigurationStatus `json:"status,omitempty"` - // AutoFailover - Whether or not failover can be done automatically. Possible values include: 'Off', 'On' - AutoFailover DisasterRecoveryConfigurationAutoFailover `json:"autoFailover,omitempty"` - // FailoverPolicy - How aggressive the automatic failover should be. Possible values include: 'Manual', 'Automatic' - FailoverPolicy DisasterRecoveryConfigurationFailoverPolicy `json:"failoverPolicy,omitempty"` - // PartnerServerID - Id of the partner server. - PartnerServerID *string `json:"partnerServerId,omitempty"` - // LogicalServerName - READ-ONLY; Logical name of the server. - LogicalServerName *string `json:"logicalServerName,omitempty"` - // PartnerLogicalServerName - READ-ONLY; Logical name of the partner server. - PartnerLogicalServerName *string `json:"partnerLogicalServerName,omitempty"` - // Role - READ-ONLY; The role of the current server in the disaster recovery configuration. Possible values include: 'None', 'Primary', 'Secondary' - Role DisasterRecoveryConfigurationRole `json:"role,omitempty"` -} - -// DisasterRecoveryConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type DisasterRecoveryConfigurationsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DisasterRecoveryConfigurationsCreateOrUpdateFuture) Result(client DisasterRecoveryConfigurationsClient) (drc DisasterRecoveryConfiguration, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DisasterRecoveryConfigurationsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if drc.Response.Response, err = future.GetResult(sender); err == nil && drc.Response.Response.StatusCode != http.StatusNoContent { - drc, err = client.CreateOrUpdateResponder(drc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsCreateOrUpdateFuture", "Result", drc.Response.Response, "Failure responding to request") - } - } - return -} - -// DisasterRecoveryConfigurationsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DisasterRecoveryConfigurationsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DisasterRecoveryConfigurationsDeleteFuture) Result(client DisasterRecoveryConfigurationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DisasterRecoveryConfigurationsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DisasterRecoveryConfigurationsFailoverAllowDataLossFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type DisasterRecoveryConfigurationsFailoverAllowDataLossFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DisasterRecoveryConfigurationsFailoverAllowDataLossFuture) Result(client DisasterRecoveryConfigurationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DisasterRecoveryConfigurationsFailoverAllowDataLossFuture") - return - } - ar.Response = future.Response() - return -} - -// DisasterRecoveryConfigurationsFailoverFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type DisasterRecoveryConfigurationsFailoverFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DisasterRecoveryConfigurationsFailoverFuture) Result(client DisasterRecoveryConfigurationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsFailoverFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.DisasterRecoveryConfigurationsFailoverFuture") - return - } - ar.Response = future.Response() - return -} - -// EditionCapability the database edition capabilities. -type EditionCapability struct { - // Name - READ-ONLY; The edition name. - Name *string `json:"name,omitempty"` - // Status - READ-ONLY; The status of the edition. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // SupportedServiceLevelObjectives - READ-ONLY; The list of supported service objectives for the edition. - SupportedServiceLevelObjectives *[]ServiceObjectiveCapability `json:"supportedServiceLevelObjectives,omitempty"` - // ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the edition. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` -} - -// ElasticPool represents a database elastic pool. -type ElasticPool struct { - autorest.Response `json:"-"` - // ElasticPoolProperties - The properties representing the resource. - *ElasticPoolProperties `json:"properties,omitempty"` - // Kind - READ-ONLY; Kind of elastic pool. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ElasticPool. -func (ep ElasticPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ep.ElasticPoolProperties != nil { - objectMap["properties"] = ep.ElasticPoolProperties - } - if ep.Location != nil { - objectMap["location"] = ep.Location - } - if ep.Tags != nil { - objectMap["tags"] = ep.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ElasticPool struct. -func (ep *ElasticPool) 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 elasticPoolProperties ElasticPoolProperties - err = json.Unmarshal(*v, &elasticPoolProperties) - if err != nil { - return err - } - ep.ElasticPoolProperties = &elasticPoolProperties - } - 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 "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ep.Tags = tags - } - 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 -} - -// ElasticPoolActivity represents the activity on an elastic pool. -type ElasticPoolActivity struct { - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ElasticPoolActivityProperties - The properties representing the resource. - *ElasticPoolActivityProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ElasticPoolActivity. -func (epa ElasticPoolActivity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if epa.Location != nil { - objectMap["location"] = epa.Location - } - if epa.ElasticPoolActivityProperties != nil { - objectMap["properties"] = epa.ElasticPoolActivityProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ElasticPoolActivity struct. -func (epa *ElasticPoolActivity) 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 - } - epa.Location = &location - } - case "properties": - if v != nil { - var elasticPoolActivityProperties ElasticPoolActivityProperties - err = json.Unmarshal(*v, &elasticPoolActivityProperties) - if err != nil { - return err - } - epa.ElasticPoolActivityProperties = &elasticPoolActivityProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - epa.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - epa.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - epa.Type = &typeVar - } - } - } - - return nil -} - -// ElasticPoolActivityListResult represents the response to a list elastic pool activity request. -type ElasticPoolActivityListResult struct { - autorest.Response `json:"-"` - // Value - The list of elastic pool activities. - Value *[]ElasticPoolActivity `json:"value,omitempty"` -} - -// ElasticPoolActivityProperties represents the properties of an elastic pool. -type ElasticPoolActivityProperties struct { - // EndTime - READ-ONLY; The time the operation finished (ISO8601 format). - EndTime *date.Time `json:"endTime,omitempty"` - // ErrorCode - READ-ONLY; The error code if available. - ErrorCode *int32 `json:"errorCode,omitempty"` - // ErrorMessage - READ-ONLY; The error message if available. - ErrorMessage *string `json:"errorMessage,omitempty"` - // ErrorSeverity - READ-ONLY; The error severity if available. - ErrorSeverity *int32 `json:"errorSeverity,omitempty"` - // Operation - READ-ONLY; The operation name. - Operation *string `json:"operation,omitempty"` - // OperationID - READ-ONLY; The unique operation ID. - OperationID *uuid.UUID `json:"operationId,omitempty"` - // PercentComplete - READ-ONLY; The percentage complete if available. - PercentComplete *int32 `json:"percentComplete,omitempty"` - // RequestedDatabaseDtuMax - READ-ONLY; The requested max DTU per database if available. - RequestedDatabaseDtuMax *int32 `json:"requestedDatabaseDtuMax,omitempty"` - // RequestedDatabaseDtuMin - READ-ONLY; The requested min DTU per database if available. - RequestedDatabaseDtuMin *int32 `json:"requestedDatabaseDtuMin,omitempty"` - // RequestedDtu - READ-ONLY; The requested DTU for the pool if available. - RequestedDtu *int32 `json:"requestedDtu,omitempty"` - // RequestedElasticPoolName - READ-ONLY; The requested name for the elastic pool if available. - RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"` - // RequestedStorageLimitInGB - READ-ONLY; The requested storage limit for the pool in GB if available. - RequestedStorageLimitInGB *int64 `json:"requestedStorageLimitInGB,omitempty"` - // ElasticPoolName - READ-ONLY; The name of the elastic pool. - ElasticPoolName *string `json:"elasticPoolName,omitempty"` - // ServerName - READ-ONLY; The name of the server the elastic pool is in. - ServerName *string `json:"serverName,omitempty"` - // StartTime - READ-ONLY; The time the operation started (ISO8601 format). - StartTime *date.Time `json:"startTime,omitempty"` - // State - READ-ONLY; The current state of the operation. - State *string `json:"state,omitempty"` - // RequestedStorageLimitInMB - READ-ONLY; The requested storage limit in MB. - RequestedStorageLimitInMB *int32 `json:"requestedStorageLimitInMB,omitempty"` - // RequestedDatabaseDtuGuarantee - READ-ONLY; The requested per database DTU guarantee. - RequestedDatabaseDtuGuarantee *int32 `json:"requestedDatabaseDtuGuarantee,omitempty"` - // RequestedDatabaseDtuCap - READ-ONLY; The requested per database DTU cap. - RequestedDatabaseDtuCap *int32 `json:"requestedDatabaseDtuCap,omitempty"` - // RequestedDtuGuarantee - READ-ONLY; The requested DTU guarantee. - RequestedDtuGuarantee *int32 `json:"requestedDtuGuarantee,omitempty"` -} - -// ElasticPoolDatabaseActivity represents the activity on an elastic pool. -type ElasticPoolDatabaseActivity struct { - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ElasticPoolDatabaseActivityProperties - The properties representing the resource. - *ElasticPoolDatabaseActivityProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ElasticPoolDatabaseActivity. -func (epda ElasticPoolDatabaseActivity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if epda.Location != nil { - objectMap["location"] = epda.Location - } - if epda.ElasticPoolDatabaseActivityProperties != nil { - objectMap["properties"] = epda.ElasticPoolDatabaseActivityProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ElasticPoolDatabaseActivity struct. -func (epda *ElasticPoolDatabaseActivity) 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 - } - epda.Location = &location - } - case "properties": - if v != nil { - var elasticPoolDatabaseActivityProperties ElasticPoolDatabaseActivityProperties - err = json.Unmarshal(*v, &elasticPoolDatabaseActivityProperties) - if err != nil { - return err - } - epda.ElasticPoolDatabaseActivityProperties = &elasticPoolDatabaseActivityProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - epda.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - epda.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - epda.Type = &typeVar - } - } - } - - return nil -} - -// ElasticPoolDatabaseActivityListResult represents the response to a list elastic pool database activity -// request. -type ElasticPoolDatabaseActivityListResult struct { - autorest.Response `json:"-"` - // Value - The list of elastic pool database activities. - Value *[]ElasticPoolDatabaseActivity `json:"value,omitempty"` -} - -// ElasticPoolDatabaseActivityProperties represents the properties of an elastic pool database activity. -type ElasticPoolDatabaseActivityProperties struct { - // DatabaseName - READ-ONLY; The database name. - DatabaseName *string `json:"databaseName,omitempty"` - // EndTime - READ-ONLY; The time the operation finished (ISO8601 format). - EndTime *date.Time `json:"endTime,omitempty"` - // ErrorCode - READ-ONLY; The error code if available. - ErrorCode *int32 `json:"errorCode,omitempty"` - // ErrorMessage - READ-ONLY; The error message if available. - ErrorMessage *string `json:"errorMessage,omitempty"` - // ErrorSeverity - READ-ONLY; The error severity if available. - ErrorSeverity *int32 `json:"errorSeverity,omitempty"` - // Operation - READ-ONLY; The operation name. - Operation *string `json:"operation,omitempty"` - // OperationID - READ-ONLY; The unique operation ID. - OperationID *uuid.UUID `json:"operationId,omitempty"` - // PercentComplete - READ-ONLY; The percentage complete if available. - PercentComplete *int32 `json:"percentComplete,omitempty"` - // RequestedElasticPoolName - READ-ONLY; The name for the elastic pool the database is moving into if available. - RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"` - // CurrentElasticPoolName - READ-ONLY; The name of the current elastic pool the database is in if available. - CurrentElasticPoolName *string `json:"currentElasticPoolName,omitempty"` - // CurrentServiceObjective - READ-ONLY; The name of the current service objective if available. - CurrentServiceObjective *string `json:"currentServiceObjective,omitempty"` - // RequestedServiceObjective - READ-ONLY; The name of the requested service objective if available. - RequestedServiceObjective *string `json:"requestedServiceObjective,omitempty"` - // ServerName - READ-ONLY; The name of the server the elastic pool is in. - ServerName *string `json:"serverName,omitempty"` - // StartTime - READ-ONLY; The time the operation started (ISO8601 format). - StartTime *date.Time `json:"startTime,omitempty"` - // State - READ-ONLY; The current state of the operation. - State *string `json:"state,omitempty"` -} - -// ElasticPoolDtuCapability the Elastic Pool DTU capability. -type ElasticPoolDtuCapability struct { - // Limit - READ-ONLY; The maximum size of the database (see 'unit' for the units). - Limit *int64 `json:"limit,omitempty"` - // MaxDatabaseCount - READ-ONLY; The maximum number of databases supported. - MaxDatabaseCount *int64 `json:"maxDatabaseCount,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // SupportedMaxSizes - READ-ONLY; The list of supported max sizes. - SupportedMaxSizes *[]MaxSizeCapability `json:"supportedMaxSizes,omitempty"` - // IncludedMaxSize - READ-ONLY; The included (free) max size for this service level objective. - IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"` - // SupportedPerDatabaseMaxSizes - READ-ONLY; The list of supported max database sizes. - SupportedPerDatabaseMaxSizes *[]MaxSizeCapability `json:"supportedPerDatabaseMaxSizes,omitempty"` - // SupportedPerDatabaseMaxDtus - READ-ONLY; The list of supported max database DTUs. - SupportedPerDatabaseMaxDtus *[]ElasticPoolPerDatabaseMaxDtuCapability `json:"supportedPerDatabaseMaxDtus,omitempty"` -} - -// ElasticPoolEditionCapability the elastic pool edition capabilities. -type ElasticPoolEditionCapability struct { - // Name - READ-ONLY; The elastic pool edition name. - Name *string `json:"name,omitempty"` - // Status - READ-ONLY; The status of the elastic pool edition. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // SupportedElasticPoolDtus - READ-ONLY; The list of supported elastic pool DTU levels for the edition. - SupportedElasticPoolDtus *[]ElasticPoolDtuCapability `json:"supportedElasticPoolDtus,omitempty"` - // ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the edition. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` -} - -// ElasticPoolListResult represents the response to a list elastic pool request. -type ElasticPoolListResult struct { - autorest.Response `json:"-"` - // Value - The list of elastic pools hosted in the server. - Value *[]ElasticPool `json:"value,omitempty"` -} - -// ElasticPoolPerDatabaseMaxDtuCapability the max per-database DTU capability. -type ElasticPoolPerDatabaseMaxDtuCapability struct { - // Limit - READ-ONLY; The maximum DTUs per database. - Limit *int64 `json:"limit,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // SupportedPerDatabaseMinDtus - READ-ONLY; The list of supported min database DTUs. - SupportedPerDatabaseMinDtus *[]ElasticPoolPerDatabaseMinDtuCapability `json:"supportedPerDatabaseMinDtus,omitempty"` -} - -// ElasticPoolPerDatabaseMinDtuCapability the minimum per-database DTU capability. -type ElasticPoolPerDatabaseMinDtuCapability struct { - // Limit - READ-ONLY; The maximum DTUs per database. - Limit *int64 `json:"limit,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` -} - -// ElasticPoolProperties represents the properties of an elastic pool. -type ElasticPoolProperties struct { - // CreationDate - READ-ONLY; The creation date of the elastic pool (ISO8601 format). - CreationDate *date.Time `json:"creationDate,omitempty"` - // State - READ-ONLY; The state of the elastic pool. Possible values include: 'ElasticPoolStateCreating', 'ElasticPoolStateReady', 'ElasticPoolStateDisabled' - State ElasticPoolState `json:"state,omitempty"` - // Edition - The edition of the elastic pool. Possible values include: 'ElasticPoolEditionBasic', 'ElasticPoolEditionStandard', 'ElasticPoolEditionPremium', 'ElasticPoolEditionGeneralPurpose', 'ElasticPoolEditionBusinessCritical' - Edition ElasticPoolEdition `json:"edition,omitempty"` - // Dtu - The total shared DTU for the database elastic pool. - Dtu *int32 `json:"dtu,omitempty"` - // DatabaseDtuMax - The maximum DTU any one database can consume. - DatabaseDtuMax *int32 `json:"databaseDtuMax,omitempty"` - // DatabaseDtuMin - The minimum DTU all databases are guaranteed. - DatabaseDtuMin *int32 `json:"databaseDtuMin,omitempty"` - // StorageMB - Gets storage limit for the database elastic pool in MB. - StorageMB *int32 `json:"storageMB,omitempty"` - // ZoneRedundant - Whether or not this database elastic pool is zone redundant, which means the replicas of this database will be spread across multiple availability zones. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` -} - -// ElasticPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ElasticPoolsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ElasticPoolsCreateOrUpdateFuture) Result(client ElasticPoolsClient) (ep ElasticPool, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsCreateOrUpdateFuture") - 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, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", ep.Response.Response, "Failure responding to request") - } - } - return -} - -// ElasticPoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ElasticPoolsUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ElasticPoolsUpdateFuture) Result(client ElasticPoolsClient) (ep ElasticPool, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsUpdateFuture") - 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.UpdateResponder(ep.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", ep.Response.Response, "Failure responding to request") - } - } - return -} - -// ElasticPoolUpdate represents an elastic pool update. -type ElasticPoolUpdate struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ElasticPoolProperties - The properties representing the resource. - *ElasticPoolProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ElasticPoolUpdate. -func (epu ElasticPoolUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if epu.Tags != nil { - objectMap["tags"] = epu.Tags - } - if epu.ElasticPoolProperties != nil { - objectMap["properties"] = epu.ElasticPoolProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ElasticPoolUpdate struct. -func (epu *ElasticPoolUpdate) 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 - } - epu.Tags = tags - } - case "properties": - if v != nil { - var elasticPoolProperties ElasticPoolProperties - err = json.Unmarshal(*v, &elasticPoolProperties) - if err != nil { - return err - } - epu.ElasticPoolProperties = &elasticPoolProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - epu.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - epu.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - epu.Type = &typeVar - } - } - } - - return nil -} - -// ExportRequest export database parameters. -type ExportRequest struct { - // StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"` - // StorageKey - The storage key to use. If storage key type is SharedAccessKey, it must be preceded with a "?." - StorageKey *string `json:"storageKey,omitempty"` - // StorageURI - The storage uri to use. - StorageURI *string `json:"storageUri,omitempty"` - // AdministratorLogin - The name of the SQL administrator. - AdministratorLogin *string `json:"administratorLogin,omitempty"` - // AdministratorLoginPassword - The password of the SQL administrator. - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` - // AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword' - AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` -} - -// ExtensionListResult represents the response to a list extensions request. -type ExtensionListResult struct { - autorest.Response `json:"-"` - // Value - The list of extensions. - Value *[]interface{} `json:"value,omitempty"` -} - -// FirewallRule represents a server firewall rule. -type FirewallRule struct { - autorest.Response `json:"-"` - // Kind - READ-ONLY; Kind of server that contains this firewall rule. - Kind *string `json:"kind,omitempty"` - // Location - READ-ONLY; Location of the server that contains this firewall rule. - Location *string `json:"location,omitempty"` - // FirewallRuleProperties - The properties representing the resource. - *FirewallRuleProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for FirewallRule. -func (fr FirewallRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fr.FirewallRuleProperties != nil { - objectMap["properties"] = fr.FirewallRuleProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for FirewallRule struct. -func (fr *FirewallRule) 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 - } - fr.Kind = &kind - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - fr.Location = &location - } - case "properties": - if v != nil { - var firewallRuleProperties FirewallRuleProperties - err = json.Unmarshal(*v, &firewallRuleProperties) - if err != nil { - return err - } - fr.FirewallRuleProperties = &firewallRuleProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - fr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - fr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - fr.Type = &typeVar - } - } - } - - return nil -} - -// FirewallRuleListResult represents the response to a List Firewall Rules request. -type FirewallRuleListResult struct { - autorest.Response `json:"-"` - // Value - The list of server firewall rules. - Value *[]FirewallRule `json:"value,omitempty"` -} - -// FirewallRuleProperties represents the properties of a server firewall rule. -type FirewallRuleProperties struct { - // StartIPAddress - The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP addresses. - StartIPAddress *string `json:"startIpAddress,omitempty"` - // EndIPAddress - The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. Use value '0.0.0.0' to represent all Azure-internal IP addresses. - EndIPAddress *string `json:"endIpAddress,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; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - 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"` -} - -// ImportExportResponse response for Import/Export Get operation. -type ImportExportResponse struct { - autorest.Response `json:"-"` - // ImportExportResponseProperties - The import/export operation properties. - *ImportExportResponseProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ImportExportResponse. -func (ier ImportExportResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ier.ImportExportResponseProperties != nil { - objectMap["properties"] = ier.ImportExportResponseProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ImportExportResponse struct. -func (ier *ImportExportResponse) 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 importExportResponseProperties ImportExportResponseProperties - err = json.Unmarshal(*v, &importExportResponseProperties) - if err != nil { - return err - } - ier.ImportExportResponseProperties = &importExportResponseProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ier.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ier.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ier.Type = &typeVar - } - } - } - - return nil -} - -// ImportExportResponseProperties response for Import/Export Status operation. -type ImportExportResponseProperties struct { - // RequestType - READ-ONLY; The request type of the operation. - RequestType *string `json:"requestType,omitempty"` - // RequestID - READ-ONLY; The request type of the operation. - RequestID *uuid.UUID `json:"requestId,omitempty"` - // ServerName - READ-ONLY; The name of the server. - ServerName *string `json:"serverName,omitempty"` - // DatabaseName - READ-ONLY; The name of the database. - DatabaseName *string `json:"databaseName,omitempty"` - // Status - READ-ONLY; The status message returned from the server. - Status *string `json:"status,omitempty"` - // LastModifiedTime - READ-ONLY; The operation status last modified time. - LastModifiedTime *string `json:"lastModifiedTime,omitempty"` - // QueuedTime - READ-ONLY; The operation queued time. - QueuedTime *string `json:"queuedTime,omitempty"` - // BlobURI - READ-ONLY; The blob uri. - BlobURI *string `json:"blobUri,omitempty"` - // ErrorMessage - READ-ONLY; The error message returned from the server. - ErrorMessage *string `json:"errorMessage,omitempty"` -} - -// ImportExtensionProperties represents the properties for an import operation -type ImportExtensionProperties struct { - // OperationMode - The type of import operation being performed. This is always Import. - OperationMode *string `json:"operationMode,omitempty"` - // StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"` - // StorageKey - The storage key to use. If storage key type is SharedAccessKey, it must be preceded with a "?." - StorageKey *string `json:"storageKey,omitempty"` - // StorageURI - The storage uri to use. - StorageURI *string `json:"storageUri,omitempty"` - // AdministratorLogin - The name of the SQL administrator. - AdministratorLogin *string `json:"administratorLogin,omitempty"` - // AdministratorLoginPassword - The password of the SQL administrator. - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` - // AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword' - AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` -} - -// ImportExtensionRequest import database parameters. -type ImportExtensionRequest struct { - // Name - The name of the extension. - Name *string `json:"name,omitempty"` - // Type - The type of the extension. - Type *string `json:"type,omitempty"` - // ImportExtensionProperties - Represents the properties of the resource. - *ImportExtensionProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ImportExtensionRequest. -func (ier ImportExtensionRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ier.Name != nil { - objectMap["name"] = ier.Name - } - if ier.Type != nil { - objectMap["type"] = ier.Type - } - if ier.ImportExtensionProperties != nil { - objectMap["properties"] = ier.ImportExtensionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ImportExtensionRequest struct. -func (ier *ImportExtensionRequest) 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 - } - ier.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ier.Type = &typeVar - } - case "properties": - if v != nil { - var importExtensionProperties ImportExtensionProperties - err = json.Unmarshal(*v, &importExtensionProperties) - if err != nil { - return err - } - ier.ImportExtensionProperties = &importExtensionProperties - } - } - } - - return nil -} - -// ImportRequest import database parameters. -type ImportRequest struct { - // DatabaseName - The name of the database to import. - DatabaseName *string `json:"databaseName,omitempty"` - // Edition - The edition for the database being created. - // - // The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands: - // - // ```azurecli - // az sql db list-editions -l -o table - // ```` - // - // ```powershell - // Get-AzSqlServerServiceObjective -Location - // ```` - // . Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2', 'GeneralPurpose', 'BusinessCritical', 'Hyperscale' - Edition DatabaseEdition `json:"edition,omitempty"` - // ServiceObjectiveName - The name of the service objective to assign to the database. Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool' - ServiceObjectiveName ServiceObjectiveName `json:"serviceObjectiveName,omitempty"` - // MaxSizeBytes - The maximum size for the newly imported database. - MaxSizeBytes *string `json:"maxSizeBytes,omitempty"` - // StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"` - // StorageKey - The storage key to use. If storage key type is SharedAccessKey, it must be preceded with a "?." - StorageKey *string `json:"storageKey,omitempty"` - // StorageURI - The storage uri to use. - StorageURI *string `json:"storageUri,omitempty"` - // AdministratorLogin - The name of the SQL administrator. - AdministratorLogin *string `json:"administratorLogin,omitempty"` - // AdministratorLoginPassword - The password of the SQL administrator. - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` - // AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword' - AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` -} - -// LocationCapabilities the capabilities for a location. -type LocationCapabilities struct { - autorest.Response `json:"-"` - // Name - READ-ONLY; The location name. - Name *string `json:"name,omitempty"` - // Status - READ-ONLY; Azure SQL Database's status for the location. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // SupportedServerVersions - READ-ONLY; The list of supported server versions. - SupportedServerVersions *[]ServerVersionCapability `json:"supportedServerVersions,omitempty"` -} - -// MaxSizeCapability the maximum size limits for a database. -type MaxSizeCapability struct { - // Limit - READ-ONLY; The maximum size of the database (see 'unit' for the units). - Limit *int64 `json:"limit,omitempty"` - // Unit - READ-ONLY; The units that the limit is expressed in. Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes' - Unit MaxSizeUnits `json:"unit,omitempty"` - // Status - READ-ONLY; The status of the maximum size capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` -} - -// Metric database metrics. -type Metric struct { - // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). - EndTime *date.Time `json:"endTime,omitempty"` - // TimeGrain - READ-ONLY; The time step to be used to summarize the metric values. - TimeGrain *string `json:"timeGrain,omitempty"` - // Unit - READ-ONLY; The unit of the metric. Possible values include: 'UnitTypeCount', 'UnitTypeBytes', 'UnitTypeSeconds', 'UnitTypePercent', 'UnitTypeCountPerSecond', 'UnitTypeBytesPerSecond' - Unit UnitType `json:"unit,omitempty"` - // Name - READ-ONLY; The name information for the metric. - Name *MetricName `json:"name,omitempty"` - // MetricValues - READ-ONLY; The metric values for the specified time window and timestep. - MetricValues *[]MetricValue `json:"metricValues,omitempty"` -} - -// MetricAvailability a metric availability value. -type MetricAvailability struct { - // Retention - READ-ONLY; The length of retention for the database metric. - Retention *string `json:"retention,omitempty"` - // TimeGrain - READ-ONLY; The granularity of the database metric. - TimeGrain *string `json:"timeGrain,omitempty"` -} - -// MetricDefinition a database metric definition. -type MetricDefinition struct { - // Name - READ-ONLY; The name information for the metric. - Name *MetricName `json:"name,omitempty"` - // PrimaryAggregationType - READ-ONLY; The primary aggregation type defining how metric values are displayed. Possible values include: 'PrimaryAggregationTypeNone', 'PrimaryAggregationTypeAverage', 'PrimaryAggregationTypeCount', 'PrimaryAggregationTypeMinimum', 'PrimaryAggregationTypeMaximum', 'PrimaryAggregationTypeTotal' - PrimaryAggregationType PrimaryAggregationType `json:"primaryAggregationType,omitempty"` - // ResourceURI - READ-ONLY; The resource uri of the database. - ResourceURI *string `json:"resourceUri,omitempty"` - // Unit - READ-ONLY; The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond' - Unit UnitDefinitionType `json:"unit,omitempty"` - // MetricAvailabilities - READ-ONLY; The list of database metric availabilities for the metric. - MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"` -} - -// MetricDefinitionListResult the response to a list database metric definitions request. -type MetricDefinitionListResult struct { - autorest.Response `json:"-"` - // Value - The list of metric definitions for the database. - Value *[]MetricDefinition `json:"value,omitempty"` -} - -// MetricListResult the response to a list database metrics request. -type MetricListResult struct { - autorest.Response `json:"-"` - // Value - The list of metrics for the database. - Value *[]Metric `json:"value,omitempty"` -} - -// MetricName a database metric name. -type MetricName struct { - // Value - READ-ONLY; The name of the database metric. - Value *string `json:"value,omitempty"` - // LocalizedValue - READ-ONLY; The friendly name of the database metric. - LocalizedValue *string `json:"localizedValue,omitempty"` -} - -// MetricValue represents database metrics. -type MetricValue struct { - // Count - READ-ONLY; The number of values for the metric. - Count *float64 `json:"count,omitempty"` - // Average - READ-ONLY; The average value of the metric. - Average *float64 `json:"average,omitempty"` - // Maximum - READ-ONLY; The max value of the metric. - Maximum *float64 `json:"maximum,omitempty"` - // Minimum - READ-ONLY; The min value of the metric. - Minimum *float64 `json:"minimum,omitempty"` - // Timestamp - READ-ONLY; The metric timestamp (ISO-8601 format). - Timestamp *date.Time `json:"timestamp,omitempty"` - // Total - READ-ONLY; The total value of the metric. - Total *float64 `json:"total,omitempty"` -} - -// Operation SQL REST API operation definition. -type Operation struct { - // Name - Operation name: {provider}/{resource}/{operation} - Name *string `json:"name,omitempty"` - // Display - Display metadata associated with the operation. - Display *OperationDisplay `json:"display,omitempty"` -} - -// OperationDisplay display metadata associated with the operation. -type OperationDisplay struct { - // Provider - Service provider: Microsoft SQL Database. - Provider *string `json:"provider,omitempty"` - // Resource - Resource on which the operation is performed: Server, Database, etc. - Resource *string `json:"resource,omitempty"` - // Operation - Type of operation: get, read, delete, etc. - Operation *string `json:"operation,omitempty"` -} - -// OperationImpact the impact of an operation, both in absolute and relative terms. -type OperationImpact struct { - // Name - READ-ONLY; The name of the impact dimension. - Name *string `json:"name,omitempty"` - // Unit - READ-ONLY; The unit in which estimated impact to dimension is measured. - Unit *string `json:"unit,omitempty"` - // ChangeValueAbsolute - READ-ONLY; The absolute impact to dimension. - ChangeValueAbsolute *float64 `json:"changeValueAbsolute,omitempty"` - // ChangeValueRelative - READ-ONLY; The relative impact to dimension (null if not applicable) - ChangeValueRelative *float64 `json:"changeValueRelative,omitempty"` -} - -// OperationListResult result of the request to list SQL operations. It contains a list of operations and a -// URL link to get the next set of results. -type OperationListResult struct { - autorest.Response `json:"-"` - // Value - List of SQL operations supported by the SQL resource provider. - Value *[]Operation `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// PerformanceLevel a possible performance level of a service objective capability. -type PerformanceLevel struct { - // Unit - READ-ONLY; Unit type used to measure service objective performance level. Possible values include: 'DTU' - Unit PerformanceLevelUnit `json:"unit,omitempty"` - // Value - READ-ONLY; Performance level value. - Value *int32 `json:"value,omitempty"` -} - -// ProxyResource ARM proxy resource. -type ProxyResource struct { - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,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"` -} - -// 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: 'Percentage', 'KB', 'Microseconds' - Unit QueryMetricUnit `json:"unit,omitempty"` - // Value - READ-ONLY; The measured value - Value *float64 `json:"value,omitempty"` -} - -// 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"` -} - -// QueryStatisticListResult represents the response to a get query request. -type QueryStatisticListResult struct { - autorest.Response `json:"-"` - // Value - The query. - Value *[]QueryStatistic `json:"value,omitempty"` -} - -// QueryText ... -type QueryText struct { - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // QueryText - READ-ONLY; Query text. - QueryText *string `json:"queryText,omitempty"` -} - -// QueryTextListResult represents the response to a get query text request. -type QueryTextListResult struct { - autorest.Response `json:"-"` - // Value - The query text. - Value *[]QueryText `json:"value,omitempty"` -} - -// RecommendedElasticPool represents a recommended elastic pool. -type RecommendedElasticPool struct { - autorest.Response `json:"-"` - // RecommendedElasticPoolProperties - The properties representing the resource. - *RecommendedElasticPoolProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for RecommendedElasticPool. -func (rep RecommendedElasticPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rep.RecommendedElasticPoolProperties != nil { - objectMap["properties"] = rep.RecommendedElasticPoolProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RecommendedElasticPool struct. -func (rep *RecommendedElasticPool) 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 recommendedElasticPoolProperties RecommendedElasticPoolProperties - err = json.Unmarshal(*v, &recommendedElasticPoolProperties) - if err != nil { - return err - } - rep.RecommendedElasticPoolProperties = &recommendedElasticPoolProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rep.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rep.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rep.Type = &typeVar - } - } - } - - return nil -} - -// RecommendedElasticPoolListMetricsResult represents the response to a list recommended elastic pool -// metrics request. -type RecommendedElasticPoolListMetricsResult struct { - autorest.Response `json:"-"` - // Value - The list of recommended elastic pools metrics. - Value *[]RecommendedElasticPoolMetric `json:"value,omitempty"` -} - -// RecommendedElasticPoolListResult represents the response to a list recommended elastic pool request. -type RecommendedElasticPoolListResult struct { - autorest.Response `json:"-"` - // Value - The list of recommended elastic pools hosted in the server. - Value *[]RecommendedElasticPool `json:"value,omitempty"` -} - -// RecommendedElasticPoolMetric represents recommended elastic pool metric. -type RecommendedElasticPoolMetric struct { - // DateTime - The time of metric (ISO8601 format). - DateTime *date.Time `json:"dateTime,omitempty"` - // Dtu - Gets or sets the DTUs (Database Transaction Units). See https://azure.microsoft.com/documentation/articles/sql-database-what-is-a-dtu/ - Dtu *float64 `json:"dtu,omitempty"` - // SizeGB - Gets or sets size in gigabytes. - SizeGB *float64 `json:"sizeGB,omitempty"` -} - -// RecommendedElasticPoolProperties represents the properties of a recommended elastic pool. -type RecommendedElasticPoolProperties struct { - // DatabaseEdition - READ-ONLY; The edition of the recommended elastic pool. The ElasticPoolEdition enumeration contains all the valid editions. Possible values include: 'ElasticPoolEditionBasic', 'ElasticPoolEditionStandard', 'ElasticPoolEditionPremium', 'ElasticPoolEditionGeneralPurpose', 'ElasticPoolEditionBusinessCritical' - DatabaseEdition ElasticPoolEdition `json:"databaseEdition,omitempty"` - // Dtu - The DTU for the recommended elastic pool. - Dtu *float64 `json:"dtu,omitempty"` - // DatabaseDtuMin - The minimum DTU for the database. - DatabaseDtuMin *float64 `json:"databaseDtuMin,omitempty"` - // DatabaseDtuMax - The maximum DTU for the database. - DatabaseDtuMax *float64 `json:"databaseDtuMax,omitempty"` - // StorageMB - Gets storage size in megabytes. - StorageMB *float64 `json:"storageMB,omitempty"` - // ObservationPeriodStart - READ-ONLY; The observation period start (ISO8601 format). - ObservationPeriodStart *date.Time `json:"observationPeriodStart,omitempty"` - // ObservationPeriodEnd - READ-ONLY; The observation period start (ISO8601 format). - ObservationPeriodEnd *date.Time `json:"observationPeriodEnd,omitempty"` - // MaxObservedDtu - READ-ONLY; Gets maximum observed DTU. - MaxObservedDtu *float64 `json:"maxObservedDtu,omitempty"` - // MaxObservedStorageMB - READ-ONLY; Gets maximum observed storage in megabytes. - MaxObservedStorageMB *float64 `json:"maxObservedStorageMB,omitempty"` - // Databases - READ-ONLY; The list of databases in this pool. Expanded property - Databases *[]Database `json:"databases,omitempty"` - // Metrics - READ-ONLY; The list of databases housed in the server. Expanded property - Metrics *[]RecommendedElasticPoolMetric `json:"metrics,omitempty"` -} - -// RecommendedIndex represents a database recommended index. -type RecommendedIndex struct { - // RecommendedIndexProperties - READ-ONLY; The properties representing the resource. - *RecommendedIndexProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for RecommendedIndex. -func (ri RecommendedIndex) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RecommendedIndex struct. -func (ri *RecommendedIndex) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DatabasesImportFuture) Result(client DatabasesClient) (ier ImportExportResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) if err != nil { - return err + err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", future.Response(), "Polling failure") + return } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var recommendedIndexProperties RecommendedIndexProperties - err = json.Unmarshal(*v, &recommendedIndexProperties) - if err != nil { - return err - } - ri.RecommendedIndexProperties = &recommendedIndexProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ri.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ri.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ri.Type = &typeVar - } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.DatabasesImportFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent { + ier, err = client.ImportResponder(ier.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", ier.Response.Response, "Failure responding to request") } } - - return nil + return } -// RecommendedIndexProperties represents the properties of a database recommended index. -type RecommendedIndexProperties struct { - // Action - READ-ONLY; The proposed index action. You can create a missing index, drop an unused index, or rebuild an existing index to improve its performance. Possible values include: 'Create', 'Drop', 'Rebuild' - Action RecommendedIndexAction `json:"action,omitempty"` - // State - READ-ONLY; The current recommendation state. Possible values include: 'Active', 'Pending', 'Executing', 'Verifying', 'PendingRevert', 'Reverting', 'Reverted', 'Ignored', 'Expired', 'Blocked', 'Success' - State RecommendedIndexState `json:"state,omitempty"` - // Created - READ-ONLY; The UTC datetime showing when this resource was created (ISO8601 format). - Created *date.Time `json:"created,omitempty"` - // LastModified - READ-ONLY; The UTC datetime of when was this resource last changed (ISO8601 format). - LastModified *date.Time `json:"lastModified,omitempty"` - // IndexType - READ-ONLY; The type of index (CLUSTERED, NONCLUSTERED, COLUMNSTORE, CLUSTERED COLUMNSTORE). Possible values include: 'CLUSTERED', 'NONCLUSTERED', 'COLUMNSTORE', 'CLUSTEREDCOLUMNSTORE' - IndexType RecommendedIndexType `json:"indexType,omitempty"` - // Schema - READ-ONLY; The schema where table to build index over resides - Schema *string `json:"schema,omitempty"` - // Table - READ-ONLY; The table on which to build index. - Table *string `json:"table,omitempty"` - // Columns - READ-ONLY; Columns over which to build index - Columns *[]string `json:"columns,omitempty"` - // IncludedColumns - READ-ONLY; The list of column names to be included in the index - IncludedColumns *[]string `json:"includedColumns,omitempty"` - // IndexScript - READ-ONLY; The full build index script - IndexScript *string `json:"indexScript,omitempty"` - // EstimatedImpact - READ-ONLY; The estimated impact of doing recommended index action. - EstimatedImpact *[]OperationImpact `json:"estimatedImpact,omitempty"` - // ReportedImpact - READ-ONLY; The values reported after index action is complete. - ReportedImpact *[]OperationImpact `json:"reportedImpact,omitempty"` +// DatabasesPauseFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DatabasesPauseFuture struct { + azure.Future } -// RecoverableDatabase a recoverable database -type RecoverableDatabase struct { - autorest.Response `json:"-"` - // RecoverableDatabaseProperties - The properties of a recoverable database - *RecoverableDatabaseProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DatabasesPauseFuture) Result(client DatabasesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesPauseFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.DatabasesPauseFuture") + return + } + ar.Response = future.Response() + return } -// MarshalJSON is the custom marshaler for RecoverableDatabase. -func (rd RecoverableDatabase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rd.RecoverableDatabaseProperties != nil { - objectMap["properties"] = rd.RecoverableDatabaseProperties - } - return json.Marshal(objectMap) +// DatabasesResumeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DatabasesResumeFuture struct { + azure.Future } -// UnmarshalJSON is the custom unmarshaler for RecoverableDatabase struct. -func (rd *RecoverableDatabase) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DatabasesResumeFuture) Result(client DatabasesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) if err != nil { - return err + err = autorest.NewErrorWithError(err, "sql.DatabasesResumeFuture", "Result", future.Response(), "Polling failure") + return } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var recoverableDatabaseProperties RecoverableDatabaseProperties - err = json.Unmarshal(*v, &recoverableDatabaseProperties) - if err != nil { - return err - } - rd.RecoverableDatabaseProperties = &recoverableDatabaseProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rd.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rd.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rd.Type = &typeVar - } - } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.DatabasesResumeFuture") + return } - - return nil + ar.Response = future.Response() + return } -// RecoverableDatabaseListResult the response to a list recoverable databases request -type RecoverableDatabaseListResult struct { - autorest.Response `json:"-"` - // Value - A list of recoverable databases - Value *[]RecoverableDatabase `json:"value,omitempty"` +// DatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DatabasesUpdateFuture struct { + azure.Future } -// RecoverableDatabaseProperties the properties of a recoverable database -type RecoverableDatabaseProperties 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"` +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DatabasesUpdateFuture) Result(client DatabasesClient) (d Database, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.DatabasesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { + d, err = client.UpdateResponder(d.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", d.Response.Response, "Failure responding to request") + } + } + return } -// ReplicationLink represents a database replication link. -type ReplicationLink struct { - autorest.Response `json:"-"` - // Location - READ-ONLY; Location of the server that contains this firewall rule. - Location *string `json:"location,omitempty"` - // ReplicationLinkProperties - The properties representing the resource. - *ReplicationLinkProperties `json:"properties,omitempty"` +// DatabaseUpdate represents a database update. +type DatabaseUpdate struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // DatabaseProperties - The properties representing the resource. + *DatabaseProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -4292,17 +1087,20 @@ type ReplicationLink struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ReplicationLink. -func (rl ReplicationLink) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for DatabaseUpdate. +func (du DatabaseUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if rl.ReplicationLinkProperties != nil { - objectMap["properties"] = rl.ReplicationLinkProperties + if du.Tags != nil { + objectMap["tags"] = du.Tags + } + if du.DatabaseProperties != nil { + objectMap["properties"] = du.DatabaseProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ReplicationLink struct. -func (rl *ReplicationLink) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for DatabaseUpdate struct. +func (du *DatabaseUpdate) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4310,23 +1108,23 @@ func (rl *ReplicationLink) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "location": + case "tags": if v != nil { - var location string - err = json.Unmarshal(*v, &location) + var tags map[string]*string + err = json.Unmarshal(*v, &tags) if err != nil { return err } - rl.Location = &location + du.Tags = tags } case "properties": if v != nil { - var replicationLinkProperties ReplicationLinkProperties - err = json.Unmarshal(*v, &replicationLinkProperties) + var databaseProperties DatabaseProperties + err = json.Unmarshal(*v, &databaseProperties) if err != nil { return err } - rl.ReplicationLinkProperties = &replicationLinkProperties + du.DatabaseProperties = &databaseProperties } case "id": if v != nil { @@ -4335,7 +1133,7 @@ func (rl *ReplicationLink) UnmarshalJSON(body []byte) error { if err != nil { return err } - rl.ID = &ID + du.ID = &ID } case "name": if v != nil { @@ -4344,7 +1142,7 @@ func (rl *ReplicationLink) UnmarshalJSON(body []byte) error { if err != nil { return err } - rl.Name = &name + du.Name = &name } case "type": if v != nil { @@ -4353,7 +1151,7 @@ func (rl *ReplicationLink) UnmarshalJSON(body []byte) error { if err != nil { return err } - rl.Type = &typeVar + du.Type = &typeVar } } } @@ -4361,100 +1159,17 @@ func (rl *ReplicationLink) UnmarshalJSON(body []byte) error { return nil } -// ReplicationLinkListResult represents the response to a List database replication link request. -type ReplicationLinkListResult struct { - autorest.Response `json:"-"` - // Value - The list of database replication links housed in the database. - Value *[]ReplicationLink `json:"value,omitempty"` -} - -// ReplicationLinkProperties represents the properties of a database 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 server hosting the partner database. - PartnerServer *string `json:"partnerServer,omitempty"` - // PartnerDatabase - READ-ONLY; The name of the partner database. - PartnerDatabase *string `json:"partnerDatabase,omitempty"` - // PartnerLocation - READ-ONLY; The Azure Region of the partner database. - PartnerLocation *string `json:"partnerLocation,omitempty"` - // Role - READ-ONLY; The role of the database 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 database 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: 'PENDING', 'SEEDING', 'CATCHUP', 'SUSPENDED' - ReplicationState ReplicationState `json:"replicationState,omitempty"` -} - -// ReplicationLinksFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type ReplicationLinksFailoverAllowDataLossFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ReplicationLinksFailoverAllowDataLossFuture) Result(client ReplicationLinksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverAllowDataLossFuture") - return - } - ar.Response = future.Response() - return -} - -// ReplicationLinksFailoverFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ReplicationLinksFailoverFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ReplicationLinksFailoverFuture) Result(client ReplicationLinksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverFuture") - return - } - ar.Response = future.Response() - return -} - -// Resource ARM resource. -type Resource struct { - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` -} - -// RestorableDroppedDatabase a restorable dropped database -type RestorableDroppedDatabase struct { +// ElasticPool represents a database elastic pool. +type ElasticPool struct { autorest.Response `json:"-"` - // Location - READ-ONLY; The geo-location where the resource lives + // ElasticPoolProperties - The properties representing the resource. + *ElasticPoolProperties `json:"properties,omitempty"` + // Kind - READ-ONLY; Kind of elastic pool. This is metadata used for the Azure portal experience. + Kind *string `json:"kind,omitempty"` + // Location - Resource location. Location *string `json:"location,omitempty"` - // RestorableDroppedDatabaseProperties - The properties of a restorable dropped database - *RestorableDroppedDatabaseProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -4463,17 +1178,23 @@ type RestorableDroppedDatabase struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for RestorableDroppedDatabase. -func (rdd RestorableDroppedDatabase) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ElasticPool. +func (ep ElasticPool) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if rdd.RestorableDroppedDatabaseProperties != nil { - objectMap["properties"] = rdd.RestorableDroppedDatabaseProperties + if ep.ElasticPoolProperties != nil { + objectMap["properties"] = ep.ElasticPoolProperties + } + if ep.Location != nil { + objectMap["location"] = ep.Location + } + if ep.Tags != nil { + objectMap["tags"] = ep.Tags } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for RestorableDroppedDatabase struct. -func (rdd *RestorableDroppedDatabase) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ElasticPool struct. +func (ep *ElasticPool) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4481,6 +1202,24 @@ func (rdd *RestorableDroppedDatabase) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "properties": + if v != nil { + var elasticPoolProperties ElasticPoolProperties + err = json.Unmarshal(*v, &elasticPoolProperties) + if err != nil { + return err + } + ep.ElasticPoolProperties = &elasticPoolProperties + } + 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 @@ -4488,16 +1227,16 @@ func (rdd *RestorableDroppedDatabase) UnmarshalJSON(body []byte) error { if err != nil { return err } - rdd.Location = &location + ep.Location = &location } - case "properties": + case "tags": if v != nil { - var restorableDroppedDatabaseProperties RestorableDroppedDatabaseProperties - err = json.Unmarshal(*v, &restorableDroppedDatabaseProperties) + var tags map[string]*string + err = json.Unmarshal(*v, &tags) if err != nil { return err } - rdd.RestorableDroppedDatabaseProperties = &restorableDroppedDatabaseProperties + ep.Tags = tags } case "id": if v != nil { @@ -4506,7 +1245,7 @@ func (rdd *RestorableDroppedDatabase) UnmarshalJSON(body []byte) error { if err != nil { return err } - rdd.ID = &ID + ep.ID = &ID } case "name": if v != nil { @@ -4515,7 +1254,7 @@ func (rdd *RestorableDroppedDatabase) UnmarshalJSON(body []byte) error { if err != nil { return err } - rdd.Name = &name + ep.Name = &name } case "type": if v != nil { @@ -4524,7 +1263,7 @@ func (rdd *RestorableDroppedDatabase) UnmarshalJSON(body []byte) error { if err != nil { return err } - rdd.Type = &typeVar + ep.Type = &typeVar } } } @@ -4532,37 +1271,12 @@ func (rdd *RestorableDroppedDatabase) UnmarshalJSON(body []byte) error { return nil } -// RestorableDroppedDatabaseListResult the response to a list restorable dropped databases request -type RestorableDroppedDatabaseListResult struct { - autorest.Response `json:"-"` - // Value - A list of restorable dropped databases - Value *[]RestorableDroppedDatabase `json:"value,omitempty"` -} - -// RestorableDroppedDatabaseProperties the properties of a restorable dropped database -type RestorableDroppedDatabaseProperties 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"` -} - -// RestorePoint a database restore point. -type RestorePoint struct { - // RestorePointProperties - The properties of the restore point. - *RestorePointProperties `json:"properties,omitempty"` +// ElasticPoolActivity represents the activity on an elastic pool. +type ElasticPoolActivity struct { + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ElasticPoolActivityProperties - The properties representing the resource. + *ElasticPoolActivityProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -4571,17 +1285,20 @@ type RestorePoint struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for RestorePoint. -func (rp RestorePoint) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ElasticPoolActivity. +func (epa ElasticPoolActivity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if rp.RestorePointProperties != nil { - objectMap["properties"] = rp.RestorePointProperties + if epa.Location != nil { + objectMap["location"] = epa.Location + } + if epa.ElasticPoolActivityProperties != nil { + objectMap["properties"] = epa.ElasticPoolActivityProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for RestorePoint struct. -func (rp *RestorePoint) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ElasticPoolActivity struct. +func (epa *ElasticPoolActivity) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4589,14 +1306,23 @@ func (rp *RestorePoint) UnmarshalJSON(body []byte) error { } 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 + } + epa.Location = &location + } case "properties": if v != nil { - var restorePointProperties RestorePointProperties - err = json.Unmarshal(*v, &restorePointProperties) + var elasticPoolActivityProperties ElasticPoolActivityProperties + err = json.Unmarshal(*v, &elasticPoolActivityProperties) if err != nil { return err } - rp.RestorePointProperties = &restorePointProperties + epa.ElasticPoolActivityProperties = &elasticPoolActivityProperties } case "id": if v != nil { @@ -4605,7 +1331,7 @@ func (rp *RestorePoint) UnmarshalJSON(body []byte) error { if err != nil { return err } - rp.ID = &ID + epa.ID = &ID } case "name": if v != nil { @@ -4614,7 +1340,7 @@ func (rp *RestorePoint) UnmarshalJSON(body []byte) error { if err != nil { return err } - rp.Name = &name + epa.Name = &name } case "type": if v != nil { @@ -4623,7 +1349,7 @@ func (rp *RestorePoint) UnmarshalJSON(body []byte) error { if err != nil { return err } - rp.Type = &typeVar + epa.Type = &typeVar } } } @@ -4631,34 +1357,63 @@ func (rp *RestorePoint) UnmarshalJSON(body []byte) error { return nil } -// RestorePointListResult the response to a list database restore points request. -type RestorePointListResult struct { +// ElasticPoolActivityListResult represents the response to a list elastic pool activity request. +type ElasticPoolActivityListResult struct { autorest.Response `json:"-"` - // Value - The list of database restore points. - Value *[]RestorePoint `json:"value,omitempty"` + // Value - The list of elastic pool activities. + Value *[]ElasticPoolActivity `json:"value,omitempty"` } -// RestorePointProperties represents the properties of a database restore point. -type RestorePointProperties struct { - // RestorePointType - READ-ONLY; The restore point type of the database restore point. Possible values include: 'DISCRETE', 'CONTINUOUS' - RestorePointType RestorePointType `json:"restorePointType,omitempty"` - // RestorePointCreationDate - READ-ONLY; Restore point creation time (ISO8601 format). Populated when restorePointType = CONTINUOUS. Null otherwise. - RestorePointCreationDate *date.Time `json:"restorePointCreationDate,omitempty"` - // EarliestRestoreDate - READ-ONLY; Earliest restore time (ISO8601 format). Populated when restorePointType = DISCRETE. Null otherwise. - EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` +// ElasticPoolActivityProperties represents the properties of an elastic pool. +type ElasticPoolActivityProperties struct { + // EndTime - READ-ONLY; The time the operation finished (ISO8601 format). + EndTime *date.Time `json:"endTime,omitempty"` + // ErrorCode - READ-ONLY; The error code if available. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message if available. + ErrorMessage *string `json:"errorMessage,omitempty"` + // ErrorSeverity - READ-ONLY; The error severity if available. + ErrorSeverity *int32 `json:"errorSeverity,omitempty"` + // Operation - READ-ONLY; The operation name. + Operation *string `json:"operation,omitempty"` + // OperationID - READ-ONLY; The unique operation ID. + OperationID *uuid.UUID `json:"operationId,omitempty"` + // PercentComplete - READ-ONLY; The percentage complete if available. + PercentComplete *int32 `json:"percentComplete,omitempty"` + // RequestedDatabaseDtuMax - READ-ONLY; The requested max DTU per database if available. + RequestedDatabaseDtuMax *int32 `json:"requestedDatabaseDtuMax,omitempty"` + // RequestedDatabaseDtuMin - READ-ONLY; The requested min DTU per database if available. + RequestedDatabaseDtuMin *int32 `json:"requestedDatabaseDtuMin,omitempty"` + // RequestedDtu - READ-ONLY; The requested DTU for the pool if available. + RequestedDtu *int32 `json:"requestedDtu,omitempty"` + // RequestedElasticPoolName - READ-ONLY; The requested name for the elastic pool if available. + RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"` + // RequestedStorageLimitInGB - READ-ONLY; The requested storage limit for the pool in GB if available. + RequestedStorageLimitInGB *int64 `json:"requestedStorageLimitInGB,omitempty"` + // ElasticPoolName - READ-ONLY; The name of the elastic pool. + ElasticPoolName *string `json:"elasticPoolName,omitempty"` + // ServerName - READ-ONLY; The name of the server the elastic pool is in. + ServerName *string `json:"serverName,omitempty"` + // StartTime - READ-ONLY; The time the operation started (ISO8601 format). + StartTime *date.Time `json:"startTime,omitempty"` + // State - READ-ONLY; The current state of the operation. + State *string `json:"state,omitempty"` + // RequestedStorageLimitInMB - READ-ONLY; The requested storage limit in MB. + RequestedStorageLimitInMB *int32 `json:"requestedStorageLimitInMB,omitempty"` + // RequestedDatabaseDtuGuarantee - READ-ONLY; The requested per database DTU guarantee. + RequestedDatabaseDtuGuarantee *int32 `json:"requestedDatabaseDtuGuarantee,omitempty"` + // RequestedDatabaseDtuCap - READ-ONLY; The requested per database DTU cap. + RequestedDatabaseDtuCap *int32 `json:"requestedDatabaseDtuCap,omitempty"` + // RequestedDtuGuarantee - READ-ONLY; The requested DTU guarantee. + RequestedDtuGuarantee *int32 `json:"requestedDtuGuarantee,omitempty"` } -// Server represents a server. -type Server struct { - autorest.Response `json:"-"` - // Kind - READ-ONLY; Kind of sql server. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // ServerProperties - Represents the properties of the resource. - *ServerProperties `json:"properties,omitempty"` - // Location - Resource location. +// ElasticPoolDatabaseActivity represents the activity on an elastic pool. +type ElasticPoolDatabaseActivity struct { + // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` + // ElasticPoolDatabaseActivityProperties - The properties representing the resource. + *ElasticPoolDatabaseActivityProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -4667,23 +1422,20 @@ type Server struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for Server. -func (s Server) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ElasticPoolDatabaseActivity. +func (epda ElasticPoolDatabaseActivity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if s.ServerProperties != nil { - objectMap["properties"] = s.ServerProperties - } - if s.Location != nil { - objectMap["location"] = s.Location + if epda.Location != nil { + objectMap["location"] = epda.Location } - if s.Tags != nil { - objectMap["tags"] = s.Tags + if epda.ElasticPoolDatabaseActivityProperties != nil { + objectMap["properties"] = epda.ElasticPoolDatabaseActivityProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for Server struct. -func (s *Server) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ElasticPoolDatabaseActivity struct. +func (epda *ElasticPoolDatabaseActivity) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4691,24 +1443,6 @@ func (s *Server) UnmarshalJSON(body []byte) error { } 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 - } - s.Kind = &kind - } - case "properties": - if v != nil { - var serverProperties ServerProperties - err = json.Unmarshal(*v, &serverProperties) - if err != nil { - return err - } - s.ServerProperties = &serverProperties - } case "location": if v != nil { var location string @@ -4716,16 +1450,16 @@ func (s *Server) UnmarshalJSON(body []byte) error { if err != nil { return err } - s.Location = &location + epda.Location = &location } - case "tags": + case "properties": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + var elasticPoolDatabaseActivityProperties ElasticPoolDatabaseActivityProperties + err = json.Unmarshal(*v, &elasticPoolDatabaseActivityProperties) if err != nil { return err } - s.Tags = tags + epda.ElasticPoolDatabaseActivityProperties = &elasticPoolDatabaseActivityProperties } case "id": if v != nil { @@ -4734,7 +1468,7 @@ func (s *Server) UnmarshalJSON(body []byte) error { if err != nil { return err } - s.ID = &ID + epda.ID = &ID } case "name": if v != nil { @@ -4743,7 +1477,7 @@ func (s *Server) UnmarshalJSON(body []byte) error { if err != nil { return err } - s.Name = &name + epda.Name = &name } case "type": if v != nil { @@ -4752,7 +1486,7 @@ func (s *Server) UnmarshalJSON(body []byte) error { if err != nil { return err } - s.Type = &typeVar + epda.Type = &typeVar } } } @@ -4760,30 +1494,139 @@ func (s *Server) UnmarshalJSON(body []byte) error { return nil } -// ServerAdministratorListResult the response to a list Active Directory Administrators request. -type ServerAdministratorListResult struct { +// ElasticPoolDatabaseActivityListResult represents the response to a list elastic pool database activity +// request. +type ElasticPoolDatabaseActivityListResult struct { autorest.Response `json:"-"` - // Value - The list of server Active Directory Administrators for the server. - Value *[]ServerAzureADAdministrator `json:"value,omitempty"` + // Value - The list of elastic pool database activities. + Value *[]ElasticPoolDatabaseActivity `json:"value,omitempty"` } -// ServerAdministratorProperties the properties of an server Administrator. -type ServerAdministratorProperties struct { - // AdministratorType - The type of administrator. - AdministratorType *string `json:"administratorType,omitempty"` - // Login - The server administrator login value. - Login *string `json:"login,omitempty"` - // Sid - The server administrator Sid (Secure ID). - Sid *uuid.UUID `json:"sid,omitempty"` - // TenantID - The server Active Directory Administrator tenant id. - TenantID *uuid.UUID `json:"tenantId,omitempty"` +// ElasticPoolDatabaseActivityProperties represents the properties of an elastic pool database activity. +type ElasticPoolDatabaseActivityProperties struct { + // DatabaseName - READ-ONLY; The database name. + DatabaseName *string `json:"databaseName,omitempty"` + // EndTime - READ-ONLY; The time the operation finished (ISO8601 format). + EndTime *date.Time `json:"endTime,omitempty"` + // ErrorCode - READ-ONLY; The error code if available. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; The error message if available. + ErrorMessage *string `json:"errorMessage,omitempty"` + // ErrorSeverity - READ-ONLY; The error severity if available. + ErrorSeverity *int32 `json:"errorSeverity,omitempty"` + // Operation - READ-ONLY; The operation name. + Operation *string `json:"operation,omitempty"` + // OperationID - READ-ONLY; The unique operation ID. + OperationID *uuid.UUID `json:"operationId,omitempty"` + // PercentComplete - READ-ONLY; The percentage complete if available. + PercentComplete *int32 `json:"percentComplete,omitempty"` + // RequestedElasticPoolName - READ-ONLY; The name for the elastic pool the database is moving into if available. + RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"` + // CurrentElasticPoolName - READ-ONLY; The name of the current elastic pool the database is in if available. + CurrentElasticPoolName *string `json:"currentElasticPoolName,omitempty"` + // CurrentServiceObjective - READ-ONLY; The name of the current service objective if available. + CurrentServiceObjective *string `json:"currentServiceObjective,omitempty"` + // RequestedServiceObjective - READ-ONLY; The name of the requested service objective if available. + RequestedServiceObjective *string `json:"requestedServiceObjective,omitempty"` + // ServerName - READ-ONLY; The name of the server the elastic pool is in. + ServerName *string `json:"serverName,omitempty"` + // StartTime - READ-ONLY; The time the operation started (ISO8601 format). + StartTime *date.Time `json:"startTime,omitempty"` + // State - READ-ONLY; The current state of the operation. + State *string `json:"state,omitempty"` } -// ServerAzureADAdministrator an server Active Directory Administrator. -type ServerAzureADAdministrator struct { +// ElasticPoolListResult represents the response to a list elastic pool request. +type ElasticPoolListResult struct { autorest.Response `json:"-"` - // ServerAdministratorProperties - The properties of the resource. - *ServerAdministratorProperties `json:"properties,omitempty"` + // Value - The list of elastic pools hosted in the server. + Value *[]ElasticPool `json:"value,omitempty"` +} + +// ElasticPoolProperties represents the properties of an elastic pool. +type ElasticPoolProperties struct { + // CreationDate - READ-ONLY; The creation date of the elastic pool (ISO8601 format). + CreationDate *date.Time `json:"creationDate,omitempty"` + // State - READ-ONLY; The state of the elastic pool. Possible values include: 'Creating', 'Ready', 'Disabled' + State ElasticPoolState `json:"state,omitempty"` + // Edition - The edition of the elastic pool. Possible values include: 'ElasticPoolEditionBasic', 'ElasticPoolEditionStandard', 'ElasticPoolEditionPremium', 'ElasticPoolEditionGeneralPurpose', 'ElasticPoolEditionBusinessCritical' + Edition ElasticPoolEdition `json:"edition,omitempty"` + // Dtu - The total shared DTU for the database elastic pool. + Dtu *int32 `json:"dtu,omitempty"` + // DatabaseDtuMax - The maximum DTU any one database can consume. + DatabaseDtuMax *int32 `json:"databaseDtuMax,omitempty"` + // DatabaseDtuMin - The minimum DTU all databases are guaranteed. + DatabaseDtuMin *int32 `json:"databaseDtuMin,omitempty"` + // StorageMB - Gets storage limit for the database elastic pool in MB. + StorageMB *int32 `json:"storageMB,omitempty"` + // ZoneRedundant - Whether or not this database elastic pool is zone redundant, which means the replicas of this database will be spread across multiple availability zones. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +// ElasticPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ElasticPoolsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ElasticPoolsCreateOrUpdateFuture) Result(client ElasticPoolsClient) (ep ElasticPool, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsCreateOrUpdateFuture") + 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, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", ep.Response.Response, "Failure responding to request") + } + } + return +} + +// ElasticPoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ElasticPoolsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ElasticPoolsUpdateFuture) Result(client ElasticPoolsClient) (ep ElasticPool, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsUpdateFuture") + 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.UpdateResponder(ep.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", ep.Response.Response, "Failure responding to request") + } + } + return +} + +// ElasticPoolUpdate represents an elastic pool update. +type ElasticPoolUpdate struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ElasticPoolProperties - The properties representing the resource. + *ElasticPoolProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -4792,17 +1635,20 @@ type ServerAzureADAdministrator struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ServerAzureADAdministrator. -func (saaa ServerAzureADAdministrator) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ElasticPoolUpdate. +func (epu ElasticPoolUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if saaa.ServerAdministratorProperties != nil { - objectMap["properties"] = saaa.ServerAdministratorProperties + if epu.Tags != nil { + objectMap["tags"] = epu.Tags + } + if epu.ElasticPoolProperties != nil { + objectMap["properties"] = epu.ElasticPoolProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ServerAzureADAdministrator struct. -func (saaa *ServerAzureADAdministrator) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ElasticPoolUpdate struct. +func (epu *ElasticPoolUpdate) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4810,14 +1656,23 @@ func (saaa *ServerAzureADAdministrator) UnmarshalJSON(body []byte) error { } 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 + } + epu.Tags = tags + } case "properties": if v != nil { - var serverAdministratorProperties ServerAdministratorProperties - err = json.Unmarshal(*v, &serverAdministratorProperties) + var elasticPoolProperties ElasticPoolProperties + err = json.Unmarshal(*v, &elasticPoolProperties) if err != nil { return err } - saaa.ServerAdministratorProperties = &serverAdministratorProperties + epu.ElasticPoolProperties = &elasticPoolProperties } case "id": if v != nil { @@ -4826,7 +1681,7 @@ func (saaa *ServerAzureADAdministrator) UnmarshalJSON(body []byte) error { if err != nil { return err } - saaa.ID = &ID + epu.ID = &ID } case "name": if v != nil { @@ -4835,7 +1690,7 @@ func (saaa *ServerAzureADAdministrator) UnmarshalJSON(body []byte) error { if err != nil { return err } - saaa.Name = &name + epu.Name = &name } case "type": if v != nil { @@ -4844,7 +1699,7 @@ func (saaa *ServerAzureADAdministrator) UnmarshalJSON(body []byte) error { if err != nil { return err } - saaa.Type = &typeVar + epu.Type = &typeVar } } } @@ -4852,73 +1707,31 @@ func (saaa *ServerAzureADAdministrator) UnmarshalJSON(body []byte) error { return nil } -// ServerAzureADAdministratorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ServerAzureADAdministratorsCreateOrUpdateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServerAzureADAdministratorsCreateOrUpdateFuture) Result(client ServerAzureADAdministratorsClient) (saaa ServerAzureADAdministrator, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADAdministratorsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if saaa.Response.Response, err = future.GetResult(sender); err == nil && saaa.Response.Response.StatusCode != http.StatusNoContent { - saaa, err = client.CreateOrUpdateResponder(saaa.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsCreateOrUpdateFuture", "Result", saaa.Response.Response, "Failure responding to request") - } - } - return -} - -// ServerAzureADAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ServerAzureADAdministratorsDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServerAzureADAdministratorsDeleteFuture) Result(client ServerAzureADAdministratorsClient) (saaa ServerAzureADAdministrator, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADAdministratorsDeleteFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if saaa.Response.Response, err = future.GetResult(sender); err == nil && saaa.Response.Response.StatusCode != http.StatusNoContent { - saaa, err = client.DeleteResponder(saaa.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsDeleteFuture", "Result", saaa.Response.Response, "Failure responding to request") - } - } - return +// ExportRequest export database parameters. +type ExportRequest struct { + // StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"` + // StorageKey - The storage key to use. If storage key type is SharedAccessKey, it must be preceded with a "?." + StorageKey *string `json:"storageKey,omitempty"` + // StorageURI - The storage uri to use. + StorageURI *string `json:"storageUri,omitempty"` + // AdministratorLogin - The name of the SQL administrator. + AdministratorLogin *string `json:"administratorLogin,omitempty"` + // AdministratorLoginPassword - The password of the SQL administrator. + AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` + // AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` } -// ServerCommunicationLink server communication link. -type ServerCommunicationLink struct { +// FirewallRule represents a server firewall rule. +type FirewallRule struct { autorest.Response `json:"-"` - // ServerCommunicationLinkProperties - The properties of resource. - *ServerCommunicationLinkProperties `json:"properties,omitempty"` - // Location - READ-ONLY; Communication link location. - Location *string `json:"location,omitempty"` - // Kind - READ-ONLY; Communication link kind. This property is used for Azure Portal metadata. + // Kind - READ-ONLY; Kind of server that contains this firewall rule. Kind *string `json:"kind,omitempty"` + // Location - READ-ONLY; Location of the server that contains this firewall rule. + Location *string `json:"location,omitempty"` + // FirewallRuleProperties - The properties representing the resource. + *FirewallRuleProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -4927,17 +1740,17 @@ type ServerCommunicationLink struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ServerCommunicationLink. -func (scl ServerCommunicationLink) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for FirewallRule. +func (fr FirewallRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if scl.ServerCommunicationLinkProperties != nil { - objectMap["properties"] = scl.ServerCommunicationLinkProperties + if fr.FirewallRuleProperties != nil { + objectMap["properties"] = fr.FirewallRuleProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ServerCommunicationLink struct. -func (scl *ServerCommunicationLink) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for FirewallRule struct. +func (fr *FirewallRule) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4945,14 +1758,14 @@ func (scl *ServerCommunicationLink) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": + case "kind": if v != nil { - var serverCommunicationLinkProperties ServerCommunicationLinkProperties - err = json.Unmarshal(*v, &serverCommunicationLinkProperties) + var kind string + err = json.Unmarshal(*v, &kind) if err != nil { return err } - scl.ServerCommunicationLinkProperties = &serverCommunicationLinkProperties + fr.Kind = &kind } case "location": if v != nil { @@ -4961,16 +1774,16 @@ func (scl *ServerCommunicationLink) UnmarshalJSON(body []byte) error { if err != nil { return err } - scl.Location = &location + fr.Location = &location } - case "kind": + case "properties": if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) + var firewallRuleProperties FirewallRuleProperties + err = json.Unmarshal(*v, &firewallRuleProperties) if err != nil { return err } - scl.Kind = &kind + fr.FirewallRuleProperties = &firewallRuleProperties } case "id": if v != nil { @@ -4979,7 +1792,7 @@ func (scl *ServerCommunicationLink) UnmarshalJSON(body []byte) error { if err != nil { return err } - scl.ID = &ID + fr.ID = &ID } case "name": if v != nil { @@ -4988,7 +1801,7 @@ func (scl *ServerCommunicationLink) UnmarshalJSON(body []byte) error { if err != nil { return err } - scl.Name = &name + fr.Name = &name } case "type": if v != nil { @@ -4997,7 +1810,7 @@ func (scl *ServerCommunicationLink) UnmarshalJSON(body []byte) error { if err != nil { return err } - scl.Type = &typeVar + fr.Type = &typeVar } } } @@ -5005,59 +1818,26 @@ func (scl *ServerCommunicationLink) UnmarshalJSON(body []byte) error { return nil } -// ServerCommunicationLinkListResult a list of server communication links. -type ServerCommunicationLinkListResult struct { +// FirewallRuleListResult represents the response to a List Firewall Rules request. +type FirewallRuleListResult struct { autorest.Response `json:"-"` - // Value - The list of server communication links. - Value *[]ServerCommunicationLink `json:"value,omitempty"` -} - -// ServerCommunicationLinkProperties the properties of a server communication link. -type ServerCommunicationLinkProperties struct { - // State - READ-ONLY; The state. - State *string `json:"state,omitempty"` - // PartnerServer - The name of the partner server. - PartnerServer *string `json:"partnerServer,omitempty"` -} - -// ServerCommunicationLinksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type ServerCommunicationLinksCreateOrUpdateFuture struct { - azure.Future + // Value - The list of server firewall rules. + Value *[]FirewallRule `json:"value,omitempty"` } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServerCommunicationLinksCreateOrUpdateFuture) Result(client ServerCommunicationLinksClient) (scl ServerCommunicationLink, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("sql.ServerCommunicationLinksCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if scl.Response.Response, err = future.GetResult(sender); err == nil && scl.Response.Response.StatusCode != http.StatusNoContent { - scl, err = client.CreateOrUpdateResponder(scl.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksCreateOrUpdateFuture", "Result", scl.Response.Response, "Failure responding to request") - } - } - return +// FirewallRuleProperties represents the properties of a server firewall rule. +type FirewallRuleProperties struct { + // StartIPAddress - The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP addresses. + StartIPAddress *string `json:"startIpAddress,omitempty"` + // EndIPAddress - The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. Use value '0.0.0.0' to represent all Azure-internal IP addresses. + EndIPAddress *string `json:"endIpAddress,omitempty"` } -// ServerConnectionPolicy a server secure connection policy. -type ServerConnectionPolicy struct { +// ImportExportResponse response for Import/Export Get operation. +type ImportExportResponse struct { autorest.Response `json:"-"` - // Kind - READ-ONLY; Metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // Location - READ-ONLY; Resource location. - Location *string `json:"location,omitempty"` - // ServerConnectionPolicyProperties - The properties of the server secure connection policy. - *ServerConnectionPolicyProperties `json:"properties,omitempty"` + // ImportExportResponseProperties - The import/export operation properties. + *ImportExportResponseProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -5066,17 +1846,17 @@ type ServerConnectionPolicy struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ServerConnectionPolicy. -func (scp ServerConnectionPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ImportExportResponse. +func (ier ImportExportResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if scp.ServerConnectionPolicyProperties != nil { - objectMap["properties"] = scp.ServerConnectionPolicyProperties + if ier.ImportExportResponseProperties != nil { + objectMap["properties"] = ier.ImportExportResponseProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ServerConnectionPolicy struct. -func (scp *ServerConnectionPolicy) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ImportExportResponse struct. +func (ier *ImportExportResponse) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -5084,32 +1864,14 @@ func (scp *ServerConnectionPolicy) UnmarshalJSON(body []byte) error { } 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 - } - scp.Kind = &kind - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - scp.Location = &location - } case "properties": if v != nil { - var serverConnectionPolicyProperties ServerConnectionPolicyProperties - err = json.Unmarshal(*v, &serverConnectionPolicyProperties) + var importExportResponseProperties ImportExportResponseProperties + err = json.Unmarshal(*v, &importExportResponseProperties) if err != nil { return err } - scp.ServerConnectionPolicyProperties = &serverConnectionPolicyProperties + ier.ImportExportResponseProperties = &importExportResponseProperties } case "id": if v != nil { @@ -5118,7 +1880,7 @@ func (scp *ServerConnectionPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - scp.ID = &ID + ier.ID = &ID } case "name": if v != nil { @@ -5127,7 +1889,7 @@ func (scp *ServerConnectionPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - scp.Name = &name + ier.Name = &name } case "type": if v != nil { @@ -5136,7 +1898,7 @@ func (scp *ServerConnectionPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - scp.Type = &typeVar + ier.Type = &typeVar } } } @@ -5144,65 +1906,73 @@ func (scp *ServerConnectionPolicy) UnmarshalJSON(body []byte) error { return nil } -// ServerConnectionPolicyProperties the properties of a server secure connection policy. -type ServerConnectionPolicyProperties struct { - // ConnectionType - The server connection type. Possible values include: 'ServerConnectionTypeDefault', 'ServerConnectionTypeProxy', 'ServerConnectionTypeRedirect' - ConnectionType ServerConnectionType `json:"connectionType,omitempty"` -} - -// ServerListResult represents the response to a get server request. -type ServerListResult struct { - autorest.Response `json:"-"` - // Value - The list of servers. - Value *[]Server `json:"value,omitempty"` +// ImportExportResponseProperties response for Import/Export Status operation. +type ImportExportResponseProperties struct { + // RequestType - READ-ONLY; The request type of the operation. + RequestType *string `json:"requestType,omitempty"` + // RequestID - READ-ONLY; The request type of the operation. + RequestID *uuid.UUID `json:"requestId,omitempty"` + // ServerName - READ-ONLY; The name of the server. + ServerName *string `json:"serverName,omitempty"` + // DatabaseName - READ-ONLY; The name of the database. + DatabaseName *string `json:"databaseName,omitempty"` + // Status - READ-ONLY; The status message returned from the server. + Status *string `json:"status,omitempty"` + // LastModifiedTime - READ-ONLY; The operation status last modified time. + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + // QueuedTime - READ-ONLY; The operation queued time. + QueuedTime *string `json:"queuedTime,omitempty"` + // BlobURI - READ-ONLY; The blob uri. + BlobURI *string `json:"blobUri,omitempty"` + // ErrorMessage - READ-ONLY; The error message returned from the server. + ErrorMessage *string `json:"errorMessage,omitempty"` } -// ServerProperties represents the properties of a server. -type ServerProperties struct { - // FullyQualifiedDomainName - READ-ONLY; The fully qualified domain name of the server. - FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"` - // Version - The version of the server. Possible values include: 'TwoFullStopZero', 'OneTwoFullStopZero' - Version ServerVersion `json:"version,omitempty"` - // AdministratorLogin - Administrator username for the server. Can only be specified when the server is being created (and is required for creation). +// ImportExtensionProperties represents the properties for an import operation +type ImportExtensionProperties struct { + // OperationMode - The type of import operation being performed. This is always Import. + OperationMode *string `json:"operationMode,omitempty"` + // StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"` + // StorageKey - The storage key to use. If storage key type is SharedAccessKey, it must be preceded with a "?." + StorageKey *string `json:"storageKey,omitempty"` + // StorageURI - The storage uri to use. + StorageURI *string `json:"storageUri,omitempty"` + // AdministratorLogin - The name of the SQL administrator. AdministratorLogin *string `json:"administratorLogin,omitempty"` - // AdministratorLoginPassword - The administrator login password (required for server creation). + // AdministratorLoginPassword - The password of the SQL administrator. AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` - // ExternalAdministratorSid - READ-ONLY; The ID of the Active Azure Directory object with admin permissions on this server. Legacy parameter, always null. To check for Active Directory admin, query .../servers/{serverName}/administrators. - ExternalAdministratorSid *uuid.UUID `json:"externalAdministratorSid,omitempty"` - // ExternalAdministratorLogin - READ-ONLY; The display name of the Azure Active Directory object with admin permissions on this server. Legacy parameter, always null. To check for Active Directory admin, query .../servers/{serverName}/administrators - ExternalAdministratorLogin *string `json:"externalAdministratorLogin,omitempty"` - // State - READ-ONLY; The state of the server. Possible values include: 'ServerStateReady', 'ServerStateDisabled' - State ServerState `json:"state,omitempty"` + // AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` } -// ServerTableAuditingPolicy a server table auditing policy. -type ServerTableAuditingPolicy struct { - autorest.Response `json:"-"` - // Kind - READ-ONLY; Resource kind. - Kind *string `json:"kind,omitempty"` - // Location - READ-ONLY; Resource location. - Location *string `json:"location,omitempty"` - // ServerTableAuditingPolicyProperties - Resource properties. - *ServerTableAuditingPolicyProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. +// ImportExtensionRequest import database parameters. +type ImportExtensionRequest struct { + // Name - The name of the extension. Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - The type of the extension. Type *string `json:"type,omitempty"` + // ImportExtensionProperties - Represents the properties of the resource. + *ImportExtensionProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for ServerTableAuditingPolicy. -func (stap ServerTableAuditingPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ImportExtensionRequest. +func (ier ImportExtensionRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if stap.ServerTableAuditingPolicyProperties != nil { - objectMap["properties"] = stap.ServerTableAuditingPolicyProperties + if ier.Name != nil { + objectMap["name"] = ier.Name + } + if ier.Type != nil { + objectMap["type"] = ier.Type + } + if ier.ImportExtensionProperties != nil { + objectMap["properties"] = ier.ImportExtensionProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ServerTableAuditingPolicy struct. -func (stap *ServerTableAuditingPolicy) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ImportExtensionRequest struct. +func (ier *ImportExtensionRequest) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -5210,42 +1980,6 @@ func (stap *ServerTableAuditingPolicy) UnmarshalJSON(body []byte) error { } 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 - } - stap.Kind = &kind - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - stap.Location = &location - } - case "properties": - if v != nil { - var serverTableAuditingPolicyProperties ServerTableAuditingPolicyProperties - err = json.Unmarshal(*v, &serverTableAuditingPolicyProperties) - if err != nil { - return err - } - stap.ServerTableAuditingPolicyProperties = &serverTableAuditingPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - stap.ID = &ID - } case "name": if v != nil { var name string @@ -5253,7 +1987,7 @@ func (stap *ServerTableAuditingPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - stap.Name = &name + ier.Name = &name } case "type": if v != nil { @@ -5262,7 +1996,16 @@ func (stap *ServerTableAuditingPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - stap.Type = &typeVar + ier.Type = &typeVar + } + case "properties": + if v != nil { + var importExtensionProperties ImportExtensionProperties + err = json.Unmarshal(*v, &importExtensionProperties) + if err != nil { + return err + } + ier.ImportExtensionProperties = &importExtensionProperties } } } @@ -5270,46 +2013,68 @@ func (stap *ServerTableAuditingPolicy) UnmarshalJSON(body []byte) error { return nil } -// ServerTableAuditingPolicyListResult represents the response to a list server table auditing policies -// request. -type ServerTableAuditingPolicyListResult struct { - autorest.Response `json:"-"` - // Value - The list of server table auditing policies. - Value *[]ServerTableAuditingPolicy `json:"value,omitempty"` +// ImportRequest import database parameters. +type ImportRequest struct { + // DatabaseName - The name of the database to import. + DatabaseName *string `json:"databaseName,omitempty"` + // Edition - The edition for the database being created. + // + // The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands: + // + // ```azurecli + // az sql db list-editions -l -o table + // ```` + // + // ```powershell + // Get-AzSqlServerServiceObjective -Location + // ```` + // . Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2', 'GeneralPurpose', 'BusinessCritical', 'Hyperscale' + Edition DatabaseEdition `json:"edition,omitempty"` + // ServiceObjectiveName - The name of the service objective to assign to the database. Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool' + ServiceObjectiveName ServiceObjectiveName `json:"serviceObjectiveName,omitempty"` + // MaxSizeBytes - The maximum size for the newly imported database. + MaxSizeBytes *string `json:"maxSizeBytes,omitempty"` + // StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"` + // StorageKey - The storage key to use. If storage key type is SharedAccessKey, it must be preceded with a "?." + StorageKey *string `json:"storageKey,omitempty"` + // StorageURI - The storage uri to use. + StorageURI *string `json:"storageUri,omitempty"` + // AdministratorLogin - The name of the SQL administrator. + AdministratorLogin *string `json:"administratorLogin,omitempty"` + // AdministratorLoginPassword - The password of the SQL administrator. + AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` + // AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` +} + +// OperationImpact the impact of an operation, both in absolute and relative terms. +type OperationImpact struct { + // Name - READ-ONLY; The name of the impact dimension. + Name *string `json:"name,omitempty"` + // Unit - READ-ONLY; The unit in which estimated impact to dimension is measured. + Unit *string `json:"unit,omitempty"` + // ChangeValueAbsolute - READ-ONLY; The absolute impact to dimension. + ChangeValueAbsolute *float64 `json:"changeValueAbsolute,omitempty"` + // ChangeValueRelative - READ-ONLY; The relative impact to dimension (null if not applicable) + ChangeValueRelative *float64 `json:"changeValueRelative,omitempty"` } -// ServerTableAuditingPolicyProperties properties of a server table auditing policy. -type ServerTableAuditingPolicyProperties struct { - // AuditingState - The state of the policy. - AuditingState *string `json:"auditingState,omitempty"` - // AuditLogsTableName - The audit logs table name. - AuditLogsTableName *string `json:"auditLogsTableName,omitempty"` - // EventTypesToAudit - Comma-separated list of event types to audit. - EventTypesToAudit *string `json:"eventTypesToAudit,omitempty"` - // FullAuditLogsTableName - The full audit logs table name. - FullAuditLogsTableName *string `json:"fullAuditLogsTableName,omitempty"` - // RetentionDays - The number of days to keep in the audit logs. - RetentionDays *string `json:"retentionDays,omitempty"` - // StorageAccountKey - The key of the auditing storage account. - StorageAccountKey *string `json:"storageAccountKey,omitempty"` - // StorageAccountName - The table storage account name - StorageAccountName *string `json:"storageAccountName,omitempty"` - // StorageAccountResourceGroupName - The table storage account resource group name - StorageAccountResourceGroupName *string `json:"storageAccountResourceGroupName,omitempty"` - // StorageAccountSecondaryKey - The secondary key of the auditing storage account. - StorageAccountSecondaryKey *string `json:"storageAccountSecondaryKey,omitempty"` - // StorageAccountSubscriptionID - The table storage subscription Id. - StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"` - // StorageTableEndpoint - The storage table endpoint. - StorageTableEndpoint *string `json:"storageTableEndpoint,omitempty"` +// ProxyResource ARM proxy resource. +type ProxyResource struct { + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` } -// ServerUpdate represents an update to a server. -type ServerUpdate struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ServerProperties - Represents the properties of the resource. - *ServerProperties `json:"properties,omitempty"` +// RecommendedElasticPool represents a recommended elastic pool. +type RecommendedElasticPool struct { + autorest.Response `json:"-"` + // RecommendedElasticPoolProperties - The properties representing the resource. + *RecommendedElasticPoolProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -5318,20 +2083,17 @@ type ServerUpdate struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ServerUpdate. -func (su ServerUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for RecommendedElasticPool. +func (rep RecommendedElasticPool) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if su.Tags != nil { - objectMap["tags"] = su.Tags - } - if su.ServerProperties != nil { - objectMap["properties"] = su.ServerProperties + if rep.RecommendedElasticPoolProperties != nil { + objectMap["properties"] = rep.RecommendedElasticPoolProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ServerUpdate struct. -func (su *ServerUpdate) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for RecommendedElasticPool struct. +func (rep *RecommendedElasticPool) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -5339,23 +2101,14 @@ func (su *ServerUpdate) UnmarshalJSON(body []byte) error { } 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 - } - su.Tags = tags - } case "properties": if v != nil { - var serverProperties ServerProperties - err = json.Unmarshal(*v, &serverProperties) + var recommendedElasticPoolProperties RecommendedElasticPoolProperties + err = json.Unmarshal(*v, &recommendedElasticPoolProperties) if err != nil { return err } - su.ServerProperties = &serverProperties + rep.RecommendedElasticPoolProperties = &recommendedElasticPoolProperties } case "id": if v != nil { @@ -5364,7 +2117,7 @@ func (su *ServerUpdate) UnmarshalJSON(body []byte) error { if err != nil { return err } - su.ID = &ID + rep.ID = &ID } case "name": if v != nil { @@ -5373,7 +2126,7 @@ func (su *ServerUpdate) UnmarshalJSON(body []byte) error { if err != nil { return err } - su.Name = &name + rep.Name = &name } case "type": if v != nil { @@ -5382,7 +2135,7 @@ func (su *ServerUpdate) UnmarshalJSON(body []byte) error { if err != nil { return err } - su.Type = &typeVar + rep.Type = &typeVar } } } @@ -5390,48 +2143,61 @@ func (su *ServerUpdate) UnmarshalJSON(body []byte) error { return nil } -// 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"` +// RecommendedElasticPoolListMetricsResult represents the response to a list recommended elastic pool +// metrics request. +type RecommendedElasticPoolListMetricsResult struct { + autorest.Response `json:"-"` + // Value - The list of recommended elastic pools metrics. + Value *[]RecommendedElasticPoolMetric `json:"value,omitempty"` } -// ServerUsageListResult represents the response to a list server metrics request. -type ServerUsageListResult struct { +// RecommendedElasticPoolListResult represents the response to a list recommended elastic pool request. +type RecommendedElasticPoolListResult struct { autorest.Response `json:"-"` - // Value - The list of server metrics for the server. - Value *[]ServerUsage `json:"value,omitempty"` + // Value - The list of recommended elastic pools hosted in the server. + Value *[]RecommendedElasticPool `json:"value,omitempty"` } -// ServerVersionCapability the server capabilities. -type ServerVersionCapability struct { - // Name - READ-ONLY; The server version name. - Name *string `json:"name,omitempty"` - // Status - READ-ONLY; The status of the server version. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // SupportedEditions - READ-ONLY; The list of supported database editions. - SupportedEditions *[]EditionCapability `json:"supportedEditions,omitempty"` - // SupportedElasticPoolEditions - READ-ONLY; The list of supported elastic pool editions. - SupportedElasticPoolEditions *[]ElasticPoolEditionCapability `json:"supportedElasticPoolEditions,omitempty"` +// RecommendedElasticPoolMetric represents recommended elastic pool metric. +type RecommendedElasticPoolMetric struct { + // DateTime - The time of metric (ISO8601 format). + DateTime *date.Time `json:"dateTime,omitempty"` + // Dtu - Gets or sets the DTUs (Database Transaction Units). See https://azure.microsoft.com/documentation/articles/sql-database-what-is-a-dtu/ + Dtu *float64 `json:"dtu,omitempty"` + // SizeGB - Gets or sets size in gigabytes. + SizeGB *float64 `json:"sizeGB,omitempty"` } -// ServiceObjective represents a database service objective. -type ServiceObjective struct { - autorest.Response `json:"-"` - // ServiceObjectiveProperties - Represents the properties of the resource. - *ServiceObjectiveProperties `json:"properties,omitempty"` +// RecommendedElasticPoolProperties represents the properties of a recommended elastic pool. +type RecommendedElasticPoolProperties struct { + // DatabaseEdition - READ-ONLY; The edition of the recommended elastic pool. The ElasticPoolEdition enumeration contains all the valid editions. Possible values include: 'ElasticPoolEditionBasic', 'ElasticPoolEditionStandard', 'ElasticPoolEditionPremium', 'ElasticPoolEditionGeneralPurpose', 'ElasticPoolEditionBusinessCritical' + DatabaseEdition ElasticPoolEdition `json:"databaseEdition,omitempty"` + // Dtu - The DTU for the recommended elastic pool. + Dtu *float64 `json:"dtu,omitempty"` + // DatabaseDtuMin - The minimum DTU for the database. + DatabaseDtuMin *float64 `json:"databaseDtuMin,omitempty"` + // DatabaseDtuMax - The maximum DTU for the database. + DatabaseDtuMax *float64 `json:"databaseDtuMax,omitempty"` + // StorageMB - Gets storage size in megabytes. + StorageMB *float64 `json:"storageMB,omitempty"` + // ObservationPeriodStart - READ-ONLY; The observation period start (ISO8601 format). + ObservationPeriodStart *date.Time `json:"observationPeriodStart,omitempty"` + // ObservationPeriodEnd - READ-ONLY; The observation period start (ISO8601 format). + ObservationPeriodEnd *date.Time `json:"observationPeriodEnd,omitempty"` + // MaxObservedDtu - READ-ONLY; Gets maximum observed DTU. + MaxObservedDtu *float64 `json:"maxObservedDtu,omitempty"` + // MaxObservedStorageMB - READ-ONLY; Gets maximum observed storage in megabytes. + MaxObservedStorageMB *float64 `json:"maxObservedStorageMB,omitempty"` + // Databases - READ-ONLY; The list of databases in this pool. Expanded property + Databases *[]Database `json:"databases,omitempty"` + // Metrics - READ-ONLY; The list of databases housed in the server. Expanded property + Metrics *[]RecommendedElasticPoolMetric `json:"metrics,omitempty"` +} + +// RecommendedIndex represents a database recommended index. +type RecommendedIndex struct { + // RecommendedIndexProperties - READ-ONLY; The properties representing the resource. + *RecommendedIndexProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -5440,17 +2206,14 @@ type ServiceObjective struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ServiceObjective. -func (so ServiceObjective) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for RecommendedIndex. +func (ri RecommendedIndex) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if so.ServiceObjectiveProperties != nil { - objectMap["properties"] = so.ServiceObjectiveProperties - } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ServiceObjective struct. -func (so *ServiceObjective) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for RecommendedIndex struct. +func (ri *RecommendedIndex) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -5460,12 +2223,12 @@ func (so *ServiceObjective) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var serviceObjectiveProperties ServiceObjectiveProperties - err = json.Unmarshal(*v, &serviceObjectiveProperties) + var recommendedIndexProperties RecommendedIndexProperties + err = json.Unmarshal(*v, &recommendedIndexProperties) if err != nil { return err } - so.ServiceObjectiveProperties = &serviceObjectiveProperties + ri.RecommendedIndexProperties = &recommendedIndexProperties } case "id": if v != nil { @@ -5474,7 +2237,7 @@ func (so *ServiceObjective) UnmarshalJSON(body []byte) error { if err != nil { return err } - so.ID = &ID + ri.ID = &ID } case "name": if v != nil { @@ -5483,7 +2246,7 @@ func (so *ServiceObjective) UnmarshalJSON(body []byte) error { if err != nil { return err } - so.Name = &name + ri.Name = &name } case "type": if v != nil { @@ -5492,7 +2255,7 @@ func (so *ServiceObjective) UnmarshalJSON(body []byte) error { if err != nil { return err } - so.Type = &typeVar + ri.Type = &typeVar } } } @@ -5500,30 +2263,60 @@ func (so *ServiceObjective) UnmarshalJSON(body []byte) error { return nil } -// ServiceObjectiveCapability the service objectives capability. -type ServiceObjectiveCapability struct { - // Name - READ-ONLY; The service objective name. +// RecommendedIndexProperties represents the properties of a database recommended index. +type RecommendedIndexProperties struct { + // Action - READ-ONLY; The proposed index action. You can create a missing index, drop an unused index, or rebuild an existing index to improve its performance. Possible values include: 'Create', 'Drop', 'Rebuild' + Action RecommendedIndexAction `json:"action,omitempty"` + // State - READ-ONLY; The current recommendation state. Possible values include: 'Active', 'Pending', 'Executing', 'Verifying', 'PendingRevert', 'Reverting', 'Reverted', 'Ignored', 'Expired', 'Blocked', 'Success' + State RecommendedIndexState `json:"state,omitempty"` + // Created - READ-ONLY; The UTC datetime showing when this resource was created (ISO8601 format). + Created *date.Time `json:"created,omitempty"` + // LastModified - READ-ONLY; The UTC datetime of when was this resource last changed (ISO8601 format). + LastModified *date.Time `json:"lastModified,omitempty"` + // IndexType - READ-ONLY; The type of index (CLUSTERED, NONCLUSTERED, COLUMNSTORE, CLUSTERED COLUMNSTORE). Possible values include: 'CLUSTERED', 'NONCLUSTERED', 'COLUMNSTORE', 'CLUSTEREDCOLUMNSTORE' + IndexType RecommendedIndexType `json:"indexType,omitempty"` + // Schema - READ-ONLY; The schema where table to build index over resides + Schema *string `json:"schema,omitempty"` + // Table - READ-ONLY; The table on which to build index. + Table *string `json:"table,omitempty"` + // Columns - READ-ONLY; Columns over which to build index + Columns *[]string `json:"columns,omitempty"` + // IncludedColumns - READ-ONLY; The list of column names to be included in the index + IncludedColumns *[]string `json:"includedColumns,omitempty"` + // IndexScript - READ-ONLY; The full build index script + IndexScript *string `json:"indexScript,omitempty"` + // EstimatedImpact - READ-ONLY; The estimated impact of doing recommended index action. + EstimatedImpact *[]OperationImpact `json:"estimatedImpact,omitempty"` + // ReportedImpact - READ-ONLY; The values reported after index action is complete. + ReportedImpact *[]OperationImpact `json:"reportedImpact,omitempty"` +} + +// ReplicationLink represents a database replication link. +type ReplicationLink struct { + autorest.Response `json:"-"` + // Location - READ-ONLY; Location of the server that contains this firewall rule. + Location *string `json:"location,omitempty"` + // ReplicationLinkProperties - The properties representing the resource. + *ReplicationLinkProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` - // Status - READ-ONLY; The status of the service objective. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // PerformanceLevel - READ-ONLY; The performance level of the service objective capability. - *PerformanceLevel `json:"performanceLevel,omitempty"` - // ID - READ-ONLY; The unique ID of the service objective. - ID *uuid.UUID `json:"id,omitempty"` - // SupportedMaxSizes - READ-ONLY; The list of supported maximum database sizes for this service objective. - SupportedMaxSizes *[]MaxSizeCapability `json:"supportedMaxSizes,omitempty"` - // IncludedMaxSize - READ-ONLY; The included (free) max size for this service level objective. - IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ServiceObjectiveCapability. -func (soc ServiceObjectiveCapability) MarshalJSON() ([]byte, error) { +// 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 ServiceObjectiveCapability struct. -func (soc *ServiceObjectiveCapability) UnmarshalJSON(body []byte) error { +// 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 { @@ -5531,59 +2324,50 @@ func (soc *ServiceObjectiveCapability) UnmarshalJSON(body []byte) error { } 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 - } - soc.Name = &name - } - case "status": + case "location": if v != nil { - var status CapabilityStatus - err = json.Unmarshal(*v, &status) + var location string + err = json.Unmarshal(*v, &location) if err != nil { return err } - soc.Status = status + rl.Location = &location } - case "performanceLevel": + case "properties": if v != nil { - var performanceLevel PerformanceLevel - err = json.Unmarshal(*v, &performanceLevel) + var replicationLinkProperties ReplicationLinkProperties + err = json.Unmarshal(*v, &replicationLinkProperties) if err != nil { return err } - soc.PerformanceLevel = &performanceLevel + rl.ReplicationLinkProperties = &replicationLinkProperties } case "id": if v != nil { - var ID uuid.UUID + var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } - soc.ID = &ID + rl.ID = &ID } - case "supportedMaxSizes": + case "name": if v != nil { - var supportedMaxSizes []MaxSizeCapability - err = json.Unmarshal(*v, &supportedMaxSizes) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - soc.SupportedMaxSizes = &supportedMaxSizes + rl.Name = &name } - case "includedMaxSize": + case "type": if v != nil { - var includedMaxSize MaxSizeCapability - err = json.Unmarshal(*v, &includedMaxSize) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - soc.IncludedMaxSize = &includedMaxSize + rl.Type = &typeVar } } } @@ -5591,25 +2375,91 @@ func (soc *ServiceObjectiveCapability) UnmarshalJSON(body []byte) error { return nil } -// ServiceObjectiveListResult represents the response to a get database service objectives request. -type ServiceObjectiveListResult struct { +// ReplicationLinkListResult represents the response to a List database replication link request. +type ReplicationLinkListResult struct { autorest.Response `json:"-"` - // Value - The list of database service objectives. - Value *[]ServiceObjective `json:"value,omitempty"` + // Value - The list of database replication links housed in the database. + Value *[]ReplicationLink `json:"value,omitempty"` +} + +// ReplicationLinkProperties represents the properties of a database 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 server hosting the partner database. + PartnerServer *string `json:"partnerServer,omitempty"` + // PartnerDatabase - READ-ONLY; The name of the partner database. + PartnerDatabase *string `json:"partnerDatabase,omitempty"` + // PartnerLocation - READ-ONLY; The Azure Region of the partner database. + PartnerLocation *string `json:"partnerLocation,omitempty"` + // Role - READ-ONLY; The role of the database 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 database 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: 'PENDING', 'SEEDING', 'CATCHUP', 'SUSPENDED' + ReplicationState ReplicationState `json:"replicationState,omitempty"` } -// ServiceObjectiveProperties represents the properties of a database service objective. -type ServiceObjectiveProperties struct { - // ServiceObjectiveName - READ-ONLY; The name for the service objective. - ServiceObjectiveName *string `json:"serviceObjectiveName,omitempty"` - // IsDefault - READ-ONLY; Gets whether the service level objective is the default service objective. - IsDefault *bool `json:"isDefault,omitempty"` - // IsSystem - READ-ONLY; Gets whether the service level objective is a system service objective. - IsSystem *bool `json:"isSystem,omitempty"` - // Description - READ-ONLY; The description for the service level objective. - Description *string `json:"description,omitempty"` - // Enabled - READ-ONLY; Gets whether the service level objective is enabled. - Enabled *bool `json:"enabled,omitempty"` +// ReplicationLinksFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ReplicationLinksFailoverAllowDataLossFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ReplicationLinksFailoverAllowDataLossFuture) Result(client ReplicationLinksClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverAllowDataLossFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationLinksFailoverFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ReplicationLinksFailoverFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ReplicationLinksFailoverFuture) Result(client ReplicationLinksClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverFuture") + return + } + ar.Response = future.Response() + return +} + +// Resource ARM resource. +type Resource struct { + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` } // ServiceTierAdvisor represents a Service Tier Advisor. @@ -5741,59 +2591,6 @@ type SloUsageMetric struct { InRangeTimeRatio *float64 `json:"inRangeTimeRatio,omitempty"` } -// TableAuditingPolicyProperties properties of a table auditing policy. -type TableAuditingPolicyProperties struct { - // AuditingState - The state of the policy. - AuditingState *string `json:"auditingState,omitempty"` - // AuditLogsTableName - The audit logs table name. - AuditLogsTableName *string `json:"auditLogsTableName,omitempty"` - // EventTypesToAudit - Comma-separated list of event types to audit. - EventTypesToAudit *string `json:"eventTypesToAudit,omitempty"` - // FullAuditLogsTableName - The full audit logs table name. - FullAuditLogsTableName *string `json:"fullAuditLogsTableName,omitempty"` - // RetentionDays - The number of days to keep in the audit logs. - RetentionDays *string `json:"retentionDays,omitempty"` - // StorageAccountKey - The key of the auditing storage account. - StorageAccountKey *string `json:"storageAccountKey,omitempty"` - // StorageAccountName - The table storage account name - StorageAccountName *string `json:"storageAccountName,omitempty"` - // StorageAccountResourceGroupName - The table storage account resource group name - StorageAccountResourceGroupName *string `json:"storageAccountResourceGroupName,omitempty"` - // StorageAccountSecondaryKey - The secondary key of the auditing storage account. - StorageAccountSecondaryKey *string `json:"storageAccountSecondaryKey,omitempty"` - // StorageAccountSubscriptionID - The table storage subscription Id. - StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"` - // StorageTableEndpoint - The storage table endpoint. - StorageTableEndpoint *string `json:"storageTableEndpoint,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: 'Min', 'Max', 'Avg', 'Sum' - 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: 'Any', 'Regular', 'Irregular', 'Aborted', 'Exception' - 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: 'CPU', 'Io', 'Logio', 'Duration', 'ExecutionCount' - ObservedMetric QueryObservedMetricType `json:"observedMetric,omitempty"` - // Queries - READ-ONLY; The list of queries. - Queries *[]QueryStatistic `json:"queries,omitempty"` -} - -// TopQueriesListResult represents the response to a get top queries request. -type TopQueriesListResult struct { - autorest.Response `json:"-"` - // Value - The list of top queries. - Value *[]TopQueries `json:"value,omitempty"` -} - // TrackedResource ARM tracked top level resource. type TrackedResource struct { // Location - Resource location. @@ -6004,14 +2801,6 @@ type TransparentDataEncryptionActivityProperties struct { PercentComplete *float64 `json:"percentComplete,omitempty"` } -// TransparentDataEncryptionListResult represents the response to a list transparent data encryption -// configurations request. -type TransparentDataEncryptionListResult struct { - autorest.Response `json:"-"` - // Value - The list of transparent data encryption configurations. - Value *[]TransparentDataEncryption `json:"value,omitempty"` -} - // 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' diff --git a/services/sql/mgmt/2014-04-01/sql/servers.go b/services/sql/mgmt/2014-04-01/sql/servers.go index 46ff8f9126cb..b3f03509242d 100644 --- a/services/sql/mgmt/2014-04-01/sql/servers.go +++ b/services/sql/mgmt/2014-04-01/sql/servers.go @@ -125,469 +125,3 @@ func (client ServersClient) CheckNameAvailabilityResponder(resp *http.Response) result.Response = autorest.Response{Response: resp} return } - -// CreateOrUpdate creates or updates a new server. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// parameters - the required parameters for creating or updating a server. -func (client ServersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters Server) (result Server, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServersClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ServersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters Server) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Kind = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ServersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ServersClient) CreateOrUpdateResponder(resp *http.Response) (result Server, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a SQL server. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -func (client ServersClient) Delete(ctx context.Context, resourceGroupName string, serverName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.ServersClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ServersClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ServersClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ServersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a server. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -func (client ServersClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result Server, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ServersClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ServersClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ServersClient) GetResponder(resp *http.Response) (result Server, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List returns a list of servers. -func (client ServersClient) List(ctx context.Context) (result ServerListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServersClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ServersClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ServersClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ServersClient) ListResponder(resp *http.Response) (result ServerListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup returns a list of servers in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -func (client ServersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ServerListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServersClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "ListByResourceGroup", resp, "Failure responding to request") - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ServersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ServersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ServersClient) ListByResourceGroupResponder(resp *http.Response) (result ServerListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update updates an existing server. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// parameters - the required parameters for updating a server. -func (client ServersClient) Update(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdate) (result Server, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, serverName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServersClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ServersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client ServersClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ServersClient) UpdateResponder(resp *http.Response) (result Server, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/sql/mgmt/2014-04-01/sql/sqlapi/interfaces.go b/services/sql/mgmt/2014-04-01/sql/sqlapi/interfaces.go index 0e49e81fd8b6..29c023154f3e 100644 --- a/services/sql/mgmt/2014-04-01/sql/sqlapi/interfaces.go +++ b/services/sql/mgmt/2014-04-01/sql/sqlapi/interfaces.go @@ -23,87 +23,13 @@ import ( "github.com/Azure/go-autorest/autorest" ) -// ServerAdvisorsClientAPI contains the set of methods on the ServerAdvisorsClient type. -type ServerAdvisorsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, advisorName string, parameters sql.Advisor) (result sql.Advisor, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, advisorName string) (result sql.Advisor, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.AdvisorListResult, err error) - Update(ctx context.Context, resourceGroupName string, serverName string, advisorName string, parameters sql.Advisor) (result sql.Advisor, err error) -} - -var _ ServerAdvisorsClientAPI = (*sql.ServerAdvisorsClient)(nil) - -// DatabaseAdvisorsClientAPI contains the set of methods on the DatabaseAdvisorsClient type. -type DatabaseAdvisorsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string, parameters sql.Advisor) (result sql.Advisor, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string) (result sql.Advisor, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.AdvisorListResult, err error) -} - -var _ DatabaseAdvisorsClientAPI = (*sql.DatabaseAdvisorsClient)(nil) - -// BackupLongTermRetentionPoliciesClientAPI contains the set of methods on the BackupLongTermRetentionPoliciesClient type. -type BackupLongTermRetentionPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.BackupLongTermRetentionPolicy) (result sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.BackupLongTermRetentionPolicy, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.BackupLongTermRetentionPolicyListResult, err error) -} - -var _ BackupLongTermRetentionPoliciesClientAPI = (*sql.BackupLongTermRetentionPoliciesClient)(nil) - -// BackupLongTermRetentionVaultsClientAPI contains the set of methods on the BackupLongTermRetentionVaultsClient type. -type BackupLongTermRetentionVaultsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters sql.BackupLongTermRetentionVault) (result sql.BackupLongTermRetentionVaultsCreateOrUpdateFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.BackupLongTermRetentionVault, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.BackupLongTermRetentionVaultListResult, err error) -} - -var _ BackupLongTermRetentionVaultsClientAPI = (*sql.BackupLongTermRetentionVaultsClient)(nil) - -// RecoverableDatabasesClientAPI contains the set of methods on the RecoverableDatabasesClient type. -type RecoverableDatabasesClientAPI interface { - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.RecoverableDatabase, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.RecoverableDatabaseListResult, err error) -} - -var _ RecoverableDatabasesClientAPI = (*sql.RecoverableDatabasesClient)(nil) - -// RestorableDroppedDatabasesClientAPI contains the set of methods on the RestorableDroppedDatabasesClient type. -type RestorableDroppedDatabasesClientAPI interface { - Get(ctx context.Context, resourceGroupName string, serverName string, restorableDroppededDatabaseID string) (result sql.RestorableDroppedDatabase, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.RestorableDroppedDatabaseListResult, err error) -} - -var _ RestorableDroppedDatabasesClientAPI = (*sql.RestorableDroppedDatabasesClient)(nil) - -// CapabilitiesClientAPI contains the set of methods on the CapabilitiesClient type. -type CapabilitiesClientAPI interface { - ListByLocation(ctx context.Context, locationID string) (result sql.LocationCapabilities, err error) -} - -var _ CapabilitiesClientAPI = (*sql.CapabilitiesClient)(nil) - // ServersClientAPI contains the set of methods on the ServersClient type. type ServersClientAPI interface { CheckNameAvailability(ctx context.Context, parameters sql.CheckNameAvailabilityRequest) (result sql.CheckNameAvailabilityResponse, err error) - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters sql.Server) (result sql.Server, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.Server, err error) - List(ctx context.Context) (result sql.ServerListResult, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string) (result sql.ServerListResult, err error) - Update(ctx context.Context, resourceGroupName string, serverName string, parameters sql.ServerUpdate) (result sql.Server, err error) } var _ ServersClientAPI = (*sql.ServersClient)(nil) -// ServerConnectionPoliciesClientAPI contains the set of methods on the ServerConnectionPoliciesClient type. -type ServerConnectionPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters sql.ServerConnectionPolicy) (result sql.ServerConnectionPolicy, err error) - Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerConnectionPolicy, err error) -} - -var _ ServerConnectionPoliciesClientAPI = (*sql.ServerConnectionPoliciesClient)(nil) - // DatabasesClientAPI contains the set of methods on the DatabasesClient type. type DatabasesClientAPI interface { CreateImportOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.ImportExtensionRequest) (result sql.DatabasesCreateImportOperationFuture, err error) @@ -117,8 +43,6 @@ type DatabasesClientAPI interface { ListByElasticPool(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.DatabaseListResult, err error) ListByRecommendedElasticPool(ctx context.Context, resourceGroupName string, serverName string, recommendedElasticPoolName string) (result sql.DatabaseListResult, err error) ListByServer(ctx context.Context, resourceGroupName string, serverName string, expand string, filter string) (result sql.DatabaseListResult, err error) - ListMetricDefinitions(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.MetricDefinitionListResult, err error) - ListMetrics(ctx context.Context, resourceGroupName string, serverName string, databaseName string, filter string) (result sql.MetricListResult, err error) Pause(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabasesPauseFuture, err error) Resume(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabasesResumeFuture, err error) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DatabaseUpdate) (result sql.DatabasesUpdateFuture, err error) @@ -126,65 +50,12 @@ type DatabasesClientAPI interface { var _ DatabasesClientAPI = (*sql.DatabasesClient)(nil) -// DatabaseThreatDetectionPoliciesClientAPI contains the set of methods on the DatabaseThreatDetectionPoliciesClient type. -type DatabaseThreatDetectionPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DatabaseSecurityAlertPolicy) (result sql.DatabaseSecurityAlertPolicy, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseSecurityAlertPolicy, err error) -} - -var _ DatabaseThreatDetectionPoliciesClientAPI = (*sql.DatabaseThreatDetectionPoliciesClient)(nil) - -// DataMaskingPoliciesClientAPI contains the set of methods on the DataMaskingPoliciesClient type. -type DataMaskingPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DataMaskingPolicy) (result sql.DataMaskingPolicy, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DataMaskingPolicy, err error) -} - -var _ DataMaskingPoliciesClientAPI = (*sql.DataMaskingPoliciesClient)(nil) - -// DataMaskingRulesClientAPI contains the set of methods on the DataMaskingRulesClient type. -type DataMaskingRulesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingRuleName string, parameters sql.DataMaskingRule) (result sql.DataMaskingRule, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DataMaskingRuleListResult, err error) -} - -var _ DataMaskingRulesClientAPI = (*sql.DataMaskingRulesClient)(nil) - -// TransparentDataEncryptionConfigurationsClientAPI contains the set of methods on the TransparentDataEncryptionConfigurationsClient type. -type TransparentDataEncryptionConfigurationsClientAPI interface { - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.TransparentDataEncryptionListResult, err error) -} - -var _ TransparentDataEncryptionConfigurationsClientAPI = (*sql.TransparentDataEncryptionConfigurationsClient)(nil) - -// ExtensionsClientAPI contains the set of methods on the ExtensionsClient type. -type ExtensionsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result autorest.Response, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.ExtensionListResult, err error) -} - -var _ ExtensionsClientAPI = (*sql.ExtensionsClient)(nil) - -// DisasterRecoveryConfigurationsClientAPI contains the set of methods on the DisasterRecoveryConfigurationsClient type. -type DisasterRecoveryConfigurationsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result sql.DisasterRecoveryConfigurationsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result sql.DisasterRecoveryConfigurationsDeleteFuture, err error) - Failover(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result sql.DisasterRecoveryConfigurationsFailoverFuture, err error) - FailoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result sql.DisasterRecoveryConfigurationsFailoverAllowDataLossFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result sql.DisasterRecoveryConfiguration, err error) - List(ctx context.Context, resourceGroupName string, serverName string) (result sql.DisasterRecoveryConfigurationListResult, err error) -} - -var _ DisasterRecoveryConfigurationsClientAPI = (*sql.DisasterRecoveryConfigurationsClient)(nil) - // ElasticPoolsClientAPI contains the set of methods on the ElasticPoolsClient type. type ElasticPoolsClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters sql.ElasticPool) (result sql.ElasticPoolsCreateOrUpdateFuture, err error) Delete(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result autorest.Response, err error) Get(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.ElasticPool, err error) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ElasticPoolListResult, err error) - ListMetricDefinitions(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.MetricDefinitionListResult, err error) - ListMetrics(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, filter string) (result sql.MetricListResult, err error) Update(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters sql.ElasticPoolUpdate) (result sql.ElasticPoolsUpdateFuture, err error) } @@ -200,43 +71,6 @@ type FirewallRulesClientAPI interface { var _ FirewallRulesClientAPI = (*sql.FirewallRulesClient)(nil) -// GeoBackupPoliciesClientAPI contains the set of methods on the GeoBackupPoliciesClient type. -type GeoBackupPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.GeoBackupPolicy) (result sql.GeoBackupPolicy, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.GeoBackupPolicy, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.GeoBackupPolicyListResult, err error) -} - -var _ GeoBackupPoliciesClientAPI = (*sql.GeoBackupPoliciesClient)(nil) - -// OperationsClientAPI contains the set of methods on the OperationsClient type. -type OperationsClientAPI interface { - List(ctx context.Context) (result sql.OperationListResult, err error) -} - -var _ OperationsClientAPI = (*sql.OperationsClient)(nil) - -// QueriesClientAPI contains the set of methods on the QueriesClient type. -type QueriesClientAPI interface { - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.TopQueriesListResult, err error) -} - -var _ QueriesClientAPI = (*sql.QueriesClient)(nil) - -// QueryStatisticsClientAPI contains the set of methods on the QueryStatisticsClient type. -type QueryStatisticsClientAPI interface { - ListByQuery(ctx context.Context, resourceGroupName string, serverName string, databaseName string, queryID string) (result sql.QueryStatisticListResult, err error) -} - -var _ QueryStatisticsClientAPI = (*sql.QueryStatisticsClient)(nil) - -// QueryTextsClientAPI contains the set of methods on the QueryTextsClient type. -type QueryTextsClientAPI interface { - ListByQuery(ctx context.Context, resourceGroupName string, serverName string, databaseName string, queryID string) (result sql.QueryTextListResult, err error) -} - -var _ QueryTextsClientAPI = (*sql.QueryTextsClient)(nil) - // RecommendedElasticPoolsClientAPI contains the set of methods on the RecommendedElasticPoolsClient type. type RecommendedElasticPoolsClientAPI interface { Get(ctx context.Context, resourceGroupName string, serverName string, recommendedElasticPoolName string) (result sql.RecommendedElasticPool, err error) @@ -257,41 +91,6 @@ type ReplicationLinksClientAPI interface { var _ ReplicationLinksClientAPI = (*sql.ReplicationLinksClient)(nil) -// RestorePointsClientAPI contains the set of methods on the RestorePointsClient type. -type RestorePointsClientAPI interface { - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.RestorePointListResult, err error) -} - -var _ RestorePointsClientAPI = (*sql.RestorePointsClient)(nil) - -// ServerAzureADAdministratorsClientAPI contains the set of methods on the ServerAzureADAdministratorsClient type. -type ServerAzureADAdministratorsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, properties sql.ServerAzureADAdministrator) (result sql.ServerAzureADAdministratorsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerAzureADAdministratorsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerAzureADAdministrator, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerAdministratorListResult, err error) -} - -var _ ServerAzureADAdministratorsClientAPI = (*sql.ServerAzureADAdministratorsClient)(nil) - -// ServerCommunicationLinksClientAPI contains the set of methods on the ServerCommunicationLinksClient type. -type ServerCommunicationLinksClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, parameters sql.ServerCommunicationLink) (result sql.ServerCommunicationLinksCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string) (result sql.ServerCommunicationLink, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerCommunicationLinkListResult, err error) -} - -var _ ServerCommunicationLinksClientAPI = (*sql.ServerCommunicationLinksClient)(nil) - -// ServiceObjectivesClientAPI contains the set of methods on the ServiceObjectivesClient type. -type ServiceObjectivesClientAPI interface { - Get(ctx context.Context, resourceGroupName string, serverName string, serviceObjectiveName string) (result sql.ServiceObjective, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServiceObjectiveListResult, err error) -} - -var _ ServiceObjectivesClientAPI = (*sql.ServiceObjectivesClient)(nil) - // ElasticPoolActivitiesClientAPI contains the set of methods on the ElasticPoolActivitiesClient type. type ElasticPoolActivitiesClientAPI interface { ListByElasticPool(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.ElasticPoolActivityListResult, err error) @@ -329,42 +128,10 @@ type TransparentDataEncryptionActivitiesClientAPI interface { var _ TransparentDataEncryptionActivitiesClientAPI = (*sql.TransparentDataEncryptionActivitiesClient)(nil) -// ServerTableAuditingPoliciesClientAPI contains the set of methods on the ServerTableAuditingPoliciesClient type. -type ServerTableAuditingPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters sql.ServerTableAuditingPolicy) (result sql.ServerTableAuditingPolicy, err error) - Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerTableAuditingPolicy, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerTableAuditingPolicyListResult, err error) -} - -var _ ServerTableAuditingPoliciesClientAPI = (*sql.ServerTableAuditingPoliciesClient)(nil) - -// DatabaseTableAuditingPoliciesClientAPI contains the set of methods on the DatabaseTableAuditingPoliciesClient type. -type DatabaseTableAuditingPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DatabaseTableAuditingPolicy) (result sql.DatabaseTableAuditingPolicy, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseTableAuditingPolicy, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseTableAuditingPolicyListResult, err error) -} - -var _ DatabaseTableAuditingPoliciesClientAPI = (*sql.DatabaseTableAuditingPoliciesClient)(nil) - -// DatabaseConnectionPoliciesClientAPI contains the set of methods on the DatabaseConnectionPoliciesClient type. -type DatabaseConnectionPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DatabaseConnectionPolicy) (result sql.DatabaseConnectionPolicy, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseConnectionPolicy, err error) -} - -var _ DatabaseConnectionPoliciesClientAPI = (*sql.DatabaseConnectionPoliciesClient)(nil) - -// ServerUsagesClientAPI contains the set of methods on the ServerUsagesClient type. -type ServerUsagesClientAPI interface { - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerUsageListResult, err error) -} - -var _ ServerUsagesClientAPI = (*sql.ServerUsagesClient)(nil) - -// DatabaseUsagesClientAPI contains the set of methods on the DatabaseUsagesClient type. -type DatabaseUsagesClientAPI interface { - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseUsageListResult, err error) +// DatabaseThreatDetectionPoliciesClientAPI contains the set of methods on the DatabaseThreatDetectionPoliciesClient type. +type DatabaseThreatDetectionPoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DatabaseSecurityAlertPolicy) (result sql.DatabaseSecurityAlertPolicy, err error) + Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabaseSecurityAlertPolicy, err error) } -var _ DatabaseUsagesClientAPI = (*sql.DatabaseUsagesClient)(nil) +var _ DatabaseThreatDetectionPoliciesClientAPI = (*sql.DatabaseThreatDetectionPoliciesClient)(nil)