From f19fd6611f53359d188586caf5247c9ff4d151f8 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 5 Jul 2021 02:57:00 +0000 Subject: [PATCH] CodeGen from PR 14841 in Azure/azure-rest-api-specs add sql tag to readme.go.md (#14841) --- .../mgmt/2015-05-01-preview/sql/CHANGELOG.md | 90 +- .../mgmt/2015-05-01-preview/sql/_meta.json | 2 +- .../sql/mgmt/2015-05-01-preview/sql/enums.go | 58 +- .../sql/mgmt/2015-05-01-preview/sql/models.go | 6 +- .../mgmt/2017-03-01-preview/sql/CHANGELOG.md | 122 +- .../mgmt/2017-03-01-preview/sql/_meta.json | 2 +- .../sql/mgmt/2017-03-01-preview/sql/enums.go | 58 +- .../sql/mgmt/2017-03-01-preview/sql/models.go | 6 +- .../mgmt/2017-10-01-preview/sql/CHANGELOG.md | 28 +- .../mgmt/2017-10-01-preview/sql/_meta.json | 2 +- .../mgmt/2018-06-01-preview/sql/CHANGELOG.md | 48 +- .../mgmt/2018-06-01-preview/sql/_meta.json | 2 +- .../sql/mgmt/2018-06-01-preview/sql/enums.go | 28 +- .../sql/mgmt/2018-06-01-preview/sql/models.go | 4 +- .../preview/sql/mgmt/v3.0/sql/CHANGELOG.md | 234 ++- services/preview/sql/mgmt/v3.0/sql/_meta.json | 2 +- services/preview/sql/mgmt/v3.0/sql/enums.go | 108 +- .../v3.0/sql/manageddatabaserestoredetails.go | 122 -- .../sql/mgmt/v3.0/sql/manageddatabases.go | 73 +- .../sql/mgmt/v3.0/sql/managedinstances.go | 163 ++- services/preview/sql/mgmt/v3.0/sql/models.go | 434 ++++-- .../v3.0/sql/privateendpointconnections.go | 8 +- .../sql/mgmt/v3.0/sql/sqlapi/interfaces.go | 67 +- .../preview/sql/mgmt/v4.0/sql/CHANGELOG.md | 457 ++++-- services/preview/sql/mgmt/v4.0/sql/_meta.json | 2 +- .../preview/sql/mgmt/v4.0/sql/databases.go | 24 +- services/preview/sql/mgmt/v4.0/sql/enums.go | 196 ++- .../mgmt/v4.0/sql/longtermretentionbackups.go | 402 +++++- ...longtermretentionmanagedinstancebackups.go | 36 +- ...licies.go => longtermretentionpolicies.go} | 126 +- services/preview/sql/mgmt/v4.0/sql/models.go | 1249 ++++++++++++----- .../v4.0/sql/privateendpointconnections.go | 8 +- .../sql/mgmt/v4.0/sql/sqlapi/interfaces.go | 113 +- .../preview/sql/mgmt/v5.0/sql/CHANGELOG.md | 2 +- services/preview/sql/mgmt/v5.0/sql/_meta.json | 2 +- services/sql/mgmt/2014-04-01/sql/CHANGELOG.md | 43 +- services/sql/mgmt/2014-04-01/sql/_meta.json | 2 +- 37 files changed, 2782 insertions(+), 1547 deletions(-) delete mode 100644 services/preview/sql/mgmt/v3.0/sql/manageddatabaserestoredetails.go rename services/preview/sql/mgmt/v4.0/sql/{backuplongtermretentionpolicies.go => longtermretentionpolicies.go} (53%) diff --git a/services/preview/sql/mgmt/2015-05-01-preview/sql/CHANGELOG.md b/services/preview/sql/mgmt/2015-05-01-preview/sql/CHANGELOG.md index c052b188e5fa..ae22fa7d6943 100644 --- a/services/preview/sql/mgmt/2015-05-01-preview/sql/CHANGELOG.md +++ b/services/preview/sql/mgmt/2015-05-01-preview/sql/CHANGELOG.md @@ -1,56 +1,40 @@ -# Change History +# Unreleased + +## Breaking Changes + +### Removed Constants + +1. PrimaryAggregationType.Average +1. PrimaryAggregationType.Maximum +1. PrimaryAggregationType.Minimum +1. PrimaryAggregationType.Total +1. UnitDefinitionType.UnitDefinitionTypeBytes +1. UnitDefinitionType.UnitDefinitionTypeBytesPerSecond +1. UnitDefinitionType.UnitDefinitionTypeCount +1. UnitDefinitionType.UnitDefinitionTypeCountPerSecond +1. UnitDefinitionType.UnitDefinitionTypePercent +1. UnitDefinitionType.UnitDefinitionTypeSeconds + +### Signature Changes + +#### Const Types + +1. Count changed type from PrimaryAggregationType to UnitDefinitionType +1. None changed type from PrimaryAggregationType to IdentityType ## Additive Changes -### New Funcs - -1. CheckNameAvailabilityResponse.MarshalJSON() ([]byte, error) -1. DatabaseBlobAuditingPolicyListResult.MarshalJSON() ([]byte, error) -1. DatabaseUsage.MarshalJSON() ([]byte, error) -1. ElasticPoolActivityProperties.MarshalJSON() ([]byte, error) -1. ElasticPoolDatabaseActivityProperties.MarshalJSON() ([]byte, error) -1. EncryptionProtectorListResult.MarshalJSON() ([]byte, error) -1. FailoverGroupListResult.MarshalJSON() ([]byte, error) -1. ImportExportResponseProperties.MarshalJSON() ([]byte, error) -1. ManagedInstanceListResult.MarshalJSON() ([]byte, error) -1. Metric.MarshalJSON() ([]byte, error) -1. MetricAvailability.MarshalJSON() ([]byte, error) -1. MetricDefinition.MarshalJSON() ([]byte, error) -1. MetricName.MarshalJSON() ([]byte, error) -1. MetricValue.MarshalJSON() ([]byte, error) -1. OperationDisplay.MarshalJSON() ([]byte, error) -1. OperationImpact.MarshalJSON() ([]byte, error) -1. OperationListResult.MarshalJSON() ([]byte, error) -1. PerformanceLevelCapability.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. RecommendedIndexProperties.MarshalJSON() ([]byte, error) -1. RecoverableDatabaseProperties.MarshalJSON() ([]byte, error) -1. ReplicationLinkProperties.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. RestorableDroppedDatabaseProperties.MarshalJSON() ([]byte, error) -1. RestorePointProperties.MarshalJSON() ([]byte, error) -1. ServerKeyListResult.MarshalJSON() ([]byte, error) -1. ServerListResult.MarshalJSON() ([]byte, error) -1. ServerUsage.MarshalJSON() ([]byte, error) -1. ServiceObjectiveProperties.MarshalJSON() ([]byte, error) -1. ServiceTierAdvisorProperties.MarshalJSON() ([]byte, error) -1. SloUsageMetric.MarshalJSON() ([]byte, error) -1. SubscriptionUsageListResult.MarshalJSON() ([]byte, error) -1. SubscriptionUsageProperties.MarshalJSON() ([]byte, error) -1. SyncAgentKeyProperties.MarshalJSON() ([]byte, error) -1. SyncAgentLinkedDatabaseListResult.MarshalJSON() ([]byte, error) -1. SyncAgentLinkedDatabaseProperties.MarshalJSON() ([]byte, error) -1. SyncAgentListResult.MarshalJSON() ([]byte, error) -1. SyncDatabaseIDListResult.MarshalJSON() ([]byte, error) -1. SyncDatabaseIDProperties.MarshalJSON() ([]byte, error) -1. SyncFullSchemaProperties.MarshalJSON() ([]byte, error) -1. SyncFullSchemaPropertiesListResult.MarshalJSON() ([]byte, error) -1. SyncFullSchemaTable.MarshalJSON() ([]byte, error) -1. SyncFullSchemaTableColumn.MarshalJSON() ([]byte, error) -1. SyncGroupListResult.MarshalJSON() ([]byte, error) -1. SyncGroupLogListResult.MarshalJSON() ([]byte, error) -1. SyncGroupLogProperties.MarshalJSON() ([]byte, error) -1. SyncMemberListResult.MarshalJSON() ([]byte, error) -1. TransparentDataEncryptionActivityProperties.MarshalJSON() ([]byte, error) -1. VirtualClusterListResult.MarshalJSON() ([]byte, error) -1. VirtualNetworkRuleListResult.MarshalJSON() ([]byte, error) +### New Constants + +1. IdentityType.UserAssigned +1. PrimaryAggregationType.PrimaryAggregationTypeAverage +1. PrimaryAggregationType.PrimaryAggregationTypeCount +1. PrimaryAggregationType.PrimaryAggregationTypeMaximum +1. PrimaryAggregationType.PrimaryAggregationTypeMinimum +1. PrimaryAggregationType.PrimaryAggregationTypeNone +1. PrimaryAggregationType.PrimaryAggregationTypeTotal +1. UnitDefinitionType.Bytes +1. UnitDefinitionType.BytesPerSecond +1. UnitDefinitionType.CountPerSecond +1. UnitDefinitionType.Percent +1. UnitDefinitionType.Seconds diff --git a/services/preview/sql/mgmt/2015-05-01-preview/sql/_meta.json b/services/preview/sql/mgmt/2015-05-01-preview/sql/_meta.json index 9b875701c866..ae7e428840eb 100644 --- a/services/preview/sql/mgmt/2015-05-01-preview/sql/_meta.json +++ b/services/preview/sql/mgmt/2015-05-01-preview/sql/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a07f49e3f75a134c1acdacc338c9f9dc32386f66", "readme": "/_/azure-rest-api-specs/specification/sql/resource-manager/readme.md", "tag": "package-2015-05-preview", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/services/preview/sql/mgmt/2015-05-01-preview/sql/enums.go b/services/preview/sql/mgmt/2015-05-01-preview/sql/enums.go index 29373105fbe6..3908be7620a8 100644 --- a/services/preview/sql/mgmt/2015-05-01-preview/sql/enums.go +++ b/services/preview/sql/mgmt/2015-05-01-preview/sql/enums.go @@ -261,13 +261,17 @@ func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState { type IdentityType string const ( + // None ... + None IdentityType = "None" // SystemAssigned ... SystemAssigned IdentityType = "SystemAssigned" + // UserAssigned ... + UserAssigned IdentityType = "UserAssigned" ) // PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. func PossibleIdentityTypeValues() []IdentityType { - return []IdentityType{SystemAssigned} + return []IdentityType{None, SystemAssigned, UserAssigned} } // ManagedInstanceLicenseType enumerates the values for managed instance license type. @@ -368,23 +372,23 @@ func PossiblePerformanceLevelUnitValues() []PerformanceLevelUnit { type PrimaryAggregationType string const ( - // Average ... - Average PrimaryAggregationType = "Average" - // Count ... - Count PrimaryAggregationType = "Count" - // Maximum ... - Maximum PrimaryAggregationType = "Maximum" - // Minimum ... - Minimum PrimaryAggregationType = "Minimum" - // None ... - None PrimaryAggregationType = "None" - // Total ... - Total PrimaryAggregationType = "Total" + // 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{Average, Count, Maximum, Minimum, None, Total} + return []PrimaryAggregationType{PrimaryAggregationTypeAverage, PrimaryAggregationTypeCount, PrimaryAggregationTypeMaximum, PrimaryAggregationTypeMinimum, PrimaryAggregationTypeNone, PrimaryAggregationTypeTotal} } // ReadOnlyEndpointFailoverPolicy enumerates the values for read only endpoint failover policy. @@ -990,23 +994,23 @@ func PossibleTransparentDataEncryptionStatusValues() []TransparentDataEncryption type UnitDefinitionType string const ( - // UnitDefinitionTypeBytes ... - UnitDefinitionTypeBytes UnitDefinitionType = "Bytes" - // UnitDefinitionTypeBytesPerSecond ... - UnitDefinitionTypeBytesPerSecond UnitDefinitionType = "BytesPerSecond" - // UnitDefinitionTypeCount ... - UnitDefinitionTypeCount UnitDefinitionType = "Count" - // UnitDefinitionTypeCountPerSecond ... - UnitDefinitionTypeCountPerSecond UnitDefinitionType = "CountPerSecond" - // UnitDefinitionTypePercent ... - UnitDefinitionTypePercent UnitDefinitionType = "Percent" - // UnitDefinitionTypeSeconds ... - UnitDefinitionTypeSeconds UnitDefinitionType = "Seconds" + // 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{UnitDefinitionTypeBytes, UnitDefinitionTypeBytesPerSecond, UnitDefinitionTypeCount, UnitDefinitionTypeCountPerSecond, UnitDefinitionTypePercent, UnitDefinitionTypeSeconds} + return []UnitDefinitionType{Bytes, BytesPerSecond, Count, CountPerSecond, Percent, Seconds} } // UnitType enumerates the values for unit type. diff --git a/services/preview/sql/mgmt/2015-05-01-preview/sql/models.go b/services/preview/sql/mgmt/2015-05-01-preview/sql/models.go index ea49f3695935..0b2c25aad15f 100644 --- a/services/preview/sql/mgmt/2015-05-01-preview/sql/models.go +++ b/services/preview/sql/mgmt/2015-05-01-preview/sql/models.go @@ -4276,11 +4276,11 @@ func (ma MetricAvailability) MarshalJSON() ([]byte, error) { 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: 'None', 'Average', 'Count', 'Minimum', 'Maximum', 'Total' + // 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: 'UnitDefinitionTypeCount', 'UnitDefinitionTypeBytes', 'UnitDefinitionTypeSeconds', 'UnitDefinitionTypePercent', 'UnitDefinitionTypeCountPerSecond', 'UnitDefinitionTypeBytesPerSecond' + // 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"` @@ -5063,7 +5063,7 @@ func (r Resource) MarshalJSON() ([]byte, error) { type ResourceIdentity struct { // PrincipalID - READ-ONLY; The Azure Active Directory principal id. PrincipalID *uuid.UUID `json:"principalId,omitempty"` - // Type - The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. Possible values include: 'SystemAssigned' + // Type - The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. Possible values include: 'None', 'SystemAssigned', 'UserAssigned' Type IdentityType `json:"type,omitempty"` // TenantID - READ-ONLY; The Azure Active Directory tenant id. TenantID *uuid.UUID `json:"tenantId,omitempty"` diff --git a/services/preview/sql/mgmt/2017-03-01-preview/sql/CHANGELOG.md b/services/preview/sql/mgmt/2017-03-01-preview/sql/CHANGELOG.md index 226948edeb15..ae22fa7d6943 100644 --- a/services/preview/sql/mgmt/2017-03-01-preview/sql/CHANGELOG.md +++ b/services/preview/sql/mgmt/2017-03-01-preview/sql/CHANGELOG.md @@ -1,90 +1,40 @@ -# Change History +# Unreleased + +## Breaking Changes + +### Removed Constants + +1. PrimaryAggregationType.Average +1. PrimaryAggregationType.Maximum +1. PrimaryAggregationType.Minimum +1. PrimaryAggregationType.Total +1. UnitDefinitionType.UnitDefinitionTypeBytes +1. UnitDefinitionType.UnitDefinitionTypeBytesPerSecond +1. UnitDefinitionType.UnitDefinitionTypeCount +1. UnitDefinitionType.UnitDefinitionTypeCountPerSecond +1. UnitDefinitionType.UnitDefinitionTypePercent +1. UnitDefinitionType.UnitDefinitionTypeSeconds + +### Signature Changes + +#### Const Types + +1. Count changed type from PrimaryAggregationType to UnitDefinitionType +1. None changed type from PrimaryAggregationType to IdentityType ## Additive Changes -### New Funcs +### New Constants -1. CheckNameAvailabilityResponse.MarshalJSON() ([]byte, error) -1. DataWarehouseUserActivitiesProperties.MarshalJSON() ([]byte, error) -1. DatabaseBlobAuditingPolicyListResult.MarshalJSON() ([]byte, error) -1. DatabaseOperationListResult.MarshalJSON() ([]byte, error) -1. DatabaseOperationProperties.MarshalJSON() ([]byte, error) -1. DatabaseUsage.MarshalJSON() ([]byte, error) -1. DatabaseVulnerabilityAssessmentListResult.MarshalJSON() ([]byte, error) -1. EditionCapability.MarshalJSON() ([]byte, error) -1. ElasticPoolActivityProperties.MarshalJSON() ([]byte, error) -1. ElasticPoolDatabaseActivityProperties.MarshalJSON() ([]byte, error) -1. ElasticPoolDtuCapability.MarshalJSON() ([]byte, error) -1. ElasticPoolEditionCapability.MarshalJSON() ([]byte, error) -1. ElasticPoolPerDatabaseMaxDtuCapability.MarshalJSON() ([]byte, error) -1. ElasticPoolPerDatabaseMinDtuCapability.MarshalJSON() ([]byte, error) -1. EncryptionProtectorListResult.MarshalJSON() ([]byte, error) -1. ExtendedDatabaseBlobAuditingPolicyListResult.MarshalJSON() ([]byte, error) -1. ExtendedServerBlobAuditingPolicyListResult.MarshalJSON() ([]byte, error) -1. FailoverGroupListResult.MarshalJSON() ([]byte, error) -1. ImportExportResponseProperties.MarshalJSON() ([]byte, error) -1. JobAgentListResult.MarshalJSON() ([]byte, error) -1. JobCredentialListResult.MarshalJSON() ([]byte, error) -1. JobExecutionListResult.MarshalJSON() ([]byte, error) -1. JobExecutionTarget.MarshalJSON() ([]byte, error) -1. JobListResult.MarshalJSON() ([]byte, error) -1. JobStepListResult.MarshalJSON() ([]byte, error) -1. JobTargetGroupListResult.MarshalJSON() ([]byte, error) -1. JobVersion.MarshalJSON() ([]byte, error) -1. JobVersionListResult.MarshalJSON() ([]byte, error) -1. LocationCapabilities.MarshalJSON() ([]byte, error) -1. LogicalServerSecurityAlertPolicyListResult.MarshalJSON() ([]byte, error) -1. ManagedBackupShortTermRetentionPolicyListResult.MarshalJSON() ([]byte, error) -1. ManagedDatabaseListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceAdministratorListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceListResult.MarshalJSON() ([]byte, error) -1. MaxSizeCapability.MarshalJSON() ([]byte, error) -1. Metric.MarshalJSON() ([]byte, error) -1. MetricAvailability.MarshalJSON() ([]byte, error) -1. MetricDefinition.MarshalJSON() ([]byte, error) -1. MetricName.MarshalJSON() ([]byte, error) -1. MetricValue.MarshalJSON() ([]byte, error) -1. OperationDisplay.MarshalJSON() ([]byte, error) -1. OperationImpact.MarshalJSON() ([]byte, error) -1. OperationListResult.MarshalJSON() ([]byte, error) -1. PerformanceLevel.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. RecommendedIndexProperties.MarshalJSON() ([]byte, error) -1. RecoverableDatabaseProperties.MarshalJSON() ([]byte, error) -1. ReplicationLinkProperties.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. RestorableDroppedDatabaseProperties.MarshalJSON() ([]byte, error) -1. RestorableDroppedManagedDatabaseListResult.MarshalJSON() ([]byte, error) -1. RestorableDroppedManagedDatabaseProperties.MarshalJSON() ([]byte, error) -1. RestorePointListResult.MarshalJSON() ([]byte, error) -1. RestorePointProperties.MarshalJSON() ([]byte, error) -1. SensitivityLabelListResult.MarshalJSON() ([]byte, error) -1. ServerBlobAuditingPolicyListResult.MarshalJSON() ([]byte, error) -1. ServerDNSAliasListResult.MarshalJSON() ([]byte, error) -1. ServerDNSAliasProperties.MarshalJSON() ([]byte, error) -1. ServerKeyListResult.MarshalJSON() ([]byte, error) -1. ServerListResult.MarshalJSON() ([]byte, error) -1. ServerUsage.MarshalJSON() ([]byte, error) -1. ServerVersionCapability.MarshalJSON() ([]byte, error) -1. ServiceObjectiveProperties.MarshalJSON() ([]byte, error) -1. ServiceTierAdvisorProperties.MarshalJSON() ([]byte, error) -1. SloUsageMetric.MarshalJSON() ([]byte, error) -1. SubscriptionUsageListResult.MarshalJSON() ([]byte, error) -1. SubscriptionUsageProperties.MarshalJSON() ([]byte, error) -1. SyncAgentKeyProperties.MarshalJSON() ([]byte, error) -1. SyncAgentLinkedDatabaseListResult.MarshalJSON() ([]byte, error) -1. SyncAgentLinkedDatabaseProperties.MarshalJSON() ([]byte, error) -1. SyncAgentListResult.MarshalJSON() ([]byte, error) -1. SyncDatabaseIDListResult.MarshalJSON() ([]byte, error) -1. SyncDatabaseIDProperties.MarshalJSON() ([]byte, error) -1. SyncFullSchemaProperties.MarshalJSON() ([]byte, error) -1. SyncFullSchemaPropertiesListResult.MarshalJSON() ([]byte, error) -1. SyncFullSchemaTable.MarshalJSON() ([]byte, error) -1. SyncFullSchemaTableColumn.MarshalJSON() ([]byte, error) -1. SyncGroupListResult.MarshalJSON() ([]byte, error) -1. SyncGroupLogListResult.MarshalJSON() ([]byte, error) -1. SyncGroupLogProperties.MarshalJSON() ([]byte, error) -1. SyncMemberListResult.MarshalJSON() ([]byte, error) -1. TransparentDataEncryptionActivityProperties.MarshalJSON() ([]byte, error) -1. VirtualClusterListResult.MarshalJSON() ([]byte, error) -1. VirtualNetworkRuleListResult.MarshalJSON() ([]byte, error) +1. IdentityType.UserAssigned +1. PrimaryAggregationType.PrimaryAggregationTypeAverage +1. PrimaryAggregationType.PrimaryAggregationTypeCount +1. PrimaryAggregationType.PrimaryAggregationTypeMaximum +1. PrimaryAggregationType.PrimaryAggregationTypeMinimum +1. PrimaryAggregationType.PrimaryAggregationTypeNone +1. PrimaryAggregationType.PrimaryAggregationTypeTotal +1. UnitDefinitionType.Bytes +1. UnitDefinitionType.BytesPerSecond +1. UnitDefinitionType.CountPerSecond +1. UnitDefinitionType.Percent +1. UnitDefinitionType.Seconds diff --git a/services/preview/sql/mgmt/2017-03-01-preview/sql/_meta.json b/services/preview/sql/mgmt/2017-03-01-preview/sql/_meta.json index 43c7e6fa1ac6..a32e52de723a 100644 --- a/services/preview/sql/mgmt/2017-03-01-preview/sql/_meta.json +++ b/services/preview/sql/mgmt/2017-03-01-preview/sql/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a07f49e3f75a134c1acdacc338c9f9dc32386f66", "readme": "/_/azure-rest-api-specs/specification/sql/resource-manager/readme.md", "tag": "package-2017-03-preview", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/services/preview/sql/mgmt/2017-03-01-preview/sql/enums.go b/services/preview/sql/mgmt/2017-03-01-preview/sql/enums.go index 1336aa4ac58f..73ecf38f66f5 100644 --- a/services/preview/sql/mgmt/2017-03-01-preview/sql/enums.go +++ b/services/preview/sql/mgmt/2017-03-01-preview/sql/enums.go @@ -386,13 +386,17 @@ func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState { type IdentityType string const ( + // None ... + None IdentityType = "None" // SystemAssigned ... SystemAssigned IdentityType = "SystemAssigned" + // UserAssigned ... + UserAssigned IdentityType = "UserAssigned" ) // PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. func PossibleIdentityTypeValues() []IdentityType { - return []IdentityType{SystemAssigned} + return []IdentityType{None, SystemAssigned, UserAssigned} } // JobAgentState enumerates the values for job agent state. @@ -704,23 +708,23 @@ func PossiblePerformanceLevelUnitValues() []PerformanceLevelUnit { type PrimaryAggregationType string const ( - // Average ... - Average PrimaryAggregationType = "Average" - // Count ... - Count PrimaryAggregationType = "Count" - // Maximum ... - Maximum PrimaryAggregationType = "Maximum" - // Minimum ... - Minimum PrimaryAggregationType = "Minimum" - // None ... - None PrimaryAggregationType = "None" - // Total ... - Total PrimaryAggregationType = "Total" + // 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{Average, Count, Maximum, Minimum, None, Total} + return []PrimaryAggregationType{PrimaryAggregationTypeAverage, PrimaryAggregationTypeCount, PrimaryAggregationTypeMaximum, PrimaryAggregationTypeMinimum, PrimaryAggregationTypeNone, PrimaryAggregationTypeTotal} } // ProvisioningState enumerates the values for provisioning state. @@ -1383,23 +1387,23 @@ func PossibleTransparentDataEncryptionStatusValues() []TransparentDataEncryption type UnitDefinitionType string const ( - // UnitDefinitionTypeBytes ... - UnitDefinitionTypeBytes UnitDefinitionType = "Bytes" - // UnitDefinitionTypeBytesPerSecond ... - UnitDefinitionTypeBytesPerSecond UnitDefinitionType = "BytesPerSecond" - // UnitDefinitionTypeCount ... - UnitDefinitionTypeCount UnitDefinitionType = "Count" - // UnitDefinitionTypeCountPerSecond ... - UnitDefinitionTypeCountPerSecond UnitDefinitionType = "CountPerSecond" - // UnitDefinitionTypePercent ... - UnitDefinitionTypePercent UnitDefinitionType = "Percent" - // UnitDefinitionTypeSeconds ... - UnitDefinitionTypeSeconds UnitDefinitionType = "Seconds" + // 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{UnitDefinitionTypeBytes, UnitDefinitionTypeBytesPerSecond, UnitDefinitionTypeCount, UnitDefinitionTypeCountPerSecond, UnitDefinitionTypePercent, UnitDefinitionTypeSeconds} + return []UnitDefinitionType{Bytes, BytesPerSecond, Count, CountPerSecond, Percent, Seconds} } // UnitType enumerates the values for unit type. diff --git a/services/preview/sql/mgmt/2017-03-01-preview/sql/models.go b/services/preview/sql/mgmt/2017-03-01-preview/sql/models.go index 4ff6cc74ad75..24f538be82fa 100644 --- a/services/preview/sql/mgmt/2017-03-01-preview/sql/models.go +++ b/services/preview/sql/mgmt/2017-03-01-preview/sql/models.go @@ -9288,11 +9288,11 @@ func (ma MetricAvailability) MarshalJSON() ([]byte, error) { 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: 'None', 'Average', 'Count', 'Minimum', 'Maximum', 'Total' + // 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: 'UnitDefinitionTypeCount', 'UnitDefinitionTypeBytes', 'UnitDefinitionTypeSeconds', 'UnitDefinitionTypePercent', 'UnitDefinitionTypeCountPerSecond', 'UnitDefinitionTypeBytesPerSecond' + // 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"` @@ -10075,7 +10075,7 @@ func (r Resource) MarshalJSON() ([]byte, error) { type ResourceIdentity struct { // PrincipalID - READ-ONLY; The Azure Active Directory principal id. PrincipalID *uuid.UUID `json:"principalId,omitempty"` - // Type - The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. Possible values include: 'SystemAssigned' + // Type - The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. Possible values include: 'None', 'SystemAssigned', 'UserAssigned' Type IdentityType `json:"type,omitempty"` // TenantID - READ-ONLY; The Azure Active Directory tenant id. TenantID *uuid.UUID `json:"tenantId,omitempty"` diff --git a/services/preview/sql/mgmt/2017-10-01-preview/sql/CHANGELOG.md b/services/preview/sql/mgmt/2017-10-01-preview/sql/CHANGELOG.md index d428d5758b07..a1ecf841edb0 100644 --- a/services/preview/sql/mgmt/2017-10-01-preview/sql/CHANGELOG.md +++ b/services/preview/sql/mgmt/2017-10-01-preview/sql/CHANGELOG.md @@ -1,28 +1,2 @@ -# Change History +# Unreleased -## Additive Changes - -### New Funcs - -1. BackupShortTermRetentionPolicyListResult.MarshalJSON() ([]byte, error) -1. DatabaseListResult.MarshalJSON() ([]byte, error) -1. DatabaseOperationListResult.MarshalJSON() ([]byte, error) -1. DatabaseOperationProperties.MarshalJSON() ([]byte, error) -1. DatabaseVulnerabilityAssessmentListResult.MarshalJSON() ([]byte, error) -1. DatabaseVulnerabilityAssessmentScanExportProperties.MarshalJSON() ([]byte, error) -1. ElasticPoolListResult.MarshalJSON() ([]byte, error) -1. ElasticPoolOperationListResult.MarshalJSON() ([]byte, error) -1. ElasticPoolOperationProperties.MarshalJSON() ([]byte, error) -1. InstanceFailoverGroupListResult.MarshalJSON() ([]byte, error) -1. LogSizeCapability.MarshalJSON() ([]byte, error) -1. ManagedInstanceEncryptionProtectorListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceKeyListResult.MarshalJSON() ([]byte, error) -1. MaxSizeCapability.MarshalJSON() ([]byte, error) -1. PerformanceLevelCapability.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. RecoverableManagedDatabaseListResult.MarshalJSON() ([]byte, error) -1. RecoverableManagedDatabaseProperties.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. VulnerabilityAssessmentScanError.MarshalJSON() ([]byte, error) -1. VulnerabilityAssessmentScanRecordListResult.MarshalJSON() ([]byte, error) -1. VulnerabilityAssessmentScanRecordProperties.MarshalJSON() ([]byte, error) diff --git a/services/preview/sql/mgmt/2017-10-01-preview/sql/_meta.json b/services/preview/sql/mgmt/2017-10-01-preview/sql/_meta.json index 40f44aa10223..a1501c508d22 100644 --- a/services/preview/sql/mgmt/2017-10-01-preview/sql/_meta.json +++ b/services/preview/sql/mgmt/2017-10-01-preview/sql/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a07f49e3f75a134c1acdacc338c9f9dc32386f66", "readme": "/_/azure-rest-api-specs/specification/sql/resource-manager/readme.md", "tag": "package-pure-2017-10-preview", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/CHANGELOG.md b/services/preview/sql/mgmt/2018-06-01-preview/sql/CHANGELOG.md index 1a04eff0df34..2514847f8f2b 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/CHANGELOG.md +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/CHANGELOG.md @@ -1,27 +1,27 @@ -# Change History +# Unreleased + +## Breaking Changes + +### Removed Constants + +1. SensitivityLabelRank.Critical +1. SensitivityLabelRank.High +1. SensitivityLabelRank.Low +1. SensitivityLabelRank.Medium + +### Signature Changes + +#### Const Types + +1. None changed type from SensitivityLabelRank to IdentityType ## Additive Changes -### New Funcs - -1. AdministratorListResult.MarshalJSON() ([]byte, error) -1. DatabaseSecurityAlertListResult.MarshalJSON() ([]byte, error) -1. InstancePoolListResult.MarshalJSON() ([]byte, error) -1. ManagedDatabaseListResult.MarshalJSON() ([]byte, error) -1. ManagedDatabaseRestoreDetailsProperties.MarshalJSON() ([]byte, error) -1. ManagedInstanceListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceLongTermRetentionBackupListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceLongTermRetentionBackupProperties.MarshalJSON() ([]byte, error) -1. ManagedInstanceLongTermRetentionPolicyListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceOperationListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceOperationParametersPair.MarshalJSON() ([]byte, error) -1. ManagedInstanceOperationProperties.MarshalJSON() ([]byte, error) -1. ManagedInstanceOperationSteps.MarshalJSON() ([]byte, error) -1. ManagedInstanceVulnerabilityAssessmentListResult.MarshalJSON() ([]byte, error) -1. PrivateEndpointConnectionListResult.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. SensitivityLabelListResult.MarshalJSON() ([]byte, error) -1. ServerVulnerabilityAssessmentListResult.MarshalJSON() ([]byte, error) -1. Usage.MarshalJSON() ([]byte, error) -1. UsageListResult.MarshalJSON() ([]byte, error) +### New Constants + +1. IdentityType.UserAssigned +1. SensitivityLabelRank.SensitivityLabelRankCritical +1. SensitivityLabelRank.SensitivityLabelRankHigh +1. SensitivityLabelRank.SensitivityLabelRankLow +1. SensitivityLabelRank.SensitivityLabelRankMedium +1. SensitivityLabelRank.SensitivityLabelRankNone diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/_meta.json b/services/preview/sql/mgmt/2018-06-01-preview/sql/_meta.json index 9ea533094426..ca4f371e11b0 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/_meta.json +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a07f49e3f75a134c1acdacc338c9f9dc32386f66", "readme": "/_/azure-rest-api-specs/specification/sql/resource-manager/readme.md", "tag": "package-pure-2018-06-preview", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/enums.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/enums.go index 1202e51a3fa1..37e7ba62d9a4 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/enums.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/enums.go @@ -42,13 +42,17 @@ func PossibleDatabaseStateValues() []DatabaseState { type IdentityType string const ( + // None ... + None IdentityType = "None" // SystemAssigned ... SystemAssigned IdentityType = "SystemAssigned" + // UserAssigned ... + UserAssigned IdentityType = "UserAssigned" ) // PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. func PossibleIdentityTypeValues() []IdentityType { - return []IdentityType{SystemAssigned} + return []IdentityType{None, SystemAssigned, UserAssigned} } // InstancePoolLicenseType enumerates the values for instance pool license type. @@ -218,21 +222,21 @@ func PossibleSecurityAlertPolicyStateValues() []SecurityAlertPolicyState { type SensitivityLabelRank string const ( - // Critical ... - Critical SensitivityLabelRank = "Critical" - // High ... - High SensitivityLabelRank = "High" - // Low ... - Low SensitivityLabelRank = "Low" - // Medium ... - Medium SensitivityLabelRank = "Medium" - // None ... - None SensitivityLabelRank = "None" + // SensitivityLabelRankCritical ... + SensitivityLabelRankCritical SensitivityLabelRank = "Critical" + // SensitivityLabelRankHigh ... + SensitivityLabelRankHigh SensitivityLabelRank = "High" + // SensitivityLabelRankLow ... + SensitivityLabelRankLow SensitivityLabelRank = "Low" + // SensitivityLabelRankMedium ... + SensitivityLabelRankMedium SensitivityLabelRank = "Medium" + // SensitivityLabelRankNone ... + SensitivityLabelRankNone SensitivityLabelRank = "None" ) // PossibleSensitivityLabelRankValues returns an array of possible values for the SensitivityLabelRank const type. func PossibleSensitivityLabelRankValues() []SensitivityLabelRank { - return []SensitivityLabelRank{Critical, High, Low, Medium, None} + return []SensitivityLabelRank{SensitivityLabelRankCritical, SensitivityLabelRankHigh, SensitivityLabelRankLow, SensitivityLabelRankMedium, SensitivityLabelRankNone} } // SensitivityLabelSource enumerates the values for sensitivity label source. diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/models.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/models.go index 78b6b544489e..063675b65cd9 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/models.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/models.go @@ -3801,7 +3801,7 @@ func (r Resource) MarshalJSON() ([]byte, error) { type ResourceIdentity struct { // PrincipalID - READ-ONLY; The Azure Active Directory principal id. PrincipalID *uuid.UUID `json:"principalId,omitempty"` - // Type - The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. Possible values include: 'SystemAssigned' + // Type - The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. Possible values include: 'None', 'SystemAssigned', 'UserAssigned' Type IdentityType `json:"type,omitempty"` // TenantID - READ-ONLY; The Azure Active Directory tenant id. TenantID *uuid.UUID `json:"tenantId,omitempty"` @@ -4113,7 +4113,7 @@ type SensitivityLabelProperties struct { InformationTypeID *string `json:"informationTypeId,omitempty"` // IsDisabled - READ-ONLY; Is sensitivity recommendation disabled. Applicable for recommended sensitivity label only. Specifies whether the sensitivity recommendation on this column is disabled (dismissed) or not. IsDisabled *bool `json:"isDisabled,omitempty"` - // Rank - Possible values include: 'None', 'Low', 'Medium', 'High', 'Critical' + // Rank - Possible values include: 'SensitivityLabelRankNone', 'SensitivityLabelRankLow', 'SensitivityLabelRankMedium', 'SensitivityLabelRankHigh', 'SensitivityLabelRankCritical' Rank SensitivityLabelRank `json:"rank,omitempty"` } diff --git a/services/preview/sql/mgmt/v3.0/sql/CHANGELOG.md b/services/preview/sql/mgmt/v3.0/sql/CHANGELOG.md index 3b4f176b3bc5..e7d0ca27dda9 100644 --- a/services/preview/sql/mgmt/v3.0/sql/CHANGELOG.md +++ b/services/preview/sql/mgmt/v3.0/sql/CHANGELOG.md @@ -1,127 +1,117 @@ -# Change History +# Unreleased + +## Breaking Changes + +### Removed Constants + +1. PrimaryAggregationType.Average +1. PrimaryAggregationType.Maximum +1. PrimaryAggregationType.Minimum +1. PrimaryAggregationType.Total + +### Removed Funcs + +1. *ManagedDatabaseRestoreDetailsResult.UnmarshalJSON([]byte) error +1. ManagedDatabaseRestoreDetailsClient.Get(context.Context, string, string, string) (ManagedDatabaseRestoreDetailsResult, error) +1. ManagedDatabaseRestoreDetailsClient.GetPreparer(context.Context, string, string, string) (*http.Request, error) +1. ManagedDatabaseRestoreDetailsClient.GetResponder(*http.Response) (ManagedDatabaseRestoreDetailsResult, error) +1. ManagedDatabaseRestoreDetailsClient.GetSender(*http.Request) (*http.Response, error) +1. ManagedDatabaseRestoreDetailsProperties.MarshalJSON() ([]byte, error) +1. ManagedDatabaseRestoreDetailsResult.MarshalJSON() ([]byte, error) +1. NewManagedDatabaseRestoreDetailsClient(string) ManagedDatabaseRestoreDetailsClient +1. NewManagedDatabaseRestoreDetailsClientWithBaseURI(string, string) ManagedDatabaseRestoreDetailsClient + +### Struct Changes + +#### Removed Structs + +1. ManagedDatabaseRestoreDetailsClient +1. ManagedDatabaseRestoreDetailsProperties +1. ManagedDatabaseRestoreDetailsResult + +### Signature Changes + +#### Const Types + +1. Count changed type from PrimaryAggregationType to QueryMetricUnitType +1. None changed type from PrimaryAggregationType to IdentityType ## Additive Changes +### New Constants + +1. AggregationFunctionType.Avg +1. AggregationFunctionType.Max +1. AggregationFunctionType.Min +1. AggregationFunctionType.Stdev +1. AggregationFunctionType.Sum +1. IdentityType.UserAssigned +1. MetricType.CPU +1. MetricType.Dtu +1. MetricType.Duration +1. MetricType.Io +1. MetricType.LogIo +1. PrimaryAggregationType.PrimaryAggregationTypeAverage +1. PrimaryAggregationType.PrimaryAggregationTypeCount +1. PrimaryAggregationType.PrimaryAggregationTypeMaximum +1. PrimaryAggregationType.PrimaryAggregationTypeMinimum +1. PrimaryAggregationType.PrimaryAggregationTypeNone +1. PrimaryAggregationType.PrimaryAggregationTypeTotal +1. QueryMetricUnitType.KB +1. QueryMetricUnitType.Microseconds +1. QueryMetricUnitType.Percentage +1. QueryTimeGrainType.P1D +1. QueryTimeGrainType.PT1H + ### New Funcs -1. AdministratorListResult.MarshalJSON() ([]byte, error) -1. AutoPauseDelayTimeRange.MarshalJSON() ([]byte, error) -1. AzureADOnlyAuthListResult.MarshalJSON() ([]byte, error) -1. BackupShortTermRetentionPolicyListResult.MarshalJSON() ([]byte, error) -1. CheckNameAvailabilityResponse.MarshalJSON() ([]byte, error) -1. DatabaseBlobAuditingPolicyListResult.MarshalJSON() ([]byte, error) -1. DatabaseListResult.MarshalJSON() ([]byte, error) -1. DatabaseOperationListResult.MarshalJSON() ([]byte, error) -1. DatabaseOperationProperties.MarshalJSON() ([]byte, error) -1. DatabaseUsage.MarshalJSON() ([]byte, error) -1. DatabaseVulnerabilityAssessmentListResult.MarshalJSON() ([]byte, error) -1. DatabaseVulnerabilityAssessmentScanExportProperties.MarshalJSON() ([]byte, error) -1. ElasticPoolActivityProperties.MarshalJSON() ([]byte, error) -1. ElasticPoolDatabaseActivityProperties.MarshalJSON() ([]byte, error) -1. ElasticPoolListResult.MarshalJSON() ([]byte, error) -1. ElasticPoolOperationListResult.MarshalJSON() ([]byte, error) -1. ElasticPoolOperationProperties.MarshalJSON() ([]byte, error) -1. EncryptionProtectorListResult.MarshalJSON() ([]byte, error) -1. ExtendedDatabaseBlobAuditingPolicyListResult.MarshalJSON() ([]byte, error) -1. ExtendedServerBlobAuditingPolicyListResult.MarshalJSON() ([]byte, error) -1. FailoverGroupListResult.MarshalJSON() ([]byte, error) -1. ImportExportOperationResultProperties.MarshalJSON() ([]byte, error) -1. InstanceFailoverGroupListResult.MarshalJSON() ([]byte, error) -1. InstancePoolListResult.MarshalJSON() ([]byte, error) -1. JobAgentListResult.MarshalJSON() ([]byte, error) -1. JobCredentialListResult.MarshalJSON() ([]byte, error) -1. JobExecutionListResult.MarshalJSON() ([]byte, error) -1. JobExecutionTarget.MarshalJSON() ([]byte, error) -1. JobListResult.MarshalJSON() ([]byte, error) -1. JobStepListResult.MarshalJSON() ([]byte, error) -1. JobTargetGroupListResult.MarshalJSON() ([]byte, error) -1. JobVersion.MarshalJSON() ([]byte, error) -1. JobVersionListResult.MarshalJSON() ([]byte, error) -1. LogSizeCapability.MarshalJSON() ([]byte, error) -1. LogicalServerSecurityAlertPolicyListResult.MarshalJSON() ([]byte, error) -1. LongTermRetentionBackupListResult.MarshalJSON() ([]byte, error) -1. LongTermRetentionBackupProperties.MarshalJSON() ([]byte, error) -1. ManagedBackupShortTermRetentionPolicyListResult.MarshalJSON() ([]byte, error) -1. ManagedDatabaseListResult.MarshalJSON() ([]byte, error) -1. ManagedDatabaseRestoreDetailsProperties.MarshalJSON() ([]byte, error) -1. ManagedDatabaseSecurityAlertPolicyListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceAdministratorListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceAzureADOnlyAuthListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceEncryptionProtectorListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceKeyListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceLongTermRetentionBackupListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceLongTermRetentionBackupProperties.MarshalJSON() ([]byte, error) -1. ManagedInstanceLongTermRetentionPolicyListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceOperationListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceOperationParametersPair.MarshalJSON() ([]byte, error) -1. ManagedInstanceOperationProperties.MarshalJSON() ([]byte, error) -1. ManagedInstanceOperationSteps.MarshalJSON() ([]byte, error) -1. ManagedInstanceVulnerabilityAssessmentListResult.MarshalJSON() ([]byte, error) -1. ManagedServerSecurityAlertPolicyListResult.MarshalJSON() ([]byte, error) -1. MaxSizeCapability.MarshalJSON() ([]byte, error) -1. Metric.MarshalJSON() ([]byte, error) -1. MetricAvailability.MarshalJSON() ([]byte, error) -1. MetricDefinition.MarshalJSON() ([]byte, error) -1. MetricName.MarshalJSON() ([]byte, error) -1. MetricValue.MarshalJSON() ([]byte, error) -1. OperationDisplay.MarshalJSON() ([]byte, error) -1. OperationImpact.MarshalJSON() ([]byte, error) -1. OperationListResult.MarshalJSON() ([]byte, error) -1. PerformanceLevelCapability.MarshalJSON() ([]byte, error) -1. PrivateEndpointConnectionListResult.MarshalJSON() ([]byte, error) -1. PrivateEndpointConnectionRequestStatus.MarshalJSON() ([]byte, error) -1. PrivateLinkResource.MarshalJSON() ([]byte, error) -1. PrivateLinkResourceListResult.MarshalJSON() ([]byte, error) -1. PrivateLinkResourceProperties.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. RecommendedIndexProperties.MarshalJSON() ([]byte, error) -1. RecoverableDatabaseProperties.MarshalJSON() ([]byte, error) -1. RecoverableManagedDatabaseListResult.MarshalJSON() ([]byte, error) -1. RecoverableManagedDatabaseProperties.MarshalJSON() ([]byte, error) -1. ReplicationLinkProperties.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. RestorableDroppedDatabaseProperties.MarshalJSON() ([]byte, error) -1. RestorableDroppedManagedDatabaseListResult.MarshalJSON() ([]byte, error) -1. RestorableDroppedManagedDatabaseProperties.MarshalJSON() ([]byte, error) -1. RestorePointListResult.MarshalJSON() ([]byte, error) -1. RestorePointProperties.MarshalJSON() ([]byte, error) -1. SensitivityLabelListResult.MarshalJSON() ([]byte, error) -1. ServerBlobAuditingPolicyListResult.MarshalJSON() ([]byte, error) -1. ServerDNSAliasListResult.MarshalJSON() ([]byte, error) -1. ServerDNSAliasProperties.MarshalJSON() ([]byte, error) -1. ServerKeyListResult.MarshalJSON() ([]byte, error) -1. ServerListResult.MarshalJSON() ([]byte, error) -1. ServerPrivateEndpointConnection.MarshalJSON() ([]byte, error) -1. ServerTrustGroupListResult.MarshalJSON() ([]byte, error) -1. ServerUsage.MarshalJSON() ([]byte, error) -1. ServerVulnerabilityAssessmentListResult.MarshalJSON() ([]byte, error) -1. ServiceObjectiveProperties.MarshalJSON() ([]byte, error) -1. ServiceTierAdvisorProperties.MarshalJSON() ([]byte, error) -1. SloUsageMetric.MarshalJSON() ([]byte, error) -1. SubscriptionUsageListResult.MarshalJSON() ([]byte, error) -1. SubscriptionUsageProperties.MarshalJSON() ([]byte, error) -1. SyncAgentKeyProperties.MarshalJSON() ([]byte, error) -1. SyncAgentLinkedDatabaseListResult.MarshalJSON() ([]byte, error) -1. SyncAgentLinkedDatabaseProperties.MarshalJSON() ([]byte, error) -1. SyncAgentListResult.MarshalJSON() ([]byte, error) -1. SyncDatabaseIDListResult.MarshalJSON() ([]byte, error) -1. SyncDatabaseIDProperties.MarshalJSON() ([]byte, error) -1. SyncFullSchemaProperties.MarshalJSON() ([]byte, error) -1. SyncFullSchemaPropertiesListResult.MarshalJSON() ([]byte, error) -1. SyncFullSchemaTable.MarshalJSON() ([]byte, error) -1. SyncFullSchemaTableColumn.MarshalJSON() ([]byte, error) -1. SyncGroupListResult.MarshalJSON() ([]byte, error) -1. SyncGroupLogListResult.MarshalJSON() ([]byte, error) -1. SyncGroupLogProperties.MarshalJSON() ([]byte, error) -1. SyncMemberListResult.MarshalJSON() ([]byte, error) -1. TransparentDataEncryptionActivityProperties.MarshalJSON() ([]byte, error) -1. Usage.MarshalJSON() ([]byte, error) -1. UsageListResult.MarshalJSON() ([]byte, error) -1. VirtualClusterListResult.MarshalJSON() ([]byte, error) -1. VirtualNetworkRuleListResult.MarshalJSON() ([]byte, error) -1. VulnerabilityAssessmentScanError.MarshalJSON() ([]byte, error) -1. VulnerabilityAssessmentScanRecordListResult.MarshalJSON() ([]byte, error) -1. VulnerabilityAssessmentScanRecordProperties.MarshalJSON() ([]byte, error) -1. WorkloadClassifierListResult.MarshalJSON() ([]byte, error) -1. WorkloadGroupListResult.MarshalJSON() ([]byte, error) +1. *TopQueriesListResultIterator.Next() error +1. *TopQueriesListResultIterator.NextWithContext(context.Context) error +1. *TopQueriesListResultPage.Next() error +1. *TopQueriesListResultPage.NextWithContext(context.Context) error +1. ManagedInstancePecProperty.MarshalJSON() ([]byte, error) +1. ManagedInstancePrivateEndpointConnectionProperties.MarshalJSON() ([]byte, error) +1. ManagedInstancesClient.ListByManagedInstance(context.Context, string, string, *int32, string, string, string, QueryTimeGrainType, AggregationFunctionType, MetricType) (TopQueriesListResultPage, error) +1. ManagedInstancesClient.ListByManagedInstanceComplete(context.Context, string, string, *int32, string, string, string, QueryTimeGrainType, AggregationFunctionType, MetricType) (TopQueriesListResultIterator, error) +1. ManagedInstancesClient.ListByManagedInstancePreparer(context.Context, string, string, *int32, string, string, string, QueryTimeGrainType, AggregationFunctionType, MetricType) (*http.Request, error) +1. ManagedInstancesClient.ListByManagedInstanceResponder(*http.Response) (TopQueriesListResult, error) +1. ManagedInstancesClient.ListByManagedInstanceSender(*http.Request) (*http.Response, error) +1. NewTopQueriesListResultIterator(TopQueriesListResultPage) TopQueriesListResultIterator +1. NewTopQueriesListResultPage(TopQueriesListResult, func(context.Context, TopQueriesListResult) (TopQueriesListResult, error)) TopQueriesListResultPage +1. PossibleAggregationFunctionTypeValues() []AggregationFunctionType +1. PossibleMetricTypeValues() []MetricType +1. PossibleQueryMetricUnitTypeValues() []QueryMetricUnitType +1. PossibleQueryTimeGrainTypeValues() []QueryTimeGrainType +1. QueryMetricInterval.MarshalJSON() ([]byte, error) +1. QueryMetricProperties.MarshalJSON() ([]byte, error) +1. QueryStatisticsProperties.MarshalJSON() ([]byte, error) +1. TopQueries.MarshalJSON() ([]byte, error) +1. TopQueriesListResult.IsEmpty() bool +1. TopQueriesListResult.MarshalJSON() ([]byte, error) +1. TopQueriesListResultIterator.NotDone() bool +1. TopQueriesListResultIterator.Response() TopQueriesListResult +1. TopQueriesListResultIterator.Value() TopQueries +1. TopQueriesListResultPage.NotDone() bool +1. TopQueriesListResultPage.Response() TopQueriesListResult +1. TopQueriesListResultPage.Values() []TopQueries + +### Struct Changes + +#### New Structs + +1. ManagedInstancePecProperty +1. ManagedInstancePrivateEndpointConnectionProperties +1. ManagedInstancePrivateEndpointProperty +1. QueryMetricInterval +1. QueryMetricProperties +1. QueryStatisticsProperties +1. TopQueries +1. TopQueriesListResult +1. TopQueriesListResultIterator +1. TopQueriesListResultPage + +#### New Struct Fields + +1. ManagedInstanceProperties.PrivateEndpointConnections +1. ManagedInstanceProperties.ZoneRedundant +1. ManagedInstanceUpdate.Identity diff --git a/services/preview/sql/mgmt/v3.0/sql/_meta.json b/services/preview/sql/mgmt/v3.0/sql/_meta.json index e3cb944a7e7f..7b2d9fe7d906 100644 --- a/services/preview/sql/mgmt/v3.0/sql/_meta.json +++ b/services/preview/sql/mgmt/v3.0/sql/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a07f49e3f75a134c1acdacc338c9f9dc32386f66", "readme": "/_/azure-rest-api-specs/specification/sql/resource-manager/readme.md", "tag": "package-composite-v3", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/services/preview/sql/mgmt/v3.0/sql/enums.go b/services/preview/sql/mgmt/v3.0/sql/enums.go index fce7ec38a37f..9e7812c40ba0 100644 --- a/services/preview/sql/mgmt/v3.0/sql/enums.go +++ b/services/preview/sql/mgmt/v3.0/sql/enums.go @@ -6,6 +6,27 @@ package sql // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// AggregationFunctionType enumerates the values for aggregation function type. +type AggregationFunctionType string + +const ( + // Avg ... + Avg AggregationFunctionType = "avg" + // Max ... + Max AggregationFunctionType = "max" + // Min ... + Min AggregationFunctionType = "min" + // Stdev ... + Stdev AggregationFunctionType = "stdev" + // Sum ... + Sum AggregationFunctionType = "sum" +) + +// PossibleAggregationFunctionTypeValues returns an array of possible values for the AggregationFunctionType const type. +func PossibleAggregationFunctionTypeValues() []AggregationFunctionType { + return []AggregationFunctionType{Avg, Max, Min, Stdev, Sum} +} + // AutomaticTuningDisabledReason enumerates the values for automatic tuning disabled reason. type AutomaticTuningDisabledReason string @@ -557,13 +578,17 @@ func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState { type IdentityType string const ( + // None ... + None IdentityType = "None" // SystemAssigned ... SystemAssigned IdentityType = "SystemAssigned" + // UserAssigned ... + UserAssigned IdentityType = "UserAssigned" ) // PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. func PossibleIdentityTypeValues() []IdentityType { - return []IdentityType{SystemAssigned} + return []IdentityType{None, SystemAssigned, UserAssigned} } // InstanceFailoverGroupReplicationRole enumerates the values for instance failover group replication role. @@ -911,6 +936,27 @@ func PossibleMaxSizeUnitValues() []MaxSizeUnit { return []MaxSizeUnit{MaxSizeUnitGigabytes, MaxSizeUnitMegabytes, MaxSizeUnitPetabytes, MaxSizeUnitTerabytes} } +// MetricType enumerates the values for metric type. +type MetricType string + +const ( + // CPU ... + CPU MetricType = "cpu" + // Dtu ... + Dtu MetricType = "dtu" + // Duration ... + Duration MetricType = "duration" + // Io ... + Io MetricType = "io" + // LogIo ... + LogIo MetricType = "logIo" +) + +// PossibleMetricTypeValues returns an array of possible values for the MetricType const type. +func PossibleMetricTypeValues() []MetricType { + return []MetricType{CPU, Dtu, Duration, Io, LogIo} +} + // OperationOrigin enumerates the values for operation origin. type OperationOrigin string @@ -958,23 +1004,23 @@ func PossiblePerformanceLevelUnitValues() []PerformanceLevelUnit { type PrimaryAggregationType string const ( - // Average ... - Average PrimaryAggregationType = "Average" - // Count ... - Count PrimaryAggregationType = "Count" - // Maximum ... - Maximum PrimaryAggregationType = "Maximum" - // Minimum ... - Minimum PrimaryAggregationType = "Minimum" - // None ... - None PrimaryAggregationType = "None" - // Total ... - Total PrimaryAggregationType = "Total" + // 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{Average, Count, Maximum, Minimum, None, Total} + return []PrimaryAggregationType{PrimaryAggregationTypeAverage, PrimaryAggregationTypeCount, PrimaryAggregationTypeMaximum, PrimaryAggregationTypeMinimum, PrimaryAggregationTypeNone, PrimaryAggregationTypeTotal} } // PrivateEndpointProvisioningState enumerates the values for private endpoint provisioning state. @@ -1076,6 +1122,40 @@ func PossibleProvisioningState1Values() []ProvisioningState1 { return []ProvisioningState1{ProvisioningState1Creating, ProvisioningState1Deleting, ProvisioningState1Failed, ProvisioningState1Succeeded, ProvisioningState1Unknown, ProvisioningState1Updating} } +// QueryMetricUnitType enumerates the values for query metric unit type. +type QueryMetricUnitType string + +const ( + // Count ... + Count QueryMetricUnitType = "count" + // KB ... + KB QueryMetricUnitType = "KB" + // Microseconds ... + Microseconds QueryMetricUnitType = "microseconds" + // Percentage ... + Percentage QueryMetricUnitType = "percentage" +) + +// PossibleQueryMetricUnitTypeValues returns an array of possible values for the QueryMetricUnitType const type. +func PossibleQueryMetricUnitTypeValues() []QueryMetricUnitType { + return []QueryMetricUnitType{Count, KB, Microseconds, Percentage} +} + +// QueryTimeGrainType enumerates the values for query time grain type. +type QueryTimeGrainType string + +const ( + // P1D ... + P1D QueryTimeGrainType = "P1D" + // PT1H ... + PT1H QueryTimeGrainType = "PT1H" +) + +// PossibleQueryTimeGrainTypeValues returns an array of possible values for the QueryTimeGrainType const type. +func PossibleQueryTimeGrainTypeValues() []QueryTimeGrainType { + return []QueryTimeGrainType{P1D, PT1H} +} + // ReadOnlyEndpointFailoverPolicy enumerates the values for read only endpoint failover policy. type ReadOnlyEndpointFailoverPolicy string diff --git a/services/preview/sql/mgmt/v3.0/sql/manageddatabaserestoredetails.go b/services/preview/sql/mgmt/v3.0/sql/manageddatabaserestoredetails.go deleted file mode 100644 index 5c4455e7451c..000000000000 --- a/services/preview/sql/mgmt/v3.0/sql/manageddatabaserestoredetails.go +++ /dev/null @@ -1,122 +0,0 @@ -package sql - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ManagedDatabaseRestoreDetailsClient 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 ManagedDatabaseRestoreDetailsClient struct { - BaseClient -} - -// NewManagedDatabaseRestoreDetailsClient creates an instance of the ManagedDatabaseRestoreDetailsClient client. -func NewManagedDatabaseRestoreDetailsClient(subscriptionID string) ManagedDatabaseRestoreDetailsClient { - return NewManagedDatabaseRestoreDetailsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagedDatabaseRestoreDetailsClientWithBaseURI creates an instance of the ManagedDatabaseRestoreDetailsClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewManagedDatabaseRestoreDetailsClientWithBaseURI(baseURI string, subscriptionID string) ManagedDatabaseRestoreDetailsClient { - return ManagedDatabaseRestoreDetailsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets managed database restore details. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// managedInstanceName - the name of the managed instance. -// databaseName - the name of the database. -func (client ManagedDatabaseRestoreDetailsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result ManagedDatabaseRestoreDetailsResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseRestoreDetailsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("sql.ManagedDatabaseRestoreDetailsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, managedInstanceName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseRestoreDetailsClient", "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.ManagedDatabaseRestoreDetailsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseRestoreDetailsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagedDatabaseRestoreDetailsClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "managedInstanceName": autorest.Encode("path", managedInstanceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restoreDetailsName": autorest.Encode("path", "Default"), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-02-02-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/managedInstances/{managedInstanceName}/databases/{databaseName}/restoreDetails/{restoreDetailsName}", 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 ManagedDatabaseRestoreDetailsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ManagedDatabaseRestoreDetailsClient) GetResponder(resp *http.Response) (result ManagedDatabaseRestoreDetailsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/preview/sql/mgmt/v3.0/sql/manageddatabases.go b/services/preview/sql/mgmt/v3.0/sql/manageddatabases.go index cf2c059a51b9..ff5988db3d39 100644 --- a/services/preview/sql/mgmt/v3.0/sql/manageddatabases.go +++ b/services/preview/sql/mgmt/v3.0/sql/manageddatabases.go @@ -36,7 +36,8 @@ func NewManagedDatabasesClientWithBaseURI(baseURI string, subscriptionID string) // CompleteRestore completes the restore operation on a managed database. // Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. +// 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. // managedInstanceName - the name of the managed instance. // databaseName - the name of the database. // parameters - the definition for completing the restore of this managed database. @@ -52,10 +53,6 @@ func (client ManagedDatabasesClient) CompleteRestore(ctx context.Context, resour }() } if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.LastBackupName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("sql.ManagedDatabasesClient", "CompleteRestore", err.Error()) @@ -128,7 +125,8 @@ func (client ManagedDatabasesClient) CompleteRestoreResponder(resp *http.Respons // CreateOrUpdate creates a new database or updates an existing database. // Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. +// 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. // managedInstanceName - the name of the managed instance. // databaseName - the name of the database. // parameters - the requested database resource state. @@ -143,14 +141,6 @@ func (client ManagedDatabasesClient) CreateOrUpdate(ctx context.Context, resourc tracing.EndSpan(ctx, sc, err) }() } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("sql.ManagedDatabasesClient", "CreateOrUpdate", err.Error()) - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, managedInstanceName, databaseName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -219,7 +209,8 @@ func (client ManagedDatabasesClient) CreateOrUpdateResponder(resp *http.Response // Delete deletes a managed database. // Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. +// 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. // managedInstanceName - the name of the managed instance. // databaseName - the name of the database. func (client ManagedDatabasesClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result ManagedDatabasesDeleteFuture, err error) { @@ -233,14 +224,6 @@ func (client ManagedDatabasesClient) Delete(ctx context.Context, resourceGroupNa tracing.EndSpan(ctx, sc, err) }() } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("sql.ManagedDatabasesClient", "Delete", err.Error()) - } - req, err := client.DeletePreparer(ctx, resourceGroupName, managedInstanceName, databaseName) if err != nil { err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "Delete", nil, "Failure preparing request") @@ -306,7 +289,8 @@ func (client ManagedDatabasesClient) DeleteResponder(resp *http.Response) (resul // Get gets a managed database. // Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. +// 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. // managedInstanceName - the name of the managed instance. // databaseName - the name of the database. func (client ManagedDatabasesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result ManagedDatabase, err error) { @@ -320,14 +304,6 @@ func (client ManagedDatabasesClient) Get(ctx context.Context, resourceGroupName tracing.EndSpan(ctx, sc, err) }() } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("sql.ManagedDatabasesClient", "Get", err.Error()) - } - req, err := client.GetPreparer(ctx, resourceGroupName, managedInstanceName, databaseName) if err != nil { err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "Get", nil, "Failure preparing request") @@ -392,7 +368,8 @@ func (client ManagedDatabasesClient) GetResponder(resp *http.Response) (result M // ListByInstance gets a list of managed databases. // Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. +// 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. // managedInstanceName - the name of the managed instance. func (client ManagedDatabasesClient) ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedDatabaseListResultPage, err error) { if tracing.IsEnabled() { @@ -405,14 +382,6 @@ func (client ManagedDatabasesClient) ListByInstance(ctx context.Context, resourc tracing.EndSpan(ctx, sc, err) }() } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("sql.ManagedDatabasesClient", "ListByInstance", err.Error()) - } - result.fn = client.listByInstanceNextResults req, err := client.ListByInstancePreparer(ctx, resourceGroupName, managedInstanceName) if err != nil { @@ -518,7 +487,8 @@ func (client ManagedDatabasesClient) ListByInstanceComplete(ctx context.Context, // ListInaccessibleByInstance gets a list of inaccessible managed databases in a managed instance // Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. +// 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. // managedInstanceName - the name of the managed instance. func (client ManagedDatabasesClient) ListInaccessibleByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ManagedDatabaseListResultPage, err error) { if tracing.IsEnabled() { @@ -531,14 +501,6 @@ func (client ManagedDatabasesClient) ListInaccessibleByInstance(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("sql.ManagedDatabasesClient", "ListInaccessibleByInstance", err.Error()) - } - result.fn = client.listInaccessibleByInstanceNextResults req, err := client.ListInaccessibleByInstancePreparer(ctx, resourceGroupName, managedInstanceName) if err != nil { @@ -644,7 +606,8 @@ func (client ManagedDatabasesClient) ListInaccessibleByInstanceComplete(ctx cont // Update updates an existing database. // Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. +// 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. // managedInstanceName - the name of the managed instance. // databaseName - the name of the database. // parameters - the requested database resource state. @@ -659,14 +622,6 @@ func (client ManagedDatabasesClient) Update(ctx context.Context, resourceGroupNa tracing.EndSpan(ctx, sc, err) }() } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("sql.ManagedDatabasesClient", "Update", err.Error()) - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, managedInstanceName, databaseName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesClient", "Update", nil, "Failure preparing request") diff --git a/services/preview/sql/mgmt/v3.0/sql/managedinstances.go b/services/preview/sql/mgmt/v3.0/sql/managedinstances.go index e7a25151b987..fce2f13cf149 100644 --- a/services/preview/sql/mgmt/v3.0/sql/managedinstances.go +++ b/services/preview/sql/mgmt/v3.0/sql/managedinstances.go @@ -203,8 +203,9 @@ func (client ManagedInstancesClient) DeleteResponder(resp *http.Response) (resul // Failover failovers a managed instance. // Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// managedInstanceName - the name of the managed instance. +// 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. +// managedInstanceName - the name of the managed instance to failover. // replicaType - the type of replica to be failed over. func (client ManagedInstancesClient) Failover(ctx context.Context, resourceGroupName string, managedInstanceName string, replicaType ReplicaType) (result ManagedInstancesFailoverFuture, err error) { if tracing.IsEnabled() { @@ -217,14 +218,6 @@ func (client ManagedInstancesClient) Failover(ctx context.Context, resourceGroup tracing.EndSpan(ctx, sc, err) }() } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("sql.ManagedInstancesClient", "Failover", err.Error()) - } - req, err := client.FailoverPreparer(ctx, resourceGroupName, managedInstanceName, replicaType) if err != nil { err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "Failover", nil, "Failure preparing request") @@ -248,7 +241,7 @@ func (client ManagedInstancesClient) FailoverPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01-preview" + const APIVersion = "2020-02-02-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -599,6 +592,154 @@ func (client ManagedInstancesClient) ListByInstancePoolComplete(ctx context.Cont return } +// ListByManagedInstance get top resource consuming queries of a managed instance. +// 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. +// managedInstanceName - the name of the managed instance. +// numberOfQueries - how many 'top queries' to return. Default is 5. +// databases - comma separated list of databases to be included into search. All DB's are included if this +// parameter is not specified. +// startTime - start time for observed period. +// endTime - end time for observed period. +// interval - the time step to be used to summarize the metric values. Default value is PT1H +// aggregationFunction - aggregation function to be used, default value is 'sum' +// observationMetric - metric to be used for ranking top queries. Default is 'cpu' +func (client ManagedInstancesClient) ListByManagedInstance(ctx context.Context, resourceGroupName string, managedInstanceName string, numberOfQueries *int32, databases string, startTime string, endTime string, interval QueryTimeGrainType, aggregationFunction AggregationFunctionType, observationMetric MetricType) (result TopQueriesListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstancesClient.ListByManagedInstance") + defer func() { + sc := -1 + if result.tqlr.Response.Response != nil { + sc = result.tqlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByManagedInstanceNextResults + req, err := client.ListByManagedInstancePreparer(ctx, resourceGroupName, managedInstanceName, numberOfQueries, databases, startTime, endTime, interval, aggregationFunction, observationMetric) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "ListByManagedInstance", nil, "Failure preparing request") + return + } + + resp, err := client.ListByManagedInstanceSender(req) + if err != nil { + result.tqlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "ListByManagedInstance", resp, "Failure sending request") + return + } + + result.tqlr, err = client.ListByManagedInstanceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "ListByManagedInstance", resp, "Failure responding to request") + return + } + if result.tqlr.hasNextLink() && result.tqlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByManagedInstancePreparer prepares the ListByManagedInstance request. +func (client ManagedInstancesClient) ListByManagedInstancePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, numberOfQueries *int32, databases string, startTime string, endTime string, interval QueryTimeGrainType, aggregationFunction AggregationFunctionType, observationMetric MetricType) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managedInstanceName": autorest.Encode("path", managedInstanceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-02-02-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if numberOfQueries != nil { + queryParameters["numberOfQueries"] = autorest.Encode("query", *numberOfQueries) + } + if len(databases) > 0 { + queryParameters["databases"] = autorest.Encode("query", databases) + } + if len(startTime) > 0 { + queryParameters["startTime"] = autorest.Encode("query", startTime) + } + if len(endTime) > 0 { + queryParameters["endTime"] = autorest.Encode("query", endTime) + } + if len(string(interval)) > 0 { + queryParameters["interval"] = autorest.Encode("query", interval) + } + if len(string(aggregationFunction)) > 0 { + queryParameters["aggregationFunction"] = autorest.Encode("query", aggregationFunction) + } + if len(string(observationMetric)) > 0 { + queryParameters["observationMetric"] = autorest.Encode("query", observationMetric) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/topqueries", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByManagedInstanceSender sends the ListByManagedInstance request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedInstancesClient) ListByManagedInstanceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByManagedInstanceResponder handles the response to the ListByManagedInstance request. The method always +// closes the http.Response Body. +func (client ManagedInstancesClient) ListByManagedInstanceResponder(resp *http.Response) (result TopQueriesListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByManagedInstanceNextResults retrieves the next set of results, if any. +func (client ManagedInstancesClient) listByManagedInstanceNextResults(ctx context.Context, lastResults TopQueriesListResult) (result TopQueriesListResult, err error) { + req, err := lastResults.topQueriesListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "listByManagedInstanceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByManagedInstanceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "listByManagedInstanceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByManagedInstanceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ManagedInstancesClient", "listByManagedInstanceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByManagedInstanceComplete enumerates all values, automatically crossing page boundaries as required. +func (client ManagedInstancesClient) ListByManagedInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string, numberOfQueries *int32, databases string, startTime string, endTime string, interval QueryTimeGrainType, aggregationFunction AggregationFunctionType, observationMetric MetricType) (result TopQueriesListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstancesClient.ListByManagedInstance") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByManagedInstance(ctx, resourceGroupName, managedInstanceName, numberOfQueries, databases, startTime, endTime, interval, aggregationFunction, observationMetric) + return +} + // ListByResourceGroup gets a list of managed instances in a resource group. // Parameters: // resourceGroupName - the name of the resource group that contains the resource. You can obtain this value diff --git a/services/preview/sql/mgmt/v3.0/sql/models.go b/services/preview/sql/mgmt/v3.0/sql/models.go index d1fabad574b4..160b76909bfc 100644 --- a/services/preview/sql/mgmt/v3.0/sql/models.go +++ b/services/preview/sql/mgmt/v3.0/sql/models.go @@ -11153,109 +11153,6 @@ func (mdp ManagedDatabaseProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// ManagedDatabaseRestoreDetailsProperties the managed database's restore details properties. -type ManagedDatabaseRestoreDetailsProperties struct { - // Status - READ-ONLY; Restore status. - Status *string `json:"status,omitempty"` - // CurrentRestoringFileName - READ-ONLY; Current restoring file name. - CurrentRestoringFileName *string `json:"currentRestoringFileName,omitempty"` - // LastRestoredFileName - READ-ONLY; Last restored file name. - LastRestoredFileName *string `json:"lastRestoredFileName,omitempty"` - // LastRestoredFileTime - READ-ONLY; Last restored file time. - LastRestoredFileTime *date.Time `json:"lastRestoredFileTime,omitempty"` - // PercentCompleted - READ-ONLY; Percent completed. - PercentCompleted *float64 `json:"percentCompleted,omitempty"` - // UnrestorableFiles - READ-ONLY; List of unrestorable files. - UnrestorableFiles *[]string `json:"unrestorableFiles,omitempty"` - // NumberOfFilesDetected - READ-ONLY; Number of files detected. - NumberOfFilesDetected *int64 `json:"numberOfFilesDetected,omitempty"` - // LastUploadedFileName - READ-ONLY; Last uploaded file name. - LastUploadedFileName *string `json:"lastUploadedFileName,omitempty"` - // LastUploadedFileTime - READ-ONLY; Last uploaded file time. - LastUploadedFileTime *date.Time `json:"lastUploadedFileTime,omitempty"` - // BlockReason - READ-ONLY; The reason why restore is in Blocked state. - BlockReason *string `json:"blockReason,omitempty"` -} - -// MarshalJSON is the custom marshaler for ManagedDatabaseRestoreDetailsProperties. -func (mdrdp ManagedDatabaseRestoreDetailsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ManagedDatabaseRestoreDetailsResult a managed database restore details. -type ManagedDatabaseRestoreDetailsResult struct { - autorest.Response `json:"-"` - // ManagedDatabaseRestoreDetailsProperties - Resource properties. - *ManagedDatabaseRestoreDetailsProperties `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 ManagedDatabaseRestoreDetailsResult. -func (mdrdr ManagedDatabaseRestoreDetailsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mdrdr.ManagedDatabaseRestoreDetailsProperties != nil { - objectMap["properties"] = mdrdr.ManagedDatabaseRestoreDetailsProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ManagedDatabaseRestoreDetailsResult struct. -func (mdrdr *ManagedDatabaseRestoreDetailsResult) 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 managedDatabaseRestoreDetailsProperties ManagedDatabaseRestoreDetailsProperties - err = json.Unmarshal(*v, &managedDatabaseRestoreDetailsProperties) - if err != nil { - return err - } - mdrdr.ManagedDatabaseRestoreDetailsProperties = &managedDatabaseRestoreDetailsProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - mdrdr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - mdrdr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - mdrdr.Type = &typeVar - } - } - } - - return nil -} - // ManagedDatabasesCompleteRestoreFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ManagedDatabasesCompleteRestoreFuture struct { @@ -14315,6 +14212,48 @@ type ManagedInstancePairInfo struct { PartnerManagedInstanceID *string `json:"partnerManagedInstanceId,omitempty"` } +// ManagedInstancePecProperty a private endpoint connection under a managed instance +type ManagedInstancePecProperty struct { + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Properties - READ-ONLY; Private endpoint connection properties + Properties *ManagedInstancePrivateEndpointConnectionProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedInstancePecProperty. +func (mipp ManagedInstancePecProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ManagedInstancePrivateEndpointConnectionProperties properties of a private endpoint connection. +type ManagedInstancePrivateEndpointConnectionProperties struct { + // PrivateEndpoint - Private endpoint which the connection belongs to. + PrivateEndpoint *ManagedInstancePrivateEndpointProperty `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - Connection State of the Private Endpoint Connection. + PrivateLinkServiceConnectionState *ManagedInstancePrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` + // ProvisioningState - READ-ONLY; State of the Private Endpoint Connection. + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedInstancePrivateEndpointConnectionProperties. +func (mipecp ManagedInstancePrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mipecp.PrivateEndpoint != nil { + objectMap["privateEndpoint"] = mipecp.PrivateEndpoint + } + if mipecp.PrivateLinkServiceConnectionState != nil { + objectMap["privateLinkServiceConnectionState"] = mipecp.PrivateLinkServiceConnectionState + } + return json.Marshal(objectMap) +} + +// ManagedInstancePrivateEndpointProperty ... +type ManagedInstancePrivateEndpointProperty struct { + // ID - Resource id of the private endpoint. + ID *string `json:"id,omitempty"` +} + // ManagedInstancePrivateLinkServiceConnectionStateProperty ... type ManagedInstancePrivateLinkServiceConnectionStateProperty struct { // Status - The private link service connection status. @@ -14388,10 +14327,14 @@ type ManagedInstanceProperties struct { InstancePoolID *string `json:"instancePoolId,omitempty"` // MaintenanceConfigurationID - Specifies maintenance configuration id to apply to this managed instance. MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"` + // PrivateEndpointConnections - READ-ONLY; List of private endpoint connections on a managed instance. + PrivateEndpointConnections *[]ManagedInstancePecProperty `json:"privateEndpointConnections,omitempty"` // MinimalTLSVersion - Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2' MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"` // StorageAccountType - The storage account type used to store backups for this instance. The options are LRS (LocallyRedundantStorage), ZRS (ZoneRedundantStorage) and GRS (GeoRedundantStorage). Possible values include: 'GRS', 'LRS', 'ZRS' StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` + // ZoneRedundant - Whether or not the multi-az is enabled. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` } // MarshalJSON is the custom marshaler for ManagedInstanceProperties. @@ -14451,6 +14394,9 @@ func (mip ManagedInstanceProperties) MarshalJSON() ([]byte, error) { if mip.StorageAccountType != "" { objectMap["storageAccountType"] = mip.StorageAccountType } + if mip.ZoneRedundant != nil { + objectMap["zoneRedundant"] = mip.ZoneRedundant + } return json.Marshal(objectMap) } @@ -14655,6 +14601,8 @@ func (future *ManagedInstanceTdeCertificatesCreateFuture) result(client ManagedI type ManagedInstanceUpdate struct { // Sku - Managed instance sku Sku *Sku `json:"sku,omitempty"` + // Identity - Managed instance identity + Identity *ResourceIdentity `json:"identity,omitempty"` // ManagedInstanceProperties - Resource properties. *ManagedInstanceProperties `json:"properties,omitempty"` // Tags - Resource tags. @@ -14667,6 +14615,9 @@ func (miu ManagedInstanceUpdate) MarshalJSON() ([]byte, error) { if miu.Sku != nil { objectMap["sku"] = miu.Sku } + if miu.Identity != nil { + objectMap["identity"] = miu.Identity + } if miu.ManagedInstanceProperties != nil { objectMap["properties"] = miu.ManagedInstanceProperties } @@ -14694,6 +14645,15 @@ func (miu *ManagedInstanceUpdate) UnmarshalJSON(body []byte) error { } miu.Sku = &sku } + case "identity": + if v != nil { + var identity ResourceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + miu.Identity = &identity + } case "properties": if v != nil { var managedInstanceProperties ManagedInstanceProperties @@ -15472,7 +15432,7 @@ func (ma MetricAvailability) MarshalJSON() ([]byte, error) { 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: 'None', 'Average', 'Count', 'Minimum', 'Maximum', 'Total' + // 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"` @@ -16442,6 +16402,78 @@ func (pr ProxyResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// QueryMetricInterval properties of a query metrics interval. +type QueryMetricInterval struct { + // IntervalStartTime - READ-ONLY; The start time for the metric interval (ISO-8601 format). + IntervalStartTime *string `json:"intervalStartTime,omitempty"` + // IntervalType - READ-ONLY; Interval type (length). Possible values include: 'PT1H', 'P1D' + IntervalType QueryTimeGrainType `json:"intervalType,omitempty"` + // ExecutionCount - READ-ONLY; Execution count of a query in this interval. + ExecutionCount *int64 `json:"executionCount,omitempty"` + // Metrics - List of metric objects for this interval + Metrics *[]QueryMetricProperties `json:"metrics,omitempty"` +} + +// MarshalJSON is the custom marshaler for QueryMetricInterval. +func (qmi QueryMetricInterval) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if qmi.Metrics != nil { + objectMap["metrics"] = qmi.Metrics + } + return json.Marshal(objectMap) +} + +// QueryMetricProperties properties of a topquery metric in one interval. +type QueryMetricProperties struct { + // Name - READ-ONLY; The name information for the metric. + Name *string `json:"name,omitempty"` + // DisplayName - READ-ONLY; The UI appropriate name for the metric. + DisplayName *string `json:"displayName,omitempty"` + // Unit - READ-ONLY; The unit of the metric. Possible values include: 'Percentage', 'KB', 'Microseconds', 'Count' + Unit QueryMetricUnitType `json:"unit,omitempty"` + // Value - READ-ONLY; The value of the metric. + Value *float64 `json:"value,omitempty"` + // Min - READ-ONLY; Metric value when min() aggregate function is used over the interval. + Min *float64 `json:"min,omitempty"` + // Max - READ-ONLY; Metric value when max() aggregate function is used over the interval. + Max *float64 `json:"max,omitempty"` + // Avg - READ-ONLY; Metric value when avg() aggregate function is used over the interval. + Avg *float64 `json:"avg,omitempty"` + // Sum - READ-ONLY; Metric value when sum() aggregate function is used over the interval. + Sum *float64 `json:"sum,omitempty"` + // Stdev - READ-ONLY; Metric value when stdev aggregate function is used over the interval. + Stdev *float64 `json:"stdev,omitempty"` +} + +// MarshalJSON is the custom marshaler for QueryMetricProperties. +func (qmp QueryMetricProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// QueryStatisticsProperties properties of a query execution statistics. +type QueryStatisticsProperties struct { + // DatabaseName - READ-ONLY; Database name of the database in which this query was executed. + DatabaseName *string `json:"databaseName,omitempty"` + // QueryID - READ-ONLY; Unique query id (unique within one database). + QueryID *string `json:"queryId,omitempty"` + // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). + StartTime *string `json:"startTime,omitempty"` + // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). + EndTime *string `json:"endTime,omitempty"` + // Intervals - List of intervals with appropriate metric data + Intervals *[]QueryMetricInterval `json:"intervals,omitempty"` +} + +// MarshalJSON is the custom marshaler for QueryStatisticsProperties. +func (qsp QueryStatisticsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if qsp.Intervals != nil { + objectMap["intervals"] = qsp.Intervals + } + return json.Marshal(objectMap) +} + // ReadScaleCapability the read scale capability. type ReadScaleCapability struct { // MaxNumberOfReplicas - READ-ONLY; The maximum number of read scale replicas. @@ -17307,7 +17339,7 @@ func (r Resource) MarshalJSON() ([]byte, error) { type ResourceIdentity struct { // PrincipalID - READ-ONLY; The Azure Active Directory principal id. PrincipalID *uuid.UUID `json:"principalId,omitempty"` - // Type - The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. Possible values include: 'SystemAssigned' + // Type - The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. Possible values include: 'None', 'SystemAssigned', 'UserAssigned' Type IdentityType `json:"type,omitempty"` // TenantID - READ-ONLY; The Azure Active Directory tenant id. TenantID *uuid.UUID `json:"tenantId,omitempty"` @@ -24127,6 +24159,198 @@ func (future *TdeCertificatesCreateFuture) result(client TdeCertificatesClient) return } +// TopQueries ... +type TopQueries struct { + // NumberOfQueries - READ-ONLY; Requested number of top queries. + NumberOfQueries *int32 `json:"numberOfQueries,omitempty"` + // AggregationFunction - READ-ONLY; Aggregation function used to calculate query metrics. + AggregationFunction *string `json:"aggregationFunction,omitempty"` + // ObservationMetric - READ-ONLY; Metric used to rank queries. + ObservationMetric *string `json:"observationMetric,omitempty"` + // IntervalType - READ-ONLY; Interval type (length). Possible values include: 'PT1H', 'P1D' + IntervalType QueryTimeGrainType `json:"intervalType,omitempty"` + // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). + StartTime *string `json:"startTime,omitempty"` + // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). + EndTime *string `json:"endTime,omitempty"` + // Queries - List of top resource consuming queries with appropriate metric data + Queries *[]QueryStatisticsProperties `json:"queries,omitempty"` +} + +// MarshalJSON is the custom marshaler for TopQueries. +func (tq TopQueries) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tq.Queries != nil { + objectMap["queries"] = tq.Queries + } + return json.Marshal(objectMap) +} + +// TopQueriesListResult a list of top resource consuming queries on managed instance +type TopQueriesListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]TopQueries `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for TopQueriesListResult. +func (tqlr TopQueriesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// TopQueriesListResultIterator provides access to a complete listing of TopQueries values. +type TopQueriesListResultIterator struct { + i int + page TopQueriesListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TopQueriesListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TopQueriesListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *TopQueriesListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TopQueriesListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TopQueriesListResultIterator) Response() TopQueriesListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TopQueriesListResultIterator) Value() TopQueries { + if !iter.page.NotDone() { + return TopQueries{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TopQueriesListResultIterator type. +func NewTopQueriesListResultIterator(page TopQueriesListResultPage) TopQueriesListResultIterator { + return TopQueriesListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tqlr TopQueriesListResult) IsEmpty() bool { + return tqlr.Value == nil || len(*tqlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (tqlr TopQueriesListResult) hasNextLink() bool { + return tqlr.NextLink != nil && len(*tqlr.NextLink) != 0 +} + +// topQueriesListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tqlr TopQueriesListResult) topQueriesListResultPreparer(ctx context.Context) (*http.Request, error) { + if !tqlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tqlr.NextLink))) +} + +// TopQueriesListResultPage contains a page of TopQueries values. +type TopQueriesListResultPage struct { + fn func(context.Context, TopQueriesListResult) (TopQueriesListResult, error) + tqlr TopQueriesListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TopQueriesListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TopQueriesListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.tqlr) + if err != nil { + return err + } + page.tqlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *TopQueriesListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TopQueriesListResultPage) NotDone() bool { + return !page.tqlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TopQueriesListResultPage) Response() TopQueriesListResult { + return page.tqlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TopQueriesListResultPage) Values() []TopQueries { + if page.tqlr.IsEmpty() { + return nil + } + return *page.tqlr.Value +} + +// Creates a new instance of the TopQueriesListResultPage type. +func NewTopQueriesListResultPage(cur TopQueriesListResult, getNextPage func(context.Context, TopQueriesListResult) (TopQueriesListResult, error)) TopQueriesListResultPage { + return TopQueriesListResultPage{ + fn: getNextPage, + tqlr: cur, + } +} + // TrackedResource ARM tracked top level resource. type TrackedResource struct { // Location - Resource location. diff --git a/services/preview/sql/mgmt/v3.0/sql/privateendpointconnections.go b/services/preview/sql/mgmt/v3.0/sql/privateendpointconnections.go index 6b943ae6dad7..a090ca0ff760 100644 --- a/services/preview/sql/mgmt/v3.0/sql/privateendpointconnections.go +++ b/services/preview/sql/mgmt/v3.0/sql/privateendpointconnections.go @@ -83,7 +83,7 @@ func (client PrivateEndpointConnectionsClient) CreateOrUpdatePreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -165,7 +165,7 @@ func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -252,7 +252,7 @@ func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -334,7 +334,7 @@ func (client PrivateEndpointConnectionsClient) ListByServerPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/sql/mgmt/v3.0/sql/sqlapi/interfaces.go b/services/preview/sql/mgmt/v3.0/sql/sqlapi/interfaces.go index 4fb675257b85..3aea59e1830e 100644 --- a/services/preview/sql/mgmt/v3.0/sql/sqlapi/interfaces.go +++ b/services/preview/sql/mgmt/v3.0/sql/sqlapi/interfaces.go @@ -807,17 +807,6 @@ type UsagesClientAPI interface { var _ UsagesClientAPI = (*sql.UsagesClient)(nil) -// PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. -type PrivateEndpointConnectionsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters sql.PrivateEndpointConnection) (result sql.PrivateEndpointConnectionsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string) (result sql.PrivateEndpointConnectionsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string) (result sql.PrivateEndpointConnection, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.PrivateEndpointConnectionListResultPage, err error) - ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result sql.PrivateEndpointConnectionListResultIterator, err error) -} - -var _ PrivateEndpointConnectionsClientAPI = (*sql.PrivateEndpointConnectionsClient)(nil) - // PrivateLinkResourcesClientAPI contains the set of methods on the PrivateLinkResourcesClient type. type PrivateLinkResourcesClientAPI interface { Get(ctx context.Context, resourceGroupName string, serverName string, groupName string) (result sql.PrivateLinkResource, err error) @@ -961,29 +950,12 @@ type SyncMembersClientAPI interface { var _ SyncMembersClientAPI = (*sql.SyncMembersClient)(nil) -// ManagedInstancesClientAPI contains the set of methods on the ManagedInstancesClient type. -type ManagedInstancesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters sql.ManagedInstance) (result sql.ManagedInstancesCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.ManagedInstancesDeleteFuture, err error) - Failover(ctx context.Context, resourceGroupName string, managedInstanceName string, replicaType sql.ReplicaType) (result sql.ManagedInstancesFailoverFuture, err error) - Get(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.ManagedInstance, err error) - List(ctx context.Context) (result sql.ManagedInstanceListResultPage, err error) - ListComplete(ctx context.Context) (result sql.ManagedInstanceListResultIterator, err error) - ListByInstancePool(ctx context.Context, resourceGroupName string, instancePoolName string) (result sql.ManagedInstanceListResultPage, err error) - ListByInstancePoolComplete(ctx context.Context, resourceGroupName string, instancePoolName string) (result sql.ManagedInstanceListResultIterator, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string) (result sql.ManagedInstanceListResultPage, err error) - ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result sql.ManagedInstanceListResultIterator, err error) - Update(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters sql.ManagedInstanceUpdate) (result sql.ManagedInstancesUpdateFuture, err error) -} - -var _ ManagedInstancesClientAPI = (*sql.ManagedInstancesClient)(nil) - -// ManagedDatabaseRestoreDetailsClientAPI contains the set of methods on the ManagedDatabaseRestoreDetailsClient type. -type ManagedDatabaseRestoreDetailsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string) (result sql.ManagedDatabaseRestoreDetailsResult, err error) +// ImportExportClientAPI contains the set of methods on the ImportExportClient type. +type ImportExportClientAPI interface { + Import(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.ImportExistingDatabaseDefinition) (result sql.ImportExportImportFuture, err error) } -var _ ManagedDatabaseRestoreDetailsClientAPI = (*sql.ManagedDatabaseRestoreDetailsClient)(nil) +var _ ImportExportClientAPI = (*sql.ImportExportClient)(nil) // ManagedDatabasesClientAPI contains the set of methods on the ManagedDatabasesClient type. type ManagedDatabasesClientAPI interface { @@ -1011,12 +983,24 @@ type ServerAzureADOnlyAuthenticationsClientAPI interface { var _ ServerAzureADOnlyAuthenticationsClientAPI = (*sql.ServerAzureADOnlyAuthenticationsClient)(nil) -// ImportExportClientAPI contains the set of methods on the ImportExportClient type. -type ImportExportClientAPI interface { - Import(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.ImportExistingDatabaseDefinition) (result sql.ImportExportImportFuture, err error) +// ManagedInstancesClientAPI contains the set of methods on the ManagedInstancesClient type. +type ManagedInstancesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters sql.ManagedInstance) (result sql.ManagedInstancesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.ManagedInstancesDeleteFuture, err error) + Failover(ctx context.Context, resourceGroupName string, managedInstanceName string, replicaType sql.ReplicaType) (result sql.ManagedInstancesFailoverFuture, err error) + Get(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.ManagedInstance, err error) + List(ctx context.Context) (result sql.ManagedInstanceListResultPage, err error) + ListComplete(ctx context.Context) (result sql.ManagedInstanceListResultIterator, err error) + ListByInstancePool(ctx context.Context, resourceGroupName string, instancePoolName string) (result sql.ManagedInstanceListResultPage, err error) + ListByInstancePoolComplete(ctx context.Context, resourceGroupName string, instancePoolName string) (result sql.ManagedInstanceListResultIterator, err error) + ListByManagedInstance(ctx context.Context, resourceGroupName string, managedInstanceName string, numberOfQueries *int32, databases string, startTime string, endTime string, interval sql.QueryTimeGrainType, aggregationFunction sql.AggregationFunctionType, observationMetric sql.MetricType) (result sql.TopQueriesListResultPage, err error) + ListByManagedInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string, numberOfQueries *int32, databases string, startTime string, endTime string, interval sql.QueryTimeGrainType, aggregationFunction sql.AggregationFunctionType, observationMetric sql.MetricType) (result sql.TopQueriesListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result sql.ManagedInstanceListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result sql.ManagedInstanceListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters sql.ManagedInstanceUpdate) (result sql.ManagedInstancesUpdateFuture, err error) } -var _ ImportExportClientAPI = (*sql.ImportExportClient)(nil) +var _ ManagedInstancesClientAPI = (*sql.ManagedInstancesClient)(nil) // ManagedInstanceAzureADOnlyAuthenticationsClientAPI contains the set of methods on the ManagedInstanceAzureADOnlyAuthenticationsClient type. type ManagedInstanceAzureADOnlyAuthenticationsClientAPI interface { @@ -1041,3 +1025,14 @@ type ServerTrustGroupsClientAPI interface { } var _ ServerTrustGroupsClientAPI = (*sql.ServerTrustGroupsClient)(nil) + +// PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. +type PrivateEndpointConnectionsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters sql.PrivateEndpointConnection) (result sql.PrivateEndpointConnectionsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string) (result sql.PrivateEndpointConnectionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string) (result sql.PrivateEndpointConnection, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.PrivateEndpointConnectionListResultPage, err error) + ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result sql.PrivateEndpointConnectionListResultIterator, err error) +} + +var _ PrivateEndpointConnectionsClientAPI = (*sql.PrivateEndpointConnectionsClient)(nil) diff --git a/services/preview/sql/mgmt/v4.0/sql/CHANGELOG.md b/services/preview/sql/mgmt/v4.0/sql/CHANGELOG.md index 7d668b2a7b47..63c6f281bb8c 100644 --- a/services/preview/sql/mgmt/v4.0/sql/CHANGELOG.md +++ b/services/preview/sql/mgmt/v4.0/sql/CHANGELOG.md @@ -1,132 +1,335 @@ -# Change History +# Unreleased + +## Breaking Changes + +### Removed Constants + +1. DatabaseState2.DatabaseState2All +1. DatabaseState2.DatabaseState2Deleted +1. DatabaseState2.DatabaseState2Live +1. DatabaseState3.DatabaseState3All +1. DatabaseState3.DatabaseState3Deleted +1. DatabaseState3.DatabaseState3Live +1. DatabaseState4.DatabaseState4All +1. DatabaseState4.DatabaseState4Deleted +1. DatabaseState4.DatabaseState4Live +1. DatabaseState5.DatabaseState5All +1. DatabaseState5.DatabaseState5Deleted +1. DatabaseState5.DatabaseState5Live +1. DatabaseState6.DatabaseState6All +1. DatabaseState6.DatabaseState6Deleted +1. DatabaseState6.DatabaseState6Live +1. LongTermRetentionDatabaseState.LongTermRetentionDatabaseStateAll +1. LongTermRetentionDatabaseState.LongTermRetentionDatabaseStateDeleted +1. LongTermRetentionDatabaseState.LongTermRetentionDatabaseStateLive +1. SecondaryType.Named + +### Removed Funcs + +1. *BackupLongTermRetentionPoliciesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *BackupLongTermRetentionPolicy.UnmarshalJSON([]byte) error +1. BackupLongTermRetentionPoliciesClient.CreateOrUpdate(context.Context, string, string, string, BackupLongTermRetentionPolicy) (BackupLongTermRetentionPoliciesCreateOrUpdateFuture, error) +1. BackupLongTermRetentionPoliciesClient.CreateOrUpdatePreparer(context.Context, string, string, string, BackupLongTermRetentionPolicy) (*http.Request, error) +1. BackupLongTermRetentionPoliciesClient.CreateOrUpdateResponder(*http.Response) (BackupLongTermRetentionPolicy, error) +1. BackupLongTermRetentionPoliciesClient.CreateOrUpdateSender(*http.Request) (BackupLongTermRetentionPoliciesCreateOrUpdateFuture, error) +1. BackupLongTermRetentionPoliciesClient.Get(context.Context, string, string, string) (BackupLongTermRetentionPolicy, error) +1. BackupLongTermRetentionPoliciesClient.GetPreparer(context.Context, string, string, string) (*http.Request, error) +1. BackupLongTermRetentionPoliciesClient.GetResponder(*http.Response) (BackupLongTermRetentionPolicy, error) +1. BackupLongTermRetentionPoliciesClient.GetSender(*http.Request) (*http.Response, error) +1. BackupLongTermRetentionPoliciesClient.ListByDatabase(context.Context, string, string, string) (BackupLongTermRetentionPolicy, error) +1. BackupLongTermRetentionPoliciesClient.ListByDatabasePreparer(context.Context, string, string, string) (*http.Request, error) +1. BackupLongTermRetentionPoliciesClient.ListByDatabaseResponder(*http.Response) (BackupLongTermRetentionPolicy, error) +1. BackupLongTermRetentionPoliciesClient.ListByDatabaseSender(*http.Request) (*http.Response, error) +1. BackupLongTermRetentionPolicy.MarshalJSON() ([]byte, error) +1. NewBackupLongTermRetentionPoliciesClient(string) BackupLongTermRetentionPoliciesClient +1. NewBackupLongTermRetentionPoliciesClientWithBaseURI(string, string) BackupLongTermRetentionPoliciesClient +1. PossibleDatabaseState1Values() []DatabaseState1 +1. PossibleDatabaseState2Values() []DatabaseState2 +1. PossibleDatabaseState3Values() []DatabaseState3 +1. PossibleDatabaseState4Values() []DatabaseState4 +1. PossibleDatabaseState5Values() []DatabaseState5 +1. PossibleDatabaseState6Values() []DatabaseState6 +1. PossibleLongTermRetentionDatabaseStateValues() []LongTermRetentionDatabaseState +1. SystemData.MarshalJSON() ([]byte, error) + +### Struct Changes + +#### Removed Structs + +1. BackupLongTermRetentionPoliciesClient +1. BackupLongTermRetentionPoliciesCreateOrUpdateFuture +1. BackupLongTermRetentionPolicy +1. LongTermRetentionPolicyProperties + +#### Removed Struct Fields + +1. DatabaseProperties.StorageAccountType + +### Signature Changes + +#### Const Types + +1. All changed type from DatabaseState1 to DatabaseState +1. Deleted changed type from DatabaseState1 to DatabaseState +1. Geo changed type from SecondaryType to BackupStorageRedundancy +1. Live changed type from DatabaseState1 to DatabaseState + +#### Funcs + +1. LongTermRetentionBackupsClient.ListByDatabase + - Params + - From: context.Context, string, string, string, *bool, LongTermRetentionDatabaseState + - To: context.Context, string, string, string, *bool, DatabaseState +1. LongTermRetentionBackupsClient.ListByDatabaseComplete + - Params + - From: context.Context, string, string, string, *bool, LongTermRetentionDatabaseState + - To: context.Context, string, string, string, *bool, DatabaseState +1. LongTermRetentionBackupsClient.ListByDatabasePreparer + - Params + - From: context.Context, string, string, string, *bool, LongTermRetentionDatabaseState + - To: context.Context, string, string, string, *bool, DatabaseState +1. LongTermRetentionBackupsClient.ListByLocation + - Params + - From: context.Context, string, *bool, LongTermRetentionDatabaseState + - To: context.Context, string, *bool, DatabaseState +1. LongTermRetentionBackupsClient.ListByLocationComplete + - Params + - From: context.Context, string, *bool, LongTermRetentionDatabaseState + - To: context.Context, string, *bool, DatabaseState +1. LongTermRetentionBackupsClient.ListByLocationPreparer + - Params + - From: context.Context, string, *bool, LongTermRetentionDatabaseState + - To: context.Context, string, *bool, DatabaseState +1. LongTermRetentionBackupsClient.ListByResourceGroupDatabase + - Params + - From: context.Context, string, string, string, string, *bool, LongTermRetentionDatabaseState + - To: context.Context, string, string, string, string, *bool, DatabaseState +1. LongTermRetentionBackupsClient.ListByResourceGroupDatabaseComplete + - Params + - From: context.Context, string, string, string, string, *bool, LongTermRetentionDatabaseState + - To: context.Context, string, string, string, string, *bool, DatabaseState +1. LongTermRetentionBackupsClient.ListByResourceGroupDatabasePreparer + - Params + - From: context.Context, string, string, string, string, *bool, LongTermRetentionDatabaseState + - To: context.Context, string, string, string, string, *bool, DatabaseState +1. LongTermRetentionBackupsClient.ListByResourceGroupLocation + - Params + - From: context.Context, string, string, *bool, LongTermRetentionDatabaseState + - To: context.Context, string, string, *bool, DatabaseState +1. LongTermRetentionBackupsClient.ListByResourceGroupLocationComplete + - Params + - From: context.Context, string, string, *bool, LongTermRetentionDatabaseState + - To: context.Context, string, string, *bool, DatabaseState +1. LongTermRetentionBackupsClient.ListByResourceGroupLocationPreparer + - Params + - From: context.Context, string, string, *bool, LongTermRetentionDatabaseState + - To: context.Context, string, string, *bool, DatabaseState +1. LongTermRetentionBackupsClient.ListByResourceGroupServer + - Params + - From: context.Context, string, string, string, *bool, LongTermRetentionDatabaseState + - To: context.Context, string, string, string, *bool, DatabaseState +1. LongTermRetentionBackupsClient.ListByResourceGroupServerComplete + - Params + - From: context.Context, string, string, string, *bool, LongTermRetentionDatabaseState + - To: context.Context, string, string, string, *bool, DatabaseState +1. LongTermRetentionBackupsClient.ListByResourceGroupServerPreparer + - Params + - From: context.Context, string, string, string, *bool, LongTermRetentionDatabaseState + - To: context.Context, string, string, string, *bool, DatabaseState +1. LongTermRetentionBackupsClient.ListByServer + - Params + - From: context.Context, string, string, *bool, LongTermRetentionDatabaseState + - To: context.Context, string, string, *bool, DatabaseState +1. LongTermRetentionBackupsClient.ListByServerComplete + - Params + - From: context.Context, string, string, *bool, LongTermRetentionDatabaseState + - To: context.Context, string, string, *bool, DatabaseState +1. LongTermRetentionBackupsClient.ListByServerPreparer + - Params + - From: context.Context, string, string, *bool, LongTermRetentionDatabaseState + - To: context.Context, string, string, *bool, DatabaseState +1. LongTermRetentionManagedInstanceBackupsClient.ListByDatabase + - Params + - From: context.Context, string, string, string, *bool, DatabaseState1 + - To: context.Context, string, string, string, *bool, DatabaseState +1. LongTermRetentionManagedInstanceBackupsClient.ListByDatabaseComplete + - Params + - From: context.Context, string, string, string, *bool, DatabaseState1 + - To: context.Context, string, string, string, *bool, DatabaseState +1. LongTermRetentionManagedInstanceBackupsClient.ListByDatabasePreparer + - Params + - From: context.Context, string, string, string, *bool, DatabaseState1 + - To: context.Context, string, string, string, *bool, DatabaseState +1. LongTermRetentionManagedInstanceBackupsClient.ListByInstance + - Params + - From: context.Context, string, string, *bool, DatabaseState2 + - To: context.Context, string, string, *bool, DatabaseState +1. LongTermRetentionManagedInstanceBackupsClient.ListByInstanceComplete + - Params + - From: context.Context, string, string, *bool, DatabaseState2 + - To: context.Context, string, string, *bool, DatabaseState +1. LongTermRetentionManagedInstanceBackupsClient.ListByInstancePreparer + - Params + - From: context.Context, string, string, *bool, DatabaseState2 + - To: context.Context, string, string, *bool, DatabaseState +1. LongTermRetentionManagedInstanceBackupsClient.ListByLocation + - Params + - From: context.Context, string, *bool, DatabaseState3 + - To: context.Context, string, *bool, DatabaseState +1. LongTermRetentionManagedInstanceBackupsClient.ListByLocationComplete + - Params + - From: context.Context, string, *bool, DatabaseState3 + - To: context.Context, string, *bool, DatabaseState +1. LongTermRetentionManagedInstanceBackupsClient.ListByLocationPreparer + - Params + - From: context.Context, string, *bool, DatabaseState3 + - To: context.Context, string, *bool, DatabaseState +1. LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupDatabase + - Params + - From: context.Context, string, string, string, string, *bool, DatabaseState4 + - To: context.Context, string, string, string, string, *bool, DatabaseState +1. LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupDatabaseComplete + - Params + - From: context.Context, string, string, string, string, *bool, DatabaseState4 + - To: context.Context, string, string, string, string, *bool, DatabaseState +1. LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupDatabasePreparer + - Params + - From: context.Context, string, string, string, string, *bool, DatabaseState4 + - To: context.Context, string, string, string, string, *bool, DatabaseState +1. LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupInstance + - Params + - From: context.Context, string, string, string, *bool, DatabaseState5 + - To: context.Context, string, string, string, *bool, DatabaseState +1. LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupInstanceComplete + - Params + - From: context.Context, string, string, string, *bool, DatabaseState5 + - To: context.Context, string, string, string, *bool, DatabaseState +1. LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupInstancePreparer + - Params + - From: context.Context, string, string, string, *bool, DatabaseState5 + - To: context.Context, string, string, string, *bool, DatabaseState +1. LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupLocation + - Params + - From: context.Context, string, string, *bool, DatabaseState6 + - To: context.Context, string, string, *bool, DatabaseState +1. LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupLocationComplete + - Params + - From: context.Context, string, string, *bool, DatabaseState6 + - To: context.Context, string, string, *bool, DatabaseState +1. LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupLocationPreparer + - Params + - From: context.Context, string, string, *bool, DatabaseState6 + - To: context.Context, string, string, *bool, DatabaseState ## Additive Changes +### New Constants + +1. BackupStorageRedundancy.Local +1. BackupStorageRedundancy.Zone +1. CurrentBackupStorageRedundancy.CurrentBackupStorageRedundancyGeo +1. CurrentBackupStorageRedundancy.CurrentBackupStorageRedundancyLocal +1. CurrentBackupStorageRedundancy.CurrentBackupStorageRedundancyZone +1. RequestedBackupStorageRedundancy.RequestedBackupStorageRedundancyGeo +1. RequestedBackupStorageRedundancy.RequestedBackupStorageRedundancyLocal +1. RequestedBackupStorageRedundancy.RequestedBackupStorageRedundancyZone +1. SecondaryType.SecondaryTypeGeo +1. SecondaryType.SecondaryTypeNamed +1. TargetBackupStorageRedundancy.TargetBackupStorageRedundancyGeo +1. TargetBackupStorageRedundancy.TargetBackupStorageRedundancyLocal +1. TargetBackupStorageRedundancy.TargetBackupStorageRedundancyZone + ### New Funcs -1. AdministratorListResult.MarshalJSON() ([]byte, error) -1. AutoPauseDelayTimeRange.MarshalJSON() ([]byte, error) -1. AzureADOnlyAuthListResult.MarshalJSON() ([]byte, error) -1. BackupShortTermRetentionPolicyListResult.MarshalJSON() ([]byte, error) -1. CheckNameAvailabilityResponse.MarshalJSON() ([]byte, error) -1. DatabaseBlobAuditingPolicyListResult.MarshalJSON() ([]byte, error) -1. DatabaseListResult.MarshalJSON() ([]byte, error) -1. DatabaseOperationListResult.MarshalJSON() ([]byte, error) -1. DatabaseOperationProperties.MarshalJSON() ([]byte, error) -1. DatabaseUsage.MarshalJSON() ([]byte, error) -1. DatabaseVulnerabilityAssessmentListResult.MarshalJSON() ([]byte, error) -1. DatabaseVulnerabilityAssessmentScanExportProperties.MarshalJSON() ([]byte, error) -1. ElasticPoolActivityProperties.MarshalJSON() ([]byte, error) -1. ElasticPoolDatabaseActivityProperties.MarshalJSON() ([]byte, error) -1. ElasticPoolListResult.MarshalJSON() ([]byte, error) -1. ElasticPoolOperationListResult.MarshalJSON() ([]byte, error) -1. ElasticPoolOperationProperties.MarshalJSON() ([]byte, error) -1. EncryptionProtectorListResult.MarshalJSON() ([]byte, error) -1. ExtendedDatabaseBlobAuditingPolicyListResult.MarshalJSON() ([]byte, error) -1. ExtendedServerBlobAuditingPolicyListResult.MarshalJSON() ([]byte, error) -1. FailoverGroupListResult.MarshalJSON() ([]byte, error) -1. ImportExportOperationResultProperties.MarshalJSON() ([]byte, error) -1. InstanceFailoverGroupListResult.MarshalJSON() ([]byte, error) -1. InstancePoolListResult.MarshalJSON() ([]byte, error) -1. JobAgentListResult.MarshalJSON() ([]byte, error) -1. JobCredentialListResult.MarshalJSON() ([]byte, error) -1. JobExecutionListResult.MarshalJSON() ([]byte, error) -1. JobExecutionTarget.MarshalJSON() ([]byte, error) -1. JobListResult.MarshalJSON() ([]byte, error) -1. JobStepListResult.MarshalJSON() ([]byte, error) -1. JobTargetGroupListResult.MarshalJSON() ([]byte, error) -1. JobVersion.MarshalJSON() ([]byte, error) -1. JobVersionListResult.MarshalJSON() ([]byte, error) -1. LogSizeCapability.MarshalJSON() ([]byte, error) -1. LogicalServerSecurityAlertPolicyListResult.MarshalJSON() ([]byte, error) -1. LongTermRetentionBackupListResult.MarshalJSON() ([]byte, error) -1. LongTermRetentionBackupProperties.MarshalJSON() ([]byte, error) -1. ManagedBackupShortTermRetentionPolicyListResult.MarshalJSON() ([]byte, error) -1. ManagedDatabaseListResult.MarshalJSON() ([]byte, error) -1. ManagedDatabaseRestoreDetailsProperties.MarshalJSON() ([]byte, error) -1. ManagedDatabaseSecurityAlertPolicyListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceAdministratorListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceAzureADOnlyAuthListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceEncryptionProtectorListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceKeyListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceLongTermRetentionBackupListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceLongTermRetentionBackupProperties.MarshalJSON() ([]byte, error) -1. ManagedInstanceLongTermRetentionPolicyListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceOperationListResult.MarshalJSON() ([]byte, error) -1. ManagedInstanceOperationParametersPair.MarshalJSON() ([]byte, error) -1. ManagedInstanceOperationProperties.MarshalJSON() ([]byte, error) -1. ManagedInstanceOperationSteps.MarshalJSON() ([]byte, error) -1. ManagedInstancePecProperty.MarshalJSON() ([]byte, error) -1. ManagedInstanceVulnerabilityAssessmentListResult.MarshalJSON() ([]byte, error) -1. ManagedServerSecurityAlertPolicyListResult.MarshalJSON() ([]byte, error) -1. MaxSizeCapability.MarshalJSON() ([]byte, error) -1. Metric.MarshalJSON() ([]byte, error) -1. MetricAvailability.MarshalJSON() ([]byte, error) -1. MetricDefinition.MarshalJSON() ([]byte, error) -1. MetricName.MarshalJSON() ([]byte, error) -1. MetricValue.MarshalJSON() ([]byte, error) -1. OperationDisplay.MarshalJSON() ([]byte, error) -1. OperationImpact.MarshalJSON() ([]byte, error) -1. OperationListResult.MarshalJSON() ([]byte, error) -1. PerformanceLevelCapability.MarshalJSON() ([]byte, error) -1. PrivateEndpointConnectionListResult.MarshalJSON() ([]byte, error) -1. PrivateEndpointConnectionRequestStatus.MarshalJSON() ([]byte, error) -1. PrivateLinkResource.MarshalJSON() ([]byte, error) -1. PrivateLinkResourceListResult.MarshalJSON() ([]byte, error) -1. PrivateLinkResourceProperties.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. QueryMetricProperties.MarshalJSON() ([]byte, error) -1. RecommendedIndexProperties.MarshalJSON() ([]byte, error) -1. RecoverableDatabaseProperties.MarshalJSON() ([]byte, error) -1. RecoverableManagedDatabaseListResult.MarshalJSON() ([]byte, error) -1. RecoverableManagedDatabaseProperties.MarshalJSON() ([]byte, error) -1. ReplicationLinkProperties.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. RestorableDroppedDatabaseProperties.MarshalJSON() ([]byte, error) -1. RestorableDroppedManagedDatabaseListResult.MarshalJSON() ([]byte, error) -1. RestorableDroppedManagedDatabaseProperties.MarshalJSON() ([]byte, error) -1. RestorePointListResult.MarshalJSON() ([]byte, error) -1. RestorePointProperties.MarshalJSON() ([]byte, error) -1. SensitivityLabelListResult.MarshalJSON() ([]byte, error) -1. ServerBlobAuditingPolicyListResult.MarshalJSON() ([]byte, error) -1. ServerDNSAliasListResult.MarshalJSON() ([]byte, error) -1. ServerDNSAliasProperties.MarshalJSON() ([]byte, error) -1. ServerDevOpsAuditSettingsListResult.MarshalJSON() ([]byte, error) -1. ServerKeyListResult.MarshalJSON() ([]byte, error) -1. ServerListResult.MarshalJSON() ([]byte, error) -1. ServerPrivateEndpointConnection.MarshalJSON() ([]byte, error) -1. ServerTrustGroupListResult.MarshalJSON() ([]byte, error) -1. ServerUsage.MarshalJSON() ([]byte, error) -1. ServerVulnerabilityAssessmentListResult.MarshalJSON() ([]byte, error) -1. ServiceObjectiveProperties.MarshalJSON() ([]byte, error) -1. ServiceTierAdvisorProperties.MarshalJSON() ([]byte, error) -1. SloUsageMetric.MarshalJSON() ([]byte, error) -1. SubscriptionUsageListResult.MarshalJSON() ([]byte, error) -1. SubscriptionUsageProperties.MarshalJSON() ([]byte, error) -1. SyncAgentKeyProperties.MarshalJSON() ([]byte, error) -1. SyncAgentLinkedDatabaseListResult.MarshalJSON() ([]byte, error) -1. SyncAgentLinkedDatabaseProperties.MarshalJSON() ([]byte, error) -1. SyncAgentListResult.MarshalJSON() ([]byte, error) -1. SyncDatabaseIDListResult.MarshalJSON() ([]byte, error) -1. SyncDatabaseIDProperties.MarshalJSON() ([]byte, error) -1. SyncFullSchemaProperties.MarshalJSON() ([]byte, error) -1. SyncFullSchemaPropertiesListResult.MarshalJSON() ([]byte, error) -1. SyncFullSchemaTable.MarshalJSON() ([]byte, error) -1. SyncFullSchemaTableColumn.MarshalJSON() ([]byte, error) -1. SyncGroupListResult.MarshalJSON() ([]byte, error) -1. SyncGroupLogListResult.MarshalJSON() ([]byte, error) -1. SyncGroupLogProperties.MarshalJSON() ([]byte, error) -1. SyncMemberListResult.MarshalJSON() ([]byte, error) -1. SystemData.MarshalJSON() ([]byte, error) -1. TopQueriesListResult.MarshalJSON() ([]byte, error) -1. TransparentDataEncryptionActivityProperties.MarshalJSON() ([]byte, error) -1. Usage.MarshalJSON() ([]byte, error) -1. UsageListResult.MarshalJSON() ([]byte, error) -1. VirtualClusterListResult.MarshalJSON() ([]byte, error) -1. VirtualNetworkRuleListResult.MarshalJSON() ([]byte, error) -1. VulnerabilityAssessmentScanError.MarshalJSON() ([]byte, error) -1. VulnerabilityAssessmentScanRecordListResult.MarshalJSON() ([]byte, error) -1. VulnerabilityAssessmentScanRecordProperties.MarshalJSON() ([]byte, error) -1. WorkloadClassifierListResult.MarshalJSON() ([]byte, error) -1. WorkloadGroupListResult.MarshalJSON() ([]byte, error) +1. *CopyLongTermRetentionBackupParameters.UnmarshalJSON([]byte) error +1. *LongTermRetentionBackupOperationResult.UnmarshalJSON([]byte) error +1. *LongTermRetentionBackupsCopyByResourceGroupFuture.UnmarshalJSON([]byte) error +1. *LongTermRetentionBackupsCopyFuture.UnmarshalJSON([]byte) error +1. *LongTermRetentionBackupsUpdateByResourceGroupFuture.UnmarshalJSON([]byte) error +1. *LongTermRetentionBackupsUpdateFuture.UnmarshalJSON([]byte) error +1. *LongTermRetentionPoliciesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *LongTermRetentionPolicy.UnmarshalJSON([]byte) error +1. *LongTermRetentionPolicyListResultIterator.Next() error +1. *LongTermRetentionPolicyListResultIterator.NextWithContext(context.Context) error +1. *LongTermRetentionPolicyListResultPage.Next() error +1. *LongTermRetentionPolicyListResultPage.NextWithContext(context.Context) error +1. *UpdateLongTermRetentionBackupParameters.UnmarshalJSON([]byte) error +1. CopyLongTermRetentionBackupParameters.MarshalJSON() ([]byte, error) +1. LongTermRetentionBackupOperationResult.MarshalJSON() ([]byte, error) +1. LongTermRetentionBackupsClient.Copy(context.Context, string, string, string, string, CopyLongTermRetentionBackupParameters) (LongTermRetentionBackupsCopyFuture, error) +1. LongTermRetentionBackupsClient.CopyByResourceGroup(context.Context, string, string, string, string, string, CopyLongTermRetentionBackupParameters) (LongTermRetentionBackupsCopyByResourceGroupFuture, error) +1. LongTermRetentionBackupsClient.CopyByResourceGroupPreparer(context.Context, string, string, string, string, string, CopyLongTermRetentionBackupParameters) (*http.Request, error) +1. LongTermRetentionBackupsClient.CopyByResourceGroupResponder(*http.Response) (LongTermRetentionBackupOperationResult, error) +1. LongTermRetentionBackupsClient.CopyByResourceGroupSender(*http.Request) (LongTermRetentionBackupsCopyByResourceGroupFuture, error) +1. LongTermRetentionBackupsClient.CopyPreparer(context.Context, string, string, string, string, CopyLongTermRetentionBackupParameters) (*http.Request, error) +1. LongTermRetentionBackupsClient.CopyResponder(*http.Response) (LongTermRetentionBackupOperationResult, error) +1. LongTermRetentionBackupsClient.CopySender(*http.Request) (LongTermRetentionBackupsCopyFuture, error) +1. LongTermRetentionBackupsClient.Update(context.Context, string, string, string, string, UpdateLongTermRetentionBackupParameters) (LongTermRetentionBackupsUpdateFuture, error) +1. LongTermRetentionBackupsClient.UpdateByResourceGroup(context.Context, string, string, string, string, string, UpdateLongTermRetentionBackupParameters) (LongTermRetentionBackupsUpdateByResourceGroupFuture, error) +1. LongTermRetentionBackupsClient.UpdateByResourceGroupPreparer(context.Context, string, string, string, string, string, UpdateLongTermRetentionBackupParameters) (*http.Request, error) +1. LongTermRetentionBackupsClient.UpdateByResourceGroupResponder(*http.Response) (LongTermRetentionBackupOperationResult, error) +1. LongTermRetentionBackupsClient.UpdateByResourceGroupSender(*http.Request) (LongTermRetentionBackupsUpdateByResourceGroupFuture, error) +1. LongTermRetentionBackupsClient.UpdatePreparer(context.Context, string, string, string, string, UpdateLongTermRetentionBackupParameters) (*http.Request, error) +1. LongTermRetentionBackupsClient.UpdateResponder(*http.Response) (LongTermRetentionBackupOperationResult, error) +1. LongTermRetentionBackupsClient.UpdateSender(*http.Request) (LongTermRetentionBackupsUpdateFuture, error) +1. LongTermRetentionOperationResultProperties.MarshalJSON() ([]byte, error) +1. LongTermRetentionPoliciesClient.CreateOrUpdate(context.Context, string, string, string, LongTermRetentionPolicy) (LongTermRetentionPoliciesCreateOrUpdateFuture, error) +1. LongTermRetentionPoliciesClient.CreateOrUpdatePreparer(context.Context, string, string, string, LongTermRetentionPolicy) (*http.Request, error) +1. LongTermRetentionPoliciesClient.CreateOrUpdateResponder(*http.Response) (LongTermRetentionPolicy, error) +1. LongTermRetentionPoliciesClient.CreateOrUpdateSender(*http.Request) (LongTermRetentionPoliciesCreateOrUpdateFuture, error) +1. LongTermRetentionPoliciesClient.Get(context.Context, string, string, string) (LongTermRetentionPolicy, error) +1. LongTermRetentionPoliciesClient.GetPreparer(context.Context, string, string, string) (*http.Request, error) +1. LongTermRetentionPoliciesClient.GetResponder(*http.Response) (LongTermRetentionPolicy, error) +1. LongTermRetentionPoliciesClient.GetSender(*http.Request) (*http.Response, error) +1. LongTermRetentionPoliciesClient.ListByDatabase(context.Context, string, string, string) (LongTermRetentionPolicyListResultPage, error) +1. LongTermRetentionPoliciesClient.ListByDatabaseComplete(context.Context, string, string, string) (LongTermRetentionPolicyListResultIterator, error) +1. LongTermRetentionPoliciesClient.ListByDatabasePreparer(context.Context, string, string, string) (*http.Request, error) +1. LongTermRetentionPoliciesClient.ListByDatabaseResponder(*http.Response) (LongTermRetentionPolicyListResult, error) +1. LongTermRetentionPoliciesClient.ListByDatabaseSender(*http.Request) (*http.Response, error) +1. LongTermRetentionPolicy.MarshalJSON() ([]byte, error) +1. LongTermRetentionPolicyListResult.IsEmpty() bool +1. LongTermRetentionPolicyListResult.MarshalJSON() ([]byte, error) +1. LongTermRetentionPolicyListResultIterator.NotDone() bool +1. LongTermRetentionPolicyListResultIterator.Response() LongTermRetentionPolicyListResult +1. LongTermRetentionPolicyListResultIterator.Value() LongTermRetentionPolicy +1. LongTermRetentionPolicyListResultPage.NotDone() bool +1. LongTermRetentionPolicyListResultPage.Response() LongTermRetentionPolicyListResult +1. LongTermRetentionPolicyListResultPage.Values() []LongTermRetentionPolicy +1. NewLongTermRetentionPoliciesClient(string) LongTermRetentionPoliciesClient +1. NewLongTermRetentionPoliciesClientWithBaseURI(string, string) LongTermRetentionPoliciesClient +1. NewLongTermRetentionPolicyListResultIterator(LongTermRetentionPolicyListResultPage) LongTermRetentionPolicyListResultIterator +1. NewLongTermRetentionPolicyListResultPage(LongTermRetentionPolicyListResult, func(context.Context, LongTermRetentionPolicyListResult) (LongTermRetentionPolicyListResult, error)) LongTermRetentionPolicyListResultPage +1. PossibleBackupStorageRedundancyValues() []BackupStorageRedundancy +1. PossibleCurrentBackupStorageRedundancyValues() []CurrentBackupStorageRedundancy +1. PossibleDatabaseStateValues() []DatabaseState +1. PossibleRequestedBackupStorageRedundancyValues() []RequestedBackupStorageRedundancy +1. PossibleTargetBackupStorageRedundancyValues() []TargetBackupStorageRedundancy +1. UpdateLongTermRetentionBackupParameters.MarshalJSON() ([]byte, error) + +### Struct Changes + +#### New Structs + +1. CopyLongTermRetentionBackupParameters +1. CopyLongTermRetentionBackupParametersProperties +1. LongTermRetentionBackupOperationResult +1. LongTermRetentionBackupsCopyByResourceGroupFuture +1. LongTermRetentionBackupsCopyFuture +1. LongTermRetentionBackupsUpdateByResourceGroupFuture +1. LongTermRetentionBackupsUpdateFuture +1. LongTermRetentionOperationResultProperties +1. LongTermRetentionPoliciesClient +1. LongTermRetentionPoliciesCreateOrUpdateFuture +1. LongTermRetentionPolicy +1. LongTermRetentionPolicyListResult +1. LongTermRetentionPolicyListResultIterator +1. LongTermRetentionPolicyListResultPage +1. UpdateLongTermRetentionBackupParameters +1. UpdateLongTermRetentionBackupParametersProperties + +#### New Struct Fields + +1. DatabaseProperties.CurrentBackupStorageRedundancy +1. DatabaseProperties.RequestedBackupStorageRedundancy +1. LongTermRetentionBackupProperties.BackupStorageRedundancy +1. LongTermRetentionBackupProperties.RequestedBackupStorageRedundancy diff --git a/services/preview/sql/mgmt/v4.0/sql/_meta.json b/services/preview/sql/mgmt/v4.0/sql/_meta.json index cd7a79ec4d39..b497a0bd3931 100644 --- a/services/preview/sql/mgmt/v4.0/sql/_meta.json +++ b/services/preview/sql/mgmt/v4.0/sql/_meta.json @@ -1,5 +1,5 @@ { - "commit": "a1eee0489c374782a934ec1f093abd16fa7718ca", + "commit": "a07f49e3f75a134c1acdacc338c9f9dc32386f66", "readme": "/_/azure-rest-api-specs/specification/sql/resource-manager/readme.md", "tag": "package-composite-v4", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/services/preview/sql/mgmt/v4.0/sql/databases.go b/services/preview/sql/mgmt/v4.0/sql/databases.go index a6fd694d53a0..a99c63451041 100644 --- a/services/preview/sql/mgmt/v4.0/sql/databases.go +++ b/services/preview/sql/mgmt/v4.0/sql/databases.go @@ -86,7 +86,7 @@ func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-08-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -171,7 +171,7 @@ func (client DatabasesClient) DeletePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-08-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -345,7 +345,7 @@ func (client DatabasesClient) FailoverPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-08-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -435,7 +435,7 @@ func (client DatabasesClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-08-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -519,7 +519,7 @@ func (client DatabasesClient) ListByElasticPoolPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-08-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -638,7 +638,7 @@ func (client DatabasesClient) ListByServerPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-08-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -757,7 +757,7 @@ func (client DatabasesClient) ListInaccessibleByServerPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-08-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1026,7 +1026,7 @@ func (client DatabasesClient) PausePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-08-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1121,7 +1121,7 @@ func (client DatabasesClient) RenamePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-08-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1194,7 +1194,7 @@ func (client DatabasesClient) ResumePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-08-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1276,7 +1276,7 @@ func (client DatabasesClient) UpdatePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-08-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1359,7 +1359,7 @@ func (client DatabasesClient) UpgradeDataWarehousePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-08-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/sql/mgmt/v4.0/sql/enums.go b/services/preview/sql/mgmt/v4.0/sql/enums.go index eb3318b849a1..6a929bdbf2d7 100644 --- a/services/preview/sql/mgmt/v4.0/sql/enums.go +++ b/services/preview/sql/mgmt/v4.0/sql/enums.go @@ -137,6 +137,23 @@ func PossibleAutomaticTuningServerReasonValues() []AutomaticTuningServerReason { return []AutomaticTuningServerReason{AutomaticTuningServerReasonAutoConfigured, AutomaticTuningServerReasonDefault, AutomaticTuningServerReasonDisabled} } +// BackupStorageRedundancy enumerates the values for backup storage redundancy. +type BackupStorageRedundancy string + +const ( + // Geo ... + Geo BackupStorageRedundancy = "Geo" + // Local ... + Local BackupStorageRedundancy = "Local" + // Zone ... + Zone BackupStorageRedundancy = "Zone" +) + +// PossibleBackupStorageRedundancyValues returns an array of possible values for the BackupStorageRedundancy const type. +func PossibleBackupStorageRedundancyValues() []BackupStorageRedundancy { + return []BackupStorageRedundancy{Geo, Local, Zone} +} + // BlobAuditingPolicyState enumerates the values for blob auditing policy state. type BlobAuditingPolicyState string @@ -272,6 +289,23 @@ func PossibleCreateModeValues() []CreateMode { return []CreateMode{CreateModeCopy, CreateModeDefault, CreateModeOnlineSecondary, CreateModePointInTimeRestore, CreateModeRecovery, CreateModeRestore, CreateModeRestoreExternalBackup, CreateModeRestoreExternalBackupSecondary, CreateModeRestoreLongTermRetentionBackup, CreateModeSecondary} } +// CurrentBackupStorageRedundancy enumerates the values for current backup storage redundancy. +type CurrentBackupStorageRedundancy string + +const ( + // CurrentBackupStorageRedundancyGeo ... + CurrentBackupStorageRedundancyGeo CurrentBackupStorageRedundancy = "Geo" + // CurrentBackupStorageRedundancyLocal ... + CurrentBackupStorageRedundancyLocal CurrentBackupStorageRedundancy = "Local" + // CurrentBackupStorageRedundancyZone ... + CurrentBackupStorageRedundancyZone CurrentBackupStorageRedundancy = "Zone" +) + +// PossibleCurrentBackupStorageRedundancyValues returns an array of possible values for the CurrentBackupStorageRedundancy const type. +func PossibleCurrentBackupStorageRedundancyValues() []CurrentBackupStorageRedundancy { + return []CurrentBackupStorageRedundancy{CurrentBackupStorageRedundancyGeo, CurrentBackupStorageRedundancyLocal, CurrentBackupStorageRedundancyZone} +} + // DatabaseLicenseType enumerates the values for database license type. type DatabaseLicenseType string @@ -302,106 +336,21 @@ func PossibleDatabaseReadScaleValues() []DatabaseReadScale { return []DatabaseReadScale{DatabaseReadScaleDisabled, DatabaseReadScaleEnabled} } -// DatabaseState1 enumerates the values for database state 1. -type DatabaseState1 string +// DatabaseState enumerates the values for database state. +type DatabaseState string const ( // All ... - All DatabaseState1 = "All" + All DatabaseState = "All" // Deleted ... - Deleted DatabaseState1 = "Deleted" + Deleted DatabaseState = "Deleted" // Live ... - Live DatabaseState1 = "Live" -) - -// PossibleDatabaseState1Values returns an array of possible values for the DatabaseState1 const type. -func PossibleDatabaseState1Values() []DatabaseState1 { - return []DatabaseState1{All, Deleted, Live} -} - -// DatabaseState2 enumerates the values for database state 2. -type DatabaseState2 string - -const ( - // DatabaseState2All ... - DatabaseState2All DatabaseState2 = "All" - // DatabaseState2Deleted ... - DatabaseState2Deleted DatabaseState2 = "Deleted" - // DatabaseState2Live ... - DatabaseState2Live DatabaseState2 = "Live" -) - -// PossibleDatabaseState2Values returns an array of possible values for the DatabaseState2 const type. -func PossibleDatabaseState2Values() []DatabaseState2 { - return []DatabaseState2{DatabaseState2All, DatabaseState2Deleted, DatabaseState2Live} -} - -// DatabaseState3 enumerates the values for database state 3. -type DatabaseState3 string - -const ( - // DatabaseState3All ... - DatabaseState3All DatabaseState3 = "All" - // DatabaseState3Deleted ... - DatabaseState3Deleted DatabaseState3 = "Deleted" - // DatabaseState3Live ... - DatabaseState3Live DatabaseState3 = "Live" -) - -// PossibleDatabaseState3Values returns an array of possible values for the DatabaseState3 const type. -func PossibleDatabaseState3Values() []DatabaseState3 { - return []DatabaseState3{DatabaseState3All, DatabaseState3Deleted, DatabaseState3Live} -} - -// DatabaseState4 enumerates the values for database state 4. -type DatabaseState4 string - -const ( - // DatabaseState4All ... - DatabaseState4All DatabaseState4 = "All" - // DatabaseState4Deleted ... - DatabaseState4Deleted DatabaseState4 = "Deleted" - // DatabaseState4Live ... - DatabaseState4Live DatabaseState4 = "Live" + Live DatabaseState = "Live" ) -// PossibleDatabaseState4Values returns an array of possible values for the DatabaseState4 const type. -func PossibleDatabaseState4Values() []DatabaseState4 { - return []DatabaseState4{DatabaseState4All, DatabaseState4Deleted, DatabaseState4Live} -} - -// DatabaseState5 enumerates the values for database state 5. -type DatabaseState5 string - -const ( - // DatabaseState5All ... - DatabaseState5All DatabaseState5 = "All" - // DatabaseState5Deleted ... - DatabaseState5Deleted DatabaseState5 = "Deleted" - // DatabaseState5Live ... - DatabaseState5Live DatabaseState5 = "Live" -) - -// PossibleDatabaseState5Values returns an array of possible values for the DatabaseState5 const type. -func PossibleDatabaseState5Values() []DatabaseState5 { - return []DatabaseState5{DatabaseState5All, DatabaseState5Deleted, DatabaseState5Live} -} - -// DatabaseState6 enumerates the values for database state 6. -type DatabaseState6 string - -const ( - // DatabaseState6All ... - DatabaseState6All DatabaseState6 = "All" - // DatabaseState6Deleted ... - DatabaseState6Deleted DatabaseState6 = "Deleted" - // DatabaseState6Live ... - DatabaseState6Live DatabaseState6 = "Live" -) - -// PossibleDatabaseState6Values returns an array of possible values for the DatabaseState6 const type. -func PossibleDatabaseState6Values() []DatabaseState6 { - return []DatabaseState6{DatabaseState6All, DatabaseState6Deleted, DatabaseState6Live} +// PossibleDatabaseStateValues returns an array of possible values for the DatabaseState const type. +func PossibleDatabaseStateValues() []DatabaseState { + return []DatabaseState{All, Deleted, Live} } // DatabaseStatus enumerates the values for database status. @@ -803,23 +752,6 @@ func PossibleLogSizeUnitValues() []LogSizeUnit { return []LogSizeUnit{Gigabytes, Megabytes, Percent, Petabytes, Terabytes} } -// LongTermRetentionDatabaseState enumerates the values for long term retention database state. -type LongTermRetentionDatabaseState string - -const ( - // LongTermRetentionDatabaseStateAll ... - LongTermRetentionDatabaseStateAll LongTermRetentionDatabaseState = "All" - // LongTermRetentionDatabaseStateDeleted ... - LongTermRetentionDatabaseStateDeleted LongTermRetentionDatabaseState = "Deleted" - // LongTermRetentionDatabaseStateLive ... - LongTermRetentionDatabaseStateLive LongTermRetentionDatabaseState = "Live" -) - -// PossibleLongTermRetentionDatabaseStateValues returns an array of possible values for the LongTermRetentionDatabaseState const type. -func PossibleLongTermRetentionDatabaseStateValues() []LongTermRetentionDatabaseState { - return []LongTermRetentionDatabaseState{LongTermRetentionDatabaseStateAll, LongTermRetentionDatabaseStateDeleted, LongTermRetentionDatabaseStateLive} -} - // ManagedDatabaseCreateMode enumerates the values for managed database create mode. type ManagedDatabaseCreateMode string @@ -1329,6 +1261,23 @@ func PossibleReplicaTypeValues() []ReplicaType { return []ReplicaType{ReplicaTypePrimary, ReplicaTypeReadableSecondary} } +// RequestedBackupStorageRedundancy enumerates the values for requested backup storage redundancy. +type RequestedBackupStorageRedundancy string + +const ( + // RequestedBackupStorageRedundancyGeo ... + RequestedBackupStorageRedundancyGeo RequestedBackupStorageRedundancy = "Geo" + // RequestedBackupStorageRedundancyLocal ... + RequestedBackupStorageRedundancyLocal RequestedBackupStorageRedundancy = "Local" + // RequestedBackupStorageRedundancyZone ... + RequestedBackupStorageRedundancyZone RequestedBackupStorageRedundancy = "Zone" +) + +// PossibleRequestedBackupStorageRedundancyValues returns an array of possible values for the RequestedBackupStorageRedundancy const type. +func PossibleRequestedBackupStorageRedundancyValues() []RequestedBackupStorageRedundancy { + return []RequestedBackupStorageRedundancy{RequestedBackupStorageRedundancyGeo, RequestedBackupStorageRedundancyLocal, RequestedBackupStorageRedundancyZone} +} + // RestorePointType enumerates the values for restore point type. type RestorePointType string @@ -1365,15 +1314,15 @@ func PossibleSampleNameValues() []SampleName { type SecondaryType string const ( - // Geo ... - Geo SecondaryType = "Geo" - // Named ... - Named SecondaryType = "Named" + // SecondaryTypeGeo ... + SecondaryTypeGeo SecondaryType = "Geo" + // SecondaryTypeNamed ... + SecondaryTypeNamed SecondaryType = "Named" ) // PossibleSecondaryTypeValues returns an array of possible values for the SecondaryType const type. func PossibleSecondaryTypeValues() []SecondaryType { - return []SecondaryType{Geo, Named} + return []SecondaryType{SecondaryTypeGeo, SecondaryTypeNamed} } // SecurityAlertPolicyEmailAccountAdmins enumerates the values for security alert policy email account admins. @@ -1870,6 +1819,23 @@ func PossibleSyncMemberStateValues() []SyncMemberState { return []SyncMemberState{DeProvisioned, DeProvisionFailed, DeProvisioning, DisabledBackupRestore, DisabledTombstoneCleanup, Provisioned, ProvisionFailed, Provisioning, ReprovisionFailed, Reprovisioning, SyncCancelled, SyncCancelling, SyncFailed, SyncInProgress, SyncSucceeded, SyncSucceededWithWarnings, UnProvisioned, UnReprovisioned} } +// TargetBackupStorageRedundancy enumerates the values for target backup storage redundancy. +type TargetBackupStorageRedundancy string + +const ( + // TargetBackupStorageRedundancyGeo ... + TargetBackupStorageRedundancyGeo TargetBackupStorageRedundancy = "Geo" + // TargetBackupStorageRedundancyLocal ... + TargetBackupStorageRedundancyLocal TargetBackupStorageRedundancy = "Local" + // TargetBackupStorageRedundancyZone ... + TargetBackupStorageRedundancyZone TargetBackupStorageRedundancy = "Zone" +) + +// PossibleTargetBackupStorageRedundancyValues returns an array of possible values for the TargetBackupStorageRedundancy const type. +func PossibleTargetBackupStorageRedundancyValues() []TargetBackupStorageRedundancy { + return []TargetBackupStorageRedundancy{TargetBackupStorageRedundancyGeo, TargetBackupStorageRedundancyLocal, TargetBackupStorageRedundancyZone} +} + // TransparentDataEncryptionActivityStatus enumerates the values for transparent data encryption activity // status. type TransparentDataEncryptionActivityStatus string diff --git a/services/preview/sql/mgmt/v4.0/sql/longtermretentionbackups.go b/services/preview/sql/mgmt/v4.0/sql/longtermretentionbackups.go index 5eaaaaf63773..9936c1b783ae 100644 --- a/services/preview/sql/mgmt/v4.0/sql/longtermretentionbackups.go +++ b/services/preview/sql/mgmt/v4.0/sql/longtermretentionbackups.go @@ -33,6 +33,179 @@ func NewLongTermRetentionBackupsClientWithBaseURI(baseURI string, subscriptionID return LongTermRetentionBackupsClient{NewWithBaseURI(baseURI, subscriptionID)} } +// Copy copy an existing long term retention backup. +// Parameters: +// locationName - the location of the database. +// longTermRetentionServerName - the name of the server +// longTermRetentionDatabaseName - the name of the database +// backupName - the backup name. +// parameters - the parameters needed for long term retention copy request +func (client LongTermRetentionBackupsClient) Copy(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters CopyLongTermRetentionBackupParameters) (result LongTermRetentionBackupsCopyFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.Copy") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CopyPreparer(ctx, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "Copy", nil, "Failure preparing request") + return + } + + result, err = client.CopySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "Copy", nil, "Failure sending request") + return + } + + return +} + +// CopyPreparer prepares the Copy request. +func (client LongTermRetentionBackupsClient) CopyPreparer(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters CopyLongTermRetentionBackupParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backupName": autorest.Encode("path", backupName), + "locationName": autorest.Encode("path", locationName), + "longTermRetentionDatabaseName": autorest.Encode("path", longTermRetentionDatabaseName), + "longTermRetentionServerName": autorest.Encode("path", longTermRetentionServerName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CopySender sends the Copy request. The method will close the +// http.Response Body if it receives an error. +func (client LongTermRetentionBackupsClient) CopySender(req *http.Request) (future LongTermRetentionBackupsCopyFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CopyResponder handles the response to the Copy request. The method always +// closes the http.Response Body. +func (client LongTermRetentionBackupsClient) CopyResponder(resp *http.Response) (result LongTermRetentionBackupOperationResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CopyByResourceGroup copy an existing long term retention backup to a different 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. +// locationName - the location of the database. +// longTermRetentionServerName - the name of the server +// longTermRetentionDatabaseName - the name of the database +// backupName - the backup name. +// parameters - the parameters needed for long term retention copy request +func (client LongTermRetentionBackupsClient) CopyByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters CopyLongTermRetentionBackupParameters) (result LongTermRetentionBackupsCopyByResourceGroupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.CopyByResourceGroup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CopyByResourceGroupPreparer(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "CopyByResourceGroup", nil, "Failure preparing request") + return + } + + result, err = client.CopyByResourceGroupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "CopyByResourceGroup", nil, "Failure sending request") + return + } + + return +} + +// CopyByResourceGroupPreparer prepares the CopyByResourceGroup request. +func (client LongTermRetentionBackupsClient) CopyByResourceGroupPreparer(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters CopyLongTermRetentionBackupParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backupName": autorest.Encode("path", backupName), + "locationName": autorest.Encode("path", locationName), + "longTermRetentionDatabaseName": autorest.Encode("path", longTermRetentionDatabaseName), + "longTermRetentionServerName": autorest.Encode("path", longTermRetentionServerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CopyByResourceGroupSender sends the CopyByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client LongTermRetentionBackupsClient) CopyByResourceGroupSender(req *http.Request) (future LongTermRetentionBackupsCopyByResourceGroupFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CopyByResourceGroupResponder handles the response to the CopyByResourceGroup request. The method always +// closes the http.Response Body. +func (client LongTermRetentionBackupsClient) CopyByResourceGroupResponder(resp *http.Response) (result LongTermRetentionBackupOperationResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Delete deletes a long term retention backup. // Parameters: // locationName - the location of the database @@ -75,7 +248,7 @@ func (client LongTermRetentionBackupsClient) DeletePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +332,7 @@ func (client LongTermRetentionBackupsClient) DeleteByResourceGroupPreparer(ctx c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -247,7 +420,7 @@ func (client LongTermRetentionBackupsClient) GetPreparer(ctx context.Context, lo "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -330,7 +503,7 @@ func (client LongTermRetentionBackupsClient) GetByResourceGroupPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -368,7 +541,7 @@ func (client LongTermRetentionBackupsClient) GetByResourceGroupResponder(resp *h // longTermRetentionDatabaseName - the name of the database // onlyLatestPerDatabase - whether or not to only get the latest backup for each database. // databaseState - whether to query against just live databases, just deleted databases, or all databases. -func (client LongTermRetentionBackupsClient) ListByDatabase(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultPage, err error) { +func (client LongTermRetentionBackupsClient) ListByDatabase(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result LongTermRetentionBackupListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByDatabase") defer func() { @@ -407,7 +580,7 @@ func (client LongTermRetentionBackupsClient) ListByDatabase(ctx context.Context, } // ListByDatabasePreparer prepares the ListByDatabase request. -func (client LongTermRetentionBackupsClient) ListByDatabasePreparer(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (*http.Request, error) { +func (client LongTermRetentionBackupsClient) ListByDatabasePreparer(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (*http.Request, error) { pathParameters := map[string]interface{}{ "locationName": autorest.Encode("path", locationName), "longTermRetentionDatabaseName": autorest.Encode("path", longTermRetentionDatabaseName), @@ -415,7 +588,7 @@ func (client LongTermRetentionBackupsClient) ListByDatabasePreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -474,7 +647,7 @@ func (client LongTermRetentionBackupsClient) listByDatabaseNextResults(ctx conte } // ListByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client LongTermRetentionBackupsClient) ListByDatabaseComplete(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultIterator, err error) { +func (client LongTermRetentionBackupsClient) ListByDatabaseComplete(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result LongTermRetentionBackupListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByDatabase") defer func() { @@ -494,7 +667,7 @@ func (client LongTermRetentionBackupsClient) ListByDatabaseComplete(ctx context. // locationName - the location of the database // onlyLatestPerDatabase - whether or not to only get the latest backup for each database. // databaseState - whether to query against just live databases, just deleted databases, or all databases. -func (client LongTermRetentionBackupsClient) ListByLocation(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultPage, err error) { +func (client LongTermRetentionBackupsClient) ListByLocation(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result LongTermRetentionBackupListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByLocation") defer func() { @@ -533,13 +706,13 @@ func (client LongTermRetentionBackupsClient) ListByLocation(ctx context.Context, } // ListByLocationPreparer prepares the ListByLocation request. -func (client LongTermRetentionBackupsClient) ListByLocationPreparer(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (*http.Request, error) { +func (client LongTermRetentionBackupsClient) ListByLocationPreparer(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (*http.Request, error) { pathParameters := map[string]interface{}{ "locationName": autorest.Encode("path", locationName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -598,7 +771,7 @@ func (client LongTermRetentionBackupsClient) listByLocationNextResults(ctx conte } // ListByLocationComplete enumerates all values, automatically crossing page boundaries as required. -func (client LongTermRetentionBackupsClient) ListByLocationComplete(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultIterator, err error) { +func (client LongTermRetentionBackupsClient) ListByLocationComplete(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result LongTermRetentionBackupListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByLocation") defer func() { @@ -622,7 +795,7 @@ func (client LongTermRetentionBackupsClient) ListByLocationComplete(ctx context. // longTermRetentionDatabaseName - the name of the database // onlyLatestPerDatabase - whether or not to only get the latest backup for each database. // databaseState - whether to query against just live databases, just deleted databases, or all databases. -func (client LongTermRetentionBackupsClient) ListByResourceGroupDatabase(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultPage, err error) { +func (client LongTermRetentionBackupsClient) ListByResourceGroupDatabase(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result LongTermRetentionBackupListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByResourceGroupDatabase") defer func() { @@ -661,7 +834,7 @@ func (client LongTermRetentionBackupsClient) ListByResourceGroupDatabase(ctx con } // ListByResourceGroupDatabasePreparer prepares the ListByResourceGroupDatabase request. -func (client LongTermRetentionBackupsClient) ListByResourceGroupDatabasePreparer(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (*http.Request, error) { +func (client LongTermRetentionBackupsClient) ListByResourceGroupDatabasePreparer(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (*http.Request, error) { pathParameters := map[string]interface{}{ "locationName": autorest.Encode("path", locationName), "longTermRetentionDatabaseName": autorest.Encode("path", longTermRetentionDatabaseName), @@ -670,7 +843,7 @@ func (client LongTermRetentionBackupsClient) ListByResourceGroupDatabasePreparer "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -729,7 +902,7 @@ func (client LongTermRetentionBackupsClient) listByResourceGroupDatabaseNextResu } // ListByResourceGroupDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client LongTermRetentionBackupsClient) ListByResourceGroupDatabaseComplete(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultIterator, err error) { +func (client LongTermRetentionBackupsClient) ListByResourceGroupDatabaseComplete(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result LongTermRetentionBackupListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByResourceGroupDatabase") defer func() { @@ -751,7 +924,7 @@ func (client LongTermRetentionBackupsClient) ListByResourceGroupDatabaseComplete // locationName - the location of the database // onlyLatestPerDatabase - whether or not to only get the latest backup for each database. // databaseState - whether to query against just live databases, just deleted databases, or all databases. -func (client LongTermRetentionBackupsClient) ListByResourceGroupLocation(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultPage, err error) { +func (client LongTermRetentionBackupsClient) ListByResourceGroupLocation(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result LongTermRetentionBackupListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByResourceGroupLocation") defer func() { @@ -790,14 +963,14 @@ func (client LongTermRetentionBackupsClient) ListByResourceGroupLocation(ctx con } // ListByResourceGroupLocationPreparer prepares the ListByResourceGroupLocation request. -func (client LongTermRetentionBackupsClient) ListByResourceGroupLocationPreparer(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (*http.Request, error) { +func (client LongTermRetentionBackupsClient) ListByResourceGroupLocationPreparer(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (*http.Request, error) { pathParameters := map[string]interface{}{ "locationName": autorest.Encode("path", locationName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -856,7 +1029,7 @@ func (client LongTermRetentionBackupsClient) listByResourceGroupLocationNextResu } // ListByResourceGroupLocationComplete enumerates all values, automatically crossing page boundaries as required. -func (client LongTermRetentionBackupsClient) ListByResourceGroupLocationComplete(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultIterator, err error) { +func (client LongTermRetentionBackupsClient) ListByResourceGroupLocationComplete(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result LongTermRetentionBackupListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByResourceGroupLocation") defer func() { @@ -879,7 +1052,7 @@ func (client LongTermRetentionBackupsClient) ListByResourceGroupLocationComplete // longTermRetentionServerName - the name of the server // onlyLatestPerDatabase - whether or not to only get the latest backup for each database. // databaseState - whether to query against just live databases, just deleted databases, or all databases. -func (client LongTermRetentionBackupsClient) ListByResourceGroupServer(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultPage, err error) { +func (client LongTermRetentionBackupsClient) ListByResourceGroupServer(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result LongTermRetentionBackupListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByResourceGroupServer") defer func() { @@ -918,7 +1091,7 @@ func (client LongTermRetentionBackupsClient) ListByResourceGroupServer(ctx conte } // ListByResourceGroupServerPreparer prepares the ListByResourceGroupServer request. -func (client LongTermRetentionBackupsClient) ListByResourceGroupServerPreparer(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (*http.Request, error) { +func (client LongTermRetentionBackupsClient) ListByResourceGroupServerPreparer(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (*http.Request, error) { pathParameters := map[string]interface{}{ "locationName": autorest.Encode("path", locationName), "longTermRetentionServerName": autorest.Encode("path", longTermRetentionServerName), @@ -926,7 +1099,7 @@ func (client LongTermRetentionBackupsClient) ListByResourceGroupServerPreparer(c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -985,7 +1158,7 @@ func (client LongTermRetentionBackupsClient) listByResourceGroupServerNextResult } // ListByResourceGroupServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client LongTermRetentionBackupsClient) ListByResourceGroupServerComplete(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultIterator, err error) { +func (client LongTermRetentionBackupsClient) ListByResourceGroupServerComplete(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result LongTermRetentionBackupListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByResourceGroupServer") defer func() { @@ -1006,7 +1179,7 @@ func (client LongTermRetentionBackupsClient) ListByResourceGroupServerComplete(c // longTermRetentionServerName - the name of the server // onlyLatestPerDatabase - whether or not to only get the latest backup for each database. // databaseState - whether to query against just live databases, just deleted databases, or all databases. -func (client LongTermRetentionBackupsClient) ListByServer(ctx context.Context, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultPage, err error) { +func (client LongTermRetentionBackupsClient) ListByServer(ctx context.Context, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result LongTermRetentionBackupListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByServer") defer func() { @@ -1045,14 +1218,14 @@ func (client LongTermRetentionBackupsClient) ListByServer(ctx context.Context, l } // ListByServerPreparer prepares the ListByServer request. -func (client LongTermRetentionBackupsClient) ListByServerPreparer(ctx context.Context, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (*http.Request, error) { +func (client LongTermRetentionBackupsClient) ListByServerPreparer(ctx context.Context, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (*http.Request, error) { pathParameters := map[string]interface{}{ "locationName": autorest.Encode("path", locationName), "longTermRetentionServerName": autorest.Encode("path", longTermRetentionServerName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1111,7 +1284,7 @@ func (client LongTermRetentionBackupsClient) listByServerNextResults(ctx context } // ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client LongTermRetentionBackupsClient) ListByServerComplete(ctx context.Context, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState LongTermRetentionDatabaseState) (result LongTermRetentionBackupListResultIterator, err error) { +func (client LongTermRetentionBackupsClient) ListByServerComplete(ctx context.Context, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result LongTermRetentionBackupListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.ListByServer") defer func() { @@ -1125,3 +1298,176 @@ func (client LongTermRetentionBackupsClient) ListByServerComplete(ctx context.Co result.page, err = client.ListByServer(ctx, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState) return } + +// Update updates an existing long term retention backup. +// Parameters: +// locationName - the location of the database. +// longTermRetentionServerName - the name of the server +// longTermRetentionDatabaseName - the name of the database +// backupName - the backup name. +// parameters - the requested backup resource state +func (client LongTermRetentionBackupsClient) Update(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters UpdateLongTermRetentionBackupParameters) (result LongTermRetentionBackupsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "Update", nil, "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client LongTermRetentionBackupsClient) UpdatePreparer(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters UpdateLongTermRetentionBackupParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backupName": autorest.Encode("path", backupName), + "locationName": autorest.Encode("path", locationName), + "longTermRetentionDatabaseName": autorest.Encode("path", longTermRetentionDatabaseName), + "longTermRetentionServerName": autorest.Encode("path", longTermRetentionServerName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update", 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 LongTermRetentionBackupsClient) UpdateSender(req *http.Request) (future LongTermRetentionBackupsUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client LongTermRetentionBackupsClient) UpdateResponder(resp *http.Response) (result LongTermRetentionBackupOperationResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateByResourceGroup updates an existing long term retention backup. +// 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. +// locationName - the location of the database. +// longTermRetentionServerName - the name of the server +// longTermRetentionDatabaseName - the name of the database +// backupName - the backup name. +// parameters - the requested backup resource state +func (client LongTermRetentionBackupsClient) UpdateByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters UpdateLongTermRetentionBackupParameters) (result LongTermRetentionBackupsUpdateByResourceGroupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupsClient.UpdateByResourceGroup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateByResourceGroupPreparer(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "UpdateByResourceGroup", nil, "Failure preparing request") + return + } + + result, err = client.UpdateByResourceGroupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsClient", "UpdateByResourceGroup", nil, "Failure sending request") + return + } + + return +} + +// UpdateByResourceGroupPreparer prepares the UpdateByResourceGroup request. +func (client LongTermRetentionBackupsClient) UpdateByResourceGroupPreparer(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters UpdateLongTermRetentionBackupParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backupName": autorest.Encode("path", backupName), + "locationName": autorest.Encode("path", locationName), + "longTermRetentionDatabaseName": autorest.Encode("path", longTermRetentionDatabaseName), + "longTermRetentionServerName": autorest.Encode("path", longTermRetentionServerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateByResourceGroupSender sends the UpdateByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client LongTermRetentionBackupsClient) UpdateByResourceGroupSender(req *http.Request) (future LongTermRetentionBackupsUpdateByResourceGroupFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateByResourceGroupResponder handles the response to the UpdateByResourceGroup request. The method always +// closes the http.Response Body. +func (client LongTermRetentionBackupsClient) UpdateByResourceGroupResponder(resp *http.Response) (result LongTermRetentionBackupOperationResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/sql/mgmt/v4.0/sql/longtermretentionmanagedinstancebackups.go b/services/preview/sql/mgmt/v4.0/sql/longtermretentionmanagedinstancebackups.go index 9c98c81bd6dc..32811f881fd9 100644 --- a/services/preview/sql/mgmt/v4.0/sql/longtermretentionmanagedinstancebackups.go +++ b/services/preview/sql/mgmt/v4.0/sql/longtermretentionmanagedinstancebackups.go @@ -369,7 +369,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) GetByResourceGroupRe // databaseName - the name of the managed database. // onlyLatestPerDatabase - whether or not to only get the latest backup for each database. // databaseState - whether to query against just live databases, just deleted databases, or all databases. -func (client LongTermRetentionManagedInstanceBackupsClient) ListByDatabase(ctx context.Context, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState DatabaseState1) (result ManagedInstanceLongTermRetentionBackupListResultPage, err error) { +func (client LongTermRetentionManagedInstanceBackupsClient) ListByDatabase(ctx context.Context, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result ManagedInstanceLongTermRetentionBackupListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionManagedInstanceBackupsClient.ListByDatabase") defer func() { @@ -408,7 +408,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByDatabase(ctx c } // ListByDatabasePreparer prepares the ListByDatabase request. -func (client LongTermRetentionManagedInstanceBackupsClient) ListByDatabasePreparer(ctx context.Context, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState DatabaseState1) (*http.Request, error) { +func (client LongTermRetentionManagedInstanceBackupsClient) ListByDatabasePreparer(ctx context.Context, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (*http.Request, error) { pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), "locationName": autorest.Encode("path", locationName), @@ -475,7 +475,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) listByDatabaseNextRe } // ListByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client LongTermRetentionManagedInstanceBackupsClient) ListByDatabaseComplete(ctx context.Context, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState DatabaseState1) (result ManagedInstanceLongTermRetentionBackupListResultIterator, err error) { +func (client LongTermRetentionManagedInstanceBackupsClient) ListByDatabaseComplete(ctx context.Context, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result ManagedInstanceLongTermRetentionBackupListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionManagedInstanceBackupsClient.ListByDatabase") defer func() { @@ -496,7 +496,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByDatabaseComple // managedInstanceName - the name of the managed instance. // onlyLatestPerDatabase - whether or not to only get the latest backup for each database. // databaseState - whether to query against just live databases, just deleted databases, or all databases. -func (client LongTermRetentionManagedInstanceBackupsClient) ListByInstance(ctx context.Context, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState DatabaseState2) (result ManagedInstanceLongTermRetentionBackupListResultPage, err error) { +func (client LongTermRetentionManagedInstanceBackupsClient) ListByInstance(ctx context.Context, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result ManagedInstanceLongTermRetentionBackupListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionManagedInstanceBackupsClient.ListByInstance") defer func() { @@ -535,7 +535,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByInstance(ctx c } // ListByInstancePreparer prepares the ListByInstance request. -func (client LongTermRetentionManagedInstanceBackupsClient) ListByInstancePreparer(ctx context.Context, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState DatabaseState2) (*http.Request, error) { +func (client LongTermRetentionManagedInstanceBackupsClient) ListByInstancePreparer(ctx context.Context, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (*http.Request, error) { pathParameters := map[string]interface{}{ "locationName": autorest.Encode("path", locationName), "managedInstanceName": autorest.Encode("path", managedInstanceName), @@ -601,7 +601,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) listByInstanceNextRe } // ListByInstanceComplete enumerates all values, automatically crossing page boundaries as required. -func (client LongTermRetentionManagedInstanceBackupsClient) ListByInstanceComplete(ctx context.Context, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState DatabaseState2) (result ManagedInstanceLongTermRetentionBackupListResultIterator, err error) { +func (client LongTermRetentionManagedInstanceBackupsClient) ListByInstanceComplete(ctx context.Context, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result ManagedInstanceLongTermRetentionBackupListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionManagedInstanceBackupsClient.ListByInstance") defer func() { @@ -621,7 +621,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByInstanceComple // locationName - the location of the database. // onlyLatestPerDatabase - whether or not to only get the latest backup for each database. // databaseState - whether to query against just live databases, just deleted databases, or all databases. -func (client LongTermRetentionManagedInstanceBackupsClient) ListByLocation(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState DatabaseState3) (result ManagedInstanceLongTermRetentionBackupListResultPage, err error) { +func (client LongTermRetentionManagedInstanceBackupsClient) ListByLocation(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result ManagedInstanceLongTermRetentionBackupListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionManagedInstanceBackupsClient.ListByLocation") defer func() { @@ -660,7 +660,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByLocation(ctx c } // ListByLocationPreparer prepares the ListByLocation request. -func (client LongTermRetentionManagedInstanceBackupsClient) ListByLocationPreparer(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState DatabaseState3) (*http.Request, error) { +func (client LongTermRetentionManagedInstanceBackupsClient) ListByLocationPreparer(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (*http.Request, error) { pathParameters := map[string]interface{}{ "locationName": autorest.Encode("path", locationName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -725,7 +725,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) listByLocationNextRe } // ListByLocationComplete enumerates all values, automatically crossing page boundaries as required. -func (client LongTermRetentionManagedInstanceBackupsClient) ListByLocationComplete(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState DatabaseState3) (result ManagedInstanceLongTermRetentionBackupListResultIterator, err error) { +func (client LongTermRetentionManagedInstanceBackupsClient) ListByLocationComplete(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result ManagedInstanceLongTermRetentionBackupListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionManagedInstanceBackupsClient.ListByLocation") defer func() { @@ -749,7 +749,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByLocationComple // databaseName - the name of the managed database. // onlyLatestPerDatabase - whether or not to only get the latest backup for each database. // databaseState - whether to query against just live databases, just deleted databases, or all databases. -func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupDatabase(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState DatabaseState4) (result ManagedInstanceLongTermRetentionBackupListResultPage, err error) { +func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupDatabase(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result ManagedInstanceLongTermRetentionBackupListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupDatabase") defer func() { @@ -788,7 +788,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupD } // ListByResourceGroupDatabasePreparer prepares the ListByResourceGroupDatabase request. -func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupDatabasePreparer(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState DatabaseState4) (*http.Request, error) { +func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupDatabasePreparer(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (*http.Request, error) { pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), "locationName": autorest.Encode("path", locationName), @@ -856,7 +856,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) listByResourceGroupD } // ListByResourceGroupDatabaseComplete enumerates all values, automatically crossing page boundaries as required. -func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupDatabaseComplete(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState DatabaseState4) (result ManagedInstanceLongTermRetentionBackupListResultIterator, err error) { +func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupDatabaseComplete(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result ManagedInstanceLongTermRetentionBackupListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupDatabase") defer func() { @@ -879,7 +879,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupD // managedInstanceName - the name of the managed instance. // onlyLatestPerDatabase - whether or not to only get the latest backup for each database. // databaseState - whether to query against just live databases, just deleted databases, or all databases. -func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupInstance(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState DatabaseState5) (result ManagedInstanceLongTermRetentionBackupListResultPage, err error) { +func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupInstance(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result ManagedInstanceLongTermRetentionBackupListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupInstance") defer func() { @@ -918,7 +918,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupI } // ListByResourceGroupInstancePreparer prepares the ListByResourceGroupInstance request. -func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupInstancePreparer(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState DatabaseState5) (*http.Request, error) { +func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupInstancePreparer(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (*http.Request, error) { pathParameters := map[string]interface{}{ "locationName": autorest.Encode("path", locationName), "managedInstanceName": autorest.Encode("path", managedInstanceName), @@ -985,7 +985,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) listByResourceGroupI } // ListByResourceGroupInstanceComplete enumerates all values, automatically crossing page boundaries as required. -func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupInstanceComplete(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState DatabaseState5) (result ManagedInstanceLongTermRetentionBackupListResultIterator, err error) { +func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupInstanceComplete(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result ManagedInstanceLongTermRetentionBackupListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupInstance") defer func() { @@ -1007,7 +1007,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupI // locationName - the location of the database. // onlyLatestPerDatabase - whether or not to only get the latest backup for each database. // databaseState - whether to query against just live databases, just deleted databases, or all databases. -func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupLocation(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState DatabaseState6) (result ManagedInstanceLongTermRetentionBackupListResultPage, err error) { +func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupLocation(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result ManagedInstanceLongTermRetentionBackupListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupLocation") defer func() { @@ -1046,7 +1046,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupL } // ListByResourceGroupLocationPreparer prepares the ListByResourceGroupLocation request. -func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupLocationPreparer(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState DatabaseState6) (*http.Request, error) { +func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupLocationPreparer(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (*http.Request, error) { pathParameters := map[string]interface{}{ "locationName": autorest.Encode("path", locationName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -1112,7 +1112,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) listByResourceGroupL } // ListByResourceGroupLocationComplete enumerates all values, automatically crossing page boundaries as required. -func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupLocationComplete(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState DatabaseState6) (result ManagedInstanceLongTermRetentionBackupListResultIterator, err error) { +func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupLocationComplete(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState DatabaseState) (result ManagedInstanceLongTermRetentionBackupListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupLocation") defer func() { diff --git a/services/preview/sql/mgmt/v4.0/sql/backuplongtermretentionpolicies.go b/services/preview/sql/mgmt/v4.0/sql/longtermretentionpolicies.go similarity index 53% rename from services/preview/sql/mgmt/v4.0/sql/backuplongtermretentionpolicies.go rename to services/preview/sql/mgmt/v4.0/sql/longtermretentionpolicies.go index f4748594176b..fc31c8f81ff8 100644 --- a/services/preview/sql/mgmt/v4.0/sql/backuplongtermretentionpolicies.go +++ b/services/preview/sql/mgmt/v4.0/sql/longtermretentionpolicies.go @@ -14,23 +14,23 @@ import ( "net/http" ) -// BackupLongTermRetentionPoliciesClient 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 BackupLongTermRetentionPoliciesClient struct { +// LongTermRetentionPoliciesClient 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 LongTermRetentionPoliciesClient struct { BaseClient } -// NewBackupLongTermRetentionPoliciesClient creates an instance of the BackupLongTermRetentionPoliciesClient client. -func NewBackupLongTermRetentionPoliciesClient(subscriptionID string) BackupLongTermRetentionPoliciesClient { - return NewBackupLongTermRetentionPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewLongTermRetentionPoliciesClient creates an instance of the LongTermRetentionPoliciesClient client. +func NewLongTermRetentionPoliciesClient(subscriptionID string) LongTermRetentionPoliciesClient { + return NewLongTermRetentionPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewBackupLongTermRetentionPoliciesClientWithBaseURI creates an instance of the BackupLongTermRetentionPoliciesClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewBackupLongTermRetentionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) BackupLongTermRetentionPoliciesClient { - return BackupLongTermRetentionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewLongTermRetentionPoliciesClientWithBaseURI creates an instance of the LongTermRetentionPoliciesClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewLongTermRetentionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) LongTermRetentionPoliciesClient { + return LongTermRetentionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate sets a database's long term retention policy. @@ -40,9 +40,9 @@ func NewBackupLongTermRetentionPoliciesClientWithBaseURI(baseURI string, subscri // serverName - the name of the server. // databaseName - the name of the database. // parameters - the long term retention policy info. -func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters BackupLongTermRetentionPolicy) (result BackupLongTermRetentionPoliciesCreateOrUpdateFuture, err error) { +func (client LongTermRetentionPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters LongTermRetentionPolicy) (result LongTermRetentionPoliciesCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupLongTermRetentionPoliciesClient.CreateOrUpdate") + ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionPoliciesClient.CreateOrUpdate") defer func() { sc := -1 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { @@ -53,13 +53,13 @@ func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdate(ctx context.C } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") return } result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionPoliciesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -67,7 +67,7 @@ func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdate(ctx context.C } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters BackupLongTermRetentionPolicy) (*http.Request, error) { +func (client LongTermRetentionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters LongTermRetentionPolicy) (*http.Request, error) { pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), "policyName": autorest.Encode("path", "default"), @@ -76,7 +76,7 @@ func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdatePreparer(ctx c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -93,7 +93,7 @@ func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdatePreparer(ctx c // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdateSender(req *http.Request) (future BackupLongTermRetentionPoliciesCreateOrUpdateFuture, err error) { +func (client LongTermRetentionPoliciesClient) CreateOrUpdateSender(req *http.Request) (future LongTermRetentionPoliciesCreateOrUpdateFuture, err error) { var resp *http.Response resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { @@ -108,7 +108,7 @@ func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdateSender(req *ht // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result BackupLongTermRetentionPolicy, err error) { +func (client LongTermRetentionPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result LongTermRetentionPolicy, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), @@ -124,9 +124,9 @@ func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdateResponder(resp // from the Azure Resource Manager API or the portal. // serverName - the name of the server. // databaseName - the name of the database. -func (client BackupLongTermRetentionPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result BackupLongTermRetentionPolicy, err error) { +func (client LongTermRetentionPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result LongTermRetentionPolicy, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupLongTermRetentionPoliciesClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionPoliciesClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -137,20 +137,20 @@ func (client BackupLongTermRetentionPoliciesClient) Get(ctx context.Context, res } req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionPoliciesClient", "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.BackupLongTermRetentionPoliciesClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionPoliciesClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionPoliciesClient", "Get", resp, "Failure responding to request") return } @@ -158,7 +158,7 @@ func (client BackupLongTermRetentionPoliciesClient) Get(ctx context.Context, res } // GetPreparer prepares the Get request. -func (client BackupLongTermRetentionPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { +func (client LongTermRetentionPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), "policyName": autorest.Encode("path", "default"), @@ -167,7 +167,7 @@ func (client BackupLongTermRetentionPoliciesClient) GetPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -182,13 +182,13 @@ func (client BackupLongTermRetentionPoliciesClient) GetPreparer(ctx context.Cont // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client BackupLongTermRetentionPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { +func (client LongTermRetentionPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client BackupLongTermRetentionPoliciesClient) GetResponder(resp *http.Response) (result BackupLongTermRetentionPolicy, err error) { +func (client LongTermRetentionPoliciesClient) GetResponder(resp *http.Response) (result LongTermRetentionPolicy, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -204,33 +204,38 @@ func (client BackupLongTermRetentionPoliciesClient) GetResponder(resp *http.Resp // from the Azure Resource Manager API or the portal. // serverName - the name of the server. // databaseName - the name of the database. -func (client BackupLongTermRetentionPoliciesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result BackupLongTermRetentionPolicy, err error) { +func (client LongTermRetentionPoliciesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result LongTermRetentionPolicyListResultPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupLongTermRetentionPoliciesClient.ListByDatabase") + ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionPoliciesClient.ListByDatabase") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.ltrplr.Response.Response != nil { + sc = result.ltrplr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } + result.fn = client.listByDatabaseNextResults req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesClient", "ListByDatabase", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionPoliciesClient", "ListByDatabase", nil, "Failure preparing request") return } resp, err := client.ListByDatabaseSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesClient", "ListByDatabase", resp, "Failure sending request") + result.ltrplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionPoliciesClient", "ListByDatabase", resp, "Failure sending request") return } - result, err = client.ListByDatabaseResponder(resp) + result.ltrplr, err = client.ListByDatabaseResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesClient", "ListByDatabase", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionPoliciesClient", "ListByDatabase", resp, "Failure responding to request") + return + } + if result.ltrplr.hasNextLink() && result.ltrplr.IsEmpty() { + err = result.NextWithContext(ctx) return } @@ -238,7 +243,7 @@ func (client BackupLongTermRetentionPoliciesClient) ListByDatabase(ctx context.C } // ListByDatabasePreparer prepares the ListByDatabase request. -func (client BackupLongTermRetentionPoliciesClient) ListByDatabasePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { +func (client LongTermRetentionPoliciesClient) ListByDatabasePreparer(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), @@ -246,7 +251,7 @@ func (client BackupLongTermRetentionPoliciesClient) ListByDatabasePreparer(ctx c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -261,13 +266,13 @@ func (client BackupLongTermRetentionPoliciesClient) ListByDatabasePreparer(ctx c // ListByDatabaseSender sends the ListByDatabase request. The method will close the // http.Response Body if it receives an error. -func (client BackupLongTermRetentionPoliciesClient) ListByDatabaseSender(req *http.Request) (*http.Response, error) { +func (client LongTermRetentionPoliciesClient) ListByDatabaseSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByDatabaseResponder handles the response to the ListByDatabase request. The method always // closes the http.Response Body. -func (client BackupLongTermRetentionPoliciesClient) ListByDatabaseResponder(resp *http.Response) (result BackupLongTermRetentionPolicy, err error) { +func (client LongTermRetentionPoliciesClient) ListByDatabaseResponder(resp *http.Response) (result LongTermRetentionPolicyListResult, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -276,3 +281,40 @@ func (client BackupLongTermRetentionPoliciesClient) ListByDatabaseResponder(resp result.Response = autorest.Response{Response: resp} return } + +// listByDatabaseNextResults retrieves the next set of results, if any. +func (client LongTermRetentionPoliciesClient) listByDatabaseNextResults(ctx context.Context, lastResults LongTermRetentionPolicyListResult) (result LongTermRetentionPolicyListResult, err error) { + req, err := lastResults.longTermRetentionPolicyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "sql.LongTermRetentionPoliciesClient", "listByDatabaseNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDatabaseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "sql.LongTermRetentionPoliciesClient", "listByDatabaseNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionPoliciesClient", "listByDatabaseNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. +func (client LongTermRetentionPoliciesClient) ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result LongTermRetentionPolicyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionPoliciesClient.ListByDatabase") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByDatabase(ctx, resourceGroupName, serverName, databaseName) + return +} diff --git a/services/preview/sql/mgmt/v4.0/sql/models.go b/services/preview/sql/mgmt/v4.0/sql/models.go index 22e205ad101b..28eb54af5d3f 100644 --- a/services/preview/sql/mgmt/v4.0/sql/models.go +++ b/services/preview/sql/mgmt/v4.0/sql/models.go @@ -477,122 +477,6 @@ type AzureADOnlyAuthProperties struct { AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"` } -// BackupLongTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type BackupLongTermRetentionPoliciesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BackupLongTermRetentionPoliciesClient) (BackupLongTermRetentionPolicy, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *BackupLongTermRetentionPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for BackupLongTermRetentionPoliciesCreateOrUpdateFuture.Result. -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 { - bltrp.Response.Response = future.Response() - 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 long term retention policy. -type BackupLongTermRetentionPolicy struct { - autorest.Response `json:"-"` - // LongTermRetentionPolicyProperties - Resource properties. - *LongTermRetentionPolicyProperties `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.LongTermRetentionPolicyProperties != nil { - objectMap["properties"] = bltrp.LongTermRetentionPolicyProperties - } - return json.Marshal(objectMap) -} - -// 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) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var longTermRetentionPolicyProperties LongTermRetentionPolicyProperties - err = json.Unmarshal(*v, &longTermRetentionPolicyProperties) - if err != nil { - return err - } - bltrp.LongTermRetentionPolicyProperties = &longTermRetentionPolicyProperties - } - 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 - } - } - } - - return nil -} - // BackupShortTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type BackupShortTermRetentionPoliciesCreateOrUpdateFuture struct { @@ -968,6 +852,63 @@ type CompleteDatabaseRestoreDefinition struct { LastBackupName *string `json:"lastBackupName,omitempty"` } +// CopyLongTermRetentionBackupParameters contains the information necessary to perform long term retention +// backup copy operation. +type CopyLongTermRetentionBackupParameters struct { + // CopyLongTermRetentionBackupParametersProperties - Resource properties. + *CopyLongTermRetentionBackupParametersProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CopyLongTermRetentionBackupParameters. +func (cltrbp CopyLongTermRetentionBackupParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cltrbp.CopyLongTermRetentionBackupParametersProperties != nil { + objectMap["properties"] = cltrbp.CopyLongTermRetentionBackupParametersProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CopyLongTermRetentionBackupParameters struct. +func (cltrbp *CopyLongTermRetentionBackupParameters) 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 copyLongTermRetentionBackupParametersProperties CopyLongTermRetentionBackupParametersProperties + err = json.Unmarshal(*v, ©LongTermRetentionBackupParametersProperties) + if err != nil { + return err + } + cltrbp.CopyLongTermRetentionBackupParametersProperties = ©LongTermRetentionBackupParametersProperties + } + } + } + + return nil +} + +// CopyLongTermRetentionBackupParametersProperties contains the properties to perform long term retention +// backup copy operation. +type CopyLongTermRetentionBackupParametersProperties struct { + // TargetSubscriptionID - The subscription that owns the target server + TargetSubscriptionID *string `json:"targetSubscriptionId,omitempty"` + // TargetResourceGroup - The resource group that owns the target server + TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` + // TargetServerResourceID - The resource Id of the target server that owns the database + TargetServerResourceID *string `json:"targetServerResourceId,omitempty"` + // TargetServerFullyQualifiedDomainName - The fully qualified domain name of the target server + TargetServerFullyQualifiedDomainName *string `json:"targetServerFullyQualifiedDomainName,omitempty"` + // TargetDatabaseName - The name of the database owns the copied backup. + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + // TargetBackupStorageRedundancy - The storage redundancy type of the copied backup. Possible values include: 'TargetBackupStorageRedundancyGeo', 'TargetBackupStorageRedundancyLocal', 'TargetBackupStorageRedundancyZone' + TargetBackupStorageRedundancy TargetBackupStorageRedundancy `json:"targetBackupStorageRedundancy,omitempty"` +} + // CreateDatabaseRestorePointDefinition contains the information necessary to perform a create database // restore point operation. type CreateDatabaseRestorePointDefinition struct { @@ -2071,14 +2012,16 @@ type DatabaseProperties struct { ReadScale DatabaseReadScale `json:"readScale,omitempty"` // HighAvailabilityReplicaCount - The number of secondary replicas associated with the database that are used to provide high availability. HighAvailabilityReplicaCount *int32 `json:"highAvailabilityReplicaCount,omitempty"` - // SecondaryType - The secondary type of the database if it is a secondary. Valid values are Geo and Named. Possible values include: 'Geo', 'Named' + // SecondaryType - The secondary type of the database if it is a secondary. Valid values are Geo and Named. Possible values include: 'SecondaryTypeGeo', 'SecondaryTypeNamed' SecondaryType SecondaryType `json:"secondaryType,omitempty"` // CurrentSku - READ-ONLY; The name and tier of the SKU. CurrentSku *Sku `json:"currentSku,omitempty"` // AutoPauseDelay - Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled AutoPauseDelay *int32 `json:"autoPauseDelay,omitempty"` - // StorageAccountType - The storage account type used to store backups for this database. Possible values include: 'GRS', 'LRS', 'ZRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` + // CurrentBackupStorageRedundancy - READ-ONLY; The storage account type used to store backups for this database. Possible values include: 'CurrentBackupStorageRedundancyGeo', 'CurrentBackupStorageRedundancyLocal', 'CurrentBackupStorageRedundancyZone' + CurrentBackupStorageRedundancy CurrentBackupStorageRedundancy `json:"currentBackupStorageRedundancy,omitempty"` + // RequestedBackupStorageRedundancy - The storage account type to be used to store backups for this database. Possible values include: 'RequestedBackupStorageRedundancyGeo', 'RequestedBackupStorageRedundancyLocal', 'RequestedBackupStorageRedundancyZone' + RequestedBackupStorageRedundancy RequestedBackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"` // MinCapacity - Minimal capacity that database will always have allocated, if not paused MinCapacity *float64 `json:"minCapacity,omitempty"` // PausedDate - READ-ONLY; The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready. @@ -2149,8 +2092,8 @@ func (dp DatabaseProperties) MarshalJSON() ([]byte, error) { if dp.AutoPauseDelay != nil { objectMap["autoPauseDelay"] = dp.AutoPauseDelay } - if dp.StorageAccountType != "" { - objectMap["storageAccountType"] = dp.StorageAccountType + if dp.RequestedBackupStorageRedundancy != "" { + objectMap["requestedBackupStorageRedundancy"] = dp.RequestedBackupStorageRedundancy } if dp.MinCapacity != nil { objectMap["minCapacity"] = dp.MinCapacity @@ -10155,24 +10098,753 @@ type LongTermRetentionBackupListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for LongTermRetentionBackupListResult. -func (ltrblr LongTermRetentionBackupListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for LongTermRetentionBackupListResult. +func (ltrblr LongTermRetentionBackupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// LongTermRetentionBackupListResultIterator provides access to a complete listing of +// LongTermRetentionBackup values. +type LongTermRetentionBackupListResultIterator struct { + i int + page LongTermRetentionBackupListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *LongTermRetentionBackupListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *LongTermRetentionBackupListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LongTermRetentionBackupListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter LongTermRetentionBackupListResultIterator) Response() LongTermRetentionBackupListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter LongTermRetentionBackupListResultIterator) Value() LongTermRetentionBackup { + if !iter.page.NotDone() { + return LongTermRetentionBackup{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the LongTermRetentionBackupListResultIterator type. +func NewLongTermRetentionBackupListResultIterator(page LongTermRetentionBackupListResultPage) LongTermRetentionBackupListResultIterator { + return LongTermRetentionBackupListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ltrblr LongTermRetentionBackupListResult) IsEmpty() bool { + return ltrblr.Value == nil || len(*ltrblr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ltrblr LongTermRetentionBackupListResult) hasNextLink() bool { + return ltrblr.NextLink != nil && len(*ltrblr.NextLink) != 0 +} + +// longTermRetentionBackupListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ltrblr LongTermRetentionBackupListResult) longTermRetentionBackupListResultPreparer(ctx context.Context) (*http.Request, error) { + if !ltrblr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ltrblr.NextLink))) +} + +// LongTermRetentionBackupListResultPage contains a page of LongTermRetentionBackup values. +type LongTermRetentionBackupListResultPage struct { + fn func(context.Context, LongTermRetentionBackupListResult) (LongTermRetentionBackupListResult, error) + ltrblr LongTermRetentionBackupListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *LongTermRetentionBackupListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ltrblr) + if err != nil { + return err + } + page.ltrblr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *LongTermRetentionBackupListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LongTermRetentionBackupListResultPage) NotDone() bool { + return !page.ltrblr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LongTermRetentionBackupListResultPage) Response() LongTermRetentionBackupListResult { + return page.ltrblr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LongTermRetentionBackupListResultPage) Values() []LongTermRetentionBackup { + if page.ltrblr.IsEmpty() { + return nil + } + return *page.ltrblr.Value +} + +// Creates a new instance of the LongTermRetentionBackupListResultPage type. +func NewLongTermRetentionBackupListResultPage(cur LongTermRetentionBackupListResult, getNextPage func(context.Context, LongTermRetentionBackupListResult) (LongTermRetentionBackupListResult, error)) LongTermRetentionBackupListResultPage { + return LongTermRetentionBackupListResultPage{ + fn: getNextPage, + ltrblr: cur, + } +} + +// LongTermRetentionBackupOperationResult a LongTermRetentionBackup operation result resource. +type LongTermRetentionBackupOperationResult struct { + autorest.Response `json:"-"` + // LongTermRetentionOperationResultProperties - Resource properties. + *LongTermRetentionOperationResultProperties `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 LongTermRetentionBackupOperationResult. +func (ltrbor LongTermRetentionBackupOperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ltrbor.LongTermRetentionOperationResultProperties != nil { + objectMap["properties"] = ltrbor.LongTermRetentionOperationResultProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LongTermRetentionBackupOperationResult struct. +func (ltrbor *LongTermRetentionBackupOperationResult) 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 longTermRetentionOperationResultProperties LongTermRetentionOperationResultProperties + err = json.Unmarshal(*v, &longTermRetentionOperationResultProperties) + if err != nil { + return err + } + ltrbor.LongTermRetentionOperationResultProperties = &longTermRetentionOperationResultProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ltrbor.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ltrbor.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ltrbor.Type = &typeVar + } + } + } + + return nil +} + +// LongTermRetentionBackupProperties properties of a long term retention backup +type LongTermRetentionBackupProperties struct { + // ServerName - READ-ONLY; The server name that the backup database belong to. + ServerName *string `json:"serverName,omitempty"` + // ServerCreateTime - READ-ONLY; The create time of the server. + ServerCreateTime *date.Time `json:"serverCreateTime,omitempty"` + // DatabaseName - READ-ONLY; The name of the database the backup belong to + DatabaseName *string `json:"databaseName,omitempty"` + // DatabaseDeletionTime - READ-ONLY; The delete time of the database + DatabaseDeletionTime *date.Time `json:"databaseDeletionTime,omitempty"` + // BackupTime - READ-ONLY; The time the backup was taken + BackupTime *date.Time `json:"backupTime,omitempty"` + // BackupExpirationTime - READ-ONLY; The time the long term retention backup will expire. + BackupExpirationTime *date.Time `json:"backupExpirationTime,omitempty"` + // BackupStorageRedundancy - READ-ONLY; The storage redundancy type of the backup. Possible values include: 'Geo', 'Local', 'Zone' + BackupStorageRedundancy BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty"` + // RequestedBackupStorageRedundancy - The storage redundancy type of the backup. Possible values include: 'Geo', 'Local', 'Zone' + RequestedBackupStorageRedundancy BackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"` +} + +// MarshalJSON is the custom marshaler for LongTermRetentionBackupProperties. +func (ltrbp LongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ltrbp.RequestedBackupStorageRedundancy != "" { + objectMap["requestedBackupStorageRedundancy"] = ltrbp.RequestedBackupStorageRedundancy + } + return json.Marshal(objectMap) +} + +// LongTermRetentionBackupsCopyByResourceGroupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type LongTermRetentionBackupsCopyByResourceGroupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LongTermRetentionBackupsClient) (LongTermRetentionBackupOperationResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LongTermRetentionBackupsCopyByResourceGroupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LongTermRetentionBackupsCopyByResourceGroupFuture.Result. +func (future *LongTermRetentionBackupsCopyByResourceGroupFuture) result(client LongTermRetentionBackupsClient) (ltrbor LongTermRetentionBackupOperationResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsCopyByResourceGroupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ltrbor.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsCopyByResourceGroupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ltrbor.Response.Response, err = future.GetResult(sender); err == nil && ltrbor.Response.Response.StatusCode != http.StatusNoContent { + ltrbor, err = client.CopyByResourceGroupResponder(ltrbor.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsCopyByResourceGroupFuture", "Result", ltrbor.Response.Response, "Failure responding to request") + } + } + return +} + +// LongTermRetentionBackupsCopyFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type LongTermRetentionBackupsCopyFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LongTermRetentionBackupsClient) (LongTermRetentionBackupOperationResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LongTermRetentionBackupsCopyFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LongTermRetentionBackupsCopyFuture.Result. +func (future *LongTermRetentionBackupsCopyFuture) result(client LongTermRetentionBackupsClient) (ltrbor LongTermRetentionBackupOperationResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsCopyFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ltrbor.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsCopyFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ltrbor.Response.Response, err = future.GetResult(sender); err == nil && ltrbor.Response.Response.StatusCode != http.StatusNoContent { + ltrbor, err = client.CopyResponder(ltrbor.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsCopyFuture", "Result", ltrbor.Response.Response, "Failure responding to request") + } + } + return +} + +// LongTermRetentionBackupsDeleteByResourceGroupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type LongTermRetentionBackupsDeleteByResourceGroupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LongTermRetentionBackupsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LongTermRetentionBackupsDeleteByResourceGroupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LongTermRetentionBackupsDeleteByResourceGroupFuture.Result. +func (future *LongTermRetentionBackupsDeleteByResourceGroupFuture) result(client LongTermRetentionBackupsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsDeleteByResourceGroupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsDeleteByResourceGroupFuture") + return + } + ar.Response = future.Response() + return +} + +// LongTermRetentionBackupsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type LongTermRetentionBackupsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LongTermRetentionBackupsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LongTermRetentionBackupsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LongTermRetentionBackupsDeleteFuture.Result. +func (future *LongTermRetentionBackupsDeleteFuture) result(client LongTermRetentionBackupsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// LongTermRetentionBackupsUpdateByResourceGroupFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type LongTermRetentionBackupsUpdateByResourceGroupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LongTermRetentionBackupsClient) (LongTermRetentionBackupOperationResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LongTermRetentionBackupsUpdateByResourceGroupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LongTermRetentionBackupsUpdateByResourceGroupFuture.Result. +func (future *LongTermRetentionBackupsUpdateByResourceGroupFuture) result(client LongTermRetentionBackupsClient) (ltrbor LongTermRetentionBackupOperationResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsUpdateByResourceGroupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ltrbor.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsUpdateByResourceGroupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ltrbor.Response.Response, err = future.GetResult(sender); err == nil && ltrbor.Response.Response.StatusCode != http.StatusNoContent { + ltrbor, err = client.UpdateByResourceGroupResponder(ltrbor.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsUpdateByResourceGroupFuture", "Result", ltrbor.Response.Response, "Failure responding to request") + } + } + return +} + +// LongTermRetentionBackupsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type LongTermRetentionBackupsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LongTermRetentionBackupsClient) (LongTermRetentionBackupOperationResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LongTermRetentionBackupsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LongTermRetentionBackupsUpdateFuture.Result. +func (future *LongTermRetentionBackupsUpdateFuture) result(client LongTermRetentionBackupsClient) (ltrbor LongTermRetentionBackupOperationResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ltrbor.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ltrbor.Response.Response, err = future.GetResult(sender); err == nil && ltrbor.Response.Response.StatusCode != http.StatusNoContent { + ltrbor, err = client.UpdateResponder(ltrbor.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsUpdateFuture", "Result", ltrbor.Response.Response, "Failure responding to request") + } + } + return +} + +// LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LongTermRetentionManagedInstanceBackupsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture.Result. +func (future *LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture) result(client LongTermRetentionManagedInstanceBackupsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture") + return + } + ar.Response = future.Response() + return +} + +// LongTermRetentionManagedInstanceBackupsDeleteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type LongTermRetentionManagedInstanceBackupsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LongTermRetentionManagedInstanceBackupsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LongTermRetentionManagedInstanceBackupsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LongTermRetentionManagedInstanceBackupsDeleteFuture.Result. +func (future *LongTermRetentionManagedInstanceBackupsDeleteFuture) result(client LongTermRetentionManagedInstanceBackupsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionManagedInstanceBackupsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionManagedInstanceBackupsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// LongTermRetentionOperationResultProperties contains the operation result properties for long term +// retention backup operation. +type LongTermRetentionOperationResultProperties struct { + // RequestID - READ-ONLY; Request Id. + RequestID *uuid.UUID `json:"requestId,omitempty"` + // OperationType - READ-ONLY; Operation type. + OperationType *string `json:"operationType,omitempty"` + // FromBackupResourceID - READ-ONLY; Source backup resource id + FromBackupResourceID *string `json:"fromBackupResourceId,omitempty"` + // ToBackupResourceID - READ-ONLY; Target backup resource id + ToBackupResourceID *string `json:"toBackupResourceId,omitempty"` + // TargetBackupStorageRedundancy - READ-ONLY; The storage redundancy type of the copied backup. Possible values include: 'Geo', 'Local', 'Zone' + TargetBackupStorageRedundancy BackupStorageRedundancy `json:"targetBackupStorageRedundancy,omitempty"` + // Status - READ-ONLY; Operation status + Status *string `json:"status,omitempty"` + // Message - READ-ONLY; Progress message + Message *string `json:"message,omitempty"` +} + +// MarshalJSON is the custom marshaler for LongTermRetentionOperationResultProperties. +func (ltrorp LongTermRetentionOperationResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// LongTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type LongTermRetentionPoliciesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LongTermRetentionPoliciesClient) (LongTermRetentionPolicy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LongTermRetentionPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LongTermRetentionPoliciesCreateOrUpdateFuture.Result. +func (future *LongTermRetentionPoliciesCreateOrUpdateFuture) result(client LongTermRetentionPoliciesClient) (ltrp LongTermRetentionPolicy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ltrp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionPoliciesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ltrp.Response.Response, err = future.GetResult(sender); err == nil && ltrp.Response.Response.StatusCode != http.StatusNoContent { + ltrp, err = client.CreateOrUpdateResponder(ltrp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionPoliciesCreateOrUpdateFuture", "Result", ltrp.Response.Response, "Failure responding to request") + } + } + return +} + +// LongTermRetentionPolicy a long term retention policy. +type LongTermRetentionPolicy struct { + autorest.Response `json:"-"` + // BaseLongTermRetentionPolicyProperties - Resource properties. + *BaseLongTermRetentionPolicyProperties `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 LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ltrp.BaseLongTermRetentionPolicyProperties != nil { + objectMap["properties"] = ltrp.BaseLongTermRetentionPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LongTermRetentionPolicy struct. +func (ltrp *LongTermRetentionPolicy) 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 baseLongTermRetentionPolicyProperties BaseLongTermRetentionPolicyProperties + err = json.Unmarshal(*v, &baseLongTermRetentionPolicyProperties) + if err != nil { + return err + } + ltrp.BaseLongTermRetentionPolicyProperties = &baseLongTermRetentionPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ltrp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ltrp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ltrp.Type = &typeVar + } + } + } + + return nil +} + +// LongTermRetentionPolicyListResult a list of long term retention policies. +type LongTermRetentionPolicyListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]LongTermRetentionPolicy `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for LongTermRetentionPolicyListResult. +func (ltrplr LongTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) return json.Marshal(objectMap) } -// LongTermRetentionBackupListResultIterator provides access to a complete listing of -// LongTermRetentionBackup values. -type LongTermRetentionBackupListResultIterator struct { +// LongTermRetentionPolicyListResultIterator provides access to a complete listing of +// LongTermRetentionPolicy values. +type LongTermRetentionPolicyListResultIterator struct { i int - page LongTermRetentionBackupListResultPage + page LongTermRetentionPolicyListResultPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *LongTermRetentionBackupListResultIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *LongTermRetentionPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupListResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionPolicyListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -10197,67 +10869,67 @@ func (iter *LongTermRetentionBackupListResultIterator) NextWithContext(ctx conte // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *LongTermRetentionBackupListResultIterator) Next() error { +func (iter *LongTermRetentionPolicyListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LongTermRetentionBackupListResultIterator) NotDone() bool { +func (iter LongTermRetentionPolicyListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter LongTermRetentionBackupListResultIterator) Response() LongTermRetentionBackupListResult { +func (iter LongTermRetentionPolicyListResultIterator) Response() LongTermRetentionPolicyListResult { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter LongTermRetentionBackupListResultIterator) Value() LongTermRetentionBackup { +func (iter LongTermRetentionPolicyListResultIterator) Value() LongTermRetentionPolicy { if !iter.page.NotDone() { - return LongTermRetentionBackup{} + return LongTermRetentionPolicy{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the LongTermRetentionBackupListResultIterator type. -func NewLongTermRetentionBackupListResultIterator(page LongTermRetentionBackupListResultPage) LongTermRetentionBackupListResultIterator { - return LongTermRetentionBackupListResultIterator{page: page} +// Creates a new instance of the LongTermRetentionPolicyListResultIterator type. +func NewLongTermRetentionPolicyListResultIterator(page LongTermRetentionPolicyListResultPage) LongTermRetentionPolicyListResultIterator { + return LongTermRetentionPolicyListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (ltrblr LongTermRetentionBackupListResult) IsEmpty() bool { - return ltrblr.Value == nil || len(*ltrblr.Value) == 0 +func (ltrplr LongTermRetentionPolicyListResult) IsEmpty() bool { + return ltrplr.Value == nil || len(*ltrplr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (ltrblr LongTermRetentionBackupListResult) hasNextLink() bool { - return ltrblr.NextLink != nil && len(*ltrblr.NextLink) != 0 +func (ltrplr LongTermRetentionPolicyListResult) hasNextLink() bool { + return ltrplr.NextLink != nil && len(*ltrplr.NextLink) != 0 } -// longTermRetentionBackupListResultPreparer prepares a request to retrieve the next set of results. +// longTermRetentionPolicyListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (ltrblr LongTermRetentionBackupListResult) longTermRetentionBackupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ltrblr.hasNextLink() { +func (ltrplr LongTermRetentionPolicyListResult) longTermRetentionPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { + if !ltrplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(ltrblr.NextLink))) + autorest.WithBaseURL(to.String(ltrplr.NextLink))) } -// LongTermRetentionBackupListResultPage contains a page of LongTermRetentionBackup values. -type LongTermRetentionBackupListResultPage struct { - fn func(context.Context, LongTermRetentionBackupListResult) (LongTermRetentionBackupListResult, error) - ltrblr LongTermRetentionBackupListResult +// LongTermRetentionPolicyListResultPage contains a page of LongTermRetentionPolicy values. +type LongTermRetentionPolicyListResultPage struct { + fn func(context.Context, LongTermRetentionPolicyListResult) (LongTermRetentionPolicyListResult, error) + ltrplr LongTermRetentionPolicyListResult } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *LongTermRetentionBackupListResultPage) NextWithContext(ctx context.Context) (err error) { +func (page *LongTermRetentionPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupListResultPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionPolicyListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -10267,11 +10939,11 @@ func (page *LongTermRetentionBackupListResultPage) NextWithContext(ctx context.C }() } for { - next, err := page.fn(ctx, page.ltrblr) + next, err := page.fn(ctx, page.ltrplr) if err != nil { return err } - page.ltrblr = next + page.ltrplr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -10282,216 +10954,34 @@ func (page *LongTermRetentionBackupListResultPage) NextWithContext(ctx context.C // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *LongTermRetentionBackupListResultPage) Next() error { +func (page *LongTermRetentionPolicyListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LongTermRetentionBackupListResultPage) NotDone() bool { - return !page.ltrblr.IsEmpty() +func (page LongTermRetentionPolicyListResultPage) NotDone() bool { + return !page.ltrplr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page LongTermRetentionBackupListResultPage) Response() LongTermRetentionBackupListResult { - return page.ltrblr +func (page LongTermRetentionPolicyListResultPage) Response() LongTermRetentionPolicyListResult { + return page.ltrplr } // Values returns the slice of values for the current page or nil if there are no values. -func (page LongTermRetentionBackupListResultPage) Values() []LongTermRetentionBackup { - if page.ltrblr.IsEmpty() { +func (page LongTermRetentionPolicyListResultPage) Values() []LongTermRetentionPolicy { + if page.ltrplr.IsEmpty() { return nil } - return *page.ltrblr.Value + return *page.ltrplr.Value } -// Creates a new instance of the LongTermRetentionBackupListResultPage type. -func NewLongTermRetentionBackupListResultPage(cur LongTermRetentionBackupListResult, getNextPage func(context.Context, LongTermRetentionBackupListResult) (LongTermRetentionBackupListResult, error)) LongTermRetentionBackupListResultPage { - return LongTermRetentionBackupListResultPage{ +// Creates a new instance of the LongTermRetentionPolicyListResultPage type. +func NewLongTermRetentionPolicyListResultPage(cur LongTermRetentionPolicyListResult, getNextPage func(context.Context, LongTermRetentionPolicyListResult) (LongTermRetentionPolicyListResult, error)) LongTermRetentionPolicyListResultPage { + return LongTermRetentionPolicyListResultPage{ fn: getNextPage, - ltrblr: cur, - } -} - -// LongTermRetentionBackupProperties properties of a long term retention backup -type LongTermRetentionBackupProperties struct { - // ServerName - READ-ONLY; The server name that the backup database belong to. - ServerName *string `json:"serverName,omitempty"` - // ServerCreateTime - READ-ONLY; The create time of the server. - ServerCreateTime *date.Time `json:"serverCreateTime,omitempty"` - // DatabaseName - READ-ONLY; The name of the database the backup belong to - DatabaseName *string `json:"databaseName,omitempty"` - // DatabaseDeletionTime - READ-ONLY; The delete time of the database - DatabaseDeletionTime *date.Time `json:"databaseDeletionTime,omitempty"` - // BackupTime - READ-ONLY; The time the backup was taken - BackupTime *date.Time `json:"backupTime,omitempty"` - // BackupExpirationTime - READ-ONLY; The time the long term retention backup will expire. - BackupExpirationTime *date.Time `json:"backupExpirationTime,omitempty"` -} - -// MarshalJSON is the custom marshaler for LongTermRetentionBackupProperties. -func (ltrbp LongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// LongTermRetentionBackupsDeleteByResourceGroupFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type LongTermRetentionBackupsDeleteByResourceGroupFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LongTermRetentionBackupsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LongTermRetentionBackupsDeleteByResourceGroupFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LongTermRetentionBackupsDeleteByResourceGroupFuture.Result. -func (future *LongTermRetentionBackupsDeleteByResourceGroupFuture) result(client LongTermRetentionBackupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsDeleteByResourceGroupFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsDeleteByResourceGroupFuture") - return - } - ar.Response = future.Response() - return -} - -// LongTermRetentionBackupsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LongTermRetentionBackupsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LongTermRetentionBackupsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LongTermRetentionBackupsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LongTermRetentionBackupsDeleteFuture.Result. -func (future *LongTermRetentionBackupsDeleteFuture) result(client LongTermRetentionBackupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture an abstraction for monitoring and -// retrieving the results of a long-running operation. -type LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LongTermRetentionManagedInstanceBackupsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture.Result. -func (future *LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture) result(client LongTermRetentionManagedInstanceBackupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture") - return - } - ar.Response = future.Response() - return -} - -// LongTermRetentionManagedInstanceBackupsDeleteFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type LongTermRetentionManagedInstanceBackupsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LongTermRetentionManagedInstanceBackupsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LongTermRetentionManagedInstanceBackupsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LongTermRetentionManagedInstanceBackupsDeleteFuture.Result. -func (future *LongTermRetentionManagedInstanceBackupsDeleteFuture) result(client LongTermRetentionManagedInstanceBackupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.LongTermRetentionManagedInstanceBackupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionManagedInstanceBackupsDeleteFuture") - return + ltrplr: cur, } - ar.Response = future.Response() - return -} - -// LongTermRetentionPolicyProperties properties of a long term retention policy -type LongTermRetentionPolicyProperties struct { - // WeeklyRetention - The weekly retention policy for an LTR backup in an ISO 8601 format. - WeeklyRetention *string `json:"weeklyRetention,omitempty"` - // MonthlyRetention - The monthly retention policy for an LTR backup in an ISO 8601 format. - MonthlyRetention *string `json:"monthlyRetention,omitempty"` - // YearlyRetention - The yearly retention policy for an LTR backup in an ISO 8601 format. - YearlyRetention *string `json:"yearlyRetention,omitempty"` - // WeekOfYear - The week of year to take the yearly backup in an ISO 8601 format. - WeekOfYear *int32 `json:"weekOfYear,omitempty"` } // MaintenanceConfigurationCapability the maintenance configuration capability @@ -24535,26 +25025,20 @@ func (future *SyncMembersUpdateFuture) result(client SyncMembersClient) (sm Sync // SystemData metadata pertaining to creation and last modification of the resource. type SystemData struct { - // CreatedBy - READ-ONLY; A string identifier for the identity that created the resource. + // CreatedBy - The identity that created the resource. CreatedBy *string `json:"createdBy,omitempty"` - // CreatedByType - READ-ONLY; The type of identity that created the resource: . Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + // CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' CreatedByType CreatedByType `json:"createdByType,omitempty"` - // CreatedAt - READ-ONLY; The timestamp of resource creation (UTC). + // CreatedAt - The timestamp of resource creation (UTC). CreatedAt *date.Time `json:"createdAt,omitempty"` - // LastModifiedBy - READ-ONLY; A string identifier for the identity that last modified the resource. + // LastModifiedBy - The identity that last modified the resource. LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - // LastModifiedByType - READ-ONLY; The type of identity that last modified the resource: . Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` - // LastModifiedAt - READ-ONLY; The timestamp of last modification (UTC). + // LastModifiedAt - The timestamp of resource last modification (UTC) LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` } -// MarshalJSON is the custom marshaler for SystemData. -func (sd SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - // TdeCertificate a TDE certificate that can be uploaded into a server. type TdeCertificate struct { // TdeCertificateProperties - Resource properties. @@ -25092,6 +25576,53 @@ type UnlinkParameters struct { ForcedTermination *bool `json:"forcedTermination,omitempty"` } +// UpdateLongTermRetentionBackupParameters contains the information necessary to perform long term +// retention backup update operation. +type UpdateLongTermRetentionBackupParameters struct { + // UpdateLongTermRetentionBackupParametersProperties - Resource properties. + *UpdateLongTermRetentionBackupParametersProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for UpdateLongTermRetentionBackupParameters. +func (ultrbp UpdateLongTermRetentionBackupParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ultrbp.UpdateLongTermRetentionBackupParametersProperties != nil { + objectMap["properties"] = ultrbp.UpdateLongTermRetentionBackupParametersProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for UpdateLongTermRetentionBackupParameters struct. +func (ultrbp *UpdateLongTermRetentionBackupParameters) 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 updateLongTermRetentionBackupParametersProperties UpdateLongTermRetentionBackupParametersProperties + err = json.Unmarshal(*v, &updateLongTermRetentionBackupParametersProperties) + if err != nil { + return err + } + ultrbp.UpdateLongTermRetentionBackupParametersProperties = &updateLongTermRetentionBackupParametersProperties + } + } + } + + return nil +} + +// UpdateLongTermRetentionBackupParametersProperties contains the properties to perform long term retention +// backup copy operation. +type UpdateLongTermRetentionBackupParametersProperties struct { + // RequestedBackupStorageRedundancy - The storage redundancy type of the copied backup. Possible values include: 'RequestedBackupStorageRedundancyGeo', 'RequestedBackupStorageRedundancyLocal', 'RequestedBackupStorageRedundancyZone' + RequestedBackupStorageRedundancy RequestedBackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"` +} + // UpsertManagedServerOperationParameters ... type UpsertManagedServerOperationParameters struct { Family *string `json:"family,omitempty"` diff --git a/services/preview/sql/mgmt/v4.0/sql/privateendpointconnections.go b/services/preview/sql/mgmt/v4.0/sql/privateendpointconnections.go index 6b943ae6dad7..a090ca0ff760 100644 --- a/services/preview/sql/mgmt/v4.0/sql/privateendpointconnections.go +++ b/services/preview/sql/mgmt/v4.0/sql/privateendpointconnections.go @@ -83,7 +83,7 @@ func (client PrivateEndpointConnectionsClient) CreateOrUpdatePreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -165,7 +165,7 @@ func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -252,7 +252,7 @@ func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -334,7 +334,7 @@ func (client PrivateEndpointConnectionsClient) ListByServerPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01-preview" + const APIVersion = "2020-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/sql/mgmt/v4.0/sql/sqlapi/interfaces.go b/services/preview/sql/mgmt/v4.0/sql/sqlapi/interfaces.go index 6775b55a1c3c..6b968f8fd195 100644 --- a/services/preview/sql/mgmt/v4.0/sql/sqlapi/interfaces.go +++ b/services/preview/sql/mgmt/v4.0/sql/sqlapi/interfaces.go @@ -471,37 +471,6 @@ type JobVersionsClientAPI interface { var _ JobVersionsClientAPI = (*sql.JobVersionsClient)(nil) -// LongTermRetentionBackupsClientAPI contains the set of methods on the LongTermRetentionBackupsClient type. -type LongTermRetentionBackupsClientAPI interface { - Delete(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (result sql.LongTermRetentionBackupsDeleteFuture, err error) - DeleteByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (result sql.LongTermRetentionBackupsDeleteByResourceGroupFuture, err error) - Get(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (result sql.LongTermRetentionBackup, err error) - GetByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (result sql.LongTermRetentionBackup, err error) - ListByDatabase(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState sql.LongTermRetentionDatabaseState) (result sql.LongTermRetentionBackupListResultPage, err error) - ListByDatabaseComplete(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState sql.LongTermRetentionDatabaseState) (result sql.LongTermRetentionBackupListResultIterator, err error) - ListByLocation(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState sql.LongTermRetentionDatabaseState) (result sql.LongTermRetentionBackupListResultPage, err error) - ListByLocationComplete(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState sql.LongTermRetentionDatabaseState) (result sql.LongTermRetentionBackupListResultIterator, err error) - ListByResourceGroupDatabase(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState sql.LongTermRetentionDatabaseState) (result sql.LongTermRetentionBackupListResultPage, err error) - ListByResourceGroupDatabaseComplete(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState sql.LongTermRetentionDatabaseState) (result sql.LongTermRetentionBackupListResultIterator, err error) - ListByResourceGroupLocation(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState sql.LongTermRetentionDatabaseState) (result sql.LongTermRetentionBackupListResultPage, err error) - ListByResourceGroupLocationComplete(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState sql.LongTermRetentionDatabaseState) (result sql.LongTermRetentionBackupListResultIterator, err error) - ListByResourceGroupServer(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState sql.LongTermRetentionDatabaseState) (result sql.LongTermRetentionBackupListResultPage, err error) - ListByResourceGroupServerComplete(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState sql.LongTermRetentionDatabaseState) (result sql.LongTermRetentionBackupListResultIterator, err error) - ListByServer(ctx context.Context, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState sql.LongTermRetentionDatabaseState) (result sql.LongTermRetentionBackupListResultPage, err error) - ListByServerComplete(ctx context.Context, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState sql.LongTermRetentionDatabaseState) (result sql.LongTermRetentionBackupListResultIterator, err error) -} - -var _ LongTermRetentionBackupsClientAPI = (*sql.LongTermRetentionBackupsClient)(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.BackupLongTermRetentionPolicy, err error) -} - -var _ BackupLongTermRetentionPoliciesClientAPI = (*sql.BackupLongTermRetentionPoliciesClient)(nil) - // ManagedBackupShortTermRetentionPoliciesClientAPI contains the set of methods on the ManagedBackupShortTermRetentionPoliciesClient type. type ManagedBackupShortTermRetentionPoliciesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters sql.ManagedBackupShortTermRetentionPolicy) (result sql.ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture, err error) @@ -807,17 +776,6 @@ type UsagesClientAPI interface { var _ UsagesClientAPI = (*sql.UsagesClient)(nil) -// PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. -type PrivateEndpointConnectionsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters sql.PrivateEndpointConnection) (result sql.PrivateEndpointConnectionsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string) (result sql.PrivateEndpointConnectionsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string) (result sql.PrivateEndpointConnection, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.PrivateEndpointConnectionListResultPage, err error) - ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result sql.PrivateEndpointConnectionListResultIterator, err error) -} - -var _ PrivateEndpointConnectionsClientAPI = (*sql.PrivateEndpointConnectionsClient)(nil) - // PrivateLinkResourcesClientAPI contains the set of methods on the PrivateLinkResourcesClient type. type PrivateLinkResourcesClientAPI interface { Get(ctx context.Context, resourceGroupName string, serverName string, groupName string) (result sql.PrivateLinkResource, err error) @@ -856,18 +814,18 @@ type LongTermRetentionManagedInstanceBackupsClientAPI interface { DeleteByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, backupName string) (result sql.LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture, err error) Get(ctx context.Context, locationName string, managedInstanceName string, databaseName string, backupName string) (result sql.ManagedInstanceLongTermRetentionBackup, err error) GetByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, backupName string) (result sql.ManagedInstanceLongTermRetentionBackup, err error) - ListByDatabase(ctx context.Context, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState1) (result sql.ManagedInstanceLongTermRetentionBackupListResultPage, err error) - ListByDatabaseComplete(ctx context.Context, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState1) (result sql.ManagedInstanceLongTermRetentionBackupListResultIterator, err error) - ListByInstance(ctx context.Context, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState2) (result sql.ManagedInstanceLongTermRetentionBackupListResultPage, err error) - ListByInstanceComplete(ctx context.Context, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState2) (result sql.ManagedInstanceLongTermRetentionBackupListResultIterator, err error) - ListByLocation(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState3) (result sql.ManagedInstanceLongTermRetentionBackupListResultPage, err error) - ListByLocationComplete(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState3) (result sql.ManagedInstanceLongTermRetentionBackupListResultIterator, err error) - ListByResourceGroupDatabase(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState4) (result sql.ManagedInstanceLongTermRetentionBackupListResultPage, err error) - ListByResourceGroupDatabaseComplete(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState4) (result sql.ManagedInstanceLongTermRetentionBackupListResultIterator, err error) - ListByResourceGroupInstance(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState5) (result sql.ManagedInstanceLongTermRetentionBackupListResultPage, err error) - ListByResourceGroupInstanceComplete(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState5) (result sql.ManagedInstanceLongTermRetentionBackupListResultIterator, err error) - ListByResourceGroupLocation(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState6) (result sql.ManagedInstanceLongTermRetentionBackupListResultPage, err error) - ListByResourceGroupLocationComplete(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState6) (result sql.ManagedInstanceLongTermRetentionBackupListResultIterator, err error) + ListByDatabase(ctx context.Context, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.ManagedInstanceLongTermRetentionBackupListResultPage, err error) + ListByDatabaseComplete(ctx context.Context, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.ManagedInstanceLongTermRetentionBackupListResultIterator, err error) + ListByInstance(ctx context.Context, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.ManagedInstanceLongTermRetentionBackupListResultPage, err error) + ListByInstanceComplete(ctx context.Context, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.ManagedInstanceLongTermRetentionBackupListResultIterator, err error) + ListByLocation(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.ManagedInstanceLongTermRetentionBackupListResultPage, err error) + ListByLocationComplete(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.ManagedInstanceLongTermRetentionBackupListResultIterator, err error) + ListByResourceGroupDatabase(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.ManagedInstanceLongTermRetentionBackupListResultPage, err error) + ListByResourceGroupDatabaseComplete(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.ManagedInstanceLongTermRetentionBackupListResultIterator, err error) + ListByResourceGroupInstance(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.ManagedInstanceLongTermRetentionBackupListResultPage, err error) + ListByResourceGroupInstanceComplete(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.ManagedInstanceLongTermRetentionBackupListResultIterator, err error) + ListByResourceGroupLocation(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.ManagedInstanceLongTermRetentionBackupListResultPage, err error) + ListByResourceGroupLocationComplete(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.ManagedInstanceLongTermRetentionBackupListResultIterator, err error) } var _ LongTermRetentionManagedInstanceBackupsClientAPI = (*sql.LongTermRetentionManagedInstanceBackupsClient)(nil) @@ -1053,3 +1011,50 @@ type ServerDevOpsAuditSettingsClientAPI interface { } var _ ServerDevOpsAuditSettingsClientAPI = (*sql.ServerDevOpsAuditSettingsClient)(nil) + +// LongTermRetentionBackupsClientAPI contains the set of methods on the LongTermRetentionBackupsClient type. +type LongTermRetentionBackupsClientAPI interface { + Copy(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters sql.CopyLongTermRetentionBackupParameters) (result sql.LongTermRetentionBackupsCopyFuture, err error) + CopyByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters sql.CopyLongTermRetentionBackupParameters) (result sql.LongTermRetentionBackupsCopyByResourceGroupFuture, err error) + Delete(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (result sql.LongTermRetentionBackupsDeleteFuture, err error) + DeleteByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (result sql.LongTermRetentionBackupsDeleteByResourceGroupFuture, err error) + Get(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (result sql.LongTermRetentionBackup, err error) + GetByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string) (result sql.LongTermRetentionBackup, err error) + ListByDatabase(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.LongTermRetentionBackupListResultPage, err error) + ListByDatabaseComplete(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.LongTermRetentionBackupListResultIterator, err error) + ListByLocation(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.LongTermRetentionBackupListResultPage, err error) + ListByLocationComplete(ctx context.Context, locationName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.LongTermRetentionBackupListResultIterator, err error) + ListByResourceGroupDatabase(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.LongTermRetentionBackupListResultPage, err error) + ListByResourceGroupDatabaseComplete(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.LongTermRetentionBackupListResultIterator, err error) + ListByResourceGroupLocation(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.LongTermRetentionBackupListResultPage, err error) + ListByResourceGroupLocationComplete(ctx context.Context, resourceGroupName string, locationName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.LongTermRetentionBackupListResultIterator, err error) + ListByResourceGroupServer(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.LongTermRetentionBackupListResultPage, err error) + ListByResourceGroupServerComplete(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.LongTermRetentionBackupListResultIterator, err error) + ListByServer(ctx context.Context, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.LongTermRetentionBackupListResultPage, err error) + ListByServerComplete(ctx context.Context, locationName string, longTermRetentionServerName string, onlyLatestPerDatabase *bool, databaseState sql.DatabaseState) (result sql.LongTermRetentionBackupListResultIterator, err error) + Update(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters sql.UpdateLongTermRetentionBackupParameters) (result sql.LongTermRetentionBackupsUpdateFuture, err error) + UpdateByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters sql.UpdateLongTermRetentionBackupParameters) (result sql.LongTermRetentionBackupsUpdateByResourceGroupFuture, err error) +} + +var _ LongTermRetentionBackupsClientAPI = (*sql.LongTermRetentionBackupsClient)(nil) + +// LongTermRetentionPoliciesClientAPI contains the set of methods on the LongTermRetentionPoliciesClient type. +type LongTermRetentionPoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.LongTermRetentionPolicy) (result sql.LongTermRetentionPoliciesCreateOrUpdateFuture, err error) + Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.LongTermRetentionPolicy, err error) + ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.LongTermRetentionPolicyListResultPage, err error) + ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.LongTermRetentionPolicyListResultIterator, err error) +} + +var _ LongTermRetentionPoliciesClientAPI = (*sql.LongTermRetentionPoliciesClient)(nil) + +// PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. +type PrivateEndpointConnectionsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters sql.PrivateEndpointConnection) (result sql.PrivateEndpointConnectionsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string) (result sql.PrivateEndpointConnectionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string) (result sql.PrivateEndpointConnection, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.PrivateEndpointConnectionListResultPage, err error) + ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result sql.PrivateEndpointConnectionListResultIterator, err error) +} + +var _ PrivateEndpointConnectionsClientAPI = (*sql.PrivateEndpointConnectionsClient)(nil) diff --git a/services/preview/sql/mgmt/v5.0/sql/CHANGELOG.md b/services/preview/sql/mgmt/v5.0/sql/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/preview/sql/mgmt/v5.0/sql/CHANGELOG.md +++ b/services/preview/sql/mgmt/v5.0/sql/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/preview/sql/mgmt/v5.0/sql/_meta.json b/services/preview/sql/mgmt/v5.0/sql/_meta.json index c1fe03a5a532..3286199c994f 100644 --- a/services/preview/sql/mgmt/v5.0/sql/_meta.json +++ b/services/preview/sql/mgmt/v5.0/sql/_meta.json @@ -1,5 +1,5 @@ { - "commit": "8dff86df71bee429af84ea4713288ef3cdd1db2f", + "commit": "a07f49e3f75a134c1acdacc338c9f9dc32386f66", "readme": "/_/azure-rest-api-specs/specification/sql/resource-manager/readme.md", "tag": "package-composite-v5", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/services/sql/mgmt/2014-04-01/sql/CHANGELOG.md b/services/sql/mgmt/2014-04-01/sql/CHANGELOG.md index d62f29075dba..a1ecf841edb0 100644 --- a/services/sql/mgmt/2014-04-01/sql/CHANGELOG.md +++ b/services/sql/mgmt/2014-04-01/sql/CHANGELOG.md @@ -1,43 +1,2 @@ -# Change History +# Unreleased -## Additive Changes - -### New Funcs - -1. CheckNameAvailabilityResponse.MarshalJSON() ([]byte, error) -1. DatabaseUsage.MarshalJSON() ([]byte, error) -1. EditionCapability.MarshalJSON() ([]byte, error) -1. ElasticPoolActivityProperties.MarshalJSON() ([]byte, error) -1. ElasticPoolDatabaseActivityProperties.MarshalJSON() ([]byte, error) -1. ElasticPoolDtuCapability.MarshalJSON() ([]byte, error) -1. ElasticPoolEditionCapability.MarshalJSON() ([]byte, error) -1. ElasticPoolPerDatabaseMaxDtuCapability.MarshalJSON() ([]byte, error) -1. ElasticPoolPerDatabaseMinDtuCapability.MarshalJSON() ([]byte, error) -1. ImportExportResponseProperties.MarshalJSON() ([]byte, error) -1. LocationCapabilities.MarshalJSON() ([]byte, error) -1. MaxSizeCapability.MarshalJSON() ([]byte, error) -1. Metric.MarshalJSON() ([]byte, error) -1. MetricAvailability.MarshalJSON() ([]byte, error) -1. MetricDefinition.MarshalJSON() ([]byte, error) -1. MetricName.MarshalJSON() ([]byte, error) -1. MetricValue.MarshalJSON() ([]byte, error) -1. OperationImpact.MarshalJSON() ([]byte, error) -1. PerformanceLevel.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. QueryInterval.MarshalJSON() ([]byte, error) -1. QueryMetric.MarshalJSON() ([]byte, error) -1. QueryStatistic.MarshalJSON() ([]byte, error) -1. QueryText.MarshalJSON() ([]byte, error) -1. RecommendedIndexProperties.MarshalJSON() ([]byte, error) -1. RecoverableDatabaseProperties.MarshalJSON() ([]byte, error) -1. ReplicationLinkProperties.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. RestorableDroppedDatabaseProperties.MarshalJSON() ([]byte, error) -1. RestorePointProperties.MarshalJSON() ([]byte, error) -1. ServerUsage.MarshalJSON() ([]byte, error) -1. ServerVersionCapability.MarshalJSON() ([]byte, error) -1. ServiceObjectiveProperties.MarshalJSON() ([]byte, error) -1. ServiceTierAdvisorProperties.MarshalJSON() ([]byte, error) -1. SloUsageMetric.MarshalJSON() ([]byte, error) -1. TopQueries.MarshalJSON() ([]byte, error) -1. TransparentDataEncryptionActivityProperties.MarshalJSON() ([]byte, error) diff --git a/services/sql/mgmt/2014-04-01/sql/_meta.json b/services/sql/mgmt/2014-04-01/sql/_meta.json index 5da05cc1db34..498355cce5d2 100644 --- a/services/sql/mgmt/2014-04-01/sql/_meta.json +++ b/services/sql/mgmt/2014-04-01/sql/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a07f49e3f75a134c1acdacc338c9f9dc32386f66", "readme": "/_/azure-rest-api-specs/specification/sql/resource-manager/readme.md", "tag": "package-pure-2014-04", "use": "@microsoft.azure/autorest.go@2.1.183",