From c9021ef18b8036a8e7de8f97b453b7d405a35d9b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 20 Apr 2022 13:16:13 +0000 Subject: [PATCH] CodeGen from PR 18751 in Azure/azure-rest-api-specs Merge 50e99328fbe5910cbe23d2f6d31b52d26360aac9 into b5d8eef5bf187dc99f1c18e8323b19e0c37a7124 --- .../mgmt/2015-05-01-preview/sql/CHANGELOG.md | 41 +- .../mgmt/2015-05-01-preview/sql/_meta.json | 2 +- .../sql/mgmt/2015-05-01-preview/sql/enums.go | 60 +- .../sql/mgmt/2015-05-01-preview/sql/models.go | 6 +- .../mgmt/2017-03-01-preview/sql/CHANGELOG.md | 41 +- .../mgmt/2017-03-01-preview/sql/_meta.json | 2 +- .../sql/mgmt/2017-03-01-preview/sql/enums.go | 60 +- .../sql/mgmt/2017-03-01-preview/sql/models.go | 18 +- .../mgmt/2017-10-01-preview/sql/CHANGELOG.md | 2 +- .../mgmt/2017-10-01-preview/sql/_meta.json | 2 +- .../mgmt/2018-06-01-preview/sql/CHANGELOG.md | 28 +- .../mgmt/2018-06-01-preview/sql/_meta.json | 2 +- .../sql/mgmt/2018-06-01-preview/sql/enums.go | 30 +- .../sql/mgmt/2018-06-01-preview/sql/models.go | 4 +- .../preview/sql/mgmt/v3.0/sql/CHANGELOG.md | 126 +- services/preview/sql/mgmt/v3.0/sql/_meta.json | 2 +- services/preview/sql/mgmt/v3.0/sql/enums.go | 110 +- .../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 | 629 ++- .../v3.0/sql/privateendpointconnections.go | 8 +- .../sql/mgmt/v3.0/sql/sqlapi/interfaces.go | 67 +- .../preview/sql/mgmt/v4.0/sql/CHANGELOG.md | 336 +- 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 | 200 +- .../mgmt/v4.0/sql/longtermretentionbackups.go | 406 +- ...longtermretentionmanagedinstancebackups.go | 36 +- ...licies.go => longtermretentionpolicies.go} | 126 +- services/preview/sql/mgmt/v4.0/sql/models.go | 1263 ++++-- .../v4.0/sql/privateendpointconnections.go | 8 +- .../sql/mgmt/v4.0/sql/sqlapi/interfaces.go | 113 +- .../preview/sql/mgmt/v5.0/sql/CHANGELOG.md | 491 +- services/preview/sql/mgmt/v5.0/sql/_meta.json | 2 +- .../preview/sql/mgmt/v5.0/sql/databases.go | 28 +- .../v5.0/sql/databasesecurityalertpolicies.go | 4 +- .../v5.0/sql/distributedavailabilitygroups.go | 483 ++ .../preview/sql/mgmt/v5.0/sql/elasticpools.go | 18 +- .../sql/mgmt/v5.0/sql/endpointcertificates.go | 232 + services/preview/sql/mgmt/v5.0/sql/enums.go | 204 +- .../sql/mgmt/v5.0/sql/ipv6firewallrules.go | 392 ++ .../sql/mgmt/v5.0/sql/ledgerdigestuploads.go | 62 +- .../mgmt/v5.0/sql/longtermretentionbackups.go | 28 +- ...longtermretentionmanagedinstancebackups.go | 20 +- .../manageddatabasesecurityalertpolicies.go | 4 +- .../sql/mgmt/v5.0/sql/managedinstances.go | 18 +- services/preview/sql/mgmt/v5.0/sql/models.go | 3956 ++++++++++++----- .../sql/mgmt/v5.0/sql/operationshealth.go | 150 - .../sql/mgmt/v5.0/sql/replicationlinks.go | 333 -- .../v5.0/sql/restorabledroppeddatabases.go | 4 +- .../sql/restorabledroppedmanageddatabases.go | 4 +- .../mgmt/v5.0/sql/serverconnectionpolicies.go | 164 +- .../mgmt/v5.0/sql/servertrustcertificates.go | 399 ++ .../sql/mgmt/v5.0/sql/sqlapi/interfaces.go | 394 +- .../preview/sql/mgmt/v5.0/sql/syncgroups.go | 6 +- .../transparentdataencryptionactivities.go | 115 - .../v5.0/sql/transparentdataencryptions.go | 172 +- services/sql/mgmt/2014-04-01/sql/CHANGELOG.md | 2 +- services/sql/mgmt/2014-04-01/sql/_meta.json | 2 +- 60 files changed, 8443 insertions(+), 3356 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%) create mode 100644 services/preview/sql/mgmt/v5.0/sql/distributedavailabilitygroups.go create mode 100644 services/preview/sql/mgmt/v5.0/sql/endpointcertificates.go create mode 100644 services/preview/sql/mgmt/v5.0/sql/ipv6firewallrules.go delete mode 100644 services/preview/sql/mgmt/v5.0/sql/operationshealth.go create mode 100644 services/preview/sql/mgmt/v5.0/sql/servertrustcertificates.go delete mode 100644 services/preview/sql/mgmt/v5.0/sql/transparentdataencryptionactivities.go 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 52911e4cc5e4..f24416d8a595 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,2 +1,41 @@ -# 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 Constants + +1. IdentityType.SystemAssignedUserAssigned +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 e8c2180420cf..c744d9a313a9 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": "0dc36a61d0262fdce1de05e28de0cd55d74e18a9", "readme": "/_/azure-rest-api-specs/specification/sql/resource-manager/readme.md", "tag": "package-2015-05-preview", "use": "@microsoft.azure/autorest.go@2.1.187", 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..3f357397e296 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,19 @@ func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState { type IdentityType string const ( + // None ... + None IdentityType = "None" // SystemAssigned ... SystemAssigned IdentityType = "SystemAssigned" + // SystemAssignedUserAssigned ... + SystemAssignedUserAssigned IdentityType = "SystemAssigned,UserAssigned" + // 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, SystemAssignedUserAssigned, UserAssigned} } // ManagedInstanceLicenseType enumerates the values for managed instance license type. @@ -368,23 +374,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 +996,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..581f17ac7fdc 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', 'SystemAssignedUserAssigned' 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 52911e4cc5e4..f24416d8a595 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,2 +1,41 @@ -# 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 Constants + +1. IdentityType.SystemAssignedUserAssigned +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 355088c31f38..0b461c1868d0 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": "0dc36a61d0262fdce1de05e28de0cd55d74e18a9", "readme": "/_/azure-rest-api-specs/specification/sql/resource-manager/readme.md", "tag": "package-2017-03-preview", "use": "@microsoft.azure/autorest.go@2.1.187", 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..bc6c7e6d804c 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,19 @@ func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState { type IdentityType string const ( + // None ... + None IdentityType = "None" // SystemAssigned ... SystemAssigned IdentityType = "SystemAssigned" + // SystemAssignedUserAssigned ... + SystemAssignedUserAssigned IdentityType = "SystemAssigned,UserAssigned" + // 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, SystemAssignedUserAssigned, UserAssigned} } // JobAgentState enumerates the values for job agent state. @@ -704,23 +710,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 +1389,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..2d119e58fe0a 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 @@ -631,6 +631,9 @@ type DatabaseBlobAuditingPolicyProperties struct { // USER_CHANGE_PASSWORD_GROUP // BATCH_STARTED_GROUP // BATCH_COMPLETED_GROUP + // DBCC_GROUP + // DATABASE_OWNERSHIP_CHANGE_GROUP + // DATABASE_CHANGE_GROUP // // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. // @@ -3707,6 +3710,9 @@ type ExtendedDatabaseBlobAuditingPolicyProperties struct { // USER_CHANGE_PASSWORD_GROUP // BATCH_STARTED_GROUP // BATCH_COMPLETED_GROUP + // DBCC_GROUP + // DATABASE_OWNERSHIP_CHANGE_GROUP + // DATABASE_CHANGE_GROUP // // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. // @@ -4086,6 +4092,9 @@ type ExtendedServerBlobAuditingPolicyProperties struct { // USER_CHANGE_PASSWORD_GROUP // BATCH_STARTED_GROUP // BATCH_COMPLETED_GROUP + // DBCC_GROUP + // DATABASE_OWNERSHIP_CHANGE_GROUP + // DATABASE_CHANGE_GROUP // // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. // @@ -9288,11 +9297,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 +10084,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', 'SystemAssignedUserAssigned' Type IdentityType `json:"type,omitempty"` // TenantID - READ-ONLY; The Azure Active Directory tenant id. TenantID *uuid.UUID `json:"tenantId,omitempty"` @@ -11687,6 +11696,9 @@ type ServerBlobAuditingPolicyProperties struct { // USER_CHANGE_PASSWORD_GROUP // BATCH_STARTED_GROUP // BATCH_COMPLETED_GROUP + // DBCC_GROUP + // DATABASE_OWNERSHIP_CHANGE_GROUP + // DATABASE_CHANGE_GROUP // // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. // 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 52911e4cc5e4..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,2 +1,2 @@ -# Change History +# Unreleased 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 4df1e8fcb670..1c4d83cf9499 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": "0dc36a61d0262fdce1de05e28de0cd55d74e18a9", "readme": "/_/azure-rest-api-specs/specification/sql/resource-manager/readme.md", "tag": "package-pure-2017-10-preview", "use": "@microsoft.azure/autorest.go@2.1.187", 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 52911e4cc5e4..71c26d62a517 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,2 +1,28 @@ -# 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 Constants + +1. IdentityType.SystemAssignedUserAssigned +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 66cbec1fe487..494e9f088875 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": "0dc36a61d0262fdce1de05e28de0cd55d74e18a9", "readme": "/_/azure-rest-api-specs/specification/sql/resource-manager/readme.md", "tag": "package-pure-2018-06-preview", "use": "@microsoft.azure/autorest.go@2.1.187", 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..612a61848f06 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,19 @@ func PossibleDatabaseStateValues() []DatabaseState { type IdentityType string const ( + // None ... + None IdentityType = "None" // SystemAssigned ... SystemAssigned IdentityType = "SystemAssigned" + // SystemAssignedUserAssigned ... + SystemAssignedUserAssigned IdentityType = "SystemAssigned,UserAssigned" + // 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, SystemAssignedUserAssigned, UserAssigned} } // InstancePoolLicenseType enumerates the values for instance pool license type. @@ -218,21 +224,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..83d18bb325c2 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', 'SystemAssignedUserAssigned' 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 52911e4cc5e4..7738e1339d5d 100644 --- a/services/preview/sql/mgmt/v3.0/sql/CHANGELOG.md +++ b/services/preview/sql/mgmt/v3.0/sql/CHANGELOG.md @@ -1,2 +1,126 @@ -# 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 + +#### Removed Struct Fields + +1. DatabaseUpdate.*DatabaseProperties + +### 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.SystemAssignedUserAssigned +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. *TopQueriesListResultIterator.Next() error +1. *TopQueriesListResultIterator.NextWithContext(context.Context) error +1. *TopQueriesListResultPage.Next() error +1. *TopQueriesListResultPage.NextWithContext(context.Context) error +1. DatabaseUpdateProperties.MarshalJSON() ([]byte, 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. DatabaseUpdateProperties +1. ManagedInstancePecProperty +1. ManagedInstancePrivateEndpointConnectionProperties +1. ManagedInstancePrivateEndpointProperty +1. QueryMetricInterval +1. QueryMetricProperties +1. QueryStatisticsProperties +1. TopQueries +1. TopQueriesListResult +1. TopQueriesListResultIterator +1. TopQueriesListResultPage + +#### New Struct Fields + +1. DatabaseProperties.SourceResourceID +1. DatabaseUpdate.*DatabaseUpdateProperties +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 9a952e027cb6..fb9a00b186e7 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": "0dc36a61d0262fdce1de05e28de0cd55d74e18a9", "readme": "/_/azure-rest-api-specs/specification/sql/resource-manager/readme.md", "tag": "package-composite-v3", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/sql/mgmt/v3.0/sql/enums.go b/services/preview/sql/mgmt/v3.0/sql/enums.go index fce7ec38a37f..ad274f8a6696 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,19 @@ func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState { type IdentityType string const ( + // None ... + None IdentityType = "None" // SystemAssigned ... SystemAssigned IdentityType = "SystemAssigned" + // SystemAssignedUserAssigned ... + SystemAssignedUserAssigned IdentityType = "SystemAssigned,UserAssigned" + // 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, SystemAssignedUserAssigned, UserAssigned} } // InstanceFailoverGroupReplicationRole enumerates the values for instance failover group replication role. @@ -911,6 +938,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 +1006,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 +1124,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 c9a950271bb9..cdb52af38d8a 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()) @@ -129,7 +126,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. @@ -144,14 +142,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") @@ -221,7 +211,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) { @@ -235,14 +226,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") @@ -309,7 +292,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) { @@ -323,14 +307,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") @@ -395,7 +371,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() { @@ -408,14 +385,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 { @@ -521,7 +490,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() { @@ -534,14 +504,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 { @@ -647,7 +609,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. @@ -662,14 +625,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 652a8d675c0e..3116dec56424 100644 --- a/services/preview/sql/mgmt/v3.0/sql/managedinstances.go +++ b/services/preview/sql/mgmt/v3.0/sql/managedinstances.go @@ -205,8 +205,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() { @@ -219,14 +220,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") @@ -250,7 +243,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, } @@ -602,6 +595,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..b67382fd024d 100644 --- a/services/preview/sql/mgmt/v3.0/sql/models.go +++ b/services/preview/sql/mgmt/v3.0/sql/models.go @@ -1514,6 +1514,9 @@ type DatabaseBlobAuditingPolicyProperties struct { // USER_CHANGE_PASSWORD_GROUP // BATCH_STARTED_GROUP // BATCH_COMPLETED_GROUP + // DBCC_GROUP + // DATABASE_OWNERSHIP_CHANGE_GROUP + // DATABASE_CHANGE_GROUP // // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. // @@ -2083,6 +2086,20 @@ type DatabaseProperties struct { PausedDate *date.Time `json:"pausedDate,omitempty"` // ResumedDate - READ-ONLY; The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused. ResumedDate *date.Time `json:"resumedDate,omitempty"` + // SourceResourceID - The resource identifier of the source associated with the create operation of this database. + // + // When sourceResourceId is specified, sourceDatabaseId, recoverableDatabaseId, restorableDroppedDatabaseId and sourceDatabaseDeletionDate must not be specified and CreateMode must be PointInTimeRestore, Restore or Recover. + // + // When createMode is PointInTimeRestore, sourceResourceId must be the resource ID of an existing database or existing sql pool, and restorePointInTime must be specified. + // + // When createMode is Restore, sourceResourceId must be the resource ID of restorable dropped database or restorable dropped sql pool. + // + // When createMode is Recover, sourceResourceId must be the resource ID of recoverable database or recoverable sql pool. + // + // This property allows to restore across subscriptions which is only supported for DataWarehouse edition. + // + // When source subscription belongs to a different tenant than target subscription, “x-ms-authorization-auxiliary” header must contain authentication token for the source tenant. For more details about “x-ms-authorization-auxiliary” header see https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant + SourceResourceID *string `json:"sourceResourceId,omitempty"` } // MarshalJSON is the custom marshaler for DatabaseProperties. @@ -2148,6 +2165,9 @@ func (dp DatabaseProperties) MarshalJSON() ([]byte, error) { if dp.MinCapacity != nil { objectMap["minCapacity"] = dp.MinCapacity } + if dp.SourceResourceID != nil { + objectMap["sourceResourceId"] = dp.SourceResourceID + } return json.Marshal(objectMap) } @@ -2595,12 +2615,12 @@ func (future *DatabasesUpgradeDataWarehouseFuture) result(client DatabasesClient return } -// DatabaseUpdate a database resource. +// DatabaseUpdate a database update resource. type DatabaseUpdate struct { // Sku - The name and tier of the SKU. Sku *Sku `json:"sku,omitempty"` - // DatabaseProperties - Resource properties. - *DatabaseProperties `json:"properties,omitempty"` + // DatabaseUpdateProperties - Resource properties. + *DatabaseUpdateProperties `json:"properties,omitempty"` // Tags - Resource tags. Tags map[string]*string `json:"tags"` } @@ -2611,8 +2631,8 @@ func (du DatabaseUpdate) MarshalJSON() ([]byte, error) { if du.Sku != nil { objectMap["sku"] = du.Sku } - if du.DatabaseProperties != nil { - objectMap["properties"] = du.DatabaseProperties + if du.DatabaseUpdateProperties != nil { + objectMap["properties"] = du.DatabaseUpdateProperties } if du.Tags != nil { objectMap["tags"] = du.Tags @@ -2640,12 +2660,12 @@ func (du *DatabaseUpdate) UnmarshalJSON(body []byte) error { } case "properties": if v != nil { - var databaseProperties DatabaseProperties - err = json.Unmarshal(*v, &databaseProperties) + var databaseUpdateProperties DatabaseUpdateProperties + err = json.Unmarshal(*v, &databaseUpdateProperties) if err != nil { return err } - du.DatabaseProperties = &databaseProperties + du.DatabaseUpdateProperties = &databaseUpdateProperties } case "tags": if v != nil { @@ -2662,6 +2682,156 @@ func (du *DatabaseUpdate) UnmarshalJSON(body []byte) error { return nil } +// DatabaseUpdateProperties a database update properties. +type DatabaseUpdateProperties struct { + // CreateMode - Specifies the mode of database creation. + // + // Default: regular database creation. + // + // Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database. + // + // Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database. + // + // PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified. + // + // Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore. + // + // Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time. + // + // RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID. + // + // Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. Possible values include: 'CreateModeDefault', 'CreateModeCopy', 'CreateModeSecondary', 'CreateModePointInTimeRestore', 'CreateModeRestore', 'CreateModeRecovery', 'CreateModeRestoreExternalBackup', 'CreateModeRestoreExternalBackupSecondary', 'CreateModeRestoreLongTermRetentionBackup', 'CreateModeOnlineSecondary' + CreateMode CreateMode `json:"createMode,omitempty"` + // Collation - The collation of the database. + Collation *string `json:"collation,omitempty"` + // MaxSizeBytes - The max size of the database expressed in bytes. + MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"` + // SampleName - The name of the sample schema to apply when creating this database. Possible values include: 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + SampleName SampleName `json:"sampleName,omitempty"` + // ElasticPoolID - The resource identifier of the elastic pool containing this database. + ElasticPoolID *string `json:"elasticPoolId,omitempty"` + // SourceDatabaseID - The resource identifier of the source database associated with create operation of this database. + SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"` + // Status - READ-ONLY; The status of the database. Possible values include: 'DatabaseStatusOnline', 'DatabaseStatusRestoring', 'DatabaseStatusRecoveryPending', 'DatabaseStatusRecovering', 'DatabaseStatusSuspect', 'DatabaseStatusOffline', 'DatabaseStatusStandby', 'DatabaseStatusShutdown', 'DatabaseStatusEmergencyMode', 'DatabaseStatusAutoClosed', 'DatabaseStatusCopying', 'DatabaseStatusCreating', 'DatabaseStatusInaccessible', 'DatabaseStatusOfflineSecondary', 'DatabaseStatusPausing', 'DatabaseStatusPaused', 'DatabaseStatusResuming', 'DatabaseStatusScaling', 'DatabaseStatusOfflineChangingDwPerformanceTiers', 'DatabaseStatusOnlineChangingDwPerformanceTiers', 'DatabaseStatusDisabled' + Status DatabaseStatus `json:"status,omitempty"` + // DatabaseID - READ-ONLY; The ID of the database. + DatabaseID *uuid.UUID `json:"databaseId,omitempty"` + // CreationDate - READ-ONLY; The creation date of the database (ISO8601 format). + CreationDate *date.Time `json:"creationDate,omitempty"` + // CurrentServiceObjectiveName - READ-ONLY; The current service level objective name of the database. + CurrentServiceObjectiveName *string `json:"currentServiceObjectiveName,omitempty"` + // RequestedServiceObjectiveName - READ-ONLY; The requested service level objective name of the database. + RequestedServiceObjectiveName *string `json:"requestedServiceObjectiveName,omitempty"` + // DefaultSecondaryLocation - READ-ONLY; The default secondary region for this database. + DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty"` + // FailoverGroupID - READ-ONLY; Failover Group resource identifier that this database belongs to. + FailoverGroupID *string `json:"failoverGroupId,omitempty"` + // RestorePointInTime - Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. + RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"` + // SourceDatabaseDeletionDate - Specifies the time that the database was deleted. + SourceDatabaseDeletionDate *date.Time `json:"sourceDatabaseDeletionDate,omitempty"` + // RecoveryServicesRecoveryPointID - The resource identifier of the recovery point associated with create operation of this database. + RecoveryServicesRecoveryPointID *string `json:"recoveryServicesRecoveryPointId,omitempty"` + // LongTermRetentionBackupResourceID - The resource identifier of the long term retention backup associated with create operation of this database. + LongTermRetentionBackupResourceID *string `json:"longTermRetentionBackupResourceId,omitempty"` + // RecoverableDatabaseID - The resource identifier of the recoverable database associated with create operation of this database. + RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"` + // RestorableDroppedDatabaseID - The resource identifier of the restorable dropped database associated with create operation of this database. + RestorableDroppedDatabaseID *string `json:"restorableDroppedDatabaseId,omitempty"` + // CatalogCollation - Collation of the metadata catalog. Possible values include: 'DATABASEDEFAULT', 'SQLLatin1GeneralCP1CIAS' + CatalogCollation CatalogCollationType `json:"catalogCollation,omitempty"` + // ZoneRedundant - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` + // LicenseType - The license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit. Possible values include: 'LicenseIncluded', 'BasePrice' + LicenseType DatabaseLicenseType `json:"licenseType,omitempty"` + // MaxLogSizeBytes - READ-ONLY; The max log size for this database. + MaxLogSizeBytes *int64 `json:"maxLogSizeBytes,omitempty"` + // EarliestRestoreDate - READ-ONLY; This records the earliest start date and time that restore is available for this database (ISO8601 format). + EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` + // ReadScale - The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Possible values include: 'DatabaseReadScaleEnabled', 'DatabaseReadScaleDisabled' + ReadScale DatabaseReadScale `json:"readScale,omitempty"` + // ReadReplicaCount - The number of readonly secondary replicas associated with the database. + ReadReplicaCount *int32 `json:"readReplicaCount,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"` + // 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. + PausedDate *date.Time `json:"pausedDate,omitempty"` + // ResumedDate - READ-ONLY; The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused. + ResumedDate *date.Time `json:"resumedDate,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabaseUpdateProperties. +func (dup DatabaseUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dup.CreateMode != "" { + objectMap["createMode"] = dup.CreateMode + } + if dup.Collation != nil { + objectMap["collation"] = dup.Collation + } + if dup.MaxSizeBytes != nil { + objectMap["maxSizeBytes"] = dup.MaxSizeBytes + } + if dup.SampleName != "" { + objectMap["sampleName"] = dup.SampleName + } + if dup.ElasticPoolID != nil { + objectMap["elasticPoolId"] = dup.ElasticPoolID + } + if dup.SourceDatabaseID != nil { + objectMap["sourceDatabaseId"] = dup.SourceDatabaseID + } + if dup.RestorePointInTime != nil { + objectMap["restorePointInTime"] = dup.RestorePointInTime + } + if dup.SourceDatabaseDeletionDate != nil { + objectMap["sourceDatabaseDeletionDate"] = dup.SourceDatabaseDeletionDate + } + if dup.RecoveryServicesRecoveryPointID != nil { + objectMap["recoveryServicesRecoveryPointId"] = dup.RecoveryServicesRecoveryPointID + } + if dup.LongTermRetentionBackupResourceID != nil { + objectMap["longTermRetentionBackupResourceId"] = dup.LongTermRetentionBackupResourceID + } + if dup.RecoverableDatabaseID != nil { + objectMap["recoverableDatabaseId"] = dup.RecoverableDatabaseID + } + if dup.RestorableDroppedDatabaseID != nil { + objectMap["restorableDroppedDatabaseId"] = dup.RestorableDroppedDatabaseID + } + if dup.CatalogCollation != "" { + objectMap["catalogCollation"] = dup.CatalogCollation + } + if dup.ZoneRedundant != nil { + objectMap["zoneRedundant"] = dup.ZoneRedundant + } + if dup.LicenseType != "" { + objectMap["licenseType"] = dup.LicenseType + } + if dup.ReadScale != "" { + objectMap["readScale"] = dup.ReadScale + } + if dup.ReadReplicaCount != nil { + objectMap["readReplicaCount"] = dup.ReadReplicaCount + } + if dup.AutoPauseDelay != nil { + objectMap["autoPauseDelay"] = dup.AutoPauseDelay + } + if dup.StorageAccountType != "" { + objectMap["storageAccountType"] = dup.StorageAccountType + } + if dup.MinCapacity != nil { + objectMap["minCapacity"] = dup.MinCapacity + } + return json.Marshal(objectMap) +} + // DatabaseUsage the database usages. type DatabaseUsage struct { // Name - READ-ONLY; The name of the usage metric. @@ -5375,6 +5545,9 @@ type ExtendedDatabaseBlobAuditingPolicyProperties struct { // USER_CHANGE_PASSWORD_GROUP // BATCH_STARTED_GROUP // BATCH_COMPLETED_GROUP + // DBCC_GROUP + // DATABASE_OWNERSHIP_CHANGE_GROUP + // DATABASE_CHANGE_GROUP // // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. // @@ -5754,6 +5927,9 @@ type ExtendedServerBlobAuditingPolicyProperties struct { // USER_CHANGE_PASSWORD_GROUP // BATCH_STARTED_GROUP // BATCH_COMPLETED_GROUP + // DBCC_GROUP + // DATABASE_OWNERSHIP_CHANGE_GROUP + // DATABASE_CHANGE_GROUP // // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. // @@ -11153,109 +11329,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 +14388,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 +14503,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 +14570,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 +14777,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 +14791,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 +14821,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 +15608,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 +16578,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 +17515,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', 'SystemAssignedUserAssigned' Type IdentityType `json:"type,omitempty"` // TenantID - READ-ONLY; The Azure Active Directory tenant id. TenantID *uuid.UUID `json:"tenantId,omitempty"` @@ -19047,6 +19255,9 @@ type ServerBlobAuditingPolicyProperties struct { // USER_CHANGE_PASSWORD_GROUP // BATCH_STARTED_GROUP // BATCH_COMPLETED_GROUP + // DBCC_GROUP + // DATABASE_OWNERSHIP_CHANGE_GROUP + // DATABASE_CHANGE_GROUP // // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. // @@ -24127,6 +24338,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 d66b3e5f3f61..9fcd87b43a29 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, } @@ -166,7 +166,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, } @@ -254,7 +254,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, } @@ -336,7 +336,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 52911e4cc5e4..0e6c7a6ac2ec 100644 --- a/services/preview/sql/mgmt/v4.0/sql/CHANGELOG.md +++ b/services/preview/sql/mgmt/v4.0/sql/CHANGELOG.md @@ -1,2 +1,336 @@ -# 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. IdentityType.SystemAssignedUserAssigned +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. *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 bb735559bd7b..c9921062f603 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": "0dc36a61d0262fdce1de05e28de0cd55d74e18a9", "readme": "/_/azure-rest-api-specs/specification/sql/resource-manager/readme.md", "tag": "package-composite-v4", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/sql/mgmt/v4.0/sql/databases.go b/services/preview/sql/mgmt/v4.0/sql/databases.go index 95d7c44d9246..52dec36114dd 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, } @@ -172,7 +172,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, } @@ -348,7 +348,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, } @@ -439,7 +439,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, } @@ -523,7 +523,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, } @@ -642,7 +642,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, } @@ -761,7 +761,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, } @@ -1030,7 +1030,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, } @@ -1126,7 +1126,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, } @@ -1199,7 +1199,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, } @@ -1282,7 +1282,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, } @@ -1366,7 +1366,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..cc861f6c6013 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. @@ -601,13 +550,15 @@ const ( None IdentityType = "None" // SystemAssigned ... SystemAssigned IdentityType = "SystemAssigned" + // SystemAssignedUserAssigned ... + SystemAssignedUserAssigned IdentityType = "SystemAssigned,UserAssigned" // UserAssigned ... UserAssigned IdentityType = "UserAssigned" ) // PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. func PossibleIdentityTypeValues() []IdentityType { - return []IdentityType{None, SystemAssigned, UserAssigned} + return []IdentityType{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned} } // InstanceFailoverGroupReplicationRole enumerates the values for instance failover group replication role. @@ -803,23 +754,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 +1263,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 +1316,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 +1821,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 c2b40d332dd1..99ca55b9bef1 100644 --- a/services/preview/sql/mgmt/v4.0/sql/longtermretentionbackups.go +++ b/services/preview/sql/mgmt/v4.0/sql/longtermretentionbackups.go @@ -33,6 +33,181 @@ 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", result.Response(), "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 + future.FutureAPI = &azure.Future{} + 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", result.Response(), "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 + future.FutureAPI = &azure.Future{} + 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 +250,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, } @@ -160,7 +335,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, } @@ -249,7 +424,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, } @@ -332,7 +507,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, } @@ -370,7 +545,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() { @@ -409,7 +584,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), @@ -417,7 +592,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, } @@ -476,7 +651,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() { @@ -496,7 +671,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() { @@ -535,13 +710,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, } @@ -600,7 +775,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() { @@ -624,7 +799,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() { @@ -663,7 +838,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), @@ -672,7 +847,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, } @@ -731,7 +906,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() { @@ -753,7 +928,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() { @@ -792,14 +967,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, } @@ -858,7 +1033,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() { @@ -881,7 +1056,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() { @@ -920,7 +1095,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), @@ -928,7 +1103,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, } @@ -987,7 +1162,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() { @@ -1008,7 +1183,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() { @@ -1047,14 +1222,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, } @@ -1113,7 +1288,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() { @@ -1127,3 +1302,178 @@ 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", result.Response(), "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 + future.FutureAPI = &azure.Future{} + 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", result.Response(), "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 + future.FutureAPI = &azure.Future{} + 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 a0b0712c782d..dcca4055b809 100644 --- a/services/preview/sql/mgmt/v4.0/sql/longtermretentionmanagedinstancebackups.go +++ b/services/preview/sql/mgmt/v4.0/sql/longtermretentionmanagedinstancebackups.go @@ -371,7 +371,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() { @@ -410,7 +410,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), @@ -477,7 +477,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() { @@ -498,7 +498,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() { @@ -537,7 +537,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), @@ -603,7 +603,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() { @@ -623,7 +623,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() { @@ -662,7 +662,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), @@ -727,7 +727,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() { @@ -751,7 +751,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() { @@ -790,7 +790,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), @@ -858,7 +858,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() { @@ -881,7 +881,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() { @@ -920,7 +920,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), @@ -987,7 +987,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() { @@ -1009,7 +1009,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() { @@ -1048,7 +1048,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), @@ -1114,7 +1114,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 49886703a379..ebbcb1d3fac2 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", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "sql.LongTermRetentionPoliciesClient", "CreateOrUpdate", result.Response(), "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 future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) @@ -109,7 +109,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), @@ -125,9 +125,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 { @@ -138,20 +138,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 } @@ -159,7 +159,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"), @@ -168,7 +168,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, } @@ -183,13 +183,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), @@ -205,33 +205,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 } @@ -239,7 +244,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), @@ -247,7 +252,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, } @@ -262,13 +267,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), @@ -277,3 +282,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..c02c4b9a43fe 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 { @@ -1514,6 +1455,9 @@ type DatabaseBlobAuditingPolicyProperties struct { // USER_CHANGE_PASSWORD_GROUP // BATCH_STARTED_GROUP // BATCH_COMPLETED_GROUP + // DBCC_GROUP + // DATABASE_OWNERSHIP_CHANGE_GROUP + // DATABASE_CHANGE_GROUP // // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. // @@ -2071,14 +2015,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 +2095,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 @@ -5394,6 +5340,9 @@ type ExtendedDatabaseBlobAuditingPolicyProperties struct { // USER_CHANGE_PASSWORD_GROUP // BATCH_STARTED_GROUP // BATCH_COMPLETED_GROUP + // DBCC_GROUP + // DATABASE_OWNERSHIP_CHANGE_GROUP + // DATABASE_CHANGE_GROUP // // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. // @@ -5773,6 +5722,9 @@ type ExtendedServerBlobAuditingPolicyProperties struct { // USER_CHANGE_PASSWORD_GROUP // BATCH_STARTED_GROUP // BATCH_COMPLETED_GROUP + // DBCC_GROUP + // DATABASE_OWNERSHIP_CHANGE_GROUP + // DATABASE_CHANGE_GROUP // // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. // @@ -10155,24 +10107,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 +10878,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 +10948,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 +10963,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 @@ -17507,7 +18006,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: 'None', 'SystemAssigned', 'UserAssigned' + // 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', 'SystemAssignedUserAssigned' Type IdentityType `json:"type,omitempty"` // TenantID - READ-ONLY; The Azure Active Directory tenant id. TenantID *uuid.UUID `json:"tenantId,omitempty"` @@ -19247,6 +19746,9 @@ type ServerBlobAuditingPolicyProperties struct { // USER_CHANGE_PASSWORD_GROUP // BATCH_STARTED_GROUP // BATCH_COMPLETED_GROUP + // DBCC_GROUP + // DATABASE_OWNERSHIP_CHANGE_GROUP + // DATABASE_CHANGE_GROUP // // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. // @@ -24535,26 +25037,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 +25588,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 d66b3e5f3f61..9fcd87b43a29 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, } @@ -166,7 +166,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, } @@ -254,7 +254,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, } @@ -336,7 +336,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..05951745de8b 100644 --- a/services/preview/sql/mgmt/v5.0/sql/CHANGELOG.md +++ b/services/preview/sql/mgmt/v5.0/sql/CHANGELOG.md @@ -1,2 +1,491 @@ -# Change History +# Unreleased +## Breaking Changes + +### Removed Constants + +1. BackupStorageRedundancy1.BackupStorageRedundancy1Geo +1. BackupStorageRedundancy1.BackupStorageRedundancy1Local +1. BackupStorageRedundancy1.BackupStorageRedundancy1Zone +1. CurrentBackupStorageRedundancy.CurrentBackupStorageRedundancyGeo +1. CurrentBackupStorageRedundancy.CurrentBackupStorageRedundancyLocal +1. CurrentBackupStorageRedundancy.CurrentBackupStorageRedundancyZone +1. RequestedBackupStorageRedundancy.RequestedBackupStorageRedundancyGeo +1. RequestedBackupStorageRedundancy.RequestedBackupStorageRedundancyLocal +1. RequestedBackupStorageRedundancy.RequestedBackupStorageRedundancyZone +1. StorageAccountType1.StorageAccountType1GRS +1. StorageAccountType1.StorageAccountType1LRS +1. StorageAccountType1.StorageAccountType1ZRS +1. TargetBackupStorageRedundancy.TargetBackupStorageRedundancyGeo +1. TargetBackupStorageRedundancy.TargetBackupStorageRedundancyLocal +1. TargetBackupStorageRedundancy.TargetBackupStorageRedundancyZone +1. TransparentDataEncryptionActivityStatus.TransparentDataEncryptionActivityStatusDecrypting +1. TransparentDataEncryptionActivityStatus.TransparentDataEncryptionActivityStatusEncrypting +1. TransparentDataEncryptionStatus.TransparentDataEncryptionStatusDisabled +1. TransparentDataEncryptionStatus.TransparentDataEncryptionStatusEnabled + +### Removed Funcs + +1. *OperationsHealth.UnmarshalJSON([]byte) error +1. *OperationsHealthListResultIterator.Next() error +1. *OperationsHealthListResultIterator.NextWithContext(context.Context) error +1. *OperationsHealthListResultPage.Next() error +1. *OperationsHealthListResultPage.NextWithContext(context.Context) error +1. *ReplicationLinksFailoverAllowDataLossFuture.UnmarshalJSON([]byte) error +1. *ReplicationLinksFailoverFuture.UnmarshalJSON([]byte) error +1. *ReplicationLinksUnlinkFuture.UnmarshalJSON([]byte) error +1. *TransparentDataEncryption.UnmarshalJSON([]byte) error +1. *TransparentDataEncryptionActivity.UnmarshalJSON([]byte) error +1. NewOperationsHealthClient(string) OperationsHealthClient +1. NewOperationsHealthClientWithBaseURI(string, string) OperationsHealthClient +1. NewOperationsHealthListResultIterator(OperationsHealthListResultPage) OperationsHealthListResultIterator +1. NewOperationsHealthListResultPage(OperationsHealthListResult, func(context.Context, OperationsHealthListResult) (OperationsHealthListResult, error)) OperationsHealthListResultPage +1. NewTransparentDataEncryptionActivitiesClient(string) TransparentDataEncryptionActivitiesClient +1. NewTransparentDataEncryptionActivitiesClientWithBaseURI(string, string) TransparentDataEncryptionActivitiesClient +1. OperationsHealth.MarshalJSON() ([]byte, error) +1. OperationsHealthClient.ListByLocation(context.Context, string) (OperationsHealthListResultPage, error) +1. OperationsHealthClient.ListByLocationComplete(context.Context, string) (OperationsHealthListResultIterator, error) +1. OperationsHealthClient.ListByLocationPreparer(context.Context, string) (*http.Request, error) +1. OperationsHealthClient.ListByLocationResponder(*http.Response) (OperationsHealthListResult, error) +1. OperationsHealthClient.ListByLocationSender(*http.Request) (*http.Response, error) +1. OperationsHealthListResult.IsEmpty() bool +1. OperationsHealthListResult.MarshalJSON() ([]byte, error) +1. OperationsHealthListResultIterator.NotDone() bool +1. OperationsHealthListResultIterator.Response() OperationsHealthListResult +1. OperationsHealthListResultIterator.Value() OperationsHealth +1. OperationsHealthListResultPage.NotDone() bool +1. OperationsHealthListResultPage.Response() OperationsHealthListResult +1. OperationsHealthListResultPage.Values() []OperationsHealth +1. OperationsHealthProperties.MarshalJSON() ([]byte, error) +1. PossibleBackupStorageRedundancy1Values() []BackupStorageRedundancy1 +1. PossibleCurrentBackupStorageRedundancyValues() []CurrentBackupStorageRedundancy +1. PossibleRequestedBackupStorageRedundancyValues() []RequestedBackupStorageRedundancy +1. PossibleStorageAccountType1Values() []StorageAccountType1 +1. PossibleTargetBackupStorageRedundancyValues() []TargetBackupStorageRedundancy +1. PossibleTransparentDataEncryptionActivityStatusValues() []TransparentDataEncryptionActivityStatus +1. PossibleTransparentDataEncryptionStatusValues() []TransparentDataEncryptionStatus +1. ReplicationLinksClient.Delete(context.Context, string, string, string, string) (autorest.Response, error) +1. ReplicationLinksClient.DeletePreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ReplicationLinksClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. ReplicationLinksClient.DeleteSender(*http.Request) (*http.Response, error) +1. ReplicationLinksClient.Failover(context.Context, string, string, string, string) (ReplicationLinksFailoverFuture, error) +1. ReplicationLinksClient.FailoverAllowDataLoss(context.Context, string, string, string, string) (ReplicationLinksFailoverAllowDataLossFuture, error) +1. ReplicationLinksClient.FailoverAllowDataLossPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ReplicationLinksClient.FailoverAllowDataLossResponder(*http.Response) (autorest.Response, error) +1. ReplicationLinksClient.FailoverAllowDataLossSender(*http.Request) (ReplicationLinksFailoverAllowDataLossFuture, error) +1. ReplicationLinksClient.FailoverPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ReplicationLinksClient.FailoverResponder(*http.Response) (autorest.Response, error) +1. ReplicationLinksClient.FailoverSender(*http.Request) (ReplicationLinksFailoverFuture, error) +1. ReplicationLinksClient.Unlink(context.Context, string, string, string, string, UnlinkParameters) (ReplicationLinksUnlinkFuture, error) +1. ReplicationLinksClient.UnlinkPreparer(context.Context, string, string, string, string, UnlinkParameters) (*http.Request, error) +1. ReplicationLinksClient.UnlinkResponder(*http.Response) (autorest.Response, error) +1. ReplicationLinksClient.UnlinkSender(*http.Request) (ReplicationLinksUnlinkFuture, error) +1. ResourceIdentityWithUserAssignedIdentities.MarshalJSON() ([]byte, error) +1. TransparentDataEncryption.MarshalJSON() ([]byte, error) +1. TransparentDataEncryptionActivitiesClient.ListByConfiguration(context.Context, string, string, string) (TransparentDataEncryptionActivityListResult, error) +1. TransparentDataEncryptionActivitiesClient.ListByConfigurationPreparer(context.Context, string, string, string) (*http.Request, error) +1. TransparentDataEncryptionActivitiesClient.ListByConfigurationResponder(*http.Response) (TransparentDataEncryptionActivityListResult, error) +1. TransparentDataEncryptionActivitiesClient.ListByConfigurationSender(*http.Request) (*http.Response, error) +1. TransparentDataEncryptionActivity.MarshalJSON() ([]byte, error) +1. TransparentDataEncryptionActivityProperties.MarshalJSON() ([]byte, error) + +### Struct Changes + +#### Removed Structs + +1. OperationsHealth +1. OperationsHealthClient +1. OperationsHealthListResult +1. OperationsHealthListResultIterator +1. OperationsHealthListResultPage +1. OperationsHealthProperties +1. ReplicationLinksFailoverAllowDataLossFuture +1. ReplicationLinksFailoverFuture +1. ReplicationLinksUnlinkFuture +1. ResourceIdentityWithUserAssignedIdentities +1. TransparentDataEncryption +1. TransparentDataEncryptionActivitiesClient +1. TransparentDataEncryptionActivity +1. TransparentDataEncryptionActivityListResult +1. TransparentDataEncryptionActivityProperties +1. UnlinkParameters + +#### Removed Struct Fields + +1. DatabaseUpdate.*DatabaseProperties +1. ManagedInstanceProperties.StorageAccountType +1. RestorableDroppedDatabaseProperties.ElasticPoolID +1. TransparentDataEncryptionProperties.Status + +### Signature Changes + +#### Funcs + +1. ElasticPoolsClient.ListByServer + - Params + - From: context.Context, string, string, *int32 + - To: context.Context, string, string, *int64 +1. ElasticPoolsClient.ListByServerComplete + - Params + - From: context.Context, string, string, *int32 + - To: context.Context, string, string, *int64 +1. ElasticPoolsClient.ListByServerPreparer + - Params + - From: context.Context, string, string, *int32 + - To: context.Context, string, string, *int64 +1. LedgerDigestUploadsClient.CreateOrUpdate + - Returns + - From: LedgerDigestUploads, error + - To: LedgerDigestUploadsCreateOrUpdateFuture, error +1. LedgerDigestUploadsClient.CreateOrUpdateSender + - Returns + - From: *http.Response, error + - To: LedgerDigestUploadsCreateOrUpdateFuture, error +1. LedgerDigestUploadsClient.Disable + - Returns + - From: LedgerDigestUploads, error + - To: LedgerDigestUploadsDisableFuture, error +1. LedgerDigestUploadsClient.DisableSender + - Returns + - From: *http.Response, error + - To: LedgerDigestUploadsDisableFuture, error +1. ServerConnectionPoliciesClient.CreateOrUpdate + - Returns + - From: ServerConnectionPolicy, error + - To: ServerConnectionPoliciesCreateOrUpdateFuture, error +1. ServerConnectionPoliciesClient.CreateOrUpdateSender + - Returns + - From: *http.Response, error + - To: ServerConnectionPoliciesCreateOrUpdateFuture, error +1. SyncGroupsClient.ListLogs + - Params + - From: context.Context, string, string, string, string, string, string, string, string + - To: context.Context, string, string, string, string, string, string, SyncGroupsType, string +1. SyncGroupsClient.ListLogsComplete + - Params + - From: context.Context, string, string, string, string, string, string, string, string + - To: context.Context, string, string, string, string, string, string, SyncGroupsType, string +1. SyncGroupsClient.ListLogsPreparer + - Params + - From: context.Context, string, string, string, string, string, string, string, string + - To: context.Context, string, string, string, string, string, string, SyncGroupsType, string +1. TransparentDataEncryptionsClient.CreateOrUpdate + - Params + - From: context.Context, string, string, string, TransparentDataEncryption + - To: context.Context, string, string, string, LogicalDatabaseTransparentDataEncryption + - Returns + - From: TransparentDataEncryption, error + - To: LogicalDatabaseTransparentDataEncryption, error +1. TransparentDataEncryptionsClient.CreateOrUpdatePreparer + - Params + - From: context.Context, string, string, string, TransparentDataEncryption + - To: context.Context, string, string, string, LogicalDatabaseTransparentDataEncryption +1. TransparentDataEncryptionsClient.CreateOrUpdateResponder + - Returns + - From: TransparentDataEncryption, error + - To: LogicalDatabaseTransparentDataEncryption, error +1. TransparentDataEncryptionsClient.Get + - Returns + - From: TransparentDataEncryption, error + - To: LogicalDatabaseTransparentDataEncryption, error +1. TransparentDataEncryptionsClient.GetResponder + - Returns + - From: TransparentDataEncryption, error + - To: LogicalDatabaseTransparentDataEncryption, error + +#### Struct Fields + +1. CopyLongTermRetentionBackupParametersProperties.TargetBackupStorageRedundancy changed type from TargetBackupStorageRedundancy to BackupStorageRedundancy +1. DatabaseProperties.CurrentBackupStorageRedundancy changed type from CurrentBackupStorageRedundancy to BackupStorageRedundancy +1. DatabaseProperties.RequestedBackupStorageRedundancy changed type from RequestedBackupStorageRedundancy to BackupStorageRedundancy +1. RestorableDroppedDatabaseProperties.BackupStorageRedundancy changed type from BackupStorageRedundancy1 to BackupStorageRedundancy +1. StorageCapability.StorageAccountType changed type from StorageAccountType1 to StorageAccountType +1. UpdateLongTermRetentionBackupParametersProperties.RequestedBackupStorageRedundancy changed type from RequestedBackupStorageRedundancy to BackupStorageRedundancy + +## Additive Changes + +### New Constants + +1. BackupStorageRedundancy.BackupStorageRedundancyGeoZone +1. DatabaseIdentityType.DatabaseIdentityTypeNone +1. DatabaseIdentityType.DatabaseIdentityTypeUserAssigned +1. DatabaseStatus.DatabaseStatusStarting +1. DatabaseStatus.DatabaseStatusStopped +1. DatabaseStatus.DatabaseStatusStopping +1. IdentityType.IdentityTypeSystemAssignedUserAssigned +1. ProvisioningState1.ProvisioningState1Accepted +1. ProvisioningState1.ProvisioningState1Canceled +1. ProvisioningState1.ProvisioningState1Created +1. ProvisioningState1.ProvisioningState1Deleted +1. ProvisioningState1.ProvisioningState1NotSpecified +1. ProvisioningState1.ProvisioningState1Registering +1. ProvisioningState1.ProvisioningState1Running +1. ProvisioningState1.ProvisioningState1TimedOut +1. ProvisioningState1.ProvisioningState1Unrecognized +1. ReplicationMode.ReplicationModeAsync +1. ReplicationMode.ReplicationModeSync +1. ServicePrincipalType.ServicePrincipalTypeNone +1. ServicePrincipalType.ServicePrincipalTypeSystemAssigned +1. SyncGroupsType.SyncGroupsTypeAll +1. SyncGroupsType.SyncGroupsTypeError +1. SyncGroupsType.SyncGroupsTypeSuccess +1. SyncGroupsType.SyncGroupsTypeWarning + +### New Funcs + +1. *DistributedAvailabilityGroup.UnmarshalJSON([]byte) error +1. *DistributedAvailabilityGroupsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *DistributedAvailabilityGroupsDeleteFuture.UnmarshalJSON([]byte) error +1. *DistributedAvailabilityGroupsListResultIterator.Next() error +1. *DistributedAvailabilityGroupsListResultIterator.NextWithContext(context.Context) error +1. *DistributedAvailabilityGroupsListResultPage.Next() error +1. *DistributedAvailabilityGroupsListResultPage.NextWithContext(context.Context) error +1. *DistributedAvailabilityGroupsUpdateFuture.UnmarshalJSON([]byte) error +1. *EndpointCertificate.UnmarshalJSON([]byte) error +1. *EndpointCertificateListResultIterator.Next() error +1. *EndpointCertificateListResultIterator.NextWithContext(context.Context) error +1. *EndpointCertificateListResultPage.Next() error +1. *EndpointCertificateListResultPage.NextWithContext(context.Context) error +1. *IPv6FirewallRule.UnmarshalJSON([]byte) error +1. *IPv6FirewallRuleListResultIterator.Next() error +1. *IPv6FirewallRuleListResultIterator.NextWithContext(context.Context) error +1. *IPv6FirewallRuleListResultPage.Next() error +1. *IPv6FirewallRuleListResultPage.NextWithContext(context.Context) error +1. *LedgerDigestUploadsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *LedgerDigestUploadsDisableFuture.UnmarshalJSON([]byte) error +1. *LogicalDatabaseTransparentDataEncryption.UnmarshalJSON([]byte) error +1. *LogicalDatabaseTransparentDataEncryptionListResultIterator.Next() error +1. *LogicalDatabaseTransparentDataEncryptionListResultIterator.NextWithContext(context.Context) error +1. *LogicalDatabaseTransparentDataEncryptionListResultPage.Next() error +1. *LogicalDatabaseTransparentDataEncryptionListResultPage.NextWithContext(context.Context) error +1. *ServerConnectionPoliciesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *ServerConnectionPolicyListResultIterator.Next() error +1. *ServerConnectionPolicyListResultIterator.NextWithContext(context.Context) error +1. *ServerConnectionPolicyListResultPage.Next() error +1. *ServerConnectionPolicyListResultPage.NextWithContext(context.Context) error +1. *ServerTrustCertificate.UnmarshalJSON([]byte) error +1. *ServerTrustCertificatesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *ServerTrustCertificatesDeleteFuture.UnmarshalJSON([]byte) error +1. *ServerTrustCertificatesListResultIterator.Next() error +1. *ServerTrustCertificatesListResultIterator.NextWithContext(context.Context) error +1. *ServerTrustCertificatesListResultPage.Next() error +1. *ServerTrustCertificatesListResultPage.NextWithContext(context.Context) error +1. DatabaseIdentity.MarshalJSON() ([]byte, error) +1. DatabaseUpdateProperties.MarshalJSON() ([]byte, error) +1. DatabaseUserIdentity.MarshalJSON() ([]byte, error) +1. DistributedAvailabilityGroup.MarshalJSON() ([]byte, error) +1. DistributedAvailabilityGroupProperties.MarshalJSON() ([]byte, error) +1. DistributedAvailabilityGroupsClient.CreateOrUpdate(context.Context, string, string, string, DistributedAvailabilityGroup) (DistributedAvailabilityGroupsCreateOrUpdateFuture, error) +1. DistributedAvailabilityGroupsClient.CreateOrUpdatePreparer(context.Context, string, string, string, DistributedAvailabilityGroup) (*http.Request, error) +1. DistributedAvailabilityGroupsClient.CreateOrUpdateResponder(*http.Response) (DistributedAvailabilityGroup, error) +1. DistributedAvailabilityGroupsClient.CreateOrUpdateSender(*http.Request) (DistributedAvailabilityGroupsCreateOrUpdateFuture, error) +1. DistributedAvailabilityGroupsClient.Delete(context.Context, string, string, string) (DistributedAvailabilityGroupsDeleteFuture, error) +1. DistributedAvailabilityGroupsClient.DeletePreparer(context.Context, string, string, string) (*http.Request, error) +1. DistributedAvailabilityGroupsClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. DistributedAvailabilityGroupsClient.DeleteSender(*http.Request) (DistributedAvailabilityGroupsDeleteFuture, error) +1. DistributedAvailabilityGroupsClient.Get(context.Context, string, string, string) (DistributedAvailabilityGroup, error) +1. DistributedAvailabilityGroupsClient.GetPreparer(context.Context, string, string, string) (*http.Request, error) +1. DistributedAvailabilityGroupsClient.GetResponder(*http.Response) (DistributedAvailabilityGroup, error) +1. DistributedAvailabilityGroupsClient.GetSender(*http.Request) (*http.Response, error) +1. DistributedAvailabilityGroupsClient.ListByInstance(context.Context, string, string) (DistributedAvailabilityGroupsListResultPage, error) +1. DistributedAvailabilityGroupsClient.ListByInstanceComplete(context.Context, string, string) (DistributedAvailabilityGroupsListResultIterator, error) +1. DistributedAvailabilityGroupsClient.ListByInstancePreparer(context.Context, string, string) (*http.Request, error) +1. DistributedAvailabilityGroupsClient.ListByInstanceResponder(*http.Response) (DistributedAvailabilityGroupsListResult, error) +1. DistributedAvailabilityGroupsClient.ListByInstanceSender(*http.Request) (*http.Response, error) +1. DistributedAvailabilityGroupsClient.Update(context.Context, string, string, string, DistributedAvailabilityGroup) (DistributedAvailabilityGroupsUpdateFuture, error) +1. DistributedAvailabilityGroupsClient.UpdatePreparer(context.Context, string, string, string, DistributedAvailabilityGroup) (*http.Request, error) +1. DistributedAvailabilityGroupsClient.UpdateResponder(*http.Response) (DistributedAvailabilityGroup, error) +1. DistributedAvailabilityGroupsClient.UpdateSender(*http.Request) (DistributedAvailabilityGroupsUpdateFuture, error) +1. DistributedAvailabilityGroupsListResult.IsEmpty() bool +1. DistributedAvailabilityGroupsListResult.MarshalJSON() ([]byte, error) +1. DistributedAvailabilityGroupsListResultIterator.NotDone() bool +1. DistributedAvailabilityGroupsListResultIterator.Response() DistributedAvailabilityGroupsListResult +1. DistributedAvailabilityGroupsListResultIterator.Value() DistributedAvailabilityGroup +1. DistributedAvailabilityGroupsListResultPage.NotDone() bool +1. DistributedAvailabilityGroupsListResultPage.Response() DistributedAvailabilityGroupsListResult +1. DistributedAvailabilityGroupsListResultPage.Values() []DistributedAvailabilityGroup +1. EndpointCertificate.MarshalJSON() ([]byte, error) +1. EndpointCertificateListResult.IsEmpty() bool +1. EndpointCertificateListResult.MarshalJSON() ([]byte, error) +1. EndpointCertificateListResultIterator.NotDone() bool +1. EndpointCertificateListResultIterator.Response() EndpointCertificateListResult +1. EndpointCertificateListResultIterator.Value() EndpointCertificate +1. EndpointCertificateListResultPage.NotDone() bool +1. EndpointCertificateListResultPage.Response() EndpointCertificateListResult +1. EndpointCertificateListResultPage.Values() []EndpointCertificate +1. EndpointCertificatesClient.Get(context.Context, string, string, string) (EndpointCertificate, error) +1. EndpointCertificatesClient.GetPreparer(context.Context, string, string, string) (*http.Request, error) +1. EndpointCertificatesClient.GetResponder(*http.Response) (EndpointCertificate, error) +1. EndpointCertificatesClient.GetSender(*http.Request) (*http.Response, error) +1. EndpointCertificatesClient.ListByInstance(context.Context, string, string) (EndpointCertificateListResultPage, error) +1. EndpointCertificatesClient.ListByInstanceComplete(context.Context, string, string) (EndpointCertificateListResultIterator, error) +1. EndpointCertificatesClient.ListByInstancePreparer(context.Context, string, string) (*http.Request, error) +1. EndpointCertificatesClient.ListByInstanceResponder(*http.Response) (EndpointCertificateListResult, error) +1. EndpointCertificatesClient.ListByInstanceSender(*http.Request) (*http.Response, error) +1. IPv6FirewallRule.MarshalJSON() ([]byte, error) +1. IPv6FirewallRuleListResult.IsEmpty() bool +1. IPv6FirewallRuleListResult.MarshalJSON() ([]byte, error) +1. IPv6FirewallRuleListResultIterator.NotDone() bool +1. IPv6FirewallRuleListResultIterator.Response() IPv6FirewallRuleListResult +1. IPv6FirewallRuleListResultIterator.Value() IPv6FirewallRule +1. IPv6FirewallRuleListResultPage.NotDone() bool +1. IPv6FirewallRuleListResultPage.Response() IPv6FirewallRuleListResult +1. IPv6FirewallRuleListResultPage.Values() []IPv6FirewallRule +1. IPv6FirewallRulesClient.CreateOrUpdate(context.Context, string, string, string, IPv6FirewallRule) (IPv6FirewallRule, error) +1. IPv6FirewallRulesClient.CreateOrUpdatePreparer(context.Context, string, string, string, IPv6FirewallRule) (*http.Request, error) +1. IPv6FirewallRulesClient.CreateOrUpdateResponder(*http.Response) (IPv6FirewallRule, error) +1. IPv6FirewallRulesClient.CreateOrUpdateSender(*http.Request) (*http.Response, error) +1. IPv6FirewallRulesClient.Delete(context.Context, string, string, string) (autorest.Response, error) +1. IPv6FirewallRulesClient.DeletePreparer(context.Context, string, string, string) (*http.Request, error) +1. IPv6FirewallRulesClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. IPv6FirewallRulesClient.DeleteSender(*http.Request) (*http.Response, error) +1. IPv6FirewallRulesClient.Get(context.Context, string, string, string) (IPv6FirewallRule, error) +1. IPv6FirewallRulesClient.GetPreparer(context.Context, string, string, string) (*http.Request, error) +1. IPv6FirewallRulesClient.GetResponder(*http.Response) (IPv6FirewallRule, error) +1. IPv6FirewallRulesClient.GetSender(*http.Request) (*http.Response, error) +1. IPv6FirewallRulesClient.ListByServer(context.Context, string, string) (IPv6FirewallRuleListResultPage, error) +1. IPv6FirewallRulesClient.ListByServerComplete(context.Context, string, string) (IPv6FirewallRuleListResultIterator, error) +1. IPv6FirewallRulesClient.ListByServerPreparer(context.Context, string, string) (*http.Request, error) +1. IPv6FirewallRulesClient.ListByServerResponder(*http.Response) (IPv6FirewallRuleListResult, error) +1. IPv6FirewallRulesClient.ListByServerSender(*http.Request) (*http.Response, error) +1. LogicalDatabaseTransparentDataEncryption.MarshalJSON() ([]byte, error) +1. LogicalDatabaseTransparentDataEncryptionListResult.IsEmpty() bool +1. LogicalDatabaseTransparentDataEncryptionListResult.MarshalJSON() ([]byte, error) +1. LogicalDatabaseTransparentDataEncryptionListResultIterator.NotDone() bool +1. LogicalDatabaseTransparentDataEncryptionListResultIterator.Response() LogicalDatabaseTransparentDataEncryptionListResult +1. LogicalDatabaseTransparentDataEncryptionListResultIterator.Value() LogicalDatabaseTransparentDataEncryption +1. LogicalDatabaseTransparentDataEncryptionListResultPage.NotDone() bool +1. LogicalDatabaseTransparentDataEncryptionListResultPage.Response() LogicalDatabaseTransparentDataEncryptionListResult +1. LogicalDatabaseTransparentDataEncryptionListResultPage.Values() []LogicalDatabaseTransparentDataEncryption +1. NewDistributedAvailabilityGroupsClient(string) DistributedAvailabilityGroupsClient +1. NewDistributedAvailabilityGroupsClientWithBaseURI(string, string) DistributedAvailabilityGroupsClient +1. NewDistributedAvailabilityGroupsListResultIterator(DistributedAvailabilityGroupsListResultPage) DistributedAvailabilityGroupsListResultIterator +1. NewDistributedAvailabilityGroupsListResultPage(DistributedAvailabilityGroupsListResult, func(context.Context, DistributedAvailabilityGroupsListResult) (DistributedAvailabilityGroupsListResult, error)) DistributedAvailabilityGroupsListResultPage +1. NewEndpointCertificateListResultIterator(EndpointCertificateListResultPage) EndpointCertificateListResultIterator +1. NewEndpointCertificateListResultPage(EndpointCertificateListResult, func(context.Context, EndpointCertificateListResult) (EndpointCertificateListResult, error)) EndpointCertificateListResultPage +1. NewEndpointCertificatesClient(string) EndpointCertificatesClient +1. NewEndpointCertificatesClientWithBaseURI(string, string) EndpointCertificatesClient +1. NewIPv6FirewallRuleListResultIterator(IPv6FirewallRuleListResultPage) IPv6FirewallRuleListResultIterator +1. NewIPv6FirewallRuleListResultPage(IPv6FirewallRuleListResult, func(context.Context, IPv6FirewallRuleListResult) (IPv6FirewallRuleListResult, error)) IPv6FirewallRuleListResultPage +1. NewIPv6FirewallRulesClient(string) IPv6FirewallRulesClient +1. NewIPv6FirewallRulesClientWithBaseURI(string, string) IPv6FirewallRulesClient +1. NewLogicalDatabaseTransparentDataEncryptionListResultIterator(LogicalDatabaseTransparentDataEncryptionListResultPage) LogicalDatabaseTransparentDataEncryptionListResultIterator +1. NewLogicalDatabaseTransparentDataEncryptionListResultPage(LogicalDatabaseTransparentDataEncryptionListResult, func(context.Context, LogicalDatabaseTransparentDataEncryptionListResult) (LogicalDatabaseTransparentDataEncryptionListResult, error)) LogicalDatabaseTransparentDataEncryptionListResultPage +1. NewServerConnectionPolicyListResultIterator(ServerConnectionPolicyListResultPage) ServerConnectionPolicyListResultIterator +1. NewServerConnectionPolicyListResultPage(ServerConnectionPolicyListResult, func(context.Context, ServerConnectionPolicyListResult) (ServerConnectionPolicyListResult, error)) ServerConnectionPolicyListResultPage +1. NewServerTrustCertificatesClient(string) ServerTrustCertificatesClient +1. NewServerTrustCertificatesClientWithBaseURI(string, string) ServerTrustCertificatesClient +1. NewServerTrustCertificatesListResultIterator(ServerTrustCertificatesListResultPage) ServerTrustCertificatesListResultIterator +1. NewServerTrustCertificatesListResultPage(ServerTrustCertificatesListResult, func(context.Context, ServerTrustCertificatesListResult) (ServerTrustCertificatesListResult, error)) ServerTrustCertificatesListResultPage +1. PossibleDatabaseIdentityTypeValues() []DatabaseIdentityType +1. PossibleReplicationModeValues() []ReplicationMode +1. PossibleServicePrincipalTypeValues() []ServicePrincipalType +1. PossibleSyncGroupsTypeValues() []SyncGroupsType +1. ServerConnectionPoliciesClient.ListByServer(context.Context, string, string) (ServerConnectionPolicyListResultPage, error) +1. ServerConnectionPoliciesClient.ListByServerComplete(context.Context, string, string) (ServerConnectionPolicyListResultIterator, error) +1. ServerConnectionPoliciesClient.ListByServerPreparer(context.Context, string, string) (*http.Request, error) +1. ServerConnectionPoliciesClient.ListByServerResponder(*http.Response) (ServerConnectionPolicyListResult, error) +1. ServerConnectionPoliciesClient.ListByServerSender(*http.Request) (*http.Response, error) +1. ServerConnectionPolicyListResult.IsEmpty() bool +1. ServerConnectionPolicyListResult.MarshalJSON() ([]byte, error) +1. ServerConnectionPolicyListResultIterator.NotDone() bool +1. ServerConnectionPolicyListResultIterator.Response() ServerConnectionPolicyListResult +1. ServerConnectionPolicyListResultIterator.Value() ServerConnectionPolicy +1. ServerConnectionPolicyListResultPage.NotDone() bool +1. ServerConnectionPolicyListResultPage.Response() ServerConnectionPolicyListResult +1. ServerConnectionPolicyListResultPage.Values() []ServerConnectionPolicy +1. ServerTrustCertificate.MarshalJSON() ([]byte, error) +1. ServerTrustCertificateProperties.MarshalJSON() ([]byte, error) +1. ServerTrustCertificatesClient.CreateOrUpdate(context.Context, string, string, string, ServerTrustCertificate) (ServerTrustCertificatesCreateOrUpdateFuture, error) +1. ServerTrustCertificatesClient.CreateOrUpdatePreparer(context.Context, string, string, string, ServerTrustCertificate) (*http.Request, error) +1. ServerTrustCertificatesClient.CreateOrUpdateResponder(*http.Response) (ServerTrustCertificate, error) +1. ServerTrustCertificatesClient.CreateOrUpdateSender(*http.Request) (ServerTrustCertificatesCreateOrUpdateFuture, error) +1. ServerTrustCertificatesClient.Delete(context.Context, string, string, string) (ServerTrustCertificatesDeleteFuture, error) +1. ServerTrustCertificatesClient.DeletePreparer(context.Context, string, string, string) (*http.Request, error) +1. ServerTrustCertificatesClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. ServerTrustCertificatesClient.DeleteSender(*http.Request) (ServerTrustCertificatesDeleteFuture, error) +1. ServerTrustCertificatesClient.Get(context.Context, string, string, string) (ServerTrustCertificate, error) +1. ServerTrustCertificatesClient.GetPreparer(context.Context, string, string, string) (*http.Request, error) +1. ServerTrustCertificatesClient.GetResponder(*http.Response) (ServerTrustCertificate, error) +1. ServerTrustCertificatesClient.GetSender(*http.Request) (*http.Response, error) +1. ServerTrustCertificatesClient.ListByInstance(context.Context, string, string) (ServerTrustCertificatesListResultPage, error) +1. ServerTrustCertificatesClient.ListByInstanceComplete(context.Context, string, string) (ServerTrustCertificatesListResultIterator, error) +1. ServerTrustCertificatesClient.ListByInstancePreparer(context.Context, string, string) (*http.Request, error) +1. ServerTrustCertificatesClient.ListByInstanceResponder(*http.Response) (ServerTrustCertificatesListResult, error) +1. ServerTrustCertificatesClient.ListByInstanceSender(*http.Request) (*http.Response, error) +1. ServerTrustCertificatesListResult.IsEmpty() bool +1. ServerTrustCertificatesListResult.MarshalJSON() ([]byte, error) +1. ServerTrustCertificatesListResultIterator.NotDone() bool +1. ServerTrustCertificatesListResultIterator.Response() ServerTrustCertificatesListResult +1. ServerTrustCertificatesListResultIterator.Value() ServerTrustCertificate +1. ServerTrustCertificatesListResultPage.NotDone() bool +1. ServerTrustCertificatesListResultPage.Response() ServerTrustCertificatesListResult +1. ServerTrustCertificatesListResultPage.Values() []ServerTrustCertificate +1. ServicePrincipal.MarshalJSON() ([]byte, error) +1. TransparentDataEncryptionsClient.ListByDatabase(context.Context, string, string, string) (LogicalDatabaseTransparentDataEncryptionListResultPage, error) +1. TransparentDataEncryptionsClient.ListByDatabaseComplete(context.Context, string, string, string) (LogicalDatabaseTransparentDataEncryptionListResultIterator, error) +1. TransparentDataEncryptionsClient.ListByDatabasePreparer(context.Context, string, string, string) (*http.Request, error) +1. TransparentDataEncryptionsClient.ListByDatabaseResponder(*http.Response) (LogicalDatabaseTransparentDataEncryptionListResult, error) +1. TransparentDataEncryptionsClient.ListByDatabaseSender(*http.Request) (*http.Response, error) + +### Struct Changes + +#### New Structs + +1. DatabaseIdentity +1. DatabaseUpdateProperties +1. DatabaseUserIdentity +1. DistributedAvailabilityGroup +1. DistributedAvailabilityGroupProperties +1. DistributedAvailabilityGroupsClient +1. DistributedAvailabilityGroupsCreateOrUpdateFuture +1. DistributedAvailabilityGroupsDeleteFuture +1. DistributedAvailabilityGroupsListResult +1. DistributedAvailabilityGroupsListResultIterator +1. DistributedAvailabilityGroupsListResultPage +1. DistributedAvailabilityGroupsUpdateFuture +1. EndpointCertificate +1. EndpointCertificateListResult +1. EndpointCertificateListResultIterator +1. EndpointCertificateListResultPage +1. EndpointCertificateProperties +1. EndpointCertificatesClient +1. IPv6FirewallRule +1. IPv6FirewallRuleListResult +1. IPv6FirewallRuleListResultIterator +1. IPv6FirewallRuleListResultPage +1. IPv6FirewallRulesClient +1. IPv6ServerFirewallRuleProperties +1. LedgerDigestUploadsCreateOrUpdateFuture +1. LedgerDigestUploadsDisableFuture +1. LogicalDatabaseTransparentDataEncryption +1. LogicalDatabaseTransparentDataEncryptionListResult +1. LogicalDatabaseTransparentDataEncryptionListResultIterator +1. LogicalDatabaseTransparentDataEncryptionListResultPage +1. ServerConnectionPoliciesCreateOrUpdateFuture +1. ServerConnectionPolicyListResult +1. ServerConnectionPolicyListResultIterator +1. ServerConnectionPolicyListResultPage +1. ServerTrustCertificate +1. ServerTrustCertificateProperties +1. ServerTrustCertificatesClient +1. ServerTrustCertificatesCreateOrUpdateFuture +1. ServerTrustCertificatesDeleteFuture +1. ServerTrustCertificatesListResult +1. ServerTrustCertificatesListResultIterator +1. ServerTrustCertificatesListResultPage +1. ServicePrincipal + +#### New Struct Fields + +1. Database.Identity +1. DatabaseProperties.FederatedClientID +1. DatabaseProperties.SourceResourceID +1. DatabaseUpdate.*DatabaseUpdateProperties +1. DatabaseUpdate.Identity +1. ElasticPoolProperties.HighAvailabilityReplicaCount +1. ElasticPoolUpdateProperties.HighAvailabilityReplicaCount +1. ManagedInstanceProperties.CurrentBackupStorageRedundancy +1. ManagedInstanceProperties.RequestedBackupStorageRedundancy +1. ManagedInstanceProperties.ServicePrincipal +1. TransparentDataEncryptionProperties.State diff --git a/services/preview/sql/mgmt/v5.0/sql/_meta.json b/services/preview/sql/mgmt/v5.0/sql/_meta.json index fe8ee2dae0a5..3ff0efd1a9a9 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": "0dc36a61d0262fdce1de05e28de0cd55d74e18a9", "readme": "/_/azure-rest-api-specs/specification/sql/resource-manager/readme.md", "tag": "package-composite-v5", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/sql/mgmt/v5.0/sql/databases.go b/services/preview/sql/mgmt/v5.0/sql/databases.go index 148a7b9a3c1f..3393ead14dcb 100644 --- a/services/preview/sql/mgmt/v5.0/sql/databases.go +++ b/services/preview/sql/mgmt/v5.0/sql/databases.go @@ -86,7 +86,7 @@ func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -172,7 +172,7 @@ func (client DatabasesClient) DeletePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -263,7 +263,7 @@ func (client DatabasesClient) ExportPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -348,7 +348,7 @@ func (client DatabasesClient) FailoverPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -439,7 +439,7 @@ func (client DatabasesClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -521,7 +521,7 @@ func (client DatabasesClient) ImportPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -617,7 +617,7 @@ func (client DatabasesClient) ListByElasticPoolPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -736,7 +736,7 @@ func (client DatabasesClient) ListByServerPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -858,7 +858,7 @@ func (client DatabasesClient) ListInaccessibleByServerPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1127,7 +1127,7 @@ func (client DatabasesClient) PausePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1223,7 +1223,7 @@ func (client DatabasesClient) RenamePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1296,7 +1296,7 @@ func (client DatabasesClient) ResumePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1379,7 +1379,7 @@ func (client DatabasesClient) UpdatePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1463,7 +1463,7 @@ func (client DatabasesClient) UpgradeDataWarehousePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/sql/mgmt/v5.0/sql/databasesecurityalertpolicies.go b/services/preview/sql/mgmt/v5.0/sql/databasesecurityalertpolicies.go index deace584057c..7637a7d50a2c 100644 --- a/services/preview/sql/mgmt/v5.0/sql/databasesecurityalertpolicies.go +++ b/services/preview/sql/mgmt/v5.0/sql/databasesecurityalertpolicies.go @@ -78,7 +78,7 @@ func (client DatabaseSecurityAlertPoliciesClient) CreateOrUpdatePreparer(ctx con pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityAlertPolicyName": autorest.Encode("path", "default"), + "securityAlertPolicyName": autorest.Encode("path", "Default"), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -161,7 +161,7 @@ func (client DatabaseSecurityAlertPoliciesClient) GetPreparer(ctx context.Contex pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityAlertPolicyName": autorest.Encode("path", "default"), + "securityAlertPolicyName": autorest.Encode("path", "Default"), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } diff --git a/services/preview/sql/mgmt/v5.0/sql/distributedavailabilitygroups.go b/services/preview/sql/mgmt/v5.0/sql/distributedavailabilitygroups.go new file mode 100644 index 000000000000..78c05140f4e4 --- /dev/null +++ b/services/preview/sql/mgmt/v5.0/sql/distributedavailabilitygroups.go @@ -0,0 +1,483 @@ +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/tracing" + "net/http" +) + +// DistributedAvailabilityGroupsClient 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 DistributedAvailabilityGroupsClient struct { + BaseClient +} + +// NewDistributedAvailabilityGroupsClient creates an instance of the DistributedAvailabilityGroupsClient client. +func NewDistributedAvailabilityGroupsClient(subscriptionID string) DistributedAvailabilityGroupsClient { + return NewDistributedAvailabilityGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDistributedAvailabilityGroupsClientWithBaseURI creates an instance of the DistributedAvailabilityGroupsClient +// 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 NewDistributedAvailabilityGroupsClientWithBaseURI(baseURI string, subscriptionID string) DistributedAvailabilityGroupsClient { + return DistributedAvailabilityGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a distributed availability group between Sql On-Prem and Sql 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. +// distributedAvailabilityGroupName - the distributed availability group name. +// parameters - the distributed availability group info. +func (client DistributedAvailabilityGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroup) (result DistributedAvailabilityGroupsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DistributedAvailabilityGroupsClient.CreateOrUpdate") + 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.CreateOrUpdatePreparer(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DistributedAvailabilityGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DistributedAvailabilityGroupsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DistributedAvailabilityGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroup) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "distributedAvailabilityGroupName": autorest.Encode("path", distributedAvailabilityGroupName), + "managedInstanceName": autorest.Encode("path", managedInstanceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DistributedAvailabilityGroupsClient) CreateOrUpdateSender(req *http.Request) (future DistributedAvailabilityGroupsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + 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 +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DistributedAvailabilityGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result DistributedAvailabilityGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete drops a distributed availability group between Sql On-Prem and Sql 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. +// distributedAvailabilityGroupName - the distributed availability group name. +func (client DistributedAvailabilityGroupsClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string) (result DistributedAvailabilityGroupsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DistributedAvailabilityGroupsClient.Delete") + 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.DeletePreparer(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DistributedAvailabilityGroupsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DistributedAvailabilityGroupsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DistributedAvailabilityGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "distributedAvailabilityGroupName": autorest.Encode("path", distributedAvailabilityGroupName), + "managedInstanceName": autorest.Encode("path", managedInstanceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DistributedAvailabilityGroupsClient) DeleteSender(req *http.Request) (future DistributedAvailabilityGroupsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + 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 +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DistributedAvailabilityGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a distributed availability group info. +// 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. +// distributedAvailabilityGroupName - the distributed availability group name. +func (client DistributedAvailabilityGroupsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string) (result DistributedAvailabilityGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DistributedAvailabilityGroupsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DistributedAvailabilityGroupsClient", "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.DistributedAvailabilityGroupsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DistributedAvailabilityGroupsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DistributedAvailabilityGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "distributedAvailabilityGroupName": autorest.Encode("path", distributedAvailabilityGroupName), + "managedInstanceName": autorest.Encode("path", managedInstanceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}", 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 DistributedAvailabilityGroupsClient) 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 DistributedAvailabilityGroupsClient) GetResponder(resp *http.Response) (result DistributedAvailabilityGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByInstance gets a list of a distributed availability groups in 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. +func (client DistributedAvailabilityGroupsClient) ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result DistributedAvailabilityGroupsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DistributedAvailabilityGroupsClient.ListByInstance") + defer func() { + sc := -1 + if result.daglr.Response.Response != nil { + sc = result.daglr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByInstanceNextResults + req, err := client.ListByInstancePreparer(ctx, resourceGroupName, managedInstanceName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DistributedAvailabilityGroupsClient", "ListByInstance", nil, "Failure preparing request") + return + } + + resp, err := client.ListByInstanceSender(req) + if err != nil { + result.daglr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.DistributedAvailabilityGroupsClient", "ListByInstance", resp, "Failure sending request") + return + } + + result.daglr, err = client.ListByInstanceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DistributedAvailabilityGroupsClient", "ListByInstance", resp, "Failure responding to request") + return + } + if result.daglr.hasNextLink() && result.daglr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByInstancePreparer prepares the ListByInstance request. +func (client DistributedAvailabilityGroupsClient) ListByInstancePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string) (*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 = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByInstanceSender sends the ListByInstance request. The method will close the +// http.Response Body if it receives an error. +func (client DistributedAvailabilityGroupsClient) ListByInstanceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByInstanceResponder handles the response to the ListByInstance request. The method always +// closes the http.Response Body. +func (client DistributedAvailabilityGroupsClient) ListByInstanceResponder(resp *http.Response) (result DistributedAvailabilityGroupsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByInstanceNextResults retrieves the next set of results, if any. +func (client DistributedAvailabilityGroupsClient) listByInstanceNextResults(ctx context.Context, lastResults DistributedAvailabilityGroupsListResult) (result DistributedAvailabilityGroupsListResult, err error) { + req, err := lastResults.distributedAvailabilityGroupsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "sql.DistributedAvailabilityGroupsClient", "listByInstanceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByInstanceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "sql.DistributedAvailabilityGroupsClient", "listByInstanceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByInstanceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DistributedAvailabilityGroupsClient", "listByInstanceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByInstanceComplete enumerates all values, automatically crossing page boundaries as required. +func (client DistributedAvailabilityGroupsClient) ListByInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result DistributedAvailabilityGroupsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DistributedAvailabilityGroupsClient.ListByInstance") + 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.ListByInstance(ctx, resourceGroupName, managedInstanceName) + return +} + +// Update updates a distributed availability group replication mode. +// 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. +// distributedAvailabilityGroupName - the distributed availability group name. +// parameters - the distributed availability group info. +func (client DistributedAvailabilityGroupsClient) Update(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroup) (result DistributedAvailabilityGroupsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DistributedAvailabilityGroupsClient.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, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DistributedAvailabilityGroupsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DistributedAvailabilityGroupsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DistributedAvailabilityGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroup) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "distributedAvailabilityGroupName": autorest.Encode("path", distributedAvailabilityGroupName), + "managedInstanceName": autorest.Encode("path", managedInstanceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}", 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 DistributedAvailabilityGroupsClient) UpdateSender(req *http.Request) (future DistributedAvailabilityGroupsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + 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 DistributedAvailabilityGroupsClient) UpdateResponder(resp *http.Response) (result DistributedAvailabilityGroup, 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/v5.0/sql/elasticpools.go b/services/preview/sql/mgmt/v5.0/sql/elasticpools.go index f69d6d42e21f..7ca8f52c2bb9 100644 --- a/services/preview/sql/mgmt/v5.0/sql/elasticpools.go +++ b/services/preview/sql/mgmt/v5.0/sql/elasticpools.go @@ -82,7 +82,7 @@ func (client ElasticPoolsClient) CreateOrUpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-08-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -167,7 +167,7 @@ func (client ElasticPoolsClient) DeletePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-08-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -248,7 +248,7 @@ func (client ElasticPoolsClient) FailoverPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-08-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -336,7 +336,7 @@ func (client ElasticPoolsClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-08-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -373,7 +373,7 @@ func (client ElasticPoolsClient) GetResponder(resp *http.Response) (result Elast // from the Azure Resource Manager API or the portal. // serverName - the name of the server. // skip - the number of elements in the collection to skip. -func (client ElasticPoolsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string, skip *int32) (result ElasticPoolListResultPage, err error) { +func (client ElasticPoolsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string, skip *int64) (result ElasticPoolListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolsClient.ListByServer") defer func() { @@ -412,14 +412,14 @@ func (client ElasticPoolsClient) ListByServer(ctx context.Context, resourceGroup } // ListByServerPreparer prepares the ListByServer request. -func (client ElasticPoolsClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string, skip *int32) (*http.Request, error) { +func (client ElasticPoolsClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string, skip *int64) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-08-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -475,7 +475,7 @@ func (client ElasticPoolsClient) listByServerNextResults(ctx context.Context, la } // ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client ElasticPoolsClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string, skip *int32) (result ElasticPoolListResultIterator, err error) { +func (client ElasticPoolsClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string, skip *int64) (result ElasticPoolListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolsClient.ListByServer") defer func() { @@ -692,7 +692,7 @@ func (client ElasticPoolsClient) UpdatePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-08-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/sql/mgmt/v5.0/sql/endpointcertificates.go b/services/preview/sql/mgmt/v5.0/sql/endpointcertificates.go new file mode 100644 index 000000000000..8ca9f8c7b43a --- /dev/null +++ b/services/preview/sql/mgmt/v5.0/sql/endpointcertificates.go @@ -0,0 +1,232 @@ +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/tracing" + "net/http" +) + +// EndpointCertificatesClient 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 EndpointCertificatesClient struct { + BaseClient +} + +// NewEndpointCertificatesClient creates an instance of the EndpointCertificatesClient client. +func NewEndpointCertificatesClient(subscriptionID string) EndpointCertificatesClient { + return NewEndpointCertificatesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewEndpointCertificatesClientWithBaseURI creates an instance of the EndpointCertificatesClient 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 NewEndpointCertificatesClientWithBaseURI(baseURI string, subscriptionID string) EndpointCertificatesClient { + return EndpointCertificatesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a certificate used on the endpoint with the given id. +// 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. +// endpointType - type of the endpoint whose certificate the customer is looking for. +func (client EndpointCertificatesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, endpointType string) (result EndpointCertificate, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointCertificatesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, managedInstanceName, endpointType) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.EndpointCertificatesClient", "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.EndpointCertificatesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.EndpointCertificatesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client EndpointCertificatesClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, endpointType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointType": autorest.Encode("path", endpointType), + "managedInstanceName": autorest.Encode("path", managedInstanceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates/{endpointType}", 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 EndpointCertificatesClient) 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 EndpointCertificatesClient) GetResponder(resp *http.Response) (result EndpointCertificate, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByInstance list certificates used on endpoints on the target 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. +func (client EndpointCertificatesClient) ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result EndpointCertificateListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointCertificatesClient.ListByInstance") + defer func() { + sc := -1 + if result.eclr.Response.Response != nil { + sc = result.eclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByInstanceNextResults + req, err := client.ListByInstancePreparer(ctx, resourceGroupName, managedInstanceName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.EndpointCertificatesClient", "ListByInstance", nil, "Failure preparing request") + return + } + + resp, err := client.ListByInstanceSender(req) + if err != nil { + result.eclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.EndpointCertificatesClient", "ListByInstance", resp, "Failure sending request") + return + } + + result.eclr, err = client.ListByInstanceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.EndpointCertificatesClient", "ListByInstance", resp, "Failure responding to request") + return + } + if result.eclr.hasNextLink() && result.eclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByInstancePreparer prepares the ListByInstance request. +func (client EndpointCertificatesClient) ListByInstancePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string) (*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 = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByInstanceSender sends the ListByInstance request. The method will close the +// http.Response Body if it receives an error. +func (client EndpointCertificatesClient) ListByInstanceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByInstanceResponder handles the response to the ListByInstance request. The method always +// closes the http.Response Body. +func (client EndpointCertificatesClient) ListByInstanceResponder(resp *http.Response) (result EndpointCertificateListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByInstanceNextResults retrieves the next set of results, if any. +func (client EndpointCertificatesClient) listByInstanceNextResults(ctx context.Context, lastResults EndpointCertificateListResult) (result EndpointCertificateListResult, err error) { + req, err := lastResults.endpointCertificateListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "sql.EndpointCertificatesClient", "listByInstanceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByInstanceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "sql.EndpointCertificatesClient", "listByInstanceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByInstanceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.EndpointCertificatesClient", "listByInstanceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByInstanceComplete enumerates all values, automatically crossing page boundaries as required. +func (client EndpointCertificatesClient) ListByInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result EndpointCertificateListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointCertificatesClient.ListByInstance") + 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.ListByInstance(ctx, resourceGroupName, managedInstanceName) + return +} diff --git a/services/preview/sql/mgmt/v5.0/sql/enums.go b/services/preview/sql/mgmt/v5.0/sql/enums.go index d9231c128e95..9c5c86e2fdb3 100644 --- a/services/preview/sql/mgmt/v5.0/sql/enums.go +++ b/services/preview/sql/mgmt/v5.0/sql/enums.go @@ -213,6 +213,8 @@ type BackupStorageRedundancy string const ( // BackupStorageRedundancyGeo ... BackupStorageRedundancyGeo BackupStorageRedundancy = "Geo" + // BackupStorageRedundancyGeoZone ... + BackupStorageRedundancyGeoZone BackupStorageRedundancy = "GeoZone" // BackupStorageRedundancyLocal ... BackupStorageRedundancyLocal BackupStorageRedundancy = "Local" // BackupStorageRedundancyZone ... @@ -221,24 +223,7 @@ const ( // PossibleBackupStorageRedundancyValues returns an array of possible values for the BackupStorageRedundancy const type. func PossibleBackupStorageRedundancyValues() []BackupStorageRedundancy { - return []BackupStorageRedundancy{BackupStorageRedundancyGeo, BackupStorageRedundancyLocal, BackupStorageRedundancyZone} -} - -// BackupStorageRedundancy1 enumerates the values for backup storage redundancy 1. -type BackupStorageRedundancy1 string - -const ( - // BackupStorageRedundancy1Geo ... - BackupStorageRedundancy1Geo BackupStorageRedundancy1 = "Geo" - // BackupStorageRedundancy1Local ... - BackupStorageRedundancy1Local BackupStorageRedundancy1 = "Local" - // BackupStorageRedundancy1Zone ... - BackupStorageRedundancy1Zone BackupStorageRedundancy1 = "Zone" -) - -// PossibleBackupStorageRedundancy1Values returns an array of possible values for the BackupStorageRedundancy1 const type. -func PossibleBackupStorageRedundancy1Values() []BackupStorageRedundancy1 { - return []BackupStorageRedundancy1{BackupStorageRedundancy1Geo, BackupStorageRedundancy1Local, BackupStorageRedundancy1Zone} + return []BackupStorageRedundancy{BackupStorageRedundancyGeo, BackupStorageRedundancyGeoZone, BackupStorageRedundancyLocal, BackupStorageRedundancyZone} } // BlobAuditingPolicyState enumerates the values for blob auditing policy state. @@ -455,21 +440,19 @@ 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 +// DatabaseIdentityType enumerates the values for database identity type. +type DatabaseIdentityType string const ( - // CurrentBackupStorageRedundancyGeo ... - CurrentBackupStorageRedundancyGeo CurrentBackupStorageRedundancy = "Geo" - // CurrentBackupStorageRedundancyLocal ... - CurrentBackupStorageRedundancyLocal CurrentBackupStorageRedundancy = "Local" - // CurrentBackupStorageRedundancyZone ... - CurrentBackupStorageRedundancyZone CurrentBackupStorageRedundancy = "Zone" + // DatabaseIdentityTypeNone ... + DatabaseIdentityTypeNone DatabaseIdentityType = "None" + // DatabaseIdentityTypeUserAssigned ... + DatabaseIdentityTypeUserAssigned DatabaseIdentityType = "UserAssigned" ) -// PossibleCurrentBackupStorageRedundancyValues returns an array of possible values for the CurrentBackupStorageRedundancy const type. -func PossibleCurrentBackupStorageRedundancyValues() []CurrentBackupStorageRedundancy { - return []CurrentBackupStorageRedundancy{CurrentBackupStorageRedundancyGeo, CurrentBackupStorageRedundancyLocal, CurrentBackupStorageRedundancyZone} +// PossibleDatabaseIdentityTypeValues returns an array of possible values for the DatabaseIdentityType const type. +func PossibleDatabaseIdentityTypeValues() []DatabaseIdentityType { + return []DatabaseIdentityType{DatabaseIdentityTypeNone, DatabaseIdentityTypeUserAssigned} } // DatabaseLicenseType enumerates the values for database license type. @@ -563,13 +546,19 @@ const ( DatabaseStatusShutdown DatabaseStatus = "Shutdown" // DatabaseStatusStandby ... DatabaseStatusStandby DatabaseStatus = "Standby" + // DatabaseStatusStarting ... + DatabaseStatusStarting DatabaseStatus = "Starting" + // DatabaseStatusStopped ... + DatabaseStatusStopped DatabaseStatus = "Stopped" + // DatabaseStatusStopping ... + DatabaseStatusStopping DatabaseStatus = "Stopping" // DatabaseStatusSuspect ... DatabaseStatusSuspect DatabaseStatus = "Suspect" ) // PossibleDatabaseStatusValues returns an array of possible values for the DatabaseStatus const type. func PossibleDatabaseStatusValues() []DatabaseStatus { - return []DatabaseStatus{DatabaseStatusAutoClosed, DatabaseStatusCopying, DatabaseStatusCreating, DatabaseStatusDisabled, DatabaseStatusEmergencyMode, DatabaseStatusInaccessible, DatabaseStatusOffline, DatabaseStatusOfflineChangingDwPerformanceTiers, DatabaseStatusOfflineSecondary, DatabaseStatusOnline, DatabaseStatusOnlineChangingDwPerformanceTiers, DatabaseStatusPaused, DatabaseStatusPausing, DatabaseStatusRecovering, DatabaseStatusRecoveryPending, DatabaseStatusRestoring, DatabaseStatusResuming, DatabaseStatusScaling, DatabaseStatusShutdown, DatabaseStatusStandby, DatabaseStatusSuspect} + return []DatabaseStatus{DatabaseStatusAutoClosed, DatabaseStatusCopying, DatabaseStatusCreating, DatabaseStatusDisabled, DatabaseStatusEmergencyMode, DatabaseStatusInaccessible, DatabaseStatusOffline, DatabaseStatusOfflineChangingDwPerformanceTiers, DatabaseStatusOfflineSecondary, DatabaseStatusOnline, DatabaseStatusOnlineChangingDwPerformanceTiers, DatabaseStatusPaused, DatabaseStatusPausing, DatabaseStatusRecovering, DatabaseStatusRecoveryPending, DatabaseStatusRestoring, DatabaseStatusResuming, DatabaseStatusScaling, DatabaseStatusShutdown, DatabaseStatusStandby, DatabaseStatusStarting, DatabaseStatusStopped, DatabaseStatusStopping, DatabaseStatusSuspect} } // DataMaskingFunction enumerates the values for data masking function. @@ -720,13 +709,15 @@ const ( IdentityTypeNone IdentityType = "None" // IdentityTypeSystemAssigned ... IdentityTypeSystemAssigned IdentityType = "SystemAssigned" + // IdentityTypeSystemAssignedUserAssigned ... + IdentityTypeSystemAssignedUserAssigned IdentityType = "SystemAssigned,UserAssigned" // IdentityTypeUserAssigned ... IdentityTypeUserAssigned IdentityType = "UserAssigned" ) // PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. func PossibleIdentityTypeValues() []IdentityType { - return []IdentityType{IdentityTypeNone, IdentityTypeSystemAssigned, IdentityTypeUserAssigned} + return []IdentityType{IdentityTypeNone, IdentityTypeSystemAssigned, IdentityTypeSystemAssignedUserAssigned, IdentityTypeUserAssigned} } // ImplementationMethod enumerates the values for implementation method. @@ -1286,23 +1277,41 @@ func PossibleProvisioningStateValues() []ProvisioningState { type ProvisioningState1 string const ( + // ProvisioningState1Accepted ... + ProvisioningState1Accepted ProvisioningState1 = "Accepted" + // ProvisioningState1Canceled ... + ProvisioningState1Canceled ProvisioningState1 = "Canceled" + // ProvisioningState1Created ... + ProvisioningState1Created ProvisioningState1 = "Created" // ProvisioningState1Creating ... ProvisioningState1Creating ProvisioningState1 = "Creating" + // ProvisioningState1Deleted ... + ProvisioningState1Deleted ProvisioningState1 = "Deleted" // ProvisioningState1Deleting ... ProvisioningState1Deleting ProvisioningState1 = "Deleting" // ProvisioningState1Failed ... ProvisioningState1Failed ProvisioningState1 = "Failed" + // ProvisioningState1NotSpecified ... + ProvisioningState1NotSpecified ProvisioningState1 = "NotSpecified" + // ProvisioningState1Registering ... + ProvisioningState1Registering ProvisioningState1 = "Registering" + // ProvisioningState1Running ... + ProvisioningState1Running ProvisioningState1 = "Running" // ProvisioningState1Succeeded ... ProvisioningState1Succeeded ProvisioningState1 = "Succeeded" + // ProvisioningState1TimedOut ... + ProvisioningState1TimedOut ProvisioningState1 = "TimedOut" // ProvisioningState1Unknown ... ProvisioningState1Unknown ProvisioningState1 = "Unknown" + // ProvisioningState1Unrecognized ... + ProvisioningState1Unrecognized ProvisioningState1 = "Unrecognized" // ProvisioningState1Updating ... ProvisioningState1Updating ProvisioningState1 = "Updating" ) // PossibleProvisioningState1Values returns an array of possible values for the ProvisioningState1 const type. func PossibleProvisioningState1Values() []ProvisioningState1 { - return []ProvisioningState1{ProvisioningState1Creating, ProvisioningState1Deleting, ProvisioningState1Failed, ProvisioningState1Succeeded, ProvisioningState1Unknown, ProvisioningState1Updating} + return []ProvisioningState1{ProvisioningState1Accepted, ProvisioningState1Canceled, ProvisioningState1Created, ProvisioningState1Creating, ProvisioningState1Deleted, ProvisioningState1Deleting, ProvisioningState1Failed, ProvisioningState1NotSpecified, ProvisioningState1Registering, ProvisioningState1Running, ProvisioningState1Succeeded, ProvisioningState1TimedOut, ProvisioningState1Unknown, ProvisioningState1Unrecognized, ProvisioningState1Updating} } // QueryMetricUnitType enumerates the values for query metric unit type. @@ -1453,6 +1462,21 @@ func PossibleReplicationLinkTypeValues() []ReplicationLinkType { return []ReplicationLinkType{ReplicationLinkTypeGEO, ReplicationLinkTypeNAMED} } +// ReplicationMode enumerates the values for replication mode. +type ReplicationMode string + +const ( + // ReplicationModeAsync ... + ReplicationModeAsync ReplicationMode = "Async" + // ReplicationModeSync ... + ReplicationModeSync ReplicationMode = "Sync" +) + +// PossibleReplicationModeValues returns an array of possible values for the ReplicationMode const type. +func PossibleReplicationModeValues() []ReplicationMode { + return []ReplicationMode{ReplicationModeAsync, ReplicationModeSync} +} + // ReplicationRole enumerates the values for replication role. type ReplicationRole string @@ -1508,23 +1532,6 @@ 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 @@ -1875,6 +1882,21 @@ func PossibleServiceObjectiveNameValues() []ServiceObjectiveName { return []ServiceObjectiveName{ServiceObjectiveNameBasic, ServiceObjectiveNameDS100, ServiceObjectiveNameDS1000, ServiceObjectiveNameDS1200, ServiceObjectiveNameDS1500, ServiceObjectiveNameDS200, ServiceObjectiveNameDS2000, ServiceObjectiveNameDS300, ServiceObjectiveNameDS400, ServiceObjectiveNameDS500, ServiceObjectiveNameDS600, ServiceObjectiveNameDW100, ServiceObjectiveNameDW1000, ServiceObjectiveNameDW10000c, ServiceObjectiveNameDW1000c, ServiceObjectiveNameDW1200, ServiceObjectiveNameDW1500, ServiceObjectiveNameDW15000c, ServiceObjectiveNameDW1500c, ServiceObjectiveNameDW200, ServiceObjectiveNameDW2000, ServiceObjectiveNameDW2000c, ServiceObjectiveNameDW2500c, ServiceObjectiveNameDW300, ServiceObjectiveNameDW3000, ServiceObjectiveNameDW30000c, ServiceObjectiveNameDW3000c, ServiceObjectiveNameDW400, ServiceObjectiveNameDW500, ServiceObjectiveNameDW5000c, ServiceObjectiveNameDW600, ServiceObjectiveNameDW6000, ServiceObjectiveNameDW6000c, ServiceObjectiveNameDW7500c, ServiceObjectiveNameElasticPool, ServiceObjectiveNameFree, ServiceObjectiveNameP1, ServiceObjectiveNameP11, ServiceObjectiveNameP15, ServiceObjectiveNameP2, ServiceObjectiveNameP3, ServiceObjectiveNameP4, ServiceObjectiveNameP6, ServiceObjectiveNamePRS1, ServiceObjectiveNamePRS2, ServiceObjectiveNamePRS4, ServiceObjectiveNamePRS6, ServiceObjectiveNameS0, ServiceObjectiveNameS1, ServiceObjectiveNameS12, ServiceObjectiveNameS2, ServiceObjectiveNameS3, ServiceObjectiveNameS4, ServiceObjectiveNameS6, ServiceObjectiveNameS7, ServiceObjectiveNameS9, ServiceObjectiveNameSystem, ServiceObjectiveNameSystem0, ServiceObjectiveNameSystem1, ServiceObjectiveNameSystem2, ServiceObjectiveNameSystem2L, ServiceObjectiveNameSystem3, ServiceObjectiveNameSystem3L, ServiceObjectiveNameSystem4, ServiceObjectiveNameSystem4L} } +// ServicePrincipalType enumerates the values for service principal type. +type ServicePrincipalType string + +const ( + // ServicePrincipalTypeNone ... + ServicePrincipalTypeNone ServicePrincipalType = "None" + // ServicePrincipalTypeSystemAssigned ... + ServicePrincipalTypeSystemAssigned ServicePrincipalType = "SystemAssigned" +) + +// PossibleServicePrincipalTypeValues returns an array of possible values for the ServicePrincipalType const type. +func PossibleServicePrincipalTypeValues() []ServicePrincipalType { + return []ServicePrincipalType{ServicePrincipalTypeNone, ServicePrincipalTypeSystemAssigned} +} + // State enumerates the values for state. type State string @@ -1945,23 +1967,6 @@ func PossibleStorageAccountTypeValues() []StorageAccountType { return []StorageAccountType{StorageAccountTypeGRS, StorageAccountTypeLRS, StorageAccountTypeZRS} } -// StorageAccountType1 enumerates the values for storage account type 1. -type StorageAccountType1 string - -const ( - // StorageAccountType1GRS ... - StorageAccountType1GRS StorageAccountType1 = "GRS" - // StorageAccountType1LRS ... - StorageAccountType1LRS StorageAccountType1 = "LRS" - // StorageAccountType1ZRS ... - StorageAccountType1ZRS StorageAccountType1 = "ZRS" -) - -// PossibleStorageAccountType1Values returns an array of possible values for the StorageAccountType1 const type. -func PossibleStorageAccountType1Values() []StorageAccountType1 { - return []StorageAccountType1{StorageAccountType1GRS, StorageAccountType1LRS, StorageAccountType1ZRS} -} - // StorageKeyType enumerates the values for storage key type. type StorageKeyType string @@ -2066,6 +2071,25 @@ func PossibleSyncGroupStateValues() []SyncGroupState { return []SyncGroupState{SyncGroupStateError, SyncGroupStateGood, SyncGroupStateNotReady, SyncGroupStateProgressing, SyncGroupStateWarning} } +// SyncGroupsType enumerates the values for sync groups type. +type SyncGroupsType string + +const ( + // SyncGroupsTypeAll ... + SyncGroupsTypeAll SyncGroupsType = "All" + // SyncGroupsTypeError ... + SyncGroupsTypeError SyncGroupsType = "Error" + // SyncGroupsTypeSuccess ... + SyncGroupsTypeSuccess SyncGroupsType = "Success" + // SyncGroupsTypeWarning ... + SyncGroupsTypeWarning SyncGroupsType = "Warning" +) + +// PossibleSyncGroupsTypeValues returns an array of possible values for the SyncGroupsType const type. +func PossibleSyncGroupsTypeValues() []SyncGroupsType { + return []SyncGroupsType{SyncGroupsTypeAll, SyncGroupsTypeError, SyncGroupsTypeSuccess, SyncGroupsTypeWarning} +} + // SyncMemberDbType enumerates the values for sync member db type. type SyncMemberDbType string @@ -2145,39 +2169,6 @@ func PossibleTableTemporalTypeValues() []TableTemporalType { return []TableTemporalType{TableTemporalTypeHistoryTable, TableTemporalTypeNonTemporalTable, TableTemporalTypeSystemVersionedTemporalTable} } -// 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 - -const ( - // TransparentDataEncryptionActivityStatusDecrypting ... - TransparentDataEncryptionActivityStatusDecrypting TransparentDataEncryptionActivityStatus = "Decrypting" - // TransparentDataEncryptionActivityStatusEncrypting ... - TransparentDataEncryptionActivityStatusEncrypting TransparentDataEncryptionActivityStatus = "Encrypting" -) - -// PossibleTransparentDataEncryptionActivityStatusValues returns an array of possible values for the TransparentDataEncryptionActivityStatus const type. -func PossibleTransparentDataEncryptionActivityStatusValues() []TransparentDataEncryptionActivityStatus { - return []TransparentDataEncryptionActivityStatus{TransparentDataEncryptionActivityStatusDecrypting, TransparentDataEncryptionActivityStatusEncrypting} -} - // TransparentDataEncryptionState enumerates the values for transparent data encryption state. type TransparentDataEncryptionState string @@ -2193,21 +2184,6 @@ func PossibleTransparentDataEncryptionStateValues() []TransparentDataEncryptionS return []TransparentDataEncryptionState{TransparentDataEncryptionStateDisabled, TransparentDataEncryptionStateEnabled} } -// TransparentDataEncryptionStatus enumerates the values for transparent data encryption status. -type TransparentDataEncryptionStatus string - -const ( - // TransparentDataEncryptionStatusDisabled ... - TransparentDataEncryptionStatusDisabled TransparentDataEncryptionStatus = "Disabled" - // TransparentDataEncryptionStatusEnabled ... - TransparentDataEncryptionStatusEnabled TransparentDataEncryptionStatus = "Enabled" -) - -// PossibleTransparentDataEncryptionStatusValues returns an array of possible values for the TransparentDataEncryptionStatus const type. -func PossibleTransparentDataEncryptionStatusValues() []TransparentDataEncryptionStatus { - return []TransparentDataEncryptionStatus{TransparentDataEncryptionStatusDisabled, TransparentDataEncryptionStatusEnabled} -} - // UnitDefinitionType enumerates the values for unit definition type. type UnitDefinitionType string diff --git a/services/preview/sql/mgmt/v5.0/sql/ipv6firewallrules.go b/services/preview/sql/mgmt/v5.0/sql/ipv6firewallrules.go new file mode 100644 index 000000000000..7bb7c5c21f54 --- /dev/null +++ b/services/preview/sql/mgmt/v5.0/sql/ipv6firewallrules.go @@ -0,0 +1,392 @@ +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/tracing" + "net/http" +) + +// IPv6FirewallRulesClient 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 IPv6FirewallRulesClient struct { + BaseClient +} + +// NewIPv6FirewallRulesClient creates an instance of the IPv6FirewallRulesClient client. +func NewIPv6FirewallRulesClient(subscriptionID string) IPv6FirewallRulesClient { + return NewIPv6FirewallRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIPv6FirewallRulesClientWithBaseURI creates an instance of the IPv6FirewallRulesClient 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 NewIPv6FirewallRulesClientWithBaseURI(baseURI string, subscriptionID string) IPv6FirewallRulesClient { + return IPv6FirewallRulesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an IPv6 firewall rule. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +// firewallRuleName - the name of the firewall rule. +// parameters - the required parameters for creating or updating an IPv6 firewall rule. +func (client IPv6FirewallRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters IPv6FirewallRule) (result IPv6FirewallRule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IPv6FirewallRulesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, firewallRuleName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.IPv6FirewallRulesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.IPv6FirewallRulesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.IPv6FirewallRulesClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client IPv6FirewallRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters IPv6FirewallRule) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "firewallRuleName": autorest.Encode("path", firewallRuleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client IPv6FirewallRulesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client IPv6FirewallRulesClient) CreateOrUpdateResponder(resp *http.Response) (result IPv6FirewallRule, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an IPv6 firewall rule. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +// firewallRuleName - the name of the firewall rule. +func (client IPv6FirewallRulesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IPv6FirewallRulesClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, firewallRuleName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.IPv6FirewallRulesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "sql.IPv6FirewallRulesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.IPv6FirewallRulesClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IPv6FirewallRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "firewallRuleName": autorest.Encode("path", firewallRuleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client IPv6FirewallRulesClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client IPv6FirewallRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets an IPv6 firewall rule. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +// firewallRuleName - the name of the firewall rule. +func (client IPv6FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (result IPv6FirewallRule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IPv6FirewallRulesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, serverName, firewallRuleName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.IPv6FirewallRulesClient", "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.IPv6FirewallRulesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.IPv6FirewallRulesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client IPv6FirewallRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "firewallRuleName": autorest.Encode("path", firewallRuleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}", 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 IPv6FirewallRulesClient) 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 IPv6FirewallRulesClient) GetResponder(resp *http.Response) (result IPv6FirewallRule, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByServer gets a list of IPv6 firewall rules. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +func (client IPv6FirewallRulesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result IPv6FirewallRuleListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IPv6FirewallRulesClient.ListByServer") + defer func() { + sc := -1 + if result.ip6frlr.Response.Response != nil { + sc = result.ip6frlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByServerNextResults + req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.IPv6FirewallRulesClient", "ListByServer", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServerSender(req) + if err != nil { + result.ip6frlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.IPv6FirewallRulesClient", "ListByServer", resp, "Failure sending request") + return + } + + result.ip6frlr, err = client.ListByServerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.IPv6FirewallRulesClient", "ListByServer", resp, "Failure responding to request") + return + } + if result.ip6frlr.hasNextLink() && result.ip6frlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByServerPreparer prepares the ListByServer request. +func (client IPv6FirewallRulesClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServerSender sends the ListByServer request. The method will close the +// http.Response Body if it receives an error. +func (client IPv6FirewallRulesClient) ListByServerSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServerResponder handles the response to the ListByServer request. The method always +// closes the http.Response Body. +func (client IPv6FirewallRulesClient) ListByServerResponder(resp *http.Response) (result IPv6FirewallRuleListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServerNextResults retrieves the next set of results, if any. +func (client IPv6FirewallRulesClient) listByServerNextResults(ctx context.Context, lastResults IPv6FirewallRuleListResult) (result IPv6FirewallRuleListResult, err error) { + req, err := lastResults.iPv6FirewallRuleListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "sql.IPv6FirewallRulesClient", "listByServerNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "sql.IPv6FirewallRulesClient", "listByServerNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.IPv6FirewallRulesClient", "listByServerNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. +func (client IPv6FirewallRulesClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result IPv6FirewallRuleListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IPv6FirewallRulesClient.ListByServer") + 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.ListByServer(ctx, resourceGroupName, serverName) + return +} diff --git a/services/preview/sql/mgmt/v5.0/sql/ledgerdigestuploads.go b/services/preview/sql/mgmt/v5.0/sql/ledgerdigestuploads.go index c5103a6ca454..c758e79ad4b4 100644 --- a/services/preview/sql/mgmt/v5.0/sql/ledgerdigestuploads.go +++ b/services/preview/sql/mgmt/v5.0/sql/ledgerdigestuploads.go @@ -39,13 +39,13 @@ func NewLedgerDigestUploadsClientWithBaseURI(baseURI string, subscriptionID stri // from the Azure Resource Manager API or the portal. // serverName - the name of the server. // databaseName - the name of the database. -func (client LedgerDigestUploadsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters LedgerDigestUploads) (result LedgerDigestUploads, err error) { +func (client LedgerDigestUploadsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters LedgerDigestUploads) (result LedgerDigestUploadsCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LedgerDigestUploadsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -56,16 +56,9 @@ func (client LedgerDigestUploadsClient) CreateOrUpdate(ctx context.Context, reso return } - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.LedgerDigestUploadsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) + result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "sql.LedgerDigestUploadsClient", "CreateOrUpdate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.LedgerDigestUploadsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -99,8 +92,18 @@ func (client LedgerDigestUploadsClient) CreateOrUpdatePreparer(ctx context.Conte // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client LedgerDigestUploadsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client LedgerDigestUploadsClient) CreateOrUpdateSender(req *http.Request) (future LedgerDigestUploadsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + 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 } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -121,13 +124,13 @@ func (client LedgerDigestUploadsClient) CreateOrUpdateResponder(resp *http.Respo // from the Azure Resource Manager API or the portal. // serverName - the name of the server. // databaseName - the name of the database. -func (client LedgerDigestUploadsClient) Disable(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result LedgerDigestUploads, err error) { +func (client LedgerDigestUploadsClient) Disable(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result LedgerDigestUploadsDisableFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LedgerDigestUploadsClient.Disable") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -138,16 +141,9 @@ func (client LedgerDigestUploadsClient) Disable(ctx context.Context, resourceGro return } - resp, err := client.DisableSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.LedgerDigestUploadsClient", "Disable", resp, "Failure sending request") - return - } - - result, err = client.DisableResponder(resp) + result, err = client.DisableSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "sql.LedgerDigestUploadsClient", "Disable", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.LedgerDigestUploadsClient", "Disable", result.Response(), "Failure sending request") return } @@ -179,8 +175,18 @@ func (client LedgerDigestUploadsClient) DisablePreparer(ctx context.Context, res // DisableSender sends the Disable request. The method will close the // http.Response Body if it receives an error. -func (client LedgerDigestUploadsClient) DisableSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client LedgerDigestUploadsClient) DisableSender(req *http.Request) (future LedgerDigestUploadsDisableFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + 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 } // DisableResponder handles the response to the Disable request. The method always diff --git a/services/preview/sql/mgmt/v5.0/sql/longtermretentionbackups.go b/services/preview/sql/mgmt/v5.0/sql/longtermretentionbackups.go index 99ca55b9bef1..34221dfe6b02 100644 --- a/services/preview/sql/mgmt/v5.0/sql/longtermretentionbackups.go +++ b/services/preview/sql/mgmt/v5.0/sql/longtermretentionbackups.go @@ -76,7 +76,7 @@ func (client LongTermRetentionBackupsClient) CopyPreparer(ctx context.Context, l "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -165,7 +165,7 @@ func (client LongTermRetentionBackupsClient) CopyByResourceGroupPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -250,7 +250,7 @@ func (client LongTermRetentionBackupsClient) DeletePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -335,7 +335,7 @@ func (client LongTermRetentionBackupsClient) DeleteByResourceGroupPreparer(ctx c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -424,7 +424,7 @@ func (client LongTermRetentionBackupsClient) GetPreparer(ctx context.Context, lo "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -507,7 +507,7 @@ func (client LongTermRetentionBackupsClient) GetByResourceGroupPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -592,7 +592,7 @@ func (client LongTermRetentionBackupsClient) ListByDatabasePreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -716,7 +716,7 @@ func (client LongTermRetentionBackupsClient) ListByLocationPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -847,7 +847,7 @@ func (client LongTermRetentionBackupsClient) ListByResourceGroupDatabasePreparer "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -974,7 +974,7 @@ func (client LongTermRetentionBackupsClient) ListByResourceGroupLocationPreparer "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1103,7 +1103,7 @@ func (client LongTermRetentionBackupsClient) ListByResourceGroupServerPreparer(c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1229,7 +1229,7 @@ func (client LongTermRetentionBackupsClient) ListByServerPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1346,7 +1346,7 @@ func (client LongTermRetentionBackupsClient) UpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1435,7 +1435,7 @@ func (client LongTermRetentionBackupsClient) UpdateByResourceGroupPreparer(ctx c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/sql/mgmt/v5.0/sql/longtermretentionmanagedinstancebackups.go b/services/preview/sql/mgmt/v5.0/sql/longtermretentionmanagedinstancebackups.go index f9cde4f9388e..a3bbf78627ef 100644 --- a/services/preview/sql/mgmt/v5.0/sql/longtermretentionmanagedinstancebackups.go +++ b/services/preview/sql/mgmt/v5.0/sql/longtermretentionmanagedinstancebackups.go @@ -76,7 +76,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) DeletePreparer(ctx c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -161,7 +161,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) DeleteByResourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -250,7 +250,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) GetPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -333,7 +333,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) GetByResourceGroupPr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -418,7 +418,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByDatabasePrepar "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -544,7 +544,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByInstancePrepar "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -668,7 +668,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByLocationPrepar "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -799,7 +799,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupD "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -928,7 +928,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupI "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1055,7 +1055,7 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupL "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/sql/mgmt/v5.0/sql/manageddatabasesecurityalertpolicies.go b/services/preview/sql/mgmt/v5.0/sql/manageddatabasesecurityalertpolicies.go index dfd1380ebc88..b52b859cd667 100644 --- a/services/preview/sql/mgmt/v5.0/sql/manageddatabasesecurityalertpolicies.go +++ b/services/preview/sql/mgmt/v5.0/sql/manageddatabasesecurityalertpolicies.go @@ -80,7 +80,7 @@ func (client ManagedDatabaseSecurityAlertPoliciesClient) CreateOrUpdatePreparer( "databaseName": autorest.Encode("path", databaseName), "managedInstanceName": autorest.Encode("path", managedInstanceName), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityAlertPolicyName": autorest.Encode("path", "default"), + "securityAlertPolicyName": autorest.Encode("path", "Default"), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -162,7 +162,7 @@ func (client ManagedDatabaseSecurityAlertPoliciesClient) GetPreparer(ctx context "databaseName": autorest.Encode("path", databaseName), "managedInstanceName": autorest.Encode("path", managedInstanceName), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityAlertPolicyName": autorest.Encode("path", "default"), + "securityAlertPolicyName": autorest.Encode("path", "Default"), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } diff --git a/services/preview/sql/mgmt/v5.0/sql/managedinstances.go b/services/preview/sql/mgmt/v5.0/sql/managedinstances.go index 6cd74238340c..a8d719b66602 100644 --- a/services/preview/sql/mgmt/v5.0/sql/managedinstances.go +++ b/services/preview/sql/mgmt/v5.0/sql/managedinstances.go @@ -81,7 +81,7 @@ func (client ManagedInstancesClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -163,7 +163,7 @@ func (client ManagedInstancesClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -243,7 +243,7 @@ func (client ManagedInstancesClient) FailoverPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -333,7 +333,7 @@ func (client ManagedInstancesClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -414,7 +414,7 @@ func (client ManagedInstancesClient) ListPreparer(ctx context.Context, expand st "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -537,7 +537,7 @@ func (client ManagedInstancesClient) ListByInstancePoolPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -667,7 +667,7 @@ func (client ManagedInstancesClient) ListByManagedInstancePreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -806,7 +806,7 @@ func (client ManagedInstancesClient) ListByResourceGroupPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -917,7 +917,7 @@ func (client ManagedInstancesClient) UpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-11-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/sql/mgmt/v5.0/sql/models.go b/services/preview/sql/mgmt/v5.0/sql/models.go index 32af3e49022d..23adb56691dd 100644 --- a/services/preview/sql/mgmt/v5.0/sql/models.go +++ b/services/preview/sql/mgmt/v5.0/sql/models.go @@ -1106,8 +1106,8 @@ type CopyLongTermRetentionBackupParametersProperties struct { 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"` + // TargetBackupStorageRedundancy - The storage redundancy type of the copied backup. Possible values include: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone', 'BackupStorageRedundancyGeoZone' + TargetBackupStorageRedundancy BackupStorageRedundancy `json:"targetBackupStorageRedundancy,omitempty"` } // CreateDatabaseRestorePointDefinition contains the information necessary to perform a create database @@ -1136,6 +1136,8 @@ type Database struct { Kind *string `json:"kind,omitempty"` // ManagedBy - READ-ONLY; Resource that manages the database. ManagedBy *string `json:"managedBy,omitempty"` + // Identity - The Azure Active Directory identity of the database. + Identity *DatabaseIdentity `json:"identity,omitempty"` // DatabaseProperties - Resource properties. *DatabaseProperties `json:"properties,omitempty"` // Location - Resource location. @@ -1156,6 +1158,9 @@ func (d Database) MarshalJSON() ([]byte, error) { if d.Sku != nil { objectMap["sku"] = d.Sku } + if d.Identity != nil { + objectMap["identity"] = d.Identity + } if d.DatabaseProperties != nil { objectMap["properties"] = d.DatabaseProperties } @@ -1204,6 +1209,15 @@ func (d *Database) UnmarshalJSON(body []byte) error { } d.ManagedBy = &managedBy } + case "identity": + if v != nil { + var identity DatabaseIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + d.Identity = &identity + } case "properties": if v != nil { var databaseProperties DatabaseProperties @@ -2080,6 +2094,28 @@ type DatabaseExtensionsProperties struct { StorageURI *string `json:"storageUri,omitempty"` } +// DatabaseIdentity azure Active Directory identity configuration for a resource. +type DatabaseIdentity struct { + // Type - The identity type. Possible values include: 'DatabaseIdentityTypeNone', 'DatabaseIdentityTypeUserAssigned' + Type DatabaseIdentityType `json:"type,omitempty"` + // TenantID - READ-ONLY; The Azure Active Directory tenant id. + TenantID *uuid.UUID `json:"tenantId,omitempty"` + // UserAssignedIdentities - The resource ids of the user assigned identities to use + UserAssignedIdentities map[string]*DatabaseUserIdentity `json:"userAssignedIdentities"` +} + +// MarshalJSON is the custom marshaler for DatabaseIdentity. +func (di DatabaseIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if di.Type != "" { + objectMap["type"] = di.Type + } + if di.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = di.UserAssignedIdentities + } + return json.Marshal(objectMap) +} + // DatabaseListResult a list of databases. type DatabaseListResult struct { autorest.Response `json:"-"` @@ -2550,7 +2586,7 @@ type DatabaseProperties struct { ElasticPoolID *string `json:"elasticPoolId,omitempty"` // SourceDatabaseID - The resource identifier of the source database associated with create operation of this database. SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"` - // Status - READ-ONLY; The status of the database. Possible values include: 'DatabaseStatusOnline', 'DatabaseStatusRestoring', 'DatabaseStatusRecoveryPending', 'DatabaseStatusRecovering', 'DatabaseStatusSuspect', 'DatabaseStatusOffline', 'DatabaseStatusStandby', 'DatabaseStatusShutdown', 'DatabaseStatusEmergencyMode', 'DatabaseStatusAutoClosed', 'DatabaseStatusCopying', 'DatabaseStatusCreating', 'DatabaseStatusInaccessible', 'DatabaseStatusOfflineSecondary', 'DatabaseStatusPausing', 'DatabaseStatusPaused', 'DatabaseStatusResuming', 'DatabaseStatusScaling', 'DatabaseStatusOfflineChangingDwPerformanceTiers', 'DatabaseStatusOnlineChangingDwPerformanceTiers', 'DatabaseStatusDisabled' + // Status - READ-ONLY; The status of the database. Possible values include: 'DatabaseStatusOnline', 'DatabaseStatusRestoring', 'DatabaseStatusRecoveryPending', 'DatabaseStatusRecovering', 'DatabaseStatusSuspect', 'DatabaseStatusOffline', 'DatabaseStatusStandby', 'DatabaseStatusShutdown', 'DatabaseStatusEmergencyMode', 'DatabaseStatusAutoClosed', 'DatabaseStatusCopying', 'DatabaseStatusCreating', 'DatabaseStatusInaccessible', 'DatabaseStatusOfflineSecondary', 'DatabaseStatusPausing', 'DatabaseStatusPaused', 'DatabaseStatusResuming', 'DatabaseStatusScaling', 'DatabaseStatusOfflineChangingDwPerformanceTiers', 'DatabaseStatusOnlineChangingDwPerformanceTiers', 'DatabaseStatusDisabled', 'DatabaseStatusStopping', 'DatabaseStatusStopped', 'DatabaseStatusStarting' Status DatabaseStatus `json:"status,omitempty"` // DatabaseID - READ-ONLY; The ID of the database. DatabaseID *uuid.UUID `json:"databaseId,omitempty"` @@ -2586,9 +2622,9 @@ type DatabaseProperties struct { MaxLogSizeBytes *int64 `json:"maxLogSizeBytes,omitempty"` // EarliestRestoreDate - READ-ONLY; This records the earliest start date and time that restore is available for this database (ISO8601 format). EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` - // ReadScale - The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Possible values include: 'DatabaseReadScaleEnabled', 'DatabaseReadScaleDisabled' + // ReadScale - The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Not applicable to a Hyperscale database within an elastic pool. Possible values include: 'DatabaseReadScaleEnabled', 'DatabaseReadScaleDisabled' ReadScale DatabaseReadScale `json:"readScale,omitempty"` - // HighAvailabilityReplicaCount - The number of secondary replicas associated with the database that are used to provide high availability. + // HighAvailabilityReplicaCount - The number of secondary replicas associated with the database that are used to provide high availability. Not applicable to a Hyperscale database within an elastic pool. 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: 'SecondaryTypeGeo', 'SecondaryTypeNamed' SecondaryType SecondaryType `json:"secondaryType,omitempty"` @@ -2596,10 +2632,10 @@ type DatabaseProperties struct { 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"` - // 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"` + // CurrentBackupStorageRedundancy - READ-ONLY; The storage account type used to store backups for this database. Possible values include: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone', 'BackupStorageRedundancyGeoZone' + CurrentBackupStorageRedundancy BackupStorageRedundancy `json:"currentBackupStorageRedundancy,omitempty"` + // RequestedBackupStorageRedundancy - The storage account type to be used to store backups for this database. Possible values include: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone', 'BackupStorageRedundancyGeoZone' + RequestedBackupStorageRedundancy BackupStorageRedundancy `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. @@ -2612,6 +2648,22 @@ type DatabaseProperties struct { IsLedgerOn *bool `json:"isLedgerOn,omitempty"` // IsInfraEncryptionEnabled - READ-ONLY; Infra encryption is enabled for this database. IsInfraEncryptionEnabled *bool `json:"isInfraEncryptionEnabled,omitempty"` + // FederatedClientID - The Client id used for cross tenant per database CMK scenario + FederatedClientID *uuid.UUID `json:"federatedClientId,omitempty"` + // SourceResourceID - The resource identifier of the source associated with the create operation of this database. + // + // When sourceResourceId is specified, sourceDatabaseId, recoverableDatabaseId, restorableDroppedDatabaseId and sourceDatabaseDeletionDate must not be specified and CreateMode must be PointInTimeRestore, Restore or Recover. + // + // When createMode is PointInTimeRestore, sourceResourceId must be the resource ID of an existing database or existing sql pool, and restorePointInTime must be specified. + // + // When createMode is Restore, sourceResourceId must be the resource ID of restorable dropped database or restorable dropped sql pool. + // + // When createMode is Recover, sourceResourceId must be the resource ID of recoverable database or recoverable sql pool. + // + // This property allows to restore across subscriptions which is only supported for DataWarehouse edition. + // + // When source subscription belongs to a different tenant than target subscription, “x-ms-authorization-auxiliary” header must contain authentication token for the source tenant. For more details about “x-ms-authorization-auxiliary” header see https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant + SourceResourceID *string `json:"sourceResourceId,omitempty"` } // MarshalJSON is the custom marshaler for DatabaseProperties. @@ -2686,6 +2738,12 @@ func (dp DatabaseProperties) MarshalJSON() ([]byte, error) { if dp.IsLedgerOn != nil { objectMap["isLedgerOn"] = dp.IsLedgerOn } + if dp.FederatedClientID != nil { + objectMap["federatedClientId"] = dp.FederatedClientID + } + if dp.SourceResourceID != nil { + objectMap["sourceResourceId"] = dp.SourceResourceID + } return json.Marshal(objectMap) } @@ -3736,12 +3794,14 @@ type DatabaseTableProperties struct { MemoryOptimized *bool `json:"memoryOptimized,omitempty"` } -// DatabaseUpdate a database resource. +// DatabaseUpdate a database update resource. type DatabaseUpdate struct { // Sku - The name and tier of the SKU. Sku *Sku `json:"sku,omitempty"` - // DatabaseProperties - Resource properties. - *DatabaseProperties `json:"properties,omitempty"` + // Identity - Database identity + Identity *DatabaseIdentity `json:"identity,omitempty"` + // DatabaseUpdateProperties - Resource properties. + *DatabaseUpdateProperties `json:"properties,omitempty"` // Tags - Resource tags. Tags map[string]*string `json:"tags"` } @@ -3752,8 +3812,11 @@ func (du DatabaseUpdate) MarshalJSON() ([]byte, error) { if du.Sku != nil { objectMap["sku"] = du.Sku } - if du.DatabaseProperties != nil { - objectMap["properties"] = du.DatabaseProperties + if du.Identity != nil { + objectMap["identity"] = du.Identity + } + if du.DatabaseUpdateProperties != nil { + objectMap["properties"] = du.DatabaseUpdateProperties } if du.Tags != nil { objectMap["tags"] = du.Tags @@ -3779,14 +3842,23 @@ func (du *DatabaseUpdate) UnmarshalJSON(body []byte) error { } du.Sku = &sku } + case "identity": + if v != nil { + var identity DatabaseIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + du.Identity = &identity + } case "properties": if v != nil { - var databaseProperties DatabaseProperties - err = json.Unmarshal(*v, &databaseProperties) + var databaseUpdateProperties DatabaseUpdateProperties + err = json.Unmarshal(*v, &databaseUpdateProperties) if err != nil { return err } - du.DatabaseProperties = &databaseProperties + du.DatabaseUpdateProperties = &databaseUpdateProperties } case "tags": if v != nil { @@ -3803,6 +3875,180 @@ func (du *DatabaseUpdate) UnmarshalJSON(body []byte) error { return nil } +// DatabaseUpdateProperties a database update properties. +type DatabaseUpdateProperties struct { + // CreateMode - Specifies the mode of database creation. + // + // Default: regular database creation. + // + // Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database. + // + // Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database. + // + // PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified. + // + // Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore. + // + // Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time. + // + // RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID. + // + // Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. Possible values include: 'CreateModeDefault', 'CreateModeCopy', 'CreateModeSecondary', 'CreateModePointInTimeRestore', 'CreateModeRestore', 'CreateModeRecovery', 'CreateModeRestoreExternalBackup', 'CreateModeRestoreExternalBackupSecondary', 'CreateModeRestoreLongTermRetentionBackup', 'CreateModeOnlineSecondary' + CreateMode CreateMode `json:"createMode,omitempty"` + // Collation - The collation of the database. + Collation *string `json:"collation,omitempty"` + // MaxSizeBytes - The max size of the database expressed in bytes. + MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"` + // SampleName - The name of the sample schema to apply when creating this database. Possible values include: 'SampleNameAdventureWorksLT', 'SampleNameWideWorldImportersStd', 'SampleNameWideWorldImportersFull' + SampleName SampleName `json:"sampleName,omitempty"` + // ElasticPoolID - The resource identifier of the elastic pool containing this database. + ElasticPoolID *string `json:"elasticPoolId,omitempty"` + // SourceDatabaseID - The resource identifier of the source database associated with create operation of this database. + SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"` + // Status - READ-ONLY; The status of the database. Possible values include: 'DatabaseStatusOnline', 'DatabaseStatusRestoring', 'DatabaseStatusRecoveryPending', 'DatabaseStatusRecovering', 'DatabaseStatusSuspect', 'DatabaseStatusOffline', 'DatabaseStatusStandby', 'DatabaseStatusShutdown', 'DatabaseStatusEmergencyMode', 'DatabaseStatusAutoClosed', 'DatabaseStatusCopying', 'DatabaseStatusCreating', 'DatabaseStatusInaccessible', 'DatabaseStatusOfflineSecondary', 'DatabaseStatusPausing', 'DatabaseStatusPaused', 'DatabaseStatusResuming', 'DatabaseStatusScaling', 'DatabaseStatusOfflineChangingDwPerformanceTiers', 'DatabaseStatusOnlineChangingDwPerformanceTiers', 'DatabaseStatusDisabled', 'DatabaseStatusStopping', 'DatabaseStatusStopped', 'DatabaseStatusStarting' + Status DatabaseStatus `json:"status,omitempty"` + // DatabaseID - READ-ONLY; The ID of the database. + DatabaseID *uuid.UUID `json:"databaseId,omitempty"` + // CreationDate - READ-ONLY; The creation date of the database (ISO8601 format). + CreationDate *date.Time `json:"creationDate,omitempty"` + // CurrentServiceObjectiveName - READ-ONLY; The current service level objective name of the database. + CurrentServiceObjectiveName *string `json:"currentServiceObjectiveName,omitempty"` + // RequestedServiceObjectiveName - READ-ONLY; The requested service level objective name of the database. + RequestedServiceObjectiveName *string `json:"requestedServiceObjectiveName,omitempty"` + // DefaultSecondaryLocation - READ-ONLY; The default secondary region for this database. + DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty"` + // FailoverGroupID - READ-ONLY; Failover Group resource identifier that this database belongs to. + FailoverGroupID *string `json:"failoverGroupId,omitempty"` + // RestorePointInTime - Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. + RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"` + // SourceDatabaseDeletionDate - Specifies the time that the database was deleted. + SourceDatabaseDeletionDate *date.Time `json:"sourceDatabaseDeletionDate,omitempty"` + // RecoveryServicesRecoveryPointID - The resource identifier of the recovery point associated with create operation of this database. + RecoveryServicesRecoveryPointID *string `json:"recoveryServicesRecoveryPointId,omitempty"` + // LongTermRetentionBackupResourceID - The resource identifier of the long term retention backup associated with create operation of this database. + LongTermRetentionBackupResourceID *string `json:"longTermRetentionBackupResourceId,omitempty"` + // RecoverableDatabaseID - The resource identifier of the recoverable database associated with create operation of this database. + RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"` + // RestorableDroppedDatabaseID - The resource identifier of the restorable dropped database associated with create operation of this database. + RestorableDroppedDatabaseID *string `json:"restorableDroppedDatabaseId,omitempty"` + // CatalogCollation - Collation of the metadata catalog. Possible values include: 'CatalogCollationTypeDATABASEDEFAULT', 'CatalogCollationTypeSQLLatin1GeneralCP1CIAS' + CatalogCollation CatalogCollationType `json:"catalogCollation,omitempty"` + // ZoneRedundant - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` + // LicenseType - The license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit. Possible values include: 'DatabaseLicenseTypeLicenseIncluded', 'DatabaseLicenseTypeBasePrice' + LicenseType DatabaseLicenseType `json:"licenseType,omitempty"` + // MaxLogSizeBytes - READ-ONLY; The max log size for this database. + MaxLogSizeBytes *int64 `json:"maxLogSizeBytes,omitempty"` + // EarliestRestoreDate - READ-ONLY; This records the earliest start date and time that restore is available for this database (ISO8601 format). + EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` + // ReadScale - The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Not applicable to a Hyperscale database within an elastic pool. Possible values include: 'DatabaseReadScaleEnabled', 'DatabaseReadScaleDisabled' + ReadScale DatabaseReadScale `json:"readScale,omitempty"` + // HighAvailabilityReplicaCount - The number of secondary replicas associated with the database that are used to provide high availability. Not applicable to a Hyperscale database within an elastic pool. + 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: '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"` + // CurrentBackupStorageRedundancy - READ-ONLY; The storage account type used to store backups for this database. Possible values include: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone', 'BackupStorageRedundancyGeoZone' + CurrentBackupStorageRedundancy BackupStorageRedundancy `json:"currentBackupStorageRedundancy,omitempty"` + // RequestedBackupStorageRedundancy - The storage account type to be used to store backups for this database. Possible values include: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone', 'BackupStorageRedundancyGeoZone' + RequestedBackupStorageRedundancy BackupStorageRedundancy `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. + PausedDate *date.Time `json:"pausedDate,omitempty"` + // ResumedDate - READ-ONLY; The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused. + ResumedDate *date.Time `json:"resumedDate,omitempty"` + // MaintenanceConfigurationID - Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur. + MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"` + // IsLedgerOn - Whether or not this database is a ledger database, which means all tables in the database are ledger tables. Note: the value of this property cannot be changed after the database has been created. + IsLedgerOn *bool `json:"isLedgerOn,omitempty"` + // IsInfraEncryptionEnabled - READ-ONLY; Infra encryption is enabled for this database. + IsInfraEncryptionEnabled *bool `json:"isInfraEncryptionEnabled,omitempty"` + // FederatedClientID - The Client id used for cross tenant per database CMK scenario + FederatedClientID *uuid.UUID `json:"federatedClientId,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabaseUpdateProperties. +func (dup DatabaseUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dup.CreateMode != "" { + objectMap["createMode"] = dup.CreateMode + } + if dup.Collation != nil { + objectMap["collation"] = dup.Collation + } + if dup.MaxSizeBytes != nil { + objectMap["maxSizeBytes"] = dup.MaxSizeBytes + } + if dup.SampleName != "" { + objectMap["sampleName"] = dup.SampleName + } + if dup.ElasticPoolID != nil { + objectMap["elasticPoolId"] = dup.ElasticPoolID + } + if dup.SourceDatabaseID != nil { + objectMap["sourceDatabaseId"] = dup.SourceDatabaseID + } + if dup.RestorePointInTime != nil { + objectMap["restorePointInTime"] = dup.RestorePointInTime + } + if dup.SourceDatabaseDeletionDate != nil { + objectMap["sourceDatabaseDeletionDate"] = dup.SourceDatabaseDeletionDate + } + if dup.RecoveryServicesRecoveryPointID != nil { + objectMap["recoveryServicesRecoveryPointId"] = dup.RecoveryServicesRecoveryPointID + } + if dup.LongTermRetentionBackupResourceID != nil { + objectMap["longTermRetentionBackupResourceId"] = dup.LongTermRetentionBackupResourceID + } + if dup.RecoverableDatabaseID != nil { + objectMap["recoverableDatabaseId"] = dup.RecoverableDatabaseID + } + if dup.RestorableDroppedDatabaseID != nil { + objectMap["restorableDroppedDatabaseId"] = dup.RestorableDroppedDatabaseID + } + if dup.CatalogCollation != "" { + objectMap["catalogCollation"] = dup.CatalogCollation + } + if dup.ZoneRedundant != nil { + objectMap["zoneRedundant"] = dup.ZoneRedundant + } + if dup.LicenseType != "" { + objectMap["licenseType"] = dup.LicenseType + } + if dup.ReadScale != "" { + objectMap["readScale"] = dup.ReadScale + } + if dup.HighAvailabilityReplicaCount != nil { + objectMap["highAvailabilityReplicaCount"] = dup.HighAvailabilityReplicaCount + } + if dup.SecondaryType != "" { + objectMap["secondaryType"] = dup.SecondaryType + } + if dup.AutoPauseDelay != nil { + objectMap["autoPauseDelay"] = dup.AutoPauseDelay + } + if dup.RequestedBackupStorageRedundancy != "" { + objectMap["requestedBackupStorageRedundancy"] = dup.RequestedBackupStorageRedundancy + } + if dup.MinCapacity != nil { + objectMap["minCapacity"] = dup.MinCapacity + } + if dup.MaintenanceConfigurationID != nil { + objectMap["maintenanceConfigurationId"] = dup.MaintenanceConfigurationID + } + if dup.IsLedgerOn != nil { + objectMap["isLedgerOn"] = dup.IsLedgerOn + } + if dup.FederatedClientID != nil { + objectMap["federatedClientId"] = dup.FederatedClientID + } + return json.Marshal(objectMap) +} + // DatabaseUsage usage metric of a database. type DatabaseUsage struct { // DatabaseUsageProperties - Resource properties. @@ -4058,6 +4304,20 @@ func (dup DatabaseUsageProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// DatabaseUserIdentity azure Active Directory identity configuration for a resource. +type DatabaseUserIdentity struct { + // PrincipalID - READ-ONLY; The Azure Active Directory principal id. + PrincipalID *uuid.UUID `json:"principalId,omitempty"` + // ClientID - READ-ONLY; The Azure Active Directory client id. + ClientID *uuid.UUID `json:"clientId,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabaseUserIdentity. +func (dui DatabaseUserIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // DatabaseVulnerabilityAssessment a database vulnerability assessment. type DatabaseVulnerabilityAssessment struct { autorest.Response `json:"-"` @@ -5358,64 +5618,11 @@ func (future *DeletedServersRecoverFuture) result(client DeletedServersClient) ( return } -// DNSRefreshConfigurationProperties DNS refresh configuration properties. -type DNSRefreshConfigurationProperties struct { - // Status - READ-ONLY; The status of the DNS refresh operation. Possible values include: 'Status1Succeeded', 'Status1Failed' - Status Status1 `json:"status,omitempty"` -} - -// MarshalJSON is the custom marshaler for DNSRefreshConfigurationProperties. -func (drcp DNSRefreshConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// EditionCapability the edition capability. -type EditionCapability struct { - // Name - READ-ONLY; The database edition name. - Name *string `json:"name,omitempty"` - // SupportedServiceLevelObjectives - READ-ONLY; The list of supported service objectives for the edition. - SupportedServiceLevelObjectives *[]ServiceObjectiveCapability `json:"supportedServiceLevelObjectives,omitempty"` - // ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the edition. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` - // ReadScale - READ-ONLY; The read scale capability for the edition. - ReadScale *ReadScaleCapability `json:"readScale,omitempty"` - // SupportedStorageCapabilities - READ-ONLY; The list of supported storage capabilities for this edition - SupportedStorageCapabilities *[]StorageCapability `json:"supportedStorageCapabilities,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` -} - -// MarshalJSON is the custom marshaler for EditionCapability. -func (ec EditionCapability) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ec.Reason != nil { - objectMap["reason"] = ec.Reason - } - return json.Marshal(objectMap) -} - -// ElasticPool an elastic pool. -type ElasticPool struct { +// DistributedAvailabilityGroup distributed availability group between box and Sql Managed Instance. +type DistributedAvailabilityGroup struct { autorest.Response `json:"-"` - // Sku - The elastic pool SKU. - // - // The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or the following command: - // - // ```azurecli - // az sql elastic-pool list-editions -l -o table - // ```` - Sku *Sku `json:"sku,omitempty"` - // Kind - READ-ONLY; Kind of elastic pool. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // ElasticPoolProperties - Resource properties. - *ElasticPoolProperties `json:"properties,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` + // DistributedAvailabilityGroupProperties - Resource properties. + *DistributedAvailabilityGroupProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -5424,26 +5631,17 @@ type ElasticPool struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ElasticPool. -func (ep ElasticPool) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for DistributedAvailabilityGroup. +func (dag DistributedAvailabilityGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ep.Sku != nil { - objectMap["sku"] = ep.Sku - } - if ep.ElasticPoolProperties != nil { - objectMap["properties"] = ep.ElasticPoolProperties - } - if ep.Location != nil { - objectMap["location"] = ep.Location - } - if ep.Tags != nil { - objectMap["tags"] = ep.Tags + if dag.DistributedAvailabilityGroupProperties != nil { + objectMap["properties"] = dag.DistributedAvailabilityGroupProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ElasticPool struct. -func (ep *ElasticPool) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for DistributedAvailabilityGroup struct. +func (dag *DistributedAvailabilityGroup) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -5451,29 +5649,498 @@ func (ep *ElasticPool) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "sku": + case "properties": if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) + var distributedAvailabilityGroupProperties DistributedAvailabilityGroupProperties + err = json.Unmarshal(*v, &distributedAvailabilityGroupProperties) if err != nil { return err } - ep.Sku = &sku + dag.DistributedAvailabilityGroupProperties = &distributedAvailabilityGroupProperties } - case "kind": + case "id": if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - ep.Kind = &kind + dag.ID = &ID } - case "properties": + case "name": if v != nil { - var elasticPoolProperties ElasticPoolProperties - err = json.Unmarshal(*v, &elasticPoolProperties) - if err != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dag.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dag.Type = &typeVar + } + } + } + + return nil +} + +// DistributedAvailabilityGroupProperties the properties of a distributed availability group. +type DistributedAvailabilityGroupProperties struct { + // TargetDatabase - The name of the target database + TargetDatabase *string `json:"targetDatabase,omitempty"` + // SourceEndpoint - The source endpoint + SourceEndpoint *string `json:"sourceEndpoint,omitempty"` + // PrimaryAvailabilityGroupName - The primary availability group name + PrimaryAvailabilityGroupName *string `json:"primaryAvailabilityGroupName,omitempty"` + // SecondaryAvailabilityGroupName - The secondary availability group name + SecondaryAvailabilityGroupName *string `json:"secondaryAvailabilityGroupName,omitempty"` + // ReplicationMode - The replication mode of a distributed availability group. Parameter will be ignored during link creation. Possible values include: 'ReplicationModeAsync', 'ReplicationModeSync' + ReplicationMode ReplicationMode `json:"replicationMode,omitempty"` + // DistributedAvailabilityGroupID - READ-ONLY; The distributed availability group id + DistributedAvailabilityGroupID *uuid.UUID `json:"distributedAvailabilityGroupId,omitempty"` + // SourceReplicaID - READ-ONLY; The source replica id + SourceReplicaID *uuid.UUID `json:"sourceReplicaId,omitempty"` + // TargetReplicaID - READ-ONLY; The target replica id + TargetReplicaID *uuid.UUID `json:"targetReplicaId,omitempty"` + // LinkState - READ-ONLY; The link state + LinkState *string `json:"linkState,omitempty"` + // LastHardenedLsn - READ-ONLY; The last hardened lsn + LastHardenedLsn *string `json:"lastHardenedLsn,omitempty"` +} + +// MarshalJSON is the custom marshaler for DistributedAvailabilityGroupProperties. +func (dagp DistributedAvailabilityGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dagp.TargetDatabase != nil { + objectMap["targetDatabase"] = dagp.TargetDatabase + } + if dagp.SourceEndpoint != nil { + objectMap["sourceEndpoint"] = dagp.SourceEndpoint + } + if dagp.PrimaryAvailabilityGroupName != nil { + objectMap["primaryAvailabilityGroupName"] = dagp.PrimaryAvailabilityGroupName + } + if dagp.SecondaryAvailabilityGroupName != nil { + objectMap["secondaryAvailabilityGroupName"] = dagp.SecondaryAvailabilityGroupName + } + if dagp.ReplicationMode != "" { + objectMap["replicationMode"] = dagp.ReplicationMode + } + return json.Marshal(objectMap) +} + +// DistributedAvailabilityGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type DistributedAvailabilityGroupsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DistributedAvailabilityGroupsClient) (DistributedAvailabilityGroup, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DistributedAvailabilityGroupsCreateOrUpdateFuture) 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 DistributedAvailabilityGroupsCreateOrUpdateFuture.Result. +func (future *DistributedAvailabilityGroupsCreateOrUpdateFuture) result(client DistributedAvailabilityGroupsClient) (dag DistributedAvailabilityGroup, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DistributedAvailabilityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dag.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.DistributedAvailabilityGroupsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dag.Response.Response, err = future.GetResult(sender); err == nil && dag.Response.Response.StatusCode != http.StatusNoContent { + dag, err = client.CreateOrUpdateResponder(dag.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DistributedAvailabilityGroupsCreateOrUpdateFuture", "Result", dag.Response.Response, "Failure responding to request") + } + } + return +} + +// DistributedAvailabilityGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DistributedAvailabilityGroupsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DistributedAvailabilityGroupsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DistributedAvailabilityGroupsDeleteFuture) 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 DistributedAvailabilityGroupsDeleteFuture.Result. +func (future *DistributedAvailabilityGroupsDeleteFuture) result(client DistributedAvailabilityGroupsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DistributedAvailabilityGroupsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.DistributedAvailabilityGroupsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DistributedAvailabilityGroupsListResult a list of distributed availability groups in instance. +type DistributedAvailabilityGroupsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]DistributedAvailabilityGroup `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for DistributedAvailabilityGroupsListResult. +func (daglr DistributedAvailabilityGroupsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DistributedAvailabilityGroupsListResultIterator provides access to a complete listing of +// DistributedAvailabilityGroup values. +type DistributedAvailabilityGroupsListResultIterator struct { + i int + page DistributedAvailabilityGroupsListResultPage +} + +// 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 *DistributedAvailabilityGroupsListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DistributedAvailabilityGroupsListResultIterator.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 *DistributedAvailabilityGroupsListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DistributedAvailabilityGroupsListResultIterator) 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 DistributedAvailabilityGroupsListResultIterator) Response() DistributedAvailabilityGroupsListResult { + 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 DistributedAvailabilityGroupsListResultIterator) Value() DistributedAvailabilityGroup { + if !iter.page.NotDone() { + return DistributedAvailabilityGroup{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DistributedAvailabilityGroupsListResultIterator type. +func NewDistributedAvailabilityGroupsListResultIterator(page DistributedAvailabilityGroupsListResultPage) DistributedAvailabilityGroupsListResultIterator { + return DistributedAvailabilityGroupsListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (daglr DistributedAvailabilityGroupsListResult) IsEmpty() bool { + return daglr.Value == nil || len(*daglr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (daglr DistributedAvailabilityGroupsListResult) hasNextLink() bool { + return daglr.NextLink != nil && len(*daglr.NextLink) != 0 +} + +// distributedAvailabilityGroupsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (daglr DistributedAvailabilityGroupsListResult) distributedAvailabilityGroupsListResultPreparer(ctx context.Context) (*http.Request, error) { + if !daglr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(daglr.NextLink))) +} + +// DistributedAvailabilityGroupsListResultPage contains a page of DistributedAvailabilityGroup values. +type DistributedAvailabilityGroupsListResultPage struct { + fn func(context.Context, DistributedAvailabilityGroupsListResult) (DistributedAvailabilityGroupsListResult, error) + daglr DistributedAvailabilityGroupsListResult +} + +// 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 *DistributedAvailabilityGroupsListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DistributedAvailabilityGroupsListResultPage.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.daglr) + if err != nil { + return err + } + page.daglr = 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 *DistributedAvailabilityGroupsListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DistributedAvailabilityGroupsListResultPage) NotDone() bool { + return !page.daglr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DistributedAvailabilityGroupsListResultPage) Response() DistributedAvailabilityGroupsListResult { + return page.daglr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DistributedAvailabilityGroupsListResultPage) Values() []DistributedAvailabilityGroup { + if page.daglr.IsEmpty() { + return nil + } + return *page.daglr.Value +} + +// Creates a new instance of the DistributedAvailabilityGroupsListResultPage type. +func NewDistributedAvailabilityGroupsListResultPage(cur DistributedAvailabilityGroupsListResult, getNextPage func(context.Context, DistributedAvailabilityGroupsListResult) (DistributedAvailabilityGroupsListResult, error)) DistributedAvailabilityGroupsListResultPage { + return DistributedAvailabilityGroupsListResultPage{ + fn: getNextPage, + daglr: cur, + } +} + +// DistributedAvailabilityGroupsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DistributedAvailabilityGroupsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DistributedAvailabilityGroupsClient) (DistributedAvailabilityGroup, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DistributedAvailabilityGroupsUpdateFuture) 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 DistributedAvailabilityGroupsUpdateFuture.Result. +func (future *DistributedAvailabilityGroupsUpdateFuture) result(client DistributedAvailabilityGroupsClient) (dag DistributedAvailabilityGroup, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DistributedAvailabilityGroupsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dag.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.DistributedAvailabilityGroupsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dag.Response.Response, err = future.GetResult(sender); err == nil && dag.Response.Response.StatusCode != http.StatusNoContent { + dag, err = client.UpdateResponder(dag.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DistributedAvailabilityGroupsUpdateFuture", "Result", dag.Response.Response, "Failure responding to request") + } + } + return +} + +// DNSRefreshConfigurationProperties DNS refresh configuration properties. +type DNSRefreshConfigurationProperties struct { + // Status - READ-ONLY; The status of the DNS refresh operation. Possible values include: 'Status1Succeeded', 'Status1Failed' + Status Status1 `json:"status,omitempty"` +} + +// MarshalJSON is the custom marshaler for DNSRefreshConfigurationProperties. +func (drcp DNSRefreshConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// EditionCapability the edition capability. +type EditionCapability struct { + // Name - READ-ONLY; The database edition name. + Name *string `json:"name,omitempty"` + // SupportedServiceLevelObjectives - READ-ONLY; The list of supported service objectives for the edition. + SupportedServiceLevelObjectives *[]ServiceObjectiveCapability `json:"supportedServiceLevelObjectives,omitempty"` + // ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the edition. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` + // ReadScale - READ-ONLY; The read scale capability for the edition. + ReadScale *ReadScaleCapability `json:"readScale,omitempty"` + // SupportedStorageCapabilities - READ-ONLY; The list of supported storage capabilities for this edition + SupportedStorageCapabilities *[]StorageCapability `json:"supportedStorageCapabilities,omitempty"` + // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' + Status CapabilityStatus `json:"status,omitempty"` + // Reason - The reason for the capability not being available. + Reason *string `json:"reason,omitempty"` +} + +// MarshalJSON is the custom marshaler for EditionCapability. +func (ec EditionCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ec.Reason != nil { + objectMap["reason"] = ec.Reason + } + return json.Marshal(objectMap) +} + +// ElasticPool an elastic pool. +type ElasticPool struct { + autorest.Response `json:"-"` + // Sku - The elastic pool SKU. + // + // The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or the following command: + // + // ```azurecli + // az sql elastic-pool list-editions -l -o table + // ```` + Sku *Sku `json:"sku,omitempty"` + // Kind - READ-ONLY; Kind of elastic pool. This is metadata used for the Azure portal experience. + Kind *string `json:"kind,omitempty"` + // ElasticPoolProperties - Resource properties. + *ElasticPoolProperties `json:"properties,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ElasticPool. +func (ep ElasticPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ep.Sku != nil { + objectMap["sku"] = ep.Sku + } + if ep.ElasticPoolProperties != nil { + objectMap["properties"] = ep.ElasticPoolProperties + } + if ep.Location != nil { + objectMap["location"] = ep.Location + } + if ep.Tags != nil { + objectMap["tags"] = ep.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ElasticPool struct. +func (ep *ElasticPool) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + ep.Sku = &sku + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ep.Kind = &kind + } + case "properties": + if v != nil { + var elasticPoolProperties ElasticPoolProperties + err = json.Unmarshal(*v, &elasticPoolProperties) + if err != nil { return err } ep.ElasticPoolProperties = &elasticPoolProperties @@ -6376,6 +7043,8 @@ type ElasticPoolProperties struct { LicenseType ElasticPoolLicenseType `json:"licenseType,omitempty"` // MaintenanceConfigurationID - Maintenance configuration id assigned to the elastic pool. This configuration defines the period when the maintenance updates will will occur. MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"` + // HighAvailabilityReplicaCount - The number of secondary replicas associated with the elastic pool that are used to provide high availability. + HighAvailabilityReplicaCount *int32 `json:"highAvailabilityReplicaCount,omitempty"` } // MarshalJSON is the custom marshaler for ElasticPoolProperties. @@ -6396,6 +7065,9 @@ func (epp ElasticPoolProperties) MarshalJSON() ([]byte, error) { if epp.MaintenanceConfigurationID != nil { objectMap["maintenanceConfigurationId"] = epp.MaintenanceConfigurationID } + if epp.HighAvailabilityReplicaCount != nil { + objectMap["highAvailabilityReplicaCount"] = epp.HighAvailabilityReplicaCount + } return json.Marshal(objectMap) } @@ -6637,6 +7309,8 @@ type ElasticPoolUpdateProperties struct { LicenseType ElasticPoolLicenseType `json:"licenseType,omitempty"` // MaintenanceConfigurationID - Maintenance configuration id assigned to the elastic pool. This configuration defines the period when the maintenance updates will will occur. MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"` + // HighAvailabilityReplicaCount - The number of secondary replicas associated with the elastic pool that are used to provide high availability. Applicable only to Hyperscale elastic pools. + HighAvailabilityReplicaCount *int32 `json:"highAvailabilityReplicaCount,omitempty"` } // EncryptionProtector the server encryption protector. @@ -6951,64 +7625,309 @@ func (future *EncryptionProtectorsCreateOrUpdateFuture) UnmarshalJSON(body []byt return nil } -// result is the default implementation for EncryptionProtectorsCreateOrUpdateFuture.Result. -func (future *EncryptionProtectorsCreateOrUpdateFuture) result(client EncryptionProtectorsClient) (ep EncryptionProtector, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ep.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("sql.EncryptionProtectorsCreateOrUpdateFuture") - return +// result is the default implementation for EncryptionProtectorsCreateOrUpdateFuture.Result. +func (future *EncryptionProtectorsCreateOrUpdateFuture) result(client EncryptionProtectorsClient) (ep EncryptionProtector, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ep.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.EncryptionProtectorsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent { + ep, err = client.CreateOrUpdateResponder(ep.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsCreateOrUpdateFuture", "Result", ep.Response.Response, "Failure responding to request") + } + } + return +} + +// EncryptionProtectorsRevalidateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type EncryptionProtectorsRevalidateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(EncryptionProtectorsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *EncryptionProtectorsRevalidateFuture) 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 EncryptionProtectorsRevalidateFuture.Result. +func (future *EncryptionProtectorsRevalidateFuture) result(client EncryptionProtectorsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsRevalidateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.EncryptionProtectorsRevalidateFuture") + return + } + ar.Response = future.Response() + return +} + +// EndpointCertificate certificate used on an endpoint on the Managed Instance. +type EndpointCertificate struct { + autorest.Response `json:"-"` + // EndpointCertificateProperties - Resource properties. + *EndpointCertificateProperties `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 EndpointCertificate. +func (ec EndpointCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ec.EndpointCertificateProperties != nil { + objectMap["properties"] = ec.EndpointCertificateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for EndpointCertificate struct. +func (ec *EndpointCertificate) 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 endpointCertificateProperties EndpointCertificateProperties + err = json.Unmarshal(*v, &endpointCertificateProperties) + if err != nil { + return err + } + ec.EndpointCertificateProperties = &endpointCertificateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ec.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ec.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ec.Type = &typeVar + } + } + } + + return nil +} + +// EndpointCertificateListResult a list of endpoint certificates on the target instance. +type EndpointCertificateListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]EndpointCertificate `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for EndpointCertificateListResult. +func (eclr EndpointCertificateListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// EndpointCertificateListResultIterator provides access to a complete listing of EndpointCertificate +// values. +type EndpointCertificateListResultIterator struct { + i int + page EndpointCertificateListResultPage +} + +// 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 *EndpointCertificateListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointCertificateListResultIterator.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 *EndpointCertificateListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EndpointCertificateListResultIterator) 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 EndpointCertificateListResultIterator) Response() EndpointCertificateListResult { + 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 EndpointCertificateListResultIterator) Value() EndpointCertificate { + if !iter.page.NotDone() { + return EndpointCertificate{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EndpointCertificateListResultIterator type. +func NewEndpointCertificateListResultIterator(page EndpointCertificateListResultPage) EndpointCertificateListResultIterator { + return EndpointCertificateListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (eclr EndpointCertificateListResult) IsEmpty() bool { + return eclr.Value == nil || len(*eclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (eclr EndpointCertificateListResult) hasNextLink() bool { + return eclr.NextLink != nil && len(*eclr.NextLink) != 0 +} + +// endpointCertificateListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (eclr EndpointCertificateListResult) endpointCertificateListResultPreparer(ctx context.Context) (*http.Request, error) { + if !eclr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(eclr.NextLink))) +} + +// EndpointCertificateListResultPage contains a page of EndpointCertificate values. +type EndpointCertificateListResultPage struct { + fn func(context.Context, EndpointCertificateListResult) (EndpointCertificateListResult, error) + eclr EndpointCertificateListResult +} + +// 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 *EndpointCertificateListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointCertificateListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent { - ep, err = client.CreateOrUpdateResponder(ep.Response.Response) + for { + next, err := page.fn(ctx, page.eclr) if err != nil { - err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsCreateOrUpdateFuture", "Result", ep.Response.Response, "Failure responding to request") + return err + } + page.eclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break } } - return + return nil } -// EncryptionProtectorsRevalidateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type EncryptionProtectorsRevalidateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(EncryptionProtectorsClient) (autorest.Response, error) +// 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 *EndpointCertificateListResultPage) Next() error { + return page.NextWithContext(context.Background()) } -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *EncryptionProtectorsRevalidateFuture) 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 +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EndpointCertificateListResultPage) NotDone() bool { + return !page.eclr.IsEmpty() } -// result is the default implementation for EncryptionProtectorsRevalidateFuture.Result. -func (future *EncryptionProtectorsRevalidateFuture) result(client EncryptionProtectorsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsRevalidateFuture", "Result", future.Response(), "Polling failure") - return +// Response returns the raw server response from the last page request. +func (page EndpointCertificateListResultPage) Response() EndpointCertificateListResult { + return page.eclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EndpointCertificateListResultPage) Values() []EndpointCertificate { + if page.eclr.IsEmpty() { + return nil } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("sql.EncryptionProtectorsRevalidateFuture") - return + return *page.eclr.Value +} + +// Creates a new instance of the EndpointCertificateListResultPage type. +func NewEndpointCertificateListResultPage(cur EndpointCertificateListResult, getNextPage func(context.Context, EndpointCertificateListResult) (EndpointCertificateListResult, error)) EndpointCertificateListResultPage { + return EndpointCertificateListResultPage{ + fn: getNextPage, + eclr: cur, } - ar.Response = future.Response() - return +} + +// EndpointCertificateProperties the properties of an endpoint certificate. +type EndpointCertificateProperties struct { + // PublicBlob - The certificate public blob + PublicBlob *string `json:"publicBlob,omitempty"` } // ExportDatabaseDefinition contains the information necessary to perform export database operation. @@ -10018,52 +10937,301 @@ func (future *InstancePoolsUpdateFuture) result(client InstancePoolsClient) (IP err = azure.NewAsyncOpIncompleteError("sql.InstancePoolsUpdateFuture") return } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if IP.Response.Response, err = future.GetResult(sender); err == nil && IP.Response.Response.StatusCode != http.StatusNoContent { - IP, err = client.UpdateResponder(IP.Response.Response) + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if IP.Response.Response, err = future.GetResult(sender); err == nil && IP.Response.Response.StatusCode != http.StatusNoContent { + IP, err = client.UpdateResponder(IP.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.InstancePoolsUpdateFuture", "Result", IP.Response.Response, "Failure responding to request") + } + } + return +} + +// InstancePoolUpdate an update to an Instance pool. +type InstancePoolUpdate struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for InstancePoolUpdate. +func (ipu InstancePoolUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ipu.Tags != nil { + objectMap["tags"] = ipu.Tags + } + return json.Marshal(objectMap) +} + +// InstancePoolVcoresCapability the managed instance virtual cores capability. +type InstancePoolVcoresCapability struct { + // Name - READ-ONLY; The virtual cores identifier. + Name *string `json:"name,omitempty"` + // Value - READ-ONLY; The virtual cores value. + Value *int32 `json:"value,omitempty"` + // StorageLimit - READ-ONLY; Storage limit. + StorageLimit *MaxSizeCapability `json:"storageLimit,omitempty"` + // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' + Status CapabilityStatus `json:"status,omitempty"` + // Reason - The reason for the capability not being available. + Reason *string `json:"reason,omitempty"` +} + +// MarshalJSON is the custom marshaler for InstancePoolVcoresCapability. +func (ipvc InstancePoolVcoresCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ipvc.Reason != nil { + objectMap["reason"] = ipvc.Reason + } + return json.Marshal(objectMap) +} + +// IPv6FirewallRule an IPv6 server firewall rule. +type IPv6FirewallRule struct { + autorest.Response `json:"-"` + // IPv6ServerFirewallRuleProperties - Resource properties. + *IPv6ServerFirewallRuleProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IPv6FirewallRule. +func (ip6fr IPv6FirewallRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ip6fr.IPv6ServerFirewallRuleProperties != nil { + objectMap["properties"] = ip6fr.IPv6ServerFirewallRuleProperties + } + if ip6fr.Name != nil { + objectMap["name"] = ip6fr.Name + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IPv6FirewallRule struct. +func (ip6fr *IPv6FirewallRule) 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 iPv6ServerFirewallRuleProperties IPv6ServerFirewallRuleProperties + err = json.Unmarshal(*v, &iPv6ServerFirewallRuleProperties) + if err != nil { + return err + } + ip6fr.IPv6ServerFirewallRuleProperties = &iPv6ServerFirewallRuleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ip6fr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ip6fr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ip6fr.Type = &typeVar + } + } + } + + return nil +} + +// IPv6FirewallRuleListResult the response to a list IPv6 firewall rules request +type IPv6FirewallRuleListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]IPv6FirewallRule `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for IPv6FirewallRuleListResult. +func (ip6frlr IPv6FirewallRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// IPv6FirewallRuleListResultIterator provides access to a complete listing of IPv6FirewallRule values. +type IPv6FirewallRuleListResultIterator struct { + i int + page IPv6FirewallRuleListResultPage +} + +// 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 *IPv6FirewallRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IPv6FirewallRuleListResultIterator.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 *IPv6FirewallRuleListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IPv6FirewallRuleListResultIterator) 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 IPv6FirewallRuleListResultIterator) Response() IPv6FirewallRuleListResult { + 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 IPv6FirewallRuleListResultIterator) Value() IPv6FirewallRule { + if !iter.page.NotDone() { + return IPv6FirewallRule{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IPv6FirewallRuleListResultIterator type. +func NewIPv6FirewallRuleListResultIterator(page IPv6FirewallRuleListResultPage) IPv6FirewallRuleListResultIterator { + return IPv6FirewallRuleListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ip6frlr IPv6FirewallRuleListResult) IsEmpty() bool { + return ip6frlr.Value == nil || len(*ip6frlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ip6frlr IPv6FirewallRuleListResult) hasNextLink() bool { + return ip6frlr.NextLink != nil && len(*ip6frlr.NextLink) != 0 +} + +// iPv6FirewallRuleListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ip6frlr IPv6FirewallRuleListResult) iPv6FirewallRuleListResultPreparer(ctx context.Context) (*http.Request, error) { + if !ip6frlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ip6frlr.NextLink))) +} + +// IPv6FirewallRuleListResultPage contains a page of IPv6FirewallRule values. +type IPv6FirewallRuleListResultPage struct { + fn func(context.Context, IPv6FirewallRuleListResult) (IPv6FirewallRuleListResult, error) + ip6frlr IPv6FirewallRuleListResult +} + +// 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 *IPv6FirewallRuleListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IPv6FirewallRuleListResultPage.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.ip6frlr) if err != nil { - err = autorest.NewErrorWithError(err, "sql.InstancePoolsUpdateFuture", "Result", IP.Response.Response, "Failure responding to request") + return err + } + page.ip6frlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break } } - return + return nil } -// InstancePoolUpdate an update to an Instance pool. -type InstancePoolUpdate struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` +// 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 *IPv6FirewallRuleListResultPage) Next() error { + return page.NextWithContext(context.Background()) } -// MarshalJSON is the custom marshaler for InstancePoolUpdate. -func (ipu InstancePoolUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ipu.Tags != nil { - objectMap["tags"] = ipu.Tags - } - return json.Marshal(objectMap) +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IPv6FirewallRuleListResultPage) NotDone() bool { + return !page.ip6frlr.IsEmpty() } -// InstancePoolVcoresCapability the managed instance virtual cores capability. -type InstancePoolVcoresCapability struct { - // Name - READ-ONLY; The virtual cores identifier. - Name *string `json:"name,omitempty"` - // Value - READ-ONLY; The virtual cores value. - Value *int32 `json:"value,omitempty"` - // StorageLimit - READ-ONLY; Storage limit. - StorageLimit *MaxSizeCapability `json:"storageLimit,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` +// Response returns the raw server response from the last page request. +func (page IPv6FirewallRuleListResultPage) Response() IPv6FirewallRuleListResult { + return page.ip6frlr } -// MarshalJSON is the custom marshaler for InstancePoolVcoresCapability. -func (ipvc InstancePoolVcoresCapability) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ipvc.Reason != nil { - objectMap["reason"] = ipvc.Reason +// Values returns the slice of values for the current page or nil if there are no values. +func (page IPv6FirewallRuleListResultPage) Values() []IPv6FirewallRule { + if page.ip6frlr.IsEmpty() { + return nil } - return json.Marshal(objectMap) + return *page.ip6frlr.Value +} + +// Creates a new instance of the IPv6FirewallRuleListResultPage type. +func NewIPv6FirewallRuleListResultPage(cur IPv6FirewallRuleListResult, getNextPage func(context.Context, IPv6FirewallRuleListResult) (IPv6FirewallRuleListResult, error)) IPv6FirewallRuleListResultPage { + return IPv6FirewallRuleListResultPage{ + fn: getNextPage, + ip6frlr: cur, + } +} + +// IPv6ServerFirewallRuleProperties the properties of an IPv6 server firewall rule. +type IPv6ServerFirewallRuleProperties struct { + // StartIPv6Address - The start IP address of the firewall rule. Must be IPv6 format. + StartIPv6Address *string `json:"startIPv6Address,omitempty"` + // EndIPv6Address - The end IP address of the firewall rule. Must be IPv6 format. Must be greater than or equal to startIpAddress. + EndIPv6Address *string `json:"endIPv6Address,omitempty"` } // Job a job. @@ -11794,28 +12962,216 @@ func (jtg *JobTargetGroup) UnmarshalJSON(body []byte) error { type JobTargetGroupListResult struct { autorest.Response `json:"-"` // Value - READ-ONLY; Array of results. - Value *[]JobTargetGroup `json:"value,omitempty"` + Value *[]JobTargetGroup `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobTargetGroupListResult. +func (jtglr JobTargetGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// JobTargetGroupListResultIterator provides access to a complete listing of JobTargetGroup values. +type JobTargetGroupListResultIterator struct { + i int + page JobTargetGroupListResultPage +} + +// 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 *JobTargetGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetGroupListResultIterator.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 *JobTargetGroupListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobTargetGroupListResultIterator) 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 JobTargetGroupListResultIterator) Response() JobTargetGroupListResult { + 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 JobTargetGroupListResultIterator) Value() JobTargetGroup { + if !iter.page.NotDone() { + return JobTargetGroup{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the JobTargetGroupListResultIterator type. +func NewJobTargetGroupListResultIterator(page JobTargetGroupListResultPage) JobTargetGroupListResultIterator { + return JobTargetGroupListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (jtglr JobTargetGroupListResult) IsEmpty() bool { + return jtglr.Value == nil || len(*jtglr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (jtglr JobTargetGroupListResult) hasNextLink() bool { + return jtglr.NextLink != nil && len(*jtglr.NextLink) != 0 +} + +// jobTargetGroupListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jtglr JobTargetGroupListResult) jobTargetGroupListResultPreparer(ctx context.Context) (*http.Request, error) { + if !jtglr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jtglr.NextLink))) +} + +// JobTargetGroupListResultPage contains a page of JobTargetGroup values. +type JobTargetGroupListResultPage struct { + fn func(context.Context, JobTargetGroupListResult) (JobTargetGroupListResult, error) + jtglr JobTargetGroupListResult +} + +// 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 *JobTargetGroupListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetGroupListResultPage.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.jtglr) + if err != nil { + return err + } + page.jtglr = 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 *JobTargetGroupListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobTargetGroupListResultPage) NotDone() bool { + return !page.jtglr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobTargetGroupListResultPage) Response() JobTargetGroupListResult { + return page.jtglr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobTargetGroupListResultPage) Values() []JobTargetGroup { + if page.jtglr.IsEmpty() { + return nil + } + return *page.jtglr.Value +} + +// Creates a new instance of the JobTargetGroupListResultPage type. +func NewJobTargetGroupListResultPage(cur JobTargetGroupListResult, getNextPage func(context.Context, JobTargetGroupListResult) (JobTargetGroupListResult, error)) JobTargetGroupListResultPage { + return JobTargetGroupListResultPage{ + fn: getNextPage, + jtglr: cur, + } +} + +// JobTargetGroupProperties properties of job target group. +type JobTargetGroupProperties struct { + // Members - Members of the target group. + Members *[]JobTarget `json:"members,omitempty"` +} + +// JobVersion a job version. +type JobVersion struct { + autorest.Response `json:"-"` + // 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 JobVersion. +func (jv JobVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// JobVersionListResult a list of job versions. +type JobVersionListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]JobVersion `json:"value,omitempty"` // NextLink - READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for JobTargetGroupListResult. -func (jtglr JobTargetGroupListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for JobVersionListResult. +func (jvlr JobVersionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) return json.Marshal(objectMap) } -// JobTargetGroupListResultIterator provides access to a complete listing of JobTargetGroup values. -type JobTargetGroupListResultIterator struct { +// JobVersionListResultIterator provides access to a complete listing of JobVersion values. +type JobVersionListResultIterator struct { i int - page JobTargetGroupListResultPage + page JobVersionListResultPage } // 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 *JobTargetGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *JobVersionListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetGroupListResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/JobVersionListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -11840,67 +13196,67 @@ func (iter *JobTargetGroupListResultIterator) NextWithContext(ctx context.Contex // 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 *JobTargetGroupListResultIterator) Next() error { +func (iter *JobVersionListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter JobTargetGroupListResultIterator) NotDone() bool { +func (iter JobVersionListResultIterator) 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 JobTargetGroupListResultIterator) Response() JobTargetGroupListResult { +func (iter JobVersionListResultIterator) Response() JobVersionListResult { 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 JobTargetGroupListResultIterator) Value() JobTargetGroup { +func (iter JobVersionListResultIterator) Value() JobVersion { if !iter.page.NotDone() { - return JobTargetGroup{} + return JobVersion{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the JobTargetGroupListResultIterator type. -func NewJobTargetGroupListResultIterator(page JobTargetGroupListResultPage) JobTargetGroupListResultIterator { - return JobTargetGroupListResultIterator{page: page} +// Creates a new instance of the JobVersionListResultIterator type. +func NewJobVersionListResultIterator(page JobVersionListResultPage) JobVersionListResultIterator { + return JobVersionListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (jtglr JobTargetGroupListResult) IsEmpty() bool { - return jtglr.Value == nil || len(*jtglr.Value) == 0 +func (jvlr JobVersionListResult) IsEmpty() bool { + return jvlr.Value == nil || len(*jvlr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (jtglr JobTargetGroupListResult) hasNextLink() bool { - return jtglr.NextLink != nil && len(*jtglr.NextLink) != 0 +func (jvlr JobVersionListResult) hasNextLink() bool { + return jvlr.NextLink != nil && len(*jvlr.NextLink) != 0 } -// jobTargetGroupListResultPreparer prepares a request to retrieve the next set of results. +// jobVersionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (jtglr JobTargetGroupListResult) jobTargetGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !jtglr.hasNextLink() { +func (jvlr JobVersionListResult) jobVersionListResultPreparer(ctx context.Context) (*http.Request, error) { + if !jvlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(jtglr.NextLink))) + autorest.WithBaseURL(to.String(jvlr.NextLink))) } -// JobTargetGroupListResultPage contains a page of JobTargetGroup values. -type JobTargetGroupListResultPage struct { - fn func(context.Context, JobTargetGroupListResult) (JobTargetGroupListResult, error) - jtglr JobTargetGroupListResult +// JobVersionListResultPage contains a page of JobVersion values. +type JobVersionListResultPage struct { + fn func(context.Context, JobVersionListResult) (JobVersionListResult, error) + jvlr JobVersionListResult } // 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 *JobTargetGroupListResultPage) NextWithContext(ctx context.Context) (err error) { +func (page *JobVersionListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetGroupListResultPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/JobVersionListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -11910,11 +13266,11 @@ func (page *JobTargetGroupListResultPage) NextWithContext(ctx context.Context) ( }() } for { - next, err := page.fn(ctx, page.jtglr) + next, err := page.fn(ctx, page.jvlr) if err != nil { return err } - page.jtglr = next + page.jvlr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -11925,45 +13281,41 @@ func (page *JobTargetGroupListResultPage) NextWithContext(ctx context.Context) ( // 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 *JobTargetGroupListResultPage) Next() error { +func (page *JobVersionListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page JobTargetGroupListResultPage) NotDone() bool { - return !page.jtglr.IsEmpty() +func (page JobVersionListResultPage) NotDone() bool { + return !page.jvlr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page JobTargetGroupListResultPage) Response() JobTargetGroupListResult { - return page.jtglr +func (page JobVersionListResultPage) Response() JobVersionListResult { + return page.jvlr } // Values returns the slice of values for the current page or nil if there are no values. -func (page JobTargetGroupListResultPage) Values() []JobTargetGroup { - if page.jtglr.IsEmpty() { +func (page JobVersionListResultPage) Values() []JobVersion { + if page.jvlr.IsEmpty() { return nil } - return *page.jtglr.Value + return *page.jvlr.Value } -// Creates a new instance of the JobTargetGroupListResultPage type. -func NewJobTargetGroupListResultPage(cur JobTargetGroupListResult, getNextPage func(context.Context, JobTargetGroupListResult) (JobTargetGroupListResult, error)) JobTargetGroupListResultPage { - return JobTargetGroupListResultPage{ - fn: getNextPage, - jtglr: cur, +// Creates a new instance of the JobVersionListResultPage type. +func NewJobVersionListResultPage(cur JobVersionListResult, getNextPage func(context.Context, JobVersionListResult) (JobVersionListResult, error)) JobVersionListResultPage { + return JobVersionListResultPage{ + fn: getNextPage, + jvlr: cur, } } -// JobTargetGroupProperties properties of job target group. -type JobTargetGroupProperties struct { - // Members - Members of the target group. - Members *[]JobTarget `json:"members,omitempty"` -} - -// JobVersion a job version. -type JobVersion struct { +// LedgerDigestUploads azure SQL Database ledger digest upload settings. +type LedgerDigestUploads struct { autorest.Response `json:"-"` + // LedgerDigestUploadsProperties - Resource properties. + *LedgerDigestUploadsProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -11972,38 +13324,179 @@ type JobVersion struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for JobVersion. -func (jv JobVersion) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for LedgerDigestUploads. +func (ldu LedgerDigestUploads) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if ldu.LedgerDigestUploadsProperties != nil { + objectMap["properties"] = ldu.LedgerDigestUploadsProperties + } return json.Marshal(objectMap) } -// JobVersionListResult a list of job versions. -type JobVersionListResult struct { +// UnmarshalJSON is the custom unmarshaler for LedgerDigestUploads struct. +func (ldu *LedgerDigestUploads) 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 ledgerDigestUploadsProperties LedgerDigestUploadsProperties + err = json.Unmarshal(*v, &ledgerDigestUploadsProperties) + if err != nil { + return err + } + ldu.LedgerDigestUploadsProperties = &ledgerDigestUploadsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ldu.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ldu.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ldu.Type = &typeVar + } + } + } + + return nil +} + +// LedgerDigestUploadsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type LedgerDigestUploadsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LedgerDigestUploadsClient) (LedgerDigestUploads, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LedgerDigestUploadsCreateOrUpdateFuture) 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 LedgerDigestUploadsCreateOrUpdateFuture.Result. +func (future *LedgerDigestUploadsCreateOrUpdateFuture) result(client LedgerDigestUploadsClient) (ldu LedgerDigestUploads, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LedgerDigestUploadsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ldu.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.LedgerDigestUploadsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ldu.Response.Response, err = future.GetResult(sender); err == nil && ldu.Response.Response.StatusCode != http.StatusNoContent { + ldu, err = client.CreateOrUpdateResponder(ldu.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LedgerDigestUploadsCreateOrUpdateFuture", "Result", ldu.Response.Response, "Failure responding to request") + } + } + return +} + +// LedgerDigestUploadsDisableFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type LedgerDigestUploadsDisableFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LedgerDigestUploadsClient) (LedgerDigestUploads, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LedgerDigestUploadsDisableFuture) 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 LedgerDigestUploadsDisableFuture.Result. +func (future *LedgerDigestUploadsDisableFuture) result(client LedgerDigestUploadsClient) (ldu LedgerDigestUploads, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LedgerDigestUploadsDisableFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ldu.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.LedgerDigestUploadsDisableFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ldu.Response.Response, err = future.GetResult(sender); err == nil && ldu.Response.Response.StatusCode != http.StatusNoContent { + ldu, err = client.DisableResponder(ldu.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.LedgerDigestUploadsDisableFuture", "Result", ldu.Response.Response, "Failure responding to request") + } + } + return +} + +// LedgerDigestUploadsListResult a list of ledger digest upload settings. +type LedgerDigestUploadsListResult struct { autorest.Response `json:"-"` // Value - READ-ONLY; Array of results. - Value *[]JobVersion `json:"value,omitempty"` + Value *[]LedgerDigestUploads `json:"value,omitempty"` // NextLink - READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for JobVersionListResult. -func (jvlr JobVersionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for LedgerDigestUploadsListResult. +func (ldulr LedgerDigestUploadsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) return json.Marshal(objectMap) } -// JobVersionListResultIterator provides access to a complete listing of JobVersion values. -type JobVersionListResultIterator struct { +// LedgerDigestUploadsListResultIterator provides access to a complete listing of LedgerDigestUploads +// values. +type LedgerDigestUploadsListResultIterator struct { i int - page JobVersionListResultPage + page LedgerDigestUploadsListResultPage } // 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 *JobVersionListResultIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *LedgerDigestUploadsListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobVersionListResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/LedgerDigestUploadsListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -12028,67 +13521,67 @@ func (iter *JobVersionListResultIterator) NextWithContext(ctx context.Context) ( // 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 *JobVersionListResultIterator) Next() error { +func (iter *LedgerDigestUploadsListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter JobVersionListResultIterator) NotDone() bool { +func (iter LedgerDigestUploadsListResultIterator) 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 JobVersionListResultIterator) Response() JobVersionListResult { +func (iter LedgerDigestUploadsListResultIterator) Response() LedgerDigestUploadsListResult { 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 JobVersionListResultIterator) Value() JobVersion { +func (iter LedgerDigestUploadsListResultIterator) Value() LedgerDigestUploads { if !iter.page.NotDone() { - return JobVersion{} + return LedgerDigestUploads{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the JobVersionListResultIterator type. -func NewJobVersionListResultIterator(page JobVersionListResultPage) JobVersionListResultIterator { - return JobVersionListResultIterator{page: page} +// Creates a new instance of the LedgerDigestUploadsListResultIterator type. +func NewLedgerDigestUploadsListResultIterator(page LedgerDigestUploadsListResultPage) LedgerDigestUploadsListResultIterator { + return LedgerDigestUploadsListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (jvlr JobVersionListResult) IsEmpty() bool { - return jvlr.Value == nil || len(*jvlr.Value) == 0 +func (ldulr LedgerDigestUploadsListResult) IsEmpty() bool { + return ldulr.Value == nil || len(*ldulr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (jvlr JobVersionListResult) hasNextLink() bool { - return jvlr.NextLink != nil && len(*jvlr.NextLink) != 0 +func (ldulr LedgerDigestUploadsListResult) hasNextLink() bool { + return ldulr.NextLink != nil && len(*ldulr.NextLink) != 0 } -// jobVersionListResultPreparer prepares a request to retrieve the next set of results. +// ledgerDigestUploadsListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (jvlr JobVersionListResult) jobVersionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !jvlr.hasNextLink() { +func (ldulr LedgerDigestUploadsListResult) ledgerDigestUploadsListResultPreparer(ctx context.Context) (*http.Request, error) { + if !ldulr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(jvlr.NextLink))) + autorest.WithBaseURL(to.String(ldulr.NextLink))) } -// JobVersionListResultPage contains a page of JobVersion values. -type JobVersionListResultPage struct { - fn func(context.Context, JobVersionListResult) (JobVersionListResult, error) - jvlr JobVersionListResult +// LedgerDigestUploadsListResultPage contains a page of LedgerDigestUploads values. +type LedgerDigestUploadsListResultPage struct { + fn func(context.Context, LedgerDigestUploadsListResult) (LedgerDigestUploadsListResult, error) + ldulr LedgerDigestUploadsListResult } // 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 *JobVersionListResultPage) NextWithContext(ctx context.Context) (err error) { +func (page *LedgerDigestUploadsListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobVersionListResultPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/LedgerDigestUploadsListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -12098,11 +13591,11 @@ func (page *JobVersionListResultPage) NextWithContext(ctx context.Context) (err }() } for { - next, err := page.fn(ctx, page.jvlr) + next, err := page.fn(ctx, page.ldulr) if err != nil { return err } - page.jvlr = next + page.ldulr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -12113,41 +13606,113 @@ func (page *JobVersionListResultPage) NextWithContext(ctx context.Context) (err // 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 *JobVersionListResultPage) Next() error { +func (page *LedgerDigestUploadsListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page JobVersionListResultPage) NotDone() bool { - return !page.jvlr.IsEmpty() +func (page LedgerDigestUploadsListResultPage) NotDone() bool { + return !page.ldulr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page JobVersionListResultPage) Response() JobVersionListResult { - return page.jvlr +func (page LedgerDigestUploadsListResultPage) Response() LedgerDigestUploadsListResult { + return page.ldulr } // Values returns the slice of values for the current page or nil if there are no values. -func (page JobVersionListResultPage) Values() []JobVersion { - if page.jvlr.IsEmpty() { +func (page LedgerDigestUploadsListResultPage) Values() []LedgerDigestUploads { + if page.ldulr.IsEmpty() { return nil } - return *page.jvlr.Value + return *page.ldulr.Value } -// Creates a new instance of the JobVersionListResultPage type. -func NewJobVersionListResultPage(cur JobVersionListResult, getNextPage func(context.Context, JobVersionListResult) (JobVersionListResult, error)) JobVersionListResultPage { - return JobVersionListResultPage{ - fn: getNextPage, - jvlr: cur, +// Creates a new instance of the LedgerDigestUploadsListResultPage type. +func NewLedgerDigestUploadsListResultPage(cur LedgerDigestUploadsListResult, getNextPage func(context.Context, LedgerDigestUploadsListResult) (LedgerDigestUploadsListResult, error)) LedgerDigestUploadsListResultPage { + return LedgerDigestUploadsListResultPage{ + fn: getNextPage, + ldulr: cur, } } -// LedgerDigestUploads azure SQL Database ledger digest upload settings. -type LedgerDigestUploads struct { +// LedgerDigestUploadsProperties the properties of a database ledger digest upload settings. +type LedgerDigestUploadsProperties struct { + // DigestStorageEndpoint - The digest storage endpoint, which must be either an Azure blob storage endpoint or an URI for Azure Confidential Ledger. + DigestStorageEndpoint *string `json:"digestStorageEndpoint,omitempty"` + // State - READ-ONLY; Specifies the state of ledger digest upload. Possible values include: 'LedgerDigestUploadsStateEnabled', 'LedgerDigestUploadsStateDisabled' + State LedgerDigestUploadsState `json:"state,omitempty"` +} + +// MarshalJSON is the custom marshaler for LedgerDigestUploadsProperties. +func (ldup LedgerDigestUploadsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ldup.DigestStorageEndpoint != nil { + objectMap["digestStorageEndpoint"] = ldup.DigestStorageEndpoint + } + return json.Marshal(objectMap) +} + +// LicenseTypeCapability the license type capability +type LicenseTypeCapability struct { + // Name - READ-ONLY; License type identifier. + Name *string `json:"name,omitempty"` + // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' + Status CapabilityStatus `json:"status,omitempty"` + // Reason - The reason for the capability not being available. + Reason *string `json:"reason,omitempty"` +} + +// MarshalJSON is the custom marshaler for LicenseTypeCapability. +func (ltc LicenseTypeCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ltc.Reason != nil { + objectMap["reason"] = ltc.Reason + } + return json.Marshal(objectMap) +} + +// ListAdvisor ... +type ListAdvisor struct { autorest.Response `json:"-"` - // LedgerDigestUploadsProperties - Resource properties. - *LedgerDigestUploadsProperties `json:"properties,omitempty"` + Value *[]Advisor `json:"value,omitempty"` +} + +// ListRecommendedAction ... +type ListRecommendedAction struct { + autorest.Response `json:"-"` + Value *[]RecommendedAction `json:"value,omitempty"` +} + +// LocationCapabilities the location capability. +type LocationCapabilities struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; The location name. + Name *string `json:"name,omitempty"` + // SupportedServerVersions - READ-ONLY; The list of supported server versions. + SupportedServerVersions *[]ServerVersionCapability `json:"supportedServerVersions,omitempty"` + // SupportedManagedInstanceVersions - READ-ONLY; The list of supported managed instance versions. + SupportedManagedInstanceVersions *[]ManagedInstanceVersionCapability `json:"supportedManagedInstanceVersions,omitempty"` + // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' + Status CapabilityStatus `json:"status,omitempty"` + // Reason - The reason for the capability not being available. + Reason *string `json:"reason,omitempty"` +} + +// MarshalJSON is the custom marshaler for LocationCapabilities. +func (lc LocationCapabilities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lc.Reason != nil { + objectMap["reason"] = lc.Reason + } + return json.Marshal(objectMap) +} + +// LogicalDatabaseTransparentDataEncryption a logical database transparent data encryption state. +type LogicalDatabaseTransparentDataEncryption struct { + autorest.Response `json:"-"` + // TransparentDataEncryptionProperties - Resource properties. + *TransparentDataEncryptionProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -12156,17 +13721,17 @@ type LedgerDigestUploads struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for LedgerDigestUploads. -func (ldu LedgerDigestUploads) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for LogicalDatabaseTransparentDataEncryption. +func (ldtde LogicalDatabaseTransparentDataEncryption) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ldu.LedgerDigestUploadsProperties != nil { - objectMap["properties"] = ldu.LedgerDigestUploadsProperties + if ldtde.TransparentDataEncryptionProperties != nil { + objectMap["properties"] = ldtde.TransparentDataEncryptionProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for LedgerDigestUploads struct. -func (ldu *LedgerDigestUploads) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for LogicalDatabaseTransparentDataEncryption struct. +func (ldtde *LogicalDatabaseTransparentDataEncryption) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -12176,12 +13741,12 @@ func (ldu *LedgerDigestUploads) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var ledgerDigestUploadsProperties LedgerDigestUploadsProperties - err = json.Unmarshal(*v, &ledgerDigestUploadsProperties) + var transparentDataEncryptionProperties TransparentDataEncryptionProperties + err = json.Unmarshal(*v, &transparentDataEncryptionProperties) if err != nil { return err } - ldu.LedgerDigestUploadsProperties = &ledgerDigestUploadsProperties + ldtde.TransparentDataEncryptionProperties = &transparentDataEncryptionProperties } case "id": if v != nil { @@ -12190,7 +13755,7 @@ func (ldu *LedgerDigestUploads) UnmarshalJSON(body []byte) error { if err != nil { return err } - ldu.ID = &ID + ldtde.ID = &ID } case "name": if v != nil { @@ -12199,7 +13764,7 @@ func (ldu *LedgerDigestUploads) UnmarshalJSON(body []byte) error { if err != nil { return err } - ldu.Name = &name + ldtde.Name = &name } case "type": if v != nil { @@ -12208,7 +13773,7 @@ func (ldu *LedgerDigestUploads) UnmarshalJSON(body []byte) error { if err != nil { return err } - ldu.Type = &typeVar + ldtde.Type = &typeVar } } } @@ -12216,33 +13781,33 @@ func (ldu *LedgerDigestUploads) UnmarshalJSON(body []byte) error { return nil } -// LedgerDigestUploadsListResult a list of ledger digest upload settings. -type LedgerDigestUploadsListResult struct { +// LogicalDatabaseTransparentDataEncryptionListResult a list of transparent data encryptions +type LogicalDatabaseTransparentDataEncryptionListResult struct { autorest.Response `json:"-"` // Value - READ-ONLY; Array of results. - Value *[]LedgerDigestUploads `json:"value,omitempty"` + Value *[]LogicalDatabaseTransparentDataEncryption `json:"value,omitempty"` // NextLink - READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for LedgerDigestUploadsListResult. -func (ldulr LedgerDigestUploadsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for LogicalDatabaseTransparentDataEncryptionListResult. +func (ldtdelr LogicalDatabaseTransparentDataEncryptionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) return json.Marshal(objectMap) } -// LedgerDigestUploadsListResultIterator provides access to a complete listing of LedgerDigestUploads -// values. -type LedgerDigestUploadsListResultIterator struct { +// LogicalDatabaseTransparentDataEncryptionListResultIterator provides access to a complete listing of +// LogicalDatabaseTransparentDataEncryption values. +type LogicalDatabaseTransparentDataEncryptionListResultIterator struct { i int - page LedgerDigestUploadsListResultPage + page LogicalDatabaseTransparentDataEncryptionListResultPage } // 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 *LedgerDigestUploadsListResultIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *LogicalDatabaseTransparentDataEncryptionListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LedgerDigestUploadsListResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/LogicalDatabaseTransparentDataEncryptionListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -12267,67 +13832,68 @@ func (iter *LedgerDigestUploadsListResultIterator) NextWithContext(ctx context.C // 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 *LedgerDigestUploadsListResultIterator) Next() error { +func (iter *LogicalDatabaseTransparentDataEncryptionListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LedgerDigestUploadsListResultIterator) NotDone() bool { +func (iter LogicalDatabaseTransparentDataEncryptionListResultIterator) 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 LedgerDigestUploadsListResultIterator) Response() LedgerDigestUploadsListResult { +func (iter LogicalDatabaseTransparentDataEncryptionListResultIterator) Response() LogicalDatabaseTransparentDataEncryptionListResult { 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 LedgerDigestUploadsListResultIterator) Value() LedgerDigestUploads { +func (iter LogicalDatabaseTransparentDataEncryptionListResultIterator) Value() LogicalDatabaseTransparentDataEncryption { if !iter.page.NotDone() { - return LedgerDigestUploads{} + return LogicalDatabaseTransparentDataEncryption{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the LedgerDigestUploadsListResultIterator type. -func NewLedgerDigestUploadsListResultIterator(page LedgerDigestUploadsListResultPage) LedgerDigestUploadsListResultIterator { - return LedgerDigestUploadsListResultIterator{page: page} +// Creates a new instance of the LogicalDatabaseTransparentDataEncryptionListResultIterator type. +func NewLogicalDatabaseTransparentDataEncryptionListResultIterator(page LogicalDatabaseTransparentDataEncryptionListResultPage) LogicalDatabaseTransparentDataEncryptionListResultIterator { + return LogicalDatabaseTransparentDataEncryptionListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (ldulr LedgerDigestUploadsListResult) IsEmpty() bool { - return ldulr.Value == nil || len(*ldulr.Value) == 0 +func (ldtdelr LogicalDatabaseTransparentDataEncryptionListResult) IsEmpty() bool { + return ldtdelr.Value == nil || len(*ldtdelr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (ldulr LedgerDigestUploadsListResult) hasNextLink() bool { - return ldulr.NextLink != nil && len(*ldulr.NextLink) != 0 +func (ldtdelr LogicalDatabaseTransparentDataEncryptionListResult) hasNextLink() bool { + return ldtdelr.NextLink != nil && len(*ldtdelr.NextLink) != 0 } -// ledgerDigestUploadsListResultPreparer prepares a request to retrieve the next set of results. +// logicalDatabaseTransparentDataEncryptionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (ldulr LedgerDigestUploadsListResult) ledgerDigestUploadsListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ldulr.hasNextLink() { +func (ldtdelr LogicalDatabaseTransparentDataEncryptionListResult) logicalDatabaseTransparentDataEncryptionListResultPreparer(ctx context.Context) (*http.Request, error) { + if !ldtdelr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(ldulr.NextLink))) + autorest.WithBaseURL(to.String(ldtdelr.NextLink))) } -// LedgerDigestUploadsListResultPage contains a page of LedgerDigestUploads values. -type LedgerDigestUploadsListResultPage struct { - fn func(context.Context, LedgerDigestUploadsListResult) (LedgerDigestUploadsListResult, error) - ldulr LedgerDigestUploadsListResult +// LogicalDatabaseTransparentDataEncryptionListResultPage contains a page of +// LogicalDatabaseTransparentDataEncryption values. +type LogicalDatabaseTransparentDataEncryptionListResultPage struct { + fn func(context.Context, LogicalDatabaseTransparentDataEncryptionListResult) (LogicalDatabaseTransparentDataEncryptionListResult, error) + ldtdelr LogicalDatabaseTransparentDataEncryptionListResult } // 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 *LedgerDigestUploadsListResultPage) NextWithContext(ctx context.Context) (err error) { +func (page *LogicalDatabaseTransparentDataEncryptionListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LedgerDigestUploadsListResultPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/LogicalDatabaseTransparentDataEncryptionListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -12337,121 +13903,49 @@ func (page *LedgerDigestUploadsListResultPage) NextWithContext(ctx context.Conte }() } for { - next, err := page.fn(ctx, page.ldulr) + next, err := page.fn(ctx, page.ldtdelr) if err != nil { return err - } - page.ldulr = 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 *LedgerDigestUploadsListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LedgerDigestUploadsListResultPage) NotDone() bool { - return !page.ldulr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page LedgerDigestUploadsListResultPage) Response() LedgerDigestUploadsListResult { - return page.ldulr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page LedgerDigestUploadsListResultPage) Values() []LedgerDigestUploads { - if page.ldulr.IsEmpty() { - return nil - } - return *page.ldulr.Value -} - -// Creates a new instance of the LedgerDigestUploadsListResultPage type. -func NewLedgerDigestUploadsListResultPage(cur LedgerDigestUploadsListResult, getNextPage func(context.Context, LedgerDigestUploadsListResult) (LedgerDigestUploadsListResult, error)) LedgerDigestUploadsListResultPage { - return LedgerDigestUploadsListResultPage{ - fn: getNextPage, - ldulr: cur, - } -} - -// LedgerDigestUploadsProperties the properties of a database ledger digest upload settings. -type LedgerDigestUploadsProperties struct { - // DigestStorageEndpoint - The digest storage endpoint, which must be either an Azure blob storage endpoint or an URI for Azure Confidential Ledger. - DigestStorageEndpoint *string `json:"digestStorageEndpoint,omitempty"` - // State - READ-ONLY; Specifies the state of ledger digest upload. Possible values include: 'LedgerDigestUploadsStateEnabled', 'LedgerDigestUploadsStateDisabled' - State LedgerDigestUploadsState `json:"state,omitempty"` -} - -// MarshalJSON is the custom marshaler for LedgerDigestUploadsProperties. -func (ldup LedgerDigestUploadsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ldup.DigestStorageEndpoint != nil { - objectMap["digestStorageEndpoint"] = ldup.DigestStorageEndpoint - } - return json.Marshal(objectMap) -} - -// LicenseTypeCapability the license type capability -type LicenseTypeCapability struct { - // Name - READ-ONLY; License type identifier. - Name *string `json:"name,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + } + page.ldtdelr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil } -// MarshalJSON is the custom marshaler for LicenseTypeCapability. -func (ltc LicenseTypeCapability) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ltc.Reason != nil { - objectMap["reason"] = ltc.Reason - } - return json.Marshal(objectMap) +// 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 *LogicalDatabaseTransparentDataEncryptionListResultPage) Next() error { + return page.NextWithContext(context.Background()) } -// ListAdvisor ... -type ListAdvisor struct { - autorest.Response `json:"-"` - Value *[]Advisor `json:"value,omitempty"` +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LogicalDatabaseTransparentDataEncryptionListResultPage) NotDone() bool { + return !page.ldtdelr.IsEmpty() } -// ListRecommendedAction ... -type ListRecommendedAction struct { - autorest.Response `json:"-"` - Value *[]RecommendedAction `json:"value,omitempty"` +// Response returns the raw server response from the last page request. +func (page LogicalDatabaseTransparentDataEncryptionListResultPage) Response() LogicalDatabaseTransparentDataEncryptionListResult { + return page.ldtdelr } -// LocationCapabilities the location capability. -type LocationCapabilities struct { - autorest.Response `json:"-"` - // Name - READ-ONLY; The location name. - Name *string `json:"name,omitempty"` - // SupportedServerVersions - READ-ONLY; The list of supported server versions. - SupportedServerVersions *[]ServerVersionCapability `json:"supportedServerVersions,omitempty"` - // SupportedManagedInstanceVersions - READ-ONLY; The list of supported managed instance versions. - SupportedManagedInstanceVersions *[]ManagedInstanceVersionCapability `json:"supportedManagedInstanceVersions,omitempty"` - // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' - Status CapabilityStatus `json:"status,omitempty"` - // Reason - The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` +// Values returns the slice of values for the current page or nil if there are no values. +func (page LogicalDatabaseTransparentDataEncryptionListResultPage) Values() []LogicalDatabaseTransparentDataEncryption { + if page.ldtdelr.IsEmpty() { + return nil + } + return *page.ldtdelr.Value } -// MarshalJSON is the custom marshaler for LocationCapabilities. -func (lc LocationCapabilities) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lc.Reason != nil { - objectMap["reason"] = lc.Reason +// Creates a new instance of the LogicalDatabaseTransparentDataEncryptionListResultPage type. +func NewLogicalDatabaseTransparentDataEncryptionListResultPage(cur LogicalDatabaseTransparentDataEncryptionListResult, getNextPage func(context.Context, LogicalDatabaseTransparentDataEncryptionListResult) (LogicalDatabaseTransparentDataEncryptionListResult, error)) LogicalDatabaseTransparentDataEncryptionListResultPage { + return LogicalDatabaseTransparentDataEncryptionListResultPage{ + fn: getNextPage, + ldtdelr: cur, } - return json.Marshal(objectMap) } // LogicalServerSecurityAlertPolicyListResult a list of the server's security alert policies. @@ -12960,9 +14454,9 @@ type LongTermRetentionBackupProperties struct { 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: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone' + // BackupStorageRedundancy - READ-ONLY; The storage redundancy type of the backup. Possible values include: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone', 'BackupStorageRedundancyGeoZone' BackupStorageRedundancy BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty"` - // RequestedBackupStorageRedundancy - The storage redundancy type of the backup. Possible values include: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone' + // RequestedBackupStorageRedundancy - The storage redundancy type of the backup. Possible values include: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone', 'BackupStorageRedundancyGeoZone' RequestedBackupStorageRedundancy BackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"` } @@ -13306,7 +14800,7 @@ type LongTermRetentionOperationResultProperties struct { 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: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone' + // TargetBackupStorageRedundancy - READ-ONLY; The storage redundancy type of the copied backup. Possible values include: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone', 'BackupStorageRedundancyGeoZone' TargetBackupStorageRedundancy BackupStorageRedundancy `json:"targetBackupStorageRedundancy,omitempty"` // Status - READ-ONLY; Operation status Status *string `json:"status,omitempty"` @@ -17061,7 +18555,7 @@ type ManagedInstanceLongTermRetentionBackupProperties struct { 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: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone' + // BackupStorageRedundancy - READ-ONLY; The storage redundancy type of the backup. Possible values include: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone', 'BackupStorageRedundancyGeoZone' BackupStorageRedundancy BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty"` } @@ -18275,7 +19769,7 @@ func (miplscsp ManagedInstancePrivateLinkServiceConnectionStateProperty) Marshal // ManagedInstanceProperties the properties of a managed instance. type ManagedInstanceProperties struct { - // ProvisioningState - READ-ONLY; Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Deleting', 'ProvisioningState1Updating', 'ProvisioningState1Unknown', 'ProvisioningState1Succeeded', 'ProvisioningState1Failed' + // ProvisioningState - READ-ONLY; Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Deleting', 'ProvisioningState1Updating', 'ProvisioningState1Unknown', 'ProvisioningState1Succeeded', 'ProvisioningState1Failed', 'ProvisioningState1Accepted', 'ProvisioningState1Created', 'ProvisioningState1Deleted', 'ProvisioningState1Unrecognized', 'ProvisioningState1Running', 'ProvisioningState1Canceled', 'ProvisioningState1NotSpecified', 'ProvisioningState1Registering', 'ProvisioningState1TimedOut' ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"` // ManagedInstanceCreateMode - Specifies the mode of database creation. // @@ -18328,8 +19822,10 @@ type ManagedInstanceProperties struct { 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: 'StorageAccountTypeGRS', 'StorageAccountTypeLRS', 'StorageAccountTypeZRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` + // CurrentBackupStorageRedundancy - READ-ONLY; The storage account type used to store backups for this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). Possible values include: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone', 'BackupStorageRedundancyGeoZone' + CurrentBackupStorageRedundancy BackupStorageRedundancy `json:"currentBackupStorageRedundancy,omitempty"` + // RequestedBackupStorageRedundancy - The storage account type to be used to store backups for this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). Possible values include: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone', 'BackupStorageRedundancyGeoZone' + RequestedBackupStorageRedundancy BackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"` // ZoneRedundant - Whether or not the multi-az is enabled. ZoneRedundant *bool `json:"zoneRedundant,omitempty"` // PrimaryUserAssignedIdentityID - The resource id of a user assigned identity to be used by default. @@ -18338,6 +19834,8 @@ type ManagedInstanceProperties struct { KeyID *string `json:"keyId,omitempty"` // Administrators - The Azure Active Directory administrator of the server. Administrators *ManagedInstanceExternalAdministrator `json:"administrators,omitempty"` + // ServicePrincipal - The managed instance's service principal. + ServicePrincipal *ServicePrincipal `json:"servicePrincipal,omitempty"` } // MarshalJSON is the custom marshaler for ManagedInstanceProperties. @@ -18394,8 +19892,8 @@ func (mip ManagedInstanceProperties) MarshalJSON() ([]byte, error) { if mip.MinimalTLSVersion != nil { objectMap["minimalTlsVersion"] = mip.MinimalTLSVersion } - if mip.StorageAccountType != "" { - objectMap["storageAccountType"] = mip.StorageAccountType + if mip.RequestedBackupStorageRedundancy != "" { + objectMap["requestedBackupStorageRedundancy"] = mip.RequestedBackupStorageRedundancy } if mip.ZoneRedundant != nil { objectMap["zoneRedundant"] = mip.ZoneRedundant @@ -18409,6 +19907,9 @@ func (mip ManagedInstanceProperties) MarshalJSON() ([]byte, error) { if mip.Administrators != nil { objectMap["administrators"] = mip.Administrators } + if mip.ServicePrincipal != nil { + objectMap["servicePrincipal"] = mip.ServicePrincipal + } return json.Marshal(objectMap) } @@ -20175,275 +21676,38 @@ func NewOperationListResultIterator(page OperationListResultPage) OperationListR } // IsEmpty returns true if the ListResult contains no values. -func (olr OperationListResult) IsEmpty() bool { - return olr.Value == nil || len(*olr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (olr OperationListResult) hasNextLink() bool { - return olr.NextLink != nil && len(*olr.NextLink) != 0 -} - -// operationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !olr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(olr.NextLink))) -} - -// OperationListResultPage contains a page of Operation values. -type OperationListResultPage struct { - fn func(context.Context, OperationListResult) (OperationListResult, error) - olr OperationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.olr) - if err != nil { - return err - } - page.olr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *OperationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page OperationListResultPage) NotDone() bool { - return !page.olr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page OperationListResultPage) Response() OperationListResult { - return page.olr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page OperationListResultPage) Values() []Operation { - if page.olr.IsEmpty() { - return nil - } - return *page.olr.Value -} - -// Creates a new instance of the OperationListResultPage type. -func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { - return OperationListResultPage{ - fn: getNextPage, - olr: cur, - } -} - -// OperationsHealth operations health status in a location. -type OperationsHealth struct { - // OperationsHealthProperties - Resource properties. - *OperationsHealthProperties `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 OperationsHealth. -func (oh OperationsHealth) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if oh.OperationsHealthProperties != nil { - objectMap["properties"] = oh.OperationsHealthProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for OperationsHealth struct. -func (oh *OperationsHealth) 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 operationsHealthProperties OperationsHealthProperties - err = json.Unmarshal(*v, &operationsHealthProperties) - if err != nil { - return err - } - oh.OperationsHealthProperties = &operationsHealthProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - oh.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - oh.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - oh.Type = &typeVar - } - } - } - - return nil -} - -// OperationsHealthListResult a list of service health statuses in a location. -type OperationsHealthListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]OperationsHealth `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationsHealthListResult. -func (ohlr OperationsHealthListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// OperationsHealthListResultIterator provides access to a complete listing of OperationsHealth values. -type OperationsHealthListResultIterator struct { - i int - page OperationsHealthListResultPage -} - -// 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 *OperationsHealthListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsHealthListResultIterator.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 *OperationsHealthListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter OperationsHealthListResultIterator) 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 OperationsHealthListResultIterator) Response() OperationsHealthListResult { - 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 OperationsHealthListResultIterator) Value() OperationsHealth { - if !iter.page.NotDone() { - return OperationsHealth{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the OperationsHealthListResultIterator type. -func NewOperationsHealthListResultIterator(page OperationsHealthListResultPage) OperationsHealthListResultIterator { - return OperationsHealthListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ohlr OperationsHealthListResult) IsEmpty() bool { - return ohlr.Value == nil || len(*ohlr.Value) == 0 +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (ohlr OperationsHealthListResult) hasNextLink() bool { - return ohlr.NextLink != nil && len(*ohlr.NextLink) != 0 +func (olr OperationListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 } -// operationsHealthListResultPreparer prepares a request to retrieve the next set of results. +// operationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (ohlr OperationsHealthListResult) operationsHealthListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ohlr.hasNextLink() { +func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !olr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(ohlr.NextLink))) + autorest.WithBaseURL(to.String(olr.NextLink))) } -// OperationsHealthListResultPage contains a page of OperationsHealth values. -type OperationsHealthListResultPage struct { - fn func(context.Context, OperationsHealthListResult) (OperationsHealthListResult, error) - ohlr OperationsHealthListResult +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(context.Context, OperationListResult) (OperationListResult, error) + olr OperationListResult } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *OperationsHealthListResultPage) NextWithContext(ctx context.Context) (err error) { +func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsHealthListResultPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -20453,11 +21717,11 @@ func (page *OperationsHealthListResultPage) NextWithContext(ctx context.Context) }() } for { - next, err := page.fn(ctx, page.ohlr) + next, err := page.fn(ctx, page.olr) if err != nil { return err } - page.ohlr = next + page.olr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -20468,52 +21732,36 @@ func (page *OperationsHealthListResultPage) NextWithContext(ctx context.Context) // 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 *OperationsHealthListResultPage) Next() error { +func (page *OperationListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page OperationsHealthListResultPage) NotDone() bool { - return !page.ohlr.IsEmpty() +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page OperationsHealthListResultPage) Response() OperationsHealthListResult { - return page.ohlr +func (page OperationListResultPage) Response() OperationListResult { + return page.olr } // Values returns the slice of values for the current page or nil if there are no values. -func (page OperationsHealthListResultPage) Values() []OperationsHealth { - if page.ohlr.IsEmpty() { +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { return nil } - return *page.ohlr.Value + return *page.olr.Value } -// Creates a new instance of the OperationsHealthListResultPage type. -func NewOperationsHealthListResultPage(cur OperationsHealthListResult, getNextPage func(context.Context, OperationsHealthListResult) (OperationsHealthListResult, error)) OperationsHealthListResultPage { - return OperationsHealthListResultPage{ - fn: getNextPage, - ohlr: cur, +// Creates a new instance of the OperationListResultPage type. +func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{ + fn: getNextPage, + olr: cur, } } -// OperationsHealthProperties properties of an operation health. -type OperationsHealthProperties struct { - // Name - READ-ONLY; Operation name for the service - Name *string `json:"name,omitempty"` - // Health - READ-ONLY; Operation health status of the service. - Health *string `json:"health,omitempty"` - // Description - READ-ONLY; Health status description. - Description *string `json:"description,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationsHealthProperties. -func (ohp OperationsHealthProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - // OutboundFirewallRule an Azure SQL DB Server Outbound Firewall Rule. type OutboundFirewallRule struct { autorest.Response `json:"-"` @@ -22640,117 +23888,6 @@ func (rlp ReplicationLinkProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// ReplicationLinksFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type ReplicationLinksFailoverAllowDataLossFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ReplicationLinksClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ReplicationLinksFailoverAllowDataLossFuture) 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 ReplicationLinksFailoverAllowDataLossFuture.Result. -func (future *ReplicationLinksFailoverAllowDataLossFuture) result(client ReplicationLinksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverAllowDataLossFuture") - return - } - ar.Response = future.Response() - return -} - -// ReplicationLinksFailoverFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ReplicationLinksFailoverFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ReplicationLinksClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ReplicationLinksFailoverFuture) 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 ReplicationLinksFailoverFuture.Result. -func (future *ReplicationLinksFailoverFuture) result(client ReplicationLinksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverFuture") - return - } - ar.Response = future.Response() - return -} - -// ReplicationLinksUnlinkFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ReplicationLinksUnlinkFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ReplicationLinksClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ReplicationLinksUnlinkFuture) 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 ReplicationLinksUnlinkFuture.Result. -func (future *ReplicationLinksUnlinkFuture) result(client ReplicationLinksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksUnlinkFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksUnlinkFuture") - return - } - ar.Response = future.Response() - return -} - // Resource ARM resource. type Resource struct { // ID - READ-ONLY; Resource ID. @@ -22773,7 +23910,7 @@ type ResourceIdentity struct { UserAssignedIdentities map[string]*UserIdentity `json:"userAssignedIdentities"` // 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: 'IdentityTypeNone', 'IdentityTypeSystemAssigned', 'IdentityTypeUserAssigned' + // 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: 'IdentityTypeNone', 'IdentityTypeSystemAssigned', 'IdentityTypeUserAssigned', 'IdentityTypeSystemAssignedUserAssigned' Type IdentityType `json:"type,omitempty"` // TenantID - READ-ONLY; The Azure Active Directory tenant id. TenantID *uuid.UUID `json:"tenantId,omitempty"` @@ -22791,30 +23928,6 @@ func (ri ResourceIdentity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// ResourceIdentityWithUserAssignedIdentities azure Active Directory identity configuration for a resource. -type ResourceIdentityWithUserAssignedIdentities struct { - // UserAssignedIdentities - The resource ids of the user assigned identities to use - UserAssignedIdentities map[string]*UserIdentity `json:"userAssignedIdentities"` - // 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: 'IdentityTypeNone', 'IdentityTypeSystemAssigned', 'IdentityTypeUserAssigned' - Type IdentityType `json:"type,omitempty"` - // TenantID - READ-ONLY; The Azure Active Directory tenant id. - TenantID *uuid.UUID `json:"tenantId,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceIdentityWithUserAssignedIdentities. -func (riwuai ResourceIdentityWithUserAssignedIdentities) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if riwuai.UserAssignedIdentities != nil { - objectMap["userAssignedIdentities"] = riwuai.UserAssignedIdentities - } - if riwuai.Type != "" { - objectMap["type"] = riwuai.Type - } - return json.Marshal(objectMap) -} - // ResourceMoveDefinition contains the information necessary to perform a resource move (rename). type ResourceMoveDefinition struct { // ID - The target ID for the resource @@ -23127,16 +24240,14 @@ type RestorableDroppedDatabaseProperties struct { DatabaseName *string `json:"databaseName,omitempty"` // MaxSizeBytes - READ-ONLY; The max size of the database expressed in bytes. MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"` - // ElasticPoolID - READ-ONLY; DEPRECATED: The resource name of the elastic pool containing this database. This property is deprecated and the value will always be null. - ElasticPoolID *string `json:"elasticPoolId,omitempty"` // CreationDate - READ-ONLY; The creation date of the database (ISO8601 format). CreationDate *date.Time `json:"creationDate,omitempty"` // DeletionDate - READ-ONLY; The deletion date of the database (ISO8601 format). DeletionDate *date.Time `json:"deletionDate,omitempty"` // EarliestRestoreDate - READ-ONLY; The earliest restore date of the database (ISO8601 format). EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` - // BackupStorageRedundancy - READ-ONLY; The storage account type used to store backups for this database. Possible values include: 'BackupStorageRedundancy1Geo', 'BackupStorageRedundancy1Local', 'BackupStorageRedundancy1Zone' - BackupStorageRedundancy BackupStorageRedundancy1 `json:"backupStorageRedundancy,omitempty"` + // BackupStorageRedundancy - READ-ONLY; The storage account type used to store backups for this database. Possible values include: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone', 'BackupStorageRedundancyGeoZone' + BackupStorageRedundancy BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty"` } // MarshalJSON is the custom marshaler for RestorableDroppedDatabaseProperties. @@ -25570,14 +26681,57 @@ func (future *ServerCommunicationLinksCreateOrUpdateFuture) result(client Server return } -// ServerConnectionPolicy a server secure connection policy. +// ServerConnectionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ServerConnectionPoliciesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServerConnectionPoliciesClient) (ServerConnectionPolicy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServerConnectionPoliciesCreateOrUpdateFuture) 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 ServerConnectionPoliciesCreateOrUpdateFuture.Result. +func (future *ServerConnectionPoliciesCreateOrUpdateFuture) result(client ServerConnectionPoliciesClient) (scp ServerConnectionPolicy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerConnectionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + scp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.ServerConnectionPoliciesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if scp.Response.Response, err = future.GetResult(sender); err == nil && scp.Response.Response.StatusCode != http.StatusNoContent { + scp, err = client.CreateOrUpdateResponder(scp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerConnectionPoliciesCreateOrUpdateFuture", "Result", scp.Response.Response, "Failure responding to request") + } + } + return +} + +// ServerConnectionPolicy a server connection policy type ServerConnectionPolicy struct { autorest.Response `json:"-"` - // Kind - READ-ONLY; Metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` // Location - READ-ONLY; Resource location. Location *string `json:"location,omitempty"` - // ServerConnectionPolicyProperties - The properties of the server secure connection policy. + // Kind - READ-ONLY; Metadata used for the Azure portal experience. + Kind *string `json:"kind,omitempty"` + // ServerConnectionPolicyProperties - Resource properties. *ServerConnectionPolicyProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` @@ -25605,23 +26759,23 @@ func (scp *ServerConnectionPolicy) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "kind": + case "location": if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) + var location string + err = json.Unmarshal(*v, &location) if err != nil { return err } - scp.Kind = &kind + scp.Location = &location } - case "location": + case "kind": if v != nil { - var location string - err = json.Unmarshal(*v, &location) + var kind string + err = json.Unmarshal(*v, &kind) if err != nil { return err } - scp.Location = &location + scp.Kind = &kind } case "properties": if v != nil { @@ -25661,13 +26815,179 @@ func (scp *ServerConnectionPolicy) UnmarshalJSON(body []byte) error { } } } - + + return nil +} + +// ServerConnectionPolicyListResult a list of server connection policy objects. +type ServerConnectionPolicyListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]ServerConnectionPolicy `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerConnectionPolicyListResult. +func (scplr ServerConnectionPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ServerConnectionPolicyListResultIterator provides access to a complete listing of ServerConnectionPolicy +// values. +type ServerConnectionPolicyListResultIterator struct { + i int + page ServerConnectionPolicyListResultPage +} + +// 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 *ServerConnectionPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerConnectionPolicyListResultIterator.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 *ServerConnectionPolicyListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServerConnectionPolicyListResultIterator) 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 ServerConnectionPolicyListResultIterator) Response() ServerConnectionPolicyListResult { + 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 ServerConnectionPolicyListResultIterator) Value() ServerConnectionPolicy { + if !iter.page.NotDone() { + return ServerConnectionPolicy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ServerConnectionPolicyListResultIterator type. +func NewServerConnectionPolicyListResultIterator(page ServerConnectionPolicyListResultPage) ServerConnectionPolicyListResultIterator { + return ServerConnectionPolicyListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scplr ServerConnectionPolicyListResult) IsEmpty() bool { + return scplr.Value == nil || len(*scplr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scplr ServerConnectionPolicyListResult) hasNextLink() bool { + return scplr.NextLink != nil && len(*scplr.NextLink) != 0 +} + +// serverConnectionPolicyListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scplr ServerConnectionPolicyListResult) serverConnectionPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { + if !scplr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scplr.NextLink))) +} + +// ServerConnectionPolicyListResultPage contains a page of ServerConnectionPolicy values. +type ServerConnectionPolicyListResultPage struct { + fn func(context.Context, ServerConnectionPolicyListResult) (ServerConnectionPolicyListResult, error) + scplr ServerConnectionPolicyListResult +} + +// 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 *ServerConnectionPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerConnectionPolicyListResultPage.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.scplr) + if err != nil { + return err + } + page.scplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } return nil } -// ServerConnectionPolicyProperties the properties of a server secure connection policy. +// 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 *ServerConnectionPolicyListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServerConnectionPolicyListResultPage) NotDone() bool { + return !page.scplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ServerConnectionPolicyListResultPage) Response() ServerConnectionPolicyListResult { + return page.scplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServerConnectionPolicyListResultPage) Values() []ServerConnectionPolicy { + if page.scplr.IsEmpty() { + return nil + } + return *page.scplr.Value +} + +// Creates a new instance of the ServerConnectionPolicyListResultPage type. +func NewServerConnectionPolicyListResultPage(cur ServerConnectionPolicyListResult, getNextPage func(context.Context, ServerConnectionPolicyListResult) (ServerConnectionPolicyListResult, error)) ServerConnectionPolicyListResultPage { + return ServerConnectionPolicyListResultPage{ + fn: getNextPage, + scplr: cur, + } +} + +// ServerConnectionPolicyProperties the properties of a server connection policy. type ServerConnectionPolicyProperties struct { - // ConnectionType - The server connection type. Possible values include: 'ServerConnectionTypeDefault', 'ServerConnectionTypeProxy', 'ServerConnectionTypeRedirect' + // ConnectionType - The server connection type. Possible values include: 'ServerConnectionTypeDefault', 'ServerConnectionTypeRedirect', 'ServerConnectionTypeProxy' ConnectionType ServerConnectionType `json:"connectionType,omitempty"` } @@ -27286,20 +28606,227 @@ func (sp ServerProperties) MarshalJSON() ([]byte, error) { if sp.RestrictOutboundNetworkAccess != "" { objectMap["restrictOutboundNetworkAccess"] = sp.RestrictOutboundNetworkAccess } - return json.Marshal(objectMap) + return json.Marshal(objectMap) +} + +// ServersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServersCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServersClient) (Server, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServersCreateOrUpdateFuture) 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 ServersCreateOrUpdateFuture.Result. +func (future *ServersCreateOrUpdateFuture) result(client ServersClient) (s Server, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + s.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.ServersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.CreateOrUpdateResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// ServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServersDeleteFuture) 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 ServersDeleteFuture.Result. +func (future *ServersDeleteFuture) result(client ServersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.ServersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ServerSecurityAlertPoliciesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServerSecurityAlertPoliciesClient) (ServerSecurityAlertPolicy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServerSecurityAlertPoliciesCreateOrUpdateFuture) 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 ServerSecurityAlertPoliciesCreateOrUpdateFuture.Result. +func (future *ServerSecurityAlertPoliciesCreateOrUpdateFuture) result(client ServerSecurityAlertPoliciesClient) (ssap ServerSecurityAlertPolicy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ssap.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ssap.Response.Response, err = future.GetResult(sender); err == nil && ssap.Response.Response.StatusCode != http.StatusNoContent { + ssap, err = client.CreateOrUpdateResponder(ssap.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", ssap.Response.Response, "Failure responding to request") + } + } + return +} + +// ServerSecurityAlertPolicy a server security alert policy. +type ServerSecurityAlertPolicy struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; SystemData of SecurityAlertPolicyResource. + SystemData *SystemData `json:"systemData,omitempty"` + // SecurityAlertsPolicyProperties - Resource properties. + *SecurityAlertsPolicyProperties `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 ServerSecurityAlertPolicy. +func (ssap ServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssap.SecurityAlertsPolicyProperties != nil { + objectMap["properties"] = ssap.SecurityAlertsPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServerSecurityAlertPolicy struct. +func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + ssap.SystemData = &systemData + } + case "properties": + if v != nil { + var securityAlertsPolicyProperties SecurityAlertsPolicyProperties + err = json.Unmarshal(*v, &securityAlertsPolicyProperties) + if err != nil { + return err + } + ssap.SecurityAlertsPolicyProperties = &securityAlertsPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssap.Type = &typeVar + } + } + } + + return nil } -// ServersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// ServersImportDatabaseFuture an abstraction for monitoring and retrieving the results of a long-running // operation. -type ServersCreateOrUpdateFuture struct { +type ServersImportDatabaseFuture struct { azure.FutureAPI // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. - Result func(ServersClient) (Server, error) + Result func(ServersClient) (ImportExportOperationResult, error) } // UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { +func (future *ServersImportDatabaseFuture) UnmarshalJSON(body []byte) error { var azFuture azure.Future if err := json.Unmarshal(body, &azFuture); err != nil { return err @@ -27309,77 +28836,40 @@ func (future *ServersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { return nil } -// result is the default implementation for ServersCreateOrUpdateFuture.Result. -func (future *ServersCreateOrUpdateFuture) result(client ServersClient) (s Server, err error) { +// result is the default implementation for ServersImportDatabaseFuture.Result. +func (future *ServersImportDatabaseFuture) result(client ServersClient) (ieor ImportExportOperationResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "sql.ServersImportDatabaseFuture", "Result", future.Response(), "Polling failure") return } if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("sql.ServersCreateOrUpdateFuture") + ieor.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.ServersImportDatabaseFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.CreateOrUpdateResponder(s.Response.Response) + if ieor.Response.Response, err = future.GetResult(sender); err == nil && ieor.Response.Response.StatusCode != http.StatusNoContent { + ieor, err = client.ImportDatabaseResponder(ieor.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.ServersImportDatabaseFuture", "Result", ieor.Response.Response, "Failure responding to request") } } return } -// ServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// ServersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. -type ServersDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ServersClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServersDeleteFuture) 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 ServersDeleteFuture.Result. -func (future *ServersDeleteFuture) result(client ServersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("sql.ServersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ServerSecurityAlertPoliciesCreateOrUpdateFuture struct { +type ServersUpdateFuture struct { azure.FutureAPI // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. - Result func(ServerSecurityAlertPoliciesClient) (ServerSecurityAlertPolicy, error) + Result func(ServersClient) (Server, error) } // UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServerSecurityAlertPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { +func (future *ServersUpdateFuture) UnmarshalJSON(body []byte) error { var azFuture azure.Future if err := json.Unmarshal(body, &azFuture); err != nil { return err @@ -27389,36 +28879,35 @@ func (future *ServerSecurityAlertPoliciesCreateOrUpdateFuture) UnmarshalJSON(bod return nil } -// result is the default implementation for ServerSecurityAlertPoliciesCreateOrUpdateFuture.Result. -func (future *ServerSecurityAlertPoliciesCreateOrUpdateFuture) result(client ServerSecurityAlertPoliciesClient) (ssap ServerSecurityAlertPolicy, err error) { +// result is the default implementation for ServersUpdateFuture.Result. +func (future *ServersUpdateFuture) result(client ServersClient) (s Server, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "sql.ServersUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - ssap.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture") + s.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.ServersUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ssap.Response.Response, err = future.GetResult(sender); err == nil && ssap.Response.Response.StatusCode != http.StatusNoContent { - ssap, err = client.CreateOrUpdateResponder(ssap.Response.Response) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.UpdateResponder(s.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", ssap.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.ServersUpdateFuture", "Result", s.Response.Response, "Failure responding to request") } } return } -// ServerSecurityAlertPolicy a server security alert policy. -type ServerSecurityAlertPolicy struct { +// ServerTrustCertificate server trust certificate imported from box to enable connection between box and +// Sql Managed Instance. +type ServerTrustCertificate struct { autorest.Response `json:"-"` - // SystemData - READ-ONLY; SystemData of SecurityAlertPolicyResource. - SystemData *SystemData `json:"systemData,omitempty"` - // SecurityAlertsPolicyProperties - Resource properties. - *SecurityAlertsPolicyProperties `json:"properties,omitempty"` + // ServerTrustCertificateProperties - Resource properties. + *ServerTrustCertificateProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -27427,17 +28916,17 @@ type ServerSecurityAlertPolicy struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ServerSecurityAlertPolicy. -func (ssap ServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ServerTrustCertificate. +func (stc ServerTrustCertificate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ssap.SecurityAlertsPolicyProperties != nil { - objectMap["properties"] = ssap.SecurityAlertsPolicyProperties + if stc.ServerTrustCertificateProperties != nil { + objectMap["properties"] = stc.ServerTrustCertificateProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ServerSecurityAlertPolicy struct. -func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ServerTrustCertificate struct. +func (stc *ServerTrustCertificate) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -27445,23 +28934,14 @@ func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - ssap.SystemData = &systemData - } case "properties": if v != nil { - var securityAlertsPolicyProperties SecurityAlertsPolicyProperties - err = json.Unmarshal(*v, &securityAlertsPolicyProperties) + var serverTrustCertificateProperties ServerTrustCertificateProperties + err = json.Unmarshal(*v, &serverTrustCertificateProperties) if err != nil { return err } - ssap.SecurityAlertsPolicyProperties = &securityAlertsPolicyProperties + stc.ServerTrustCertificateProperties = &serverTrustCertificateProperties } case "id": if v != nil { @@ -27470,7 +28950,7 @@ func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - ssap.ID = &ID + stc.ID = &ID } case "name": if v != nil { @@ -27479,7 +28959,7 @@ func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - ssap.Name = &name + stc.Name = &name } case "type": if v != nil { @@ -27488,7 +28968,7 @@ func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - ssap.Type = &typeVar + stc.Type = &typeVar } } } @@ -27496,90 +28976,269 @@ func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error { return nil } -// ServersImportDatabaseFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServersImportDatabaseFuture struct { +// ServerTrustCertificateProperties the properties of a server trust certificate. +type ServerTrustCertificateProperties struct { + // PublicBlob - The certificate public blob + PublicBlob *string `json:"publicBlob,omitempty"` + // Thumbprint - READ-ONLY; The certificate thumbprint + Thumbprint *string `json:"thumbprint,omitempty"` + // CertificateName - READ-ONLY; The certificate name + CertificateName *string `json:"certificateName,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerTrustCertificateProperties. +func (stcp ServerTrustCertificateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if stcp.PublicBlob != nil { + objectMap["publicBlob"] = stcp.PublicBlob + } + return json.Marshal(objectMap) +} + +// ServerTrustCertificatesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ServerTrustCertificatesCreateOrUpdateFuture struct { azure.FutureAPI // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. - Result func(ServersClient) (ImportExportOperationResult, error) + Result func(ServerTrustCertificatesClient) (ServerTrustCertificate, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServerTrustCertificatesCreateOrUpdateFuture) 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 ServerTrustCertificatesCreateOrUpdateFuture.Result. +func (future *ServerTrustCertificatesCreateOrUpdateFuture) result(client ServerTrustCertificatesClient) (stc ServerTrustCertificate, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerTrustCertificatesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + stc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.ServerTrustCertificatesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if stc.Response.Response, err = future.GetResult(sender); err == nil && stc.Response.Response.StatusCode != http.StatusNoContent { + stc, err = client.CreateOrUpdateResponder(stc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerTrustCertificatesCreateOrUpdateFuture", "Result", stc.Response.Response, "Failure responding to request") + } + } + return +} + +// ServerTrustCertificatesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ServerTrustCertificatesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServerTrustCertificatesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServerTrustCertificatesDeleteFuture) 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 ServerTrustCertificatesDeleteFuture.Result. +func (future *ServerTrustCertificatesDeleteFuture) result(client ServerTrustCertificatesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerTrustCertificatesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("sql.ServerTrustCertificatesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ServerTrustCertificatesListResult a list of server trust certificates in instance. +type ServerTrustCertificatesListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]ServerTrustCertificate `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerTrustCertificatesListResult. +func (stclr ServerTrustCertificatesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ServerTrustCertificatesListResultIterator provides access to a complete listing of +// ServerTrustCertificate values. +type ServerTrustCertificatesListResultIterator struct { + i int + page ServerTrustCertificatesListResultPage +} + +// 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 *ServerTrustCertificatesListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerTrustCertificatesListResultIterator.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 *ServerTrustCertificatesListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServerTrustCertificatesListResultIterator) 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 ServerTrustCertificatesListResultIterator) Response() ServerTrustCertificatesListResult { + 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 ServerTrustCertificatesListResultIterator) Value() ServerTrustCertificate { + if !iter.page.NotDone() { + return ServerTrustCertificate{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ServerTrustCertificatesListResultIterator type. +func NewServerTrustCertificatesListResultIterator(page ServerTrustCertificatesListResultPage) ServerTrustCertificatesListResultIterator { + return ServerTrustCertificatesListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (stclr ServerTrustCertificatesListResult) IsEmpty() bool { + return stclr.Value == nil || len(*stclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (stclr ServerTrustCertificatesListResult) hasNextLink() bool { + return stclr.NextLink != nil && len(*stclr.NextLink) != 0 } -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServersImportDatabaseFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err +// serverTrustCertificatesListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (stclr ServerTrustCertificatesListResult) serverTrustCertificatesListResultPreparer(ctx context.Context) (*http.Request, error) { + if !stclr.hasNextLink() { + return nil, nil } - future.FutureAPI = &azFuture - future.Result = future.result - return nil + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(stclr.NextLink))) } -// result is the default implementation for ServersImportDatabaseFuture.Result. -func (future *ServersImportDatabaseFuture) result(client ServersClient) (ieor ImportExportOperationResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersImportDatabaseFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ieor.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("sql.ServersImportDatabaseFuture") - return +// ServerTrustCertificatesListResultPage contains a page of ServerTrustCertificate values. +type ServerTrustCertificatesListResultPage struct { + fn func(context.Context, ServerTrustCertificatesListResult) (ServerTrustCertificatesListResult, error) + stclr ServerTrustCertificatesListResult +} + +// 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 *ServerTrustCertificatesListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerTrustCertificatesListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ieor.Response.Response, err = future.GetResult(sender); err == nil && ieor.Response.Response.StatusCode != http.StatusNoContent { - ieor, err = client.ImportDatabaseResponder(ieor.Response.Response) + for { + next, err := page.fn(ctx, page.stclr) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersImportDatabaseFuture", "Result", ieor.Response.Response, "Failure responding to request") + return err + } + page.stclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break } } - return + return nil } -// ServersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServersUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ServersClient) (Server, error) +// 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 *ServerTrustCertificatesListResultPage) Next() error { + return page.NextWithContext(context.Background()) } -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServersUpdateFuture) 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 +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServerTrustCertificatesListResultPage) NotDone() bool { + return !page.stclr.IsEmpty() } -// result is the default implementation for ServersUpdateFuture.Result. -func (future *ServersUpdateFuture) result(client ServersClient) (s Server, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("sql.ServersUpdateFuture") - return +// Response returns the raw server response from the last page request. +func (page ServerTrustCertificatesListResultPage) Response() ServerTrustCertificatesListResult { + return page.stclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServerTrustCertificatesListResultPage) Values() []ServerTrustCertificate { + if page.stclr.IsEmpty() { + return nil } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.UpdateResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServersUpdateFuture", "Result", s.Response.Response, "Failure responding to request") - } + return *page.stclr.Value +} + +// Creates a new instance of the ServerTrustCertificatesListResultPage type. +func NewServerTrustCertificatesListResultPage(cur ServerTrustCertificatesListResult, getNextPage func(context.Context, ServerTrustCertificatesListResult) (ServerTrustCertificatesListResult, error)) ServerTrustCertificatesListResultPage { + return ServerTrustCertificatesListResultPage{ + fn: getNextPage, + stclr: cur, } - return } // ServerTrustGroup a server trust group. @@ -28421,6 +30080,27 @@ func (sop ServiceObjectiveProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// ServicePrincipal the managed instance's service principal configuration for a resource. +type ServicePrincipal struct { + // PrincipalID - READ-ONLY; The Azure Active Directory application object id. + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - READ-ONLY; The Azure Active Directory application client id. + ClientID *string `json:"clientId,omitempty"` + // TenantID - READ-ONLY; The Azure Active Directory tenant id. + TenantID *string `json:"tenantId,omitempty"` + // Type - Service principal type. Possible values include: 'ServicePrincipalTypeNone', 'ServicePrincipalTypeSystemAssigned' + Type ServicePrincipalType `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServicePrincipal. +func (sp ServicePrincipal) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.Type != "" { + objectMap["type"] = sp.Type + } + return json.Marshal(objectMap) +} + // Sku an ARM Resource SKU. type Sku struct { // Name - The name of the SKU, typically, a letter + Number code, e.g. P3. @@ -28453,8 +30133,8 @@ func (sum SloUsageMetric) MarshalJSON() ([]byte, error) { // StorageCapability the storage account type capability. type StorageCapability struct { - // StorageAccountType - READ-ONLY; The storage account type for the database's backups. Possible values include: 'StorageAccountType1GRS', 'StorageAccountType1LRS', 'StorageAccountType1ZRS' - StorageAccountType StorageAccountType1 `json:"storageAccountType,omitempty"` + // StorageAccountType - READ-ONLY; The storage account type for the database's backups. Possible values include: 'StorageAccountTypeGRS', 'StorageAccountTypeLRS', 'StorageAccountTypeZRS' + StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' Status CapabilityStatus `json:"status,omitempty"` // Reason - The reason for the capability not being available. @@ -31497,206 +33177,10 @@ func (tr TrackedResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// TransparentDataEncryption represents a database transparent data encryption configuration. -type TransparentDataEncryption struct { - autorest.Response `json:"-"` - // Location - READ-ONLY; Resource location. - Location *string `json:"location,omitempty"` - // TransparentDataEncryptionProperties - Represents the properties of the resource. - *TransparentDataEncryptionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; 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 TransparentDataEncryption. -func (tde TransparentDataEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tde.TransparentDataEncryptionProperties != nil { - objectMap["properties"] = tde.TransparentDataEncryptionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for TransparentDataEncryption struct. -func (tde *TransparentDataEncryption) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - tde.Location = &location - } - case "properties": - if v != nil { - var transparentDataEncryptionProperties TransparentDataEncryptionProperties - err = json.Unmarshal(*v, &transparentDataEncryptionProperties) - if err != nil { - return err - } - tde.TransparentDataEncryptionProperties = &transparentDataEncryptionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - tde.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - tde.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - tde.Type = &typeVar - } - } - } - - return nil -} - -// TransparentDataEncryptionActivity represents a database transparent data encryption Scan. -type TransparentDataEncryptionActivity struct { - // Location - READ-ONLY; Resource location. - Location *string `json:"location,omitempty"` - // TransparentDataEncryptionActivityProperties - Represents the properties of the resource. - *TransparentDataEncryptionActivityProperties `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 TransparentDataEncryptionActivity. -func (tdea TransparentDataEncryptionActivity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tdea.TransparentDataEncryptionActivityProperties != nil { - objectMap["properties"] = tdea.TransparentDataEncryptionActivityProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for TransparentDataEncryptionActivity struct. -func (tdea *TransparentDataEncryptionActivity) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - tdea.Location = &location - } - case "properties": - if v != nil { - var transparentDataEncryptionActivityProperties TransparentDataEncryptionActivityProperties - err = json.Unmarshal(*v, &transparentDataEncryptionActivityProperties) - if err != nil { - return err - } - tdea.TransparentDataEncryptionActivityProperties = &transparentDataEncryptionActivityProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - tdea.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - tdea.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - tdea.Type = &typeVar - } - } - } - - return nil -} - -// TransparentDataEncryptionActivityListResult represents the response to a list database transparent data -// encryption activity request. -type TransparentDataEncryptionActivityListResult struct { - autorest.Response `json:"-"` - // Value - The list of database transparent data encryption activities. - Value *[]TransparentDataEncryptionActivity `json:"value,omitempty"` -} - -// TransparentDataEncryptionActivityProperties represents the properties of a database transparent data -// encryption Scan. -type TransparentDataEncryptionActivityProperties struct { - // Status - READ-ONLY; The status of the database. Possible values include: 'TransparentDataEncryptionActivityStatusEncrypting', 'TransparentDataEncryptionActivityStatusDecrypting' - Status TransparentDataEncryptionActivityStatus `json:"status,omitempty"` - // PercentComplete - READ-ONLY; The percent complete of the transparent data encryption scan for a database. - PercentComplete *float64 `json:"percentComplete,omitempty"` -} - -// MarshalJSON is the custom marshaler for TransparentDataEncryptionActivityProperties. -func (tdeap TransparentDataEncryptionActivityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// TransparentDataEncryptionProperties represents the properties of a database transparent data encryption. +// TransparentDataEncryptionProperties properties of a transparent data encryption. type TransparentDataEncryptionProperties struct { - // Status - The status of the database transparent data encryption. Possible values include: 'TransparentDataEncryptionStatusEnabled', 'TransparentDataEncryptionStatusDisabled' - Status TransparentDataEncryptionStatus `json:"status,omitempty"` -} - -// UnlinkParameters represents the parameters for Unlink Replication Link request. -type UnlinkParameters struct { - // ForcedTermination - Determines whether link will be terminated in a forced or a friendly way. - ForcedTermination *bool `json:"forcedTermination,omitempty"` + // State - Specifies the state of the transparent data encryption. Possible values include: 'TransparentDataEncryptionStateEnabled', 'TransparentDataEncryptionStateDisabled' + State TransparentDataEncryptionState `json:"state,omitempty"` } // UpdateLongTermRetentionBackupParameters contains the information necessary to perform long term @@ -31742,8 +33226,8 @@ func (ultrbp *UpdateLongTermRetentionBackupParameters) UnmarshalJSON(body []byte // 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"` + // RequestedBackupStorageRedundancy - The storage redundancy type of the copied backup. Possible values include: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone', 'BackupStorageRedundancyGeoZone' + RequestedBackupStorageRedundancy BackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"` } // UpdateManagedInstanceDNSServersOperation a recoverable managed database resource. diff --git a/services/preview/sql/mgmt/v5.0/sql/operationshealth.go b/services/preview/sql/mgmt/v5.0/sql/operationshealth.go deleted file mode 100644 index 336375cc7e29..000000000000 --- a/services/preview/sql/mgmt/v5.0/sql/operationshealth.go +++ /dev/null @@ -1,150 +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/tracing" - "net/http" -) - -// OperationsHealthClient 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 OperationsHealthClient struct { - BaseClient -} - -// NewOperationsHealthClient creates an instance of the OperationsHealthClient client. -func NewOperationsHealthClient(subscriptionID string) OperationsHealthClient { - return NewOperationsHealthClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewOperationsHealthClientWithBaseURI creates an instance of the OperationsHealthClient 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 NewOperationsHealthClientWithBaseURI(baseURI string, subscriptionID string) OperationsHealthClient { - return OperationsHealthClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListByLocation gets a service operation health status. -// Parameters: -// locationName - the name of the region where the resource is located. -func (client OperationsHealthClient) ListByLocation(ctx context.Context, locationName string) (result OperationsHealthListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsHealthClient.ListByLocation") - defer func() { - sc := -1 - if result.ohlr.Response.Response != nil { - sc = result.ohlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByLocationNextResults - req, err := client.ListByLocationPreparer(ctx, locationName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.OperationsHealthClient", "ListByLocation", nil, "Failure preparing request") - return - } - - resp, err := client.ListByLocationSender(req) - if err != nil { - result.ohlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.OperationsHealthClient", "ListByLocation", resp, "Failure sending request") - return - } - - result.ohlr, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.OperationsHealthClient", "ListByLocation", resp, "Failure responding to request") - return - } - if result.ohlr.hasNextLink() && result.ohlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByLocationPreparer prepares the ListByLocation request. -func (client OperationsHealthClient) ListByLocationPreparer(ctx context.Context, locationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "locationName": autorest.Encode("path", locationName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-11-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/operationsHealth", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByLocationSender sends the ListByLocation request. The method will close the -// http.Response Body if it receives an error. -func (client OperationsHealthClient) ListByLocationSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByLocationResponder handles the response to the ListByLocation request. The method always -// closes the http.Response Body. -func (client OperationsHealthClient) ListByLocationResponder(resp *http.Response) (result OperationsHealthListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByLocationNextResults retrieves the next set of results, if any. -func (client OperationsHealthClient) listByLocationNextResults(ctx context.Context, lastResults OperationsHealthListResult) (result OperationsHealthListResult, err error) { - req, err := lastResults.operationsHealthListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "sql.OperationsHealthClient", "listByLocationNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByLocationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "sql.OperationsHealthClient", "listByLocationNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.OperationsHealthClient", "listByLocationNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByLocationComplete enumerates all values, automatically crossing page boundaries as required. -func (client OperationsHealthClient) ListByLocationComplete(ctx context.Context, locationName string) (result OperationsHealthListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsHealthClient.ListByLocation") - 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.ListByLocation(ctx, locationName) - return -} diff --git a/services/preview/sql/mgmt/v5.0/sql/replicationlinks.go b/services/preview/sql/mgmt/v5.0/sql/replicationlinks.go index 60c0723d451a..648593a5fe19 100644 --- a/services/preview/sql/mgmt/v5.0/sql/replicationlinks.go +++ b/services/preview/sql/mgmt/v5.0/sql/replicationlinks.go @@ -33,253 +33,6 @@ func NewReplicationLinksClientWithBaseURI(baseURI string, subscriptionID string) return ReplicationLinksClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Delete deletes a database replication link. Cannot be done during failover. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// databaseName - the name of the database that has the replication link to be dropped. -// linkID - the ID of the replication link to be deleted. -func (client ReplicationLinksClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLinksClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, databaseName, linkID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ReplicationLinksClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "linkId": autorest.Encode("path", linkID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ReplicationLinksClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ReplicationLinksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Failover sets which replica database is primary by failing over from the current primary replica database. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// databaseName - the name of the database that has the replication link to be failed over. -// linkID - the ID of the replication link to be failed over. -func (client ReplicationLinksClient) Failover(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result ReplicationLinksFailoverFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLinksClient.Failover") - 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.FailoverPreparer(ctx, resourceGroupName, serverName, databaseName, linkID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "Failover", nil, "Failure preparing request") - return - } - - result, err = client.FailoverSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "Failover", result.Response(), "Failure sending request") - return - } - - return -} - -// FailoverPreparer prepares the Failover request. -func (client ReplicationLinksClient) FailoverPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "linkId": autorest.Encode("path", linkID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// FailoverSender sends the Failover request. The method will close the -// http.Response Body if it receives an error. -func (client ReplicationLinksClient) FailoverSender(req *http.Request) (future ReplicationLinksFailoverFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - 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 -} - -// FailoverResponder handles the response to the Failover request. The method always -// closes the http.Response Body. -func (client ReplicationLinksClient) FailoverResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// FailoverAllowDataLoss sets which replica database is primary by failing over from the current primary replica -// database. This operation might result in data loss. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// databaseName - the name of the database that has the replication link to be failed over. -// linkID - the ID of the replication link to be failed over. -func (client ReplicationLinksClient) FailoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result ReplicationLinksFailoverAllowDataLossFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLinksClient.FailoverAllowDataLoss") - 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.FailoverAllowDataLossPreparer(ctx, resourceGroupName, serverName, databaseName, linkID) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "FailoverAllowDataLoss", nil, "Failure preparing request") - return - } - - result, err = client.FailoverAllowDataLossSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "FailoverAllowDataLoss", result.Response(), "Failure sending request") - return - } - - return -} - -// FailoverAllowDataLossPreparer prepares the FailoverAllowDataLoss request. -func (client ReplicationLinksClient) FailoverAllowDataLossPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "linkId": autorest.Encode("path", linkID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// FailoverAllowDataLossSender sends the FailoverAllowDataLoss request. The method will close the -// http.Response Body if it receives an error. -func (client ReplicationLinksClient) FailoverAllowDataLossSender(req *http.Request) (future ReplicationLinksFailoverAllowDataLossFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - 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 -} - -// FailoverAllowDataLossResponder handles the response to the FailoverAllowDataLoss request. The method always -// closes the http.Response Body. -func (client ReplicationLinksClient) FailoverAllowDataLossResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - // Get gets a replication link. // Parameters: // resourceGroupName - the name of the resource group that contains the resource. You can obtain this value @@ -600,89 +353,3 @@ func (client ReplicationLinksClient) ListByServerComplete(ctx context.Context, r result.page, err = client.ListByServer(ctx, resourceGroupName, serverName) return } - -// Unlink deletes a database replication link in forced or friendly way. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// databaseName - the name of the database that has the replication link to be failed over. -// linkID - the ID of the replication link to be failed over. -// parameters - the required parameters for unlinking replication link. -func (client ReplicationLinksClient) Unlink(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, parameters UnlinkParameters) (result ReplicationLinksUnlinkFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLinksClient.Unlink") - 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.UnlinkPreparer(ctx, resourceGroupName, serverName, databaseName, linkID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "Unlink", nil, "Failure preparing request") - return - } - - result, err = client.UnlinkSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.ReplicationLinksClient", "Unlink", result.Response(), "Failure sending request") - return - } - - return -} - -// UnlinkPreparer prepares the Unlink request. -func (client ReplicationLinksClient) UnlinkPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, parameters UnlinkParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "linkId": autorest.Encode("path", linkID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/unlink", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UnlinkSender sends the Unlink request. The method will close the -// http.Response Body if it receives an error. -func (client ReplicationLinksClient) UnlinkSender(req *http.Request) (future ReplicationLinksUnlinkFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - 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 -} - -// UnlinkResponder handles the response to the Unlink request. The method always -// closes the http.Response Body. -func (client ReplicationLinksClient) UnlinkResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/services/preview/sql/mgmt/v5.0/sql/restorabledroppeddatabases.go b/services/preview/sql/mgmt/v5.0/sql/restorabledroppeddatabases.go index fba3a6c7ac5b..4e9f1e488849 100644 --- a/services/preview/sql/mgmt/v5.0/sql/restorabledroppeddatabases.go +++ b/services/preview/sql/mgmt/v5.0/sql/restorabledroppeddatabases.go @@ -80,7 +80,7 @@ func (client RestorableDroppedDatabasesClient) GetPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -162,7 +162,7 @@ func (client RestorableDroppedDatabasesClient) ListByServerPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/sql/mgmt/v5.0/sql/restorabledroppedmanageddatabases.go b/services/preview/sql/mgmt/v5.0/sql/restorabledroppedmanageddatabases.go index 0758769aae6d..2d9de035e999 100644 --- a/services/preview/sql/mgmt/v5.0/sql/restorabledroppedmanageddatabases.go +++ b/services/preview/sql/mgmt/v5.0/sql/restorabledroppedmanageddatabases.go @@ -81,7 +81,7 @@ func (client RestorableDroppedManagedDatabasesClient) GetPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -163,7 +163,7 @@ func (client RestorableDroppedManagedDatabasesClient) ListByInstancePreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01-preview" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/sql/mgmt/v5.0/sql/serverconnectionpolicies.go b/services/preview/sql/mgmt/v5.0/sql/serverconnectionpolicies.go index fd714db39b75..416550161475 100644 --- a/services/preview/sql/mgmt/v5.0/sql/serverconnectionpolicies.go +++ b/services/preview/sql/mgmt/v5.0/sql/serverconnectionpolicies.go @@ -33,19 +33,19 @@ func NewServerConnectionPoliciesClientWithBaseURI(baseURI string, subscriptionID return ServerConnectionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates the server's connection policy. +// CreateOrUpdate updates a server connection policy // Parameters: // resourceGroupName - the name of the resource group that contains the resource. You can obtain this value // from the Azure Resource Manager API or the portal. // serverName - the name of the server. -// parameters - the required parameters for updating a secure connection policy. -func (client ServerConnectionPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerConnectionPolicy) (result ServerConnectionPolicy, err error) { +// parameters - the required parameters for updating a server connection policy. +func (client ServerConnectionPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerConnectionPolicy) (result ServerConnectionPoliciesCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ServerConnectionPoliciesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -56,16 +56,9 @@ func (client ServerConnectionPoliciesClient) CreateOrUpdate(ctx context.Context, return } - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.ServerConnectionPoliciesClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) + result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "sql.ServerConnectionPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "sql.ServerConnectionPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -81,13 +74,13 @@ func (client ServerConnectionPoliciesClient) CreateOrUpdatePreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2014-04-01" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } - parameters.Kind = nil parameters.Location = nil + parameters.Kind = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), @@ -100,8 +93,18 @@ func (client ServerConnectionPoliciesClient) CreateOrUpdatePreparer(ctx context. // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client ServerConnectionPoliciesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client ServerConnectionPoliciesClient) CreateOrUpdateSender(req *http.Request) (future ServerConnectionPoliciesCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + 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 } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -109,14 +112,14 @@ func (client ServerConnectionPoliciesClient) CreateOrUpdateSender(req *http.Requ func (client ServerConnectionPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ServerConnectionPolicy, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// Get gets the server's secure connection policy. +// Get gets a server connection policy // 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. @@ -163,7 +166,7 @@ func (client ServerConnectionPoliciesClient) GetPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2014-04-01" + const APIVersion = "2021-05-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -193,3 +196,122 @@ func (client ServerConnectionPoliciesClient) GetResponder(resp *http.Response) ( result.Response = autorest.Response{Response: resp} return } + +// ListByServer lists connection policy +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +func (client ServerConnectionPoliciesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServerConnectionPolicyListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerConnectionPoliciesClient.ListByServer") + defer func() { + sc := -1 + if result.scplr.Response.Response != nil { + sc = result.scplr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByServerNextResults + req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerConnectionPoliciesClient", "ListByServer", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServerSender(req) + if err != nil { + result.scplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ServerConnectionPoliciesClient", "ListByServer", resp, "Failure sending request") + return + } + + result.scplr, err = client.ListByServerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerConnectionPoliciesClient", "ListByServer", resp, "Failure responding to request") + return + } + if result.scplr.hasNextLink() && result.scplr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByServerPreparer prepares the ListByServer request. +func (client ServerConnectionPoliciesClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-05-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServerSender sends the ListByServer request. The method will close the +// http.Response Body if it receives an error. +func (client ServerConnectionPoliciesClient) ListByServerSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServerResponder handles the response to the ListByServer request. The method always +// closes the http.Response Body. +func (client ServerConnectionPoliciesClient) ListByServerResponder(resp *http.Response) (result ServerConnectionPolicyListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServerNextResults retrieves the next set of results, if any. +func (client ServerConnectionPoliciesClient) listByServerNextResults(ctx context.Context, lastResults ServerConnectionPolicyListResult) (result ServerConnectionPolicyListResult, err error) { + req, err := lastResults.serverConnectionPolicyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "sql.ServerConnectionPoliciesClient", "listByServerNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "sql.ServerConnectionPoliciesClient", "listByServerNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerConnectionPoliciesClient", "listByServerNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServerConnectionPoliciesClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result ServerConnectionPolicyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerConnectionPoliciesClient.ListByServer") + 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.ListByServer(ctx, resourceGroupName, serverName) + return +} diff --git a/services/preview/sql/mgmt/v5.0/sql/servertrustcertificates.go b/services/preview/sql/mgmt/v5.0/sql/servertrustcertificates.go new file mode 100644 index 000000000000..d0f4a1495ae2 --- /dev/null +++ b/services/preview/sql/mgmt/v5.0/sql/servertrustcertificates.go @@ -0,0 +1,399 @@ +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/tracing" + "net/http" +) + +// ServerTrustCertificatesClient 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 ServerTrustCertificatesClient struct { + BaseClient +} + +// NewServerTrustCertificatesClient creates an instance of the ServerTrustCertificatesClient client. +func NewServerTrustCertificatesClient(subscriptionID string) ServerTrustCertificatesClient { + return NewServerTrustCertificatesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServerTrustCertificatesClientWithBaseURI creates an instance of the ServerTrustCertificatesClient 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 NewServerTrustCertificatesClientWithBaseURI(baseURI string, subscriptionID string) ServerTrustCertificatesClient { + return ServerTrustCertificatesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate uploads a server trust certificate from box to Sql 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. +// certificateName - name of of the certificate to upload. +// parameters - the server trust certificate info. +func (client ServerTrustCertificatesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, certificateName string, parameters ServerTrustCertificate) (result ServerTrustCertificatesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerTrustCertificatesClient.CreateOrUpdate") + 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.CreateOrUpdatePreparer(ctx, resourceGroupName, managedInstanceName, certificateName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerTrustCertificatesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerTrustCertificatesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ServerTrustCertificatesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, certificateName string, parameters ServerTrustCertificate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateName": autorest.Encode("path", certificateName), + "managedInstanceName": autorest.Encode("path", managedInstanceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ServerTrustCertificatesClient) CreateOrUpdateSender(req *http.Request) (future ServerTrustCertificatesCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + 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 +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ServerTrustCertificatesClient) CreateOrUpdateResponder(resp *http.Response) (result ServerTrustCertificate, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a server trust certificate that was uploaded from box to Sql 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. +// certificateName - name of of the certificate to delete. +func (client ServerTrustCertificatesClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, certificateName string) (result ServerTrustCertificatesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerTrustCertificatesClient.Delete") + 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.DeletePreparer(ctx, resourceGroupName, managedInstanceName, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerTrustCertificatesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerTrustCertificatesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ServerTrustCertificatesClient) DeletePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, certificateName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateName": autorest.Encode("path", certificateName), + "managedInstanceName": autorest.Encode("path", managedInstanceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ServerTrustCertificatesClient) DeleteSender(req *http.Request) (future ServerTrustCertificatesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + 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 +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ServerTrustCertificatesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a server trust certificate that was uploaded from box to Sql 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. +// certificateName - name of of the certificate to get. +func (client ServerTrustCertificatesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, certificateName string) (result ServerTrustCertificate, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerTrustCertificatesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, managedInstanceName, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerTrustCertificatesClient", "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.ServerTrustCertificatesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerTrustCertificatesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ServerTrustCertificatesClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, certificateName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateName": autorest.Encode("path", certificateName), + "managedInstanceName": autorest.Encode("path", managedInstanceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}", 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 ServerTrustCertificatesClient) 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 ServerTrustCertificatesClient) GetResponder(resp *http.Response) (result ServerTrustCertificate, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByInstance gets a list of server trust certificates that were uploaded from box to the given Sql 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. +func (client ServerTrustCertificatesClient) ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ServerTrustCertificatesListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerTrustCertificatesClient.ListByInstance") + defer func() { + sc := -1 + if result.stclr.Response.Response != nil { + sc = result.stclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByInstanceNextResults + req, err := client.ListByInstancePreparer(ctx, resourceGroupName, managedInstanceName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerTrustCertificatesClient", "ListByInstance", nil, "Failure preparing request") + return + } + + resp, err := client.ListByInstanceSender(req) + if err != nil { + result.stclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ServerTrustCertificatesClient", "ListByInstance", resp, "Failure sending request") + return + } + + result.stclr, err = client.ListByInstanceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerTrustCertificatesClient", "ListByInstance", resp, "Failure responding to request") + return + } + if result.stclr.hasNextLink() && result.stclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByInstancePreparer prepares the ListByInstance request. +func (client ServerTrustCertificatesClient) ListByInstancePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string) (*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 = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByInstanceSender sends the ListByInstance request. The method will close the +// http.Response Body if it receives an error. +func (client ServerTrustCertificatesClient) ListByInstanceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByInstanceResponder handles the response to the ListByInstance request. The method always +// closes the http.Response Body. +func (client ServerTrustCertificatesClient) ListByInstanceResponder(resp *http.Response) (result ServerTrustCertificatesListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByInstanceNextResults retrieves the next set of results, if any. +func (client ServerTrustCertificatesClient) listByInstanceNextResults(ctx context.Context, lastResults ServerTrustCertificatesListResult) (result ServerTrustCertificatesListResult, err error) { + req, err := lastResults.serverTrustCertificatesListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "sql.ServerTrustCertificatesClient", "listByInstanceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByInstanceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "sql.ServerTrustCertificatesClient", "listByInstanceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByInstanceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerTrustCertificatesClient", "listByInstanceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByInstanceComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServerTrustCertificatesClient) ListByInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result ServerTrustCertificatesListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerTrustCertificatesClient.ListByInstance") + 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.ListByInstance(ctx, resourceGroupName, managedInstanceName) + return +} diff --git a/services/preview/sql/mgmt/v5.0/sql/sqlapi/interfaces.go b/services/preview/sql/mgmt/v5.0/sql/sqlapi/interfaces.go index c0309960fd04..d61c88506f1d 100644 --- a/services/preview/sql/mgmt/v5.0/sql/sqlapi/interfaces.go +++ b/services/preview/sql/mgmt/v5.0/sql/sqlapi/interfaces.go @@ -22,14 +22,6 @@ type RecoverableDatabasesClientAPI interface { var _ RecoverableDatabasesClientAPI = (*sql.RecoverableDatabasesClient)(nil) -// ServerConnectionPoliciesClientAPI contains the set of methods on the ServerConnectionPoliciesClient type. -type ServerConnectionPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters sql.ServerConnectionPolicy) (result sql.ServerConnectionPolicy, err error) - Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerConnectionPolicy, err error) -} - -var _ ServerConnectionPoliciesClientAPI = (*sql.ServerConnectionPoliciesClient)(nil) - // DataMaskingPoliciesClientAPI contains the set of methods on the DataMaskingPoliciesClient type. type DataMaskingPoliciesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.DataMaskingPolicy) (result sql.DataMaskingPolicy, err error) @@ -86,8 +78,8 @@ type ElasticPoolsClientAPI interface { Delete(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.ElasticPoolsDeleteFuture, err error) Failover(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.ElasticPoolsFailoverFuture, err error) Get(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.ElasticPool, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string, skip *int32) (result sql.ElasticPoolListResultPage, err error) - ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string, skip *int32) (result sql.ElasticPoolListResultIterator, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string, skip *int64) (result sql.ElasticPoolListResultPage, err error) + ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string, skip *int64) (result sql.ElasticPoolListResultIterator, err error) ListMetricDefinitions(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result sql.MetricDefinitionListResult, err error) ListMetrics(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, filter string) (result sql.MetricListResult, err error) Update(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters sql.ElasticPoolUpdate) (result sql.ElasticPoolsUpdateFuture, err error) @@ -95,21 +87,6 @@ type ElasticPoolsClientAPI interface { var _ ElasticPoolsClientAPI = (*sql.ElasticPoolsClient)(nil) -// ReplicationLinksClientAPI contains the set of methods on the ReplicationLinksClient type. -type ReplicationLinksClientAPI interface { - Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result autorest.Response, err error) - Failover(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result sql.ReplicationLinksFailoverFuture, err error) - FailoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result sql.ReplicationLinksFailoverAllowDataLossFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result sql.ReplicationLink, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.ReplicationLinkListResultPage, err error) - ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.ReplicationLinkListResultIterator, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ReplicationLinkListResultPage, err error) - ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result sql.ReplicationLinkListResultIterator, err error) - Unlink(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, parameters sql.UnlinkParameters) (result sql.ReplicationLinksUnlinkFuture, err error) -} - -var _ ReplicationLinksClientAPI = (*sql.ReplicationLinksClient)(nil) - // ServerCommunicationLinksClientAPI contains the set of methods on the ServerCommunicationLinksClient type. type ServerCommunicationLinksClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, parameters sql.ServerCommunicationLink) (result sql.ServerCommunicationLinksCreateOrUpdateFuture, err error) @@ -142,21 +119,6 @@ type ElasticPoolDatabaseActivitiesClientAPI interface { var _ ElasticPoolDatabaseActivitiesClientAPI = (*sql.ElasticPoolDatabaseActivitiesClient)(nil) -// TransparentDataEncryptionsClientAPI contains the set of methods on the TransparentDataEncryptionsClient type. -type TransparentDataEncryptionsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.TransparentDataEncryption) (result sql.TransparentDataEncryption, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.TransparentDataEncryption, err error) -} - -var _ TransparentDataEncryptionsClientAPI = (*sql.TransparentDataEncryptionsClient)(nil) - -// TransparentDataEncryptionActivitiesClientAPI contains the set of methods on the TransparentDataEncryptionActivitiesClient type. -type TransparentDataEncryptionActivitiesClientAPI interface { - ListByConfiguration(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.TransparentDataEncryptionActivityListResult, err error) -} - -var _ TransparentDataEncryptionActivitiesClientAPI = (*sql.TransparentDataEncryptionActivitiesClient)(nil) - // ServerUsagesClientAPI contains the set of methods on the ServerUsagesClient type. type ServerUsagesClientAPI interface { ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerUsageListResult, err error) @@ -503,54 +465,6 @@ type CapabilitiesClientAPI interface { var _ CapabilitiesClientAPI = (*sql.CapabilitiesClient)(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) - -// LongTermRetentionManagedInstanceBackupsClientAPI contains the set of methods on the LongTermRetentionManagedInstanceBackupsClient type. -type LongTermRetentionManagedInstanceBackupsClientAPI interface { - Delete(ctx context.Context, locationName string, managedInstanceName string, databaseName string, backupName string) (result sql.LongTermRetentionManagedInstanceBackupsDeleteFuture, err error) - 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.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) - // 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) @@ -656,29 +570,6 @@ type ManagedDatabaseSecurityEventsClientAPI interface { var _ ManagedDatabaseSecurityEventsClientAPI = (*sql.ManagedDatabaseSecurityEventsClient)(nil) -// ManagedDatabaseSensitivityLabelsClientAPI contains the set of methods on the ManagedDatabaseSensitivityLabelsClient type. -type ManagedDatabaseSensitivityLabelsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, parameters sql.SensitivityLabel) (result sql.SensitivityLabel, err error) - Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) - DisableRecommendation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) - EnableRecommendation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, sensitivityLabelSource sql.SensitivityLabelSource) (result sql.SensitivityLabel, err error) - ListCurrentByDatabase(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, skipToken string, count *bool, filter string) (result sql.SensitivityLabelListResultPage, err error) - ListCurrentByDatabaseComplete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, skipToken string, count *bool, filter string) (result sql.SensitivityLabelListResultIterator, err error) - ListRecommendedByDatabase(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, skipToken string, includeDisabledRecommendations *bool, filter string) (result sql.SensitivityLabelListResultPage, err error) - ListRecommendedByDatabaseComplete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, skipToken string, includeDisabledRecommendations *bool, filter string) (result sql.SensitivityLabelListResultIterator, err error) - Update(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters sql.SensitivityLabelUpdateList) (result autorest.Response, err error) -} - -var _ ManagedDatabaseSensitivityLabelsClientAPI = (*sql.ManagedDatabaseSensitivityLabelsClient)(nil) - -// ManagedDatabaseRecommendedSensitivityLabelsClientAPI contains the set of methods on the ManagedDatabaseRecommendedSensitivityLabelsClient type. -type ManagedDatabaseRecommendedSensitivityLabelsClientAPI interface { - Update(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters sql.RecommendedSensitivityLabelUpdateList) (result autorest.Response, err error) -} - -var _ ManagedDatabaseRecommendedSensitivityLabelsClientAPI = (*sql.ManagedDatabaseRecommendedSensitivityLabelsClient)(nil) - // ManagedDatabaseTablesClientAPI contains the set of methods on the ManagedDatabaseTablesClient type. type ManagedDatabaseTablesClientAPI interface { Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string) (result sql.DatabaseTable, err error) @@ -813,25 +704,6 @@ type ManagedInstancePrivateLinkResourcesClientAPI interface { var _ ManagedInstancePrivateLinkResourcesClientAPI = (*sql.ManagedInstancePrivateLinkResourcesClient)(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, expand string) (result sql.ManagedInstance, err error) - List(ctx context.Context, expand string) (result sql.ManagedInstanceListResultPage, err error) - ListComplete(ctx context.Context, expand string) (result sql.ManagedInstanceListResultIterator, err error) - ListByInstancePool(ctx context.Context, resourceGroupName string, instancePoolName string, expand string) (result sql.ManagedInstanceListResultPage, err error) - ListByInstancePoolComplete(ctx context.Context, resourceGroupName string, instancePoolName string, expand 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, expand string) (result sql.ManagedInstanceListResultPage, err error) - ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, expand 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) - // ManagedInstanceTdeCertificatesClientAPI contains the set of methods on the ManagedInstanceTdeCertificatesClient type. type ManagedInstanceTdeCertificatesClientAPI interface { Create(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters sql.TdeCertificate) (result sql.ManagedInstanceTdeCertificatesCreateFuture, err error) @@ -879,14 +751,6 @@ type OperationsClientAPI interface { var _ OperationsClientAPI = (*sql.OperationsClient)(nil) -// OperationsHealthClientAPI contains the set of methods on the OperationsHealthClient type. -type OperationsHealthClientAPI interface { - ListByLocation(ctx context.Context, locationName string) (result sql.OperationsHealthListResultPage, err error) - ListByLocationComplete(ctx context.Context, locationName string) (result sql.OperationsHealthListResultIterator, err error) -} - -var _ OperationsHealthClientAPI = (*sql.OperationsHealthClient)(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) @@ -927,29 +791,6 @@ type RestorePointsClientAPI interface { var _ RestorePointsClientAPI = (*sql.RestorePointsClient)(nil) -// SensitivityLabelsClientAPI contains the set of methods on the SensitivityLabelsClient type. -type SensitivityLabelsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, parameters sql.SensitivityLabel) (result sql.SensitivityLabel, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) - DisableRecommendation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) - EnableRecommendation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, sensitivityLabelSource sql.SensitivityLabelSource) (result sql.SensitivityLabel, err error) - ListCurrentByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string, skipToken string, count *bool, filter string) (result sql.SensitivityLabelListResultPage, err error) - ListCurrentByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, skipToken string, count *bool, filter string) (result sql.SensitivityLabelListResultIterator, err error) - ListRecommendedByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string, skipToken string, includeDisabledRecommendations *bool, filter string) (result sql.SensitivityLabelListResultPage, err error) - ListRecommendedByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, skipToken string, includeDisabledRecommendations *bool, filter string) (result sql.SensitivityLabelListResultIterator, err error) - Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.SensitivityLabelUpdateList) (result autorest.Response, err error) -} - -var _ SensitivityLabelsClientAPI = (*sql.SensitivityLabelsClient)(nil) - -// RecommendedSensitivityLabelsClientAPI contains the set of methods on the RecommendedSensitivityLabelsClient type. -type RecommendedSensitivityLabelsClientAPI interface { - Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.RecommendedSensitivityLabelUpdateList) (result autorest.Response, err error) -} - -var _ RecommendedSensitivityLabelsClientAPI = (*sql.RecommendedSensitivityLabelsClient)(nil) - // ServerAdvisorsClientAPI contains the set of methods on the ServerAdvisorsClient type. type ServerAdvisorsClientAPI interface { Get(ctx context.Context, resourceGroupName string, serverName string, advisorName string) (result sql.Advisor, err error) @@ -1105,8 +946,8 @@ type SyncGroupsClientAPI interface { ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.SyncGroupListResultIterator, err error) ListHubSchemas(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncFullSchemaPropertiesListResultPage, err error) ListHubSchemasComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncFullSchemaPropertiesListResultIterator, err error) - ListLogs(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParameter string, continuationToken string) (result sql.SyncGroupLogListResultPage, err error) - ListLogsComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParameter string, continuationToken string) (result sql.SyncGroupLogListResultIterator, err error) + ListLogs(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParameter sql.SyncGroupsType, continuationToken string) (result sql.SyncGroupLogListResultPage, err error) + ListLogsComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParameter sql.SyncGroupsType, continuationToken string) (result sql.SyncGroupLogListResultIterator, err error) ListSyncDatabaseIds(ctx context.Context, locationName string) (result sql.SyncDatabaseIDListResultPage, err error) ListSyncDatabaseIdsComplete(ctx context.Context, locationName string) (result sql.SyncDatabaseIDListResultIterator, err error) RefreshHubSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncGroupsRefreshHubSchemaFuture, err error) @@ -1194,6 +1035,16 @@ type WorkloadGroupsClientAPI interface { var _ WorkloadGroupsClientAPI = (*sql.WorkloadGroupsClient)(nil) +// TransparentDataEncryptionsClientAPI contains the set of methods on the TransparentDataEncryptionsClient type. +type TransparentDataEncryptionsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.LogicalDatabaseTransparentDataEncryption) (result sql.LogicalDatabaseTransparentDataEncryption, err error) + Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.LogicalDatabaseTransparentDataEncryption, err error) + ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.LogicalDatabaseTransparentDataEncryptionListResultPage, err error) + ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.LogicalDatabaseTransparentDataEncryptionListResultIterator, err error) +} + +var _ TransparentDataEncryptionsClientAPI = (*sql.TransparentDataEncryptionsClient)(nil) + // BackupShortTermRetentionPoliciesClientAPI contains the set of methods on the BackupShortTermRetentionPoliciesClient type. type BackupShortTermRetentionPoliciesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.BackupShortTermRetentionPolicy) (result sql.BackupShortTermRetentionPoliciesCreateOrUpdateFuture, err error) @@ -1234,8 +1085,8 @@ var _ DatabaseUsagesClientAPI = (*sql.DatabaseUsagesClient)(nil) // LedgerDigestUploadsClientAPI contains the set of methods on the LedgerDigestUploadsClient type. type LedgerDigestUploadsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.LedgerDigestUploads) (result sql.LedgerDigestUploads, err error) - Disable(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.LedgerDigestUploads, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.LedgerDigestUploads) (result sql.LedgerDigestUploadsCreateOrUpdateFuture, err error) + Disable(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.LedgerDigestUploadsDisableFuture, err error) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.LedgerDigestUploads, err error) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.LedgerDigestUploadsListResultPage, err error) ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.LedgerDigestUploadsListResultIterator, err error) @@ -1254,24 +1105,6 @@ type OutboundFirewallRulesClientAPI interface { var _ OutboundFirewallRulesClientAPI = (*sql.OutboundFirewallRulesClient)(nil) -// RestorableDroppedDatabasesClientAPI contains the set of methods on the RestorableDroppedDatabasesClient type. -type RestorableDroppedDatabasesClientAPI interface { - Get(ctx context.Context, resourceGroupName string, serverName string, restorableDroppedDatabaseID string) (result sql.RestorableDroppedDatabase, err error) - ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.RestorableDroppedDatabaseListResultPage, err error) - ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result sql.RestorableDroppedDatabaseListResultIterator, err error) -} - -var _ RestorableDroppedDatabasesClientAPI = (*sql.RestorableDroppedDatabasesClient)(nil) - -// RestorableDroppedManagedDatabasesClientAPI contains the set of methods on the RestorableDroppedManagedDatabasesClient type. -type RestorableDroppedManagedDatabasesClientAPI interface { - Get(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string) (result sql.RestorableDroppedManagedDatabase, err error) - ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.RestorableDroppedManagedDatabaseListResultPage, err error) - ListByInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.RestorableDroppedManagedDatabaseListResultIterator, err error) -} - -var _ RestorableDroppedManagedDatabasesClientAPI = (*sql.RestorableDroppedManagedDatabasesClient)(nil) - // ServersClientAPI contains the set of methods on the ServersClient type. type ServersClientAPI interface { CheckNameAvailability(ctx context.Context, parameters sql.CheckNameAvailabilityRequest) (result sql.CheckNameAvailabilityResponse, err error) @@ -1295,3 +1128,198 @@ type UsagesClientAPI interface { } var _ UsagesClientAPI = (*sql.UsagesClient)(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) + +// LongTermRetentionManagedInstanceBackupsClientAPI contains the set of methods on the LongTermRetentionManagedInstanceBackupsClient type. +type LongTermRetentionManagedInstanceBackupsClientAPI interface { + Delete(ctx context.Context, locationName string, managedInstanceName string, databaseName string, backupName string) (result sql.LongTermRetentionManagedInstanceBackupsDeleteFuture, err error) + 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.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) + +// 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, expand string) (result sql.ManagedInstance, err error) + List(ctx context.Context, expand string) (result sql.ManagedInstanceListResultPage, err error) + ListComplete(ctx context.Context, expand string) (result sql.ManagedInstanceListResultIterator, err error) + ListByInstancePool(ctx context.Context, resourceGroupName string, instancePoolName string, expand string) (result sql.ManagedInstanceListResultPage, err error) + ListByInstancePoolComplete(ctx context.Context, resourceGroupName string, instancePoolName string, expand 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, expand string) (result sql.ManagedInstanceListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, expand 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) + +// RestorableDroppedDatabasesClientAPI contains the set of methods on the RestorableDroppedDatabasesClient type. +type RestorableDroppedDatabasesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, serverName string, restorableDroppedDatabaseID string) (result sql.RestorableDroppedDatabase, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.RestorableDroppedDatabaseListResultPage, err error) + ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result sql.RestorableDroppedDatabaseListResultIterator, err error) +} + +var _ RestorableDroppedDatabasesClientAPI = (*sql.RestorableDroppedDatabasesClient)(nil) + +// RestorableDroppedManagedDatabasesClientAPI contains the set of methods on the RestorableDroppedManagedDatabasesClient type. +type RestorableDroppedManagedDatabasesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string) (result sql.RestorableDroppedManagedDatabase, err error) + ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.RestorableDroppedManagedDatabaseListResultPage, err error) + ListByInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.RestorableDroppedManagedDatabaseListResultIterator, err error) +} + +var _ RestorableDroppedManagedDatabasesClientAPI = (*sql.RestorableDroppedManagedDatabasesClient)(nil) + +// ServerConnectionPoliciesClientAPI contains the set of methods on the ServerConnectionPoliciesClient type. +type ServerConnectionPoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters sql.ServerConnectionPolicy) (result sql.ServerConnectionPoliciesCreateOrUpdateFuture, err error) + Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerConnectionPolicy, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerConnectionPolicyListResultPage, err error) + ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result sql.ServerConnectionPolicyListResultIterator, err error) +} + +var _ ServerConnectionPoliciesClientAPI = (*sql.ServerConnectionPoliciesClient)(nil) + +// DistributedAvailabilityGroupsClientAPI contains the set of methods on the DistributedAvailabilityGroupsClient type. +type DistributedAvailabilityGroupsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters sql.DistributedAvailabilityGroup) (result sql.DistributedAvailabilityGroupsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string) (result sql.DistributedAvailabilityGroupsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string) (result sql.DistributedAvailabilityGroup, err error) + ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.DistributedAvailabilityGroupsListResultPage, err error) + ListByInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.DistributedAvailabilityGroupsListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters sql.DistributedAvailabilityGroup) (result sql.DistributedAvailabilityGroupsUpdateFuture, err error) +} + +var _ DistributedAvailabilityGroupsClientAPI = (*sql.DistributedAvailabilityGroupsClient)(nil) + +// ServerTrustCertificatesClientAPI contains the set of methods on the ServerTrustCertificatesClient type. +type ServerTrustCertificatesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, certificateName string, parameters sql.ServerTrustCertificate) (result sql.ServerTrustCertificatesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, certificateName string) (result sql.ServerTrustCertificatesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, managedInstanceName string, certificateName string) (result sql.ServerTrustCertificate, err error) + ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.ServerTrustCertificatesListResultPage, err error) + ListByInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.ServerTrustCertificatesListResultIterator, err error) +} + +var _ ServerTrustCertificatesClientAPI = (*sql.ServerTrustCertificatesClient)(nil) + +// IPv6FirewallRulesClientAPI contains the set of methods on the IPv6FirewallRulesClient type. +type IPv6FirewallRulesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters sql.IPv6FirewallRule) (result sql.IPv6FirewallRule, err error) + Delete(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (result sql.IPv6FirewallRule, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.IPv6FirewallRuleListResultPage, err error) + ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result sql.IPv6FirewallRuleListResultIterator, err error) +} + +var _ IPv6FirewallRulesClientAPI = (*sql.IPv6FirewallRulesClient)(nil) + +// EndpointCertificatesClientAPI contains the set of methods on the EndpointCertificatesClient type. +type EndpointCertificatesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, managedInstanceName string, endpointType string) (result sql.EndpointCertificate, err error) + ListByInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.EndpointCertificateListResultPage, err error) + ListByInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.EndpointCertificateListResultIterator, err error) +} + +var _ EndpointCertificatesClientAPI = (*sql.EndpointCertificatesClient)(nil) + +// ReplicationLinksClientAPI contains the set of methods on the ReplicationLinksClient type. +type ReplicationLinksClientAPI interface { + Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result sql.ReplicationLink, err error) + ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.ReplicationLinkListResultPage, err error) + ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.ReplicationLinkListResultIterator, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ReplicationLinkListResultPage, err error) + ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result sql.ReplicationLinkListResultIterator, err error) +} + +var _ ReplicationLinksClientAPI = (*sql.ReplicationLinksClient)(nil) + +// ManagedDatabaseSensitivityLabelsClientAPI contains the set of methods on the ManagedDatabaseSensitivityLabelsClient type. +type ManagedDatabaseSensitivityLabelsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, parameters sql.SensitivityLabel) (result sql.SensitivityLabel, err error) + Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) + DisableRecommendation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) + EnableRecommendation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, sensitivityLabelSource sql.SensitivityLabelSource) (result sql.SensitivityLabel, err error) + ListCurrentByDatabase(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, skipToken string, count *bool, filter string) (result sql.SensitivityLabelListResultPage, err error) + ListCurrentByDatabaseComplete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, skipToken string, count *bool, filter string) (result sql.SensitivityLabelListResultIterator, err error) + ListRecommendedByDatabase(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, skipToken string, includeDisabledRecommendations *bool, filter string) (result sql.SensitivityLabelListResultPage, err error) + ListRecommendedByDatabaseComplete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, skipToken string, includeDisabledRecommendations *bool, filter string) (result sql.SensitivityLabelListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters sql.SensitivityLabelUpdateList) (result autorest.Response, err error) +} + +var _ ManagedDatabaseSensitivityLabelsClientAPI = (*sql.ManagedDatabaseSensitivityLabelsClient)(nil) + +// ManagedDatabaseRecommendedSensitivityLabelsClientAPI contains the set of methods on the ManagedDatabaseRecommendedSensitivityLabelsClient type. +type ManagedDatabaseRecommendedSensitivityLabelsClientAPI interface { + Update(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters sql.RecommendedSensitivityLabelUpdateList) (result autorest.Response, err error) +} + +var _ ManagedDatabaseRecommendedSensitivityLabelsClientAPI = (*sql.ManagedDatabaseRecommendedSensitivityLabelsClient)(nil) + +// SensitivityLabelsClientAPI contains the set of methods on the SensitivityLabelsClient type. +type SensitivityLabelsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, parameters sql.SensitivityLabel) (result sql.SensitivityLabel, err error) + Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) + DisableRecommendation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) + EnableRecommendation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, sensitivityLabelSource sql.SensitivityLabelSource) (result sql.SensitivityLabel, err error) + ListCurrentByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string, skipToken string, count *bool, filter string) (result sql.SensitivityLabelListResultPage, err error) + ListCurrentByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, skipToken string, count *bool, filter string) (result sql.SensitivityLabelListResultIterator, err error) + ListRecommendedByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string, skipToken string, includeDisabledRecommendations *bool, filter string) (result sql.SensitivityLabelListResultPage, err error) + ListRecommendedByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, skipToken string, includeDisabledRecommendations *bool, filter string) (result sql.SensitivityLabelListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.SensitivityLabelUpdateList) (result autorest.Response, err error) +} + +var _ SensitivityLabelsClientAPI = (*sql.SensitivityLabelsClient)(nil) + +// RecommendedSensitivityLabelsClientAPI contains the set of methods on the RecommendedSensitivityLabelsClient type. +type RecommendedSensitivityLabelsClientAPI interface { + Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.RecommendedSensitivityLabelUpdateList) (result autorest.Response, err error) +} + +var _ RecommendedSensitivityLabelsClientAPI = (*sql.RecommendedSensitivityLabelsClient)(nil) diff --git a/services/preview/sql/mgmt/v5.0/sql/syncgroups.go b/services/preview/sql/mgmt/v5.0/sql/syncgroups.go index e8fbad895e04..0d388e00ce91 100644 --- a/services/preview/sql/mgmt/v5.0/sql/syncgroups.go +++ b/services/preview/sql/mgmt/v5.0/sql/syncgroups.go @@ -626,7 +626,7 @@ func (client SyncGroupsClient) ListHubSchemasComplete(ctx context.Context, resou // endTime - get logs generated before this time. // typeParameter - the types of logs to retrieve. // continuationToken - the continuation token for this operation. -func (client SyncGroupsClient) ListLogs(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParameter string, continuationToken string) (result SyncGroupLogListResultPage, err error) { +func (client SyncGroupsClient) ListLogs(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParameter SyncGroupsType, continuationToken string) (result SyncGroupLogListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.ListLogs") defer func() { @@ -665,7 +665,7 @@ func (client SyncGroupsClient) ListLogs(ctx context.Context, resourceGroupName s } // ListLogsPreparer prepares the ListLogs request. -func (client SyncGroupsClient) ListLogsPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParameter string, continuationToken string) (*http.Request, error) { +func (client SyncGroupsClient) ListLogsPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParameter SyncGroupsType, continuationToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -733,7 +733,7 @@ func (client SyncGroupsClient) listLogsNextResults(ctx context.Context, lastResu } // ListLogsComplete enumerates all values, automatically crossing page boundaries as required. -func (client SyncGroupsClient) ListLogsComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParameter string, continuationToken string) (result SyncGroupLogListResultIterator, err error) { +func (client SyncGroupsClient) ListLogsComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParameter SyncGroupsType, continuationToken string) (result SyncGroupLogListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.ListLogs") defer func() { diff --git a/services/preview/sql/mgmt/v5.0/sql/transparentdataencryptionactivities.go b/services/preview/sql/mgmt/v5.0/sql/transparentdataencryptionactivities.go deleted file mode 100644 index 309e0d47eb0d..000000000000 --- a/services/preview/sql/mgmt/v5.0/sql/transparentdataencryptionactivities.go +++ /dev/null @@ -1,115 +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/tracing" - "net/http" -) - -// TransparentDataEncryptionActivitiesClient 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 TransparentDataEncryptionActivitiesClient struct { - BaseClient -} - -// NewTransparentDataEncryptionActivitiesClient creates an instance of the TransparentDataEncryptionActivitiesClient -// client. -func NewTransparentDataEncryptionActivitiesClient(subscriptionID string) TransparentDataEncryptionActivitiesClient { - return NewTransparentDataEncryptionActivitiesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewTransparentDataEncryptionActivitiesClientWithBaseURI creates an instance of the -// TransparentDataEncryptionActivitiesClient 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 NewTransparentDataEncryptionActivitiesClientWithBaseURI(baseURI string, subscriptionID string) TransparentDataEncryptionActivitiesClient { - return TransparentDataEncryptionActivitiesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListByConfiguration returns a database's transparent data encryption operation result. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -// databaseName - the name of the database for which the transparent data encryption applies. -func (client TransparentDataEncryptionActivitiesClient) ListByConfiguration(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result TransparentDataEncryptionActivityListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TransparentDataEncryptionActivitiesClient.ListByConfiguration") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListByConfigurationPreparer(ctx, resourceGroupName, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionActivitiesClient", "ListByConfiguration", nil, "Failure preparing request") - return - } - - resp, err := client.ListByConfigurationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionActivitiesClient", "ListByConfiguration", resp, "Failure sending request") - return - } - - result, err = client.ListByConfigurationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionActivitiesClient", "ListByConfiguration", resp, "Failure responding to request") - return - } - - return -} - -// ListByConfigurationPreparer prepares the ListByConfiguration request. -func (client TransparentDataEncryptionActivitiesClient) ListByConfigurationPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "transparentDataEncryptionName": autorest.Encode("path", "current"), - } - - const APIVersion = "2014-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}/operationResults", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByConfigurationSender sends the ListByConfiguration request. The method will close the -// http.Response Body if it receives an error. -func (client TransparentDataEncryptionActivitiesClient) ListByConfigurationSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByConfigurationResponder handles the response to the ListByConfiguration request. The method always -// closes the http.Response Body. -func (client TransparentDataEncryptionActivitiesClient) ListByConfigurationResponder(resp *http.Response) (result TransparentDataEncryptionActivityListResult, 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/v5.0/sql/transparentdataencryptions.go b/services/preview/sql/mgmt/v5.0/sql/transparentdataencryptions.go index 691b41cd1464..79f9d00ca5a6 100644 --- a/services/preview/sql/mgmt/v5.0/sql/transparentdataencryptions.go +++ b/services/preview/sql/mgmt/v5.0/sql/transparentdataencryptions.go @@ -33,14 +33,14 @@ func NewTransparentDataEncryptionsClientWithBaseURI(baseURI string, subscription return TransparentDataEncryptionsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a database's transparent data encryption configuration. +// CreateOrUpdate updates a logical database's transparent data encryption configuration. // Parameters: // resourceGroupName - the name of the resource group that contains the resource. You can obtain this value // from the Azure Resource Manager API or the portal. // serverName - the name of the server. -// databaseName - the name of the database for which setting the transparent data encryption applies. -// parameters - the required parameters for creating or updating transparent data encryption. -func (client TransparentDataEncryptionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters TransparentDataEncryption) (result TransparentDataEncryption, err error) { +// databaseName - the name of the logical database for which the security alert policy is defined. +// parameters - the database transparent data encryption. +func (client TransparentDataEncryptionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters LogicalDatabaseTransparentDataEncryption) (result LogicalDatabaseTransparentDataEncryption, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TransparentDataEncryptionsClient.CreateOrUpdate") defer func() { @@ -74,26 +74,25 @@ func (client TransparentDataEncryptionsClient) CreateOrUpdate(ctx context.Contex } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client TransparentDataEncryptionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters TransparentDataEncryption) (*http.Request, error) { +func (client TransparentDataEncryptionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters LogicalDatabaseTransparentDataEncryption) (*http.Request, error) { pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "transparentDataEncryptionName": autorest.Encode("path", "current"), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tdeName": autorest.Encode("path", "current"), } - const APIVersion = "2014-04-01" + const APIVersion = "2021-02-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } - parameters.Location = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -107,23 +106,23 @@ func (client TransparentDataEncryptionsClient) CreateOrUpdateSender(req *http.Re // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client TransparentDataEncryptionsClient) CreateOrUpdateResponder(resp *http.Response) (result TransparentDataEncryption, err error) { +func (client TransparentDataEncryptionsClient) CreateOrUpdateResponder(resp *http.Response) (result LogicalDatabaseTransparentDataEncryption, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// Get gets a database's transparent data encryption configuration. +// Get gets a logical database's transparent data encryption. // Parameters: // resourceGroupName - the name of the resource group that contains the resource. You can obtain this value // from the Azure Resource Manager API or the portal. // serverName - the name of the server. -// databaseName - the name of the database for which the transparent data encryption applies. -func (client TransparentDataEncryptionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result TransparentDataEncryption, err error) { +// databaseName - the name of the logical database for which the transparent data encryption is defined. +func (client TransparentDataEncryptionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result LogicalDatabaseTransparentDataEncryption, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TransparentDataEncryptionsClient.Get") defer func() { @@ -159,14 +158,14 @@ func (client TransparentDataEncryptionsClient) Get(ctx context.Context, resource // GetPreparer prepares the Get request. func (client TransparentDataEncryptionsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "transparentDataEncryptionName": autorest.Encode("path", "current"), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tdeName": autorest.Encode("path", "current"), } - const APIVersion = "2014-04-01" + const APIVersion = "2021-02-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -174,7 +173,7 @@ func (client TransparentDataEncryptionsClient) GetPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -187,7 +186,7 @@ func (client TransparentDataEncryptionsClient) GetSender(req *http.Request) (*ht // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client TransparentDataEncryptionsClient) GetResponder(resp *http.Response) (result TransparentDataEncryption, err error) { +func (client TransparentDataEncryptionsClient) GetResponder(resp *http.Response) (result LogicalDatabaseTransparentDataEncryption, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -196,3 +195,124 @@ func (client TransparentDataEncryptionsClient) GetResponder(resp *http.Response) result.Response = autorest.Response{Response: resp} return } + +// ListByDatabase gets a list of the logical database's transparent data encryption. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +// databaseName - the name of the logical database for which the transparent data encryption is defined. +func (client TransparentDataEncryptionsClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result LogicalDatabaseTransparentDataEncryptionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TransparentDataEncryptionsClient.ListByDatabase") + defer func() { + sc := -1 + if result.ldtdelr.Response.Response != nil { + sc = result.ldtdelr.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.TransparentDataEncryptionsClient", "ListByDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseSender(req) + if err != nil { + result.ldtdelr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionsClient", "ListByDatabase", resp, "Failure sending request") + return + } + + result.ldtdelr, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionsClient", "ListByDatabase", resp, "Failure responding to request") + return + } + if result.ldtdelr.hasNextLink() && result.ldtdelr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByDatabasePreparer prepares the ListByDatabase request. +func (client TransparentDataEncryptionsClient) 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), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDatabaseSender sends the ListByDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client TransparentDataEncryptionsClient) 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 TransparentDataEncryptionsClient) ListByDatabaseResponder(resp *http.Response) (result LogicalDatabaseTransparentDataEncryptionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDatabaseNextResults retrieves the next set of results, if any. +func (client TransparentDataEncryptionsClient) listByDatabaseNextResults(ctx context.Context, lastResults LogicalDatabaseTransparentDataEncryptionListResult) (result LogicalDatabaseTransparentDataEncryptionListResult, err error) { + req, err := lastResults.logicalDatabaseTransparentDataEncryptionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionsClient", "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.TransparentDataEncryptionsClient", "listByDatabaseNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionsClient", "listByDatabaseNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. +func (client TransparentDataEncryptionsClient) ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result LogicalDatabaseTransparentDataEncryptionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TransparentDataEncryptionsClient.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/sql/mgmt/2014-04-01/sql/CHANGELOG.md b/services/sql/mgmt/2014-04-01/sql/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/sql/mgmt/2014-04-01/sql/CHANGELOG.md +++ b/services/sql/mgmt/2014-04-01/sql/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/sql/mgmt/2014-04-01/sql/_meta.json b/services/sql/mgmt/2014-04-01/sql/_meta.json index 062071db058d..58ff6ab77224 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": "0dc36a61d0262fdce1de05e28de0cd55d74e18a9", "readme": "/_/azure-rest-api-specs/specification/sql/resource-manager/readme.md", "tag": "package-pure-2014-04", "use": "@microsoft.azure/autorest.go@2.1.187",