diff --git a/services/sql/mgmt/2014-04-01/sql/models.go b/services/sql/mgmt/2014-04-01/sql/models.go index 0c13d0a8ba7e..5fe23b5cf326 100644 --- a/services/sql/mgmt/2014-04-01/sql/models.go +++ b/services/sql/mgmt/2014-04-01/sql/models.go @@ -36,6 +36,11 @@ const ( SQL AuthenticationType = "SQL" ) +// PossibleAuthenticationTypeValues returns an array of possible values for the AuthenticationType const type. +func PossibleAuthenticationTypeValues() [2]AuthenticationType { + return [2]AuthenticationType{ADPassword, SQL} +} + // CheckNameAvailabilityReason enumerates the values for check name availability reason. type CheckNameAvailabilityReason string @@ -46,6 +51,11 @@ const ( Invalid CheckNameAvailabilityReason = "Invalid" ) +// PossibleCheckNameAvailabilityReasonValues returns an array of possible values for the CheckNameAvailabilityReason const type. +func PossibleCheckNameAvailabilityReasonValues() [2]CheckNameAvailabilityReason { + return [2]CheckNameAvailabilityReason{AlreadyExists, Invalid} +} + // CreateMode enumerates the values for create mode. type CreateMode string @@ -68,6 +78,11 @@ const ( RestoreLongTermRetentionBackup CreateMode = "RestoreLongTermRetentionBackup" ) +// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. +func PossibleCreateModeValues() [8]CreateMode { + return [8]CreateMode{Copy, Default, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, Restore, RestoreLongTermRetentionBackup} +} + // DatabaseEdition enumerates the values for database edition. type DatabaseEdition string @@ -96,6 +111,11 @@ const ( Web DatabaseEdition = "Web" ) +// PossibleDatabaseEditionValues returns an array of possible values for the DatabaseEdition const type. +func PossibleDatabaseEditionValues() [11]DatabaseEdition { + return [11]DatabaseEdition{Basic, Business, DataWarehouse, Free, Premium, PremiumRS, Standard, Stretch, System, System2, Web} +} + // ElasticPoolEdition enumerates the values for elastic pool edition. type ElasticPoolEdition string @@ -108,6 +128,11 @@ const ( ElasticPoolEditionStandard ElasticPoolEdition = "Standard" ) +// PossibleElasticPoolEditionValues returns an array of possible values for the ElasticPoolEdition const type. +func PossibleElasticPoolEditionValues() [3]ElasticPoolEdition { + return [3]ElasticPoolEdition{ElasticPoolEditionBasic, ElasticPoolEditionPremium, ElasticPoolEditionStandard} +} + // ElasticPoolState enumerates the values for elastic pool state. type ElasticPoolState string @@ -120,6 +145,11 @@ const ( Ready ElasticPoolState = "Ready" ) +// PossibleElasticPoolStateValues returns an array of possible values for the ElasticPoolState const type. +func PossibleElasticPoolStateValues() [3]ElasticPoolState { + return [3]ElasticPoolState{Creating, Disabled, Ready} +} + // ReadScale enumerates the values for read scale. type ReadScale string @@ -130,6 +160,11 @@ const ( ReadScaleEnabled ReadScale = "Enabled" ) +// PossibleReadScaleValues returns an array of possible values for the ReadScale const type. +func PossibleReadScaleValues() [2]ReadScale { + return [2]ReadScale{ReadScaleDisabled, ReadScaleEnabled} +} + // RecommendedIndexAction enumerates the values for recommended index action. type RecommendedIndexAction string @@ -142,6 +177,11 @@ const ( Rebuild RecommendedIndexAction = "Rebuild" ) +// PossibleRecommendedIndexActionValues returns an array of possible values for the RecommendedIndexAction const type. +func PossibleRecommendedIndexActionValues() [3]RecommendedIndexAction { + return [3]RecommendedIndexAction{Create, Drop, Rebuild} +} + // RecommendedIndexState enumerates the values for recommended index state. type RecommendedIndexState string @@ -170,6 +210,11 @@ const ( Verifying RecommendedIndexState = "Verifying" ) +// PossibleRecommendedIndexStateValues returns an array of possible values for the RecommendedIndexState const type. +func PossibleRecommendedIndexStateValues() [11]RecommendedIndexState { + return [11]RecommendedIndexState{Active, Blocked, Executing, Expired, Ignored, Pending, PendingRevert, Reverted, Reverting, Success, Verifying} +} + // RecommendedIndexType enumerates the values for recommended index type. type RecommendedIndexType string @@ -184,6 +229,11 @@ const ( NONCLUSTERED RecommendedIndexType = "NONCLUSTERED" ) +// PossibleRecommendedIndexTypeValues returns an array of possible values for the RecommendedIndexType const type. +func PossibleRecommendedIndexTypeValues() [4]RecommendedIndexType { + return [4]RecommendedIndexType{CLUSTERED, CLUSTEREDCOLUMNSTORE, COLUMNSTORE, NONCLUSTERED} +} + // ReplicationRole enumerates the values for replication role. type ReplicationRole string @@ -200,6 +250,11 @@ const ( ReplicationRoleSource ReplicationRole = "Source" ) +// PossibleReplicationRoleValues returns an array of possible values for the ReplicationRole const type. +func PossibleReplicationRoleValues() [5]ReplicationRole { + return [5]ReplicationRole{ReplicationRoleCopy, ReplicationRoleNonReadableSecondary, ReplicationRolePrimary, ReplicationRoleSecondary, ReplicationRoleSource} +} + // ReplicationState enumerates the values for replication state. type ReplicationState string @@ -214,6 +269,11 @@ const ( SUSPENDED ReplicationState = "SUSPENDED" ) +// PossibleReplicationStateValues returns an array of possible values for the ReplicationState const type. +func PossibleReplicationStateValues() [4]ReplicationState { + return [4]ReplicationState{CATCHUP, PENDING, SEEDING, SUSPENDED} +} + // SampleName enumerates the values for sample name. type SampleName string @@ -222,6 +282,11 @@ const ( AdventureWorksLT SampleName = "AdventureWorksLT" ) +// PossibleSampleNameValues returns an array of possible values for the SampleName const type. +func PossibleSampleNameValues() [1]SampleName { + return [1]SampleName{AdventureWorksLT} +} + // SecurityAlertPolicyEmailAccountAdmins enumerates the values for security alert policy email account admins. type SecurityAlertPolicyEmailAccountAdmins string @@ -232,6 +297,11 @@ const ( SecurityAlertPolicyEmailAccountAdminsEnabled SecurityAlertPolicyEmailAccountAdmins = "Enabled" ) +// PossibleSecurityAlertPolicyEmailAccountAdminsValues returns an array of possible values for the SecurityAlertPolicyEmailAccountAdmins const type. +func PossibleSecurityAlertPolicyEmailAccountAdminsValues() [2]SecurityAlertPolicyEmailAccountAdmins { + return [2]SecurityAlertPolicyEmailAccountAdmins{SecurityAlertPolicyEmailAccountAdminsDisabled, SecurityAlertPolicyEmailAccountAdminsEnabled} +} + // SecurityAlertPolicyState enumerates the values for security alert policy state. type SecurityAlertPolicyState string @@ -244,6 +314,11 @@ const ( SecurityAlertPolicyStateNew SecurityAlertPolicyState = "New" ) +// PossibleSecurityAlertPolicyStateValues returns an array of possible values for the SecurityAlertPolicyState const type. +func PossibleSecurityAlertPolicyStateValues() [3]SecurityAlertPolicyState { + return [3]SecurityAlertPolicyState{SecurityAlertPolicyStateDisabled, SecurityAlertPolicyStateEnabled, SecurityAlertPolicyStateNew} +} + // SecurityAlertPolicyUseServerDefault enumerates the values for security alert policy use server default. type SecurityAlertPolicyUseServerDefault string @@ -254,6 +329,11 @@ const ( SecurityAlertPolicyUseServerDefaultEnabled SecurityAlertPolicyUseServerDefault = "Enabled" ) +// PossibleSecurityAlertPolicyUseServerDefaultValues returns an array of possible values for the SecurityAlertPolicyUseServerDefault const type. +func PossibleSecurityAlertPolicyUseServerDefaultValues() [2]SecurityAlertPolicyUseServerDefault { + return [2]SecurityAlertPolicyUseServerDefault{SecurityAlertPolicyUseServerDefaultDisabled, SecurityAlertPolicyUseServerDefaultEnabled} +} + // ServiceObjectiveName enumerates the values for service objective name. type ServiceObjectiveName string @@ -390,6 +470,11 @@ const ( ServiceObjectiveNameSystem4L ServiceObjectiveName = "System4L" ) +// PossibleServiceObjectiveNameValues returns an array of possible values for the ServiceObjectiveName const type. +func PossibleServiceObjectiveNameValues() [65]ServiceObjectiveName { + return [65]ServiceObjectiveName{ServiceObjectiveNameBasic, ServiceObjectiveNameDS100, ServiceObjectiveNameDS1000, ServiceObjectiveNameDS1200, ServiceObjectiveNameDS1500, ServiceObjectiveNameDS200, ServiceObjectiveNameDS2000, ServiceObjectiveNameDS300, ServiceObjectiveNameDS400, ServiceObjectiveNameDS500, ServiceObjectiveNameDS600, ServiceObjectiveNameDW100, ServiceObjectiveNameDW1000, ServiceObjectiveNameDW10000c, ServiceObjectiveNameDW1000c, ServiceObjectiveNameDW1200, ServiceObjectiveNameDW1500, ServiceObjectiveNameDW15000c, ServiceObjectiveNameDW1500c, ServiceObjectiveNameDW200, ServiceObjectiveNameDW2000, ServiceObjectiveNameDW2000c, ServiceObjectiveNameDW2500c, ServiceObjectiveNameDW300, ServiceObjectiveNameDW3000, ServiceObjectiveNameDW30000c, ServiceObjectiveNameDW3000c, ServiceObjectiveNameDW400, ServiceObjectiveNameDW500, ServiceObjectiveNameDW5000c, ServiceObjectiveNameDW600, ServiceObjectiveNameDW6000, ServiceObjectiveNameDW6000c, ServiceObjectiveNameDW7500c, ServiceObjectiveNameElasticPool, ServiceObjectiveNameFree, ServiceObjectiveNameP1, ServiceObjectiveNameP11, ServiceObjectiveNameP15, ServiceObjectiveNameP2, ServiceObjectiveNameP3, ServiceObjectiveNameP4, ServiceObjectiveNameP6, ServiceObjectiveNamePRS1, ServiceObjectiveNamePRS2, ServiceObjectiveNamePRS4, ServiceObjectiveNamePRS6, ServiceObjectiveNameS0, ServiceObjectiveNameS1, ServiceObjectiveNameS12, ServiceObjectiveNameS2, ServiceObjectiveNameS3, ServiceObjectiveNameS4, ServiceObjectiveNameS6, ServiceObjectiveNameS7, ServiceObjectiveNameS9, ServiceObjectiveNameSystem, ServiceObjectiveNameSystem0, ServiceObjectiveNameSystem1, ServiceObjectiveNameSystem2, ServiceObjectiveNameSystem2L, ServiceObjectiveNameSystem3, ServiceObjectiveNameSystem3L, ServiceObjectiveNameSystem4, ServiceObjectiveNameSystem4L} +} + // StorageKeyType enumerates the values for storage key type. type StorageKeyType string @@ -400,6 +485,11 @@ const ( StorageAccessKey StorageKeyType = "StorageAccessKey" ) +// PossibleStorageKeyTypeValues returns an array of possible values for the StorageKeyType const type. +func PossibleStorageKeyTypeValues() [2]StorageKeyType { + return [2]StorageKeyType{SharedAccessKey, StorageAccessKey} +} + // TransparentDataEncryptionActivityStatus enumerates the values for transparent data encryption activity // status. type TransparentDataEncryptionActivityStatus string @@ -411,6 +501,11 @@ const ( Encrypting TransparentDataEncryptionActivityStatus = "Encrypting" ) +// PossibleTransparentDataEncryptionActivityStatusValues returns an array of possible values for the TransparentDataEncryptionActivityStatus const type. +func PossibleTransparentDataEncryptionActivityStatusValues() [2]TransparentDataEncryptionActivityStatus { + return [2]TransparentDataEncryptionActivityStatus{Decrypting, Encrypting} +} + // TransparentDataEncryptionStatus enumerates the values for transparent data encryption status. type TransparentDataEncryptionStatus string @@ -421,6 +516,11 @@ const ( TransparentDataEncryptionStatusEnabled TransparentDataEncryptionStatus = "Enabled" ) +// PossibleTransparentDataEncryptionStatusValues returns an array of possible values for the TransparentDataEncryptionStatus const type. +func PossibleTransparentDataEncryptionStatusValues() [2]TransparentDataEncryptionStatus { + return [2]TransparentDataEncryptionStatus{TransparentDataEncryptionStatusDisabled, TransparentDataEncryptionStatusEnabled} +} + // 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. diff --git a/services/sql/mgmt/2015-05-01-preview/sql/models.go b/services/sql/mgmt/2015-05-01-preview/sql/models.go index 1775b88e8fa1..4a4ab14e082b 100644 --- a/services/sql/mgmt/2015-05-01-preview/sql/models.go +++ b/services/sql/mgmt/2015-05-01-preview/sql/models.go @@ -37,6 +37,11 @@ const ( SQL AuthenticationType = "SQL" ) +// PossibleAuthenticationTypeValues returns an array of possible values for the AuthenticationType const type. +func PossibleAuthenticationTypeValues() [2]AuthenticationType { + return [2]AuthenticationType{ADPassword, SQL} +} + // BackupLongTermRetentionPolicyState enumerates the values for backup long term retention policy state. type BackupLongTermRetentionPolicyState string @@ -47,6 +52,11 @@ const ( Enabled BackupLongTermRetentionPolicyState = "Enabled" ) +// PossibleBackupLongTermRetentionPolicyStateValues returns an array of possible values for the BackupLongTermRetentionPolicyState const type. +func PossibleBackupLongTermRetentionPolicyStateValues() [2]BackupLongTermRetentionPolicyState { + return [2]BackupLongTermRetentionPolicyState{Disabled, Enabled} +} + // BlobAuditingPolicyState enumerates the values for blob auditing policy state. type BlobAuditingPolicyState string @@ -57,6 +67,11 @@ const ( BlobAuditingPolicyStateEnabled BlobAuditingPolicyState = "Enabled" ) +// PossibleBlobAuditingPolicyStateValues returns an array of possible values for the BlobAuditingPolicyState const type. +func PossibleBlobAuditingPolicyStateValues() [2]BlobAuditingPolicyState { + return [2]BlobAuditingPolicyState{BlobAuditingPolicyStateDisabled, BlobAuditingPolicyStateEnabled} +} + // CapabilityStatus enumerates the values for capability status. type CapabilityStatus string @@ -71,6 +86,11 @@ const ( CapabilityStatusVisible CapabilityStatus = "Visible" ) +// PossibleCapabilityStatusValues returns an array of possible values for the CapabilityStatus const type. +func PossibleCapabilityStatusValues() [4]CapabilityStatus { + return [4]CapabilityStatus{CapabilityStatusAvailable, CapabilityStatusDefault, CapabilityStatusDisabled, CapabilityStatusVisible} +} + // CheckNameAvailabilityReason enumerates the values for check name availability reason. type CheckNameAvailabilityReason string @@ -81,6 +101,11 @@ const ( Invalid CheckNameAvailabilityReason = "Invalid" ) +// PossibleCheckNameAvailabilityReasonValues returns an array of possible values for the CheckNameAvailabilityReason const type. +func PossibleCheckNameAvailabilityReasonValues() [2]CheckNameAvailabilityReason { + return [2]CheckNameAvailabilityReason{AlreadyExists, Invalid} +} + // CreateMode enumerates the values for create mode. type CreateMode string @@ -103,6 +128,11 @@ const ( RestoreLongTermRetentionBackup CreateMode = "RestoreLongTermRetentionBackup" ) +// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. +func PossibleCreateModeValues() [8]CreateMode { + return [8]CreateMode{Copy, Default, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, Restore, RestoreLongTermRetentionBackup} +} + // DatabaseEdition enumerates the values for database edition. type DatabaseEdition string @@ -131,6 +161,11 @@ const ( Web DatabaseEdition = "Web" ) +// PossibleDatabaseEditionValues returns an array of possible values for the DatabaseEdition const type. +func PossibleDatabaseEditionValues() [11]DatabaseEdition { + return [11]DatabaseEdition{Basic, Business, DataWarehouse, Free, Premium, PremiumRS, Standard, Stretch, System, System2, Web} +} + // DataMaskingFunction enumerates the values for data masking function. type DataMaskingFunction string @@ -149,6 +184,11 @@ const ( DataMaskingFunctionText DataMaskingFunction = "Text" ) +// PossibleDataMaskingFunctionValues returns an array of possible values for the DataMaskingFunction const type. +func PossibleDataMaskingFunctionValues() [6]DataMaskingFunction { + return [6]DataMaskingFunction{DataMaskingFunctionCCN, DataMaskingFunctionDefault, DataMaskingFunctionEmail, DataMaskingFunctionNumber, DataMaskingFunctionSSN, DataMaskingFunctionText} +} + // DataMaskingRuleState enumerates the values for data masking rule state. type DataMaskingRuleState string @@ -159,6 +199,11 @@ const ( DataMaskingRuleStateEnabled DataMaskingRuleState = "Enabled" ) +// PossibleDataMaskingRuleStateValues returns an array of possible values for the DataMaskingRuleState const type. +func PossibleDataMaskingRuleStateValues() [2]DataMaskingRuleState { + return [2]DataMaskingRuleState{DataMaskingRuleStateDisabled, DataMaskingRuleStateEnabled} +} + // DataMaskingState enumerates the values for data masking state. type DataMaskingState string @@ -169,6 +214,11 @@ const ( DataMaskingStateEnabled DataMaskingState = "Enabled" ) +// PossibleDataMaskingStateValues returns an array of possible values for the DataMaskingState const type. +func PossibleDataMaskingStateValues() [2]DataMaskingState { + return [2]DataMaskingState{DataMaskingStateDisabled, DataMaskingStateEnabled} +} + // ElasticPoolEdition enumerates the values for elastic pool edition. type ElasticPoolEdition string @@ -181,6 +231,11 @@ const ( ElasticPoolEditionStandard ElasticPoolEdition = "Standard" ) +// PossibleElasticPoolEditionValues returns an array of possible values for the ElasticPoolEdition const type. +func PossibleElasticPoolEditionValues() [3]ElasticPoolEdition { + return [3]ElasticPoolEdition{ElasticPoolEditionBasic, ElasticPoolEditionPremium, ElasticPoolEditionStandard} +} + // ElasticPoolState enumerates the values for elastic pool state. type ElasticPoolState string @@ -193,6 +248,11 @@ const ( ElasticPoolStateReady ElasticPoolState = "Ready" ) +// PossibleElasticPoolStateValues returns an array of possible values for the ElasticPoolState const type. +func PossibleElasticPoolStateValues() [3]ElasticPoolState { + return [3]ElasticPoolState{ElasticPoolStateCreating, ElasticPoolStateDisabled, ElasticPoolStateReady} +} + // FailoverGroupReplicationRole enumerates the values for failover group replication role. type FailoverGroupReplicationRole string @@ -203,6 +263,11 @@ const ( Secondary FailoverGroupReplicationRole = "Secondary" ) +// PossibleFailoverGroupReplicationRoleValues returns an array of possible values for the FailoverGroupReplicationRole const type. +func PossibleFailoverGroupReplicationRoleValues() [2]FailoverGroupReplicationRole { + return [2]FailoverGroupReplicationRole{Primary, Secondary} +} + // GeoBackupPolicyState enumerates the values for geo backup policy state. type GeoBackupPolicyState string @@ -213,6 +278,11 @@ const ( GeoBackupPolicyStateEnabled GeoBackupPolicyState = "Enabled" ) +// PossibleGeoBackupPolicyStateValues returns an array of possible values for the GeoBackupPolicyState const type. +func PossibleGeoBackupPolicyStateValues() [2]GeoBackupPolicyState { + return [2]GeoBackupPolicyState{GeoBackupPolicyStateDisabled, GeoBackupPolicyStateEnabled} +} + // IdentityType enumerates the values for identity type. type IdentityType string @@ -221,6 +291,11 @@ const ( SystemAssigned IdentityType = "SystemAssigned" ) +// PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. +func PossibleIdentityTypeValues() [1]IdentityType { + return [1]IdentityType{SystemAssigned} +} + // MaxSizeUnits enumerates the values for max size units. type MaxSizeUnits string @@ -235,6 +310,11 @@ const ( Terabytes MaxSizeUnits = "Terabytes" ) +// PossibleMaxSizeUnitsValues returns an array of possible values for the MaxSizeUnits const type. +func PossibleMaxSizeUnitsValues() [4]MaxSizeUnits { + return [4]MaxSizeUnits{Gigabytes, Megabytes, Petabytes, Terabytes} +} + // OperationOrigin enumerates the values for operation origin. type OperationOrigin string @@ -245,6 +325,11 @@ const ( OperationOriginUser OperationOrigin = "user" ) +// PossibleOperationOriginValues returns an array of possible values for the OperationOrigin const type. +func PossibleOperationOriginValues() [2]OperationOrigin { + return [2]OperationOrigin{OperationOriginSystem, OperationOriginUser} +} + // PerformanceLevelUnit enumerates the values for performance level unit. type PerformanceLevelUnit string @@ -253,6 +338,11 @@ const ( DTU PerformanceLevelUnit = "DTU" ) +// PossiblePerformanceLevelUnitValues returns an array of possible values for the PerformanceLevelUnit const type. +func PossiblePerformanceLevelUnitValues() [1]PerformanceLevelUnit { + return [1]PerformanceLevelUnit{DTU} +} + // PrimaryAggregationType enumerates the values for primary aggregation type. type PrimaryAggregationType string @@ -271,6 +361,11 @@ const ( Total PrimaryAggregationType = "Total" ) +// PossiblePrimaryAggregationTypeValues returns an array of possible values for the PrimaryAggregationType const type. +func PossiblePrimaryAggregationTypeValues() [6]PrimaryAggregationType { + return [6]PrimaryAggregationType{Average, Count, Maximum, Minimum, None, Total} +} + // ReadOnlyEndpointFailoverPolicy enumerates the values for read only endpoint failover policy. type ReadOnlyEndpointFailoverPolicy string @@ -281,6 +376,11 @@ const ( ReadOnlyEndpointFailoverPolicyEnabled ReadOnlyEndpointFailoverPolicy = "Enabled" ) +// PossibleReadOnlyEndpointFailoverPolicyValues returns an array of possible values for the ReadOnlyEndpointFailoverPolicy const type. +func PossibleReadOnlyEndpointFailoverPolicyValues() [2]ReadOnlyEndpointFailoverPolicy { + return [2]ReadOnlyEndpointFailoverPolicy{ReadOnlyEndpointFailoverPolicyDisabled, ReadOnlyEndpointFailoverPolicyEnabled} +} + // ReadScale enumerates the values for read scale. type ReadScale string @@ -291,6 +391,11 @@ const ( ReadScaleEnabled ReadScale = "Enabled" ) +// PossibleReadScaleValues returns an array of possible values for the ReadScale const type. +func PossibleReadScaleValues() [2]ReadScale { + return [2]ReadScale{ReadScaleDisabled, ReadScaleEnabled} +} + // ReadWriteEndpointFailoverPolicy enumerates the values for read write endpoint failover policy. type ReadWriteEndpointFailoverPolicy string @@ -301,6 +406,11 @@ const ( Manual ReadWriteEndpointFailoverPolicy = "Manual" ) +// PossibleReadWriteEndpointFailoverPolicyValues returns an array of possible values for the ReadWriteEndpointFailoverPolicy const type. +func PossibleReadWriteEndpointFailoverPolicyValues() [2]ReadWriteEndpointFailoverPolicy { + return [2]ReadWriteEndpointFailoverPolicy{Automatic, Manual} +} + // RecommendedIndexAction enumerates the values for recommended index action. type RecommendedIndexAction string @@ -313,6 +423,11 @@ const ( Rebuild RecommendedIndexAction = "Rebuild" ) +// PossibleRecommendedIndexActionValues returns an array of possible values for the RecommendedIndexAction const type. +func PossibleRecommendedIndexActionValues() [3]RecommendedIndexAction { + return [3]RecommendedIndexAction{Create, Drop, Rebuild} +} + // RecommendedIndexState enumerates the values for recommended index state. type RecommendedIndexState string @@ -341,6 +456,11 @@ const ( Verifying RecommendedIndexState = "Verifying" ) +// PossibleRecommendedIndexStateValues returns an array of possible values for the RecommendedIndexState const type. +func PossibleRecommendedIndexStateValues() [11]RecommendedIndexState { + return [11]RecommendedIndexState{Active, Blocked, Executing, Expired, Ignored, Pending, PendingRevert, Reverted, Reverting, Success, Verifying} +} + // RecommendedIndexType enumerates the values for recommended index type. type RecommendedIndexType string @@ -355,6 +475,11 @@ const ( NONCLUSTERED RecommendedIndexType = "NONCLUSTERED" ) +// PossibleRecommendedIndexTypeValues returns an array of possible values for the RecommendedIndexType const type. +func PossibleRecommendedIndexTypeValues() [4]RecommendedIndexType { + return [4]RecommendedIndexType{CLUSTERED, CLUSTEREDCOLUMNSTORE, COLUMNSTORE, NONCLUSTERED} +} + // ReplicationRole enumerates the values for replication role. type ReplicationRole string @@ -371,6 +496,11 @@ const ( ReplicationRoleSource ReplicationRole = "Source" ) +// PossibleReplicationRoleValues returns an array of possible values for the ReplicationRole const type. +func PossibleReplicationRoleValues() [5]ReplicationRole { + return [5]ReplicationRole{ReplicationRoleCopy, ReplicationRoleNonReadableSecondary, ReplicationRolePrimary, ReplicationRoleSecondary, ReplicationRoleSource} +} + // ReplicationState enumerates the values for replication state. type ReplicationState string @@ -385,6 +515,11 @@ const ( SUSPENDED ReplicationState = "SUSPENDED" ) +// PossibleReplicationStateValues returns an array of possible values for the ReplicationState const type. +func PossibleReplicationStateValues() [4]ReplicationState { + return [4]ReplicationState{CATCHUP, PENDING, SEEDING, SUSPENDED} +} + // RestorePointType enumerates the values for restore point type. type RestorePointType string @@ -395,6 +530,11 @@ const ( DISCRETE RestorePointType = "DISCRETE" ) +// PossibleRestorePointTypeValues returns an array of possible values for the RestorePointType const type. +func PossibleRestorePointTypeValues() [2]RestorePointType { + return [2]RestorePointType{CONTINUOUS, DISCRETE} +} + // SampleName enumerates the values for sample name. type SampleName string @@ -403,6 +543,11 @@ const ( AdventureWorksLT SampleName = "AdventureWorksLT" ) +// PossibleSampleNameValues returns an array of possible values for the SampleName const type. +func PossibleSampleNameValues() [1]SampleName { + return [1]SampleName{AdventureWorksLT} +} + // SecurityAlertPolicyEmailAccountAdmins enumerates the values for security alert policy email account admins. type SecurityAlertPolicyEmailAccountAdmins string @@ -413,6 +558,11 @@ const ( SecurityAlertPolicyEmailAccountAdminsEnabled SecurityAlertPolicyEmailAccountAdmins = "Enabled" ) +// PossibleSecurityAlertPolicyEmailAccountAdminsValues returns an array of possible values for the SecurityAlertPolicyEmailAccountAdmins const type. +func PossibleSecurityAlertPolicyEmailAccountAdminsValues() [2]SecurityAlertPolicyEmailAccountAdmins { + return [2]SecurityAlertPolicyEmailAccountAdmins{SecurityAlertPolicyEmailAccountAdminsDisabled, SecurityAlertPolicyEmailAccountAdminsEnabled} +} + // SecurityAlertPolicyState enumerates the values for security alert policy state. type SecurityAlertPolicyState string @@ -425,6 +575,11 @@ const ( SecurityAlertPolicyStateNew SecurityAlertPolicyState = "New" ) +// PossibleSecurityAlertPolicyStateValues returns an array of possible values for the SecurityAlertPolicyState const type. +func PossibleSecurityAlertPolicyStateValues() [3]SecurityAlertPolicyState { + return [3]SecurityAlertPolicyState{SecurityAlertPolicyStateDisabled, SecurityAlertPolicyStateEnabled, SecurityAlertPolicyStateNew} +} + // SecurityAlertPolicyUseServerDefault enumerates the values for security alert policy use server default. type SecurityAlertPolicyUseServerDefault string @@ -435,6 +590,11 @@ const ( SecurityAlertPolicyUseServerDefaultEnabled SecurityAlertPolicyUseServerDefault = "Enabled" ) +// PossibleSecurityAlertPolicyUseServerDefaultValues returns an array of possible values for the SecurityAlertPolicyUseServerDefault const type. +func PossibleSecurityAlertPolicyUseServerDefaultValues() [2]SecurityAlertPolicyUseServerDefault { + return [2]SecurityAlertPolicyUseServerDefault{SecurityAlertPolicyUseServerDefaultDisabled, SecurityAlertPolicyUseServerDefaultEnabled} +} + // ServerConnectionType enumerates the values for server connection type. type ServerConnectionType string @@ -447,6 +607,11 @@ const ( ServerConnectionTypeRedirect ServerConnectionType = "Redirect" ) +// PossibleServerConnectionTypeValues returns an array of possible values for the ServerConnectionType const type. +func PossibleServerConnectionTypeValues() [3]ServerConnectionType { + return [3]ServerConnectionType{ServerConnectionTypeDefault, ServerConnectionTypeProxy, ServerConnectionTypeRedirect} +} + // ServerKeyType enumerates the values for server key type. type ServerKeyType string @@ -457,6 +622,11 @@ const ( ServiceManaged ServerKeyType = "ServiceManaged" ) +// PossibleServerKeyTypeValues returns an array of possible values for the ServerKeyType const type. +func PossibleServerKeyTypeValues() [2]ServerKeyType { + return [2]ServerKeyType{AzureKeyVault, ServiceManaged} +} + // ServiceObjectiveName enumerates the values for service objective name. type ServiceObjectiveName string @@ -593,6 +763,11 @@ const ( ServiceObjectiveNameSystem4L ServiceObjectiveName = "System4L" ) +// PossibleServiceObjectiveNameValues returns an array of possible values for the ServiceObjectiveName const type. +func PossibleServiceObjectiveNameValues() [65]ServiceObjectiveName { + return [65]ServiceObjectiveName{ServiceObjectiveNameBasic, ServiceObjectiveNameDS100, ServiceObjectiveNameDS1000, ServiceObjectiveNameDS1200, ServiceObjectiveNameDS1500, ServiceObjectiveNameDS200, ServiceObjectiveNameDS2000, ServiceObjectiveNameDS300, ServiceObjectiveNameDS400, ServiceObjectiveNameDS500, ServiceObjectiveNameDS600, ServiceObjectiveNameDW100, ServiceObjectiveNameDW1000, ServiceObjectiveNameDW10000c, ServiceObjectiveNameDW1000c, ServiceObjectiveNameDW1200, ServiceObjectiveNameDW1500, ServiceObjectiveNameDW15000c, ServiceObjectiveNameDW1500c, ServiceObjectiveNameDW200, ServiceObjectiveNameDW2000, ServiceObjectiveNameDW2000c, ServiceObjectiveNameDW2500c, ServiceObjectiveNameDW300, ServiceObjectiveNameDW3000, ServiceObjectiveNameDW30000c, ServiceObjectiveNameDW3000c, ServiceObjectiveNameDW400, ServiceObjectiveNameDW500, ServiceObjectiveNameDW5000c, ServiceObjectiveNameDW600, ServiceObjectiveNameDW6000, ServiceObjectiveNameDW6000c, ServiceObjectiveNameDW7500c, ServiceObjectiveNameElasticPool, ServiceObjectiveNameFree, ServiceObjectiveNameP1, ServiceObjectiveNameP11, ServiceObjectiveNameP15, ServiceObjectiveNameP2, ServiceObjectiveNameP3, ServiceObjectiveNameP4, ServiceObjectiveNameP6, ServiceObjectiveNamePRS1, ServiceObjectiveNamePRS2, ServiceObjectiveNamePRS4, ServiceObjectiveNamePRS6, ServiceObjectiveNameS0, ServiceObjectiveNameS1, ServiceObjectiveNameS12, ServiceObjectiveNameS2, ServiceObjectiveNameS3, ServiceObjectiveNameS4, ServiceObjectiveNameS6, ServiceObjectiveNameS7, ServiceObjectiveNameS9, ServiceObjectiveNameSystem, ServiceObjectiveNameSystem0, ServiceObjectiveNameSystem1, ServiceObjectiveNameSystem2, ServiceObjectiveNameSystem2L, ServiceObjectiveNameSystem3, ServiceObjectiveNameSystem3L, ServiceObjectiveNameSystem4, ServiceObjectiveNameSystem4L} +} + // StorageKeyType enumerates the values for storage key type. type StorageKeyType string @@ -603,6 +778,11 @@ const ( StorageAccessKey StorageKeyType = "StorageAccessKey" ) +// PossibleStorageKeyTypeValues returns an array of possible values for the StorageKeyType const type. +func PossibleStorageKeyTypeValues() [2]StorageKeyType { + return [2]StorageKeyType{SharedAccessKey, StorageAccessKey} +} + // SyncAgentState enumerates the values for sync agent state. type SyncAgentState string @@ -615,6 +795,11 @@ const ( Online SyncAgentState = "Online" ) +// PossibleSyncAgentStateValues returns an array of possible values for the SyncAgentState const type. +func PossibleSyncAgentStateValues() [3]SyncAgentState { + return [3]SyncAgentState{NeverConnected, Offline, Online} +} + // SyncConflictResolutionPolicy enumerates the values for sync conflict resolution policy. type SyncConflictResolutionPolicy string @@ -625,6 +810,11 @@ const ( MemberWin SyncConflictResolutionPolicy = "MemberWin" ) +// PossibleSyncConflictResolutionPolicyValues returns an array of possible values for the SyncConflictResolutionPolicy const type. +func PossibleSyncConflictResolutionPolicyValues() [2]SyncConflictResolutionPolicy { + return [2]SyncConflictResolutionPolicy{HubWin, MemberWin} +} + // SyncDirection enumerates the values for sync direction. type SyncDirection string @@ -637,6 +827,11 @@ const ( OneWayMemberToHub SyncDirection = "OneWayMemberToHub" ) +// PossibleSyncDirectionValues returns an array of possible values for the SyncDirection const type. +func PossibleSyncDirectionValues() [3]SyncDirection { + return [3]SyncDirection{Bidirectional, OneWayHubToMember, OneWayMemberToHub} +} + // SyncGroupLogType enumerates the values for sync group log type. type SyncGroupLogType string @@ -651,6 +846,11 @@ const ( SyncGroupLogTypeWarning SyncGroupLogType = "Warning" ) +// PossibleSyncGroupLogTypeValues returns an array of possible values for the SyncGroupLogType const type. +func PossibleSyncGroupLogTypeValues() [4]SyncGroupLogType { + return [4]SyncGroupLogType{SyncGroupLogTypeAll, SyncGroupLogTypeError, SyncGroupLogTypeSuccess, SyncGroupLogTypeWarning} +} + // SyncGroupState enumerates the values for sync group state. type SyncGroupState string @@ -667,6 +867,11 @@ const ( Warning SyncGroupState = "Warning" ) +// PossibleSyncGroupStateValues returns an array of possible values for the SyncGroupState const type. +func PossibleSyncGroupStateValues() [5]SyncGroupState { + return [5]SyncGroupState{Error, Good, NotReady, Progressing, Warning} +} + // SyncMemberDbType enumerates the values for sync member db type. type SyncMemberDbType string @@ -677,6 +882,11 @@ const ( SQLServerDatabase SyncMemberDbType = "SqlServerDatabase" ) +// PossibleSyncMemberDbTypeValues returns an array of possible values for the SyncMemberDbType const type. +func PossibleSyncMemberDbTypeValues() [2]SyncMemberDbType { + return [2]SyncMemberDbType{AzureSQLDatabase, SQLServerDatabase} +} + // SyncMemberState enumerates the values for sync member state. type SyncMemberState string @@ -719,6 +929,11 @@ const ( UnReprovisioned SyncMemberState = "UnReprovisioned" ) +// PossibleSyncMemberStateValues returns an array of possible values for the SyncMemberState const type. +func PossibleSyncMemberStateValues() [18]SyncMemberState { + return [18]SyncMemberState{DeProvisioned, DeProvisionFailed, DeProvisioning, DisabledBackupRestore, DisabledTombstoneCleanup, Provisioned, ProvisionFailed, Provisioning, ReprovisionFailed, Reprovisioning, SyncCancelled, SyncCancelling, SyncFailed, SyncInProgress, SyncSucceeded, SyncSucceededWithWarnings, UnProvisioned, UnReprovisioned} +} + // TransparentDataEncryptionActivityStatus enumerates the values for transparent data encryption activity // status. type TransparentDataEncryptionActivityStatus string @@ -730,6 +945,11 @@ const ( Encrypting TransparentDataEncryptionActivityStatus = "Encrypting" ) +// PossibleTransparentDataEncryptionActivityStatusValues returns an array of possible values for the TransparentDataEncryptionActivityStatus const type. +func PossibleTransparentDataEncryptionActivityStatusValues() [2]TransparentDataEncryptionActivityStatus { + return [2]TransparentDataEncryptionActivityStatus{Decrypting, Encrypting} +} + // TransparentDataEncryptionStatus enumerates the values for transparent data encryption status. type TransparentDataEncryptionStatus string @@ -740,6 +960,11 @@ const ( TransparentDataEncryptionStatusEnabled TransparentDataEncryptionStatus = "Enabled" ) +// PossibleTransparentDataEncryptionStatusValues returns an array of possible values for the TransparentDataEncryptionStatus const type. +func PossibleTransparentDataEncryptionStatusValues() [2]TransparentDataEncryptionStatus { + return [2]TransparentDataEncryptionStatus{TransparentDataEncryptionStatusDisabled, TransparentDataEncryptionStatusEnabled} +} + // UnitDefinitionType enumerates the values for unit definition type. type UnitDefinitionType string @@ -758,6 +983,11 @@ const ( UnitDefinitionTypeSeconds UnitDefinitionType = "Seconds" ) +// PossibleUnitDefinitionTypeValues returns an array of possible values for the UnitDefinitionType const type. +func PossibleUnitDefinitionTypeValues() [6]UnitDefinitionType { + return [6]UnitDefinitionType{UnitDefinitionTypeBytes, UnitDefinitionTypeBytesPerSecond, UnitDefinitionTypeCount, UnitDefinitionTypeCountPerSecond, UnitDefinitionTypePercent, UnitDefinitionTypeSeconds} +} + // UnitType enumerates the values for unit type. type UnitType string @@ -776,6 +1006,11 @@ const ( UnitTypeSeconds UnitType = "seconds" ) +// PossibleUnitTypeValues returns an array of possible values for the UnitType const type. +func PossibleUnitTypeValues() [6]UnitType { + return [6]UnitType{UnitTypeBytes, UnitTypeBytesPerSecond, UnitTypeCount, UnitTypeCountPerSecond, UnitTypePercent, UnitTypeSeconds} +} + // VirtualNetworkRuleState enumerates the values for virtual network rule state. type VirtualNetworkRuleState string @@ -792,6 +1027,11 @@ const ( Unknown VirtualNetworkRuleState = "Unknown" ) +// PossibleVirtualNetworkRuleStateValues returns an array of possible values for the VirtualNetworkRuleState const type. +func PossibleVirtualNetworkRuleStateValues() [5]VirtualNetworkRuleState { + return [5]VirtualNetworkRuleState{Deleting, Initializing, InProgress, Ready, Unknown} +} + // BackupLongTermRetentionPoliciesGroupCreateOrUpdateFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type BackupLongTermRetentionPoliciesGroupCreateOrUpdateFuture struct { diff --git a/services/sql/mgmt/2017-03-01-preview/sql/datawarehouseuseractivities.go b/services/sql/mgmt/2017-03-01-preview/sql/datawarehouseuseractivities.go new file mode 100644 index 000000000000..7f707f560bd4 --- /dev/null +++ b/services/sql/mgmt/2017-03-01-preview/sql/datawarehouseuseractivities.go @@ -0,0 +1,112 @@ +package sql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// DataWarehouseUserActivitiesClient is the the Azure SQL Database management API provides a RESTful set of web +// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, +// retrieve, update, and delete databases. +type DataWarehouseUserActivitiesClient struct { + BaseClient +} + +// NewDataWarehouseUserActivitiesClient creates an instance of the DataWarehouseUserActivitiesClient client. +func NewDataWarehouseUserActivitiesClient(subscriptionID string) DataWarehouseUserActivitiesClient { + return NewDataWarehouseUserActivitiesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDataWarehouseUserActivitiesClientWithBaseURI creates an instance of the DataWarehouseUserActivitiesClient client. +func NewDataWarehouseUserActivitiesClientWithBaseURI(baseURI string, subscriptionID string) DataWarehouseUserActivitiesClient { + return DataWarehouseUserActivitiesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets the user activities of a data warehouse which includes running and suspended queries +// +// resourceGroupName is 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 is the name of the server. databaseName is the name of +// the database. +func (client DataWarehouseUserActivitiesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DataWarehouseUserActivities, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DataWarehouseUserActivitiesClient", "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.DataWarehouseUserActivitiesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DataWarehouseUserActivitiesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DataWarehouseUserActivitiesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "databaseName": autorest.Encode("path", databaseName), + "dataWarehouseUserActivityName": autorest.Encode("path", "current"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-01-preview" + 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}/dataWarehouseUserActivities/{dataWarehouseUserActivityName}", 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 DataWarehouseUserActivitiesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DataWarehouseUserActivitiesClient) GetResponder(resp *http.Response) (result DataWarehouseUserActivities, 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/2017-03-01-preview/sql/models.go b/services/sql/mgmt/2017-03-01-preview/sql/models.go index a5a04ebe7e1d..69b695a613af 100644 --- a/services/sql/mgmt/2017-03-01-preview/sql/models.go +++ b/services/sql/mgmt/2017-03-01-preview/sql/models.go @@ -37,6 +37,11 @@ const ( SQL AuthenticationType = "SQL" ) +// PossibleAuthenticationTypeValues returns an array of possible values for the AuthenticationType const type. +func PossibleAuthenticationTypeValues() [2]AuthenticationType { + return [2]AuthenticationType{ADPassword, SQL} +} + // AutomaticTuningDisabledReason enumerates the values for automatic tuning disabled reason. type AutomaticTuningDisabledReason string @@ -57,6 +62,11 @@ const ( QueryStoreReadOnly AutomaticTuningDisabledReason = "QueryStoreReadOnly" ) +// PossibleAutomaticTuningDisabledReasonValues returns an array of possible values for the AutomaticTuningDisabledReason const type. +func PossibleAutomaticTuningDisabledReasonValues() [7]AutomaticTuningDisabledReason { + return [7]AutomaticTuningDisabledReason{AutoConfigured, Default, Disabled, InheritedFromServer, NotSupported, QueryStoreOff, QueryStoreReadOnly} +} + // AutomaticTuningMode enumerates the values for automatic tuning mode. type AutomaticTuningMode string @@ -71,6 +81,11 @@ const ( Unspecified AutomaticTuningMode = "Unspecified" ) +// PossibleAutomaticTuningModeValues returns an array of possible values for the AutomaticTuningMode const type. +func PossibleAutomaticTuningModeValues() [4]AutomaticTuningMode { + return [4]AutomaticTuningMode{Auto, Custom, Inherit, Unspecified} +} + // AutomaticTuningOptionModeActual enumerates the values for automatic tuning option mode actual. type AutomaticTuningOptionModeActual string @@ -81,6 +96,11 @@ const ( On AutomaticTuningOptionModeActual = "On" ) +// PossibleAutomaticTuningOptionModeActualValues returns an array of possible values for the AutomaticTuningOptionModeActual const type. +func PossibleAutomaticTuningOptionModeActualValues() [2]AutomaticTuningOptionModeActual { + return [2]AutomaticTuningOptionModeActual{Off, On} +} + // AutomaticTuningOptionModeDesired enumerates the values for automatic tuning option mode desired. type AutomaticTuningOptionModeDesired string @@ -93,6 +113,11 @@ const ( AutomaticTuningOptionModeDesiredOn AutomaticTuningOptionModeDesired = "On" ) +// PossibleAutomaticTuningOptionModeDesiredValues returns an array of possible values for the AutomaticTuningOptionModeDesired const type. +func PossibleAutomaticTuningOptionModeDesiredValues() [3]AutomaticTuningOptionModeDesired { + return [3]AutomaticTuningOptionModeDesired{AutomaticTuningOptionModeDesiredDefault, AutomaticTuningOptionModeDesiredOff, AutomaticTuningOptionModeDesiredOn} +} + // AutomaticTuningServerMode enumerates the values for automatic tuning server mode. type AutomaticTuningServerMode string @@ -105,6 +130,11 @@ const ( AutomaticTuningServerModeUnspecified AutomaticTuningServerMode = "Unspecified" ) +// PossibleAutomaticTuningServerModeValues returns an array of possible values for the AutomaticTuningServerMode const type. +func PossibleAutomaticTuningServerModeValues() [3]AutomaticTuningServerMode { + return [3]AutomaticTuningServerMode{AutomaticTuningServerModeAuto, AutomaticTuningServerModeCustom, AutomaticTuningServerModeUnspecified} +} + // AutomaticTuningServerReason enumerates the values for automatic tuning server reason. type AutomaticTuningServerReason string @@ -117,6 +147,11 @@ const ( AutomaticTuningServerReasonDisabled AutomaticTuningServerReason = "Disabled" ) +// PossibleAutomaticTuningServerReasonValues returns an array of possible values for the AutomaticTuningServerReason const type. +func PossibleAutomaticTuningServerReasonValues() [3]AutomaticTuningServerReason { + return [3]AutomaticTuningServerReason{AutomaticTuningServerReasonAutoConfigured, AutomaticTuningServerReasonDefault, AutomaticTuningServerReasonDisabled} +} + // BackupLongTermRetentionPolicyState enumerates the values for backup long term retention policy state. type BackupLongTermRetentionPolicyState string @@ -127,6 +162,11 @@ const ( BackupLongTermRetentionPolicyStateEnabled BackupLongTermRetentionPolicyState = "Enabled" ) +// PossibleBackupLongTermRetentionPolicyStateValues returns an array of possible values for the BackupLongTermRetentionPolicyState const type. +func PossibleBackupLongTermRetentionPolicyStateValues() [2]BackupLongTermRetentionPolicyState { + return [2]BackupLongTermRetentionPolicyState{BackupLongTermRetentionPolicyStateDisabled, BackupLongTermRetentionPolicyStateEnabled} +} + // BlobAuditingPolicyState enumerates the values for blob auditing policy state. type BlobAuditingPolicyState string @@ -137,6 +177,11 @@ const ( BlobAuditingPolicyStateEnabled BlobAuditingPolicyState = "Enabled" ) +// PossibleBlobAuditingPolicyStateValues returns an array of possible values for the BlobAuditingPolicyState const type. +func PossibleBlobAuditingPolicyStateValues() [2]BlobAuditingPolicyState { + return [2]BlobAuditingPolicyState{BlobAuditingPolicyStateDisabled, BlobAuditingPolicyStateEnabled} +} + // CapabilityStatus enumerates the values for capability status. type CapabilityStatus string @@ -151,6 +196,11 @@ const ( CapabilityStatusVisible CapabilityStatus = "Visible" ) +// PossibleCapabilityStatusValues returns an array of possible values for the CapabilityStatus const type. +func PossibleCapabilityStatusValues() [4]CapabilityStatus { + return [4]CapabilityStatus{CapabilityStatusAvailable, CapabilityStatusDefault, CapabilityStatusDisabled, CapabilityStatusVisible} +} + // CheckNameAvailabilityReason enumerates the values for check name availability reason. type CheckNameAvailabilityReason string @@ -161,6 +211,11 @@ const ( Invalid CheckNameAvailabilityReason = "Invalid" ) +// PossibleCheckNameAvailabilityReasonValues returns an array of possible values for the CheckNameAvailabilityReason const type. +func PossibleCheckNameAvailabilityReasonValues() [2]CheckNameAvailabilityReason { + return [2]CheckNameAvailabilityReason{AlreadyExists, Invalid} +} + // CreateMode enumerates the values for create mode. type CreateMode string @@ -183,6 +238,11 @@ const ( CreateModeRestoreLongTermRetentionBackup CreateMode = "RestoreLongTermRetentionBackup" ) +// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. +func PossibleCreateModeValues() [8]CreateMode { + return [8]CreateMode{CreateModeCopy, CreateModeDefault, CreateModeNonReadableSecondary, CreateModeOnlineSecondary, CreateModePointInTimeRestore, CreateModeRecovery, CreateModeRestore, CreateModeRestoreLongTermRetentionBackup} +} + // DatabaseEdition enumerates the values for database edition. type DatabaseEdition string @@ -211,6 +271,11 @@ const ( Web DatabaseEdition = "Web" ) +// PossibleDatabaseEditionValues returns an array of possible values for the DatabaseEdition const type. +func PossibleDatabaseEditionValues() [11]DatabaseEdition { + return [11]DatabaseEdition{Basic, Business, DataWarehouse, Free, Premium, PremiumRS, Standard, Stretch, System, System2, Web} +} + // DataMaskingFunction enumerates the values for data masking function. type DataMaskingFunction string @@ -229,6 +294,11 @@ const ( DataMaskingFunctionText DataMaskingFunction = "Text" ) +// PossibleDataMaskingFunctionValues returns an array of possible values for the DataMaskingFunction const type. +func PossibleDataMaskingFunctionValues() [6]DataMaskingFunction { + return [6]DataMaskingFunction{DataMaskingFunctionCCN, DataMaskingFunctionDefault, DataMaskingFunctionEmail, DataMaskingFunctionNumber, DataMaskingFunctionSSN, DataMaskingFunctionText} +} + // DataMaskingRuleState enumerates the values for data masking rule state. type DataMaskingRuleState string @@ -239,6 +309,11 @@ const ( DataMaskingRuleStateEnabled DataMaskingRuleState = "Enabled" ) +// PossibleDataMaskingRuleStateValues returns an array of possible values for the DataMaskingRuleState const type. +func PossibleDataMaskingRuleStateValues() [2]DataMaskingRuleState { + return [2]DataMaskingRuleState{DataMaskingRuleStateDisabled, DataMaskingRuleStateEnabled} +} + // DataMaskingState enumerates the values for data masking state. type DataMaskingState string @@ -249,6 +324,11 @@ const ( DataMaskingStateEnabled DataMaskingState = "Enabled" ) +// PossibleDataMaskingStateValues returns an array of possible values for the DataMaskingState const type. +func PossibleDataMaskingStateValues() [2]DataMaskingState { + return [2]DataMaskingState{DataMaskingStateDisabled, DataMaskingStateEnabled} +} + // ElasticPoolEdition enumerates the values for elastic pool edition. type ElasticPoolEdition string @@ -261,6 +341,11 @@ const ( ElasticPoolEditionStandard ElasticPoolEdition = "Standard" ) +// PossibleElasticPoolEditionValues returns an array of possible values for the ElasticPoolEdition const type. +func PossibleElasticPoolEditionValues() [3]ElasticPoolEdition { + return [3]ElasticPoolEdition{ElasticPoolEditionBasic, ElasticPoolEditionPremium, ElasticPoolEditionStandard} +} + // ElasticPoolState enumerates the values for elastic pool state. type ElasticPoolState string @@ -273,6 +358,11 @@ const ( ElasticPoolStateReady ElasticPoolState = "Ready" ) +// PossibleElasticPoolStateValues returns an array of possible values for the ElasticPoolState const type. +func PossibleElasticPoolStateValues() [3]ElasticPoolState { + return [3]ElasticPoolState{ElasticPoolStateCreating, ElasticPoolStateDisabled, ElasticPoolStateReady} +} + // FailoverGroupReplicationRole enumerates the values for failover group replication role. type FailoverGroupReplicationRole string @@ -283,6 +373,11 @@ const ( Secondary FailoverGroupReplicationRole = "Secondary" ) +// PossibleFailoverGroupReplicationRoleValues returns an array of possible values for the FailoverGroupReplicationRole const type. +func PossibleFailoverGroupReplicationRoleValues() [2]FailoverGroupReplicationRole { + return [2]FailoverGroupReplicationRole{Primary, Secondary} +} + // GeoBackupPolicyState enumerates the values for geo backup policy state. type GeoBackupPolicyState string @@ -293,6 +388,11 @@ const ( GeoBackupPolicyStateEnabled GeoBackupPolicyState = "Enabled" ) +// PossibleGeoBackupPolicyStateValues returns an array of possible values for the GeoBackupPolicyState const type. +func PossibleGeoBackupPolicyStateValues() [2]GeoBackupPolicyState { + return [2]GeoBackupPolicyState{GeoBackupPolicyStateDisabled, GeoBackupPolicyStateEnabled} +} + // IdentityType enumerates the values for identity type. type IdentityType string @@ -301,6 +401,11 @@ const ( SystemAssigned IdentityType = "SystemAssigned" ) +// PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. +func PossibleIdentityTypeValues() [1]IdentityType { + return [1]IdentityType{SystemAssigned} +} + // ManagementOperationState enumerates the values for management operation state. type ManagementOperationState string @@ -319,6 +424,11 @@ const ( Succeeded ManagementOperationState = "Succeeded" ) +// PossibleManagementOperationStateValues returns an array of possible values for the ManagementOperationState const type. +func PossibleManagementOperationStateValues() [6]ManagementOperationState { + return [6]ManagementOperationState{CancelInProgress, Cancelled, Failed, InProgress, Pending, Succeeded} +} + // MaxSizeUnits enumerates the values for max size units. type MaxSizeUnits string @@ -333,6 +443,11 @@ const ( Terabytes MaxSizeUnits = "Terabytes" ) +// PossibleMaxSizeUnitsValues returns an array of possible values for the MaxSizeUnits const type. +func PossibleMaxSizeUnitsValues() [4]MaxSizeUnits { + return [4]MaxSizeUnits{Gigabytes, Megabytes, Petabytes, Terabytes} +} + // OperationOrigin enumerates the values for operation origin. type OperationOrigin string @@ -343,6 +458,11 @@ const ( OperationOriginUser OperationOrigin = "user" ) +// PossibleOperationOriginValues returns an array of possible values for the OperationOrigin const type. +func PossibleOperationOriginValues() [2]OperationOrigin { + return [2]OperationOrigin{OperationOriginSystem, OperationOriginUser} +} + // PerformanceLevelUnit enumerates the values for performance level unit. type PerformanceLevelUnit string @@ -351,6 +471,11 @@ const ( DTU PerformanceLevelUnit = "DTU" ) +// PossiblePerformanceLevelUnitValues returns an array of possible values for the PerformanceLevelUnit const type. +func PossiblePerformanceLevelUnitValues() [1]PerformanceLevelUnit { + return [1]PerformanceLevelUnit{DTU} +} + // PrimaryAggregationType enumerates the values for primary aggregation type. type PrimaryAggregationType string @@ -369,6 +494,11 @@ const ( Total PrimaryAggregationType = "Total" ) +// PossiblePrimaryAggregationTypeValues returns an array of possible values for the PrimaryAggregationType const type. +func PossiblePrimaryAggregationTypeValues() [6]PrimaryAggregationType { + return [6]PrimaryAggregationType{Average, Count, Maximum, Minimum, None, Total} +} + // ReadOnlyEndpointFailoverPolicy enumerates the values for read only endpoint failover policy. type ReadOnlyEndpointFailoverPolicy string @@ -379,6 +509,11 @@ const ( ReadOnlyEndpointFailoverPolicyEnabled ReadOnlyEndpointFailoverPolicy = "Enabled" ) +// PossibleReadOnlyEndpointFailoverPolicyValues returns an array of possible values for the ReadOnlyEndpointFailoverPolicy const type. +func PossibleReadOnlyEndpointFailoverPolicyValues() [2]ReadOnlyEndpointFailoverPolicy { + return [2]ReadOnlyEndpointFailoverPolicy{ReadOnlyEndpointFailoverPolicyDisabled, ReadOnlyEndpointFailoverPolicyEnabled} +} + // ReadScale enumerates the values for read scale. type ReadScale string @@ -389,6 +524,11 @@ const ( ReadScaleEnabled ReadScale = "Enabled" ) +// PossibleReadScaleValues returns an array of possible values for the ReadScale const type. +func PossibleReadScaleValues() [2]ReadScale { + return [2]ReadScale{ReadScaleDisabled, ReadScaleEnabled} +} + // ReadWriteEndpointFailoverPolicy enumerates the values for read write endpoint failover policy. type ReadWriteEndpointFailoverPolicy string @@ -399,6 +539,11 @@ const ( Manual ReadWriteEndpointFailoverPolicy = "Manual" ) +// PossibleReadWriteEndpointFailoverPolicyValues returns an array of possible values for the ReadWriteEndpointFailoverPolicy const type. +func PossibleReadWriteEndpointFailoverPolicyValues() [2]ReadWriteEndpointFailoverPolicy { + return [2]ReadWriteEndpointFailoverPolicy{Automatic, Manual} +} + // RecommendedIndexAction enumerates the values for recommended index action. type RecommendedIndexAction string @@ -411,6 +556,11 @@ const ( Rebuild RecommendedIndexAction = "Rebuild" ) +// PossibleRecommendedIndexActionValues returns an array of possible values for the RecommendedIndexAction const type. +func PossibleRecommendedIndexActionValues() [3]RecommendedIndexAction { + return [3]RecommendedIndexAction{Create, Drop, Rebuild} +} + // RecommendedIndexState enumerates the values for recommended index state. type RecommendedIndexState string @@ -439,6 +589,11 @@ const ( RecommendedIndexStateVerifying RecommendedIndexState = "Verifying" ) +// PossibleRecommendedIndexStateValues returns an array of possible values for the RecommendedIndexState const type. +func PossibleRecommendedIndexStateValues() [11]RecommendedIndexState { + return [11]RecommendedIndexState{RecommendedIndexStateActive, RecommendedIndexStateBlocked, RecommendedIndexStateExecuting, RecommendedIndexStateExpired, RecommendedIndexStateIgnored, RecommendedIndexStatePending, RecommendedIndexStatePendingRevert, RecommendedIndexStateReverted, RecommendedIndexStateReverting, RecommendedIndexStateSuccess, RecommendedIndexStateVerifying} +} + // RecommendedIndexType enumerates the values for recommended index type. type RecommendedIndexType string @@ -453,6 +608,11 @@ const ( NONCLUSTERED RecommendedIndexType = "NONCLUSTERED" ) +// PossibleRecommendedIndexTypeValues returns an array of possible values for the RecommendedIndexType const type. +func PossibleRecommendedIndexTypeValues() [4]RecommendedIndexType { + return [4]RecommendedIndexType{CLUSTERED, CLUSTEREDCOLUMNSTORE, COLUMNSTORE, NONCLUSTERED} +} + // ReplicationRole enumerates the values for replication role. type ReplicationRole string @@ -469,6 +629,11 @@ const ( ReplicationRoleSource ReplicationRole = "Source" ) +// PossibleReplicationRoleValues returns an array of possible values for the ReplicationRole const type. +func PossibleReplicationRoleValues() [5]ReplicationRole { + return [5]ReplicationRole{ReplicationRoleCopy, ReplicationRoleNonReadableSecondary, ReplicationRolePrimary, ReplicationRoleSecondary, ReplicationRoleSource} +} + // ReplicationState enumerates the values for replication state. type ReplicationState string @@ -483,6 +648,11 @@ const ( SUSPENDED ReplicationState = "SUSPENDED" ) +// PossibleReplicationStateValues returns an array of possible values for the ReplicationState const type. +func PossibleReplicationStateValues() [4]ReplicationState { + return [4]ReplicationState{CATCHUP, PENDING, SEEDING, SUSPENDED} +} + // RestorePointType enumerates the values for restore point type. type RestorePointType string @@ -493,6 +663,11 @@ const ( DISCRETE RestorePointType = "DISCRETE" ) +// PossibleRestorePointTypeValues returns an array of possible values for the RestorePointType const type. +func PossibleRestorePointTypeValues() [2]RestorePointType { + return [2]RestorePointType{CONTINUOUS, DISCRETE} +} + // SampleName enumerates the values for sample name. type SampleName string @@ -501,6 +676,11 @@ const ( AdventureWorksLT SampleName = "AdventureWorksLT" ) +// PossibleSampleNameValues returns an array of possible values for the SampleName const type. +func PossibleSampleNameValues() [1]SampleName { + return [1]SampleName{AdventureWorksLT} +} + // SecurityAlertPolicyEmailAccountAdmins enumerates the values for security alert policy email account admins. type SecurityAlertPolicyEmailAccountAdmins string @@ -511,6 +691,11 @@ const ( SecurityAlertPolicyEmailAccountAdminsEnabled SecurityAlertPolicyEmailAccountAdmins = "Enabled" ) +// PossibleSecurityAlertPolicyEmailAccountAdminsValues returns an array of possible values for the SecurityAlertPolicyEmailAccountAdmins const type. +func PossibleSecurityAlertPolicyEmailAccountAdminsValues() [2]SecurityAlertPolicyEmailAccountAdmins { + return [2]SecurityAlertPolicyEmailAccountAdmins{SecurityAlertPolicyEmailAccountAdminsDisabled, SecurityAlertPolicyEmailAccountAdminsEnabled} +} + // SecurityAlertPolicyState enumerates the values for security alert policy state. type SecurityAlertPolicyState string @@ -523,6 +708,11 @@ const ( SecurityAlertPolicyStateNew SecurityAlertPolicyState = "New" ) +// PossibleSecurityAlertPolicyStateValues returns an array of possible values for the SecurityAlertPolicyState const type. +func PossibleSecurityAlertPolicyStateValues() [3]SecurityAlertPolicyState { + return [3]SecurityAlertPolicyState{SecurityAlertPolicyStateDisabled, SecurityAlertPolicyStateEnabled, SecurityAlertPolicyStateNew} +} + // SecurityAlertPolicyUseServerDefault enumerates the values for security alert policy use server default. type SecurityAlertPolicyUseServerDefault string @@ -533,6 +723,11 @@ const ( SecurityAlertPolicyUseServerDefaultEnabled SecurityAlertPolicyUseServerDefault = "Enabled" ) +// PossibleSecurityAlertPolicyUseServerDefaultValues returns an array of possible values for the SecurityAlertPolicyUseServerDefault const type. +func PossibleSecurityAlertPolicyUseServerDefaultValues() [2]SecurityAlertPolicyUseServerDefault { + return [2]SecurityAlertPolicyUseServerDefault{SecurityAlertPolicyUseServerDefaultDisabled, SecurityAlertPolicyUseServerDefaultEnabled} +} + // ServerConnectionType enumerates the values for server connection type. type ServerConnectionType string @@ -545,6 +740,11 @@ const ( ServerConnectionTypeRedirect ServerConnectionType = "Redirect" ) +// PossibleServerConnectionTypeValues returns an array of possible values for the ServerConnectionType const type. +func PossibleServerConnectionTypeValues() [3]ServerConnectionType { + return [3]ServerConnectionType{ServerConnectionTypeDefault, ServerConnectionTypeProxy, ServerConnectionTypeRedirect} +} + // ServerKeyType enumerates the values for server key type. type ServerKeyType string @@ -555,6 +755,11 @@ const ( ServiceManaged ServerKeyType = "ServiceManaged" ) +// PossibleServerKeyTypeValues returns an array of possible values for the ServerKeyType const type. +func PossibleServerKeyTypeValues() [2]ServerKeyType { + return [2]ServerKeyType{AzureKeyVault, ServiceManaged} +} + // ServiceObjectiveName enumerates the values for service objective name. type ServiceObjectiveName string @@ -691,6 +896,11 @@ const ( ServiceObjectiveNameSystem4L ServiceObjectiveName = "System4L" ) +// PossibleServiceObjectiveNameValues returns an array of possible values for the ServiceObjectiveName const type. +func PossibleServiceObjectiveNameValues() [65]ServiceObjectiveName { + return [65]ServiceObjectiveName{ServiceObjectiveNameBasic, ServiceObjectiveNameDS100, ServiceObjectiveNameDS1000, ServiceObjectiveNameDS1200, ServiceObjectiveNameDS1500, ServiceObjectiveNameDS200, ServiceObjectiveNameDS2000, ServiceObjectiveNameDS300, ServiceObjectiveNameDS400, ServiceObjectiveNameDS500, ServiceObjectiveNameDS600, ServiceObjectiveNameDW100, ServiceObjectiveNameDW1000, ServiceObjectiveNameDW10000c, ServiceObjectiveNameDW1000c, ServiceObjectiveNameDW1200, ServiceObjectiveNameDW1500, ServiceObjectiveNameDW15000c, ServiceObjectiveNameDW1500c, ServiceObjectiveNameDW200, ServiceObjectiveNameDW2000, ServiceObjectiveNameDW2000c, ServiceObjectiveNameDW2500c, ServiceObjectiveNameDW300, ServiceObjectiveNameDW3000, ServiceObjectiveNameDW30000c, ServiceObjectiveNameDW3000c, ServiceObjectiveNameDW400, ServiceObjectiveNameDW500, ServiceObjectiveNameDW5000c, ServiceObjectiveNameDW600, ServiceObjectiveNameDW6000, ServiceObjectiveNameDW6000c, ServiceObjectiveNameDW7500c, ServiceObjectiveNameElasticPool, ServiceObjectiveNameFree, ServiceObjectiveNameP1, ServiceObjectiveNameP11, ServiceObjectiveNameP15, ServiceObjectiveNameP2, ServiceObjectiveNameP3, ServiceObjectiveNameP4, ServiceObjectiveNameP6, ServiceObjectiveNamePRS1, ServiceObjectiveNamePRS2, ServiceObjectiveNamePRS4, ServiceObjectiveNamePRS6, ServiceObjectiveNameS0, ServiceObjectiveNameS1, ServiceObjectiveNameS12, ServiceObjectiveNameS2, ServiceObjectiveNameS3, ServiceObjectiveNameS4, ServiceObjectiveNameS6, ServiceObjectiveNameS7, ServiceObjectiveNameS9, ServiceObjectiveNameSystem, ServiceObjectiveNameSystem0, ServiceObjectiveNameSystem1, ServiceObjectiveNameSystem2, ServiceObjectiveNameSystem2L, ServiceObjectiveNameSystem3, ServiceObjectiveNameSystem3L, ServiceObjectiveNameSystem4, ServiceObjectiveNameSystem4L} +} + // StorageKeyType enumerates the values for storage key type. type StorageKeyType string @@ -701,6 +911,11 @@ const ( StorageAccessKey StorageKeyType = "StorageAccessKey" ) +// PossibleStorageKeyTypeValues returns an array of possible values for the StorageKeyType const type. +func PossibleStorageKeyTypeValues() [2]StorageKeyType { + return [2]StorageKeyType{SharedAccessKey, StorageAccessKey} +} + // SyncAgentState enumerates the values for sync agent state. type SyncAgentState string @@ -713,6 +928,11 @@ const ( Online SyncAgentState = "Online" ) +// PossibleSyncAgentStateValues returns an array of possible values for the SyncAgentState const type. +func PossibleSyncAgentStateValues() [3]SyncAgentState { + return [3]SyncAgentState{NeverConnected, Offline, Online} +} + // SyncConflictResolutionPolicy enumerates the values for sync conflict resolution policy. type SyncConflictResolutionPolicy string @@ -723,6 +943,11 @@ const ( MemberWin SyncConflictResolutionPolicy = "MemberWin" ) +// PossibleSyncConflictResolutionPolicyValues returns an array of possible values for the SyncConflictResolutionPolicy const type. +func PossibleSyncConflictResolutionPolicyValues() [2]SyncConflictResolutionPolicy { + return [2]SyncConflictResolutionPolicy{HubWin, MemberWin} +} + // SyncDirection enumerates the values for sync direction. type SyncDirection string @@ -735,6 +960,11 @@ const ( OneWayMemberToHub SyncDirection = "OneWayMemberToHub" ) +// PossibleSyncDirectionValues returns an array of possible values for the SyncDirection const type. +func PossibleSyncDirectionValues() [3]SyncDirection { + return [3]SyncDirection{Bidirectional, OneWayHubToMember, OneWayMemberToHub} +} + // SyncGroupLogType enumerates the values for sync group log type. type SyncGroupLogType string @@ -749,6 +979,11 @@ const ( Warning SyncGroupLogType = "Warning" ) +// PossibleSyncGroupLogTypeValues returns an array of possible values for the SyncGroupLogType const type. +func PossibleSyncGroupLogTypeValues() [4]SyncGroupLogType { + return [4]SyncGroupLogType{All, Error, Success, Warning} +} + // SyncGroupState enumerates the values for sync group state. type SyncGroupState string @@ -765,6 +1000,11 @@ const ( SyncGroupStateWarning SyncGroupState = "Warning" ) +// PossibleSyncGroupStateValues returns an array of possible values for the SyncGroupState const type. +func PossibleSyncGroupStateValues() [5]SyncGroupState { + return [5]SyncGroupState{SyncGroupStateError, SyncGroupStateGood, SyncGroupStateNotReady, SyncGroupStateProgressing, SyncGroupStateWarning} +} + // SyncMemberDbType enumerates the values for sync member db type. type SyncMemberDbType string @@ -775,6 +1015,11 @@ const ( SQLServerDatabase SyncMemberDbType = "SqlServerDatabase" ) +// PossibleSyncMemberDbTypeValues returns an array of possible values for the SyncMemberDbType const type. +func PossibleSyncMemberDbTypeValues() [2]SyncMemberDbType { + return [2]SyncMemberDbType{AzureSQLDatabase, SQLServerDatabase} +} + // SyncMemberState enumerates the values for sync member state. type SyncMemberState string @@ -817,6 +1062,11 @@ const ( UnReprovisioned SyncMemberState = "UnReprovisioned" ) +// PossibleSyncMemberStateValues returns an array of possible values for the SyncMemberState const type. +func PossibleSyncMemberStateValues() [18]SyncMemberState { + return [18]SyncMemberState{DeProvisioned, DeProvisionFailed, DeProvisioning, DisabledBackupRestore, DisabledTombstoneCleanup, Provisioned, ProvisionFailed, Provisioning, ReprovisionFailed, Reprovisioning, SyncCancelled, SyncCancelling, SyncFailed, SyncInProgress, SyncSucceeded, SyncSucceededWithWarnings, UnProvisioned, UnReprovisioned} +} + // TransparentDataEncryptionActivityStatus enumerates the values for transparent data encryption activity // status. type TransparentDataEncryptionActivityStatus string @@ -828,6 +1078,11 @@ const ( Encrypting TransparentDataEncryptionActivityStatus = "Encrypting" ) +// PossibleTransparentDataEncryptionActivityStatusValues returns an array of possible values for the TransparentDataEncryptionActivityStatus const type. +func PossibleTransparentDataEncryptionActivityStatusValues() [2]TransparentDataEncryptionActivityStatus { + return [2]TransparentDataEncryptionActivityStatus{Decrypting, Encrypting} +} + // TransparentDataEncryptionStatus enumerates the values for transparent data encryption status. type TransparentDataEncryptionStatus string @@ -838,6 +1093,11 @@ const ( TransparentDataEncryptionStatusEnabled TransparentDataEncryptionStatus = "Enabled" ) +// PossibleTransparentDataEncryptionStatusValues returns an array of possible values for the TransparentDataEncryptionStatus const type. +func PossibleTransparentDataEncryptionStatusValues() [2]TransparentDataEncryptionStatus { + return [2]TransparentDataEncryptionStatus{TransparentDataEncryptionStatusDisabled, TransparentDataEncryptionStatusEnabled} +} + // UnitDefinitionType enumerates the values for unit definition type. type UnitDefinitionType string @@ -856,6 +1116,11 @@ const ( UnitDefinitionTypeSeconds UnitDefinitionType = "Seconds" ) +// PossibleUnitDefinitionTypeValues returns an array of possible values for the UnitDefinitionType const type. +func PossibleUnitDefinitionTypeValues() [6]UnitDefinitionType { + return [6]UnitDefinitionType{UnitDefinitionTypeBytes, UnitDefinitionTypeBytesPerSecond, UnitDefinitionTypeCount, UnitDefinitionTypeCountPerSecond, UnitDefinitionTypePercent, UnitDefinitionTypeSeconds} +} + // UnitType enumerates the values for unit type. type UnitType string @@ -874,6 +1139,11 @@ const ( UnitTypeSeconds UnitType = "seconds" ) +// PossibleUnitTypeValues returns an array of possible values for the UnitType const type. +func PossibleUnitTypeValues() [6]UnitType { + return [6]UnitType{UnitTypeBytes, UnitTypeBytesPerSecond, UnitTypeCount, UnitTypeCountPerSecond, UnitTypePercent, UnitTypeSeconds} +} + // VirtualNetworkRuleState enumerates the values for virtual network rule state. type VirtualNetworkRuleState string @@ -890,6 +1160,11 @@ const ( VirtualNetworkRuleStateUnknown VirtualNetworkRuleState = "Unknown" ) +// PossibleVirtualNetworkRuleStateValues returns an array of possible values for the VirtualNetworkRuleState const type. +func PossibleVirtualNetworkRuleStateValues() [5]VirtualNetworkRuleState { + return [5]VirtualNetworkRuleState{VirtualNetworkRuleStateDeleting, VirtualNetworkRuleStateInitializing, VirtualNetworkRuleStateInProgress, VirtualNetworkRuleStateReady, VirtualNetworkRuleStateUnknown} +} + // AutomaticTuningOptions automatic tuning properties for individual advisors. type AutomaticTuningOptions struct { // DesiredState - Automatic tuning option desired state. Possible values include: 'AutomaticTuningOptionModeDesiredOff', 'AutomaticTuningOptionModeDesiredOn', 'AutomaticTuningOptionModeDesiredDefault' @@ -1232,13 +1507,6 @@ type CheckNameAvailabilityResponse struct { Reason CheckNameAvailabilityReason `json:"reason,omitempty"` } -// CreateDatabaseRestorePointDefinition contains the information necessary to perform a create database restore -// point operation. -type CreateDatabaseRestorePointDefinition struct { - // RestorePointLabel - The restore point label to apply - RestorePointLabel *string `json:"restorePointLabel,omitempty"` -} - // Database represents a database. type Database struct { autorest.Response `json:"-"` @@ -1737,12 +2005,6 @@ type DatabaseOperationProperties struct { ErrorSeverity *int32 `json:"errorSeverity,omitempty"` // IsUserError - Whether or not the error is a user error. IsUserError *bool `json:"isUserError,omitempty"` - // EstimatedCompletionTime - The estimated completion time of the operation. - EstimatedCompletionTime *date.Time `json:"estimatedCompletionTime,omitempty"` - // Description - The operation description. - Description *string `json:"description,omitempty"` - // IsCancellable - Whether the operation can be cancelled. - IsCancellable *bool `json:"isCancellable,omitempty"` } // DatabaseProperties represents the properties of a database. @@ -2592,6 +2854,78 @@ type DataMaskingRuleProperties struct { ReplacementString *string `json:"replacementString,omitempty"` } +// DataWarehouseUserActivities user activities of a data warehouse +type DataWarehouseUserActivities struct { + autorest.Response `json:"-"` + // DataWarehouseUserActivitiesProperties - Resource properties. + *DataWarehouseUserActivitiesProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DataWarehouseUserActivities struct. +func (dwua *DataWarehouseUserActivities) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dataWarehouseUserActivitiesProperties DataWarehouseUserActivitiesProperties + err = json.Unmarshal(*v, &dataWarehouseUserActivitiesProperties) + if err != nil { + return err + } + dwua.DataWarehouseUserActivitiesProperties = &dataWarehouseUserActivitiesProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dwua.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dwua.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dwua.Type = &typeVar + } + } + } + + return nil +} + +// DataWarehouseUserActivitiesProperties user activities of a data warehouse. This currently includes the count of +// running or suspended queries. For more information, please view the sys.dm_pdw_exec_requests dynamic management +// view (DMV). +type DataWarehouseUserActivitiesProperties struct { + // ActiveQueriesCount - Count of running and suspended queries. + ActiveQueriesCount *int32 `json:"activeQueriesCount,omitempty"` +} + // EditionCapability the database edition capabilities. type EditionCapability struct { // Name - The edition name. @@ -5332,12 +5666,9 @@ type RestorableDroppedDatabaseProperties struct { EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` } -// RestorePoint database restore points. +// RestorePoint a database restore point. type RestorePoint struct { - autorest.Response `json:"-"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // RestorePointProperties - Resource properties. + // RestorePointProperties - The properties of the restore point. *RestorePointProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` @@ -5356,15 +5687,6 @@ 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 - } - rp.Location = &location - } case "properties": if v != nil { var restorePointProperties RestorePointProperties @@ -5407,73 +5729,21 @@ func (rp *RestorePoint) UnmarshalJSON(body []byte) error { return nil } -// RestorePointListResult a list of long term retention bacukps. +// RestorePointListResult the response to a list database restore points request. type RestorePointListResult struct { autorest.Response `json:"-"` - // Value - Array of results. + // Value - The list of database restore points. Value *[]RestorePoint `json:"value,omitempty"` - // NextLink - Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` } -// RestorePointProperties properties of a database restore point +// RestorePointProperties represents the properties of a database restore point. type RestorePointProperties struct { - // RestorePointType - The type of restore point. Possible values include: 'CONTINUOUS', 'DISCRETE' + // RestorePointType - The restore point type of the database restore point. Possible values include: 'DISCRETE', 'CONTINUOUS' RestorePointType RestorePointType `json:"restorePointType,omitempty"` - // EarliestRestoreDate - The earliest time to which this database can be restored - EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` - // RestorePointCreationDate - The time the backup was taken + // RestorePointCreationDate - Restore point creation time (ISO8601 format). Populated when restorePointType = CONTINUOUS. Null otherwise. RestorePointCreationDate *date.Time `json:"restorePointCreationDate,omitempty"` - // RestorePointLabel - The label of restore point for backup request by user - RestorePointLabel *string `json:"restorePointLabel,omitempty"` -} - -// RestorePointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type RestorePointsCreateFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future RestorePointsCreateFuture) Result(client RestorePointsClient) (rp RestorePoint, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorePointsCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - return rp, azure.NewAsyncOpIncompleteError("sql.RestorePointsCreateFuture") - } - if future.PollingMethod() == azure.PollingLocation { - rp, err = client.CreateResponder(future.Response()) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorePointsCreateFuture", "Result", future.Response(), "Failure responding to request") - } - return - } - var req *http.Request - var resp *http.Response - if future.PollingURL() != "" { - req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) - if err != nil { - return - } - } else { - req = autorest.ChangeToGet(future.req) - } - resp, err = autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorePointsCreateFuture", "Result", resp, "Failure sending request") - return - } - rp, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorePointsCreateFuture", "Result", resp, "Failure responding to request") - } - return + // EarliestRestoreDate - Earliest restore time (ISO8601 format). Populated when restorePointType = DISCRETE. Null otherwise. + EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` } // Server an Azure SQL Database server. diff --git a/services/sql/mgmt/2017-03-01-preview/sql/restorepoints.go b/services/sql/mgmt/2017-03-01-preview/sql/restorepoints.go index a6166470b443..b76f8b09a4d9 100644 --- a/services/sql/mgmt/2017-03-01-preview/sql/restorepoints.go +++ b/services/sql/mgmt/2017-03-01-preview/sql/restorepoints.go @@ -21,7 +21,6 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -42,160 +41,11 @@ func NewRestorePointsClientWithBaseURI(baseURI string, subscriptionID string) Re return RestorePointsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Create creates a restore point for a data warehouse. -// -// resourceGroupName is 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 is the name of the server. databaseName is the name of -// the database. parameters is the definition for creating the restore point of this database. -func (client RestorePointsClient) Create(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters CreateDatabaseRestorePointDefinition) (result RestorePointsCreateFuture, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.RestorePointLabel", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("sql.RestorePointsClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorePointsClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorePointsClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client RestorePointsClient) CreatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters CreateDatabaseRestorePointDefinition) (*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 = "2017-03-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client RestorePointsClient) CreateSender(req *http.Request) (future RestorePointsCreateFuture, err error) { - sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) - future.Future = azure.NewFuture(req) - future.req = req - _, err = future.Done(sender) - if err != nil { - return - } - err = autorest.Respond(future.Response(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted)) - return -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client RestorePointsClient) CreateResponder(resp *http.Response) (result RestorePoint, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets a restore point. -// -// resourceGroupName is 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 is the name of the server. databaseName is the name of -// the database. restorePointName is the name of the restore point. -func (client RestorePointsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, restorePointName string) (result RestorePoint, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName, restorePointName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorePointsClient", "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.RestorePointsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.RestorePointsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client RestorePointsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, restorePointName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointName": autorest.Encode("path", restorePointName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-03-01-preview" - 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}/restorePoints/{restorePointName}", 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 RestorePointsClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RestorePointsClient) GetResponder(resp *http.Response) (result RestorePoint, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - // ListByDatabase gets a list of database restore points. // // resourceGroupName is 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 is the name of the server. databaseName is the name of -// the database. +// the database to get available restore points. func (client RestorePointsClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result RestorePointListResult, err error) { req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { @@ -227,7 +77,7 @@ func (client RestorePointsClient) ListByDatabasePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01-preview" + const APIVersion = "2014-04-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, }