diff --git a/sdk/resourcemanager/sql/armsql/CHANGELOG.md b/sdk/resourcemanager/sql/armsql/CHANGELOG.md index af5d3e8e04c0..8049553187b5 100644 --- a/sdk/resourcemanager/sql/armsql/CHANGELOG.md +++ b/sdk/resourcemanager/sql/armsql/CHANGELOG.md @@ -1,5 +1,119 @@ # Release History +## 2.0.0-beta.1 (2022-08-23) +### Breaking Changes + +- Type of `ManagedDatabaseRestoreDetailsProperties.UnrestorableFiles` has been changed from `[]*string` to `[]*ManagedDatabaseRestoreDetailsUnrestorableFileProperties` +- Type of `ManagedDatabaseRestoreDetailsProperties.PercentCompleted` has been changed from `*float64` to `*int32` +- Type of `ManagedDatabaseRestoreDetailsProperties.NumberOfFilesDetected` has been changed from `*int64` to `*int32` +- Function `*ReplicationLinksClient.Delete` has been removed +- Struct `ReplicationLinksClientDeleteOptions` has been removed + +### Features Added + +- New const `SecondaryTypeStandby` +- New const `DtcNameCurrent` +- New const `ReplicationLinkTypeSTANDBY` +- New const `MoveOperationModeCopy` +- New const `MoveOperationModeMove` +- New type alias `MoveOperationMode` +- New type alias `DtcName` +- New function `*ManagedServerDNSAliasesClient.NewListByManagedInstancePager(string, string, *ManagedServerDNSAliasesClientListByManagedInstanceOptions) *runtime.Pager[ManagedServerDNSAliasesClientListByManagedInstanceResponse]` +- New function `NewManagedInstanceAdvancedThreatProtectionSettingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedInstanceAdvancedThreatProtectionSettingsClient, error)` +- New function `PossibleDtcNameValues() []DtcName` +- New function `*ManagedDatabasesClient.BeginCompleteMove(context.Context, string, string, string, ManagedDatabaseMoveDefinition, *ManagedDatabasesClientBeginCompleteMoveOptions) (*runtime.Poller[ManagedDatabasesClientCompleteMoveResponse], error)` +- New function `*ManagedServerDNSAliasesClient.BeginDelete(context.Context, string, string, string, *ManagedServerDNSAliasesClientBeginDeleteOptions) (*runtime.Poller[ManagedServerDNSAliasesClientDeleteResponse], error)` +- New function `*ManagedInstanceDtcsClient.Get(context.Context, string, string, DtcName, *ManagedInstanceDtcsClientGetOptions) (ManagedInstanceDtcsClientGetResponse, error)` +- New function `*ManagedServerDNSAliasesClient.BeginAcquire(context.Context, string, string, string, ManagedServerDNSAliasAcquisition, *ManagedServerDNSAliasesClientBeginAcquireOptions) (*runtime.Poller[ManagedServerDNSAliasesClientAcquireResponse], error)` +- New function `PossibleMoveOperationModeValues() []MoveOperationMode` +- New function `*ManagedInstanceAdvancedThreatProtectionSettingsClient.NewListByInstancePager(string, string, *ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceOptions) *runtime.Pager[ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse]` +- New function `*ReplicationLinksClient.BeginDelete(context.Context, string, string, string, string, *ReplicationLinksClientBeginDeleteOptions) (*runtime.Poller[ReplicationLinksClientDeleteResponse], error)` +- New function `*ManagedInstanceAdvancedThreatProtectionSettingsClient.Get(context.Context, string, string, AdvancedThreatProtectionName, *ManagedInstanceAdvancedThreatProtectionSettingsClientGetOptions) (ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse, error)` +- New function `*ManagedServerDNSAliasesClient.Get(context.Context, string, string, string, *ManagedServerDNSAliasesClientGetOptions) (ManagedServerDNSAliasesClientGetResponse, error)` +- New function `*ManagedDatabasesClient.BeginCancelMove(context.Context, string, string, string, ManagedDatabaseMoveDefinition, *ManagedDatabasesClientBeginCancelMoveOptions) (*runtime.Poller[ManagedDatabasesClientCancelMoveResponse], error)` +- New function `*ManagedDatabaseAdvancedThreatProtectionSettingsClient.NewListByDatabasePager(string, string, string, *ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions) *runtime.Pager[ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse]` +- New function `*ManagedInstanceAdvancedThreatProtectionSettingsClient.BeginCreateOrUpdate(context.Context, string, string, AdvancedThreatProtectionName, ManagedInstanceAdvancedThreatProtection, *ManagedInstanceAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedInstanceAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse], error)` +- New function `*ManagedDatabaseAdvancedThreatProtectionSettingsClient.Get(context.Context, string, string, string, AdvancedThreatProtectionName, *ManagedDatabaseAdvancedThreatProtectionSettingsClientGetOptions) (ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse, error)` +- New function `*ManagedDatabasesClient.BeginStartMove(context.Context, string, string, string, ManagedDatabaseStartMoveDefinition, *ManagedDatabasesClientBeginStartMoveOptions) (*runtime.Poller[ManagedDatabasesClientStartMoveResponse], error)` +- New function `*ManagedDatabaseAdvancedThreatProtectionSettingsClient.CreateOrUpdate(context.Context, string, string, string, AdvancedThreatProtectionName, ManagedDatabaseAdvancedThreatProtection, *ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions) (ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse, error)` +- New function `*ManagedServerDNSAliasesClient.BeginCreateOrUpdate(context.Context, string, string, string, ManagedServerDNSAliasCreation, *ManagedServerDNSAliasesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedServerDNSAliasesClientCreateOrUpdateResponse], error)` +- New function `NewManagedInstanceDtcsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedInstanceDtcsClient, error)` +- New function `NewManagedServerDNSAliasesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedServerDNSAliasesClient, error)` +- New function `NewManagedDatabaseAdvancedThreatProtectionSettingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedDatabaseAdvancedThreatProtectionSettingsClient, error)` +- New function `*ManagedInstanceDtcsClient.NewListByManagedInstancePager(string, string, *ManagedInstanceDtcsClientListByManagedInstanceOptions) *runtime.Pager[ManagedInstanceDtcsClientListByManagedInstanceResponse]` +- New function `*ManagedInstanceDtcsClient.BeginCreateOrUpdate(context.Context, string, string, DtcName, ManagedInstanceDtc, *ManagedInstanceDtcsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedInstanceDtcsClientCreateOrUpdateResponse], error)` +- New struct `ManagedDatabaseAdvancedThreatProtection` +- New struct `ManagedDatabaseAdvancedThreatProtectionListResult` +- New struct `ManagedDatabaseAdvancedThreatProtectionSettingsClient` +- New struct `ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions` +- New struct `ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse` +- New struct `ManagedDatabaseAdvancedThreatProtectionSettingsClientGetOptions` +- New struct `ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse` +- New struct `ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions` +- New struct `ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse` +- New struct `ManagedDatabaseMoveDefinition` +- New struct `ManagedDatabaseRestoreDetailsBackupSetProperties` +- New struct `ManagedDatabaseRestoreDetailsUnrestorableFileProperties` +- New struct `ManagedDatabaseStartMoveDefinition` +- New struct `ManagedDatabasesClientBeginCancelMoveOptions` +- New struct `ManagedDatabasesClientBeginCompleteMoveOptions` +- New struct `ManagedDatabasesClientBeginStartMoveOptions` +- New struct `ManagedDatabasesClientCancelMoveResponse` +- New struct `ManagedDatabasesClientCompleteMoveResponse` +- New struct `ManagedDatabasesClientStartMoveResponse` +- New struct `ManagedInstanceAdvancedThreatProtection` +- New struct `ManagedInstanceAdvancedThreatProtectionListResult` +- New struct `ManagedInstanceAdvancedThreatProtectionSettingsClient` +- New struct `ManagedInstanceAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions` +- New struct `ManagedInstanceAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse` +- New struct `ManagedInstanceAdvancedThreatProtectionSettingsClientGetOptions` +- New struct `ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse` +- New struct `ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceOptions` +- New struct `ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse` +- New struct `ManagedInstanceDtc` +- New struct `ManagedInstanceDtcListResult` +- New struct `ManagedInstanceDtcProperties` +- New struct `ManagedInstanceDtcSecuritySettings` +- New struct `ManagedInstanceDtcTransactionManagerCommunicationSettings` +- New struct `ManagedInstanceDtcsClient` +- New struct `ManagedInstanceDtcsClientBeginCreateOrUpdateOptions` +- New struct `ManagedInstanceDtcsClientCreateOrUpdateResponse` +- New struct `ManagedInstanceDtcsClientGetOptions` +- New struct `ManagedInstanceDtcsClientGetResponse` +- New struct `ManagedInstanceDtcsClientListByManagedInstanceOptions` +- New struct `ManagedInstanceDtcsClientListByManagedInstanceResponse` +- New struct `ManagedServerDNSAlias` +- New struct `ManagedServerDNSAliasAcquisition` +- New struct `ManagedServerDNSAliasCreation` +- New struct `ManagedServerDNSAliasListResult` +- New struct `ManagedServerDNSAliasProperties` +- New struct `ManagedServerDNSAliasesClient` +- New struct `ManagedServerDNSAliasesClientAcquireResponse` +- New struct `ManagedServerDNSAliasesClientBeginAcquireOptions` +- New struct `ManagedServerDNSAliasesClientBeginCreateOrUpdateOptions` +- New struct `ManagedServerDNSAliasesClientBeginDeleteOptions` +- New struct `ManagedServerDNSAliasesClientCreateOrUpdateResponse` +- New struct `ManagedServerDNSAliasesClientDeleteResponse` +- New struct `ManagedServerDNSAliasesClientGetOptions` +- New struct `ManagedServerDNSAliasesClientGetResponse` +- New struct `ManagedServerDNSAliasesClientListByManagedInstanceOptions` +- New struct `ManagedServerDNSAliasesClientListByManagedInstanceResponse` +- New struct `ReplicationLinksClientBeginDeleteOptions` +- New field `CurrentBackupType` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `DiffBackupSets` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `CurrentRestoredSizeMB` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `FullBackupSets` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `NumberOfFilesRestored` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `NumberOfFilesSkipped` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `Type` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `NumberOfFilesQueued` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `NumberOfFilesUnrestorable` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `CurrentRestorePlanSizeMB` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `LogBackupSets` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `NumberOfFilesRestoring` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `StorageContainerIdentity` in struct `ManagedDatabaseProperties` + + ## 1.0.0 (2022-06-02) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_agent_client.go b/sdk/resourcemanager/sql/armsql/agent_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_agent_client.go rename to sdk/resourcemanager/sql/armsql/agent_client.go index 19822bfd09e6..8ba3e9ab978d 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_agent_client.go +++ b/sdk/resourcemanager/sql/armsql/agent_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/autorest.md b/sdk/resourcemanager/sql/armsql/autorest.md index ee2ef7c1a0e5..b475ff644ea1 100644 --- a/sdk/resourcemanager/sql/armsql/autorest.md +++ b/sdk/resourcemanager/sql/armsql/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/sql/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/sql/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 2.0.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_backupshorttermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_backupshorttermretentionpolicies_client.go rename to sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client.go index 03b32af136a4..6274db4b534b 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_backupshorttermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_capabilities_client.go b/sdk/resourcemanager/sql/armsql/capabilities_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_capabilities_client.go rename to sdk/resourcemanager/sql/armsql/capabilities_client.go index a1b2612036cf..65a581f6d520 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_capabilities_client.go +++ b/sdk/resourcemanager/sql/armsql/capabilities_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_constants.go b/sdk/resourcemanager/sql/armsql/constants.go similarity index 98% rename from sdk/resourcemanager/sql/armsql/zz_generated_constants.go rename to sdk/resourcemanager/sql/armsql/constants.go index 099a18de7eda..fe5cb5e3b4d3 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_constants.go +++ b/sdk/resourcemanager/sql/armsql/constants.go @@ -5,12 +5,13 @@ // 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. +// DO NOT EDIT. package armsql const ( moduleName = "armsql" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0-beta.1" ) type AdministratorName string @@ -286,7 +287,7 @@ func PossibleAutomaticTuningServerReasonValues() []AutomaticTuningServerReason { } } -// BackupStorageRedundancy - The storage account type used to store backups for this database. +// BackupStorageRedundancy - The storage redundancy type of the copied backup type BackupStorageRedundancy string const ( @@ -818,6 +819,19 @@ func PossibleDiffBackupIntervalInHoursValues() []DiffBackupIntervalInHours { } } +type DtcName string + +const ( + DtcNameCurrent DtcName = "current" +) + +// PossibleDtcNameValues returns the possible values for the DtcName const type. +func PossibleDtcNameValues() []DtcName { + return []DtcName{ + DtcNameCurrent, + } +} + // ElasticPoolLicenseType - The license type to apply for this elastic pool. type ElasticPoolLicenseType string @@ -1464,6 +1478,22 @@ func PossibleMetricTypeValues() []MetricType { } } +// MoveOperationMode - The move operation mode. +type MoveOperationMode string + +const ( + MoveOperationModeCopy MoveOperationMode = "Copy" + MoveOperationModeMove MoveOperationMode = "Move" +) + +// PossibleMoveOperationModeValues returns the possible values for the MoveOperationMode const type. +func PossibleMoveOperationModeValues() []MoveOperationMode { + return []MoveOperationMode{ + MoveOperationModeCopy, + MoveOperationModeMove, + } +} + // OperationMode - Operation Mode. type OperationMode string @@ -1807,12 +1837,13 @@ func PossibleReplicaTypeValues() []ReplicaType { } } -// ReplicationLinkType - Link type (GEO, NAMED). +// ReplicationLinkType - Link type (GEO, NAMED, STANDBY). type ReplicationLinkType string const ( - ReplicationLinkTypeGEO ReplicationLinkType = "GEO" - ReplicationLinkTypeNAMED ReplicationLinkType = "NAMED" + ReplicationLinkTypeGEO ReplicationLinkType = "GEO" + ReplicationLinkTypeNAMED ReplicationLinkType = "NAMED" + ReplicationLinkTypeSTANDBY ReplicationLinkType = "STANDBY" ) // PossibleReplicationLinkTypeValues returns the possible values for the ReplicationLinkType const type. @@ -1820,6 +1851,7 @@ func PossibleReplicationLinkTypeValues() []ReplicationLinkType { return []ReplicationLinkType{ ReplicationLinkTypeGEO, ReplicationLinkTypeNAMED, + ReplicationLinkTypeSTANDBY, } } @@ -1944,12 +1976,13 @@ func PossibleSampleNameValues() []SampleName { } } -// SecondaryType - The secondary type of the database if it is a secondary. Valid values are Geo and Named. +// SecondaryType - The secondary type of the database if it is a secondary. Valid values are Geo, Named and Standby. type SecondaryType string const ( - SecondaryTypeGeo SecondaryType = "Geo" - SecondaryTypeNamed SecondaryType = "Named" + SecondaryTypeGeo SecondaryType = "Geo" + SecondaryTypeNamed SecondaryType = "Named" + SecondaryTypeStandby SecondaryType = "Standby" ) // PossibleSecondaryTypeValues returns the possible values for the SecondaryType const type. @@ -1957,6 +1990,7 @@ func PossibleSecondaryTypeValues() []SecondaryType { return []SecondaryType{ SecondaryTypeGeo, SecondaryTypeNamed, + SecondaryTypeStandby, } } diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databaseadvancedthreatprotectionsettings_client.go b/sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_databaseadvancedthreatprotectionsettings_client.go rename to sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client.go index 23ef15b995f1..baf24f3b105d 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databaseadvancedthreatprotectionsettings_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databaseadvisors_client.go b/sdk/resourcemanager/sql/armsql/databaseadvisors_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_databaseadvisors_client.go rename to sdk/resourcemanager/sql/armsql/databaseadvisors_client.go index fbf894cf8870..3b8c307dbacc 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databaseadvisors_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseadvisors_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databaseautomatictuning_client.go b/sdk/resourcemanager/sql/armsql/databaseautomatictuning_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_databaseautomatictuning_client.go rename to sdk/resourcemanager/sql/armsql/databaseautomatictuning_client.go index 3826ebee3b40..45afd1e21445 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databaseautomatictuning_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseautomatictuning_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databaseblobauditingpolicies_client.go b/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_databaseblobauditingpolicies_client.go rename to sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client.go index 8b45149569c2..a5400304371c 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databaseblobauditingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databasecolumns_client.go b/sdk/resourcemanager/sql/armsql/databasecolumns_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_databasecolumns_client.go rename to sdk/resourcemanager/sql/armsql/databasecolumns_client.go index 415bef35b902..8a6a0efd38d5 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databasecolumns_client.go +++ b/sdk/resourcemanager/sql/armsql/databasecolumns_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databaseextensions_client.go b/sdk/resourcemanager/sql/armsql/databaseextensions_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_databaseextensions_client.go rename to sdk/resourcemanager/sql/armsql/databaseextensions_client.go index 45898aed9988..0947ae164a0b 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databaseextensions_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseextensions_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databaseoperations_client.go b/sdk/resourcemanager/sql/armsql/databaseoperations_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_databaseoperations_client.go rename to sdk/resourcemanager/sql/armsql/databaseoperations_client.go index fcd2ea77cb73..d3cd7eb94d31 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databaseoperations_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseoperations_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databaserecommendedactions_client.go b/sdk/resourcemanager/sql/armsql/databaserecommendedactions_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_databaserecommendedactions_client.go rename to sdk/resourcemanager/sql/armsql/databaserecommendedactions_client.go index 54058de2c788..44bd0ba67250 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databaserecommendedactions_client.go +++ b/sdk/resourcemanager/sql/armsql/databaserecommendedactions_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databases_client.go b/sdk/resourcemanager/sql/armsql/databases_client.go similarity index 96% rename from sdk/resourcemanager/sql/armsql/zz_generated_databases_client.go rename to sdk/resourcemanager/sql/armsql/databases_client.go index 803bb32711fd..9cf3bdf3f501 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databases_client.go +++ b/sdk/resourcemanager/sql/armsql/databases_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql @@ -56,7 +57,7 @@ func NewDatabasesClient(subscriptionID string, credential azcore.TokenCredential // BeginCreateOrUpdate - Creates a new database or updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -78,7 +79,7 @@ func (client *DatabasesClient) BeginCreateOrUpdate(ctx context.Context, resource // CreateOrUpdate - Creates a new database or updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview func (client *DatabasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { @@ -118,7 +119,7 @@ func (client *DatabasesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,7 +127,7 @@ func (client *DatabasesClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes the database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -146,7 +147,7 @@ func (client *DatabasesClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Deletes the database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview func (client *DatabasesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { @@ -186,14 +187,14 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginExport - Exports a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -214,7 +215,7 @@ func (client *DatabasesClient) BeginExport(ctx context.Context, resourceGroupNam // Export - Exports a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview func (client *DatabasesClient) export(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ExportDatabaseDefinition, options *DatabasesClientBeginExportOptions) (*http.Response, error) { req, err := client.exportCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { @@ -254,7 +255,7 @@ func (client *DatabasesClient) exportCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -262,7 +263,7 @@ func (client *DatabasesClient) exportCreateRequest(ctx context.Context, resource // BeginFailover - Failovers a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -282,7 +283,7 @@ func (client *DatabasesClient) BeginFailover(ctx context.Context, resourceGroupN // Failover - Failovers a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview func (client *DatabasesClient) failover(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginFailoverOptions) (*http.Response, error) { req, err := client.failoverCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { @@ -325,14 +326,14 @@ func (client *DatabasesClient) failoverCreateRequest(ctx context.Context, resour if options != nil && options.ReplicaType != nil { reqQP.Set("replicaType", string(*options.ReplicaType)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -377,7 +378,7 @@ func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -394,7 +395,7 @@ func (client *DatabasesClient) getHandleResponse(resp *http.Response) (Databases // BeginImport - Imports a bacpac into a new database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -415,7 +416,7 @@ func (client *DatabasesClient) BeginImport(ctx context.Context, resourceGroupNam // Import - Imports a bacpac into a new database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview func (client *DatabasesClient) importOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ImportExistingDatabaseDefinition, options *DatabasesClientBeginImportOptions) (*http.Response, error) { req, err := client.importCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { @@ -455,7 +456,7 @@ func (client *DatabasesClient) importCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -463,7 +464,7 @@ func (client *DatabasesClient) importCreateRequest(ctx context.Context, resource // NewListByElasticPoolPager - Gets a list of databases in an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -522,7 +523,7 @@ func (client *DatabasesClient) listByElasticPoolCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -539,7 +540,7 @@ func (client *DatabasesClient) listByElasticPoolHandleResponse(resp *http.Respon // NewListByServerPager - Gets a list of databases. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -595,7 +596,7 @@ func (client *DatabasesClient) listByServerCreateRequest(ctx context.Context, re if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -612,7 +613,7 @@ func (client *DatabasesClient) listByServerHandleResponse(resp *http.Response) ( // NewListInaccessibleByServerPager - Gets a list of inaccessible databases in a logical server // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -666,7 +667,7 @@ func (client *DatabasesClient) listInaccessibleByServerCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -824,7 +825,7 @@ func (client *DatabasesClient) listMetricsHandleResponse(resp *http.Response) (D // BeginPause - Pauses a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -844,7 +845,7 @@ func (client *DatabasesClient) BeginPause(ctx context.Context, resourceGroupName // Pause - Pauses a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview func (client *DatabasesClient) pause(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginPauseOptions) (*http.Response, error) { req, err := client.pauseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { @@ -884,7 +885,7 @@ func (client *DatabasesClient) pauseCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -892,7 +893,7 @@ func (client *DatabasesClient) pauseCreateRequest(ctx context.Context, resourceG // Rename - Renames a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -938,14 +939,14 @@ func (client *DatabasesClient) renameCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, parameters) } // BeginResume - Resumes a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -965,7 +966,7 @@ func (client *DatabasesClient) BeginResume(ctx context.Context, resourceGroupNam // Resume - Resumes a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview func (client *DatabasesClient) resume(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginResumeOptions) (*http.Response, error) { req, err := client.resumeCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { @@ -1005,7 +1006,7 @@ func (client *DatabasesClient) resumeCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1013,7 +1014,7 @@ func (client *DatabasesClient) resumeCreateRequest(ctx context.Context, resource // BeginUpdate - Updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -1034,7 +1035,7 @@ func (client *DatabasesClient) BeginUpdate(ctx context.Context, resourceGroupNam // Update - Updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview func (client *DatabasesClient) update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseUpdate, options *DatabasesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { @@ -1074,7 +1075,7 @@ func (client *DatabasesClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -1082,7 +1083,7 @@ func (client *DatabasesClient) updateCreateRequest(ctx context.Context, resource // BeginUpgradeDataWarehouse - Upgrades a data warehouse. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -1103,7 +1104,7 @@ func (client *DatabasesClient) BeginUpgradeDataWarehouse(ctx context.Context, re // UpgradeDataWarehouse - Upgrades a data warehouse. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-02-01-preview func (client *DatabasesClient) upgradeDataWarehouse(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginUpgradeDataWarehouseOptions) (*http.Response, error) { req, err := client.upgradeDataWarehouseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { @@ -1143,7 +1144,7 @@ func (client *DatabasesClient) upgradeDataWarehouseCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databaseschemas_client.go b/sdk/resourcemanager/sql/armsql/databaseschemas_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_databaseschemas_client.go rename to sdk/resourcemanager/sql/armsql/databaseschemas_client.go index 986e482c8473..69c1cb07d4cc 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databaseschemas_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseschemas_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databasesecurityalertpolicies_client.go b/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_databasesecurityalertpolicies_client.go rename to sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client.go index ab0781b8a519..dbe3f10ee13c 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databasesecurityalertpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databasetables_client.go b/sdk/resourcemanager/sql/armsql/databasetables_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_databasetables_client.go rename to sdk/resourcemanager/sql/armsql/databasetables_client.go index 5fcfd0d2964b..0cddfe69dfa0 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databasetables_client.go +++ b/sdk/resourcemanager/sql/armsql/databasetables_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databaseusages_client.go b/sdk/resourcemanager/sql/armsql/databaseusages_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_databaseusages_client.go rename to sdk/resourcemanager/sql/armsql/databaseusages_client.go index 8ecdbe413185..a088ef6038ba 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databaseusages_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseusages_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databasevulnerabilityassessmentrulebaselines_client.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_databasevulnerabilityassessmentrulebaselines_client.go rename to sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client.go index e8b74c401a3c..c56b9d19def8 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databasevulnerabilityassessmentrulebaselines_client.go +++ b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databasevulnerabilityassessments_client.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_databasevulnerabilityassessments_client.go rename to sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client.go index d4b8883d1883..adacea444931 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databasevulnerabilityassessments_client.go +++ b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databasevulnerabilityassessmentscans_client.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_databasevulnerabilityassessmentscans_client.go rename to sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client.go index 05e6b68dcd6c..3cb4f686f461 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databasevulnerabilityassessmentscans_client.go +++ b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_datamaskingpolicies_client.go b/sdk/resourcemanager/sql/armsql/datamaskingpolicies_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_datamaskingpolicies_client.go rename to sdk/resourcemanager/sql/armsql/datamaskingpolicies_client.go index 4410ad5bbf01..4fe73b5a258f 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_datamaskingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/datamaskingpolicies_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_datamaskingrules_client.go b/sdk/resourcemanager/sql/armsql/datamaskingrules_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_datamaskingrules_client.go rename to sdk/resourcemanager/sql/armsql/datamaskingrules_client.go index 0ef88ddc0179..6c211d674cae 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_datamaskingrules_client.go +++ b/sdk/resourcemanager/sql/armsql/datamaskingrules_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_datawarehouseuseractivities_client.go b/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_datawarehouseuseractivities_client.go rename to sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client.go index 1deafd72dec8..024b858ef846 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_datawarehouseuseractivities_client.go +++ b/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_deletedservers_client.go b/sdk/resourcemanager/sql/armsql/deletedservers_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_deletedservers_client.go rename to sdk/resourcemanager/sql/armsql/deletedservers_client.go index 0ff3e9a37830..2dcff3a496d6 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_deletedservers_client.go +++ b/sdk/resourcemanager/sql/armsql/deletedservers_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_distributedavailabilitygroups_client.go b/sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_distributedavailabilitygroups_client.go rename to sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client.go index d6ae08c3531f..c0a677323ce3 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_distributedavailabilitygroups_client.go +++ b/sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_elasticpoolactivities_client.go b/sdk/resourcemanager/sql/armsql/elasticpoolactivities_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_elasticpoolactivities_client.go rename to sdk/resourcemanager/sql/armsql/elasticpoolactivities_client.go index 418d5aa7b428..3e082ed3134f 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_elasticpoolactivities_client.go +++ b/sdk/resourcemanager/sql/armsql/elasticpoolactivities_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_elasticpooldatabaseactivities_client.go b/sdk/resourcemanager/sql/armsql/elasticpooldatabaseactivities_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_elasticpooldatabaseactivities_client.go rename to sdk/resourcemanager/sql/armsql/elasticpooldatabaseactivities_client.go index e9a4059b61dd..ad3d91e601c8 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_elasticpooldatabaseactivities_client.go +++ b/sdk/resourcemanager/sql/armsql/elasticpooldatabaseactivities_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_elasticpooloperations_client.go b/sdk/resourcemanager/sql/armsql/elasticpooloperations_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_elasticpooloperations_client.go rename to sdk/resourcemanager/sql/armsql/elasticpooloperations_client.go index d38c36b8fbaa..ee66e80b4caf 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_elasticpooloperations_client.go +++ b/sdk/resourcemanager/sql/armsql/elasticpooloperations_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_elasticpools_client.go b/sdk/resourcemanager/sql/armsql/elasticpools_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_elasticpools_client.go rename to sdk/resourcemanager/sql/armsql/elasticpools_client.go index 8054b3e8c26b..a1fe6342193c 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_elasticpools_client.go +++ b/sdk/resourcemanager/sql/armsql/elasticpools_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_encryptionprotectors_client.go b/sdk/resourcemanager/sql/armsql/encryptionprotectors_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_encryptionprotectors_client.go rename to sdk/resourcemanager/sql/armsql/encryptionprotectors_client.go index 993f39a13e9e..e410780205ff 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_encryptionprotectors_client.go +++ b/sdk/resourcemanager/sql/armsql/encryptionprotectors_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_endpointcertificates_client.go b/sdk/resourcemanager/sql/armsql/endpointcertificates_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_endpointcertificates_client.go rename to sdk/resourcemanager/sql/armsql/endpointcertificates_client.go index f5ed612ab9da..1419807e73de 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_endpointcertificates_client.go +++ b/sdk/resourcemanager/sql/armsql/endpointcertificates_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_extendeddatabaseblobauditingpolicies_client.go b/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_extendeddatabaseblobauditingpolicies_client.go rename to sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client.go index 0e52c2ac6843..251be38b85fe 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_extendeddatabaseblobauditingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_extendedserverblobauditingpolicies_client.go b/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_extendedserverblobauditingpolicies_client.go rename to sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client.go index b7ac23a6aaea..735dd81e2b26 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_extendedserverblobauditingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_failovergroups_client.go b/sdk/resourcemanager/sql/armsql/failovergroups_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_failovergroups_client.go rename to sdk/resourcemanager/sql/armsql/failovergroups_client.go index a3f59a61af5b..e1792dd87a3c 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_failovergroups_client.go +++ b/sdk/resourcemanager/sql/armsql/failovergroups_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_firewallrules_client.go b/sdk/resourcemanager/sql/armsql/firewallrules_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_firewallrules_client.go rename to sdk/resourcemanager/sql/armsql/firewallrules_client.go index 4e1892079353..706a4ae699b3 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_firewallrules_client.go +++ b/sdk/resourcemanager/sql/armsql/firewallrules_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_geobackuppolicies_client.go b/sdk/resourcemanager/sql/armsql/geobackuppolicies_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_geobackuppolicies_client.go rename to sdk/resourcemanager/sql/armsql/geobackuppolicies_client.go index 9f4a3421f2fd..77159c109c87 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_geobackuppolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/geobackuppolicies_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/go.mod b/sdk/resourcemanager/sql/armsql/go.mod index 77e8d20659cd..34daab2f15ff 100644 --- a/sdk/resourcemanager/sql/armsql/go.mod +++ b/sdk/resourcemanager/sql/armsql/go.mod @@ -1,23 +1,15 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) retract v0.6.0 diff --git a/sdk/resourcemanager/sql/armsql/go.sum b/sdk/resourcemanager/sql/armsql/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/sql/armsql/go.sum +++ b/sdk/resourcemanager/sql/armsql/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_instancefailovergroups_client.go b/sdk/resourcemanager/sql/armsql/instancefailovergroups_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_instancefailovergroups_client.go rename to sdk/resourcemanager/sql/armsql/instancefailovergroups_client.go index 63c03e331304..c59f125839f2 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_instancefailovergroups_client.go +++ b/sdk/resourcemanager/sql/armsql/instancefailovergroups_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_instancepools_client.go b/sdk/resourcemanager/sql/armsql/instancepools_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_instancepools_client.go rename to sdk/resourcemanager/sql/armsql/instancepools_client.go index 554d961a1094..88237d808168 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_instancepools_client.go +++ b/sdk/resourcemanager/sql/armsql/instancepools_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_ipv6firewallrules_client.go b/sdk/resourcemanager/sql/armsql/ipv6firewallrules_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_ipv6firewallrules_client.go rename to sdk/resourcemanager/sql/armsql/ipv6firewallrules_client.go index 39600712cd12..7c997b49c23a 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_ipv6firewallrules_client.go +++ b/sdk/resourcemanager/sql/armsql/ipv6firewallrules_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_jobagents_client.go b/sdk/resourcemanager/sql/armsql/jobagents_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_jobagents_client.go rename to sdk/resourcemanager/sql/armsql/jobagents_client.go index 5009424efefc..ff23c2af13bd 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_jobagents_client.go +++ b/sdk/resourcemanager/sql/armsql/jobagents_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_jobcredentials_client.go b/sdk/resourcemanager/sql/armsql/jobcredentials_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_jobcredentials_client.go rename to sdk/resourcemanager/sql/armsql/jobcredentials_client.go index 433a8d8b6bbd..013a803e9147 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_jobcredentials_client.go +++ b/sdk/resourcemanager/sql/armsql/jobcredentials_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_jobexecutions_client.go b/sdk/resourcemanager/sql/armsql/jobexecutions_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_jobexecutions_client.go rename to sdk/resourcemanager/sql/armsql/jobexecutions_client.go index a472f6a1a393..085f3e411103 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_jobexecutions_client.go +++ b/sdk/resourcemanager/sql/armsql/jobexecutions_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_jobs_client.go b/sdk/resourcemanager/sql/armsql/jobs_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_jobs_client.go rename to sdk/resourcemanager/sql/armsql/jobs_client.go index ca3f25714cf9..ce0cc6ecf417 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_jobs_client.go +++ b/sdk/resourcemanager/sql/armsql/jobs_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_jobstepexecutions_client.go b/sdk/resourcemanager/sql/armsql/jobstepexecutions_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_jobstepexecutions_client.go rename to sdk/resourcemanager/sql/armsql/jobstepexecutions_client.go index 43fb9a9d6ab6..ba273621e37f 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_jobstepexecutions_client.go +++ b/sdk/resourcemanager/sql/armsql/jobstepexecutions_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_jobsteps_client.go b/sdk/resourcemanager/sql/armsql/jobsteps_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_jobsteps_client.go rename to sdk/resourcemanager/sql/armsql/jobsteps_client.go index 32ecf9ea7778..5909a9db2d2e 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_jobsteps_client.go +++ b/sdk/resourcemanager/sql/armsql/jobsteps_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_jobtargetexecutions_client.go b/sdk/resourcemanager/sql/armsql/jobtargetexecutions_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_jobtargetexecutions_client.go rename to sdk/resourcemanager/sql/armsql/jobtargetexecutions_client.go index 677ed472765f..7b3799575005 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_jobtargetexecutions_client.go +++ b/sdk/resourcemanager/sql/armsql/jobtargetexecutions_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_jobtargetgroups_client.go b/sdk/resourcemanager/sql/armsql/jobtargetgroups_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_jobtargetgroups_client.go rename to sdk/resourcemanager/sql/armsql/jobtargetgroups_client.go index 0f39afceaaf5..ab09df55dc5b 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_jobtargetgroups_client.go +++ b/sdk/resourcemanager/sql/armsql/jobtargetgroups_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_jobversions_client.go b/sdk/resourcemanager/sql/armsql/jobversions_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_jobversions_client.go rename to sdk/resourcemanager/sql/armsql/jobversions_client.go index b05202e937bb..c92edaa0197d 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_jobversions_client.go +++ b/sdk/resourcemanager/sql/armsql/jobversions_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_ledgerdigestuploads_client.go b/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_ledgerdigestuploads_client.go rename to sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client.go index 0d3ee6c026a6..923ebbed6727 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_ledgerdigestuploads_client.go +++ b/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_longtermretentionbackups_client.go b/sdk/resourcemanager/sql/armsql/longtermretentionbackups_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_longtermretentionbackups_client.go rename to sdk/resourcemanager/sql/armsql/longtermretentionbackups_client.go index f47e0d434b78..881c8d777d36 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_longtermretentionbackups_client.go +++ b/sdk/resourcemanager/sql/armsql/longtermretentionbackups_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_longtermretentionmanagedinstancebackups_client.go b/sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_longtermretentionmanagedinstancebackups_client.go rename to sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client.go index b7dd9edac1ea..5bb4957f22dc 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_longtermretentionmanagedinstancebackups_client.go +++ b/sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_longtermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_longtermretentionpolicies_client.go rename to sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client.go index 11321fbf9f76..99c96631361c 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_longtermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_maintenancewindowoptions_client.go b/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_maintenancewindowoptions_client.go rename to sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client.go index 21551e4d703a..e15de0d8bc2f 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_maintenancewindowoptions_client.go +++ b/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_maintenancewindows_client.go b/sdk/resourcemanager/sql/armsql/maintenancewindows_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_maintenancewindows_client.go rename to sdk/resourcemanager/sql/armsql/maintenancewindows_client.go index cefdee84eaf4..a28e6beb160f 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_maintenancewindows_client.go +++ b/sdk/resourcemanager/sql/armsql/maintenancewindows_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedbackupshorttermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedbackupshorttermretentionpolicies_client.go rename to sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client.go index f94532a73759..5e2ce9ec67ff 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedbackupshorttermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client.go b/sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client.go new file mode 100644 index 000000000000..882dab033a88 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client.go @@ -0,0 +1,269 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// DO NOT EDIT. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ManagedDatabaseAdvancedThreatProtectionSettingsClient contains the methods for the ManagedDatabaseAdvancedThreatProtectionSettings group. +// Don't use this type directly, use NewManagedDatabaseAdvancedThreatProtectionSettingsClient() instead. +type ManagedDatabaseAdvancedThreatProtectionSettingsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewManagedDatabaseAdvancedThreatProtectionSettingsClient creates a new instance of ManagedDatabaseAdvancedThreatProtectionSettingsClient with the specified values. +// subscriptionID - The subscription ID that identifies an Azure subscription. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewManagedDatabaseAdvancedThreatProtectionSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedDatabaseAdvancedThreatProtectionSettingsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ManagedDatabaseAdvancedThreatProtectionSettingsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a managed database's Advanced Threat Protection state. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01-preview +// 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. +// advancedThreatProtectionName - The name of the Advanced Threat Protection state. +// parameters - The managed database Advanced Threat Protection state. +// options - ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions contains the optional parameters for +// the ManagedDatabaseAdvancedThreatProtectionSettingsClient.CreateOrUpdate method. +func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters ManagedDatabaseAdvancedThreatProtection, options *ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions) (ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, advancedThreatProtectionName, parameters, options) + if err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters ManagedDatabaseAdvancedThreatProtection, options *ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if advancedThreatProtectionName == "" { + return nil, errors.New("parameter advancedThreatProtectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{advancedThreatProtectionName}", url.PathEscape(string(advancedThreatProtectionName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) createOrUpdateHandleResponse(resp *http.Response) (ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse, error) { + result := ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedDatabaseAdvancedThreatProtection); err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Get - Gets a managed database's Advanced Threat Protection state. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01-preview +// 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. +// advancedThreatProtectionName - The name of the Advanced Threat Protection state. +// options - ManagedDatabaseAdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the ManagedDatabaseAdvancedThreatProtectionSettingsClient.Get +// method. +func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, advancedThreatProtectionName AdvancedThreatProtectionName, options *ManagedDatabaseAdvancedThreatProtectionSettingsClientGetOptions) (ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, advancedThreatProtectionName, options) + if err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, advancedThreatProtectionName AdvancedThreatProtectionName, options *ManagedDatabaseAdvancedThreatProtectionSettingsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if advancedThreatProtectionName == "" { + return nil, errors.New("parameter advancedThreatProtectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{advancedThreatProtectionName}", url.PathEscape(string(advancedThreatProtectionName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) getHandleResponse(resp *http.Response) (ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse, error) { + result := ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedDatabaseAdvancedThreatProtection); err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse{}, err + } + return result, nil +} + +// NewListByDatabasePager - Gets a list of managed database's Advanced Threat Protection states. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01-preview +// 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. +// options - ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions contains the optional parameters for +// the ManagedDatabaseAdvancedThreatProtectionSettingsClient.ListByDatabase method. +func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) NewListByDatabasePager(resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions) *runtime.Pager[ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse]{ + More: func(page ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse) (ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDatabaseCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse{}, runtime.NewResponseError(resp) + } + return client.listByDatabaseHandleResponse(resp) + }, + }) +} + +// listByDatabaseCreateRequest creates the ListByDatabase request. +func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByDatabaseHandleResponse handles the ListByDatabase response. +func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) listByDatabaseHandleResponse(resp *http.Response) (ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse, error) { + result := ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedDatabaseAdvancedThreatProtectionListResult); err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasecolumns_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasecolumns_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client.go index 3b6ac4c97f5d..392b6c6039a0 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasecolumns_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasequeries_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasequeries_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasequeries_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasequeries_client.go index cccb0fdfc3cc..e7bc4741b7b5 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasequeries_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasequeries_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabaserecommendedsensitivitylabels_client.go b/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabaserecommendedsensitivitylabels_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client.go index f6cfde71a5ee..5c6da177719c 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabaserecommendedsensitivitylabels_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabaserestoredetails_client.go b/sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client.go similarity index 98% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabaserestoredetails_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client.go index 53bba2a3d278..83d75ac7031a 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabaserestoredetails_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql @@ -56,7 +57,7 @@ func NewManagedDatabaseRestoreDetailsClient(subscriptionID string, credential az // Get - Gets managed database restore details. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -107,7 +108,7 @@ func (client *ManagedDatabaseRestoreDetailsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabases_client.go b/sdk/resourcemanager/sql/armsql/manageddatabases_client.go similarity index 68% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabases_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabases_client.go index 999721c6e13a..46b99c82e928 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabases_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql @@ -54,9 +55,147 @@ func NewManagedDatabasesClient(subscriptionID string, credential azcore.TokenCre return client, nil } +// BeginCancelMove - Cancels a managed database move operation. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01-preview +// 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 - Parameters of the cancel managed database move operation. +// options - ManagedDatabasesClientBeginCancelMoveOptions contains the optional parameters for the ManagedDatabasesClient.BeginCancelMove +// method. +func (client *ManagedDatabasesClient) BeginCancelMove(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseMoveDefinition, options *ManagedDatabasesClientBeginCancelMoveOptions) (*runtime.Poller[ManagedDatabasesClientCancelMoveResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.cancelMove(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedDatabasesClientCancelMoveResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedDatabasesClientCancelMoveResponse](options.ResumeToken, client.pl, nil) + } +} + +// CancelMove - Cancels a managed database move operation. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01-preview +func (client *ManagedDatabasesClient) cancelMove(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseMoveDefinition, options *ManagedDatabasesClientBeginCancelMoveOptions) (*http.Response, error) { + req, err := client.cancelMoveCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// cancelMoveCreateRequest creates the CancelMove request. +func (client *ManagedDatabasesClient) cancelMoveCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseMoveDefinition, options *ManagedDatabasesClientBeginCancelMoveOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/cancelMove" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginCompleteMove - Completes a managed database move operation. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01-preview +// 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 - Parameters of the complete managed database move operation. +// options - ManagedDatabasesClientBeginCompleteMoveOptions contains the optional parameters for the ManagedDatabasesClient.BeginCompleteMove +// method. +func (client *ManagedDatabasesClient) BeginCompleteMove(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseMoveDefinition, options *ManagedDatabasesClientBeginCompleteMoveOptions) (*runtime.Poller[ManagedDatabasesClientCompleteMoveResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.completeMove(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedDatabasesClientCompleteMoveResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedDatabasesClientCompleteMoveResponse](options.ResumeToken, client.pl, nil) + } +} + +// CompleteMove - Completes a managed database move operation. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01-preview +func (client *ManagedDatabasesClient) completeMove(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseMoveDefinition, options *ManagedDatabasesClientBeginCompleteMoveOptions) (*http.Response, error) { + req, err := client.completeMoveCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// completeMoveCreateRequest creates the CompleteMove request. +func (client *ManagedDatabasesClient) completeMoveCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseMoveDefinition, options *ManagedDatabasesClientBeginCompleteMoveOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeMove" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, runtime.MarshalAsJSON(req, parameters) +} + // BeginCompleteRestore - Completes the restore operation on a managed database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -78,7 +217,7 @@ func (client *ManagedDatabasesClient) BeginCompleteRestore(ctx context.Context, // CompleteRestore - Completes the restore operation on a managed database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-02-01-preview func (client *ManagedDatabasesClient) completeRestore(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters CompleteDatabaseRestoreDefinition, options *ManagedDatabasesClientBeginCompleteRestoreOptions) (*http.Response, error) { req, err := client.completeRestoreCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) if err != nil { @@ -118,14 +257,14 @@ func (client *ManagedDatabasesClient) completeRestoreCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, parameters) } // BeginCreateOrUpdate - Creates a new database or updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -147,7 +286,7 @@ func (client *ManagedDatabasesClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates a new database or updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-02-01-preview func (client *ManagedDatabasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabase, options *ManagedDatabasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) if err != nil { @@ -187,7 +326,7 @@ func (client *ManagedDatabasesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -195,7 +334,7 @@ func (client *ManagedDatabasesClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes a managed database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -216,7 +355,7 @@ func (client *ManagedDatabasesClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes a managed database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-02-01-preview func (client *ManagedDatabasesClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabasesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, options) if err != nil { @@ -256,14 +395,14 @@ func (client *ManagedDatabasesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a managed database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -308,7 +447,7 @@ func (client *ManagedDatabasesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,7 +464,7 @@ func (client *ManagedDatabasesClient) getHandleResponse(resp *http.Response) (Ma // NewListByInstancePager - Gets a list of managed databases. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -379,7 +518,7 @@ func (client *ManagedDatabasesClient) listByInstanceCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -396,7 +535,7 @@ func (client *ManagedDatabasesClient) listByInstanceHandleResponse(resp *http.Re // NewListInaccessibleByInstancePager - Gets a list of inaccessible managed databases in a managed instance // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -450,7 +589,7 @@ func (client *ManagedDatabasesClient) listInaccessibleByInstanceCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -465,9 +604,78 @@ func (client *ManagedDatabasesClient) listInaccessibleByInstanceHandleResponse(r return result, nil } +// BeginStartMove - Starts a managed database move operation. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01-preview +// 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 - Parameters of the start managed database move operation. +// options - ManagedDatabasesClientBeginStartMoveOptions contains the optional parameters for the ManagedDatabasesClient.BeginStartMove +// method. +func (client *ManagedDatabasesClient) BeginStartMove(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseStartMoveDefinition, options *ManagedDatabasesClientBeginStartMoveOptions) (*runtime.Poller[ManagedDatabasesClientStartMoveResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.startMove(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedDatabasesClientStartMoveResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedDatabasesClientStartMoveResponse](options.ResumeToken, client.pl, nil) + } +} + +// StartMove - Starts a managed database move operation. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01-preview +func (client *ManagedDatabasesClient) startMove(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseStartMoveDefinition, options *ManagedDatabasesClientBeginStartMoveOptions) (*http.Response, error) { + req, err := client.startMoveCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// startMoveCreateRequest creates the StartMove request. +func (client *ManagedDatabasesClient) startMoveCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseStartMoveDefinition, options *ManagedDatabasesClientBeginStartMoveOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/startMove" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, runtime.MarshalAsJSON(req, parameters) +} + // BeginUpdate - Updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -489,7 +697,7 @@ func (client *ManagedDatabasesClient) BeginUpdate(ctx context.Context, resourceG // Update - Updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-02-01-preview func (client *ManagedDatabasesClient) update(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseUpdate, options *ManagedDatabasesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) if err != nil { @@ -529,7 +737,7 @@ func (client *ManagedDatabasesClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabaseschemas_client.go b/sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabaseschemas_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client.go index 06c783fc88f4..4bf89dde9a5f 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabaseschemas_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasesecurityalertpolicies_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasesecurityalertpolicies_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client.go index 1020dcad779e..d26b92b55b9a 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasesecurityalertpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasesecurityevents_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasesecurityevents_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client.go index 5916a34411c8..6a15a32e65b8 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasesecurityevents_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasesensitivitylabels_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasesensitivitylabels_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client.go index c3adae17d500..7cc6a98e1168 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasesensitivitylabels_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasetables_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasetables_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasetables_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasetables_client.go index 5a822ede418b..bd9860a03e66 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasetables_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasetables_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasetransparentdataencryption_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasetransparentdataencryption_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client.go index a7022a0b652d..9cbbeba903c9 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasetransparentdataencryption_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasevulnerabilityassessmentrulebaselines_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasevulnerabilityassessmentrulebaselines_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client.go index 4625751a457a..1a223c18d9e4 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasevulnerabilityassessmentrulebaselines_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasevulnerabilityassessments_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasevulnerabilityassessments_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client.go index 4bdbe828d262..4b3205ebea13 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasevulnerabilityassessments_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasevulnerabilityassessmentscans_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasevulnerabilityassessmentscans_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client.go index b4d3e5bf4764..dd177b4fb316 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasevulnerabilityassessmentscans_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceadministrators_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceadministrators_client.go rename to sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client.go index 128fc222a8b0..0fa4ea4abe49 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceadministrators_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client.go new file mode 100644 index 000000000000..75bf6eaf31ed --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client.go @@ -0,0 +1,260 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// DO NOT EDIT. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ManagedInstanceAdvancedThreatProtectionSettingsClient contains the methods for the ManagedInstanceAdvancedThreatProtectionSettings group. +// Don't use this type directly, use NewManagedInstanceAdvancedThreatProtectionSettingsClient() instead. +type ManagedInstanceAdvancedThreatProtectionSettingsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewManagedInstanceAdvancedThreatProtectionSettingsClient creates a new instance of ManagedInstanceAdvancedThreatProtectionSettingsClient with the specified values. +// subscriptionID - The subscription ID that identifies an Azure subscription. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewManagedInstanceAdvancedThreatProtectionSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedInstanceAdvancedThreatProtectionSettingsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ManagedInstanceAdvancedThreatProtectionSettingsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates Advanced Threat Protection settings. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01-preview +// 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. +// advancedThreatProtectionName - The name of the Advanced Threat Protection state. +// parameters - The managed instance Advanced Threat Protection state. +// options - ManagedInstanceAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions contains the optional parameters +// for the ManagedInstanceAdvancedThreatProtectionSettingsClient.BeginCreateOrUpdate method. +func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters ManagedInstanceAdvancedThreatProtection, options *ManagedInstanceAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedInstanceAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, advancedThreatProtectionName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedInstanceAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedInstanceAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Creates or updates Advanced Threat Protection settings. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01-preview +func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters ManagedInstanceAdvancedThreatProtection, options *ManagedInstanceAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, advancedThreatProtectionName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters ManagedInstanceAdvancedThreatProtection, options *ManagedInstanceAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if advancedThreatProtectionName == "" { + return nil, errors.New("parameter advancedThreatProtectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{advancedThreatProtectionName}", url.PathEscape(string(advancedThreatProtectionName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// Get - Get a managed instance's Advanced Threat Protection state. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01-preview +// 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. +// advancedThreatProtectionName - The name of the Advanced Threat Protection state. +// options - ManagedInstanceAdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the ManagedInstanceAdvancedThreatProtectionSettingsClient.Get +// method. +func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, advancedThreatProtectionName AdvancedThreatProtectionName, options *ManagedInstanceAdvancedThreatProtectionSettingsClientGetOptions) (ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, advancedThreatProtectionName, options) + if err != nil { + return ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, advancedThreatProtectionName AdvancedThreatProtectionName, options *ManagedInstanceAdvancedThreatProtectionSettingsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if advancedThreatProtectionName == "" { + return nil, errors.New("parameter advancedThreatProtectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{advancedThreatProtectionName}", url.PathEscape(string(advancedThreatProtectionName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) getHandleResponse(resp *http.Response) (ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse, error) { + result := ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedInstanceAdvancedThreatProtection); err != nil { + return ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse{}, err + } + return result, nil +} + +// NewListByInstancePager - Get the managed instance's Advanced Threat Protection settings. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01-preview +// 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. +// options - ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceOptions contains the optional parameters for +// the ManagedInstanceAdvancedThreatProtectionSettingsClient.ListByInstance method. +func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) NewListByInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceOptions) *runtime.Pager[ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse]{ + More: func(page ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse) (ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByInstanceCreateRequest(ctx, resourceGroupName, managedInstanceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse{}, runtime.NewResponseError(resp) + } + return client.listByInstanceHandleResponse(resp) + }, + }) +} + +// listByInstanceCreateRequest creates the ListByInstance request. +func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) listByInstanceCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByInstanceHandleResponse handles the ListByInstance response. +func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) listByInstanceHandleResponse(resp *http.Response) (ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse, error) { + result := ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedInstanceAdvancedThreatProtectionListResult); err != nil { + return ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceazureadonlyauthentications_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceazureadonlyauthentications_client.go rename to sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client.go index 4fd02c100f29..6efc4d2365be 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceazureadonlyauthentications_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/managedinstancedtcs_client.go b/sdk/resourcemanager/sql/armsql/managedinstancedtcs_client.go new file mode 100644 index 000000000000..555c9395b987 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/managedinstancedtcs_client.go @@ -0,0 +1,259 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// DO NOT EDIT. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ManagedInstanceDtcsClient contains the methods for the ManagedInstanceDtcs group. +// Don't use this type directly, use NewManagedInstanceDtcsClient() instead. +type ManagedInstanceDtcsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewManagedInstanceDtcsClient creates a new instance of ManagedInstanceDtcsClient with the specified values. +// subscriptionID - The subscription ID that identifies an Azure subscription. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewManagedInstanceDtcsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedInstanceDtcsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ManagedInstanceDtcsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Updates managed instance DTC settings. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01-preview +// 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. +// dtcName - The name of the managed instance DTC. +// parameters - Managed instance DTC settings. +// options - ManagedInstanceDtcsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceDtcsClient.BeginCreateOrUpdate +// method. +func (client *ManagedInstanceDtcsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, dtcName DtcName, parameters ManagedInstanceDtc, options *ManagedInstanceDtcsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedInstanceDtcsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, dtcName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedInstanceDtcsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedInstanceDtcsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Updates managed instance DTC settings. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01-preview +func (client *ManagedInstanceDtcsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, dtcName DtcName, parameters ManagedInstanceDtc, options *ManagedInstanceDtcsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, dtcName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ManagedInstanceDtcsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, dtcName DtcName, parameters ManagedInstanceDtc, options *ManagedInstanceDtcsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if dtcName == "" { + return nil, errors.New("parameter dtcName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dtcName}", url.PathEscape(string(dtcName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// Get - Gets managed instance DTC settings. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01-preview +// 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. +// dtcName - The name of the managed instance DTC. +// options - ManagedInstanceDtcsClientGetOptions contains the optional parameters for the ManagedInstanceDtcsClient.Get method. +func (client *ManagedInstanceDtcsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, dtcName DtcName, options *ManagedInstanceDtcsClientGetOptions) (ManagedInstanceDtcsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, dtcName, options) + if err != nil { + return ManagedInstanceDtcsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedInstanceDtcsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedInstanceDtcsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ManagedInstanceDtcsClient) getCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, dtcName DtcName, options *ManagedInstanceDtcsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if dtcName == "" { + return nil, errors.New("parameter dtcName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dtcName}", url.PathEscape(string(dtcName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ManagedInstanceDtcsClient) getHandleResponse(resp *http.Response) (ManagedInstanceDtcsClientGetResponse, error) { + result := ManagedInstanceDtcsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedInstanceDtc); err != nil { + return ManagedInstanceDtcsClientGetResponse{}, err + } + return result, nil +} + +// NewListByManagedInstancePager - Gets a list of managed instance DTC settings. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01-preview +// 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. +// options - ManagedInstanceDtcsClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstanceDtcsClient.ListByManagedInstance +// method. +func (client *ManagedInstanceDtcsClient) NewListByManagedInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedInstanceDtcsClientListByManagedInstanceOptions) *runtime.Pager[ManagedInstanceDtcsClientListByManagedInstanceResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedInstanceDtcsClientListByManagedInstanceResponse]{ + More: func(page ManagedInstanceDtcsClientListByManagedInstanceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedInstanceDtcsClientListByManagedInstanceResponse) (ManagedInstanceDtcsClientListByManagedInstanceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByManagedInstanceCreateRequest(ctx, resourceGroupName, managedInstanceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedInstanceDtcsClientListByManagedInstanceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedInstanceDtcsClientListByManagedInstanceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedInstanceDtcsClientListByManagedInstanceResponse{}, runtime.NewResponseError(resp) + } + return client.listByManagedInstanceHandleResponse(resp) + }, + }) +} + +// listByManagedInstanceCreateRequest creates the ListByManagedInstance request. +func (client *ManagedInstanceDtcsClient) listByManagedInstanceCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstanceDtcsClientListByManagedInstanceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByManagedInstanceHandleResponse handles the ListByManagedInstance response. +func (client *ManagedInstanceDtcsClient) listByManagedInstanceHandleResponse(resp *http.Response) (ManagedInstanceDtcsClientListByManagedInstanceResponse, error) { + result := ManagedInstanceDtcsClientListByManagedInstanceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedInstanceDtcListResult); err != nil { + return ManagedInstanceDtcsClientListByManagedInstanceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceencryptionprotectors_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceencryptionprotectors_client.go rename to sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client.go index 98a7b9a2eb69..584b54bbd781 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceencryptionprotectors_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstancekeys_client.go b/sdk/resourcemanager/sql/armsql/managedinstancekeys_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstancekeys_client.go rename to sdk/resourcemanager/sql/armsql/managedinstancekeys_client.go index 8acf714bfc7c..d51d0d825099 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstancekeys_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancekeys_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstancelongtermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstancelongtermretentionpolicies_client.go rename to sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client.go index edb5734dde03..26c900b50389 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstancelongtermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceoperations_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceoperations_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceoperations_client.go rename to sdk/resourcemanager/sql/armsql/managedinstanceoperations_client.go index ddb86da1973a..d051da7c2a8d 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceoperations_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceoperations_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceprivateendpointconnections_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceprivateendpointconnections_client.go rename to sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client.go index de59cfb5a929..abc5fc0bd593 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceprivateendpointconnections_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceprivatelinkresources_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceprivatelinkresources_client.go rename to sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client.go index 90df751d8f5f..604d8c42719b 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceprivatelinkresources_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstances_client.go b/sdk/resourcemanager/sql/armsql/managedinstances_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstances_client.go rename to sdk/resourcemanager/sql/armsql/managedinstances_client.go index e5d6e50b092e..3495e567f37c 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstances_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstances_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstancetdecertificates_client.go b/sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstancetdecertificates_client.go rename to sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_client.go index 9f3162f1d405..2dfe424b299a 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstancetdecertificates_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstancevulnerabilityassessments_client.go b/sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstancevulnerabilityassessments_client.go rename to sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client.go index bcfa2e4e93dc..675b241870d9 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstancevulnerabilityassessments_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go rename to sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go index 63050781e5a8..99ad7099b0ea 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client.go b/sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client.go new file mode 100644 index 000000000000..ee6d015e7b57 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client.go @@ -0,0 +1,392 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// DO NOT EDIT. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ManagedServerDNSAliasesClient contains the methods for the ManagedServerDNSAliases group. +// Don't use this type directly, use NewManagedServerDNSAliasesClient() instead. +type ManagedServerDNSAliasesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewManagedServerDNSAliasesClient creates a new instance of ManagedServerDNSAliasesClient with the specified values. +// subscriptionID - The subscription ID that identifies an Azure subscription. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewManagedServerDNSAliasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedServerDNSAliasesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ManagedServerDNSAliasesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginAcquire - Acquires managed server DNS alias from another managed server. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-11-01-preview +// 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. +// options - ManagedServerDNSAliasesClientBeginAcquireOptions contains the optional parameters for the ManagedServerDNSAliasesClient.BeginAcquire +// method. +func (client *ManagedServerDNSAliasesClient) BeginAcquire(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, parameters ManagedServerDNSAliasAcquisition, options *ManagedServerDNSAliasesClientBeginAcquireOptions) (*runtime.Poller[ManagedServerDNSAliasesClientAcquireResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.acquire(ctx, resourceGroupName, managedInstanceName, dnsAliasName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedServerDNSAliasesClientAcquireResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedServerDNSAliasesClientAcquireResponse](options.ResumeToken, client.pl, nil) + } +} + +// Acquire - Acquires managed server DNS alias from another managed server. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-11-01-preview +func (client *ManagedServerDNSAliasesClient) acquire(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, parameters ManagedServerDNSAliasAcquisition, options *ManagedServerDNSAliasesClientBeginAcquireOptions) (*http.Response, error) { + req, err := client.acquireCreateRequest(ctx, resourceGroupName, managedInstanceName, dnsAliasName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// acquireCreateRequest creates the Acquire request. +func (client *ManagedServerDNSAliasesClient) acquireCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, parameters ManagedServerDNSAliasAcquisition, options *ManagedServerDNSAliasesClientBeginAcquireOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if dnsAliasName == "" { + return nil, errors.New("parameter dnsAliasName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dnsAliasName}", url.PathEscape(dnsAliasName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginCreateOrUpdate - Creates a managed server DNS alias. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-11-01-preview +// 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. +// options - ManagedServerDNSAliasesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedServerDNSAliasesClient.BeginCreateOrUpdate +// method. +func (client *ManagedServerDNSAliasesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, parameters ManagedServerDNSAliasCreation, options *ManagedServerDNSAliasesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedServerDNSAliasesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, dnsAliasName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedServerDNSAliasesClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedServerDNSAliasesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Creates a managed server DNS alias. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-11-01-preview +func (client *ManagedServerDNSAliasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, parameters ManagedServerDNSAliasCreation, options *ManagedServerDNSAliasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, dnsAliasName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ManagedServerDNSAliasesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, parameters ManagedServerDNSAliasCreation, options *ManagedServerDNSAliasesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if dnsAliasName == "" { + return nil, errors.New("parameter dnsAliasName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dnsAliasName}", url.PathEscape(dnsAliasName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the managed server DNS alias with the given name. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-11-01-preview +// 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. +// options - ManagedServerDNSAliasesClientBeginDeleteOptions contains the optional parameters for the ManagedServerDNSAliasesClient.BeginDelete +// method. +func (client *ManagedServerDNSAliasesClient) BeginDelete(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, options *ManagedServerDNSAliasesClientBeginDeleteOptions) (*runtime.Poller[ManagedServerDNSAliasesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, managedInstanceName, dnsAliasName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedServerDNSAliasesClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedServerDNSAliasesClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Deletes the managed server DNS alias with the given name. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-11-01-preview +func (client *ManagedServerDNSAliasesClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, options *ManagedServerDNSAliasesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, dnsAliasName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ManagedServerDNSAliasesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, options *ManagedServerDNSAliasesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if dnsAliasName == "" { + return nil, errors.New("parameter dnsAliasName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dnsAliasName}", url.PathEscape(dnsAliasName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Gets a server DNS alias. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-11-01-preview +// 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. +// options - ManagedServerDNSAliasesClientGetOptions contains the optional parameters for the ManagedServerDNSAliasesClient.Get +// method. +func (client *ManagedServerDNSAliasesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, options *ManagedServerDNSAliasesClientGetOptions) (ManagedServerDNSAliasesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, dnsAliasName, options) + if err != nil { + return ManagedServerDNSAliasesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedServerDNSAliasesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedServerDNSAliasesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ManagedServerDNSAliasesClient) getCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, options *ManagedServerDNSAliasesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if dnsAliasName == "" { + return nil, errors.New("parameter dnsAliasName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dnsAliasName}", url.PathEscape(dnsAliasName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ManagedServerDNSAliasesClient) getHandleResponse(resp *http.Response) (ManagedServerDNSAliasesClientGetResponse, error) { + result := ManagedServerDNSAliasesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedServerDNSAlias); err != nil { + return ManagedServerDNSAliasesClientGetResponse{}, err + } + return result, nil +} + +// NewListByManagedInstancePager - Gets a list of managed server DNS aliases for a managed server. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-11-01-preview +// 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. +// options - ManagedServerDNSAliasesClientListByManagedInstanceOptions contains the optional parameters for the ManagedServerDNSAliasesClient.ListByManagedInstance +// method. +func (client *ManagedServerDNSAliasesClient) NewListByManagedInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedServerDNSAliasesClientListByManagedInstanceOptions) *runtime.Pager[ManagedServerDNSAliasesClientListByManagedInstanceResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedServerDNSAliasesClientListByManagedInstanceResponse]{ + More: func(page ManagedServerDNSAliasesClientListByManagedInstanceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedServerDNSAliasesClientListByManagedInstanceResponse) (ManagedServerDNSAliasesClientListByManagedInstanceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByManagedInstanceCreateRequest(ctx, resourceGroupName, managedInstanceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedServerDNSAliasesClientListByManagedInstanceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedServerDNSAliasesClientListByManagedInstanceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedServerDNSAliasesClientListByManagedInstanceResponse{}, runtime.NewResponseError(resp) + } + return client.listByManagedInstanceHandleResponse(resp) + }, + }) +} + +// listByManagedInstanceCreateRequest creates the ListByManagedInstance request. +func (client *ManagedServerDNSAliasesClient) listByManagedInstanceCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedServerDNSAliasesClientListByManagedInstanceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByManagedInstanceHandleResponse handles the ListByManagedInstance response. +func (client *ManagedServerDNSAliasesClient) listByManagedInstanceHandleResponse(resp *http.Response) (ManagedServerDNSAliasesClientListByManagedInstanceResponse, error) { + result := ManagedServerDNSAliasesClientListByManagedInstanceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedServerDNSAliasListResult); err != nil { + return ManagedServerDNSAliasesClientListByManagedInstanceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedserversecurityalertpolicies_client.go b/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedserversecurityalertpolicies_client.go rename to sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client.go index 18cdfcfc68b0..b459a340633d 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedserversecurityalertpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_models.go b/sdk/resourcemanager/sql/armsql/models.go similarity index 96% rename from sdk/resourcemanager/sql/armsql/zz_generated_models.go rename to sdk/resourcemanager/sql/armsql/models.go index e9c86a89ef86..0576ff2a5987 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_models.go +++ b/sdk/resourcemanager/sql/armsql/models.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql @@ -290,7 +291,7 @@ type CheckNameAvailabilityRequest struct { // REQUIRED Name *string `json:"name,omitempty"` - // REQUIRED + // CONSTANT; Field has constant value "Microsoft.Sql/servers", any specified value is ignored. Type *string `json:"type,omitempty"` } @@ -1088,7 +1089,7 @@ type DatabaseProperties struct { // The name of the sample schema to apply when creating this database. SampleName *SampleName `json:"sampleName,omitempty"` - // The secondary type of the database if it is a secondary. Valid values are Geo and Named. + // The secondary type of the database if it is a secondary. Valid values are Geo, Named and Standby. SecondaryType *SecondaryType `json:"secondaryType,omitempty"` // Specifies the time that the database was deleted. @@ -1098,15 +1099,15 @@ type DatabaseProperties struct { SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"` // The resource identifier of the source associated with the create operation of this database. + // This property is only supported for DataWarehouse edition and allows to restore across subscriptions. // 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 + // When createMode is PointInTimeRestore, sourceResourceId must be the resource ID of the 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 @@ -1401,7 +1402,7 @@ type DatabaseUpdateProperties struct { // The name of the sample schema to apply when creating this database. SampleName *SampleName `json:"sampleName,omitempty"` - // The secondary type of the database if it is a secondary. Valid values are Geo and Named. + // The secondary type of the database if it is a secondary. Valid values are Geo, Named and Standby. SecondaryType *SecondaryType `json:"secondaryType,omitempty"` // Specifies the time that the database was deleted. @@ -4814,6 +4815,51 @@ type ManagedDatabase struct { Type *string `json:"type,omitempty" azure:"ro"` } +// ManagedDatabaseAdvancedThreatProtection - A managed database Advanced Threat Protection. +type ManagedDatabaseAdvancedThreatProtection struct { + // Resource properties. + Properties *AdvancedThreatProtectionProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; SystemData of AdvancedThreatProtectionResource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ManagedDatabaseAdvancedThreatProtectionListResult - A list of the managed database's Advanced Threat Protection settings. +type ManagedDatabaseAdvancedThreatProtectionListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*ManagedDatabaseAdvancedThreatProtection `json:"value,omitempty" azure:"ro"` +} + +// ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseAdvancedThreatProtectionSettingsClient.CreateOrUpdate +// method. +type ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseAdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the ManagedDatabaseAdvancedThreatProtectionSettingsClient.Get +// method. +type ManagedDatabaseAdvancedThreatProtectionSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseAdvancedThreatProtectionSettingsClient.ListByDatabase +// method. +type ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + // ManagedDatabaseColumnsClientGetOptions contains the optional parameters for the ManagedDatabaseColumnsClient.Get method. type ManagedDatabaseColumnsClientGetOptions struct { // placeholder for future optional parameters @@ -4846,6 +4892,12 @@ type ManagedDatabaseListResult struct { Value []*ManagedDatabase `json:"value,omitempty" azure:"ro"` } +// ManagedDatabaseMoveDefinition - Contains the information necessary to perform a managed database move. +type ManagedDatabaseMoveDefinition struct { + // REQUIRED; The destination managed database ID + DestinationManagedDatabaseID *string `json:"destinationManagedDatabaseId,omitempty"` +} + // ManagedDatabaseProperties - The managed database's properties. type ManagedDatabaseProperties struct { // Whether to auto complete restore of this managed database. @@ -4885,7 +4937,13 @@ type ManagedDatabaseProperties struct { // The resource identifier of the source database associated with create operation of this database. SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"` - // Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the storage container sas token. + // Conditional. If createMode is RestoreExternalBackup, this value is used. Specifies the identity used for storage container + // authentication. Can be 'SharedAccessSignature' or 'ManagedIdentity'; if not + // specified 'SharedAccessSignature' is assumed. + StorageContainerIdentity *string `json:"storageContainerIdentity,omitempty"` + + // Conditional. If createMode is RestoreExternalBackup and storageContainerIdentity is not ManagedIdentity, this value is + // required. Specifies the storage container sas token. StorageContainerSasToken *string `json:"storageContainerSasToken,omitempty"` // Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container @@ -4930,6 +4988,27 @@ type ManagedDatabaseRecommendedSensitivityLabelsClientUpdateOptions struct { // placeholder for future optional parameters } +// ManagedDatabaseRestoreDetailsBackupSetProperties - The managed database's restore details backup set properties. +type ManagedDatabaseRestoreDetailsBackupSetProperties struct { + // READ-ONLY; Backup size. + BackupSizeMB *int32 `json:"backupSizeMB,omitempty" azure:"ro"` + + // READ-ONLY; First stripe name. + FirstStripeName *string `json:"firstStripeName,omitempty" azure:"ro"` + + // READ-ONLY; Number of stripes. + NumberOfStripes *int32 `json:"numberOfStripes,omitempty" azure:"ro"` + + // READ-ONLY; Last restored file time. + RestoreFinishedTimestampUTC *time.Time `json:"restoreFinishedTimestampUtc,omitempty" azure:"ro"` + + // READ-ONLY; Last restored file time. + RestoreStartedTimestampUTC *time.Time `json:"restoreStartedTimestampUtc,omitempty" azure:"ro"` + + // READ-ONLY; Backup set status. + Status *string `json:"status,omitempty" azure:"ro"` +} + // ManagedDatabaseRestoreDetailsClientGetOptions contains the optional parameters for the ManagedDatabaseRestoreDetailsClient.Get // method. type ManagedDatabaseRestoreDetailsClientGetOptions struct { @@ -4941,9 +5020,24 @@ type ManagedDatabaseRestoreDetailsProperties struct { // READ-ONLY; The reason why restore is in Blocked state. BlockReason *string `json:"blockReason,omitempty" azure:"ro"` + // READ-ONLY; Current backup type. + CurrentBackupType *string `json:"currentBackupType,omitempty" azure:"ro"` + + // READ-ONLY; Current restore plan size MB. + CurrentRestorePlanSizeMB *int32 `json:"currentRestorePlanSizeMB,omitempty" azure:"ro"` + + // READ-ONLY; Current restored size MB. + CurrentRestoredSizeMB *int32 `json:"currentRestoredSizeMB,omitempty" azure:"ro"` + // READ-ONLY; Current restoring file name. CurrentRestoringFileName *string `json:"currentRestoringFileName,omitempty" azure:"ro"` + // READ-ONLY; Diff backup sets. + DiffBackupSets []*ManagedDatabaseRestoreDetailsBackupSetProperties `json:"diffBackupSets,omitempty" azure:"ro"` + + // READ-ONLY; Full backup sets. + FullBackupSets []*ManagedDatabaseRestoreDetailsBackupSetProperties `json:"fullBackupSets,omitempty" azure:"ro"` + // READ-ONLY; Last restored file name. LastRestoredFileName *string `json:"lastRestoredFileName,omitempty" azure:"ro"` @@ -4956,17 +5050,38 @@ type ManagedDatabaseRestoreDetailsProperties struct { // READ-ONLY; Last uploaded file time. LastUploadedFileTime *time.Time `json:"lastUploadedFileTime,omitempty" azure:"ro"` + // READ-ONLY; Log backup sets. + LogBackupSets []*ManagedDatabaseRestoreDetailsBackupSetProperties `json:"logBackupSets,omitempty" azure:"ro"` + // READ-ONLY; Number of files detected. - NumberOfFilesDetected *int64 `json:"numberOfFilesDetected,omitempty" azure:"ro"` + NumberOfFilesDetected *int32 `json:"numberOfFilesDetected,omitempty" azure:"ro"` + + // READ-ONLY; Number of files queued. + NumberOfFilesQueued *int32 `json:"numberOfFilesQueued,omitempty" azure:"ro"` + + // READ-ONLY; Number of files restored. + NumberOfFilesRestored *int32 `json:"numberOfFilesRestored,omitempty" azure:"ro"` + + // READ-ONLY; Number of files restoring. + NumberOfFilesRestoring *int32 `json:"numberOfFilesRestoring,omitempty" azure:"ro"` + + // READ-ONLY; Number of files skipped. + NumberOfFilesSkipped *int32 `json:"numberOfFilesSkipped,omitempty" azure:"ro"` + + // READ-ONLY; Number of files unrestorable. + NumberOfFilesUnrestorable *int32 `json:"numberOfFilesUnrestorable,omitempty" azure:"ro"` // READ-ONLY; Percent completed. - PercentCompleted *float64 `json:"percentCompleted,omitempty" azure:"ro"` + PercentCompleted *int32 `json:"percentCompleted,omitempty" azure:"ro"` // READ-ONLY; Restore status. Status *string `json:"status,omitempty" azure:"ro"` - // READ-ONLY; List of unrestorable files. - UnrestorableFiles []*string `json:"unrestorableFiles,omitempty" azure:"ro"` + // READ-ONLY; Restore type. + Type *string `json:"type,omitempty" azure:"ro"` + + // READ-ONLY; Unrestorable files. + UnrestorableFiles []*ManagedDatabaseRestoreDetailsUnrestorableFileProperties `json:"unrestorableFiles,omitempty" azure:"ro"` } // ManagedDatabaseRestoreDetailsResult - A managed database restore details. @@ -4984,6 +5099,12 @@ type ManagedDatabaseRestoreDetailsResult struct { Type *string `json:"type,omitempty" azure:"ro"` } +// ManagedDatabaseRestoreDetailsUnrestorableFileProperties - The managed database's restore details unrestorable file properties. +type ManagedDatabaseRestoreDetailsUnrestorableFileProperties struct { + // READ-ONLY; File name. + Name *string `json:"name,omitempty" azure:"ro"` +} + // ManagedDatabaseSchemasClientGetOptions contains the optional parameters for the ManagedDatabaseSchemasClient.Get method. type ManagedDatabaseSchemasClientGetOptions struct { // placeholder for future optional parameters @@ -5106,6 +5227,15 @@ type ManagedDatabaseSensitivityLabelsClientUpdateOptions struct { // placeholder for future optional parameters } +// ManagedDatabaseStartMoveDefinition - Contains the information necessary to start a managed database move. +type ManagedDatabaseStartMoveDefinition struct { + // REQUIRED; The destination managed database ID + DestinationManagedDatabaseID *string `json:"destinationManagedDatabaseId,omitempty"` + + // The move operation mode. + OperationMode *MoveOperationMode `json:"operationMode,omitempty"` +} + // ManagedDatabaseTablesClientGetOptions contains the optional parameters for the ManagedDatabaseTablesClient.Get method. type ManagedDatabaseTablesClientGetOptions struct { // placeholder for future optional parameters @@ -5212,6 +5342,20 @@ type ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseOptions struct { // placeholder for future optional parameters } +// ManagedDatabasesClientBeginCancelMoveOptions contains the optional parameters for the ManagedDatabasesClient.BeginCancelMove +// method. +type ManagedDatabasesClientBeginCancelMoveOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedDatabasesClientBeginCompleteMoveOptions contains the optional parameters for the ManagedDatabasesClient.BeginCompleteMove +// method. +type ManagedDatabasesClientBeginCompleteMoveOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ManagedDatabasesClientBeginCompleteRestoreOptions contains the optional parameters for the ManagedDatabasesClient.BeginCompleteRestore // method. type ManagedDatabasesClientBeginCompleteRestoreOptions struct { @@ -5232,6 +5376,13 @@ type ManagedDatabasesClientBeginDeleteOptions struct { ResumeToken string } +// ManagedDatabasesClientBeginStartMoveOptions contains the optional parameters for the ManagedDatabasesClient.BeginStartMove +// method. +type ManagedDatabasesClientBeginStartMoveOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ManagedDatabasesClientBeginUpdateOptions contains the optional parameters for the ManagedDatabasesClient.BeginUpdate method. type ManagedDatabasesClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. @@ -5347,6 +5498,52 @@ type ManagedInstanceAdministratorsClientListByInstanceOptions struct { // placeholder for future optional parameters } +// ManagedInstanceAdvancedThreatProtection - A managed instance Advanced Threat Protection. +type ManagedInstanceAdvancedThreatProtection struct { + // Resource properties. + Properties *AdvancedThreatProtectionProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; SystemData of AdvancedThreatProtectionResource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ManagedInstanceAdvancedThreatProtectionListResult - A list of the managed instance's Advanced Threat Protection settings. +type ManagedInstanceAdvancedThreatProtectionListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*ManagedInstanceAdvancedThreatProtection `json:"value,omitempty" azure:"ro"` +} + +// ManagedInstanceAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions contains the optional parameters for the +// ManagedInstanceAdvancedThreatProtectionSettingsClient.BeginCreateOrUpdate method. +type ManagedInstanceAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstanceAdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the ManagedInstanceAdvancedThreatProtectionSettingsClient.Get +// method. +type ManagedInstanceAdvancedThreatProtectionSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceAdvancedThreatProtectionSettingsClient.ListByInstance +// method. +type ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceOptions struct { + // placeholder for future optional parameters +} + // ManagedInstanceAzureADOnlyAuthListResult - A list of active directory only authentications. type ManagedInstanceAzureADOnlyAuthListResult struct { // READ-ONLY; Link to retrieve next page of results. @@ -5403,6 +5600,91 @@ type ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceOptions struct // placeholder for future optional parameters } +// ManagedInstanceDtc - SQL Managed Instance DTC +type ManagedInstanceDtc struct { + // Resource properties. + Properties *ManagedInstanceDtcProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ManagedInstanceDtcListResult - A list of managed instance's DTCs. +type ManagedInstanceDtcListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*ManagedInstanceDtc `json:"value,omitempty" azure:"ro"` +} + +// ManagedInstanceDtcProperties - The properties of managed instance DTC. +type ManagedInstanceDtcProperties struct { + // Active status of managed instance DTC. + DtcEnabled *bool `json:"dtcEnabled,omitempty"` + + // External dns suffix search list of managed instance DTC. + ExternalDNSSuffixSearchList []*string `json:"externalDnsSuffixSearchList,omitempty"` + + // Security settings of managed instance DTC. + SecuritySettings *ManagedInstanceDtcSecuritySettings `json:"securitySettings,omitempty"` + + // READ-ONLY; Host name dns suffix of managed instance DTC. + DtcHostNameDNSSuffix *string `json:"dtcHostNameDnsSuffix,omitempty" azure:"ro"` + + // READ-ONLY; Provisioning state of managed instance DTC. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// ManagedInstanceDtcSecuritySettings - The Security Settings of managed instance DTC. +type ManagedInstanceDtcSecuritySettings struct { + // Allow SNA LU 6.2 to managed instance DTC. + SnaLu6Point2TransactionsEnabled *bool `json:"snaLu6point2TransactionsEnabled,omitempty"` + + // Transaction Manager communication settings of managed instance DTC. + TransactionManagerCommunicationSettings *ManagedInstanceDtcTransactionManagerCommunicationSettings `json:"transactionManagerCommunicationSettings,omitempty"` + + // Allow XA Transactions to managed instance DTC. + XaTransactionsEnabled *bool `json:"xaTransactionsEnabled,omitempty"` +} + +// ManagedInstanceDtcTransactionManagerCommunicationSettings - The Transaction Manager Communication Settings of managed instance +// DTC. +type ManagedInstanceDtcTransactionManagerCommunicationSettings struct { + // Allow Inbound traffic to managed instance DTC. + AllowInboundEnabled *bool `json:"allowInboundEnabled,omitempty"` + + // Allow Outbound traffic of managed instance DTC. + AllowOutboundEnabled *bool `json:"allowOutboundEnabled,omitempty"` + + // Authentication type of managed instance DTC. + Authentication *string `json:"authentication,omitempty"` +} + +// ManagedInstanceDtcsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceDtcsClient.BeginCreateOrUpdate +// method. +type ManagedInstanceDtcsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstanceDtcsClientGetOptions contains the optional parameters for the ManagedInstanceDtcsClient.Get method. +type ManagedInstanceDtcsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceDtcsClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstanceDtcsClient.ListByManagedInstance +// method. +type ManagedInstanceDtcsClientListByManagedInstanceOptions struct { + // placeholder for future optional parameters +} + // ManagedInstanceEditionCapability - The managed server capability type ManagedInstanceEditionCapability struct { // The reason for the capability not being available. @@ -6337,6 +6619,83 @@ type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListB // placeholder for future optional parameters } +// ManagedServerDNSAlias - A managed server DNS alias. +type ManagedServerDNSAlias struct { + // Resource properties. + Properties *ManagedServerDNSAliasProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ManagedServerDNSAliasAcquisition - A managed server DNS alias acquisition request. +type ManagedServerDNSAliasAcquisition struct { + // REQUIRED; The resource ID of the managed server DNS alias that will be acquired to point to this managed server instead. + OldManagedServerDNSAliasResourceID *string `json:"oldManagedServerDnsAliasResourceId,omitempty"` +} + +// ManagedServerDNSAliasCreation - A managed server dns alias creation request. +type ManagedServerDNSAliasCreation struct { + // Whether or not DNS record should be created for this alias. + CreateDNSRecord *bool `json:"createDnsRecord,omitempty"` +} + +// ManagedServerDNSAliasListResult - A list of managed server DNS aliases. +type ManagedServerDNSAliasListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*ManagedServerDNSAlias `json:"value,omitempty" azure:"ro"` +} + +// ManagedServerDNSAliasProperties - Properties of a managed server DNS alias. +type ManagedServerDNSAliasProperties struct { + // READ-ONLY; The fully qualified DNS record for managed server alias + AzureDNSRecord *string `json:"azureDnsRecord,omitempty" azure:"ro"` + + // READ-ONLY; The fully qualified public DNS record for managed server alias + PublicAzureDNSRecord *string `json:"publicAzureDnsRecord,omitempty" azure:"ro"` +} + +// ManagedServerDNSAliasesClientBeginAcquireOptions contains the optional parameters for the ManagedServerDNSAliasesClient.BeginAcquire +// method. +type ManagedServerDNSAliasesClientBeginAcquireOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedServerDNSAliasesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedServerDNSAliasesClient.BeginCreateOrUpdate +// method. +type ManagedServerDNSAliasesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedServerDNSAliasesClientBeginDeleteOptions contains the optional parameters for the ManagedServerDNSAliasesClient.BeginDelete +// method. +type ManagedServerDNSAliasesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedServerDNSAliasesClientGetOptions contains the optional parameters for the ManagedServerDNSAliasesClient.Get method. +type ManagedServerDNSAliasesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedServerDNSAliasesClientListByManagedInstanceOptions contains the optional parameters for the ManagedServerDNSAliasesClient.ListByManagedInstance +// method. +type ManagedServerDNSAliasesClientListByManagedInstanceOptions struct { + // placeholder for future optional parameters +} + // ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.BeginCreateOrUpdate // method. type ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions struct { @@ -7303,7 +7662,7 @@ type ReplicationLinkProperties struct { // READ-ONLY; Whether the user is currently allowed to terminate the link. IsTerminationAllowed *bool `json:"isTerminationAllowed,omitempty" azure:"ro"` - // READ-ONLY; Link type (GEO, NAMED). + // READ-ONLY; Link type (GEO, NAMED, STANDBY). LinkType *ReplicationLinkType `json:"linkType,omitempty" azure:"ro"` // READ-ONLY; Resource partner database. @@ -7334,6 +7693,12 @@ type ReplicationLinkProperties struct { StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` } +// ReplicationLinksClientBeginDeleteOptions contains the optional parameters for the ReplicationLinksClient.BeginDelete method. +type ReplicationLinksClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ReplicationLinksClientBeginFailoverAllowDataLossOptions contains the optional parameters for the ReplicationLinksClient.BeginFailoverAllowDataLoss // method. type ReplicationLinksClientBeginFailoverAllowDataLossOptions struct { @@ -7348,11 +7713,6 @@ type ReplicationLinksClientBeginFailoverOptions struct { ResumeToken string } -// ReplicationLinksClientDeleteOptions contains the optional parameters for the ReplicationLinksClient.Delete method. -type ReplicationLinksClientDeleteOptions struct { - // placeholder for future optional parameters -} - // ReplicationLinksClientGetOptions contains the optional parameters for the ReplicationLinksClient.Get method. type ReplicationLinksClientGetOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/sql/armsql/models_serde.go b/sdk/resourcemanager/sql/armsql/models_serde.go new file mode 100644 index 000000000000..abad47ec7b93 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/models_serde.go @@ -0,0 +1,18998 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// DO NOT EDIT. + +package armsql + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AdministratorListResult. +func (a AdministratorListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdministratorListResult. +func (a *AdministratorListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AdministratorProperties. +func (a AdministratorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "administratorType", a.AdministratorType) + populate(objectMap, "azureADOnlyAuthentication", a.AzureADOnlyAuthentication) + populate(objectMap, "login", a.Login) + populate(objectMap, "sid", a.Sid) + populate(objectMap, "tenantId", a.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdministratorProperties. +func (a *AdministratorProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "administratorType": + err = unpopulate(val, "AdministratorType", &a.AdministratorType) + delete(rawMsg, key) + case "azureADOnlyAuthentication": + err = unpopulate(val, "AzureADOnlyAuthentication", &a.AzureADOnlyAuthentication) + delete(rawMsg, key) + case "login": + err = unpopulate(val, "Login", &a.Login) + delete(rawMsg, key) + case "sid": + err = unpopulate(val, "Sid", &a.Sid) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &a.TenantID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AdvancedThreatProtectionProperties. +func (a AdvancedThreatProtectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "creationTime", a.CreationTime) + populate(objectMap, "state", a.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdvancedThreatProtectionProperties. +func (a *AdvancedThreatProtectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &a.CreationTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &a.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Advisor. +func (a Advisor) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + populate(objectMap, "kind", a.Kind) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Advisor. +func (a *Advisor) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AdvisorProperties. +func (a AdvisorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "advisorStatus", a.AdvisorStatus) + populate(objectMap, "autoExecuteStatus", a.AutoExecuteStatus) + populate(objectMap, "autoExecuteStatusInheritedFrom", a.AutoExecuteStatusInheritedFrom) + populateTimeRFC3339(objectMap, "lastChecked", a.LastChecked) + populate(objectMap, "recommendationsStatus", a.RecommendationsStatus) + populate(objectMap, "recommendedActions", a.RecommendedActions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdvisorProperties. +func (a *AdvisorProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "advisorStatus": + err = unpopulate(val, "AdvisorStatus", &a.AdvisorStatus) + delete(rawMsg, key) + case "autoExecuteStatus": + err = unpopulate(val, "AutoExecuteStatus", &a.AutoExecuteStatus) + delete(rawMsg, key) + case "autoExecuteStatusInheritedFrom": + err = unpopulate(val, "AutoExecuteStatusInheritedFrom", &a.AutoExecuteStatusInheritedFrom) + delete(rawMsg, key) + case "lastChecked": + err = unpopulateTimeRFC3339(val, "LastChecked", &a.LastChecked) + delete(rawMsg, key) + case "recommendationsStatus": + err = unpopulate(val, "RecommendationsStatus", &a.RecommendationsStatus) + delete(rawMsg, key) + case "recommendedActions": + err = unpopulate(val, "RecommendedActions", &a.RecommendedActions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AgentConfiguration. +func (a AgentConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentConfiguration. +func (a *AgentConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AgentConfigurationProperties. +func (a AgentConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "state", a.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentConfigurationProperties. +func (a *AgentConfigurationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "state": + err = unpopulate(val, "State", &a.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AutoPauseDelayTimeRange. +func (a AutoPauseDelayTimeRange) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "default", a.Default) + populate(objectMap, "doNotPauseValue", a.DoNotPauseValue) + populate(objectMap, "maxValue", a.MaxValue) + populate(objectMap, "minValue", a.MinValue) + populate(objectMap, "stepSize", a.StepSize) + populate(objectMap, "unit", a.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutoPauseDelayTimeRange. +func (a *AutoPauseDelayTimeRange) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "default": + err = unpopulate(val, "Default", &a.Default) + delete(rawMsg, key) + case "doNotPauseValue": + err = unpopulate(val, "DoNotPauseValue", &a.DoNotPauseValue) + delete(rawMsg, key) + case "maxValue": + err = unpopulate(val, "MaxValue", &a.MaxValue) + delete(rawMsg, key) + case "minValue": + err = unpopulate(val, "MinValue", &a.MinValue) + delete(rawMsg, key) + case "stepSize": + err = unpopulate(val, "StepSize", &a.StepSize) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &a.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AutomaticTuningOptions. +func (a AutomaticTuningOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actualState", a.ActualState) + populate(objectMap, "desiredState", a.DesiredState) + populate(objectMap, "reasonCode", a.ReasonCode) + populate(objectMap, "reasonDesc", a.ReasonDesc) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutomaticTuningOptions. +func (a *AutomaticTuningOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actualState": + err = unpopulate(val, "ActualState", &a.ActualState) + delete(rawMsg, key) + case "desiredState": + err = unpopulate(val, "DesiredState", &a.DesiredState) + delete(rawMsg, key) + case "reasonCode": + err = unpopulate(val, "ReasonCode", &a.ReasonCode) + delete(rawMsg, key) + case "reasonDesc": + err = unpopulate(val, "ReasonDesc", &a.ReasonDesc) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AutomaticTuningServerOptions. +func (a AutomaticTuningServerOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actualState", a.ActualState) + populate(objectMap, "desiredState", a.DesiredState) + populate(objectMap, "reasonCode", a.ReasonCode) + populate(objectMap, "reasonDesc", a.ReasonDesc) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutomaticTuningServerOptions. +func (a *AutomaticTuningServerOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actualState": + err = unpopulate(val, "ActualState", &a.ActualState) + delete(rawMsg, key) + case "desiredState": + err = unpopulate(val, "DesiredState", &a.DesiredState) + delete(rawMsg, key) + case "reasonCode": + err = unpopulate(val, "ReasonCode", &a.ReasonCode) + delete(rawMsg, key) + case "reasonDesc": + err = unpopulate(val, "ReasonDesc", &a.ReasonDesc) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AutomaticTuningServerProperties. +func (a AutomaticTuningServerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actualState", a.ActualState) + populate(objectMap, "desiredState", a.DesiredState) + populate(objectMap, "options", a.Options) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutomaticTuningServerProperties. +func (a *AutomaticTuningServerProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actualState": + err = unpopulate(val, "ActualState", &a.ActualState) + delete(rawMsg, key) + case "desiredState": + err = unpopulate(val, "DesiredState", &a.DesiredState) + delete(rawMsg, key) + case "options": + err = unpopulate(val, "Options", &a.Options) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureADOnlyAuthListResult. +func (a AzureADOnlyAuthListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureADOnlyAuthListResult. +func (a *AzureADOnlyAuthListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureADOnlyAuthProperties. +func (a AzureADOnlyAuthProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureADOnlyAuthentication", a.AzureADOnlyAuthentication) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureADOnlyAuthProperties. +func (a *AzureADOnlyAuthProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureADOnlyAuthentication": + err = unpopulate(val, "AzureADOnlyAuthentication", &a.AzureADOnlyAuthentication) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackupShortTermRetentionPolicy. +func (b BackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupShortTermRetentionPolicy. +func (b *BackupShortTermRetentionPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackupShortTermRetentionPolicyListResult. +func (b BackupShortTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupShortTermRetentionPolicyListResult. +func (b *BackupShortTermRetentionPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &b.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &b.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackupShortTermRetentionPolicyProperties. +func (b BackupShortTermRetentionPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "diffBackupIntervalInHours", b.DiffBackupIntervalInHours) + populate(objectMap, "retentionDays", b.RetentionDays) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupShortTermRetentionPolicyProperties. +func (b *BackupShortTermRetentionPolicyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "diffBackupIntervalInHours": + err = unpopulate(val, "DiffBackupIntervalInHours", &b.DiffBackupIntervalInHours) + delete(rawMsg, key) + case "retentionDays": + err = unpopulate(val, "RetentionDays", &b.RetentionDays) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BaseLongTermRetentionPolicyProperties. +func (b BaseLongTermRetentionPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "monthlyRetention", b.MonthlyRetention) + populate(objectMap, "weekOfYear", b.WeekOfYear) + populate(objectMap, "weeklyRetention", b.WeeklyRetention) + populate(objectMap, "yearlyRetention", b.YearlyRetention) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BaseLongTermRetentionPolicyProperties. +func (b *BaseLongTermRetentionPolicyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "monthlyRetention": + err = unpopulate(val, "MonthlyRetention", &b.MonthlyRetention) + delete(rawMsg, key) + case "weekOfYear": + err = unpopulate(val, "WeekOfYear", &b.WeekOfYear) + delete(rawMsg, key) + case "weeklyRetention": + err = unpopulate(val, "WeeklyRetention", &b.WeeklyRetention) + delete(rawMsg, key) + case "yearlyRetention": + err = unpopulate(val, "YearlyRetention", &b.YearlyRetention) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest. +func (c CheckNameAvailabilityRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", c.Name) + objectMap["type"] = "Microsoft.Sql/servers" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityRequest. +func (c *CheckNameAvailabilityRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResponse. +func (c CheckNameAvailabilityResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "available", c.Available) + populate(objectMap, "message", c.Message) + populate(objectMap, "name", c.Name) + populate(objectMap, "reason", c.Reason) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResponse. +func (c *CheckNameAvailabilityResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "available": + err = unpopulate(val, "Available", &c.Available) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &c.Reason) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CompleteDatabaseRestoreDefinition. +func (c CompleteDatabaseRestoreDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "lastBackupName", c.LastBackupName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CompleteDatabaseRestoreDefinition. +func (c *CompleteDatabaseRestoreDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "lastBackupName": + err = unpopulate(val, "LastBackupName", &c.LastBackupName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CopyLongTermRetentionBackupParameters. +func (c CopyLongTermRetentionBackupParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CopyLongTermRetentionBackupParameters. +func (c *CopyLongTermRetentionBackupParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CopyLongTermRetentionBackupParametersProperties. +func (c CopyLongTermRetentionBackupParametersProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "targetBackupStorageRedundancy", c.TargetBackupStorageRedundancy) + populate(objectMap, "targetDatabaseName", c.TargetDatabaseName) + populate(objectMap, "targetResourceGroup", c.TargetResourceGroup) + populate(objectMap, "targetServerFullyQualifiedDomainName", c.TargetServerFullyQualifiedDomainName) + populate(objectMap, "targetServerResourceId", c.TargetServerResourceID) + populate(objectMap, "targetSubscriptionId", c.TargetSubscriptionID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CopyLongTermRetentionBackupParametersProperties. +func (c *CopyLongTermRetentionBackupParametersProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "targetBackupStorageRedundancy": + err = unpopulate(val, "TargetBackupStorageRedundancy", &c.TargetBackupStorageRedundancy) + delete(rawMsg, key) + case "targetDatabaseName": + err = unpopulate(val, "TargetDatabaseName", &c.TargetDatabaseName) + delete(rawMsg, key) + case "targetResourceGroup": + err = unpopulate(val, "TargetResourceGroup", &c.TargetResourceGroup) + delete(rawMsg, key) + case "targetServerFullyQualifiedDomainName": + err = unpopulate(val, "TargetServerFullyQualifiedDomainName", &c.TargetServerFullyQualifiedDomainName) + delete(rawMsg, key) + case "targetServerResourceId": + err = unpopulate(val, "TargetServerResourceID", &c.TargetServerResourceID) + delete(rawMsg, key) + case "targetSubscriptionId": + err = unpopulate(val, "TargetSubscriptionID", &c.TargetSubscriptionID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CreateDatabaseRestorePointDefinition. +func (c CreateDatabaseRestorePointDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "restorePointLabel", c.RestorePointLabel) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CreateDatabaseRestorePointDefinition. +func (c *CreateDatabaseRestorePointDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "restorePointLabel": + err = unpopulate(val, "RestorePointLabel", &c.RestorePointLabel) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DNSRefreshConfigurationProperties. +func (d DNSRefreshConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "status", d.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DNSRefreshConfigurationProperties. +func (d *DNSRefreshConfigurationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "status": + err = unpopulate(val, "Status", &d.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataMaskingPolicy. +func (d DataMaskingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "kind", d.Kind) + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataMaskingPolicy. +func (d *DataMaskingPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataMaskingPolicyProperties. +func (d DataMaskingPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "applicationPrincipals", d.ApplicationPrincipals) + populate(objectMap, "dataMaskingState", d.DataMaskingState) + populate(objectMap, "exemptPrincipals", d.ExemptPrincipals) + populate(objectMap, "maskingLevel", d.MaskingLevel) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataMaskingPolicyProperties. +func (d *DataMaskingPolicyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "applicationPrincipals": + err = unpopulate(val, "ApplicationPrincipals", &d.ApplicationPrincipals) + delete(rawMsg, key) + case "dataMaskingState": + err = unpopulate(val, "DataMaskingState", &d.DataMaskingState) + delete(rawMsg, key) + case "exemptPrincipals": + err = unpopulate(val, "ExemptPrincipals", &d.ExemptPrincipals) + delete(rawMsg, key) + case "maskingLevel": + err = unpopulate(val, "MaskingLevel", &d.MaskingLevel) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataMaskingRule. +func (d DataMaskingRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "kind", d.Kind) + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataMaskingRule. +func (d *DataMaskingRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataMaskingRuleListResult. +func (d DataMaskingRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataMaskingRuleListResult. +func (d *DataMaskingRuleListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataMaskingRuleProperties. +func (d DataMaskingRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aliasName", d.AliasName) + populate(objectMap, "columnName", d.ColumnName) + populate(objectMap, "id", d.ID) + populate(objectMap, "maskingFunction", d.MaskingFunction) + populate(objectMap, "numberFrom", d.NumberFrom) + populate(objectMap, "numberTo", d.NumberTo) + populate(objectMap, "prefixSize", d.PrefixSize) + populate(objectMap, "replacementString", d.ReplacementString) + populate(objectMap, "ruleState", d.RuleState) + populate(objectMap, "schemaName", d.SchemaName) + populate(objectMap, "suffixSize", d.SuffixSize) + populate(objectMap, "tableName", d.TableName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataMaskingRuleProperties. +func (d *DataMaskingRuleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "aliasName": + err = unpopulate(val, "AliasName", &d.AliasName) + delete(rawMsg, key) + case "columnName": + err = unpopulate(val, "ColumnName", &d.ColumnName) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "maskingFunction": + err = unpopulate(val, "MaskingFunction", &d.MaskingFunction) + delete(rawMsg, key) + case "numberFrom": + err = unpopulate(val, "NumberFrom", &d.NumberFrom) + delete(rawMsg, key) + case "numberTo": + err = unpopulate(val, "NumberTo", &d.NumberTo) + delete(rawMsg, key) + case "prefixSize": + err = unpopulate(val, "PrefixSize", &d.PrefixSize) + delete(rawMsg, key) + case "replacementString": + err = unpopulate(val, "ReplacementString", &d.ReplacementString) + delete(rawMsg, key) + case "ruleState": + err = unpopulate(val, "RuleState", &d.RuleState) + delete(rawMsg, key) + case "schemaName": + err = unpopulate(val, "SchemaName", &d.SchemaName) + delete(rawMsg, key) + case "suffixSize": + err = unpopulate(val, "SuffixSize", &d.SuffixSize) + delete(rawMsg, key) + case "tableName": + err = unpopulate(val, "TableName", &d.TableName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataWarehouseUserActivities. +func (d DataWarehouseUserActivities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataWarehouseUserActivities. +func (d *DataWarehouseUserActivities) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataWarehouseUserActivitiesListResult. +func (d DataWarehouseUserActivitiesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataWarehouseUserActivitiesListResult. +func (d *DataWarehouseUserActivitiesListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataWarehouseUserActivitiesProperties. +func (d DataWarehouseUserActivitiesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "activeQueriesCount", d.ActiveQueriesCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataWarehouseUserActivitiesProperties. +func (d *DataWarehouseUserActivitiesProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "activeQueriesCount": + err = unpopulate(val, "ActiveQueriesCount", &d.ActiveQueriesCount) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Database. +func (d Database) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "identity", d.Identity) + populate(objectMap, "kind", d.Kind) + populate(objectMap, "location", d.Location) + populate(objectMap, "managedBy", d.ManagedBy) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "tags", d.Tags) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Database. +func (d *Database) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &d.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "managedBy": + err = unpopulate(val, "ManagedBy", &d.ManagedBy) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseAdvancedThreatProtection. +func (d DatabaseAdvancedThreatProtection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAdvancedThreatProtection. +func (d *DatabaseAdvancedThreatProtection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseAdvancedThreatProtectionListResult. +func (d DatabaseAdvancedThreatProtectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAdvancedThreatProtectionListResult. +func (d *DatabaseAdvancedThreatProtectionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseAutomaticTuning. +func (d DatabaseAutomaticTuning) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAutomaticTuning. +func (d *DatabaseAutomaticTuning) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseAutomaticTuningProperties. +func (d DatabaseAutomaticTuningProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actualState", d.ActualState) + populate(objectMap, "desiredState", d.DesiredState) + populate(objectMap, "options", d.Options) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAutomaticTuningProperties. +func (d *DatabaseAutomaticTuningProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actualState": + err = unpopulate(val, "ActualState", &d.ActualState) + delete(rawMsg, key) + case "desiredState": + err = unpopulate(val, "DesiredState", &d.DesiredState) + delete(rawMsg, key) + case "options": + err = unpopulate(val, "Options", &d.Options) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseBlobAuditingPolicy. +func (d DatabaseBlobAuditingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "kind", d.Kind) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseBlobAuditingPolicy. +func (d *DatabaseBlobAuditingPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseBlobAuditingPolicyListResult. +func (d DatabaseBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseBlobAuditingPolicyListResult. +func (d *DatabaseBlobAuditingPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseBlobAuditingPolicyProperties. +func (d DatabaseBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "auditActionsAndGroups", d.AuditActionsAndGroups) + populate(objectMap, "isAzureMonitorTargetEnabled", d.IsAzureMonitorTargetEnabled) + populate(objectMap, "isManagedIdentityInUse", d.IsManagedIdentityInUse) + populate(objectMap, "isStorageSecondaryKeyInUse", d.IsStorageSecondaryKeyInUse) + populate(objectMap, "queueDelayMs", d.QueueDelayMs) + populate(objectMap, "retentionDays", d.RetentionDays) + populate(objectMap, "state", d.State) + populate(objectMap, "storageAccountAccessKey", d.StorageAccountAccessKey) + populate(objectMap, "storageAccountSubscriptionId", d.StorageAccountSubscriptionID) + populate(objectMap, "storageEndpoint", d.StorageEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseBlobAuditingPolicyProperties. +func (d *DatabaseBlobAuditingPolicyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "auditActionsAndGroups": + err = unpopulate(val, "AuditActionsAndGroups", &d.AuditActionsAndGroups) + delete(rawMsg, key) + case "isAzureMonitorTargetEnabled": + err = unpopulate(val, "IsAzureMonitorTargetEnabled", &d.IsAzureMonitorTargetEnabled) + delete(rawMsg, key) + case "isManagedIdentityInUse": + err = unpopulate(val, "IsManagedIdentityInUse", &d.IsManagedIdentityInUse) + delete(rawMsg, key) + case "isStorageSecondaryKeyInUse": + err = unpopulate(val, "IsStorageSecondaryKeyInUse", &d.IsStorageSecondaryKeyInUse) + delete(rawMsg, key) + case "queueDelayMs": + err = unpopulate(val, "QueueDelayMs", &d.QueueDelayMs) + delete(rawMsg, key) + case "retentionDays": + err = unpopulate(val, "RetentionDays", &d.RetentionDays) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &d.State) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &d.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageAccountSubscriptionId": + err = unpopulate(val, "StorageAccountSubscriptionID", &d.StorageAccountSubscriptionID) + delete(rawMsg, key) + case "storageEndpoint": + err = unpopulate(val, "StorageEndpoint", &d.StorageEndpoint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseColumn. +func (d DatabaseColumn) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseColumn. +func (d *DatabaseColumn) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseColumnListResult. +func (d DatabaseColumnListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseColumnListResult. +func (d *DatabaseColumnListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseColumnProperties. +func (d DatabaseColumnProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "columnType", d.ColumnType) + populate(objectMap, "isComputed", d.IsComputed) + populate(objectMap, "memoryOptimized", d.MemoryOptimized) + populate(objectMap, "temporalType", d.TemporalType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseColumnProperties. +func (d *DatabaseColumnProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "columnType": + err = unpopulate(val, "ColumnType", &d.ColumnType) + delete(rawMsg, key) + case "isComputed": + err = unpopulate(val, "IsComputed", &d.IsComputed) + delete(rawMsg, key) + case "memoryOptimized": + err = unpopulate(val, "MemoryOptimized", &d.MemoryOptimized) + delete(rawMsg, key) + case "temporalType": + err = unpopulate(val, "TemporalType", &d.TemporalType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseExtensions. +func (d DatabaseExtensions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseExtensions. +func (d *DatabaseExtensions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseExtensionsProperties. +func (d DatabaseExtensionsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "operationMode", d.OperationMode) + populate(objectMap, "storageKey", d.StorageKey) + populate(objectMap, "storageKeyType", d.StorageKeyType) + populate(objectMap, "storageUri", d.StorageURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseExtensionsProperties. +func (d *DatabaseExtensionsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "operationMode": + err = unpopulate(val, "OperationMode", &d.OperationMode) + delete(rawMsg, key) + case "storageKey": + err = unpopulate(val, "StorageKey", &d.StorageKey) + delete(rawMsg, key) + case "storageKeyType": + err = unpopulate(val, "StorageKeyType", &d.StorageKeyType) + delete(rawMsg, key) + case "storageUri": + err = unpopulate(val, "StorageURI", &d.StorageURI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseIdentity. +func (d DatabaseIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tenantId", d.TenantID) + populate(objectMap, "type", d.Type) + populate(objectMap, "userAssignedIdentities", d.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseIdentity. +func (d *DatabaseIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tenantId": + err = unpopulate(val, "TenantID", &d.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &d.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseListResult. +func (d DatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseListResult. +func (d *DatabaseListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseOperation. +func (d DatabaseOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseOperation. +func (d *DatabaseOperation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseOperationListResult. +func (d DatabaseOperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseOperationListResult. +func (d *DatabaseOperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseOperationProperties. +func (d DatabaseOperationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "databaseName", d.DatabaseName) + populate(objectMap, "description", d.Description) + populate(objectMap, "errorCode", d.ErrorCode) + populate(objectMap, "errorDescription", d.ErrorDescription) + populate(objectMap, "errorSeverity", d.ErrorSeverity) + populateTimeRFC3339(objectMap, "estimatedCompletionTime", d.EstimatedCompletionTime) + populate(objectMap, "isCancellable", d.IsCancellable) + populate(objectMap, "isUserError", d.IsUserError) + populate(objectMap, "operation", d.Operation) + populate(objectMap, "operationFriendlyName", d.OperationFriendlyName) + populate(objectMap, "percentComplete", d.PercentComplete) + populate(objectMap, "serverName", d.ServerName) + populateTimeRFC3339(objectMap, "startTime", d.StartTime) + populate(objectMap, "state", d.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseOperationProperties. +func (d *DatabaseOperationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseName": + err = unpopulate(val, "DatabaseName", &d.DatabaseName) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "errorCode": + err = unpopulate(val, "ErrorCode", &d.ErrorCode) + delete(rawMsg, key) + case "errorDescription": + err = unpopulate(val, "ErrorDescription", &d.ErrorDescription) + delete(rawMsg, key) + case "errorSeverity": + err = unpopulate(val, "ErrorSeverity", &d.ErrorSeverity) + delete(rawMsg, key) + case "estimatedCompletionTime": + err = unpopulateTimeRFC3339(val, "EstimatedCompletionTime", &d.EstimatedCompletionTime) + delete(rawMsg, key) + case "isCancellable": + err = unpopulate(val, "IsCancellable", &d.IsCancellable) + delete(rawMsg, key) + case "isUserError": + err = unpopulate(val, "IsUserError", &d.IsUserError) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &d.Operation) + delete(rawMsg, key) + case "operationFriendlyName": + err = unpopulate(val, "OperationFriendlyName", &d.OperationFriendlyName) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &d.PercentComplete) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &d.ServerName) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &d.StartTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &d.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseProperties. +func (d DatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "autoPauseDelay", d.AutoPauseDelay) + populate(objectMap, "catalogCollation", d.CatalogCollation) + populate(objectMap, "collation", d.Collation) + populate(objectMap, "createMode", d.CreateMode) + populateTimeRFC3339(objectMap, "creationDate", d.CreationDate) + populate(objectMap, "currentBackupStorageRedundancy", d.CurrentBackupStorageRedundancy) + populate(objectMap, "currentSku", d.CurrentSKU) + populate(objectMap, "currentServiceObjectiveName", d.CurrentServiceObjectiveName) + populate(objectMap, "databaseId", d.DatabaseID) + populate(objectMap, "defaultSecondaryLocation", d.DefaultSecondaryLocation) + populateTimeRFC3339(objectMap, "earliestRestoreDate", d.EarliestRestoreDate) + populate(objectMap, "elasticPoolId", d.ElasticPoolID) + populate(objectMap, "failoverGroupId", d.FailoverGroupID) + populate(objectMap, "federatedClientId", d.FederatedClientID) + populate(objectMap, "highAvailabilityReplicaCount", d.HighAvailabilityReplicaCount) + populate(objectMap, "isInfraEncryptionEnabled", d.IsInfraEncryptionEnabled) + populate(objectMap, "isLedgerOn", d.IsLedgerOn) + populate(objectMap, "licenseType", d.LicenseType) + populate(objectMap, "longTermRetentionBackupResourceId", d.LongTermRetentionBackupResourceID) + populate(objectMap, "maintenanceConfigurationId", d.MaintenanceConfigurationID) + populate(objectMap, "maxLogSizeBytes", d.MaxLogSizeBytes) + populate(objectMap, "maxSizeBytes", d.MaxSizeBytes) + populate(objectMap, "minCapacity", d.MinCapacity) + populateTimeRFC3339(objectMap, "pausedDate", d.PausedDate) + populate(objectMap, "readScale", d.ReadScale) + populate(objectMap, "recoverableDatabaseId", d.RecoverableDatabaseID) + populate(objectMap, "recoveryServicesRecoveryPointId", d.RecoveryServicesRecoveryPointID) + populate(objectMap, "requestedBackupStorageRedundancy", d.RequestedBackupStorageRedundancy) + populate(objectMap, "requestedServiceObjectiveName", d.RequestedServiceObjectiveName) + populate(objectMap, "restorableDroppedDatabaseId", d.RestorableDroppedDatabaseID) + populateTimeRFC3339(objectMap, "restorePointInTime", d.RestorePointInTime) + populateTimeRFC3339(objectMap, "resumedDate", d.ResumedDate) + populate(objectMap, "sampleName", d.SampleName) + populate(objectMap, "secondaryType", d.SecondaryType) + populateTimeRFC3339(objectMap, "sourceDatabaseDeletionDate", d.SourceDatabaseDeletionDate) + populate(objectMap, "sourceDatabaseId", d.SourceDatabaseID) + populate(objectMap, "sourceResourceId", d.SourceResourceID) + populate(objectMap, "status", d.Status) + populate(objectMap, "zoneRedundant", d.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseProperties. +func (d *DatabaseProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoPauseDelay": + err = unpopulate(val, "AutoPauseDelay", &d.AutoPauseDelay) + delete(rawMsg, key) + case "catalogCollation": + err = unpopulate(val, "CatalogCollation", &d.CatalogCollation) + delete(rawMsg, key) + case "collation": + err = unpopulate(val, "Collation", &d.Collation) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &d.CreateMode) + delete(rawMsg, key) + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &d.CreationDate) + delete(rawMsg, key) + case "currentBackupStorageRedundancy": + err = unpopulate(val, "CurrentBackupStorageRedundancy", &d.CurrentBackupStorageRedundancy) + delete(rawMsg, key) + case "currentSku": + err = unpopulate(val, "CurrentSKU", &d.CurrentSKU) + delete(rawMsg, key) + case "currentServiceObjectiveName": + err = unpopulate(val, "CurrentServiceObjectiveName", &d.CurrentServiceObjectiveName) + delete(rawMsg, key) + case "databaseId": + err = unpopulate(val, "DatabaseID", &d.DatabaseID) + delete(rawMsg, key) + case "defaultSecondaryLocation": + err = unpopulate(val, "DefaultSecondaryLocation", &d.DefaultSecondaryLocation) + delete(rawMsg, key) + case "earliestRestoreDate": + err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &d.EarliestRestoreDate) + delete(rawMsg, key) + case "elasticPoolId": + err = unpopulate(val, "ElasticPoolID", &d.ElasticPoolID) + delete(rawMsg, key) + case "failoverGroupId": + err = unpopulate(val, "FailoverGroupID", &d.FailoverGroupID) + delete(rawMsg, key) + case "federatedClientId": + err = unpopulate(val, "FederatedClientID", &d.FederatedClientID) + delete(rawMsg, key) + case "highAvailabilityReplicaCount": + err = unpopulate(val, "HighAvailabilityReplicaCount", &d.HighAvailabilityReplicaCount) + delete(rawMsg, key) + case "isInfraEncryptionEnabled": + err = unpopulate(val, "IsInfraEncryptionEnabled", &d.IsInfraEncryptionEnabled) + delete(rawMsg, key) + case "isLedgerOn": + err = unpopulate(val, "IsLedgerOn", &d.IsLedgerOn) + delete(rawMsg, key) + case "licenseType": + err = unpopulate(val, "LicenseType", &d.LicenseType) + delete(rawMsg, key) + case "longTermRetentionBackupResourceId": + err = unpopulate(val, "LongTermRetentionBackupResourceID", &d.LongTermRetentionBackupResourceID) + delete(rawMsg, key) + case "maintenanceConfigurationId": + err = unpopulate(val, "MaintenanceConfigurationID", &d.MaintenanceConfigurationID) + delete(rawMsg, key) + case "maxLogSizeBytes": + err = unpopulate(val, "MaxLogSizeBytes", &d.MaxLogSizeBytes) + delete(rawMsg, key) + case "maxSizeBytes": + err = unpopulate(val, "MaxSizeBytes", &d.MaxSizeBytes) + delete(rawMsg, key) + case "minCapacity": + err = unpopulate(val, "MinCapacity", &d.MinCapacity) + delete(rawMsg, key) + case "pausedDate": + err = unpopulateTimeRFC3339(val, "PausedDate", &d.PausedDate) + delete(rawMsg, key) + case "readScale": + err = unpopulate(val, "ReadScale", &d.ReadScale) + delete(rawMsg, key) + case "recoverableDatabaseId": + err = unpopulate(val, "RecoverableDatabaseID", &d.RecoverableDatabaseID) + delete(rawMsg, key) + case "recoveryServicesRecoveryPointId": + err = unpopulate(val, "RecoveryServicesRecoveryPointID", &d.RecoveryServicesRecoveryPointID) + delete(rawMsg, key) + case "requestedBackupStorageRedundancy": + err = unpopulate(val, "RequestedBackupStorageRedundancy", &d.RequestedBackupStorageRedundancy) + delete(rawMsg, key) + case "requestedServiceObjectiveName": + err = unpopulate(val, "RequestedServiceObjectiveName", &d.RequestedServiceObjectiveName) + delete(rawMsg, key) + case "restorableDroppedDatabaseId": + err = unpopulate(val, "RestorableDroppedDatabaseID", &d.RestorableDroppedDatabaseID) + delete(rawMsg, key) + case "restorePointInTime": + err = unpopulateTimeRFC3339(val, "RestorePointInTime", &d.RestorePointInTime) + delete(rawMsg, key) + case "resumedDate": + err = unpopulateTimeRFC3339(val, "ResumedDate", &d.ResumedDate) + delete(rawMsg, key) + case "sampleName": + err = unpopulate(val, "SampleName", &d.SampleName) + delete(rawMsg, key) + case "secondaryType": + err = unpopulate(val, "SecondaryType", &d.SecondaryType) + delete(rawMsg, key) + case "sourceDatabaseDeletionDate": + err = unpopulateTimeRFC3339(val, "SourceDatabaseDeletionDate", &d.SourceDatabaseDeletionDate) + delete(rawMsg, key) + case "sourceDatabaseId": + err = unpopulate(val, "SourceDatabaseID", &d.SourceDatabaseID) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &d.SourceResourceID) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &d.Status) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &d.ZoneRedundant) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseSchema. +func (d DatabaseSchema) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSchema. +func (d *DatabaseSchema) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseSchemaListResult. +func (d DatabaseSchemaListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSchemaListResult. +func (d *DatabaseSchemaListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseSecurityAlertListResult. +func (d DatabaseSecurityAlertListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSecurityAlertListResult. +func (d *DatabaseSecurityAlertListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseSecurityAlertPolicy. +func (d DatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSecurityAlertPolicy. +func (d *DatabaseSecurityAlertPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseTable. +func (d DatabaseTable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseTable. +func (d *DatabaseTable) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseTableListResult. +func (d DatabaseTableListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseTableListResult. +func (d *DatabaseTableListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseTableProperties. +func (d DatabaseTableProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "memoryOptimized", d.MemoryOptimized) + populate(objectMap, "temporalType", d.TemporalType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseTableProperties. +func (d *DatabaseTableProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "memoryOptimized": + err = unpopulate(val, "MemoryOptimized", &d.MemoryOptimized) + delete(rawMsg, key) + case "temporalType": + err = unpopulate(val, "TemporalType", &d.TemporalType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseUpdate. +func (d DatabaseUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", d.Identity) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "tags", d.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseUpdate. +func (d *DatabaseUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identity": + err = unpopulate(val, "Identity", &d.Identity) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseUpdateProperties. +func (d DatabaseUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "autoPauseDelay", d.AutoPauseDelay) + populate(objectMap, "catalogCollation", d.CatalogCollation) + populate(objectMap, "collation", d.Collation) + populate(objectMap, "createMode", d.CreateMode) + populateTimeRFC3339(objectMap, "creationDate", d.CreationDate) + populate(objectMap, "currentBackupStorageRedundancy", d.CurrentBackupStorageRedundancy) + populate(objectMap, "currentSku", d.CurrentSKU) + populate(objectMap, "currentServiceObjectiveName", d.CurrentServiceObjectiveName) + populate(objectMap, "databaseId", d.DatabaseID) + populate(objectMap, "defaultSecondaryLocation", d.DefaultSecondaryLocation) + populateTimeRFC3339(objectMap, "earliestRestoreDate", d.EarliestRestoreDate) + populate(objectMap, "elasticPoolId", d.ElasticPoolID) + populate(objectMap, "failoverGroupId", d.FailoverGroupID) + populate(objectMap, "federatedClientId", d.FederatedClientID) + populate(objectMap, "highAvailabilityReplicaCount", d.HighAvailabilityReplicaCount) + populate(objectMap, "isInfraEncryptionEnabled", d.IsInfraEncryptionEnabled) + populate(objectMap, "isLedgerOn", d.IsLedgerOn) + populate(objectMap, "licenseType", d.LicenseType) + populate(objectMap, "longTermRetentionBackupResourceId", d.LongTermRetentionBackupResourceID) + populate(objectMap, "maintenanceConfigurationId", d.MaintenanceConfigurationID) + populate(objectMap, "maxLogSizeBytes", d.MaxLogSizeBytes) + populate(objectMap, "maxSizeBytes", d.MaxSizeBytes) + populate(objectMap, "minCapacity", d.MinCapacity) + populateTimeRFC3339(objectMap, "pausedDate", d.PausedDate) + populate(objectMap, "readScale", d.ReadScale) + populate(objectMap, "recoverableDatabaseId", d.RecoverableDatabaseID) + populate(objectMap, "recoveryServicesRecoveryPointId", d.RecoveryServicesRecoveryPointID) + populate(objectMap, "requestedBackupStorageRedundancy", d.RequestedBackupStorageRedundancy) + populate(objectMap, "requestedServiceObjectiveName", d.RequestedServiceObjectiveName) + populate(objectMap, "restorableDroppedDatabaseId", d.RestorableDroppedDatabaseID) + populateTimeRFC3339(objectMap, "restorePointInTime", d.RestorePointInTime) + populateTimeRFC3339(objectMap, "resumedDate", d.ResumedDate) + populate(objectMap, "sampleName", d.SampleName) + populate(objectMap, "secondaryType", d.SecondaryType) + populateTimeRFC3339(objectMap, "sourceDatabaseDeletionDate", d.SourceDatabaseDeletionDate) + populate(objectMap, "sourceDatabaseId", d.SourceDatabaseID) + populate(objectMap, "status", d.Status) + populate(objectMap, "zoneRedundant", d.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseUpdateProperties. +func (d *DatabaseUpdateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoPauseDelay": + err = unpopulate(val, "AutoPauseDelay", &d.AutoPauseDelay) + delete(rawMsg, key) + case "catalogCollation": + err = unpopulate(val, "CatalogCollation", &d.CatalogCollation) + delete(rawMsg, key) + case "collation": + err = unpopulate(val, "Collation", &d.Collation) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &d.CreateMode) + delete(rawMsg, key) + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &d.CreationDate) + delete(rawMsg, key) + case "currentBackupStorageRedundancy": + err = unpopulate(val, "CurrentBackupStorageRedundancy", &d.CurrentBackupStorageRedundancy) + delete(rawMsg, key) + case "currentSku": + err = unpopulate(val, "CurrentSKU", &d.CurrentSKU) + delete(rawMsg, key) + case "currentServiceObjectiveName": + err = unpopulate(val, "CurrentServiceObjectiveName", &d.CurrentServiceObjectiveName) + delete(rawMsg, key) + case "databaseId": + err = unpopulate(val, "DatabaseID", &d.DatabaseID) + delete(rawMsg, key) + case "defaultSecondaryLocation": + err = unpopulate(val, "DefaultSecondaryLocation", &d.DefaultSecondaryLocation) + delete(rawMsg, key) + case "earliestRestoreDate": + err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &d.EarliestRestoreDate) + delete(rawMsg, key) + case "elasticPoolId": + err = unpopulate(val, "ElasticPoolID", &d.ElasticPoolID) + delete(rawMsg, key) + case "failoverGroupId": + err = unpopulate(val, "FailoverGroupID", &d.FailoverGroupID) + delete(rawMsg, key) + case "federatedClientId": + err = unpopulate(val, "FederatedClientID", &d.FederatedClientID) + delete(rawMsg, key) + case "highAvailabilityReplicaCount": + err = unpopulate(val, "HighAvailabilityReplicaCount", &d.HighAvailabilityReplicaCount) + delete(rawMsg, key) + case "isInfraEncryptionEnabled": + err = unpopulate(val, "IsInfraEncryptionEnabled", &d.IsInfraEncryptionEnabled) + delete(rawMsg, key) + case "isLedgerOn": + err = unpopulate(val, "IsLedgerOn", &d.IsLedgerOn) + delete(rawMsg, key) + case "licenseType": + err = unpopulate(val, "LicenseType", &d.LicenseType) + delete(rawMsg, key) + case "longTermRetentionBackupResourceId": + err = unpopulate(val, "LongTermRetentionBackupResourceID", &d.LongTermRetentionBackupResourceID) + delete(rawMsg, key) + case "maintenanceConfigurationId": + err = unpopulate(val, "MaintenanceConfigurationID", &d.MaintenanceConfigurationID) + delete(rawMsg, key) + case "maxLogSizeBytes": + err = unpopulate(val, "MaxLogSizeBytes", &d.MaxLogSizeBytes) + delete(rawMsg, key) + case "maxSizeBytes": + err = unpopulate(val, "MaxSizeBytes", &d.MaxSizeBytes) + delete(rawMsg, key) + case "minCapacity": + err = unpopulate(val, "MinCapacity", &d.MinCapacity) + delete(rawMsg, key) + case "pausedDate": + err = unpopulateTimeRFC3339(val, "PausedDate", &d.PausedDate) + delete(rawMsg, key) + case "readScale": + err = unpopulate(val, "ReadScale", &d.ReadScale) + delete(rawMsg, key) + case "recoverableDatabaseId": + err = unpopulate(val, "RecoverableDatabaseID", &d.RecoverableDatabaseID) + delete(rawMsg, key) + case "recoveryServicesRecoveryPointId": + err = unpopulate(val, "RecoveryServicesRecoveryPointID", &d.RecoveryServicesRecoveryPointID) + delete(rawMsg, key) + case "requestedBackupStorageRedundancy": + err = unpopulate(val, "RequestedBackupStorageRedundancy", &d.RequestedBackupStorageRedundancy) + delete(rawMsg, key) + case "requestedServiceObjectiveName": + err = unpopulate(val, "RequestedServiceObjectiveName", &d.RequestedServiceObjectiveName) + delete(rawMsg, key) + case "restorableDroppedDatabaseId": + err = unpopulate(val, "RestorableDroppedDatabaseID", &d.RestorableDroppedDatabaseID) + delete(rawMsg, key) + case "restorePointInTime": + err = unpopulateTimeRFC3339(val, "RestorePointInTime", &d.RestorePointInTime) + delete(rawMsg, key) + case "resumedDate": + err = unpopulateTimeRFC3339(val, "ResumedDate", &d.ResumedDate) + delete(rawMsg, key) + case "sampleName": + err = unpopulate(val, "SampleName", &d.SampleName) + delete(rawMsg, key) + case "secondaryType": + err = unpopulate(val, "SecondaryType", &d.SecondaryType) + delete(rawMsg, key) + case "sourceDatabaseDeletionDate": + err = unpopulateTimeRFC3339(val, "SourceDatabaseDeletionDate", &d.SourceDatabaseDeletionDate) + delete(rawMsg, key) + case "sourceDatabaseId": + err = unpopulate(val, "SourceDatabaseID", &d.SourceDatabaseID) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &d.Status) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &d.ZoneRedundant) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseUsage. +func (d DatabaseUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseUsage. +func (d *DatabaseUsage) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseUsageListResult. +func (d DatabaseUsageListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseUsageListResult. +func (d *DatabaseUsageListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseUsageProperties. +func (d DatabaseUsageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "currentValue", d.CurrentValue) + populate(objectMap, "displayName", d.DisplayName) + populate(objectMap, "limit", d.Limit) + populate(objectMap, "unit", d.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseUsageProperties. +func (d *DatabaseUsageProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentValue": + err = unpopulate(val, "CurrentValue", &d.CurrentValue) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &d.DisplayName) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &d.Limit) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &d.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseUserIdentity. +func (d DatabaseUserIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientId", d.ClientID) + populate(objectMap, "principalId", d.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseUserIdentity. +func (d *DatabaseUserIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &d.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &d.PrincipalID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessment. +func (d DatabaseVulnerabilityAssessment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessment. +func (d *DatabaseVulnerabilityAssessment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentListResult. +func (d DatabaseVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessmentListResult. +func (d *DatabaseVulnerabilityAssessmentListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentProperties. +func (d DatabaseVulnerabilityAssessmentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "recurringScans", d.RecurringScans) + populate(objectMap, "storageAccountAccessKey", d.StorageAccountAccessKey) + populate(objectMap, "storageContainerPath", d.StorageContainerPath) + populate(objectMap, "storageContainerSasKey", d.StorageContainerSasKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessmentProperties. +func (d *DatabaseVulnerabilityAssessmentProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "recurringScans": + err = unpopulate(val, "RecurringScans", &d.RecurringScans) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &d.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageContainerPath": + err = unpopulate(val, "StorageContainerPath", &d.StorageContainerPath) + delete(rawMsg, key) + case "storageContainerSasKey": + err = unpopulate(val, "StorageContainerSasKey", &d.StorageContainerSasKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentRuleBaseline. +func (d DatabaseVulnerabilityAssessmentRuleBaseline) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessmentRuleBaseline. +func (d *DatabaseVulnerabilityAssessmentRuleBaseline) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentRuleBaselineItem. +func (d DatabaseVulnerabilityAssessmentRuleBaselineItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "result", d.Result) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessmentRuleBaselineItem. +func (d *DatabaseVulnerabilityAssessmentRuleBaselineItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "result": + err = unpopulate(val, "Result", &d.Result) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentRuleBaselineProperties. +func (d DatabaseVulnerabilityAssessmentRuleBaselineProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "baselineResults", d.BaselineResults) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessmentRuleBaselineProperties. +func (d *DatabaseVulnerabilityAssessmentRuleBaselineProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "baselineResults": + err = unpopulate(val, "BaselineResults", &d.BaselineResults) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentScanExportProperties. +func (d DatabaseVulnerabilityAssessmentScanExportProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "exportedReportLocation", d.ExportedReportLocation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessmentScanExportProperties. +func (d *DatabaseVulnerabilityAssessmentScanExportProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "exportedReportLocation": + err = unpopulate(val, "ExportedReportLocation", &d.ExportedReportLocation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentScansExport. +func (d DatabaseVulnerabilityAssessmentScansExport) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessmentScansExport. +func (d *DatabaseVulnerabilityAssessmentScansExport) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeletedServer. +func (d DeletedServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServer. +func (d *DeletedServer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeletedServerListResult. +func (d DeletedServerListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServerListResult. +func (d *DeletedServerListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeletedServerProperties. +func (d DeletedServerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "deletionTime", d.DeletionTime) + populate(objectMap, "fullyQualifiedDomainName", d.FullyQualifiedDomainName) + populate(objectMap, "originalId", d.OriginalID) + populate(objectMap, "version", d.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServerProperties. +func (d *DeletedServerProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "deletionTime": + err = unpopulateTimeRFC3339(val, "DeletionTime", &d.DeletionTime) + delete(rawMsg, key) + case "fullyQualifiedDomainName": + err = unpopulate(val, "FullyQualifiedDomainName", &d.FullyQualifiedDomainName) + delete(rawMsg, key) + case "originalId": + err = unpopulate(val, "OriginalID", &d.OriginalID) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &d.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DistributedAvailabilityGroup. +func (d DistributedAvailabilityGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DistributedAvailabilityGroup. +func (d *DistributedAvailabilityGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DistributedAvailabilityGroupProperties. +func (d DistributedAvailabilityGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "distributedAvailabilityGroupId", d.DistributedAvailabilityGroupID) + populate(objectMap, "lastHardenedLsn", d.LastHardenedLsn) + populate(objectMap, "linkState", d.LinkState) + populate(objectMap, "primaryAvailabilityGroupName", d.PrimaryAvailabilityGroupName) + populate(objectMap, "replicationMode", d.ReplicationMode) + populate(objectMap, "secondaryAvailabilityGroupName", d.SecondaryAvailabilityGroupName) + populate(objectMap, "sourceEndpoint", d.SourceEndpoint) + populate(objectMap, "sourceReplicaId", d.SourceReplicaID) + populate(objectMap, "targetDatabase", d.TargetDatabase) + populate(objectMap, "targetReplicaId", d.TargetReplicaID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DistributedAvailabilityGroupProperties. +func (d *DistributedAvailabilityGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "distributedAvailabilityGroupId": + err = unpopulate(val, "DistributedAvailabilityGroupID", &d.DistributedAvailabilityGroupID) + delete(rawMsg, key) + case "lastHardenedLsn": + err = unpopulate(val, "LastHardenedLsn", &d.LastHardenedLsn) + delete(rawMsg, key) + case "linkState": + err = unpopulate(val, "LinkState", &d.LinkState) + delete(rawMsg, key) + case "primaryAvailabilityGroupName": + err = unpopulate(val, "PrimaryAvailabilityGroupName", &d.PrimaryAvailabilityGroupName) + delete(rawMsg, key) + case "replicationMode": + err = unpopulate(val, "ReplicationMode", &d.ReplicationMode) + delete(rawMsg, key) + case "secondaryAvailabilityGroupName": + err = unpopulate(val, "SecondaryAvailabilityGroupName", &d.SecondaryAvailabilityGroupName) + delete(rawMsg, key) + case "sourceEndpoint": + err = unpopulate(val, "SourceEndpoint", &d.SourceEndpoint) + delete(rawMsg, key) + case "sourceReplicaId": + err = unpopulate(val, "SourceReplicaID", &d.SourceReplicaID) + delete(rawMsg, key) + case "targetDatabase": + err = unpopulate(val, "TargetDatabase", &d.TargetDatabase) + delete(rawMsg, key) + case "targetReplicaId": + err = unpopulate(val, "TargetReplicaID", &d.TargetReplicaID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DistributedAvailabilityGroupsListResult. +func (d DistributedAvailabilityGroupsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DistributedAvailabilityGroupsListResult. +func (d *DistributedAvailabilityGroupsListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EditionCapability. +func (e EditionCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", e.Name) + populate(objectMap, "readScale", e.ReadScale) + populate(objectMap, "reason", e.Reason) + populate(objectMap, "status", e.Status) + populate(objectMap, "supportedServiceLevelObjectives", e.SupportedServiceLevelObjectives) + populate(objectMap, "supportedStorageCapabilities", e.SupportedStorageCapabilities) + populate(objectMap, "zoneRedundant", e.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EditionCapability. +func (e *EditionCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "readScale": + err = unpopulate(val, "ReadScale", &e.ReadScale) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &e.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &e.Status) + delete(rawMsg, key) + case "supportedServiceLevelObjectives": + err = unpopulate(val, "SupportedServiceLevelObjectives", &e.SupportedServiceLevelObjectives) + delete(rawMsg, key) + case "supportedStorageCapabilities": + err = unpopulate(val, "SupportedStorageCapabilities", &e.SupportedStorageCapabilities) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ElasticPool. +func (e ElasticPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", e.ID) + populate(objectMap, "kind", e.Kind) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "sku", e.SKU) + populate(objectMap, "tags", e.Tags) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPool. +func (e *ElasticPool) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &e.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolActivity. +func (e ElasticPoolActivity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", e.ID) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolActivity. +func (e *ElasticPoolActivity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolActivityListResult. +func (e ElasticPoolActivityListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolActivityListResult. +func (e *ElasticPoolActivityListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolActivityProperties. +func (e ElasticPoolActivityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "elasticPoolName", e.ElasticPoolName) + populateTimeRFC3339(objectMap, "endTime", e.EndTime) + populate(objectMap, "errorCode", e.ErrorCode) + populate(objectMap, "errorMessage", e.ErrorMessage) + populate(objectMap, "errorSeverity", e.ErrorSeverity) + populate(objectMap, "operation", e.Operation) + populate(objectMap, "operationId", e.OperationID) + populate(objectMap, "percentComplete", e.PercentComplete) + populate(objectMap, "requestedDatabaseDtuCap", e.RequestedDatabaseDtuCap) + populate(objectMap, "requestedDatabaseDtuGuarantee", e.RequestedDatabaseDtuGuarantee) + populate(objectMap, "requestedDatabaseDtuMax", e.RequestedDatabaseDtuMax) + populate(objectMap, "requestedDatabaseDtuMin", e.RequestedDatabaseDtuMin) + populate(objectMap, "requestedDtu", e.RequestedDtu) + populate(objectMap, "requestedDtuGuarantee", e.RequestedDtuGuarantee) + populate(objectMap, "requestedElasticPoolName", e.RequestedElasticPoolName) + populate(objectMap, "requestedStorageLimitInGB", e.RequestedStorageLimitInGB) + populate(objectMap, "requestedStorageLimitInMB", e.RequestedStorageLimitInMB) + populate(objectMap, "serverName", e.ServerName) + populateTimeRFC3339(objectMap, "startTime", e.StartTime) + populate(objectMap, "state", e.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolActivityProperties. +func (e *ElasticPoolActivityProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "elasticPoolName": + err = unpopulate(val, "ElasticPoolName", &e.ElasticPoolName) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &e.EndTime) + delete(rawMsg, key) + case "errorCode": + err = unpopulate(val, "ErrorCode", &e.ErrorCode) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &e.ErrorMessage) + delete(rawMsg, key) + case "errorSeverity": + err = unpopulate(val, "ErrorSeverity", &e.ErrorSeverity) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &e.Operation) + delete(rawMsg, key) + case "operationId": + err = unpopulate(val, "OperationID", &e.OperationID) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &e.PercentComplete) + delete(rawMsg, key) + case "requestedDatabaseDtuCap": + err = unpopulate(val, "RequestedDatabaseDtuCap", &e.RequestedDatabaseDtuCap) + delete(rawMsg, key) + case "requestedDatabaseDtuGuarantee": + err = unpopulate(val, "RequestedDatabaseDtuGuarantee", &e.RequestedDatabaseDtuGuarantee) + delete(rawMsg, key) + case "requestedDatabaseDtuMax": + err = unpopulate(val, "RequestedDatabaseDtuMax", &e.RequestedDatabaseDtuMax) + delete(rawMsg, key) + case "requestedDatabaseDtuMin": + err = unpopulate(val, "RequestedDatabaseDtuMin", &e.RequestedDatabaseDtuMin) + delete(rawMsg, key) + case "requestedDtu": + err = unpopulate(val, "RequestedDtu", &e.RequestedDtu) + delete(rawMsg, key) + case "requestedDtuGuarantee": + err = unpopulate(val, "RequestedDtuGuarantee", &e.RequestedDtuGuarantee) + delete(rawMsg, key) + case "requestedElasticPoolName": + err = unpopulate(val, "RequestedElasticPoolName", &e.RequestedElasticPoolName) + delete(rawMsg, key) + case "requestedStorageLimitInGB": + err = unpopulate(val, "RequestedStorageLimitInGB", &e.RequestedStorageLimitInGB) + delete(rawMsg, key) + case "requestedStorageLimitInMB": + err = unpopulate(val, "RequestedStorageLimitInMB", &e.RequestedStorageLimitInMB) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &e.ServerName) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &e.StartTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &e.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolDatabaseActivity. +func (e ElasticPoolDatabaseActivity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", e.ID) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolDatabaseActivity. +func (e *ElasticPoolDatabaseActivity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolDatabaseActivityListResult. +func (e ElasticPoolDatabaseActivityListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolDatabaseActivityListResult. +func (e *ElasticPoolDatabaseActivityListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolDatabaseActivityProperties. +func (e ElasticPoolDatabaseActivityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "currentElasticPoolName", e.CurrentElasticPoolName) + populate(objectMap, "currentServiceObjective", e.CurrentServiceObjective) + populate(objectMap, "databaseName", e.DatabaseName) + populateTimeRFC3339(objectMap, "endTime", e.EndTime) + populate(objectMap, "errorCode", e.ErrorCode) + populate(objectMap, "errorMessage", e.ErrorMessage) + populate(objectMap, "errorSeverity", e.ErrorSeverity) + populate(objectMap, "operation", e.Operation) + populate(objectMap, "operationId", e.OperationID) + populate(objectMap, "percentComplete", e.PercentComplete) + populate(objectMap, "requestedElasticPoolName", e.RequestedElasticPoolName) + populate(objectMap, "requestedServiceObjective", e.RequestedServiceObjective) + populate(objectMap, "serverName", e.ServerName) + populateTimeRFC3339(objectMap, "startTime", e.StartTime) + populate(objectMap, "state", e.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolDatabaseActivityProperties. +func (e *ElasticPoolDatabaseActivityProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentElasticPoolName": + err = unpopulate(val, "CurrentElasticPoolName", &e.CurrentElasticPoolName) + delete(rawMsg, key) + case "currentServiceObjective": + err = unpopulate(val, "CurrentServiceObjective", &e.CurrentServiceObjective) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &e.DatabaseName) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &e.EndTime) + delete(rawMsg, key) + case "errorCode": + err = unpopulate(val, "ErrorCode", &e.ErrorCode) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &e.ErrorMessage) + delete(rawMsg, key) + case "errorSeverity": + err = unpopulate(val, "ErrorSeverity", &e.ErrorSeverity) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &e.Operation) + delete(rawMsg, key) + case "operationId": + err = unpopulate(val, "OperationID", &e.OperationID) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &e.PercentComplete) + delete(rawMsg, key) + case "requestedElasticPoolName": + err = unpopulate(val, "RequestedElasticPoolName", &e.RequestedElasticPoolName) + delete(rawMsg, key) + case "requestedServiceObjective": + err = unpopulate(val, "RequestedServiceObjective", &e.RequestedServiceObjective) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &e.ServerName) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &e.StartTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &e.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolEditionCapability. +func (e ElasticPoolEditionCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", e.Name) + populate(objectMap, "reason", e.Reason) + populate(objectMap, "status", e.Status) + populate(objectMap, "supportedElasticPoolPerformanceLevels", e.SupportedElasticPoolPerformanceLevels) + populate(objectMap, "zoneRedundant", e.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolEditionCapability. +func (e *ElasticPoolEditionCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &e.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &e.Status) + delete(rawMsg, key) + case "supportedElasticPoolPerformanceLevels": + err = unpopulate(val, "SupportedElasticPoolPerformanceLevels", &e.SupportedElasticPoolPerformanceLevels) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolListResult. +func (e ElasticPoolListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolListResult. +func (e *ElasticPoolListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolOperation. +func (e ElasticPoolOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolOperation. +func (e *ElasticPoolOperation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolOperationListResult. +func (e ElasticPoolOperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolOperationListResult. +func (e *ElasticPoolOperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolOperationProperties. +func (e ElasticPoolOperationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", e.Description) + populate(objectMap, "elasticPoolName", e.ElasticPoolName) + populate(objectMap, "errorCode", e.ErrorCode) + populate(objectMap, "errorDescription", e.ErrorDescription) + populate(objectMap, "errorSeverity", e.ErrorSeverity) + populateTimeRFC3339(objectMap, "estimatedCompletionTime", e.EstimatedCompletionTime) + populate(objectMap, "isCancellable", e.IsCancellable) + populate(objectMap, "isUserError", e.IsUserError) + populate(objectMap, "operation", e.Operation) + populate(objectMap, "operationFriendlyName", e.OperationFriendlyName) + populate(objectMap, "percentComplete", e.PercentComplete) + populate(objectMap, "serverName", e.ServerName) + populateTimeRFC3339(objectMap, "startTime", e.StartTime) + populate(objectMap, "state", e.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolOperationProperties. +func (e *ElasticPoolOperationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &e.Description) + delete(rawMsg, key) + case "elasticPoolName": + err = unpopulate(val, "ElasticPoolName", &e.ElasticPoolName) + delete(rawMsg, key) + case "errorCode": + err = unpopulate(val, "ErrorCode", &e.ErrorCode) + delete(rawMsg, key) + case "errorDescription": + err = unpopulate(val, "ErrorDescription", &e.ErrorDescription) + delete(rawMsg, key) + case "errorSeverity": + err = unpopulate(val, "ErrorSeverity", &e.ErrorSeverity) + delete(rawMsg, key) + case "estimatedCompletionTime": + err = unpopulateTimeRFC3339(val, "EstimatedCompletionTime", &e.EstimatedCompletionTime) + delete(rawMsg, key) + case "isCancellable": + err = unpopulate(val, "IsCancellable", &e.IsCancellable) + delete(rawMsg, key) + case "isUserError": + err = unpopulate(val, "IsUserError", &e.IsUserError) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &e.Operation) + delete(rawMsg, key) + case "operationFriendlyName": + err = unpopulate(val, "OperationFriendlyName", &e.OperationFriendlyName) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &e.PercentComplete) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &e.ServerName) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &e.StartTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &e.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolPerDatabaseMaxPerformanceLevelCapability. +func (e ElasticPoolPerDatabaseMaxPerformanceLevelCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "limit", e.Limit) + populate(objectMap, "reason", e.Reason) + populate(objectMap, "status", e.Status) + populate(objectMap, "supportedPerDatabaseMinPerformanceLevels", e.SupportedPerDatabaseMinPerformanceLevels) + populate(objectMap, "unit", e.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolPerDatabaseMaxPerformanceLevelCapability. +func (e *ElasticPoolPerDatabaseMaxPerformanceLevelCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "limit": + err = unpopulate(val, "Limit", &e.Limit) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &e.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &e.Status) + delete(rawMsg, key) + case "supportedPerDatabaseMinPerformanceLevels": + err = unpopulate(val, "SupportedPerDatabaseMinPerformanceLevels", &e.SupportedPerDatabaseMinPerformanceLevels) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &e.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolPerDatabaseMinPerformanceLevelCapability. +func (e ElasticPoolPerDatabaseMinPerformanceLevelCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "limit", e.Limit) + populate(objectMap, "reason", e.Reason) + populate(objectMap, "status", e.Status) + populate(objectMap, "unit", e.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolPerDatabaseMinPerformanceLevelCapability. +func (e *ElasticPoolPerDatabaseMinPerformanceLevelCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "limit": + err = unpopulate(val, "Limit", &e.Limit) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &e.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &e.Status) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &e.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolPerDatabaseSettings. +func (e ElasticPoolPerDatabaseSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "maxCapacity", e.MaxCapacity) + populate(objectMap, "minCapacity", e.MinCapacity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolPerDatabaseSettings. +func (e *ElasticPoolPerDatabaseSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "maxCapacity": + err = unpopulate(val, "MaxCapacity", &e.MaxCapacity) + delete(rawMsg, key) + case "minCapacity": + err = unpopulate(val, "MinCapacity", &e.MinCapacity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolPerformanceLevelCapability. +func (e ElasticPoolPerformanceLevelCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "includedMaxSize", e.IncludedMaxSize) + populate(objectMap, "maxDatabaseCount", e.MaxDatabaseCount) + populate(objectMap, "performanceLevel", e.PerformanceLevel) + populate(objectMap, "reason", e.Reason) + populate(objectMap, "sku", e.SKU) + populate(objectMap, "status", e.Status) + populate(objectMap, "supportedLicenseTypes", e.SupportedLicenseTypes) + populate(objectMap, "supportedMaintenanceConfigurations", e.SupportedMaintenanceConfigurations) + populate(objectMap, "supportedMaxSizes", e.SupportedMaxSizes) + populate(objectMap, "supportedPerDatabaseMaxPerformanceLevels", e.SupportedPerDatabaseMaxPerformanceLevels) + populate(objectMap, "supportedPerDatabaseMaxSizes", e.SupportedPerDatabaseMaxSizes) + populate(objectMap, "zoneRedundant", e.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolPerformanceLevelCapability. +func (e *ElasticPoolPerformanceLevelCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "includedMaxSize": + err = unpopulate(val, "IncludedMaxSize", &e.IncludedMaxSize) + delete(rawMsg, key) + case "maxDatabaseCount": + err = unpopulate(val, "MaxDatabaseCount", &e.MaxDatabaseCount) + delete(rawMsg, key) + case "performanceLevel": + err = unpopulate(val, "PerformanceLevel", &e.PerformanceLevel) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &e.Reason) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &e.SKU) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &e.Status) + delete(rawMsg, key) + case "supportedLicenseTypes": + err = unpopulate(val, "SupportedLicenseTypes", &e.SupportedLicenseTypes) + delete(rawMsg, key) + case "supportedMaintenanceConfigurations": + err = unpopulate(val, "SupportedMaintenanceConfigurations", &e.SupportedMaintenanceConfigurations) + delete(rawMsg, key) + case "supportedMaxSizes": + err = unpopulate(val, "SupportedMaxSizes", &e.SupportedMaxSizes) + delete(rawMsg, key) + case "supportedPerDatabaseMaxPerformanceLevels": + err = unpopulate(val, "SupportedPerDatabaseMaxPerformanceLevels", &e.SupportedPerDatabaseMaxPerformanceLevels) + delete(rawMsg, key) + case "supportedPerDatabaseMaxSizes": + err = unpopulate(val, "SupportedPerDatabaseMaxSizes", &e.SupportedPerDatabaseMaxSizes) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolProperties. +func (e ElasticPoolProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "creationDate", e.CreationDate) + populate(objectMap, "highAvailabilityReplicaCount", e.HighAvailabilityReplicaCount) + populate(objectMap, "licenseType", e.LicenseType) + populate(objectMap, "maintenanceConfigurationId", e.MaintenanceConfigurationID) + populate(objectMap, "maxSizeBytes", e.MaxSizeBytes) + populate(objectMap, "perDatabaseSettings", e.PerDatabaseSettings) + populate(objectMap, "state", e.State) + populate(objectMap, "zoneRedundant", e.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolProperties. +func (e *ElasticPoolProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &e.CreationDate) + delete(rawMsg, key) + case "highAvailabilityReplicaCount": + err = unpopulate(val, "HighAvailabilityReplicaCount", &e.HighAvailabilityReplicaCount) + delete(rawMsg, key) + case "licenseType": + err = unpopulate(val, "LicenseType", &e.LicenseType) + delete(rawMsg, key) + case "maintenanceConfigurationId": + err = unpopulate(val, "MaintenanceConfigurationID", &e.MaintenanceConfigurationID) + delete(rawMsg, key) + case "maxSizeBytes": + err = unpopulate(val, "MaxSizeBytes", &e.MaxSizeBytes) + delete(rawMsg, key) + case "perDatabaseSettings": + err = unpopulate(val, "PerDatabaseSettings", &e.PerDatabaseSettings) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &e.State) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolUpdate. +func (e ElasticPoolUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "sku", e.SKU) + populate(objectMap, "tags", e.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolUpdate. +func (e *ElasticPoolUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &e.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolUpdateProperties. +func (e ElasticPoolUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "highAvailabilityReplicaCount", e.HighAvailabilityReplicaCount) + populate(objectMap, "licenseType", e.LicenseType) + populate(objectMap, "maintenanceConfigurationId", e.MaintenanceConfigurationID) + populate(objectMap, "maxSizeBytes", e.MaxSizeBytes) + populate(objectMap, "perDatabaseSettings", e.PerDatabaseSettings) + populate(objectMap, "zoneRedundant", e.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolUpdateProperties. +func (e *ElasticPoolUpdateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "highAvailabilityReplicaCount": + err = unpopulate(val, "HighAvailabilityReplicaCount", &e.HighAvailabilityReplicaCount) + delete(rawMsg, key) + case "licenseType": + err = unpopulate(val, "LicenseType", &e.LicenseType) + delete(rawMsg, key) + case "maintenanceConfigurationId": + err = unpopulate(val, "MaintenanceConfigurationID", &e.MaintenanceConfigurationID) + delete(rawMsg, key) + case "maxSizeBytes": + err = unpopulate(val, "MaxSizeBytes", &e.MaxSizeBytes) + delete(rawMsg, key) + case "perDatabaseSettings": + err = unpopulate(val, "PerDatabaseSettings", &e.PerDatabaseSettings) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EncryptionProtector. +func (e EncryptionProtector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", e.ID) + populate(objectMap, "kind", e.Kind) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionProtector. +func (e *EncryptionProtector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EncryptionProtectorListResult. +func (e EncryptionProtectorListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionProtectorListResult. +func (e *EncryptionProtectorListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EncryptionProtectorProperties. +func (e EncryptionProtectorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "autoRotationEnabled", e.AutoRotationEnabled) + populate(objectMap, "serverKeyName", e.ServerKeyName) + populate(objectMap, "serverKeyType", e.ServerKeyType) + populate(objectMap, "subregion", e.Subregion) + populate(objectMap, "thumbprint", e.Thumbprint) + populate(objectMap, "uri", e.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionProtectorProperties. +func (e *EncryptionProtectorProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoRotationEnabled": + err = unpopulate(val, "AutoRotationEnabled", &e.AutoRotationEnabled) + delete(rawMsg, key) + case "serverKeyName": + err = unpopulate(val, "ServerKeyName", &e.ServerKeyName) + delete(rawMsg, key) + case "serverKeyType": + err = unpopulate(val, "ServerKeyType", &e.ServerKeyType) + delete(rawMsg, key) + case "subregion": + err = unpopulate(val, "Subregion", &e.Subregion) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &e.Thumbprint) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &e.URI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointCertificate. +func (e EndpointCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointCertificate. +func (e *EndpointCertificate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointCertificateListResult. +func (e EndpointCertificateListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointCertificateListResult. +func (e *EndpointCertificateListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointCertificateProperties. +func (e EndpointCertificateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "publicBlob", e.PublicBlob) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointCertificateProperties. +func (e *EndpointCertificateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "publicBlob": + err = unpopulate(val, "PublicBlob", &e.PublicBlob) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExportDatabaseDefinition. +func (e ExportDatabaseDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "administratorLogin", e.AdministratorLogin) + populate(objectMap, "administratorLoginPassword", e.AdministratorLoginPassword) + populate(objectMap, "authenticationType", e.AuthenticationType) + populate(objectMap, "networkIsolation", e.NetworkIsolation) + populate(objectMap, "storageKey", e.StorageKey) + populate(objectMap, "storageKeyType", e.StorageKeyType) + populate(objectMap, "storageUri", e.StorageURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExportDatabaseDefinition. +func (e *ExportDatabaseDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "administratorLogin": + err = unpopulate(val, "AdministratorLogin", &e.AdministratorLogin) + delete(rawMsg, key) + case "administratorLoginPassword": + err = unpopulate(val, "AdministratorLoginPassword", &e.AdministratorLoginPassword) + delete(rawMsg, key) + case "authenticationType": + err = unpopulate(val, "AuthenticationType", &e.AuthenticationType) + delete(rawMsg, key) + case "networkIsolation": + err = unpopulate(val, "NetworkIsolation", &e.NetworkIsolation) + delete(rawMsg, key) + case "storageKey": + err = unpopulate(val, "StorageKey", &e.StorageKey) + delete(rawMsg, key) + case "storageKeyType": + err = unpopulate(val, "StorageKeyType", &e.StorageKeyType) + delete(rawMsg, key) + case "storageUri": + err = unpopulate(val, "StorageURI", &e.StorageURI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExtendedDatabaseBlobAuditingPolicy. +func (e ExtendedDatabaseBlobAuditingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedDatabaseBlobAuditingPolicy. +func (e *ExtendedDatabaseBlobAuditingPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExtendedDatabaseBlobAuditingPolicyListResult. +func (e ExtendedDatabaseBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedDatabaseBlobAuditingPolicyListResult. +func (e *ExtendedDatabaseBlobAuditingPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExtendedDatabaseBlobAuditingPolicyProperties. +func (e ExtendedDatabaseBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "auditActionsAndGroups", e.AuditActionsAndGroups) + populate(objectMap, "isAzureMonitorTargetEnabled", e.IsAzureMonitorTargetEnabled) + populate(objectMap, "isManagedIdentityInUse", e.IsManagedIdentityInUse) + populate(objectMap, "isStorageSecondaryKeyInUse", e.IsStorageSecondaryKeyInUse) + populate(objectMap, "predicateExpression", e.PredicateExpression) + populate(objectMap, "queueDelayMs", e.QueueDelayMs) + populate(objectMap, "retentionDays", e.RetentionDays) + populate(objectMap, "state", e.State) + populate(objectMap, "storageAccountAccessKey", e.StorageAccountAccessKey) + populate(objectMap, "storageAccountSubscriptionId", e.StorageAccountSubscriptionID) + populate(objectMap, "storageEndpoint", e.StorageEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedDatabaseBlobAuditingPolicyProperties. +func (e *ExtendedDatabaseBlobAuditingPolicyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "auditActionsAndGroups": + err = unpopulate(val, "AuditActionsAndGroups", &e.AuditActionsAndGroups) + delete(rawMsg, key) + case "isAzureMonitorTargetEnabled": + err = unpopulate(val, "IsAzureMonitorTargetEnabled", &e.IsAzureMonitorTargetEnabled) + delete(rawMsg, key) + case "isManagedIdentityInUse": + err = unpopulate(val, "IsManagedIdentityInUse", &e.IsManagedIdentityInUse) + delete(rawMsg, key) + case "isStorageSecondaryKeyInUse": + err = unpopulate(val, "IsStorageSecondaryKeyInUse", &e.IsStorageSecondaryKeyInUse) + delete(rawMsg, key) + case "predicateExpression": + err = unpopulate(val, "PredicateExpression", &e.PredicateExpression) + delete(rawMsg, key) + case "queueDelayMs": + err = unpopulate(val, "QueueDelayMs", &e.QueueDelayMs) + delete(rawMsg, key) + case "retentionDays": + err = unpopulate(val, "RetentionDays", &e.RetentionDays) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &e.State) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &e.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageAccountSubscriptionId": + err = unpopulate(val, "StorageAccountSubscriptionID", &e.StorageAccountSubscriptionID) + delete(rawMsg, key) + case "storageEndpoint": + err = unpopulate(val, "StorageEndpoint", &e.StorageEndpoint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExtendedServerBlobAuditingPolicy. +func (e ExtendedServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedServerBlobAuditingPolicy. +func (e *ExtendedServerBlobAuditingPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExtendedServerBlobAuditingPolicyListResult. +func (e ExtendedServerBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedServerBlobAuditingPolicyListResult. +func (e *ExtendedServerBlobAuditingPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExtendedServerBlobAuditingPolicyProperties. +func (e ExtendedServerBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "auditActionsAndGroups", e.AuditActionsAndGroups) + populate(objectMap, "isAzureMonitorTargetEnabled", e.IsAzureMonitorTargetEnabled) + populate(objectMap, "isDevopsAuditEnabled", e.IsDevopsAuditEnabled) + populate(objectMap, "isManagedIdentityInUse", e.IsManagedIdentityInUse) + populate(objectMap, "isStorageSecondaryKeyInUse", e.IsStorageSecondaryKeyInUse) + populate(objectMap, "predicateExpression", e.PredicateExpression) + populate(objectMap, "queueDelayMs", e.QueueDelayMs) + populate(objectMap, "retentionDays", e.RetentionDays) + populate(objectMap, "state", e.State) + populate(objectMap, "storageAccountAccessKey", e.StorageAccountAccessKey) + populate(objectMap, "storageAccountSubscriptionId", e.StorageAccountSubscriptionID) + populate(objectMap, "storageEndpoint", e.StorageEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedServerBlobAuditingPolicyProperties. +func (e *ExtendedServerBlobAuditingPolicyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "auditActionsAndGroups": + err = unpopulate(val, "AuditActionsAndGroups", &e.AuditActionsAndGroups) + delete(rawMsg, key) + case "isAzureMonitorTargetEnabled": + err = unpopulate(val, "IsAzureMonitorTargetEnabled", &e.IsAzureMonitorTargetEnabled) + delete(rawMsg, key) + case "isDevopsAuditEnabled": + err = unpopulate(val, "IsDevopsAuditEnabled", &e.IsDevopsAuditEnabled) + delete(rawMsg, key) + case "isManagedIdentityInUse": + err = unpopulate(val, "IsManagedIdentityInUse", &e.IsManagedIdentityInUse) + delete(rawMsg, key) + case "isStorageSecondaryKeyInUse": + err = unpopulate(val, "IsStorageSecondaryKeyInUse", &e.IsStorageSecondaryKeyInUse) + delete(rawMsg, key) + case "predicateExpression": + err = unpopulate(val, "PredicateExpression", &e.PredicateExpression) + delete(rawMsg, key) + case "queueDelayMs": + err = unpopulate(val, "QueueDelayMs", &e.QueueDelayMs) + delete(rawMsg, key) + case "retentionDays": + err = unpopulate(val, "RetentionDays", &e.RetentionDays) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &e.State) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &e.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageAccountSubscriptionId": + err = unpopulate(val, "StorageAccountSubscriptionID", &e.StorageAccountSubscriptionID) + delete(rawMsg, key) + case "storageEndpoint": + err = unpopulate(val, "StorageEndpoint", &e.StorageEndpoint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FailoverGroup. +func (f FailoverGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", f.ID) + populate(objectMap, "location", f.Location) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "tags", f.Tags) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverGroup. +func (f *FailoverGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &f.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &f.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FailoverGroupListResult. +func (f FailoverGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverGroupListResult. +func (f *FailoverGroupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FailoverGroupProperties. +func (f FailoverGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "databases", f.Databases) + populate(objectMap, "partnerServers", f.PartnerServers) + populate(objectMap, "readOnlyEndpoint", f.ReadOnlyEndpoint) + populate(objectMap, "readWriteEndpoint", f.ReadWriteEndpoint) + populate(objectMap, "replicationRole", f.ReplicationRole) + populate(objectMap, "replicationState", f.ReplicationState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverGroupProperties. +func (f *FailoverGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databases": + err = unpopulate(val, "Databases", &f.Databases) + delete(rawMsg, key) + case "partnerServers": + err = unpopulate(val, "PartnerServers", &f.PartnerServers) + delete(rawMsg, key) + case "readOnlyEndpoint": + err = unpopulate(val, "ReadOnlyEndpoint", &f.ReadOnlyEndpoint) + delete(rawMsg, key) + case "readWriteEndpoint": + err = unpopulate(val, "ReadWriteEndpoint", &f.ReadWriteEndpoint) + delete(rawMsg, key) + case "replicationRole": + err = unpopulate(val, "ReplicationRole", &f.ReplicationRole) + delete(rawMsg, key) + case "replicationState": + err = unpopulate(val, "ReplicationState", &f.ReplicationState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FailoverGroupReadOnlyEndpoint. +func (f FailoverGroupReadOnlyEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "failoverPolicy", f.FailoverPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverGroupReadOnlyEndpoint. +func (f *FailoverGroupReadOnlyEndpoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "failoverPolicy": + err = unpopulate(val, "FailoverPolicy", &f.FailoverPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FailoverGroupReadWriteEndpoint. +func (f FailoverGroupReadWriteEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "failoverPolicy", f.FailoverPolicy) + populate(objectMap, "failoverWithDataLossGracePeriodMinutes", f.FailoverWithDataLossGracePeriodMinutes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverGroupReadWriteEndpoint. +func (f *FailoverGroupReadWriteEndpoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "failoverPolicy": + err = unpopulate(val, "FailoverPolicy", &f.FailoverPolicy) + delete(rawMsg, key) + case "failoverWithDataLossGracePeriodMinutes": + err = unpopulate(val, "FailoverWithDataLossGracePeriodMinutes", &f.FailoverWithDataLossGracePeriodMinutes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FailoverGroupUpdate. +func (f FailoverGroupUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "tags", f.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverGroupUpdate. +func (f *FailoverGroupUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &f.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FailoverGroupUpdateProperties. +func (f FailoverGroupUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "databases", f.Databases) + populate(objectMap, "readOnlyEndpoint", f.ReadOnlyEndpoint) + populate(objectMap, "readWriteEndpoint", f.ReadWriteEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverGroupUpdateProperties. +func (f *FailoverGroupUpdateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databases": + err = unpopulate(val, "Databases", &f.Databases) + delete(rawMsg, key) + case "readOnlyEndpoint": + err = unpopulate(val, "ReadOnlyEndpoint", &f.ReadOnlyEndpoint) + delete(rawMsg, key) + case "readWriteEndpoint": + err = unpopulate(val, "ReadWriteEndpoint", &f.ReadWriteEndpoint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FirewallRule. +func (f FirewallRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRule. +func (f *FirewallRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FirewallRuleList. +func (f FirewallRuleList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "values", f.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRuleList. +func (f *FirewallRuleList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "values": + err = unpopulate(val, "Values", &f.Values) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FirewallRuleListResult. +func (f FirewallRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRuleListResult. +func (f *FirewallRuleListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GeoBackupPolicy. +func (g GeoBackupPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", g.ID) + populate(objectMap, "kind", g.Kind) + populate(objectMap, "location", g.Location) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GeoBackupPolicy. +func (g *GeoBackupPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &g.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &g.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &g.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GeoBackupPolicyListResult. +func (g GeoBackupPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GeoBackupPolicyListResult. +func (g *GeoBackupPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &g.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GeoBackupPolicyProperties. +func (g GeoBackupPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "state", g.State) + populate(objectMap, "storageType", g.StorageType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GeoBackupPolicyProperties. +func (g *GeoBackupPolicyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "state": + err = unpopulate(val, "State", &g.State) + delete(rawMsg, key) + case "storageType": + err = unpopulate(val, "StorageType", &g.StorageType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPv6FirewallRule. +func (i IPv6FirewallRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPv6FirewallRule. +func (i *IPv6FirewallRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPv6FirewallRuleListResult. +func (i IPv6FirewallRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPv6FirewallRuleListResult. +func (i *IPv6FirewallRuleListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPv6ServerFirewallRuleProperties. +func (i IPv6ServerFirewallRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "endIPv6Address", i.EndIPv6Address) + populate(objectMap, "startIPv6Address", i.StartIPv6Address) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPv6ServerFirewallRuleProperties. +func (i *IPv6ServerFirewallRuleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endIPv6Address": + err = unpopulate(val, "EndIPv6Address", &i.EndIPv6Address) + delete(rawMsg, key) + case "startIPv6Address": + err = unpopulate(val, "StartIPv6Address", &i.StartIPv6Address) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImportExistingDatabaseDefinition. +func (i ImportExistingDatabaseDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "administratorLogin", i.AdministratorLogin) + populate(objectMap, "administratorLoginPassword", i.AdministratorLoginPassword) + populate(objectMap, "authenticationType", i.AuthenticationType) + populate(objectMap, "networkIsolation", i.NetworkIsolation) + populate(objectMap, "storageKey", i.StorageKey) + populate(objectMap, "storageKeyType", i.StorageKeyType) + populate(objectMap, "storageUri", i.StorageURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportExistingDatabaseDefinition. +func (i *ImportExistingDatabaseDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "administratorLogin": + err = unpopulate(val, "AdministratorLogin", &i.AdministratorLogin) + delete(rawMsg, key) + case "administratorLoginPassword": + err = unpopulate(val, "AdministratorLoginPassword", &i.AdministratorLoginPassword) + delete(rawMsg, key) + case "authenticationType": + err = unpopulate(val, "AuthenticationType", &i.AuthenticationType) + delete(rawMsg, key) + case "networkIsolation": + err = unpopulate(val, "NetworkIsolation", &i.NetworkIsolation) + delete(rawMsg, key) + case "storageKey": + err = unpopulate(val, "StorageKey", &i.StorageKey) + delete(rawMsg, key) + case "storageKeyType": + err = unpopulate(val, "StorageKeyType", &i.StorageKeyType) + delete(rawMsg, key) + case "storageUri": + err = unpopulate(val, "StorageURI", &i.StorageURI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImportExportExtensionsOperationListResult. +func (i ImportExportExtensionsOperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportExportExtensionsOperationListResult. +func (i *ImportExportExtensionsOperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImportExportExtensionsOperationResult. +func (i ImportExportExtensionsOperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportExportExtensionsOperationResult. +func (i *ImportExportExtensionsOperationResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImportExportExtensionsOperationResultProperties. +func (i ImportExportExtensionsOperationResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "databaseName", i.DatabaseName) + populate(objectMap, "errorMessage", i.ErrorMessage) + populate(objectMap, "lastModifiedTime", i.LastModifiedTime) + populate(objectMap, "requestId", i.RequestID) + populate(objectMap, "requestType", i.RequestType) + populate(objectMap, "serverName", i.ServerName) + populate(objectMap, "status", i.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportExportExtensionsOperationResultProperties. +func (i *ImportExportExtensionsOperationResultProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseName": + err = unpopulate(val, "DatabaseName", &i.DatabaseName) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &i.ErrorMessage) + delete(rawMsg, key) + case "lastModifiedTime": + err = unpopulate(val, "LastModifiedTime", &i.LastModifiedTime) + delete(rawMsg, key) + case "requestId": + err = unpopulate(val, "RequestID", &i.RequestID) + delete(rawMsg, key) + case "requestType": + err = unpopulate(val, "RequestType", &i.RequestType) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &i.ServerName) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &i.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImportExportOperationResult. +func (i ImportExportOperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportExportOperationResult. +func (i *ImportExportOperationResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImportExportOperationResultProperties. +func (i ImportExportOperationResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "blobUri", i.BlobURI) + populate(objectMap, "databaseName", i.DatabaseName) + populate(objectMap, "errorMessage", i.ErrorMessage) + populate(objectMap, "lastModifiedTime", i.LastModifiedTime) + populate(objectMap, "privateEndpointConnections", i.PrivateEndpointConnections) + populate(objectMap, "queuedTime", i.QueuedTime) + populate(objectMap, "requestId", i.RequestID) + populate(objectMap, "requestType", i.RequestType) + populate(objectMap, "serverName", i.ServerName) + populate(objectMap, "status", i.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportExportOperationResultProperties. +func (i *ImportExportOperationResultProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blobUri": + err = unpopulate(val, "BlobURI", &i.BlobURI) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &i.DatabaseName) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &i.ErrorMessage) + delete(rawMsg, key) + case "lastModifiedTime": + err = unpopulate(val, "LastModifiedTime", &i.LastModifiedTime) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &i.PrivateEndpointConnections) + delete(rawMsg, key) + case "queuedTime": + err = unpopulate(val, "QueuedTime", &i.QueuedTime) + delete(rawMsg, key) + case "requestId": + err = unpopulate(val, "RequestID", &i.RequestID) + delete(rawMsg, key) + case "requestType": + err = unpopulate(val, "RequestType", &i.RequestType) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &i.ServerName) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &i.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImportNewDatabaseDefinition. +func (i ImportNewDatabaseDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "administratorLogin", i.AdministratorLogin) + populate(objectMap, "administratorLoginPassword", i.AdministratorLoginPassword) + populate(objectMap, "authenticationType", i.AuthenticationType) + populate(objectMap, "databaseName", i.DatabaseName) + populate(objectMap, "edition", i.Edition) + populate(objectMap, "maxSizeBytes", i.MaxSizeBytes) + populate(objectMap, "networkIsolation", i.NetworkIsolation) + populate(objectMap, "serviceObjectiveName", i.ServiceObjectiveName) + populate(objectMap, "storageKey", i.StorageKey) + populate(objectMap, "storageKeyType", i.StorageKeyType) + populate(objectMap, "storageUri", i.StorageURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportNewDatabaseDefinition. +func (i *ImportNewDatabaseDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "administratorLogin": + err = unpopulate(val, "AdministratorLogin", &i.AdministratorLogin) + delete(rawMsg, key) + case "administratorLoginPassword": + err = unpopulate(val, "AdministratorLoginPassword", &i.AdministratorLoginPassword) + delete(rawMsg, key) + case "authenticationType": + err = unpopulate(val, "AuthenticationType", &i.AuthenticationType) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &i.DatabaseName) + delete(rawMsg, key) + case "edition": + err = unpopulate(val, "Edition", &i.Edition) + delete(rawMsg, key) + case "maxSizeBytes": + err = unpopulate(val, "MaxSizeBytes", &i.MaxSizeBytes) + delete(rawMsg, key) + case "networkIsolation": + err = unpopulate(val, "NetworkIsolation", &i.NetworkIsolation) + delete(rawMsg, key) + case "serviceObjectiveName": + err = unpopulate(val, "ServiceObjectiveName", &i.ServiceObjectiveName) + delete(rawMsg, key) + case "storageKey": + err = unpopulate(val, "StorageKey", &i.StorageKey) + delete(rawMsg, key) + case "storageKeyType": + err = unpopulate(val, "StorageKeyType", &i.StorageKeyType) + delete(rawMsg, key) + case "storageUri": + err = unpopulate(val, "StorageURI", &i.StorageURI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InstanceFailoverGroup. +func (i InstanceFailoverGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceFailoverGroup. +func (i *InstanceFailoverGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InstanceFailoverGroupListResult. +func (i InstanceFailoverGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceFailoverGroupListResult. +func (i *InstanceFailoverGroupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InstanceFailoverGroupProperties. +func (i InstanceFailoverGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "managedInstancePairs", i.ManagedInstancePairs) + populate(objectMap, "partnerRegions", i.PartnerRegions) + populate(objectMap, "readOnlyEndpoint", i.ReadOnlyEndpoint) + populate(objectMap, "readWriteEndpoint", i.ReadWriteEndpoint) + populate(objectMap, "replicationRole", i.ReplicationRole) + populate(objectMap, "replicationState", i.ReplicationState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceFailoverGroupProperties. +func (i *InstanceFailoverGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "managedInstancePairs": + err = unpopulate(val, "ManagedInstancePairs", &i.ManagedInstancePairs) + delete(rawMsg, key) + case "partnerRegions": + err = unpopulate(val, "PartnerRegions", &i.PartnerRegions) + delete(rawMsg, key) + case "readOnlyEndpoint": + err = unpopulate(val, "ReadOnlyEndpoint", &i.ReadOnlyEndpoint) + delete(rawMsg, key) + case "readWriteEndpoint": + err = unpopulate(val, "ReadWriteEndpoint", &i.ReadWriteEndpoint) + delete(rawMsg, key) + case "replicationRole": + err = unpopulate(val, "ReplicationRole", &i.ReplicationRole) + delete(rawMsg, key) + case "replicationState": + err = unpopulate(val, "ReplicationState", &i.ReplicationState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InstanceFailoverGroupReadOnlyEndpoint. +func (i InstanceFailoverGroupReadOnlyEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "failoverPolicy", i.FailoverPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceFailoverGroupReadOnlyEndpoint. +func (i *InstanceFailoverGroupReadOnlyEndpoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "failoverPolicy": + err = unpopulate(val, "FailoverPolicy", &i.FailoverPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InstanceFailoverGroupReadWriteEndpoint. +func (i InstanceFailoverGroupReadWriteEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "failoverPolicy", i.FailoverPolicy) + populate(objectMap, "failoverWithDataLossGracePeriodMinutes", i.FailoverWithDataLossGracePeriodMinutes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceFailoverGroupReadWriteEndpoint. +func (i *InstanceFailoverGroupReadWriteEndpoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "failoverPolicy": + err = unpopulate(val, "FailoverPolicy", &i.FailoverPolicy) + delete(rawMsg, key) + case "failoverWithDataLossGracePeriodMinutes": + err = unpopulate(val, "FailoverWithDataLossGracePeriodMinutes", &i.FailoverWithDataLossGracePeriodMinutes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InstancePool. +func (i InstancePool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", i.ID) + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "sku", i.SKU) + populate(objectMap, "tags", i.Tags) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstancePool. +func (i *InstancePool) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &i.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &i.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &i.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InstancePoolEditionCapability. +func (i InstancePoolEditionCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", i.Name) + populate(objectMap, "reason", i.Reason) + populate(objectMap, "status", i.Status) + populate(objectMap, "supportedFamilies", i.SupportedFamilies) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstancePoolEditionCapability. +func (i *InstancePoolEditionCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &i.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &i.Status) + delete(rawMsg, key) + case "supportedFamilies": + err = unpopulate(val, "SupportedFamilies", &i.SupportedFamilies) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InstancePoolFamilyCapability. +func (i InstancePoolFamilyCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", i.Name) + populate(objectMap, "reason", i.Reason) + populate(objectMap, "status", i.Status) + populate(objectMap, "supportedLicenseTypes", i.SupportedLicenseTypes) + populate(objectMap, "supportedVcoresValues", i.SupportedVcoresValues) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstancePoolFamilyCapability. +func (i *InstancePoolFamilyCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &i.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &i.Status) + delete(rawMsg, key) + case "supportedLicenseTypes": + err = unpopulate(val, "SupportedLicenseTypes", &i.SupportedLicenseTypes) + delete(rawMsg, key) + case "supportedVcoresValues": + err = unpopulate(val, "SupportedVcoresValues", &i.SupportedVcoresValues) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InstancePoolListResult. +func (i InstancePoolListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstancePoolListResult. +func (i *InstancePoolListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InstancePoolProperties. +func (i InstancePoolProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "licenseType", i.LicenseType) + populate(objectMap, "subnetId", i.SubnetID) + populate(objectMap, "vCores", i.VCores) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstancePoolProperties. +func (i *InstancePoolProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "licenseType": + err = unpopulate(val, "LicenseType", &i.LicenseType) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &i.SubnetID) + delete(rawMsg, key) + case "vCores": + err = unpopulate(val, "VCores", &i.VCores) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InstancePoolUpdate. +func (i InstancePoolUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", i.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstancePoolUpdate. +func (i *InstancePoolUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &i.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InstancePoolVcoresCapability. +func (i InstancePoolVcoresCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", i.Name) + populate(objectMap, "reason", i.Reason) + populate(objectMap, "status", i.Status) + populate(objectMap, "storageLimit", i.StorageLimit) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstancePoolVcoresCapability. +func (i *InstancePoolVcoresCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &i.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &i.Status) + delete(rawMsg, key) + case "storageLimit": + err = unpopulate(val, "StorageLimit", &i.StorageLimit) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Job. +func (j *Job) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobAgent. +func (j JobAgent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", j.ID) + populate(objectMap, "location", j.Location) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "sku", j.SKU) + populate(objectMap, "tags", j.Tags) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobAgent. +func (j *JobAgent) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &j.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &j.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &j.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobAgentListResult. +func (j JobAgentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobAgentListResult. +func (j *JobAgentListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobAgentProperties. +func (j JobAgentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "databaseId", j.DatabaseID) + populate(objectMap, "state", j.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobAgentProperties. +func (j *JobAgentProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseId": + err = unpopulate(val, "DatabaseID", &j.DatabaseID) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &j.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobAgentUpdate. +func (j JobAgentUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", j.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobAgentUpdate. +func (j *JobAgentUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &j.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobCredential. +func (j JobCredential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobCredential. +func (j *JobCredential) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobCredentialListResult. +func (j JobCredentialListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobCredentialListResult. +func (j *JobCredentialListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobCredentialProperties. +func (j JobCredentialProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "password", j.Password) + populate(objectMap, "username", j.Username) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobCredentialProperties. +func (j *JobCredentialProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "password": + err = unpopulate(val, "Password", &j.Password) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &j.Username) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobExecution. +func (j JobExecution) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecution. +func (j *JobExecution) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobExecutionListResult. +func (j JobExecutionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionListResult. +func (j *JobExecutionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobExecutionProperties. +func (j JobExecutionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createTime", j.CreateTime) + populateTimeRFC3339(objectMap, "currentAttemptStartTime", j.CurrentAttemptStartTime) + populate(objectMap, "currentAttempts", j.CurrentAttempts) + populateTimeRFC3339(objectMap, "endTime", j.EndTime) + populate(objectMap, "jobExecutionId", j.JobExecutionID) + populate(objectMap, "jobVersion", j.JobVersion) + populate(objectMap, "lastMessage", j.LastMessage) + populate(objectMap, "lifecycle", j.Lifecycle) + populate(objectMap, "provisioningState", j.ProvisioningState) + populateTimeRFC3339(objectMap, "startTime", j.StartTime) + populate(objectMap, "stepId", j.StepID) + populate(objectMap, "stepName", j.StepName) + populate(objectMap, "target", j.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionProperties. +func (j *JobExecutionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createTime": + err = unpopulateTimeRFC3339(val, "CreateTime", &j.CreateTime) + delete(rawMsg, key) + case "currentAttemptStartTime": + err = unpopulateTimeRFC3339(val, "CurrentAttemptStartTime", &j.CurrentAttemptStartTime) + delete(rawMsg, key) + case "currentAttempts": + err = unpopulate(val, "CurrentAttempts", &j.CurrentAttempts) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) + delete(rawMsg, key) + case "jobExecutionId": + err = unpopulate(val, "JobExecutionID", &j.JobExecutionID) + delete(rawMsg, key) + case "jobVersion": + err = unpopulate(val, "JobVersion", &j.JobVersion) + delete(rawMsg, key) + case "lastMessage": + err = unpopulate(val, "LastMessage", &j.LastMessage) + delete(rawMsg, key) + case "lifecycle": + err = unpopulate(val, "Lifecycle", &j.Lifecycle) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &j.ProvisioningState) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) + delete(rawMsg, key) + case "stepId": + err = unpopulate(val, "StepID", &j.StepID) + delete(rawMsg, key) + case "stepName": + err = unpopulate(val, "StepName", &j.StepName) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &j.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobExecutionTarget. +func (j JobExecutionTarget) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "databaseName", j.DatabaseName) + populate(objectMap, "serverName", j.ServerName) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionTarget. +func (j *JobExecutionTarget) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseName": + err = unpopulate(val, "DatabaseName", &j.DatabaseName) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &j.ServerName) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobListResult. +func (j JobListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobListResult. +func (j *JobListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobProperties. +func (j JobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", j.Description) + populate(objectMap, "schedule", j.Schedule) + populate(objectMap, "version", j.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobProperties. +func (j *JobProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &j.Description) + delete(rawMsg, key) + case "schedule": + err = unpopulate(val, "Schedule", &j.Schedule) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &j.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobSchedule. +func (j JobSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enabled", j.Enabled) + populateTimeRFC3339(objectMap, "endTime", j.EndTime) + populate(objectMap, "interval", j.Interval) + populateTimeRFC3339(objectMap, "startTime", j.StartTime) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobSchedule. +func (j *JobSchedule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &j.Enabled) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) + delete(rawMsg, key) + case "interval": + err = unpopulate(val, "Interval", &j.Interval) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobStep. +func (j JobStep) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobStep. +func (j *JobStep) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobStepAction. +func (j JobStepAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "source", j.Source) + populate(objectMap, "type", j.Type) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobStepAction. +func (j *JobStepAction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "source": + err = unpopulate(val, "Source", &j.Source) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobStepExecutionOptions. +func (j JobStepExecutionOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "initialRetryIntervalSeconds", j.InitialRetryIntervalSeconds) + populate(objectMap, "maximumRetryIntervalSeconds", j.MaximumRetryIntervalSeconds) + populate(objectMap, "retryAttempts", j.RetryAttempts) + populate(objectMap, "retryIntervalBackoffMultiplier", j.RetryIntervalBackoffMultiplier) + populate(objectMap, "timeoutSeconds", j.TimeoutSeconds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobStepExecutionOptions. +func (j *JobStepExecutionOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "initialRetryIntervalSeconds": + err = unpopulate(val, "InitialRetryIntervalSeconds", &j.InitialRetryIntervalSeconds) + delete(rawMsg, key) + case "maximumRetryIntervalSeconds": + err = unpopulate(val, "MaximumRetryIntervalSeconds", &j.MaximumRetryIntervalSeconds) + delete(rawMsg, key) + case "retryAttempts": + err = unpopulate(val, "RetryAttempts", &j.RetryAttempts) + delete(rawMsg, key) + case "retryIntervalBackoffMultiplier": + err = unpopulate(val, "RetryIntervalBackoffMultiplier", &j.RetryIntervalBackoffMultiplier) + delete(rawMsg, key) + case "timeoutSeconds": + err = unpopulate(val, "TimeoutSeconds", &j.TimeoutSeconds) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobStepListResult. +func (j JobStepListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobStepListResult. +func (j *JobStepListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobStepOutput. +func (j JobStepOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "credential", j.Credential) + populate(objectMap, "databaseName", j.DatabaseName) + populate(objectMap, "resourceGroupName", j.ResourceGroupName) + populate(objectMap, "schemaName", j.SchemaName) + populate(objectMap, "serverName", j.ServerName) + populate(objectMap, "subscriptionId", j.SubscriptionID) + populate(objectMap, "tableName", j.TableName) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobStepOutput. +func (j *JobStepOutput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "credential": + err = unpopulate(val, "Credential", &j.Credential) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &j.DatabaseName) + delete(rawMsg, key) + case "resourceGroupName": + err = unpopulate(val, "ResourceGroupName", &j.ResourceGroupName) + delete(rawMsg, key) + case "schemaName": + err = unpopulate(val, "SchemaName", &j.SchemaName) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &j.ServerName) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &j.SubscriptionID) + delete(rawMsg, key) + case "tableName": + err = unpopulate(val, "TableName", &j.TableName) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobStepProperties. +func (j JobStepProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "action", j.Action) + populate(objectMap, "credential", j.Credential) + populate(objectMap, "executionOptions", j.ExecutionOptions) + populate(objectMap, "output", j.Output) + populate(objectMap, "stepId", j.StepID) + populate(objectMap, "targetGroup", j.TargetGroup) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobStepProperties. +func (j *JobStepProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &j.Action) + delete(rawMsg, key) + case "credential": + err = unpopulate(val, "Credential", &j.Credential) + delete(rawMsg, key) + case "executionOptions": + err = unpopulate(val, "ExecutionOptions", &j.ExecutionOptions) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &j.Output) + delete(rawMsg, key) + case "stepId": + err = unpopulate(val, "StepID", &j.StepID) + delete(rawMsg, key) + case "targetGroup": + err = unpopulate(val, "TargetGroup", &j.TargetGroup) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobTarget. +func (j JobTarget) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "databaseName", j.DatabaseName) + populate(objectMap, "elasticPoolName", j.ElasticPoolName) + populate(objectMap, "membershipType", j.MembershipType) + populate(objectMap, "refreshCredential", j.RefreshCredential) + populate(objectMap, "serverName", j.ServerName) + populate(objectMap, "shardMapName", j.ShardMapName) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobTarget. +func (j *JobTarget) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseName": + err = unpopulate(val, "DatabaseName", &j.DatabaseName) + delete(rawMsg, key) + case "elasticPoolName": + err = unpopulate(val, "ElasticPoolName", &j.ElasticPoolName) + delete(rawMsg, key) + case "membershipType": + err = unpopulate(val, "MembershipType", &j.MembershipType) + delete(rawMsg, key) + case "refreshCredential": + err = unpopulate(val, "RefreshCredential", &j.RefreshCredential) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &j.ServerName) + delete(rawMsg, key) + case "shardMapName": + err = unpopulate(val, "ShardMapName", &j.ShardMapName) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobTargetGroup. +func (j JobTargetGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobTargetGroup. +func (j *JobTargetGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobTargetGroupListResult. +func (j JobTargetGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobTargetGroupListResult. +func (j *JobTargetGroupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobTargetGroupProperties. +func (j JobTargetGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "members", j.Members) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobTargetGroupProperties. +func (j *JobTargetGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "members": + err = unpopulate(val, "Members", &j.Members) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobVersion. +func (j JobVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobVersion. +func (j *JobVersion) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobVersionListResult. +func (j JobVersionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobVersionListResult. +func (j *JobVersionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LedgerDigestUploads. +func (l LedgerDigestUploads) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LedgerDigestUploads. +func (l *LedgerDigestUploads) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LedgerDigestUploadsListResult. +func (l LedgerDigestUploadsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LedgerDigestUploadsListResult. +func (l *LedgerDigestUploadsListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LedgerDigestUploadsProperties. +func (l LedgerDigestUploadsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "digestStorageEndpoint", l.DigestStorageEndpoint) + populate(objectMap, "state", l.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LedgerDigestUploadsProperties. +func (l *LedgerDigestUploadsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "digestStorageEndpoint": + err = unpopulate(val, "DigestStorageEndpoint", &l.DigestStorageEndpoint) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &l.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LicenseTypeCapability. +func (l LicenseTypeCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", l.Name) + populate(objectMap, "reason", l.Reason) + populate(objectMap, "status", l.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseTypeCapability. +func (l *LicenseTypeCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &l.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &l.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LocationCapabilities. +func (l LocationCapabilities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", l.Name) + populate(objectMap, "reason", l.Reason) + populate(objectMap, "status", l.Status) + populate(objectMap, "supportedManagedInstanceVersions", l.SupportedManagedInstanceVersions) + populate(objectMap, "supportedServerVersions", l.SupportedServerVersions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocationCapabilities. +func (l *LocationCapabilities) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &l.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &l.Status) + delete(rawMsg, key) + case "supportedManagedInstanceVersions": + err = unpopulate(val, "SupportedManagedInstanceVersions", &l.SupportedManagedInstanceVersions) + delete(rawMsg, key) + case "supportedServerVersions": + err = unpopulate(val, "SupportedServerVersions", &l.SupportedServerVersions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LogSizeCapability. +func (l LogSizeCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "limit", l.Limit) + populate(objectMap, "unit", l.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogSizeCapability. +func (l *LogSizeCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "limit": + err = unpopulate(val, "Limit", &l.Limit) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &l.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LogicalDatabaseTransparentDataEncryption. +func (l LogicalDatabaseTransparentDataEncryption) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogicalDatabaseTransparentDataEncryption. +func (l *LogicalDatabaseTransparentDataEncryption) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LogicalDatabaseTransparentDataEncryptionListResult. +func (l LogicalDatabaseTransparentDataEncryptionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogicalDatabaseTransparentDataEncryptionListResult. +func (l *LogicalDatabaseTransparentDataEncryptionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LogicalServerAdvancedThreatProtectionListResult. +func (l LogicalServerAdvancedThreatProtectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogicalServerAdvancedThreatProtectionListResult. +func (l *LogicalServerAdvancedThreatProtectionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LogicalServerSecurityAlertPolicyListResult. +func (l LogicalServerSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogicalServerSecurityAlertPolicyListResult. +func (l *LogicalServerSecurityAlertPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionBackup. +func (l LongTermRetentionBackup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionBackup. +func (l *LongTermRetentionBackup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionBackupListResult. +func (l LongTermRetentionBackupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionBackupListResult. +func (l *LongTermRetentionBackupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionBackupOperationResult. +func (l LongTermRetentionBackupOperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionBackupOperationResult. +func (l *LongTermRetentionBackupOperationResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionBackupProperties. +func (l LongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "backupExpirationTime", l.BackupExpirationTime) + populate(objectMap, "backupStorageRedundancy", l.BackupStorageRedundancy) + populateTimeRFC3339(objectMap, "backupTime", l.BackupTime) + populateTimeRFC3339(objectMap, "databaseDeletionTime", l.DatabaseDeletionTime) + populate(objectMap, "databaseName", l.DatabaseName) + populate(objectMap, "requestedBackupStorageRedundancy", l.RequestedBackupStorageRedundancy) + populateTimeRFC3339(objectMap, "serverCreateTime", l.ServerCreateTime) + populate(objectMap, "serverName", l.ServerName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionBackupProperties. +func (l *LongTermRetentionBackupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupExpirationTime": + err = unpopulateTimeRFC3339(val, "BackupExpirationTime", &l.BackupExpirationTime) + delete(rawMsg, key) + case "backupStorageRedundancy": + err = unpopulate(val, "BackupStorageRedundancy", &l.BackupStorageRedundancy) + delete(rawMsg, key) + case "backupTime": + err = unpopulateTimeRFC3339(val, "BackupTime", &l.BackupTime) + delete(rawMsg, key) + case "databaseDeletionTime": + err = unpopulateTimeRFC3339(val, "DatabaseDeletionTime", &l.DatabaseDeletionTime) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &l.DatabaseName) + delete(rawMsg, key) + case "requestedBackupStorageRedundancy": + err = unpopulate(val, "RequestedBackupStorageRedundancy", &l.RequestedBackupStorageRedundancy) + delete(rawMsg, key) + case "serverCreateTime": + err = unpopulateTimeRFC3339(val, "ServerCreateTime", &l.ServerCreateTime) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &l.ServerName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionOperationResultProperties. +func (l LongTermRetentionOperationResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "fromBackupResourceId", l.FromBackupResourceID) + populate(objectMap, "message", l.Message) + populate(objectMap, "operationType", l.OperationType) + populate(objectMap, "requestId", l.RequestID) + populate(objectMap, "status", l.Status) + populate(objectMap, "targetBackupStorageRedundancy", l.TargetBackupStorageRedundancy) + populate(objectMap, "toBackupResourceId", l.ToBackupResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionOperationResultProperties. +func (l *LongTermRetentionOperationResultProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "fromBackupResourceId": + err = unpopulate(val, "FromBackupResourceID", &l.FromBackupResourceID) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &l.Message) + delete(rawMsg, key) + case "operationType": + err = unpopulate(val, "OperationType", &l.OperationType) + delete(rawMsg, key) + case "requestId": + err = unpopulate(val, "RequestID", &l.RequestID) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &l.Status) + delete(rawMsg, key) + case "targetBackupStorageRedundancy": + err = unpopulate(val, "TargetBackupStorageRedundancy", &l.TargetBackupStorageRedundancy) + delete(rawMsg, key) + case "toBackupResourceId": + err = unpopulate(val, "ToBackupResourceID", &l.ToBackupResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionPolicy. +func (l LongTermRetentionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionPolicy. +func (l *LongTermRetentionPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionPolicyListResult. +func (l LongTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionPolicyListResult. +func (l *LongTermRetentionPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MaintenanceConfigurationCapability. +func (m MaintenanceConfigurationCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", m.Name) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "status", m.Status) + populate(objectMap, "zoneRedundant", m.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceConfigurationCapability. +func (m *MaintenanceConfigurationCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &m.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &m.ZoneRedundant) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowOptions. +func (m MaintenanceWindowOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindowOptions. +func (m *MaintenanceWindowOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowOptionsProperties. +func (m MaintenanceWindowOptionsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowMultipleMaintenanceWindowsPerCycle", m.AllowMultipleMaintenanceWindowsPerCycle) + populate(objectMap, "defaultDurationInMinutes", m.DefaultDurationInMinutes) + populate(objectMap, "isEnabled", m.IsEnabled) + populate(objectMap, "maintenanceWindowCycles", m.MaintenanceWindowCycles) + populate(objectMap, "minCycles", m.MinCycles) + populate(objectMap, "minDurationInMinutes", m.MinDurationInMinutes) + populate(objectMap, "timeGranularityInMinutes", m.TimeGranularityInMinutes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindowOptionsProperties. +func (m *MaintenanceWindowOptionsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowMultipleMaintenanceWindowsPerCycle": + err = unpopulate(val, "AllowMultipleMaintenanceWindowsPerCycle", &m.AllowMultipleMaintenanceWindowsPerCycle) + delete(rawMsg, key) + case "defaultDurationInMinutes": + err = unpopulate(val, "DefaultDurationInMinutes", &m.DefaultDurationInMinutes) + delete(rawMsg, key) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &m.IsEnabled) + delete(rawMsg, key) + case "maintenanceWindowCycles": + err = unpopulate(val, "MaintenanceWindowCycles", &m.MaintenanceWindowCycles) + delete(rawMsg, key) + case "minCycles": + err = unpopulate(val, "MinCycles", &m.MinCycles) + delete(rawMsg, key) + case "minDurationInMinutes": + err = unpopulate(val, "MinDurationInMinutes", &m.MinDurationInMinutes) + delete(rawMsg, key) + case "timeGranularityInMinutes": + err = unpopulate(val, "TimeGranularityInMinutes", &m.TimeGranularityInMinutes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowTimeRange. +func (m MaintenanceWindowTimeRange) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dayOfWeek", m.DayOfWeek) + populate(objectMap, "duration", m.Duration) + populate(objectMap, "startTime", m.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindowTimeRange. +func (m *MaintenanceWindowTimeRange) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dayOfWeek": + err = unpopulate(val, "DayOfWeek", &m.DayOfWeek) + delete(rawMsg, key) + case "duration": + err = unpopulate(val, "Duration", &m.Duration) + delete(rawMsg, key) + case "startTime": + err = unpopulate(val, "StartTime", &m.StartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindows. +func (m MaintenanceWindows) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindows. +func (m *MaintenanceWindows) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowsProperties. +func (m MaintenanceWindowsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "timeRanges", m.TimeRanges) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindowsProperties. +func (m *MaintenanceWindowsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "timeRanges": + err = unpopulate(val, "TimeRanges", &m.TimeRanges) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedBackupShortTermRetentionPolicy. +func (m ManagedBackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedBackupShortTermRetentionPolicy. +func (m *ManagedBackupShortTermRetentionPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedBackupShortTermRetentionPolicyListResult. +func (m ManagedBackupShortTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedBackupShortTermRetentionPolicyListResult. +func (m *ManagedBackupShortTermRetentionPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedBackupShortTermRetentionPolicyProperties. +func (m ManagedBackupShortTermRetentionPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "retentionDays", m.RetentionDays) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedBackupShortTermRetentionPolicyProperties. +func (m *ManagedBackupShortTermRetentionPolicyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "retentionDays": + err = unpopulate(val, "RetentionDays", &m.RetentionDays) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabase. +func (m ManagedDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabase. +func (m *ManagedDatabase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &m.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseAdvancedThreatProtection. +func (m ManagedDatabaseAdvancedThreatProtection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseAdvancedThreatProtection. +func (m *ManagedDatabaseAdvancedThreatProtection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseAdvancedThreatProtectionListResult. +func (m ManagedDatabaseAdvancedThreatProtectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseAdvancedThreatProtectionListResult. +func (m *ManagedDatabaseAdvancedThreatProtectionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseListResult. +func (m ManagedDatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseListResult. +func (m *ManagedDatabaseListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseMoveDefinition. +func (m ManagedDatabaseMoveDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "destinationManagedDatabaseId", m.DestinationManagedDatabaseID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseMoveDefinition. +func (m *ManagedDatabaseMoveDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "destinationManagedDatabaseId": + err = unpopulate(val, "DestinationManagedDatabaseID", &m.DestinationManagedDatabaseID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseProperties. +func (m ManagedDatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "autoCompleteRestore", m.AutoCompleteRestore) + populate(objectMap, "catalogCollation", m.CatalogCollation) + populate(objectMap, "collation", m.Collation) + populate(objectMap, "createMode", m.CreateMode) + populateTimeRFC3339(objectMap, "creationDate", m.CreationDate) + populate(objectMap, "defaultSecondaryLocation", m.DefaultSecondaryLocation) + populateTimeRFC3339(objectMap, "earliestRestorePoint", m.EarliestRestorePoint) + populate(objectMap, "failoverGroupId", m.FailoverGroupID) + populate(objectMap, "lastBackupName", m.LastBackupName) + populate(objectMap, "longTermRetentionBackupResourceId", m.LongTermRetentionBackupResourceID) + populate(objectMap, "recoverableDatabaseId", m.RecoverableDatabaseID) + populate(objectMap, "restorableDroppedDatabaseId", m.RestorableDroppedDatabaseID) + populateTimeRFC3339(objectMap, "restorePointInTime", m.RestorePointInTime) + populate(objectMap, "sourceDatabaseId", m.SourceDatabaseID) + populate(objectMap, "status", m.Status) + populate(objectMap, "storageContainerIdentity", m.StorageContainerIdentity) + populate(objectMap, "storageContainerSasToken", m.StorageContainerSasToken) + populate(objectMap, "storageContainerUri", m.StorageContainerURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseProperties. +func (m *ManagedDatabaseProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoCompleteRestore": + err = unpopulate(val, "AutoCompleteRestore", &m.AutoCompleteRestore) + delete(rawMsg, key) + case "catalogCollation": + err = unpopulate(val, "CatalogCollation", &m.CatalogCollation) + delete(rawMsg, key) + case "collation": + err = unpopulate(val, "Collation", &m.Collation) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &m.CreateMode) + delete(rawMsg, key) + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &m.CreationDate) + delete(rawMsg, key) + case "defaultSecondaryLocation": + err = unpopulate(val, "DefaultSecondaryLocation", &m.DefaultSecondaryLocation) + delete(rawMsg, key) + case "earliestRestorePoint": + err = unpopulateTimeRFC3339(val, "EarliestRestorePoint", &m.EarliestRestorePoint) + delete(rawMsg, key) + case "failoverGroupId": + err = unpopulate(val, "FailoverGroupID", &m.FailoverGroupID) + delete(rawMsg, key) + case "lastBackupName": + err = unpopulate(val, "LastBackupName", &m.LastBackupName) + delete(rawMsg, key) + case "longTermRetentionBackupResourceId": + err = unpopulate(val, "LongTermRetentionBackupResourceID", &m.LongTermRetentionBackupResourceID) + delete(rawMsg, key) + case "recoverableDatabaseId": + err = unpopulate(val, "RecoverableDatabaseID", &m.RecoverableDatabaseID) + delete(rawMsg, key) + case "restorableDroppedDatabaseId": + err = unpopulate(val, "RestorableDroppedDatabaseID", &m.RestorableDroppedDatabaseID) + delete(rawMsg, key) + case "restorePointInTime": + err = unpopulateTimeRFC3339(val, "RestorePointInTime", &m.RestorePointInTime) + delete(rawMsg, key) + case "sourceDatabaseId": + err = unpopulate(val, "SourceDatabaseID", &m.SourceDatabaseID) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "storageContainerIdentity": + err = unpopulate(val, "StorageContainerIdentity", &m.StorageContainerIdentity) + delete(rawMsg, key) + case "storageContainerSasToken": + err = unpopulate(val, "StorageContainerSasToken", &m.StorageContainerSasToken) + delete(rawMsg, key) + case "storageContainerUri": + err = unpopulate(val, "StorageContainerURI", &m.StorageContainerURI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseRestoreDetailsBackupSetProperties. +func (m ManagedDatabaseRestoreDetailsBackupSetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupSizeMB", m.BackupSizeMB) + populate(objectMap, "firstStripeName", m.FirstStripeName) + populate(objectMap, "numberOfStripes", m.NumberOfStripes) + populateTimeRFC3339(objectMap, "restoreFinishedTimestampUtc", m.RestoreFinishedTimestampUTC) + populateTimeRFC3339(objectMap, "restoreStartedTimestampUtc", m.RestoreStartedTimestampUTC) + populate(objectMap, "status", m.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseRestoreDetailsBackupSetProperties. +func (m *ManagedDatabaseRestoreDetailsBackupSetProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupSizeMB": + err = unpopulate(val, "BackupSizeMB", &m.BackupSizeMB) + delete(rawMsg, key) + case "firstStripeName": + err = unpopulate(val, "FirstStripeName", &m.FirstStripeName) + delete(rawMsg, key) + case "numberOfStripes": + err = unpopulate(val, "NumberOfStripes", &m.NumberOfStripes) + delete(rawMsg, key) + case "restoreFinishedTimestampUtc": + err = unpopulateTimeRFC3339(val, "RestoreFinishedTimestampUTC", &m.RestoreFinishedTimestampUTC) + delete(rawMsg, key) + case "restoreStartedTimestampUtc": + err = unpopulateTimeRFC3339(val, "RestoreStartedTimestampUTC", &m.RestoreStartedTimestampUTC) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseRestoreDetailsProperties. +func (m ManagedDatabaseRestoreDetailsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "blockReason", m.BlockReason) + populate(objectMap, "currentBackupType", m.CurrentBackupType) + populate(objectMap, "currentRestorePlanSizeMB", m.CurrentRestorePlanSizeMB) + populate(objectMap, "currentRestoredSizeMB", m.CurrentRestoredSizeMB) + populate(objectMap, "currentRestoringFileName", m.CurrentRestoringFileName) + populate(objectMap, "diffBackupSets", m.DiffBackupSets) + populate(objectMap, "fullBackupSets", m.FullBackupSets) + populate(objectMap, "lastRestoredFileName", m.LastRestoredFileName) + populateTimeRFC3339(objectMap, "lastRestoredFileTime", m.LastRestoredFileTime) + populate(objectMap, "lastUploadedFileName", m.LastUploadedFileName) + populateTimeRFC3339(objectMap, "lastUploadedFileTime", m.LastUploadedFileTime) + populate(objectMap, "logBackupSets", m.LogBackupSets) + populate(objectMap, "numberOfFilesDetected", m.NumberOfFilesDetected) + populate(objectMap, "numberOfFilesQueued", m.NumberOfFilesQueued) + populate(objectMap, "numberOfFilesRestored", m.NumberOfFilesRestored) + populate(objectMap, "numberOfFilesRestoring", m.NumberOfFilesRestoring) + populate(objectMap, "numberOfFilesSkipped", m.NumberOfFilesSkipped) + populate(objectMap, "numberOfFilesUnrestorable", m.NumberOfFilesUnrestorable) + populate(objectMap, "percentCompleted", m.PercentCompleted) + populate(objectMap, "status", m.Status) + populate(objectMap, "type", m.Type) + populate(objectMap, "unrestorableFiles", m.UnrestorableFiles) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseRestoreDetailsProperties. +func (m *ManagedDatabaseRestoreDetailsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blockReason": + err = unpopulate(val, "BlockReason", &m.BlockReason) + delete(rawMsg, key) + case "currentBackupType": + err = unpopulate(val, "CurrentBackupType", &m.CurrentBackupType) + delete(rawMsg, key) + case "currentRestorePlanSizeMB": + err = unpopulate(val, "CurrentRestorePlanSizeMB", &m.CurrentRestorePlanSizeMB) + delete(rawMsg, key) + case "currentRestoredSizeMB": + err = unpopulate(val, "CurrentRestoredSizeMB", &m.CurrentRestoredSizeMB) + delete(rawMsg, key) + case "currentRestoringFileName": + err = unpopulate(val, "CurrentRestoringFileName", &m.CurrentRestoringFileName) + delete(rawMsg, key) + case "diffBackupSets": + err = unpopulate(val, "DiffBackupSets", &m.DiffBackupSets) + delete(rawMsg, key) + case "fullBackupSets": + err = unpopulate(val, "FullBackupSets", &m.FullBackupSets) + delete(rawMsg, key) + case "lastRestoredFileName": + err = unpopulate(val, "LastRestoredFileName", &m.LastRestoredFileName) + delete(rawMsg, key) + case "lastRestoredFileTime": + err = unpopulateTimeRFC3339(val, "LastRestoredFileTime", &m.LastRestoredFileTime) + delete(rawMsg, key) + case "lastUploadedFileName": + err = unpopulate(val, "LastUploadedFileName", &m.LastUploadedFileName) + delete(rawMsg, key) + case "lastUploadedFileTime": + err = unpopulateTimeRFC3339(val, "LastUploadedFileTime", &m.LastUploadedFileTime) + delete(rawMsg, key) + case "logBackupSets": + err = unpopulate(val, "LogBackupSets", &m.LogBackupSets) + delete(rawMsg, key) + case "numberOfFilesDetected": + err = unpopulate(val, "NumberOfFilesDetected", &m.NumberOfFilesDetected) + delete(rawMsg, key) + case "numberOfFilesQueued": + err = unpopulate(val, "NumberOfFilesQueued", &m.NumberOfFilesQueued) + delete(rawMsg, key) + case "numberOfFilesRestored": + err = unpopulate(val, "NumberOfFilesRestored", &m.NumberOfFilesRestored) + delete(rawMsg, key) + case "numberOfFilesRestoring": + err = unpopulate(val, "NumberOfFilesRestoring", &m.NumberOfFilesRestoring) + delete(rawMsg, key) + case "numberOfFilesSkipped": + err = unpopulate(val, "NumberOfFilesSkipped", &m.NumberOfFilesSkipped) + delete(rawMsg, key) + case "numberOfFilesUnrestorable": + err = unpopulate(val, "NumberOfFilesUnrestorable", &m.NumberOfFilesUnrestorable) + delete(rawMsg, key) + case "percentCompleted": + err = unpopulate(val, "PercentCompleted", &m.PercentCompleted) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "unrestorableFiles": + err = unpopulate(val, "UnrestorableFiles", &m.UnrestorableFiles) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseRestoreDetailsResult. +func (m ManagedDatabaseRestoreDetailsResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseRestoreDetailsResult. +func (m *ManagedDatabaseRestoreDetailsResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseRestoreDetailsUnrestorableFileProperties. +func (m ManagedDatabaseRestoreDetailsUnrestorableFileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", m.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseRestoreDetailsUnrestorableFileProperties. +func (m *ManagedDatabaseRestoreDetailsUnrestorableFileProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseSecurityAlertPolicy. +func (m ManagedDatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseSecurityAlertPolicy. +func (m *ManagedDatabaseSecurityAlertPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseSecurityAlertPolicyListResult. +func (m ManagedDatabaseSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseSecurityAlertPolicyListResult. +func (m *ManagedDatabaseSecurityAlertPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseStartMoveDefinition. +func (m ManagedDatabaseStartMoveDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "destinationManagedDatabaseId", m.DestinationManagedDatabaseID) + populate(objectMap, "operationMode", m.OperationMode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseStartMoveDefinition. +func (m *ManagedDatabaseStartMoveDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "destinationManagedDatabaseId": + err = unpopulate(val, "DestinationManagedDatabaseID", &m.DestinationManagedDatabaseID) + delete(rawMsg, key) + case "operationMode": + err = unpopulate(val, "OperationMode", &m.OperationMode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseUpdate. +func (m ManagedDatabaseUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "tags", m.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseUpdate. +func (m *ManagedDatabaseUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstance. +func (m ManagedInstance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "identity", m.Identity) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "sku", m.SKU) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstance. +func (m *ManagedInstance) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &m.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &m.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &m.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAdministrator. +func (m ManagedInstanceAdministrator) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceAdministrator. +func (m *ManagedInstanceAdministrator) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAdministratorListResult. +func (m ManagedInstanceAdministratorListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceAdministratorListResult. +func (m *ManagedInstanceAdministratorListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAdministratorProperties. +func (m ManagedInstanceAdministratorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "administratorType", m.AdministratorType) + populate(objectMap, "login", m.Login) + populate(objectMap, "sid", m.Sid) + populate(objectMap, "tenantId", m.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceAdministratorProperties. +func (m *ManagedInstanceAdministratorProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "administratorType": + err = unpopulate(val, "AdministratorType", &m.AdministratorType) + delete(rawMsg, key) + case "login": + err = unpopulate(val, "Login", &m.Login) + delete(rawMsg, key) + case "sid": + err = unpopulate(val, "Sid", &m.Sid) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAdvancedThreatProtection. +func (m ManagedInstanceAdvancedThreatProtection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceAdvancedThreatProtection. +func (m *ManagedInstanceAdvancedThreatProtection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAdvancedThreatProtectionListResult. +func (m ManagedInstanceAdvancedThreatProtectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceAdvancedThreatProtectionListResult. +func (m *ManagedInstanceAdvancedThreatProtectionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAzureADOnlyAuthListResult. +func (m ManagedInstanceAzureADOnlyAuthListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceAzureADOnlyAuthListResult. +func (m *ManagedInstanceAzureADOnlyAuthListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAzureADOnlyAuthProperties. +func (m ManagedInstanceAzureADOnlyAuthProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureADOnlyAuthentication", m.AzureADOnlyAuthentication) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceAzureADOnlyAuthProperties. +func (m *ManagedInstanceAzureADOnlyAuthProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureADOnlyAuthentication": + err = unpopulate(val, "AzureADOnlyAuthentication", &m.AzureADOnlyAuthentication) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAzureADOnlyAuthentication. +func (m ManagedInstanceAzureADOnlyAuthentication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceAzureADOnlyAuthentication. +func (m *ManagedInstanceAzureADOnlyAuthentication) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceDtc. +func (m ManagedInstanceDtc) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceDtc. +func (m *ManagedInstanceDtc) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceDtcListResult. +func (m ManagedInstanceDtcListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceDtcListResult. +func (m *ManagedInstanceDtcListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceDtcProperties. +func (m ManagedInstanceDtcProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dtcEnabled", m.DtcEnabled) + populate(objectMap, "dtcHostNameDnsSuffix", m.DtcHostNameDNSSuffix) + populate(objectMap, "externalDnsSuffixSearchList", m.ExternalDNSSuffixSearchList) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "securitySettings", m.SecuritySettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceDtcProperties. +func (m *ManagedInstanceDtcProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dtcEnabled": + err = unpopulate(val, "DtcEnabled", &m.DtcEnabled) + delete(rawMsg, key) + case "dtcHostNameDnsSuffix": + err = unpopulate(val, "DtcHostNameDNSSuffix", &m.DtcHostNameDNSSuffix) + delete(rawMsg, key) + case "externalDnsSuffixSearchList": + err = unpopulate(val, "ExternalDNSSuffixSearchList", &m.ExternalDNSSuffixSearchList) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + delete(rawMsg, key) + case "securitySettings": + err = unpopulate(val, "SecuritySettings", &m.SecuritySettings) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceDtcSecuritySettings. +func (m ManagedInstanceDtcSecuritySettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "snaLu6point2TransactionsEnabled", m.SnaLu6Point2TransactionsEnabled) + populate(objectMap, "transactionManagerCommunicationSettings", m.TransactionManagerCommunicationSettings) + populate(objectMap, "xaTransactionsEnabled", m.XaTransactionsEnabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceDtcSecuritySettings. +func (m *ManagedInstanceDtcSecuritySettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "snaLu6point2TransactionsEnabled": + err = unpopulate(val, "SnaLu6Point2TransactionsEnabled", &m.SnaLu6Point2TransactionsEnabled) + delete(rawMsg, key) + case "transactionManagerCommunicationSettings": + err = unpopulate(val, "TransactionManagerCommunicationSettings", &m.TransactionManagerCommunicationSettings) + delete(rawMsg, key) + case "xaTransactionsEnabled": + err = unpopulate(val, "XaTransactionsEnabled", &m.XaTransactionsEnabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceDtcTransactionManagerCommunicationSettings. +func (m ManagedInstanceDtcTransactionManagerCommunicationSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowInboundEnabled", m.AllowInboundEnabled) + populate(objectMap, "allowOutboundEnabled", m.AllowOutboundEnabled) + populate(objectMap, "authentication", m.Authentication) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceDtcTransactionManagerCommunicationSettings. +func (m *ManagedInstanceDtcTransactionManagerCommunicationSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowInboundEnabled": + err = unpopulate(val, "AllowInboundEnabled", &m.AllowInboundEnabled) + delete(rawMsg, key) + case "allowOutboundEnabled": + err = unpopulate(val, "AllowOutboundEnabled", &m.AllowOutboundEnabled) + delete(rawMsg, key) + case "authentication": + err = unpopulate(val, "Authentication", &m.Authentication) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceEditionCapability. +func (m ManagedInstanceEditionCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", m.Name) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "status", m.Status) + populate(objectMap, "supportedFamilies", m.SupportedFamilies) + populate(objectMap, "supportedStorageCapabilities", m.SupportedStorageCapabilities) + populate(objectMap, "zoneRedundant", m.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceEditionCapability. +func (m *ManagedInstanceEditionCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &m.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "supportedFamilies": + err = unpopulate(val, "SupportedFamilies", &m.SupportedFamilies) + delete(rawMsg, key) + case "supportedStorageCapabilities": + err = unpopulate(val, "SupportedStorageCapabilities", &m.SupportedStorageCapabilities) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &m.ZoneRedundant) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceEncryptionProtector. +func (m ManagedInstanceEncryptionProtector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "kind", m.Kind) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceEncryptionProtector. +func (m *ManagedInstanceEncryptionProtector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceEncryptionProtectorListResult. +func (m ManagedInstanceEncryptionProtectorListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceEncryptionProtectorListResult. +func (m *ManagedInstanceEncryptionProtectorListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceEncryptionProtectorProperties. +func (m ManagedInstanceEncryptionProtectorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "autoRotationEnabled", m.AutoRotationEnabled) + populate(objectMap, "serverKeyName", m.ServerKeyName) + populate(objectMap, "serverKeyType", m.ServerKeyType) + populate(objectMap, "thumbprint", m.Thumbprint) + populate(objectMap, "uri", m.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceEncryptionProtectorProperties. +func (m *ManagedInstanceEncryptionProtectorProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoRotationEnabled": + err = unpopulate(val, "AutoRotationEnabled", &m.AutoRotationEnabled) + delete(rawMsg, key) + case "serverKeyName": + err = unpopulate(val, "ServerKeyName", &m.ServerKeyName) + delete(rawMsg, key) + case "serverKeyType": + err = unpopulate(val, "ServerKeyType", &m.ServerKeyType) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &m.Thumbprint) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &m.URI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceExternalAdministrator. +func (m ManagedInstanceExternalAdministrator) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "administratorType", m.AdministratorType) + populate(objectMap, "azureADOnlyAuthentication", m.AzureADOnlyAuthentication) + populate(objectMap, "login", m.Login) + populate(objectMap, "principalType", m.PrincipalType) + populate(objectMap, "sid", m.Sid) + populate(objectMap, "tenantId", m.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceExternalAdministrator. +func (m *ManagedInstanceExternalAdministrator) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "administratorType": + err = unpopulate(val, "AdministratorType", &m.AdministratorType) + delete(rawMsg, key) + case "azureADOnlyAuthentication": + err = unpopulate(val, "AzureADOnlyAuthentication", &m.AzureADOnlyAuthentication) + delete(rawMsg, key) + case "login": + err = unpopulate(val, "Login", &m.Login) + delete(rawMsg, key) + case "principalType": + err = unpopulate(val, "PrincipalType", &m.PrincipalType) + delete(rawMsg, key) + case "sid": + err = unpopulate(val, "Sid", &m.Sid) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceFamilyCapability. +func (m ManagedInstanceFamilyCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", m.Name) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "sku", m.SKU) + populate(objectMap, "status", m.Status) + populate(objectMap, "supportedLicenseTypes", m.SupportedLicenseTypes) + populate(objectMap, "supportedVcoresValues", m.SupportedVcoresValues) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceFamilyCapability. +func (m *ManagedInstanceFamilyCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &m.Reason) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &m.SKU) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "supportedLicenseTypes": + err = unpopulate(val, "SupportedLicenseTypes", &m.SupportedLicenseTypes) + delete(rawMsg, key) + case "supportedVcoresValues": + err = unpopulate(val, "SupportedVcoresValues", &m.SupportedVcoresValues) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceKey. +func (m ManagedInstanceKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "kind", m.Kind) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceKey. +func (m *ManagedInstanceKey) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceKeyListResult. +func (m ManagedInstanceKeyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceKeyListResult. +func (m *ManagedInstanceKeyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceKeyProperties. +func (m ManagedInstanceKeyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "autoRotationEnabled", m.AutoRotationEnabled) + populateTimeRFC3339(objectMap, "creationDate", m.CreationDate) + populate(objectMap, "serverKeyType", m.ServerKeyType) + populate(objectMap, "thumbprint", m.Thumbprint) + populate(objectMap, "uri", m.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceKeyProperties. +func (m *ManagedInstanceKeyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoRotationEnabled": + err = unpopulate(val, "AutoRotationEnabled", &m.AutoRotationEnabled) + delete(rawMsg, key) + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &m.CreationDate) + delete(rawMsg, key) + case "serverKeyType": + err = unpopulate(val, "ServerKeyType", &m.ServerKeyType) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &m.Thumbprint) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &m.URI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceListResult. +func (m ManagedInstanceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceListResult. +func (m *ManagedInstanceListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionBackup. +func (m ManagedInstanceLongTermRetentionBackup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceLongTermRetentionBackup. +func (m *ManagedInstanceLongTermRetentionBackup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionBackupListResult. +func (m ManagedInstanceLongTermRetentionBackupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceLongTermRetentionBackupListResult. +func (m *ManagedInstanceLongTermRetentionBackupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionBackupProperties. +func (m ManagedInstanceLongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "backupExpirationTime", m.BackupExpirationTime) + populate(objectMap, "backupStorageRedundancy", m.BackupStorageRedundancy) + populateTimeRFC3339(objectMap, "backupTime", m.BackupTime) + populateTimeRFC3339(objectMap, "databaseDeletionTime", m.DatabaseDeletionTime) + populate(objectMap, "databaseName", m.DatabaseName) + populateTimeRFC3339(objectMap, "managedInstanceCreateTime", m.ManagedInstanceCreateTime) + populate(objectMap, "managedInstanceName", m.ManagedInstanceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceLongTermRetentionBackupProperties. +func (m *ManagedInstanceLongTermRetentionBackupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupExpirationTime": + err = unpopulateTimeRFC3339(val, "BackupExpirationTime", &m.BackupExpirationTime) + delete(rawMsg, key) + case "backupStorageRedundancy": + err = unpopulate(val, "BackupStorageRedundancy", &m.BackupStorageRedundancy) + delete(rawMsg, key) + case "backupTime": + err = unpopulateTimeRFC3339(val, "BackupTime", &m.BackupTime) + delete(rawMsg, key) + case "databaseDeletionTime": + err = unpopulateTimeRFC3339(val, "DatabaseDeletionTime", &m.DatabaseDeletionTime) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &m.DatabaseName) + delete(rawMsg, key) + case "managedInstanceCreateTime": + err = unpopulateTimeRFC3339(val, "ManagedInstanceCreateTime", &m.ManagedInstanceCreateTime) + delete(rawMsg, key) + case "managedInstanceName": + err = unpopulate(val, "ManagedInstanceName", &m.ManagedInstanceName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionPolicy. +func (m ManagedInstanceLongTermRetentionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceLongTermRetentionPolicy. +func (m *ManagedInstanceLongTermRetentionPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionPolicyListResult. +func (m ManagedInstanceLongTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceLongTermRetentionPolicyListResult. +func (m *ManagedInstanceLongTermRetentionPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceMaintenanceConfigurationCapability. +func (m ManagedInstanceMaintenanceConfigurationCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", m.Name) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "status", m.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceMaintenanceConfigurationCapability. +func (m *ManagedInstanceMaintenanceConfigurationCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &m.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperation. +func (m ManagedInstanceOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceOperation. +func (m *ManagedInstanceOperation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperationListResult. +func (m ManagedInstanceOperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceOperationListResult. +func (m *ManagedInstanceOperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperationParametersPair. +func (m ManagedInstanceOperationParametersPair) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "currentParameters", m.CurrentParameters) + populate(objectMap, "requestedParameters", m.RequestedParameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceOperationParametersPair. +func (m *ManagedInstanceOperationParametersPair) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentParameters": + err = unpopulate(val, "CurrentParameters", &m.CurrentParameters) + delete(rawMsg, key) + case "requestedParameters": + err = unpopulate(val, "RequestedParameters", &m.RequestedParameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperationProperties. +func (m ManagedInstanceOperationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", m.Description) + populate(objectMap, "errorCode", m.ErrorCode) + populate(objectMap, "errorDescription", m.ErrorDescription) + populate(objectMap, "errorSeverity", m.ErrorSeverity) + populateTimeRFC3339(objectMap, "estimatedCompletionTime", m.EstimatedCompletionTime) + populate(objectMap, "isCancellable", m.IsCancellable) + populate(objectMap, "isUserError", m.IsUserError) + populate(objectMap, "managedInstanceName", m.ManagedInstanceName) + populate(objectMap, "operation", m.Operation) + populate(objectMap, "operationFriendlyName", m.OperationFriendlyName) + populate(objectMap, "operationParameters", m.OperationParameters) + populate(objectMap, "operationSteps", m.OperationSteps) + populate(objectMap, "percentComplete", m.PercentComplete) + populateTimeRFC3339(objectMap, "startTime", m.StartTime) + populate(objectMap, "state", m.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceOperationProperties. +func (m *ManagedInstanceOperationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "errorCode": + err = unpopulate(val, "ErrorCode", &m.ErrorCode) + delete(rawMsg, key) + case "errorDescription": + err = unpopulate(val, "ErrorDescription", &m.ErrorDescription) + delete(rawMsg, key) + case "errorSeverity": + err = unpopulate(val, "ErrorSeverity", &m.ErrorSeverity) + delete(rawMsg, key) + case "estimatedCompletionTime": + err = unpopulateTimeRFC3339(val, "EstimatedCompletionTime", &m.EstimatedCompletionTime) + delete(rawMsg, key) + case "isCancellable": + err = unpopulate(val, "IsCancellable", &m.IsCancellable) + delete(rawMsg, key) + case "isUserError": + err = unpopulate(val, "IsUserError", &m.IsUserError) + delete(rawMsg, key) + case "managedInstanceName": + err = unpopulate(val, "ManagedInstanceName", &m.ManagedInstanceName) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &m.Operation) + delete(rawMsg, key) + case "operationFriendlyName": + err = unpopulate(val, "OperationFriendlyName", &m.OperationFriendlyName) + delete(rawMsg, key) + case "operationParameters": + err = unpopulate(val, "OperationParameters", &m.OperationParameters) + delete(rawMsg, key) + case "operationSteps": + err = unpopulate(val, "OperationSteps", &m.OperationSteps) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &m.PercentComplete) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperationSteps. +func (m ManagedInstanceOperationSteps) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "currentStep", m.CurrentStep) + populate(objectMap, "stepsList", m.StepsList) + populate(objectMap, "totalSteps", m.TotalSteps) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceOperationSteps. +func (m *ManagedInstanceOperationSteps) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentStep": + err = unpopulate(val, "CurrentStep", &m.CurrentStep) + delete(rawMsg, key) + case "stepsList": + err = unpopulate(val, "StepsList", &m.StepsList) + delete(rawMsg, key) + case "totalSteps": + err = unpopulate(val, "TotalSteps", &m.TotalSteps) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePairInfo. +func (m ManagedInstancePairInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "partnerManagedInstanceId", m.PartnerManagedInstanceID) + populate(objectMap, "primaryManagedInstanceId", m.PrimaryManagedInstanceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePairInfo. +func (m *ManagedInstancePairInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "partnerManagedInstanceId": + err = unpopulate(val, "PartnerManagedInstanceID", &m.PartnerManagedInstanceID) + delete(rawMsg, key) + case "primaryManagedInstanceId": + err = unpopulate(val, "PrimaryManagedInstanceID", &m.PrimaryManagedInstanceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePecProperty. +func (m ManagedInstancePecProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "properties", m.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePecProperty. +func (m *ManagedInstancePecProperty) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateEndpointConnection. +func (m ManagedInstancePrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateEndpointConnection. +func (m *ManagedInstancePrivateEndpointConnection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateEndpointConnectionListResult. +func (m ManagedInstancePrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateEndpointConnectionListResult. +func (m *ManagedInstancePrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateEndpointConnectionProperties. +func (m ManagedInstancePrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "privateEndpoint", m.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", m.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", m.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateEndpointConnectionProperties. +func (m *ManagedInstancePrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &m.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &m.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateEndpointProperty. +func (m ManagedInstancePrivateEndpointProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateEndpointProperty. +func (m *ManagedInstancePrivateEndpointProperty) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateLink. +func (m ManagedInstancePrivateLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateLink. +func (m *ManagedInstancePrivateLink) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateLinkListResult. +func (m ManagedInstancePrivateLinkListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateLinkListResult. +func (m *ManagedInstancePrivateLinkListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateLinkProperties. +func (m ManagedInstancePrivateLinkProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", m.GroupID) + populate(objectMap, "requiredMembers", m.RequiredMembers) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateLinkProperties. +func (m *ManagedInstancePrivateLinkProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groupId": + err = unpopulate(val, "GroupID", &m.GroupID) + delete(rawMsg, key) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &m.RequiredMembers) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateLinkServiceConnectionStateProperty. +func (m ManagedInstancePrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionsRequired", m.ActionsRequired) + populate(objectMap, "description", m.Description) + populate(objectMap, "status", m.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateLinkServiceConnectionStateProperty. +func (m *ManagedInstancePrivateLinkServiceConnectionStateProperty) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &m.ActionsRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceProperties. +func (m ManagedInstanceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "administratorLogin", m.AdministratorLogin) + populate(objectMap, "administratorLoginPassword", m.AdministratorLoginPassword) + populate(objectMap, "administrators", m.Administrators) + populate(objectMap, "collation", m.Collation) + populate(objectMap, "currentBackupStorageRedundancy", m.CurrentBackupStorageRedundancy) + populate(objectMap, "dnsZone", m.DNSZone) + populate(objectMap, "dnsZonePartner", m.DNSZonePartner) + populate(objectMap, "fullyQualifiedDomainName", m.FullyQualifiedDomainName) + populate(objectMap, "instancePoolId", m.InstancePoolID) + populate(objectMap, "keyId", m.KeyID) + populate(objectMap, "licenseType", m.LicenseType) + populate(objectMap, "maintenanceConfigurationId", m.MaintenanceConfigurationID) + populate(objectMap, "managedInstanceCreateMode", m.ManagedInstanceCreateMode) + populate(objectMap, "minimalTlsVersion", m.MinimalTLSVersion) + populate(objectMap, "primaryUserAssignedIdentityId", m.PrimaryUserAssignedIdentityID) + populate(objectMap, "privateEndpointConnections", m.PrivateEndpointConnections) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "proxyOverride", m.ProxyOverride) + populate(objectMap, "publicDataEndpointEnabled", m.PublicDataEndpointEnabled) + populate(objectMap, "requestedBackupStorageRedundancy", m.RequestedBackupStorageRedundancy) + populateTimeRFC3339(objectMap, "restorePointInTime", m.RestorePointInTime) + populate(objectMap, "servicePrincipal", m.ServicePrincipal) + populate(objectMap, "sourceManagedInstanceId", m.SourceManagedInstanceID) + populate(objectMap, "state", m.State) + populate(objectMap, "storageSizeInGB", m.StorageSizeInGB) + populate(objectMap, "subnetId", m.SubnetID) + populate(objectMap, "timezoneId", m.TimezoneID) + populate(objectMap, "vCores", m.VCores) + populate(objectMap, "zoneRedundant", m.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceProperties. +func (m *ManagedInstanceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "administratorLogin": + err = unpopulate(val, "AdministratorLogin", &m.AdministratorLogin) + delete(rawMsg, key) + case "administratorLoginPassword": + err = unpopulate(val, "AdministratorLoginPassword", &m.AdministratorLoginPassword) + delete(rawMsg, key) + case "administrators": + err = unpopulate(val, "Administrators", &m.Administrators) + delete(rawMsg, key) + case "collation": + err = unpopulate(val, "Collation", &m.Collation) + delete(rawMsg, key) + case "currentBackupStorageRedundancy": + err = unpopulate(val, "CurrentBackupStorageRedundancy", &m.CurrentBackupStorageRedundancy) + delete(rawMsg, key) + case "dnsZone": + err = unpopulate(val, "DNSZone", &m.DNSZone) + delete(rawMsg, key) + case "dnsZonePartner": + err = unpopulate(val, "DNSZonePartner", &m.DNSZonePartner) + delete(rawMsg, key) + case "fullyQualifiedDomainName": + err = unpopulate(val, "FullyQualifiedDomainName", &m.FullyQualifiedDomainName) + delete(rawMsg, key) + case "instancePoolId": + err = unpopulate(val, "InstancePoolID", &m.InstancePoolID) + delete(rawMsg, key) + case "keyId": + err = unpopulate(val, "KeyID", &m.KeyID) + delete(rawMsg, key) + case "licenseType": + err = unpopulate(val, "LicenseType", &m.LicenseType) + delete(rawMsg, key) + case "maintenanceConfigurationId": + err = unpopulate(val, "MaintenanceConfigurationID", &m.MaintenanceConfigurationID) + delete(rawMsg, key) + case "managedInstanceCreateMode": + err = unpopulate(val, "ManagedInstanceCreateMode", &m.ManagedInstanceCreateMode) + delete(rawMsg, key) + case "minimalTlsVersion": + err = unpopulate(val, "MinimalTLSVersion", &m.MinimalTLSVersion) + delete(rawMsg, key) + case "primaryUserAssignedIdentityId": + err = unpopulate(val, "PrimaryUserAssignedIdentityID", &m.PrimaryUserAssignedIdentityID) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &m.PrivateEndpointConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + delete(rawMsg, key) + case "proxyOverride": + err = unpopulate(val, "ProxyOverride", &m.ProxyOverride) + delete(rawMsg, key) + case "publicDataEndpointEnabled": + err = unpopulate(val, "PublicDataEndpointEnabled", &m.PublicDataEndpointEnabled) + delete(rawMsg, key) + case "requestedBackupStorageRedundancy": + err = unpopulate(val, "RequestedBackupStorageRedundancy", &m.RequestedBackupStorageRedundancy) + delete(rawMsg, key) + case "restorePointInTime": + err = unpopulateTimeRFC3339(val, "RestorePointInTime", &m.RestorePointInTime) + delete(rawMsg, key) + case "servicePrincipal": + err = unpopulate(val, "ServicePrincipal", &m.ServicePrincipal) + delete(rawMsg, key) + case "sourceManagedInstanceId": + err = unpopulate(val, "SourceManagedInstanceID", &m.SourceManagedInstanceID) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + case "storageSizeInGB": + err = unpopulate(val, "StorageSizeInGB", &m.StorageSizeInGB) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &m.SubnetID) + delete(rawMsg, key) + case "timezoneId": + err = unpopulate(val, "TimezoneID", &m.TimezoneID) + delete(rawMsg, key) + case "vCores": + err = unpopulate(val, "VCores", &m.VCores) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &m.ZoneRedundant) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceQuery. +func (m ManagedInstanceQuery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceQuery. +func (m *ManagedInstanceQuery) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceQueryStatistics. +func (m ManagedInstanceQueryStatistics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceQueryStatistics. +func (m *ManagedInstanceQueryStatistics) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceUpdate. +func (m ManagedInstanceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", m.Identity) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "sku", m.SKU) + populate(objectMap, "tags", m.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceUpdate. +func (m *ManagedInstanceUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identity": + err = unpopulate(val, "Identity", &m.Identity) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &m.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceVcoresCapability. +func (m ManagedInstanceVcoresCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "includedMaxSize", m.IncludedMaxSize) + populate(objectMap, "instancePoolSupported", m.InstancePoolSupported) + populate(objectMap, "name", m.Name) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "standaloneSupported", m.StandaloneSupported) + populate(objectMap, "status", m.Status) + populate(objectMap, "supportedMaintenanceConfigurations", m.SupportedMaintenanceConfigurations) + populate(objectMap, "supportedStorageSizes", m.SupportedStorageSizes) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceVcoresCapability. +func (m *ManagedInstanceVcoresCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "includedMaxSize": + err = unpopulate(val, "IncludedMaxSize", &m.IncludedMaxSize) + delete(rawMsg, key) + case "instancePoolSupported": + err = unpopulate(val, "InstancePoolSupported", &m.InstancePoolSupported) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &m.Reason) + delete(rawMsg, key) + case "standaloneSupported": + err = unpopulate(val, "StandaloneSupported", &m.StandaloneSupported) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "supportedMaintenanceConfigurations": + err = unpopulate(val, "SupportedMaintenanceConfigurations", &m.SupportedMaintenanceConfigurations) + delete(rawMsg, key) + case "supportedStorageSizes": + err = unpopulate(val, "SupportedStorageSizes", &m.SupportedStorageSizes) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceVersionCapability. +func (m ManagedInstanceVersionCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", m.Name) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "status", m.Status) + populate(objectMap, "supportedEditions", m.SupportedEditions) + populate(objectMap, "supportedInstancePoolEditions", m.SupportedInstancePoolEditions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceVersionCapability. +func (m *ManagedInstanceVersionCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &m.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "supportedEditions": + err = unpopulate(val, "SupportedEditions", &m.SupportedEditions) + delete(rawMsg, key) + case "supportedInstancePoolEditions": + err = unpopulate(val, "SupportedInstancePoolEditions", &m.SupportedInstancePoolEditions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceVulnerabilityAssessment. +func (m ManagedInstanceVulnerabilityAssessment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceVulnerabilityAssessment. +func (m *ManagedInstanceVulnerabilityAssessment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceVulnerabilityAssessmentListResult. +func (m ManagedInstanceVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceVulnerabilityAssessmentListResult. +func (m *ManagedInstanceVulnerabilityAssessmentListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceVulnerabilityAssessmentProperties. +func (m ManagedInstanceVulnerabilityAssessmentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "recurringScans", m.RecurringScans) + populate(objectMap, "storageAccountAccessKey", m.StorageAccountAccessKey) + populate(objectMap, "storageContainerPath", m.StorageContainerPath) + populate(objectMap, "storageContainerSasKey", m.StorageContainerSasKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceVulnerabilityAssessmentProperties. +func (m *ManagedInstanceVulnerabilityAssessmentProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "recurringScans": + err = unpopulate(val, "RecurringScans", &m.RecurringScans) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &m.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageContainerPath": + err = unpopulate(val, "StorageContainerPath", &m.StorageContainerPath) + delete(rawMsg, key) + case "storageContainerSasKey": + err = unpopulate(val, "StorageContainerSasKey", &m.StorageContainerSasKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedServerDNSAlias. +func (m ManagedServerDNSAlias) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServerDNSAlias. +func (m *ManagedServerDNSAlias) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedServerDNSAliasAcquisition. +func (m ManagedServerDNSAliasAcquisition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "oldManagedServerDnsAliasResourceId", m.OldManagedServerDNSAliasResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServerDNSAliasAcquisition. +func (m *ManagedServerDNSAliasAcquisition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "oldManagedServerDnsAliasResourceId": + err = unpopulate(val, "OldManagedServerDNSAliasResourceID", &m.OldManagedServerDNSAliasResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedServerDNSAliasCreation. +func (m ManagedServerDNSAliasCreation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "createDnsRecord", m.CreateDNSRecord) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServerDNSAliasCreation. +func (m *ManagedServerDNSAliasCreation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createDnsRecord": + err = unpopulate(val, "CreateDNSRecord", &m.CreateDNSRecord) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedServerDNSAliasListResult. +func (m ManagedServerDNSAliasListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServerDNSAliasListResult. +func (m *ManagedServerDNSAliasListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedServerDNSAliasProperties. +func (m ManagedServerDNSAliasProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureDnsRecord", m.AzureDNSRecord) + populate(objectMap, "publicAzureDnsRecord", m.PublicAzureDNSRecord) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServerDNSAliasProperties. +func (m *ManagedServerDNSAliasProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureDnsRecord": + err = unpopulate(val, "AzureDNSRecord", &m.AzureDNSRecord) + delete(rawMsg, key) + case "publicAzureDnsRecord": + err = unpopulate(val, "PublicAzureDNSRecord", &m.PublicAzureDNSRecord) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedServerSecurityAlertPolicy. +func (m ManagedServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServerSecurityAlertPolicy. +func (m *ManagedServerSecurityAlertPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedServerSecurityAlertPolicyListResult. +func (m ManagedServerSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServerSecurityAlertPolicyListResult. +func (m *ManagedServerSecurityAlertPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedTransparentDataEncryption. +func (m ManagedTransparentDataEncryption) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedTransparentDataEncryption. +func (m *ManagedTransparentDataEncryption) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedTransparentDataEncryptionListResult. +func (m ManagedTransparentDataEncryptionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedTransparentDataEncryptionListResult. +func (m *ManagedTransparentDataEncryptionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedTransparentDataEncryptionProperties. +func (m ManagedTransparentDataEncryptionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "state", m.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedTransparentDataEncryptionProperties. +func (m *ManagedTransparentDataEncryptionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MaxSizeCapability. +func (m MaxSizeCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "limit", m.Limit) + populate(objectMap, "unit", m.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaxSizeCapability. +func (m *MaxSizeCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "limit": + err = unpopulate(val, "Limit", &m.Limit) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &m.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MaxSizeRangeCapability. +func (m MaxSizeRangeCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "logSize", m.LogSize) + populate(objectMap, "maxValue", m.MaxValue) + populate(objectMap, "minValue", m.MinValue) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "scaleSize", m.ScaleSize) + populate(objectMap, "status", m.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaxSizeRangeCapability. +func (m *MaxSizeRangeCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "logSize": + err = unpopulate(val, "LogSize", &m.LogSize) + delete(rawMsg, key) + case "maxValue": + err = unpopulate(val, "MaxValue", &m.MaxValue) + delete(rawMsg, key) + case "minValue": + err = unpopulate(val, "MinValue", &m.MinValue) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &m.Reason) + delete(rawMsg, key) + case "scaleSize": + err = unpopulate(val, "ScaleSize", &m.ScaleSize) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Metric. +func (m Metric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", m.EndTime) + populate(objectMap, "metricValues", m.MetricValues) + populate(objectMap, "name", m.Name) + populateTimeRFC3339(objectMap, "startTime", m.StartTime) + populate(objectMap, "timeGrain", m.TimeGrain) + populate(objectMap, "unit", m.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Metric. +func (m *Metric) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &m.EndTime) + delete(rawMsg, key) + case "metricValues": + err = unpopulate(val, "MetricValues", &m.MetricValues) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) + delete(rawMsg, key) + case "timeGrain": + err = unpopulate(val, "TimeGrain", &m.TimeGrain) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &m.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricAvailability. +func (m MetricAvailability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "retention", m.Retention) + populate(objectMap, "timeGrain", m.TimeGrain) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricAvailability. +func (m *MetricAvailability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "retention": + err = unpopulate(val, "Retention", &m.Retention) + delete(rawMsg, key) + case "timeGrain": + err = unpopulate(val, "TimeGrain", &m.TimeGrain) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricDefinition. +func (m MetricDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metricAvailabilities", m.MetricAvailabilities) + populate(objectMap, "name", m.Name) + populate(objectMap, "primaryAggregationType", m.PrimaryAggregationType) + populate(objectMap, "resourceUri", m.ResourceURI) + populate(objectMap, "unit", m.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricDefinition. +func (m *MetricDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metricAvailabilities": + err = unpopulate(val, "MetricAvailabilities", &m.MetricAvailabilities) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "primaryAggregationType": + err = unpopulate(val, "PrimaryAggregationType", &m.PrimaryAggregationType) + delete(rawMsg, key) + case "resourceUri": + err = unpopulate(val, "ResourceURI", &m.ResourceURI) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &m.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricDefinitionListResult. +func (m MetricDefinitionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricDefinitionListResult. +func (m *MetricDefinitionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricListResult. +func (m MetricListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricListResult. +func (m *MetricListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricName. +func (m MetricName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "localizedValue", m.LocalizedValue) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricName. +func (m *MetricName) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "localizedValue": + err = unpopulate(val, "LocalizedValue", &m.LocalizedValue) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricValue. +func (m MetricValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "average", m.Average) + populate(objectMap, "count", m.Count) + populate(objectMap, "maximum", m.Maximum) + populate(objectMap, "minimum", m.Minimum) + populateTimeRFC3339(objectMap, "timestamp", m.Timestamp) + populate(objectMap, "total", m.Total) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricValue. +func (m *MetricValue) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "average": + err = unpopulate(val, "Average", &m.Average) + delete(rawMsg, key) + case "count": + err = unpopulate(val, "Count", &m.Count) + delete(rawMsg, key) + case "maximum": + err = unpopulate(val, "Maximum", &m.Maximum) + delete(rawMsg, key) + case "minimum": + err = unpopulate(val, "Minimum", &m.Minimum) + delete(rawMsg, key) + case "timestamp": + err = unpopulateTimeRFC3339(val, "Timestamp", &m.Timestamp) + delete(rawMsg, key) + case "total": + err = unpopulate(val, "Total", &m.Total) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MinCapacityCapability. +func (m MinCapacityCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "status", m.Status) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MinCapacityCapability. +func (m *MinCapacityCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "reason": + err = unpopulate(val, "Reason", &m.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Name. +func (n Name) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "localizedValue", n.LocalizedValue) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Name. +func (n *Name) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "localizedValue": + err = unpopulate(val, "LocalizedValue", &n.LocalizedValue) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkIsolationSettings. +func (n NetworkIsolationSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "sqlServerResourceId", n.SQLServerResourceID) + populate(objectMap, "storageAccountResourceId", n.StorageAccountResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkIsolationSettings. +func (n *NetworkIsolationSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sqlServerResourceId": + err = unpopulate(val, "SQLServerResourceID", &n.SQLServerResourceID) + delete(rawMsg, key) + case "storageAccountResourceId": + err = unpopulate(val, "StorageAccountResourceID", &n.StorageAccountResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "display", o.Display) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + populate(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationImpact. +func (o OperationImpact) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "changeValueAbsolute", o.ChangeValueAbsolute) + populate(objectMap, "changeValueRelative", o.ChangeValueRelative) + populate(objectMap, "name", o.Name) + populate(objectMap, "unit", o.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationImpact. +func (o *OperationImpact) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "changeValueAbsolute": + err = unpopulate(val, "ChangeValueAbsolute", &o.ChangeValueAbsolute) + delete(rawMsg, key) + case "changeValueRelative": + err = unpopulate(val, "ChangeValueRelative", &o.ChangeValueRelative) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &o.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OutboundFirewallRule. +func (o OutboundFirewallRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundFirewallRule. +func (o *OutboundFirewallRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OutboundFirewallRuleListResult. +func (o OutboundFirewallRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundFirewallRuleListResult. +func (o *OutboundFirewallRuleListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OutboundFirewallRuleProperties. +func (o OutboundFirewallRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "provisioningState", o.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundFirewallRuleProperties. +func (o *OutboundFirewallRuleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerInfo. +func (p PartnerInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "replicationRole", p.ReplicationRole) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerInfo. +func (p *PartnerInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "replicationRole": + err = unpopulate(val, "ReplicationRole", &p.ReplicationRole) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerRegionInfo. +func (p PartnerRegionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "location", p.Location) + populate(objectMap, "replicationRole", p.ReplicationRole) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerRegionInfo. +func (p *PartnerRegionInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "replicationRole": + err = unpopulate(val, "ReplicationRole", &p.ReplicationRole) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PerformanceLevelCapability. +func (p PerformanceLevelCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "unit", p.Unit) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PerformanceLevelCapability. +func (p *PerformanceLevelCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "unit": + err = unpopulate(val, "Unit", &p.Unit) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. +func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. +func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. +func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionRequestStatus. +func (p PrivateEndpointConnectionRequestStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "privateEndpointConnectionName", p.PrivateEndpointConnectionName) + populate(objectMap, "privateLinkServiceId", p.PrivateLinkServiceID) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionRequestStatus. +func (p *PrivateEndpointConnectionRequestStatus) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "privateEndpointConnectionName": + err = unpopulate(val, "PrivateEndpointConnectionName", &p.PrivateEndpointConnectionName) + delete(rawMsg, key) + case "privateLinkServiceId": + err = unpopulate(val, "PrivateLinkServiceID", &p.PrivateLinkServiceID) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointProperty. +func (p PrivateEndpointProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointProperty. +func (p *PrivateEndpointProperty) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. +func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. +func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. +func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. +func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) + delete(rawMsg, key) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + delete(rawMsg, key) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionStateProperty. +func (p PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionsRequired", p.ActionsRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionStateProperty. +func (p *PrivateLinkServiceConnectionStateProperty) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProxyResourceWithWritableName. +func (p ProxyResourceWithWritableName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResourceWithWritableName. +func (p *ProxyResourceWithWritableName) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QueryMetricInterval. +func (q QueryMetricInterval) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "executionCount", q.ExecutionCount) + populate(objectMap, "intervalStartTime", q.IntervalStartTime) + populate(objectMap, "intervalType", q.IntervalType) + populate(objectMap, "metrics", q.Metrics) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryMetricInterval. +func (q *QueryMetricInterval) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "executionCount": + err = unpopulate(val, "ExecutionCount", &q.ExecutionCount) + delete(rawMsg, key) + case "intervalStartTime": + err = unpopulate(val, "IntervalStartTime", &q.IntervalStartTime) + delete(rawMsg, key) + case "intervalType": + err = unpopulate(val, "IntervalType", &q.IntervalType) + delete(rawMsg, key) + case "metrics": + err = unpopulate(val, "Metrics", &q.Metrics) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QueryMetricProperties. +func (q QueryMetricProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "avg", q.Avg) + populate(objectMap, "displayName", q.DisplayName) + populate(objectMap, "max", q.Max) + populate(objectMap, "min", q.Min) + populate(objectMap, "name", q.Name) + populate(objectMap, "stdev", q.Stdev) + populate(objectMap, "sum", q.Sum) + populate(objectMap, "unit", q.Unit) + populate(objectMap, "value", q.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryMetricProperties. +func (q *QueryMetricProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "avg": + err = unpopulate(val, "Avg", &q.Avg) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &q.DisplayName) + delete(rawMsg, key) + case "max": + err = unpopulate(val, "Max", &q.Max) + delete(rawMsg, key) + case "min": + err = unpopulate(val, "Min", &q.Min) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &q.Name) + delete(rawMsg, key) + case "stdev": + err = unpopulate(val, "Stdev", &q.Stdev) + delete(rawMsg, key) + case "sum": + err = unpopulate(val, "Sum", &q.Sum) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &q.Unit) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &q.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QueryProperties. +func (q QueryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "queryText", q.QueryText) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryProperties. +func (q *QueryProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "queryText": + err = unpopulate(val, "QueryText", &q.QueryText) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QueryStatistics. +func (q QueryStatistics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", q.ID) + populate(objectMap, "name", q.Name) + populate(objectMap, "properties", q.Properties) + populate(objectMap, "type", q.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryStatistics. +func (q *QueryStatistics) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &q.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &q.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &q.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &q.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QueryStatisticsProperties. +func (q QueryStatisticsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "databaseName", q.DatabaseName) + populate(objectMap, "endTime", q.EndTime) + populate(objectMap, "intervals", q.Intervals) + populate(objectMap, "queryId", q.QueryID) + populate(objectMap, "startTime", q.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryStatisticsProperties. +func (q *QueryStatisticsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseName": + err = unpopulate(val, "DatabaseName", &q.DatabaseName) + delete(rawMsg, key) + case "endTime": + err = unpopulate(val, "EndTime", &q.EndTime) + delete(rawMsg, key) + case "intervals": + err = unpopulate(val, "Intervals", &q.Intervals) + delete(rawMsg, key) + case "queryId": + err = unpopulate(val, "QueryID", &q.QueryID) + delete(rawMsg, key) + case "startTime": + err = unpopulate(val, "StartTime", &q.StartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReadScaleCapability. +func (r ReadScaleCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "maxNumberOfReplicas", r.MaxNumberOfReplicas) + populate(objectMap, "reason", r.Reason) + populate(objectMap, "status", r.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReadScaleCapability. +func (r *ReadScaleCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "maxNumberOfReplicas": + err = unpopulate(val, "MaxNumberOfReplicas", &r.MaxNumberOfReplicas) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &r.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &r.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecommendedAction. +func (r RecommendedAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "kind", r.Kind) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedAction. +func (r *RecommendedAction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &r.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecommendedActionErrorInfo. +func (r RecommendedActionErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errorCode", r.ErrorCode) + populate(objectMap, "isRetryable", r.IsRetryable) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionErrorInfo. +func (r *RecommendedActionErrorInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorCode": + err = unpopulate(val, "ErrorCode", &r.ErrorCode) + delete(rawMsg, key) + case "isRetryable": + err = unpopulate(val, "IsRetryable", &r.IsRetryable) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecommendedActionImpactRecord. +func (r RecommendedActionImpactRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "absoluteValue", r.AbsoluteValue) + populate(objectMap, "changeValueAbsolute", r.ChangeValueAbsolute) + populate(objectMap, "changeValueRelative", r.ChangeValueRelative) + populate(objectMap, "dimensionName", r.DimensionName) + populate(objectMap, "unit", r.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionImpactRecord. +func (r *RecommendedActionImpactRecord) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "absoluteValue": + err = unpopulate(val, "AbsoluteValue", &r.AbsoluteValue) + delete(rawMsg, key) + case "changeValueAbsolute": + err = unpopulate(val, "ChangeValueAbsolute", &r.ChangeValueAbsolute) + delete(rawMsg, key) + case "changeValueRelative": + err = unpopulate(val, "ChangeValueRelative", &r.ChangeValueRelative) + delete(rawMsg, key) + case "dimensionName": + err = unpopulate(val, "DimensionName", &r.DimensionName) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &r.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecommendedActionImplementationInfo. +func (r RecommendedActionImplementationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "method", r.Method) + populate(objectMap, "script", r.Script) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionImplementationInfo. +func (r *RecommendedActionImplementationInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "method": + err = unpopulate(val, "Method", &r.Method) + delete(rawMsg, key) + case "script": + err = unpopulate(val, "Script", &r.Script) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecommendedActionMetricInfo. +func (r RecommendedActionMetricInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metricName", r.MetricName) + populateTimeRFC3339(objectMap, "startTime", r.StartTime) + populate(objectMap, "timeGrain", r.TimeGrain) + populate(objectMap, "unit", r.Unit) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionMetricInfo. +func (r *RecommendedActionMetricInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metricName": + err = unpopulate(val, "MetricName", &r.MetricName) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &r.StartTime) + delete(rawMsg, key) + case "timeGrain": + err = unpopulate(val, "TimeGrain", &r.TimeGrain) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &r.Unit) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecommendedActionProperties. +func (r RecommendedActionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "details", r.Details) + populate(objectMap, "errorDetails", r.ErrorDetails) + populate(objectMap, "estimatedImpact", r.EstimatedImpact) + populate(objectMap, "executeActionDuration", r.ExecuteActionDuration) + populate(objectMap, "executeActionInitiatedBy", r.ExecuteActionInitiatedBy) + populateTimeRFC3339(objectMap, "executeActionInitiatedTime", r.ExecuteActionInitiatedTime) + populateTimeRFC3339(objectMap, "executeActionStartTime", r.ExecuteActionStartTime) + populate(objectMap, "implementationDetails", r.ImplementationDetails) + populate(objectMap, "isArchivedAction", r.IsArchivedAction) + populate(objectMap, "isExecutableAction", r.IsExecutableAction) + populate(objectMap, "isRevertableAction", r.IsRevertableAction) + populateTimeRFC3339(objectMap, "lastRefresh", r.LastRefresh) + populate(objectMap, "linkedObjects", r.LinkedObjects) + populate(objectMap, "observedImpact", r.ObservedImpact) + populate(objectMap, "recommendationReason", r.RecommendationReason) + populate(objectMap, "revertActionDuration", r.RevertActionDuration) + populate(objectMap, "revertActionInitiatedBy", r.RevertActionInitiatedBy) + populateTimeRFC3339(objectMap, "revertActionInitiatedTime", r.RevertActionInitiatedTime) + populateTimeRFC3339(objectMap, "revertActionStartTime", r.RevertActionStartTime) + populate(objectMap, "score", r.Score) + populate(objectMap, "state", r.State) + populate(objectMap, "timeSeries", r.TimeSeries) + populateTimeRFC3339(objectMap, "validSince", r.ValidSince) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionProperties. +func (r *RecommendedActionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "details": + err = unpopulate(val, "Details", &r.Details) + delete(rawMsg, key) + case "errorDetails": + err = unpopulate(val, "ErrorDetails", &r.ErrorDetails) + delete(rawMsg, key) + case "estimatedImpact": + err = unpopulate(val, "EstimatedImpact", &r.EstimatedImpact) + delete(rawMsg, key) + case "executeActionDuration": + err = unpopulate(val, "ExecuteActionDuration", &r.ExecuteActionDuration) + delete(rawMsg, key) + case "executeActionInitiatedBy": + err = unpopulate(val, "ExecuteActionInitiatedBy", &r.ExecuteActionInitiatedBy) + delete(rawMsg, key) + case "executeActionInitiatedTime": + err = unpopulateTimeRFC3339(val, "ExecuteActionInitiatedTime", &r.ExecuteActionInitiatedTime) + delete(rawMsg, key) + case "executeActionStartTime": + err = unpopulateTimeRFC3339(val, "ExecuteActionStartTime", &r.ExecuteActionStartTime) + delete(rawMsg, key) + case "implementationDetails": + err = unpopulate(val, "ImplementationDetails", &r.ImplementationDetails) + delete(rawMsg, key) + case "isArchivedAction": + err = unpopulate(val, "IsArchivedAction", &r.IsArchivedAction) + delete(rawMsg, key) + case "isExecutableAction": + err = unpopulate(val, "IsExecutableAction", &r.IsExecutableAction) + delete(rawMsg, key) + case "isRevertableAction": + err = unpopulate(val, "IsRevertableAction", &r.IsRevertableAction) + delete(rawMsg, key) + case "lastRefresh": + err = unpopulateTimeRFC3339(val, "LastRefresh", &r.LastRefresh) + delete(rawMsg, key) + case "linkedObjects": + err = unpopulate(val, "LinkedObjects", &r.LinkedObjects) + delete(rawMsg, key) + case "observedImpact": + err = unpopulate(val, "ObservedImpact", &r.ObservedImpact) + delete(rawMsg, key) + case "recommendationReason": + err = unpopulate(val, "RecommendationReason", &r.RecommendationReason) + delete(rawMsg, key) + case "revertActionDuration": + err = unpopulate(val, "RevertActionDuration", &r.RevertActionDuration) + delete(rawMsg, key) + case "revertActionInitiatedBy": + err = unpopulate(val, "RevertActionInitiatedBy", &r.RevertActionInitiatedBy) + delete(rawMsg, key) + case "revertActionInitiatedTime": + err = unpopulateTimeRFC3339(val, "RevertActionInitiatedTime", &r.RevertActionInitiatedTime) + delete(rawMsg, key) + case "revertActionStartTime": + err = unpopulateTimeRFC3339(val, "RevertActionStartTime", &r.RevertActionStartTime) + delete(rawMsg, key) + case "score": + err = unpopulate(val, "Score", &r.Score) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &r.State) + delete(rawMsg, key) + case "timeSeries": + err = unpopulate(val, "TimeSeries", &r.TimeSeries) + delete(rawMsg, key) + case "validSince": + err = unpopulateTimeRFC3339(val, "ValidSince", &r.ValidSince) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecommendedActionStateInfo. +func (r RecommendedActionStateInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionInitiatedBy", r.ActionInitiatedBy) + populate(objectMap, "currentValue", r.CurrentValue) + populateTimeRFC3339(objectMap, "lastModified", r.LastModified) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionStateInfo. +func (r *RecommendedActionStateInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionInitiatedBy": + err = unpopulate(val, "ActionInitiatedBy", &r.ActionInitiatedBy) + delete(rawMsg, key) + case "currentValue": + err = unpopulate(val, "CurrentValue", &r.CurrentValue) + delete(rawMsg, key) + case "lastModified": + err = unpopulateTimeRFC3339(val, "LastModified", &r.LastModified) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecommendedSensitivityLabelUpdate. +func (r RecommendedSensitivityLabelUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedSensitivityLabelUpdate. +func (r *RecommendedSensitivityLabelUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecommendedSensitivityLabelUpdateList. +func (r RecommendedSensitivityLabelUpdateList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "operations", r.Operations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedSensitivityLabelUpdateList. +func (r *RecommendedSensitivityLabelUpdateList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "operations": + err = unpopulate(val, "Operations", &r.Operations) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecommendedSensitivityLabelUpdateProperties. +func (r RecommendedSensitivityLabelUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "column", r.Column) + populate(objectMap, "op", r.Op) + populate(objectMap, "schema", r.Schema) + populate(objectMap, "table", r.Table) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedSensitivityLabelUpdateProperties. +func (r *RecommendedSensitivityLabelUpdateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "column": + err = unpopulate(val, "Column", &r.Column) + delete(rawMsg, key) + case "op": + err = unpopulate(val, "Op", &r.Op) + delete(rawMsg, key) + case "schema": + err = unpopulate(val, "Schema", &r.Schema) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &r.Table) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecoverableDatabase. +func (r RecoverableDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableDatabase. +func (r *RecoverableDatabase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecoverableDatabaseListResult. +func (r RecoverableDatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableDatabaseListResult. +func (r *RecoverableDatabaseListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecoverableDatabaseProperties. +func (r RecoverableDatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "edition", r.Edition) + populate(objectMap, "elasticPoolName", r.ElasticPoolName) + populateTimeRFC3339(objectMap, "lastAvailableBackupDate", r.LastAvailableBackupDate) + populate(objectMap, "serviceLevelObjective", r.ServiceLevelObjective) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableDatabaseProperties. +func (r *RecoverableDatabaseProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "edition": + err = unpopulate(val, "Edition", &r.Edition) + delete(rawMsg, key) + case "elasticPoolName": + err = unpopulate(val, "ElasticPoolName", &r.ElasticPoolName) + delete(rawMsg, key) + case "lastAvailableBackupDate": + err = unpopulateTimeRFC3339(val, "LastAvailableBackupDate", &r.LastAvailableBackupDate) + delete(rawMsg, key) + case "serviceLevelObjective": + err = unpopulate(val, "ServiceLevelObjective", &r.ServiceLevelObjective) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecoverableManagedDatabase. +func (r RecoverableManagedDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableManagedDatabase. +func (r *RecoverableManagedDatabase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecoverableManagedDatabaseListResult. +func (r RecoverableManagedDatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableManagedDatabaseListResult. +func (r *RecoverableManagedDatabaseListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecoverableManagedDatabaseProperties. +func (r RecoverableManagedDatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "lastAvailableBackupDate", r.LastAvailableBackupDate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableManagedDatabaseProperties. +func (r *RecoverableManagedDatabaseProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "lastAvailableBackupDate": + err = unpopulate(val, "LastAvailableBackupDate", &r.LastAvailableBackupDate) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReplicationLink. +func (r ReplicationLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationLink. +func (r *ReplicationLink) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReplicationLinkListResult. +func (r ReplicationLinkListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationLinkListResult. +func (r *ReplicationLinkListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReplicationLinkProperties. +func (r ReplicationLinkProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "isTerminationAllowed", r.IsTerminationAllowed) + populate(objectMap, "linkType", r.LinkType) + populate(objectMap, "partnerDatabase", r.PartnerDatabase) + populate(objectMap, "partnerLocation", r.PartnerLocation) + populate(objectMap, "partnerRole", r.PartnerRole) + populate(objectMap, "partnerServer", r.PartnerServer) + populate(objectMap, "percentComplete", r.PercentComplete) + populate(objectMap, "replicationMode", r.ReplicationMode) + populate(objectMap, "replicationState", r.ReplicationState) + populate(objectMap, "role", r.Role) + populateTimeRFC3339(objectMap, "startTime", r.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationLinkProperties. +func (r *ReplicationLinkProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "isTerminationAllowed": + err = unpopulate(val, "IsTerminationAllowed", &r.IsTerminationAllowed) + delete(rawMsg, key) + case "linkType": + err = unpopulate(val, "LinkType", &r.LinkType) + delete(rawMsg, key) + case "partnerDatabase": + err = unpopulate(val, "PartnerDatabase", &r.PartnerDatabase) + delete(rawMsg, key) + case "partnerLocation": + err = unpopulate(val, "PartnerLocation", &r.PartnerLocation) + delete(rawMsg, key) + case "partnerRole": + err = unpopulate(val, "PartnerRole", &r.PartnerRole) + delete(rawMsg, key) + case "partnerServer": + err = unpopulate(val, "PartnerServer", &r.PartnerServer) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &r.PercentComplete) + delete(rawMsg, key) + case "replicationMode": + err = unpopulate(val, "ReplicationMode", &r.ReplicationMode) + delete(rawMsg, key) + case "replicationState": + err = unpopulate(val, "ReplicationState", &r.ReplicationState) + delete(rawMsg, key) + case "role": + err = unpopulate(val, "Role", &r.Role) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &r.StartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceIdentity. +func (r ResourceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", r.PrincipalID) + populate(objectMap, "tenantId", r.TenantID) + populate(objectMap, "type", r.Type) + populate(objectMap, "userAssignedIdentities", r.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceIdentity. +func (r *ResourceIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &r.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &r.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &r.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceMoveDefinition. +func (r ResourceMoveDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceMoveDefinition. +func (r *ResourceMoveDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceWithWritableName. +func (r ResourceWithWritableName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceWithWritableName. +func (r *ResourceWithWritableName) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedDatabase. +func (r RestorableDroppedDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "sku", r.SKU) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedDatabase. +func (r *RestorableDroppedDatabase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &r.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedDatabaseListResult. +func (r RestorableDroppedDatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedDatabaseListResult. +func (r *RestorableDroppedDatabaseListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedDatabaseProperties. +func (r RestorableDroppedDatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupStorageRedundancy", r.BackupStorageRedundancy) + populateTimeRFC3339(objectMap, "creationDate", r.CreationDate) + populate(objectMap, "databaseName", r.DatabaseName) + populateTimeRFC3339(objectMap, "deletionDate", r.DeletionDate) + populateTimeRFC3339(objectMap, "earliestRestoreDate", r.EarliestRestoreDate) + populate(objectMap, "maxSizeBytes", r.MaxSizeBytes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedDatabaseProperties. +func (r *RestorableDroppedDatabaseProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupStorageRedundancy": + err = unpopulate(val, "BackupStorageRedundancy", &r.BackupStorageRedundancy) + delete(rawMsg, key) + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &r.CreationDate) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &r.DatabaseName) + delete(rawMsg, key) + case "deletionDate": + err = unpopulateTimeRFC3339(val, "DeletionDate", &r.DeletionDate) + delete(rawMsg, key) + case "earliestRestoreDate": + err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &r.EarliestRestoreDate) + delete(rawMsg, key) + case "maxSizeBytes": + err = unpopulate(val, "MaxSizeBytes", &r.MaxSizeBytes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedManagedDatabase. +func (r RestorableDroppedManagedDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedManagedDatabase. +func (r *RestorableDroppedManagedDatabase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedManagedDatabaseListResult. +func (r RestorableDroppedManagedDatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedManagedDatabaseListResult. +func (r *RestorableDroppedManagedDatabaseListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedManagedDatabaseProperties. +func (r RestorableDroppedManagedDatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "creationDate", r.CreationDate) + populate(objectMap, "databaseName", r.DatabaseName) + populateTimeRFC3339(objectMap, "deletionDate", r.DeletionDate) + populateTimeRFC3339(objectMap, "earliestRestoreDate", r.EarliestRestoreDate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedManagedDatabaseProperties. +func (r *RestorableDroppedManagedDatabaseProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &r.CreationDate) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &r.DatabaseName) + delete(rawMsg, key) + case "deletionDate": + err = unpopulateTimeRFC3339(val, "DeletionDate", &r.DeletionDate) + delete(rawMsg, key) + case "earliestRestoreDate": + err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &r.EarliestRestoreDate) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RestorePoint. +func (r RestorePoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePoint. +func (r *RestorePoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RestorePointListResult. +func (r RestorePointListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointListResult. +func (r *RestorePointListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RestorePointProperties. +func (r RestorePointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "earliestRestoreDate", r.EarliestRestoreDate) + populateTimeRFC3339(objectMap, "restorePointCreationDate", r.RestorePointCreationDate) + populate(objectMap, "restorePointLabel", r.RestorePointLabel) + populate(objectMap, "restorePointType", r.RestorePointType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointProperties. +func (r *RestorePointProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "earliestRestoreDate": + err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &r.EarliestRestoreDate) + delete(rawMsg, key) + case "restorePointCreationDate": + err = unpopulateTimeRFC3339(val, "RestorePointCreationDate", &r.RestorePointCreationDate) + delete(rawMsg, key) + case "restorePointLabel": + err = unpopulate(val, "RestorePointLabel", &r.RestorePointLabel) + delete(rawMsg, key) + case "restorePointType": + err = unpopulate(val, "RestorePointType", &r.RestorePointType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKU. +func (s SKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "capacity", s.Capacity) + populate(objectMap, "family", s.Family) + populate(objectMap, "name", s.Name) + populate(objectMap, "size", s.Size) + populate(objectMap, "tier", s.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. +func (s *SKU) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capacity": + err = unpopulate(val, "Capacity", &s.Capacity) + delete(rawMsg, key) + case "family": + err = unpopulate(val, "Family", &s.Family) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &s.Size) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityAlertPolicyProperties. +func (s SecurityAlertPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "creationTime", s.CreationTime) + populate(objectMap, "disabledAlerts", s.DisabledAlerts) + populate(objectMap, "emailAccountAdmins", s.EmailAccountAdmins) + populate(objectMap, "emailAddresses", s.EmailAddresses) + populate(objectMap, "retentionDays", s.RetentionDays) + populate(objectMap, "state", s.State) + populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) + populate(objectMap, "storageEndpoint", s.StorageEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlertPolicyProperties. +func (s *SecurityAlertPolicyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &s.CreationTime) + delete(rawMsg, key) + case "disabledAlerts": + err = unpopulate(val, "DisabledAlerts", &s.DisabledAlerts) + delete(rawMsg, key) + case "emailAccountAdmins": + err = unpopulate(val, "EmailAccountAdmins", &s.EmailAccountAdmins) + delete(rawMsg, key) + case "emailAddresses": + err = unpopulate(val, "EmailAddresses", &s.EmailAddresses) + delete(rawMsg, key) + case "retentionDays": + err = unpopulate(val, "RetentionDays", &s.RetentionDays) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageEndpoint": + err = unpopulate(val, "StorageEndpoint", &s.StorageEndpoint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityAlertsPolicyProperties. +func (s SecurityAlertsPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "creationTime", s.CreationTime) + populate(objectMap, "disabledAlerts", s.DisabledAlerts) + populate(objectMap, "emailAccountAdmins", s.EmailAccountAdmins) + populate(objectMap, "emailAddresses", s.EmailAddresses) + populate(objectMap, "retentionDays", s.RetentionDays) + populate(objectMap, "state", s.State) + populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) + populate(objectMap, "storageEndpoint", s.StorageEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlertsPolicyProperties. +func (s *SecurityAlertsPolicyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &s.CreationTime) + delete(rawMsg, key) + case "disabledAlerts": + err = unpopulate(val, "DisabledAlerts", &s.DisabledAlerts) + delete(rawMsg, key) + case "emailAccountAdmins": + err = unpopulate(val, "EmailAccountAdmins", &s.EmailAccountAdmins) + delete(rawMsg, key) + case "emailAddresses": + err = unpopulate(val, "EmailAddresses", &s.EmailAddresses) + delete(rawMsg, key) + case "retentionDays": + err = unpopulate(val, "RetentionDays", &s.RetentionDays) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageEndpoint": + err = unpopulate(val, "StorageEndpoint", &s.StorageEndpoint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityEvent. +func (s SecurityEvent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityEvent. +func (s *SecurityEvent) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityEventCollection. +func (s SecurityEventCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityEventCollection. +func (s *SecurityEventCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityEventProperties. +func (s SecurityEventProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "applicationName", s.ApplicationName) + populate(objectMap, "clientIp", s.ClientIP) + populate(objectMap, "database", s.Database) + populateTimeRFC3339(objectMap, "eventTime", s.EventTime) + populate(objectMap, "principalName", s.PrincipalName) + populate(objectMap, "securityEventSqlInjectionAdditionalProperties", s.SecurityEventSQLInjectionAdditionalProperties) + populate(objectMap, "securityEventType", s.SecurityEventType) + populate(objectMap, "server", s.Server) + populate(objectMap, "subscription", s.Subscription) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityEventProperties. +func (s *SecurityEventProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "applicationName": + err = unpopulate(val, "ApplicationName", &s.ApplicationName) + delete(rawMsg, key) + case "clientIp": + err = unpopulate(val, "ClientIP", &s.ClientIP) + delete(rawMsg, key) + case "database": + err = unpopulate(val, "Database", &s.Database) + delete(rawMsg, key) + case "eventTime": + err = unpopulateTimeRFC3339(val, "EventTime", &s.EventTime) + delete(rawMsg, key) + case "principalName": + err = unpopulate(val, "PrincipalName", &s.PrincipalName) + delete(rawMsg, key) + case "securityEventSqlInjectionAdditionalProperties": + err = unpopulate(val, "SecurityEventSQLInjectionAdditionalProperties", &s.SecurityEventSQLInjectionAdditionalProperties) + delete(rawMsg, key) + case "securityEventType": + err = unpopulate(val, "SecurityEventType", &s.SecurityEventType) + delete(rawMsg, key) + case "server": + err = unpopulate(val, "Server", &s.Server) + delete(rawMsg, key) + case "subscription": + err = unpopulate(val, "Subscription", &s.Subscription) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityEventSQLInjectionAdditionalProperties. +func (s SecurityEventSQLInjectionAdditionalProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errorCode", s.ErrorCode) + populate(objectMap, "errorMessage", s.ErrorMessage) + populate(objectMap, "errorSeverity", s.ErrorSeverity) + populate(objectMap, "statement", s.Statement) + populate(objectMap, "statementHighlightLength", s.StatementHighlightLength) + populate(objectMap, "statementHighlightOffset", s.StatementHighlightOffset) + populate(objectMap, "threatId", s.ThreatID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityEventSQLInjectionAdditionalProperties. +func (s *SecurityEventSQLInjectionAdditionalProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorCode": + err = unpopulate(val, "ErrorCode", &s.ErrorCode) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &s.ErrorMessage) + delete(rawMsg, key) + case "errorSeverity": + err = unpopulate(val, "ErrorSeverity", &s.ErrorSeverity) + delete(rawMsg, key) + case "statement": + err = unpopulate(val, "Statement", &s.Statement) + delete(rawMsg, key) + case "statementHighlightLength": + err = unpopulate(val, "StatementHighlightLength", &s.StatementHighlightLength) + delete(rawMsg, key) + case "statementHighlightOffset": + err = unpopulate(val, "StatementHighlightOffset", &s.StatementHighlightOffset) + delete(rawMsg, key) + case "threatId": + err = unpopulate(val, "ThreatID", &s.ThreatID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityEventsFilterParameters. +func (s SecurityEventsFilterParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "eventTime", s.EventTime) + populate(objectMap, "showServerRecords", s.ShowServerRecords) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityEventsFilterParameters. +func (s *SecurityEventsFilterParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "eventTime": + err = unpopulateTimeRFC3339(val, "EventTime", &s.EventTime) + delete(rawMsg, key) + case "showServerRecords": + err = unpopulate(val, "ShowServerRecords", &s.ShowServerRecords) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SensitivityLabel. +func (s SensitivityLabel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "managedBy", s.ManagedBy) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SensitivityLabel. +func (s *SensitivityLabel) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "managedBy": + err = unpopulate(val, "ManagedBy", &s.ManagedBy) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SensitivityLabelListResult. +func (s SensitivityLabelListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SensitivityLabelListResult. +func (s *SensitivityLabelListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SensitivityLabelProperties. +func (s SensitivityLabelProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "columnName", s.ColumnName) + populate(objectMap, "informationType", s.InformationType) + populate(objectMap, "informationTypeId", s.InformationTypeID) + populate(objectMap, "isDisabled", s.IsDisabled) + populate(objectMap, "labelId", s.LabelID) + populate(objectMap, "labelName", s.LabelName) + populate(objectMap, "rank", s.Rank) + populate(objectMap, "schemaName", s.SchemaName) + populate(objectMap, "tableName", s.TableName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SensitivityLabelProperties. +func (s *SensitivityLabelProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "columnName": + err = unpopulate(val, "ColumnName", &s.ColumnName) + delete(rawMsg, key) + case "informationType": + err = unpopulate(val, "InformationType", &s.InformationType) + delete(rawMsg, key) + case "informationTypeId": + err = unpopulate(val, "InformationTypeID", &s.InformationTypeID) + delete(rawMsg, key) + case "isDisabled": + err = unpopulate(val, "IsDisabled", &s.IsDisabled) + delete(rawMsg, key) + case "labelId": + err = unpopulate(val, "LabelID", &s.LabelID) + delete(rawMsg, key) + case "labelName": + err = unpopulate(val, "LabelName", &s.LabelName) + delete(rawMsg, key) + case "rank": + err = unpopulate(val, "Rank", &s.Rank) + delete(rawMsg, key) + case "schemaName": + err = unpopulate(val, "SchemaName", &s.SchemaName) + delete(rawMsg, key) + case "tableName": + err = unpopulate(val, "TableName", &s.TableName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SensitivityLabelUpdate. +func (s SensitivityLabelUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SensitivityLabelUpdate. +func (s *SensitivityLabelUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SensitivityLabelUpdateList. +func (s SensitivityLabelUpdateList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "operations", s.Operations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SensitivityLabelUpdateList. +func (s *SensitivityLabelUpdateList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "operations": + err = unpopulate(val, "Operations", &s.Operations) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SensitivityLabelUpdateProperties. +func (s SensitivityLabelUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "column", s.Column) + populate(objectMap, "op", s.Op) + populate(objectMap, "schema", s.Schema) + populate(objectMap, "sensitivityLabel", s.SensitivityLabel) + populate(objectMap, "table", s.Table) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SensitivityLabelUpdateProperties. +func (s *SensitivityLabelUpdateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "column": + err = unpopulate(val, "Column", &s.Column) + delete(rawMsg, key) + case "op": + err = unpopulate(val, "Op", &s.Op) + delete(rawMsg, key) + case "schema": + err = unpopulate(val, "Schema", &s.Schema) + delete(rawMsg, key) + case "sensitivityLabel": + err = unpopulate(val, "SensitivityLabel", &s.SensitivityLabel) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &s.Table) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Server. +func (s Server) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "kind", s.Kind) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Server. +func (s *Server) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &s.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &s.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerAdvancedThreatProtection. +func (s ServerAdvancedThreatProtection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerAdvancedThreatProtection. +func (s *ServerAdvancedThreatProtection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerAutomaticTuning. +func (s ServerAutomaticTuning) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerAutomaticTuning. +func (s *ServerAutomaticTuning) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerAzureADAdministrator. +func (s ServerAzureADAdministrator) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerAzureADAdministrator. +func (s *ServerAzureADAdministrator) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerAzureADOnlyAuthentication. +func (s ServerAzureADOnlyAuthentication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerAzureADOnlyAuthentication. +func (s *ServerAzureADOnlyAuthentication) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicy. +func (s ServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerBlobAuditingPolicy. +func (s *ServerBlobAuditingPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicyListResult. +func (s ServerBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerBlobAuditingPolicyListResult. +func (s *ServerBlobAuditingPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicyProperties. +func (s ServerBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "auditActionsAndGroups", s.AuditActionsAndGroups) + populate(objectMap, "isAzureMonitorTargetEnabled", s.IsAzureMonitorTargetEnabled) + populate(objectMap, "isDevopsAuditEnabled", s.IsDevopsAuditEnabled) + populate(objectMap, "isManagedIdentityInUse", s.IsManagedIdentityInUse) + populate(objectMap, "isStorageSecondaryKeyInUse", s.IsStorageSecondaryKeyInUse) + populate(objectMap, "queueDelayMs", s.QueueDelayMs) + populate(objectMap, "retentionDays", s.RetentionDays) + populate(objectMap, "state", s.State) + populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) + populate(objectMap, "storageAccountSubscriptionId", s.StorageAccountSubscriptionID) + populate(objectMap, "storageEndpoint", s.StorageEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerBlobAuditingPolicyProperties. +func (s *ServerBlobAuditingPolicyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "auditActionsAndGroups": + err = unpopulate(val, "AuditActionsAndGroups", &s.AuditActionsAndGroups) + delete(rawMsg, key) + case "isAzureMonitorTargetEnabled": + err = unpopulate(val, "IsAzureMonitorTargetEnabled", &s.IsAzureMonitorTargetEnabled) + delete(rawMsg, key) + case "isDevopsAuditEnabled": + err = unpopulate(val, "IsDevopsAuditEnabled", &s.IsDevopsAuditEnabled) + delete(rawMsg, key) + case "isManagedIdentityInUse": + err = unpopulate(val, "IsManagedIdentityInUse", &s.IsManagedIdentityInUse) + delete(rawMsg, key) + case "isStorageSecondaryKeyInUse": + err = unpopulate(val, "IsStorageSecondaryKeyInUse", &s.IsStorageSecondaryKeyInUse) + delete(rawMsg, key) + case "queueDelayMs": + err = unpopulate(val, "QueueDelayMs", &s.QueueDelayMs) + delete(rawMsg, key) + case "retentionDays": + err = unpopulate(val, "RetentionDays", &s.RetentionDays) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageAccountSubscriptionId": + err = unpopulate(val, "StorageAccountSubscriptionID", &s.StorageAccountSubscriptionID) + delete(rawMsg, key) + case "storageEndpoint": + err = unpopulate(val, "StorageEndpoint", &s.StorageEndpoint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerCommunicationLink. +func (s ServerCommunicationLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "kind", s.Kind) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerCommunicationLink. +func (s *ServerCommunicationLink) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &s.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerCommunicationLinkListResult. +func (s ServerCommunicationLinkListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerCommunicationLinkListResult. +func (s *ServerCommunicationLinkListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerCommunicationLinkProperties. +func (s ServerCommunicationLinkProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "partnerServer", s.PartnerServer) + populate(objectMap, "state", s.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerCommunicationLinkProperties. +func (s *ServerCommunicationLinkProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "partnerServer": + err = unpopulate(val, "PartnerServer", &s.PartnerServer) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerConnectionPolicy. +func (s ServerConnectionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "kind", s.Kind) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerConnectionPolicy. +func (s *ServerConnectionPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &s.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerConnectionPolicyListResult. +func (s ServerConnectionPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerConnectionPolicyListResult. +func (s *ServerConnectionPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerConnectionPolicyProperties. +func (s ServerConnectionPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "connectionType", s.ConnectionType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerConnectionPolicyProperties. +func (s *ServerConnectionPolicyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "connectionType": + err = unpopulate(val, "ConnectionType", &s.ConnectionType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerDNSAlias. +func (s ServerDNSAlias) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerDNSAlias. +func (s *ServerDNSAlias) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerDNSAliasAcquisition. +func (s ServerDNSAliasAcquisition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "oldServerDnsAliasId", s.OldServerDNSAliasID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerDNSAliasAcquisition. +func (s *ServerDNSAliasAcquisition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "oldServerDnsAliasId": + err = unpopulate(val, "OldServerDNSAliasID", &s.OldServerDNSAliasID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerDNSAliasListResult. +func (s ServerDNSAliasListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerDNSAliasListResult. +func (s *ServerDNSAliasListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerDNSAliasProperties. +func (s ServerDNSAliasProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureDnsRecord", s.AzureDNSRecord) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerDNSAliasProperties. +func (s *ServerDNSAliasProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureDnsRecord": + err = unpopulate(val, "AzureDNSRecord", &s.AzureDNSRecord) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerDevOpsAuditSettingsListResult. +func (s ServerDevOpsAuditSettingsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerDevOpsAuditSettingsListResult. +func (s *ServerDevOpsAuditSettingsListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerDevOpsAuditSettingsProperties. +func (s ServerDevOpsAuditSettingsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "isAzureMonitorTargetEnabled", s.IsAzureMonitorTargetEnabled) + populate(objectMap, "state", s.State) + populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) + populate(objectMap, "storageAccountSubscriptionId", s.StorageAccountSubscriptionID) + populate(objectMap, "storageEndpoint", s.StorageEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerDevOpsAuditSettingsProperties. +func (s *ServerDevOpsAuditSettingsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "isAzureMonitorTargetEnabled": + err = unpopulate(val, "IsAzureMonitorTargetEnabled", &s.IsAzureMonitorTargetEnabled) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageAccountSubscriptionId": + err = unpopulate(val, "StorageAccountSubscriptionID", &s.StorageAccountSubscriptionID) + delete(rawMsg, key) + case "storageEndpoint": + err = unpopulate(val, "StorageEndpoint", &s.StorageEndpoint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerDevOpsAuditingSettings. +func (s ServerDevOpsAuditingSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerDevOpsAuditingSettings. +func (s *ServerDevOpsAuditingSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerExternalAdministrator. +func (s ServerExternalAdministrator) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "administratorType", s.AdministratorType) + populate(objectMap, "azureADOnlyAuthentication", s.AzureADOnlyAuthentication) + populate(objectMap, "login", s.Login) + populate(objectMap, "principalType", s.PrincipalType) + populate(objectMap, "sid", s.Sid) + populate(objectMap, "tenantId", s.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerExternalAdministrator. +func (s *ServerExternalAdministrator) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "administratorType": + err = unpopulate(val, "AdministratorType", &s.AdministratorType) + delete(rawMsg, key) + case "azureADOnlyAuthentication": + err = unpopulate(val, "AzureADOnlyAuthentication", &s.AzureADOnlyAuthentication) + delete(rawMsg, key) + case "login": + err = unpopulate(val, "Login", &s.Login) + delete(rawMsg, key) + case "principalType": + err = unpopulate(val, "PrincipalType", &s.PrincipalType) + delete(rawMsg, key) + case "sid": + err = unpopulate(val, "Sid", &s.Sid) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &s.TenantID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerFirewallRuleProperties. +func (s ServerFirewallRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "endIpAddress", s.EndIPAddress) + populate(objectMap, "startIpAddress", s.StartIPAddress) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerFirewallRuleProperties. +func (s *ServerFirewallRuleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endIpAddress": + err = unpopulate(val, "EndIPAddress", &s.EndIPAddress) + delete(rawMsg, key) + case "startIpAddress": + err = unpopulate(val, "StartIPAddress", &s.StartIPAddress) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerInfo. +func (s ServerInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "serverId", s.ServerID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerInfo. +func (s *ServerInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serverId": + err = unpopulate(val, "ServerID", &s.ServerID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerKey. +func (s ServerKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "kind", s.Kind) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerKey. +func (s *ServerKey) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &s.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerKeyListResult. +func (s ServerKeyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerKeyListResult. +func (s *ServerKeyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerKeyProperties. +func (s ServerKeyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "autoRotationEnabled", s.AutoRotationEnabled) + populateTimeRFC3339(objectMap, "creationDate", s.CreationDate) + populate(objectMap, "serverKeyType", s.ServerKeyType) + populate(objectMap, "subregion", s.Subregion) + populate(objectMap, "thumbprint", s.Thumbprint) + populate(objectMap, "uri", s.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerKeyProperties. +func (s *ServerKeyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoRotationEnabled": + err = unpopulate(val, "AutoRotationEnabled", &s.AutoRotationEnabled) + delete(rawMsg, key) + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &s.CreationDate) + delete(rawMsg, key) + case "serverKeyType": + err = unpopulate(val, "ServerKeyType", &s.ServerKeyType) + delete(rawMsg, key) + case "subregion": + err = unpopulate(val, "Subregion", &s.Subregion) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &s.Thumbprint) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &s.URI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerListResult. +func (s ServerListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerListResult. +func (s *ServerListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerOperation. +func (s ServerOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerOperation. +func (s *ServerOperation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerOperationListResult. +func (s ServerOperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerOperationListResult. +func (s *ServerOperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerOperationProperties. +func (s ServerOperationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", s.Description) + populate(objectMap, "errorCode", s.ErrorCode) + populate(objectMap, "errorDescription", s.ErrorDescription) + populate(objectMap, "errorSeverity", s.ErrorSeverity) + populateTimeRFC3339(objectMap, "estimatedCompletionTime", s.EstimatedCompletionTime) + populate(objectMap, "isCancellable", s.IsCancellable) + populate(objectMap, "isUserError", s.IsUserError) + populate(objectMap, "operation", s.Operation) + populate(objectMap, "operationFriendlyName", s.OperationFriendlyName) + populate(objectMap, "percentComplete", s.PercentComplete) + populate(objectMap, "serverName", s.ServerName) + populateTimeRFC3339(objectMap, "startTime", s.StartTime) + populate(objectMap, "state", s.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerOperationProperties. +func (s *ServerOperationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "errorCode": + err = unpopulate(val, "ErrorCode", &s.ErrorCode) + delete(rawMsg, key) + case "errorDescription": + err = unpopulate(val, "ErrorDescription", &s.ErrorDescription) + delete(rawMsg, key) + case "errorSeverity": + err = unpopulate(val, "ErrorSeverity", &s.ErrorSeverity) + delete(rawMsg, key) + case "estimatedCompletionTime": + err = unpopulateTimeRFC3339(val, "EstimatedCompletionTime", &s.EstimatedCompletionTime) + delete(rawMsg, key) + case "isCancellable": + err = unpopulate(val, "IsCancellable", &s.IsCancellable) + delete(rawMsg, key) + case "isUserError": + err = unpopulate(val, "IsUserError", &s.IsUserError) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &s.Operation) + delete(rawMsg, key) + case "operationFriendlyName": + err = unpopulate(val, "OperationFriendlyName", &s.OperationFriendlyName) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &s.PercentComplete) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &s.ServerName) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &s.StartTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerPrivateEndpointConnection. +func (s ServerPrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPrivateEndpointConnection. +func (s *ServerPrivateEndpointConnection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerProperties. +func (s ServerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "administratorLogin", s.AdministratorLogin) + populate(objectMap, "administratorLoginPassword", s.AdministratorLoginPassword) + populate(objectMap, "administrators", s.Administrators) + populate(objectMap, "federatedClientId", s.FederatedClientID) + populate(objectMap, "fullyQualifiedDomainName", s.FullyQualifiedDomainName) + populate(objectMap, "keyId", s.KeyID) + populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) + populate(objectMap, "primaryUserAssignedIdentityId", s.PrimaryUserAssignedIdentityID) + populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) + populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) + populate(objectMap, "restrictOutboundNetworkAccess", s.RestrictOutboundNetworkAccess) + populate(objectMap, "state", s.State) + populate(objectMap, "version", s.Version) + populate(objectMap, "workspaceFeature", s.WorkspaceFeature) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerProperties. +func (s *ServerProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "administratorLogin": + err = unpopulate(val, "AdministratorLogin", &s.AdministratorLogin) + delete(rawMsg, key) + case "administratorLoginPassword": + err = unpopulate(val, "AdministratorLoginPassword", &s.AdministratorLoginPassword) + delete(rawMsg, key) + case "administrators": + err = unpopulate(val, "Administrators", &s.Administrators) + delete(rawMsg, key) + case "federatedClientId": + err = unpopulate(val, "FederatedClientID", &s.FederatedClientID) + delete(rawMsg, key) + case "fullyQualifiedDomainName": + err = unpopulate(val, "FullyQualifiedDomainName", &s.FullyQualifiedDomainName) + delete(rawMsg, key) + case "keyId": + err = unpopulate(val, "KeyID", &s.KeyID) + delete(rawMsg, key) + case "minimalTlsVersion": + err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) + delete(rawMsg, key) + case "primaryUserAssignedIdentityId": + err = unpopulate(val, "PrimaryUserAssignedIdentityID", &s.PrimaryUserAssignedIdentityID) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) + delete(rawMsg, key) + case "restrictOutboundNetworkAccess": + err = unpopulate(val, "RestrictOutboundNetworkAccess", &s.RestrictOutboundNetworkAccess) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) + delete(rawMsg, key) + case "workspaceFeature": + err = unpopulate(val, "WorkspaceFeature", &s.WorkspaceFeature) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerSecurityAlertPolicy. +func (s ServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerSecurityAlertPolicy. +func (s *ServerSecurityAlertPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerTrustCertificate. +func (s ServerTrustCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerTrustCertificate. +func (s *ServerTrustCertificate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerTrustCertificateProperties. +func (s ServerTrustCertificateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "certificateName", s.CertificateName) + populate(objectMap, "publicBlob", s.PublicBlob) + populate(objectMap, "thumbprint", s.Thumbprint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerTrustCertificateProperties. +func (s *ServerTrustCertificateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificateName": + err = unpopulate(val, "CertificateName", &s.CertificateName) + delete(rawMsg, key) + case "publicBlob": + err = unpopulate(val, "PublicBlob", &s.PublicBlob) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &s.Thumbprint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerTrustCertificatesListResult. +func (s ServerTrustCertificatesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerTrustCertificatesListResult. +func (s *ServerTrustCertificatesListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerTrustGroup. +func (s ServerTrustGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerTrustGroup. +func (s *ServerTrustGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerTrustGroupListResult. +func (s ServerTrustGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerTrustGroupListResult. +func (s *ServerTrustGroupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerTrustGroupProperties. +func (s ServerTrustGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupMembers", s.GroupMembers) + populate(objectMap, "trustScopes", s.TrustScopes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerTrustGroupProperties. +func (s *ServerTrustGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groupMembers": + err = unpopulate(val, "GroupMembers", &s.GroupMembers) + delete(rawMsg, key) + case "trustScopes": + err = unpopulate(val, "TrustScopes", &s.TrustScopes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerUpdate. +func (s ServerUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "tags", s.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerUpdate. +func (s *ServerUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identity": + err = unpopulate(val, "Identity", &s.Identity) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerUsage. +func (s ServerUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "currentValue", s.CurrentValue) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "limit", s.Limit) + populate(objectMap, "name", s.Name) + populateTimeRFC3339(objectMap, "nextResetTime", s.NextResetTime) + populate(objectMap, "resourceName", s.ResourceName) + populate(objectMap, "unit", s.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerUsage. +func (s *ServerUsage) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentValue": + err = unpopulate(val, "CurrentValue", &s.CurrentValue) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &s.Limit) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "nextResetTime": + err = unpopulateTimeRFC3339(val, "NextResetTime", &s.NextResetTime) + delete(rawMsg, key) + case "resourceName": + err = unpopulate(val, "ResourceName", &s.ResourceName) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &s.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerUsageListResult. +func (s ServerUsageListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerUsageListResult. +func (s *ServerUsageListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerVersionCapability. +func (s ServerVersionCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", s.Name) + populate(objectMap, "reason", s.Reason) + populate(objectMap, "status", s.Status) + populate(objectMap, "supportedEditions", s.SupportedEditions) + populate(objectMap, "supportedElasticPoolEditions", s.SupportedElasticPoolEditions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerVersionCapability. +func (s *ServerVersionCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "supportedEditions": + err = unpopulate(val, "SupportedEditions", &s.SupportedEditions) + delete(rawMsg, key) + case "supportedElasticPoolEditions": + err = unpopulate(val, "SupportedElasticPoolEditions", &s.SupportedElasticPoolEditions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerVulnerabilityAssessment. +func (s ServerVulnerabilityAssessment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerVulnerabilityAssessment. +func (s *ServerVulnerabilityAssessment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerVulnerabilityAssessmentListResult. +func (s ServerVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerVulnerabilityAssessmentListResult. +func (s *ServerVulnerabilityAssessmentListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerVulnerabilityAssessmentProperties. +func (s ServerVulnerabilityAssessmentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "recurringScans", s.RecurringScans) + populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) + populate(objectMap, "storageContainerPath", s.StorageContainerPath) + populate(objectMap, "storageContainerSasKey", s.StorageContainerSasKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerVulnerabilityAssessmentProperties. +func (s *ServerVulnerabilityAssessmentProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "recurringScans": + err = unpopulate(val, "RecurringScans", &s.RecurringScans) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageContainerPath": + err = unpopulate(val, "StorageContainerPath", &s.StorageContainerPath) + delete(rawMsg, key) + case "storageContainerSasKey": + err = unpopulate(val, "StorageContainerSasKey", &s.StorageContainerSasKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceObjective. +func (s ServiceObjective) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceObjective. +func (s *ServiceObjective) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceObjectiveCapability. +func (s ServiceObjectiveCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "computeModel", s.ComputeModel) + populate(objectMap, "id", s.ID) + populate(objectMap, "includedMaxSize", s.IncludedMaxSize) + populate(objectMap, "name", s.Name) + populate(objectMap, "performanceLevel", s.PerformanceLevel) + populate(objectMap, "reason", s.Reason) + populate(objectMap, "sku", s.SKU) + populate(objectMap, "status", s.Status) + populate(objectMap, "supportedAutoPauseDelay", s.SupportedAutoPauseDelay) + populate(objectMap, "supportedLicenseTypes", s.SupportedLicenseTypes) + populate(objectMap, "supportedMaintenanceConfigurations", s.SupportedMaintenanceConfigurations) + populate(objectMap, "supportedMaxSizes", s.SupportedMaxSizes) + populate(objectMap, "supportedMinCapacities", s.SupportedMinCapacities) + populate(objectMap, "zoneRedundant", s.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceObjectiveCapability. +func (s *ServiceObjectiveCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "computeModel": + err = unpopulate(val, "ComputeModel", &s.ComputeModel) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "includedMaxSize": + err = unpopulate(val, "IncludedMaxSize", &s.IncludedMaxSize) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "performanceLevel": + err = unpopulate(val, "PerformanceLevel", &s.PerformanceLevel) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &s.SKU) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "supportedAutoPauseDelay": + err = unpopulate(val, "SupportedAutoPauseDelay", &s.SupportedAutoPauseDelay) + delete(rawMsg, key) + case "supportedLicenseTypes": + err = unpopulate(val, "SupportedLicenseTypes", &s.SupportedLicenseTypes) + delete(rawMsg, key) + case "supportedMaintenanceConfigurations": + err = unpopulate(val, "SupportedMaintenanceConfigurations", &s.SupportedMaintenanceConfigurations) + delete(rawMsg, key) + case "supportedMaxSizes": + err = unpopulate(val, "SupportedMaxSizes", &s.SupportedMaxSizes) + delete(rawMsg, key) + case "supportedMinCapacities": + err = unpopulate(val, "SupportedMinCapacities", &s.SupportedMinCapacities) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &s.ZoneRedundant) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceObjectiveListResult. +func (s ServiceObjectiveListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceObjectiveListResult. +func (s *ServiceObjectiveListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceObjectiveProperties. +func (s ServiceObjectiveProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", s.Description) + populate(objectMap, "enabled", s.Enabled) + populate(objectMap, "isDefault", s.IsDefault) + populate(objectMap, "isSystem", s.IsSystem) + populate(objectMap, "serviceObjectiveName", s.ServiceObjectiveName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceObjectiveProperties. +func (s *ServiceObjectiveProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &s.Enabled) + delete(rawMsg, key) + case "isDefault": + err = unpopulate(val, "IsDefault", &s.IsDefault) + delete(rawMsg, key) + case "isSystem": + err = unpopulate(val, "IsSystem", &s.IsSystem) + delete(rawMsg, key) + case "serviceObjectiveName": + err = unpopulate(val, "ServiceObjectiveName", &s.ServiceObjectiveName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServicePrincipal. +func (s ServicePrincipal) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientId", s.ClientID) + populate(objectMap, "principalId", s.PrincipalID) + populate(objectMap, "tenantId", s.TenantID) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrincipal. +func (s *ServicePrincipal) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &s.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &s.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &s.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SloUsageMetric. +func (s SloUsageMetric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "inRangeTimeRatio", s.InRangeTimeRatio) + populate(objectMap, "serviceLevelObjective", s.ServiceLevelObjective) + populate(objectMap, "serviceLevelObjectiveId", s.ServiceLevelObjectiveID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SloUsageMetric. +func (s *SloUsageMetric) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "inRangeTimeRatio": + err = unpopulate(val, "InRangeTimeRatio", &s.InRangeTimeRatio) + delete(rawMsg, key) + case "serviceLevelObjective": + err = unpopulate(val, "ServiceLevelObjective", &s.ServiceLevelObjective) + delete(rawMsg, key) + case "serviceLevelObjectiveId": + err = unpopulate(val, "ServiceLevelObjectiveID", &s.ServiceLevelObjectiveID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type StorageCapability. +func (s StorageCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "reason", s.Reason) + populate(objectMap, "status", s.Status) + populate(objectMap, "storageAccountType", s.StorageAccountType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageCapability. +func (s *StorageCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "reason": + err = unpopulate(val, "Reason", &s.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "storageAccountType": + err = unpopulate(val, "StorageAccountType", &s.StorageAccountType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubscriptionUsage. +func (s SubscriptionUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionUsage. +func (s *SubscriptionUsage) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubscriptionUsageListResult. +func (s SubscriptionUsageListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionUsageListResult. +func (s *SubscriptionUsageListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubscriptionUsageProperties. +func (s SubscriptionUsageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "currentValue", s.CurrentValue) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "limit", s.Limit) + populate(objectMap, "unit", s.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionUsageProperties. +func (s *SubscriptionUsageProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentValue": + err = unpopulate(val, "CurrentValue", &s.CurrentValue) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &s.Limit) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &s.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncAgent. +func (s SyncAgent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgent. +func (s *SyncAgent) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncAgentKeyProperties. +func (s SyncAgentKeyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "syncAgentKey", s.SyncAgentKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgentKeyProperties. +func (s *SyncAgentKeyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "syncAgentKey": + err = unpopulate(val, "SyncAgentKey", &s.SyncAgentKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncAgentLinkedDatabase. +func (s SyncAgentLinkedDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgentLinkedDatabase. +func (s *SyncAgentLinkedDatabase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncAgentLinkedDatabaseListResult. +func (s SyncAgentLinkedDatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgentLinkedDatabaseListResult. +func (s *SyncAgentLinkedDatabaseListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncAgentLinkedDatabaseProperties. +func (s SyncAgentLinkedDatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "databaseId", s.DatabaseID) + populate(objectMap, "databaseName", s.DatabaseName) + populate(objectMap, "databaseType", s.DatabaseType) + populate(objectMap, "description", s.Description) + populate(objectMap, "serverName", s.ServerName) + populate(objectMap, "userName", s.UserName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgentLinkedDatabaseProperties. +func (s *SyncAgentLinkedDatabaseProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseId": + err = unpopulate(val, "DatabaseID", &s.DatabaseID) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &s.DatabaseName) + delete(rawMsg, key) + case "databaseType": + err = unpopulate(val, "DatabaseType", &s.DatabaseType) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &s.ServerName) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &s.UserName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncAgentListResult. +func (s SyncAgentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgentListResult. +func (s *SyncAgentListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncAgentProperties. +func (s SyncAgentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "expiryTime", s.ExpiryTime) + populate(objectMap, "isUpToDate", s.IsUpToDate) + populateTimeRFC3339(objectMap, "lastAliveTime", s.LastAliveTime) + populate(objectMap, "name", s.Name) + populate(objectMap, "state", s.State) + populate(objectMap, "syncDatabaseId", s.SyncDatabaseID) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgentProperties. +func (s *SyncAgentProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "expiryTime": + err = unpopulateTimeRFC3339(val, "ExpiryTime", &s.ExpiryTime) + delete(rawMsg, key) + case "isUpToDate": + err = unpopulate(val, "IsUpToDate", &s.IsUpToDate) + delete(rawMsg, key) + case "lastAliveTime": + err = unpopulateTimeRFC3339(val, "LastAliveTime", &s.LastAliveTime) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + case "syncDatabaseId": + err = unpopulate(val, "SyncDatabaseID", &s.SyncDatabaseID) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncDatabaseIDListResult. +func (s SyncDatabaseIDListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncDatabaseIDListResult. +func (s *SyncDatabaseIDListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncDatabaseIDProperties. +func (s SyncDatabaseIDProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncDatabaseIDProperties. +func (s *SyncDatabaseIDProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncFullSchemaProperties. +func (s SyncFullSchemaProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "lastUpdateTime", s.LastUpdateTime) + populate(objectMap, "tables", s.Tables) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncFullSchemaProperties. +func (s *SyncFullSchemaProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "lastUpdateTime": + err = unpopulateTimeRFC3339(val, "LastUpdateTime", &s.LastUpdateTime) + delete(rawMsg, key) + case "tables": + err = unpopulate(val, "Tables", &s.Tables) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncFullSchemaPropertiesListResult. +func (s SyncFullSchemaPropertiesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncFullSchemaPropertiesListResult. +func (s *SyncFullSchemaPropertiesListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncFullSchemaTable. +func (s SyncFullSchemaTable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "columns", s.Columns) + populate(objectMap, "errorId", s.ErrorID) + populate(objectMap, "hasError", s.HasError) + populate(objectMap, "name", s.Name) + populate(objectMap, "quotedName", s.QuotedName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncFullSchemaTable. +func (s *SyncFullSchemaTable) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "columns": + err = unpopulate(val, "Columns", &s.Columns) + delete(rawMsg, key) + case "errorId": + err = unpopulate(val, "ErrorID", &s.ErrorID) + delete(rawMsg, key) + case "hasError": + err = unpopulate(val, "HasError", &s.HasError) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "quotedName": + err = unpopulate(val, "QuotedName", &s.QuotedName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncFullSchemaTableColumn. +func (s SyncFullSchemaTableColumn) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataSize", s.DataSize) + populate(objectMap, "dataType", s.DataType) + populate(objectMap, "errorId", s.ErrorID) + populate(objectMap, "hasError", s.HasError) + populate(objectMap, "isPrimaryKey", s.IsPrimaryKey) + populate(objectMap, "name", s.Name) + populate(objectMap, "quotedName", s.QuotedName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncFullSchemaTableColumn. +func (s *SyncFullSchemaTableColumn) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataSize": + err = unpopulate(val, "DataSize", &s.DataSize) + delete(rawMsg, key) + case "dataType": + err = unpopulate(val, "DataType", &s.DataType) + delete(rawMsg, key) + case "errorId": + err = unpopulate(val, "ErrorID", &s.ErrorID) + delete(rawMsg, key) + case "hasError": + err = unpopulate(val, "HasError", &s.HasError) + delete(rawMsg, key) + case "isPrimaryKey": + err = unpopulate(val, "IsPrimaryKey", &s.IsPrimaryKey) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "quotedName": + err = unpopulate(val, "QuotedName", &s.QuotedName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncGroup. +func (s SyncGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "sku", s.SKU) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroup. +func (s *SyncGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &s.SKU) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncGroupListResult. +func (s SyncGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupListResult. +func (s *SyncGroupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncGroupLogListResult. +func (s SyncGroupLogListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupLogListResult. +func (s *SyncGroupLogListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncGroupLogProperties. +func (s SyncGroupLogProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "details", s.Details) + populate(objectMap, "operationStatus", s.OperationStatus) + populate(objectMap, "source", s.Source) + populateTimeRFC3339(objectMap, "timestamp", s.Timestamp) + populate(objectMap, "tracingId", s.TracingID) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupLogProperties. +func (s *SyncGroupLogProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "details": + err = unpopulate(val, "Details", &s.Details) + delete(rawMsg, key) + case "operationStatus": + err = unpopulate(val, "OperationStatus", &s.OperationStatus) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &s.Source) + delete(rawMsg, key) + case "timestamp": + err = unpopulateTimeRFC3339(val, "Timestamp", &s.Timestamp) + delete(rawMsg, key) + case "tracingId": + err = unpopulate(val, "TracingID", &s.TracingID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncGroupProperties. +func (s SyncGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "conflictLoggingRetentionInDays", s.ConflictLoggingRetentionInDays) + populate(objectMap, "conflictResolutionPolicy", s.ConflictResolutionPolicy) + populate(objectMap, "enableConflictLogging", s.EnableConflictLogging) + populate(objectMap, "hubDatabasePassword", s.HubDatabasePassword) + populate(objectMap, "hubDatabaseUserName", s.HubDatabaseUserName) + populate(objectMap, "interval", s.Interval) + populateTimeRFC3339(objectMap, "lastSyncTime", s.LastSyncTime) + populate(objectMap, "privateEndpointName", s.PrivateEndpointName) + populate(objectMap, "schema", s.Schema) + populate(objectMap, "syncDatabaseId", s.SyncDatabaseID) + populate(objectMap, "syncState", s.SyncState) + populate(objectMap, "usePrivateLinkConnection", s.UsePrivateLinkConnection) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupProperties. +func (s *SyncGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "conflictLoggingRetentionInDays": + err = unpopulate(val, "ConflictLoggingRetentionInDays", &s.ConflictLoggingRetentionInDays) + delete(rawMsg, key) + case "conflictResolutionPolicy": + err = unpopulate(val, "ConflictResolutionPolicy", &s.ConflictResolutionPolicy) + delete(rawMsg, key) + case "enableConflictLogging": + err = unpopulate(val, "EnableConflictLogging", &s.EnableConflictLogging) + delete(rawMsg, key) + case "hubDatabasePassword": + err = unpopulate(val, "HubDatabasePassword", &s.HubDatabasePassword) + delete(rawMsg, key) + case "hubDatabaseUserName": + err = unpopulate(val, "HubDatabaseUserName", &s.HubDatabaseUserName) + delete(rawMsg, key) + case "interval": + err = unpopulate(val, "Interval", &s.Interval) + delete(rawMsg, key) + case "lastSyncTime": + err = unpopulateTimeRFC3339(val, "LastSyncTime", &s.LastSyncTime) + delete(rawMsg, key) + case "privateEndpointName": + err = unpopulate(val, "PrivateEndpointName", &s.PrivateEndpointName) + delete(rawMsg, key) + case "schema": + err = unpopulate(val, "Schema", &s.Schema) + delete(rawMsg, key) + case "syncDatabaseId": + err = unpopulate(val, "SyncDatabaseID", &s.SyncDatabaseID) + delete(rawMsg, key) + case "syncState": + err = unpopulate(val, "SyncState", &s.SyncState) + delete(rawMsg, key) + case "usePrivateLinkConnection": + err = unpopulate(val, "UsePrivateLinkConnection", &s.UsePrivateLinkConnection) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncGroupSchema. +func (s SyncGroupSchema) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "masterSyncMemberName", s.MasterSyncMemberName) + populate(objectMap, "tables", s.Tables) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupSchema. +func (s *SyncGroupSchema) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "masterSyncMemberName": + err = unpopulate(val, "MasterSyncMemberName", &s.MasterSyncMemberName) + delete(rawMsg, key) + case "tables": + err = unpopulate(val, "Tables", &s.Tables) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncGroupSchemaTable. +func (s SyncGroupSchemaTable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "columns", s.Columns) + populate(objectMap, "quotedName", s.QuotedName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupSchemaTable. +func (s *SyncGroupSchemaTable) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "columns": + err = unpopulate(val, "Columns", &s.Columns) + delete(rawMsg, key) + case "quotedName": + err = unpopulate(val, "QuotedName", &s.QuotedName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncGroupSchemaTableColumn. +func (s SyncGroupSchemaTableColumn) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataSize", s.DataSize) + populate(objectMap, "dataType", s.DataType) + populate(objectMap, "quotedName", s.QuotedName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupSchemaTableColumn. +func (s *SyncGroupSchemaTableColumn) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataSize": + err = unpopulate(val, "DataSize", &s.DataSize) + delete(rawMsg, key) + case "dataType": + err = unpopulate(val, "DataType", &s.DataType) + delete(rawMsg, key) + case "quotedName": + err = unpopulate(val, "QuotedName", &s.QuotedName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncMember. +func (s SyncMember) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncMember. +func (s *SyncMember) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncMemberListResult. +func (s SyncMemberListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncMemberListResult. +func (s *SyncMemberListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncMemberProperties. +func (s SyncMemberProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "databaseName", s.DatabaseName) + populate(objectMap, "databaseType", s.DatabaseType) + populate(objectMap, "password", s.Password) + populate(objectMap, "privateEndpointName", s.PrivateEndpointName) + populate(objectMap, "sqlServerDatabaseId", s.SQLServerDatabaseID) + populate(objectMap, "serverName", s.ServerName) + populate(objectMap, "syncAgentId", s.SyncAgentID) + populate(objectMap, "syncDirection", s.SyncDirection) + populate(objectMap, "syncMemberAzureDatabaseResourceId", s.SyncMemberAzureDatabaseResourceID) + populate(objectMap, "syncState", s.SyncState) + populate(objectMap, "usePrivateLinkConnection", s.UsePrivateLinkConnection) + populate(objectMap, "userName", s.UserName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncMemberProperties. +func (s *SyncMemberProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseName": + err = unpopulate(val, "DatabaseName", &s.DatabaseName) + delete(rawMsg, key) + case "databaseType": + err = unpopulate(val, "DatabaseType", &s.DatabaseType) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &s.Password) + delete(rawMsg, key) + case "privateEndpointName": + err = unpopulate(val, "PrivateEndpointName", &s.PrivateEndpointName) + delete(rawMsg, key) + case "sqlServerDatabaseId": + err = unpopulate(val, "SQLServerDatabaseID", &s.SQLServerDatabaseID) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &s.ServerName) + delete(rawMsg, key) + case "syncAgentId": + err = unpopulate(val, "SyncAgentID", &s.SyncAgentID) + delete(rawMsg, key) + case "syncDirection": + err = unpopulate(val, "SyncDirection", &s.SyncDirection) + delete(rawMsg, key) + case "syncMemberAzureDatabaseResourceId": + err = unpopulate(val, "SyncMemberAzureDatabaseResourceID", &s.SyncMemberAzureDatabaseResourceID) + delete(rawMsg, key) + case "syncState": + err = unpopulate(val, "SyncState", &s.SyncState) + delete(rawMsg, key) + case "usePrivateLinkConnection": + err = unpopulate(val, "UsePrivateLinkConnection", &s.UsePrivateLinkConnection) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &s.UserName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TdeCertificate. +func (t TdeCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TdeCertificate. +func (t *TdeCertificate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TdeCertificateProperties. +func (t TdeCertificateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "certPassword", t.CertPassword) + populate(objectMap, "privateBlob", t.PrivateBlob) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TdeCertificateProperties. +func (t *TdeCertificateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certPassword": + err = unpopulate(val, "CertPassword", &t.CertPassword) + delete(rawMsg, key) + case "privateBlob": + err = unpopulate(val, "PrivateBlob", &t.PrivateBlob) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TimeZone. +func (t TimeZone) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TimeZone. +func (t *TimeZone) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TimeZoneListResult. +func (t TimeZoneListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TimeZoneListResult. +func (t *TimeZoneListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &t.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TimeZoneProperties. +func (t TimeZoneProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "displayName", t.DisplayName) + populate(objectMap, "timeZoneId", t.TimeZoneID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TimeZoneProperties. +func (t *TimeZoneProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "displayName": + err = unpopulate(val, "DisplayName", &t.DisplayName) + delete(rawMsg, key) + case "timeZoneId": + err = unpopulate(val, "TimeZoneID", &t.TimeZoneID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TopQueries. +func (t TopQueries) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aggregationFunction", t.AggregationFunction) + populate(objectMap, "endTime", t.EndTime) + populate(objectMap, "intervalType", t.IntervalType) + populate(objectMap, "numberOfQueries", t.NumberOfQueries) + populate(objectMap, "observationMetric", t.ObservationMetric) + populate(objectMap, "queries", t.Queries) + populate(objectMap, "startTime", t.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TopQueries. +func (t *TopQueries) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "aggregationFunction": + err = unpopulate(val, "AggregationFunction", &t.AggregationFunction) + delete(rawMsg, key) + case "endTime": + err = unpopulate(val, "EndTime", &t.EndTime) + delete(rawMsg, key) + case "intervalType": + err = unpopulate(val, "IntervalType", &t.IntervalType) + delete(rawMsg, key) + case "numberOfQueries": + err = unpopulate(val, "NumberOfQueries", &t.NumberOfQueries) + delete(rawMsg, key) + case "observationMetric": + err = unpopulate(val, "ObservationMetric", &t.ObservationMetric) + delete(rawMsg, key) + case "queries": + err = unpopulate(val, "Queries", &t.Queries) + delete(rawMsg, key) + case "startTime": + err = unpopulate(val, "StartTime", &t.StartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TopQueriesListResult. +func (t TopQueriesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TopQueriesListResult. +func (t *TopQueriesListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &t.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. +func (t *TrackedResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TransparentDataEncryptionProperties. +func (t TransparentDataEncryptionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "state", t.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TransparentDataEncryptionProperties. +func (t *TransparentDataEncryptionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "state": + err = unpopulate(val, "State", &t.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateLongTermRetentionBackupParameters. +func (u UpdateLongTermRetentionBackupParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", u.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateLongTermRetentionBackupParameters. +func (u *UpdateLongTermRetentionBackupParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateLongTermRetentionBackupParametersProperties. +func (u UpdateLongTermRetentionBackupParametersProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "requestedBackupStorageRedundancy", u.RequestedBackupStorageRedundancy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateLongTermRetentionBackupParametersProperties. +func (u *UpdateLongTermRetentionBackupParametersProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "requestedBackupStorageRedundancy": + err = unpopulate(val, "RequestedBackupStorageRedundancy", &u.RequestedBackupStorageRedundancy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateManagedInstanceDNSServersOperation. +func (u UpdateManagedInstanceDNSServersOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", u.ID) + populate(objectMap, "name", u.Name) + populate(objectMap, "properties", u.Properties) + populate(objectMap, "type", u.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateManagedInstanceDNSServersOperation. +func (u *UpdateManagedInstanceDNSServersOperation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &u.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &u.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpsertManagedServerOperationParameters. +func (u UpsertManagedServerOperationParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "family", u.Family) + populate(objectMap, "storageSizeInGB", u.StorageSizeInGB) + populate(objectMap, "tier", u.Tier) + populate(objectMap, "vCores", u.VCores) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpsertManagedServerOperationParameters. +func (u *UpsertManagedServerOperationParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "family": + err = unpopulate(val, "Family", &u.Family) + delete(rawMsg, key) + case "storageSizeInGB": + err = unpopulate(val, "StorageSizeInGB", &u.StorageSizeInGB) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &u.Tier) + delete(rawMsg, key) + case "vCores": + err = unpopulate(val, "VCores", &u.VCores) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpsertManagedServerOperationStep. +func (u UpsertManagedServerOperationStep) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", u.Name) + populate(objectMap, "order", u.Order) + populate(objectMap, "status", u.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpsertManagedServerOperationStep. +func (u *UpsertManagedServerOperationStep) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "order": + err = unpopulate(val, "Order", &u.Order) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &u.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Usage. +func (u Usage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "currentValue", u.CurrentValue) + populate(objectMap, "id", u.ID) + populate(objectMap, "limit", u.Limit) + populate(objectMap, "name", u.Name) + populate(objectMap, "requestedLimit", u.RequestedLimit) + populate(objectMap, "type", u.Type) + populate(objectMap, "unit", u.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Usage. +func (u *Usage) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentValue": + err = unpopulate(val, "CurrentValue", &u.CurrentValue) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &u.ID) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &u.Limit) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "requestedLimit": + err = unpopulate(val, "RequestedLimit", &u.RequestedLimit) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &u.Type) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &u.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UsageListResult. +func (u UsageListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", u.NextLink) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UsageListResult. +func (u *UsageListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &u.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &u.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserIdentity. +func (u UserIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserIdentity. +func (u *UserIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualCluster. +func (v VirtualCluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", v.ID) + populate(objectMap, "location", v.Location) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualCluster. +func (v *VirtualCluster) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualClusterListResult. +func (v VirtualClusterListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualClusterListResult. +func (v *VirtualClusterListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualClusterProperties. +func (v VirtualClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "childResources", v.ChildResources) + populate(objectMap, "family", v.Family) + populate(objectMap, "maintenanceConfigurationId", v.MaintenanceConfigurationID) + populate(objectMap, "subnetId", v.SubnetID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualClusterProperties. +func (v *VirtualClusterProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "childResources": + err = unpopulate(val, "ChildResources", &v.ChildResources) + delete(rawMsg, key) + case "family": + err = unpopulate(val, "Family", &v.Family) + delete(rawMsg, key) + case "maintenanceConfigurationId": + err = unpopulate(val, "MaintenanceConfigurationID", &v.MaintenanceConfigurationID) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &v.SubnetID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualClusterUpdate. +func (v VirtualClusterUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualClusterUpdate. +func (v *VirtualClusterUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRule. +func (v VirtualNetworkRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRule. +func (v *VirtualNetworkRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRuleListResult. +func (v VirtualNetworkRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRuleListResult. +func (v *VirtualNetworkRuleListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRuleProperties. +func (v VirtualNetworkRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ignoreMissingVnetServiceEndpoint", v.IgnoreMissingVnetServiceEndpoint) + populate(objectMap, "state", v.State) + populate(objectMap, "virtualNetworkSubnetId", v.VirtualNetworkSubnetID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRuleProperties. +func (v *VirtualNetworkRuleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ignoreMissingVnetServiceEndpoint": + err = unpopulate(val, "IgnoreMissingVnetServiceEndpoint", &v.IgnoreMissingVnetServiceEndpoint) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &v.State) + delete(rawMsg, key) + case "virtualNetworkSubnetId": + err = unpopulate(val, "VirtualNetworkSubnetID", &v.VirtualNetworkSubnetID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentRecurringScansProperties. +func (v VulnerabilityAssessmentRecurringScansProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "emailSubscriptionAdmins", v.EmailSubscriptionAdmins) + populate(objectMap, "emails", v.Emails) + populate(objectMap, "isEnabled", v.IsEnabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentRecurringScansProperties. +func (v *VulnerabilityAssessmentRecurringScansProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "emailSubscriptionAdmins": + err = unpopulate(val, "EmailSubscriptionAdmins", &v.EmailSubscriptionAdmins) + delete(rawMsg, key) + case "emails": + err = unpopulate(val, "Emails", &v.Emails) + delete(rawMsg, key) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &v.IsEnabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanError. +func (v VulnerabilityAssessmentScanError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", v.Code) + populate(objectMap, "message", v.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanError. +func (v *VulnerabilityAssessmentScanError) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &v.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &v.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanRecord. +func (v VulnerabilityAssessmentScanRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanRecord. +func (v *VulnerabilityAssessmentScanRecord) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanRecordListResult. +func (v VulnerabilityAssessmentScanRecordListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanRecordListResult. +func (v *VulnerabilityAssessmentScanRecordListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanRecordProperties. +func (v VulnerabilityAssessmentScanRecordProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", v.EndTime) + populate(objectMap, "errors", v.Errors) + populate(objectMap, "numberOfFailedSecurityChecks", v.NumberOfFailedSecurityChecks) + populate(objectMap, "scanId", v.ScanID) + populateTimeRFC3339(objectMap, "startTime", v.StartTime) + populate(objectMap, "state", v.State) + populate(objectMap, "storageContainerPath", v.StorageContainerPath) + populate(objectMap, "triggerType", v.TriggerType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanRecordProperties. +func (v *VulnerabilityAssessmentScanRecordProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &v.EndTime) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &v.Errors) + delete(rawMsg, key) + case "numberOfFailedSecurityChecks": + err = unpopulate(val, "NumberOfFailedSecurityChecks", &v.NumberOfFailedSecurityChecks) + delete(rawMsg, key) + case "scanId": + err = unpopulate(val, "ScanID", &v.ScanID) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &v.StartTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &v.State) + delete(rawMsg, key) + case "storageContainerPath": + err = unpopulate(val, "StorageContainerPath", &v.StorageContainerPath) + delete(rawMsg, key) + case "triggerType": + err = unpopulate(val, "TriggerType", &v.TriggerType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkloadClassifier. +func (w WorkloadClassifier) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", w.ID) + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadClassifier. +func (w *WorkloadClassifier) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkloadClassifierListResult. +func (w WorkloadClassifierListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadClassifierListResult. +func (w *WorkloadClassifierListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkloadClassifierProperties. +func (w WorkloadClassifierProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "context", w.Context) + populate(objectMap, "endTime", w.EndTime) + populate(objectMap, "importance", w.Importance) + populate(objectMap, "label", w.Label) + populate(objectMap, "memberName", w.MemberName) + populate(objectMap, "startTime", w.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadClassifierProperties. +func (w *WorkloadClassifierProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "context": + err = unpopulate(val, "Context", &w.Context) + delete(rawMsg, key) + case "endTime": + err = unpopulate(val, "EndTime", &w.EndTime) + delete(rawMsg, key) + case "importance": + err = unpopulate(val, "Importance", &w.Importance) + delete(rawMsg, key) + case "label": + err = unpopulate(val, "Label", &w.Label) + delete(rawMsg, key) + case "memberName": + err = unpopulate(val, "MemberName", &w.MemberName) + delete(rawMsg, key) + case "startTime": + err = unpopulate(val, "StartTime", &w.StartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkloadGroup. +func (w WorkloadGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", w.ID) + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadGroup. +func (w *WorkloadGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkloadGroupListResult. +func (w WorkloadGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadGroupListResult. +func (w *WorkloadGroupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkloadGroupProperties. +func (w WorkloadGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "importance", w.Importance) + populate(objectMap, "maxResourcePercent", w.MaxResourcePercent) + populate(objectMap, "maxResourcePercentPerRequest", w.MaxResourcePercentPerRequest) + populate(objectMap, "minResourcePercent", w.MinResourcePercent) + populate(objectMap, "minResourcePercentPerRequest", w.MinResourcePercentPerRequest) + populate(objectMap, "queryExecutionTimeout", w.QueryExecutionTimeout) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadGroupProperties. +func (w *WorkloadGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "importance": + err = unpopulate(val, "Importance", &w.Importance) + delete(rawMsg, key) + case "maxResourcePercent": + err = unpopulate(val, "MaxResourcePercent", &w.MaxResourcePercent) + delete(rawMsg, key) + case "maxResourcePercentPerRequest": + err = unpopulate(val, "MaxResourcePercentPerRequest", &w.MaxResourcePercentPerRequest) + delete(rawMsg, key) + case "minResourcePercent": + err = unpopulate(val, "MinResourcePercent", &w.MinResourcePercent) + delete(rawMsg, key) + case "minResourcePercentPerRequest": + err = unpopulate(val, "MinResourcePercentPerRequest", &w.MinResourcePercentPerRequest) + delete(rawMsg, key) + case "queryExecutionTimeout": + err = unpopulate(val, "QueryExecutionTimeout", &w.QueryExecutionTimeout) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v interface{}) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_operations_client.go b/sdk/resourcemanager/sql/armsql/operations_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_operations_client.go rename to sdk/resourcemanager/sql/armsql/operations_client.go index e76ce32f519b..743a4f23346d 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_operations_client.go +++ b/sdk/resourcemanager/sql/armsql/operations_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_outboundfirewallrules_client.go b/sdk/resourcemanager/sql/armsql/outboundfirewallrules_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_outboundfirewallrules_client.go rename to sdk/resourcemanager/sql/armsql/outboundfirewallrules_client.go index 403d7696478c..c9453388ee20 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_outboundfirewallrules_client.go +++ b/sdk/resourcemanager/sql/armsql/outboundfirewallrules_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/sql/armsql/privateendpointconnections_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_privateendpointconnections_client.go rename to sdk/resourcemanager/sql/armsql/privateendpointconnections_client.go index 8debc8fe6f8e..aa6bee3f9ea8 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/sql/armsql/privateendpointconnections_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/sql/armsql/privatelinkresources_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_privatelinkresources_client.go rename to sdk/resourcemanager/sql/armsql/privatelinkresources_client.go index 4603c3d235b6..63a34aed6853 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/sql/armsql/privatelinkresources_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_recommendedsensitivitylabels_client.go b/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_recommendedsensitivitylabels_client.go rename to sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client.go index 81aa6ba05018..cd15b66fe922 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_recommendedsensitivitylabels_client.go +++ b/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_recoverabledatabases_client.go b/sdk/resourcemanager/sql/armsql/recoverabledatabases_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_recoverabledatabases_client.go rename to sdk/resourcemanager/sql/armsql/recoverabledatabases_client.go index 1449ba022497..e07486cbc06b 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_recoverabledatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/recoverabledatabases_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_recoverablemanageddatabases_client.go b/sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_recoverablemanageddatabases_client.go rename to sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client.go index 3d1469611e88..12e7a9ad202d 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_recoverablemanageddatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_replicationlinks_client.go b/sdk/resourcemanager/sql/armsql/replicationlinks_client.go similarity index 90% rename from sdk/resourcemanager/sql/armsql/zz_generated_replicationlinks_client.go rename to sdk/resourcemanager/sql/armsql/replicationlinks_client.go index 3640d9ea280e..0ec4242755d2 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_replicationlinks_client.go +++ b/sdk/resourcemanager/sql/armsql/replicationlinks_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql @@ -54,31 +55,47 @@ func NewReplicationLinksClient(subscriptionID string, credential azcore.TokenCre return client, nil } -// Delete - Deletes the replication link. +// BeginDelete - Deletes the replication link. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-02-01-preview // 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. -// options - ReplicationLinksClientDeleteOptions contains the optional parameters for the ReplicationLinksClient.Delete method. -func (client *ReplicationLinksClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientDeleteOptions) (ReplicationLinksClientDeleteResponse, error) { +// options - ReplicationLinksClientBeginDeleteOptions contains the optional parameters for the ReplicationLinksClient.BeginDelete +// method. +func (client *ReplicationLinksClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientBeginDeleteOptions) (*runtime.Poller[ReplicationLinksClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, databaseName, linkID, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ReplicationLinksClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ReplicationLinksClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Deletes the replication link. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01-preview +func (client *ReplicationLinksClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, linkID, options) if err != nil { - return ReplicationLinksClientDeleteResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return ReplicationLinksClientDeleteResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationLinksClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) } - return ReplicationLinksClientDeleteResponse{}, nil + return resp, nil } // deleteCreateRequest creates the Delete request. -func (client *ReplicationLinksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientDeleteOptions) (*policy.Request, error) { +func (client *ReplicationLinksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -105,14 +122,14 @@ func (client *ReplicationLinksClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginFailover - Fails over from the current primary server to this server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -134,7 +151,7 @@ func (client *ReplicationLinksClient) BeginFailover(ctx context.Context, resourc // Failover - Fails over from the current primary server to this server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-02-01-preview func (client *ReplicationLinksClient) failover(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientBeginFailoverOptions) (*http.Response, error) { req, err := client.failoverCreateRequest(ctx, resourceGroupName, serverName, databaseName, linkID, options) if err != nil { @@ -178,7 +195,7 @@ func (client *ReplicationLinksClient) failoverCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -186,7 +203,7 @@ func (client *ReplicationLinksClient) failoverCreateRequest(ctx context.Context, // BeginFailoverAllowDataLoss - Fails over from the current primary server to this server allowing data loss. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -208,7 +225,7 @@ func (client *ReplicationLinksClient) BeginFailoverAllowDataLoss(ctx context.Con // FailoverAllowDataLoss - Fails over from the current primary server to this server allowing data loss. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-02-01-preview func (client *ReplicationLinksClient) failoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientBeginFailoverAllowDataLossOptions) (*http.Response, error) { req, err := client.failoverAllowDataLossCreateRequest(ctx, resourceGroupName, serverName, databaseName, linkID, options) if err != nil { @@ -252,7 +269,7 @@ func (client *ReplicationLinksClient) failoverAllowDataLossCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,7 +277,7 @@ func (client *ReplicationLinksClient) failoverAllowDataLossCreateRequest(ctx con // Get - Gets a replication link. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -310,7 +327,7 @@ func (client *ReplicationLinksClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -327,7 +344,7 @@ func (client *ReplicationLinksClient) getHandleResponse(resp *http.Response) (Re // NewListByDatabasePager - Gets a list of replication links on database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -386,7 +403,7 @@ func (client *ReplicationLinksClient) listByDatabaseCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -403,7 +420,7 @@ func (client *ReplicationLinksClient) listByDatabaseHandleResponse(resp *http.Re // NewListByServerPager - Gets a list of replication links. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-02-01-preview // 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. @@ -457,7 +474,7 @@ func (client *ReplicationLinksClient) listByServerCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_response_types.go b/sdk/resourcemanager/sql/armsql/response_types.go similarity index 95% rename from sdk/resourcemanager/sql/armsql/zz_generated_response_types.go rename to sdk/resourcemanager/sql/armsql/response_types.go index 6883c0aec70e..ea8ba2034ff3 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_response_types.go +++ b/sdk/resourcemanager/sql/armsql/response_types.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql @@ -1050,6 +1051,21 @@ type ManagedBackupShortTermRetentionPoliciesClientUpdateResponse struct { ManagedBackupShortTermRetentionPolicy } +// ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse contains the response from method ManagedDatabaseAdvancedThreatProtectionSettingsClient.CreateOrUpdate. +type ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse struct { + ManagedDatabaseAdvancedThreatProtection +} + +// ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse contains the response from method ManagedDatabaseAdvancedThreatProtectionSettingsClient.Get. +type ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse struct { + ManagedDatabaseAdvancedThreatProtection +} + +// ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse contains the response from method ManagedDatabaseAdvancedThreatProtectionSettingsClient.ListByDatabase. +type ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse struct { + ManagedDatabaseAdvancedThreatProtectionListResult +} + // ManagedDatabaseColumnsClientGetResponse contains the response from method ManagedDatabaseColumnsClient.Get. type ManagedDatabaseColumnsClientGetResponse struct { DatabaseColumn @@ -1235,6 +1251,16 @@ type ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseResponse struct DatabaseVulnerabilityAssessmentListResult } +// ManagedDatabasesClientCancelMoveResponse contains the response from method ManagedDatabasesClient.CancelMove. +type ManagedDatabasesClientCancelMoveResponse struct { + // placeholder for future response values +} + +// ManagedDatabasesClientCompleteMoveResponse contains the response from method ManagedDatabasesClient.CompleteMove. +type ManagedDatabasesClientCompleteMoveResponse struct { + // placeholder for future response values +} + // ManagedDatabasesClientCompleteRestoreResponse contains the response from method ManagedDatabasesClient.CompleteRestore. type ManagedDatabasesClientCompleteRestoreResponse struct { // placeholder for future response values @@ -1265,6 +1291,11 @@ type ManagedDatabasesClientListInaccessibleByInstanceResponse struct { ManagedDatabaseListResult } +// ManagedDatabasesClientStartMoveResponse contains the response from method ManagedDatabasesClient.StartMove. +type ManagedDatabasesClientStartMoveResponse struct { + // placeholder for future response values +} + // ManagedDatabasesClientUpdateResponse contains the response from method ManagedDatabasesClient.Update. type ManagedDatabasesClientUpdateResponse struct { ManagedDatabase @@ -1290,6 +1321,21 @@ type ManagedInstanceAdministratorsClientListByInstanceResponse struct { ManagedInstanceAdministratorListResult } +// ManagedInstanceAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse contains the response from method ManagedInstanceAdvancedThreatProtectionSettingsClient.CreateOrUpdate. +type ManagedInstanceAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse struct { + ManagedInstanceAdvancedThreatProtection +} + +// ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse contains the response from method ManagedInstanceAdvancedThreatProtectionSettingsClient.Get. +type ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse struct { + ManagedInstanceAdvancedThreatProtection +} + +// ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse contains the response from method ManagedInstanceAdvancedThreatProtectionSettingsClient.ListByInstance. +type ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse struct { + ManagedInstanceAdvancedThreatProtectionListResult +} + // ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResponse contains the response from method ManagedInstanceAzureADOnlyAuthenticationsClient.CreateOrUpdate. type ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResponse struct { ManagedInstanceAzureADOnlyAuthentication @@ -1310,6 +1356,21 @@ type ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceResponse struc ManagedInstanceAzureADOnlyAuthListResult } +// ManagedInstanceDtcsClientCreateOrUpdateResponse contains the response from method ManagedInstanceDtcsClient.CreateOrUpdate. +type ManagedInstanceDtcsClientCreateOrUpdateResponse struct { + ManagedInstanceDtc +} + +// ManagedInstanceDtcsClientGetResponse contains the response from method ManagedInstanceDtcsClient.Get. +type ManagedInstanceDtcsClientGetResponse struct { + ManagedInstanceDtc +} + +// ManagedInstanceDtcsClientListByManagedInstanceResponse contains the response from method ManagedInstanceDtcsClient.ListByManagedInstance. +type ManagedInstanceDtcsClientListByManagedInstanceResponse struct { + ManagedInstanceDtcListResult +} + // ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResponse contains the response from method ManagedInstanceEncryptionProtectorsClient.CreateOrUpdate. type ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResponse struct { ManagedInstanceEncryptionProtector @@ -1503,6 +1564,31 @@ type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdat ManagedBackupShortTermRetentionPolicy } +// ManagedServerDNSAliasesClientAcquireResponse contains the response from method ManagedServerDNSAliasesClient.Acquire. +type ManagedServerDNSAliasesClientAcquireResponse struct { + ManagedServerDNSAlias +} + +// ManagedServerDNSAliasesClientCreateOrUpdateResponse contains the response from method ManagedServerDNSAliasesClient.CreateOrUpdate. +type ManagedServerDNSAliasesClientCreateOrUpdateResponse struct { + ManagedServerDNSAlias +} + +// ManagedServerDNSAliasesClientDeleteResponse contains the response from method ManagedServerDNSAliasesClient.Delete. +type ManagedServerDNSAliasesClientDeleteResponse struct { + // placeholder for future response values +} + +// ManagedServerDNSAliasesClientGetResponse contains the response from method ManagedServerDNSAliasesClient.Get. +type ManagedServerDNSAliasesClientGetResponse struct { + ManagedServerDNSAlias +} + +// ManagedServerDNSAliasesClientListByManagedInstanceResponse contains the response from method ManagedServerDNSAliasesClient.ListByManagedInstance. +type ManagedServerDNSAliasesClientListByManagedInstanceResponse struct { + ManagedServerDNSAliasListResult +} + // ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResponse contains the response from method ManagedServerSecurityAlertPoliciesClient.CreateOrUpdate. type ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResponse struct { ManagedServerSecurityAlertPolicy diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_restorabledroppeddatabases_client.go b/sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_restorabledroppeddatabases_client.go rename to sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client.go index 1cac6e80a95f..310d3ad1207e 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_restorabledroppeddatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_restorabledroppedmanageddatabases_client.go b/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_restorabledroppedmanageddatabases_client.go rename to sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client.go index a41db5c71d38..4e6508b3a81f 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_restorabledroppedmanageddatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_restorepoints_client.go b/sdk/resourcemanager/sql/armsql/restorepoints_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_restorepoints_client.go rename to sdk/resourcemanager/sql/armsql/restorepoints_client.go index f7588a46bc98..ce1f65e46155 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_restorepoints_client.go +++ b/sdk/resourcemanager/sql/armsql/restorepoints_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_sensitivitylabels_client.go b/sdk/resourcemanager/sql/armsql/sensitivitylabels_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_sensitivitylabels_client.go rename to sdk/resourcemanager/sql/armsql/sensitivitylabels_client.go index 89cd4070794a..9e4b0778709e 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_sensitivitylabels_client.go +++ b/sdk/resourcemanager/sql/armsql/sensitivitylabels_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serveradvancedthreatprotectionsettings_client.go b/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_serveradvancedthreatprotectionsettings_client.go rename to sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client.go index dabcee0d9d37..2d9eda914c8b 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serveradvancedthreatprotectionsettings_client.go +++ b/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serveradvisors_client.go b/sdk/resourcemanager/sql/armsql/serveradvisors_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_serveradvisors_client.go rename to sdk/resourcemanager/sql/armsql/serveradvisors_client.go index 98fee4654320..9fdd932503cb 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serveradvisors_client.go +++ b/sdk/resourcemanager/sql/armsql/serveradvisors_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serverautomatictuning_client.go b/sdk/resourcemanager/sql/armsql/serverautomatictuning_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_serverautomatictuning_client.go rename to sdk/resourcemanager/sql/armsql/serverautomatictuning_client.go index ed2635a63112..fdd414dd1de5 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serverautomatictuning_client.go +++ b/sdk/resourcemanager/sql/armsql/serverautomatictuning_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serverazureadadministrators_client.go b/sdk/resourcemanager/sql/armsql/serverazureadadministrators_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_serverazureadadministrators_client.go rename to sdk/resourcemanager/sql/armsql/serverazureadadministrators_client.go index 96286817c8cc..22639e1cb703 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serverazureadadministrators_client.go +++ b/sdk/resourcemanager/sql/armsql/serverazureadadministrators_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serverazureadonlyauthentications_client.go b/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_serverazureadonlyauthentications_client.go rename to sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client.go index 824cac245e18..70447ea2dc5f 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serverazureadonlyauthentications_client.go +++ b/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serverblobauditingpolicies_client.go b/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_serverblobauditingpolicies_client.go rename to sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client.go index 4bd48f75e10d..db53c0fedd76 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serverblobauditingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_servercommunicationlinks_client.go b/sdk/resourcemanager/sql/armsql/servercommunicationlinks_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_servercommunicationlinks_client.go rename to sdk/resourcemanager/sql/armsql/servercommunicationlinks_client.go index 3dcf9925eff8..f5e76e2f9c2d 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_servercommunicationlinks_client.go +++ b/sdk/resourcemanager/sql/armsql/servercommunicationlinks_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serverconnectionpolicies_client.go b/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_serverconnectionpolicies_client.go rename to sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client.go index e06d7370d999..08a74cfa9917 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serverconnectionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serverdevopsauditsettings_client.go b/sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_serverdevopsauditsettings_client.go rename to sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client.go index 14679ab5c1ac..97a1e2077cfd 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serverdevopsauditsettings_client.go +++ b/sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serverdnsaliases_client.go b/sdk/resourcemanager/sql/armsql/serverdnsaliases_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_serverdnsaliases_client.go rename to sdk/resourcemanager/sql/armsql/serverdnsaliases_client.go index f3dcf00df33b..4db66cecd84d 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serverdnsaliases_client.go +++ b/sdk/resourcemanager/sql/armsql/serverdnsaliases_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serverkeys_client.go b/sdk/resourcemanager/sql/armsql/serverkeys_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_serverkeys_client.go rename to sdk/resourcemanager/sql/armsql/serverkeys_client.go index 998aa822cc92..753bd48a01bb 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serverkeys_client.go +++ b/sdk/resourcemanager/sql/armsql/serverkeys_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serveroperations_client.go b/sdk/resourcemanager/sql/armsql/serveroperations_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_serveroperations_client.go rename to sdk/resourcemanager/sql/armsql/serveroperations_client.go index 776683a5df5b..e809fd8d3041 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serveroperations_client.go +++ b/sdk/resourcemanager/sql/armsql/serveroperations_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_servers_client.go b/sdk/resourcemanager/sql/armsql/servers_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_servers_client.go rename to sdk/resourcemanager/sql/armsql/servers_client.go index 1b70e7b73852..3325c6ba1bba 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_servers_client.go +++ b/sdk/resourcemanager/sql/armsql/servers_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serversecurityalertpolicies_client.go b/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_serversecurityalertpolicies_client.go rename to sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client.go index 2912e4605d90..d48f5d0ad1cd 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serversecurityalertpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_servertrustcertificates_client.go b/sdk/resourcemanager/sql/armsql/servertrustcertificates_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_servertrustcertificates_client.go rename to sdk/resourcemanager/sql/armsql/servertrustcertificates_client.go index 9153eb0f3055..e257001cee92 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_servertrustcertificates_client.go +++ b/sdk/resourcemanager/sql/armsql/servertrustcertificates_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_servertrustgroups_client.go b/sdk/resourcemanager/sql/armsql/servertrustgroups_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_servertrustgroups_client.go rename to sdk/resourcemanager/sql/armsql/servertrustgroups_client.go index 39c7c2c6454b..45a29c0333cf 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_servertrustgroups_client.go +++ b/sdk/resourcemanager/sql/armsql/servertrustgroups_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serverusages_client.go b/sdk/resourcemanager/sql/armsql/serverusages_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_serverusages_client.go rename to sdk/resourcemanager/sql/armsql/serverusages_client.go index 603f31f793ba..9dbfefc3da40 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serverusages_client.go +++ b/sdk/resourcemanager/sql/armsql/serverusages_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_servervulnerabilityassessments_client.go b/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_servervulnerabilityassessments_client.go rename to sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client.go index 3762ba82a253..d1cb9d23f102 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_servervulnerabilityassessments_client.go +++ b/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serviceobjectives_client.go b/sdk/resourcemanager/sql/armsql/serviceobjectives_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_serviceobjectives_client.go rename to sdk/resourcemanager/sql/armsql/serviceobjectives_client.go index 90a95399985c..e1fcde77fb49 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serviceobjectives_client.go +++ b/sdk/resourcemanager/sql/armsql/serviceobjectives_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_subscriptionusages_client.go b/sdk/resourcemanager/sql/armsql/subscriptionusages_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_subscriptionusages_client.go rename to sdk/resourcemanager/sql/armsql/subscriptionusages_client.go index 1f44a0fde4f6..a5bb53300c0f 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_subscriptionusages_client.go +++ b/sdk/resourcemanager/sql/armsql/subscriptionusages_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_syncagents_client.go b/sdk/resourcemanager/sql/armsql/syncagents_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_syncagents_client.go rename to sdk/resourcemanager/sql/armsql/syncagents_client.go index 8bbfef21bfbb..1b2a13550d4c 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_syncagents_client.go +++ b/sdk/resourcemanager/sql/armsql/syncagents_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_syncgroups_client.go b/sdk/resourcemanager/sql/armsql/syncgroups_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_syncgroups_client.go rename to sdk/resourcemanager/sql/armsql/syncgroups_client.go index 5cc02d7a0a08..9df1eb44e1ad 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_syncgroups_client.go +++ b/sdk/resourcemanager/sql/armsql/syncgroups_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_syncmembers_client.go b/sdk/resourcemanager/sql/armsql/syncmembers_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_syncmembers_client.go rename to sdk/resourcemanager/sql/armsql/syncmembers_client.go index 046f844cd55c..112d4b307c2b 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_syncmembers_client.go +++ b/sdk/resourcemanager/sql/armsql/syncmembers_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_tdecertificates_client.go b/sdk/resourcemanager/sql/armsql/tdecertificates_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_tdecertificates_client.go rename to sdk/resourcemanager/sql/armsql/tdecertificates_client.go index b23c1e2f8757..c854c2359659 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_tdecertificates_client.go +++ b/sdk/resourcemanager/sql/armsql/tdecertificates_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_time_rfc3339.go b/sdk/resourcemanager/sql/armsql/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/sql/armsql/time_rfc3339.go index 53c1ba048ed3..9d1382cbe090 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/sql/armsql/time_rfc3339.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_timezones_client.go b/sdk/resourcemanager/sql/armsql/timezones_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_timezones_client.go rename to sdk/resourcemanager/sql/armsql/timezones_client.go index b56f1c938613..e450d97c165d 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_timezones_client.go +++ b/sdk/resourcemanager/sql/armsql/timezones_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_transparentdataencryptions_client.go b/sdk/resourcemanager/sql/armsql/transparentdataencryptions_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_transparentdataencryptions_client.go rename to sdk/resourcemanager/sql/armsql/transparentdataencryptions_client.go index 86ff8f8b762f..58841ec5b0dd 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_transparentdataencryptions_client.go +++ b/sdk/resourcemanager/sql/armsql/transparentdataencryptions_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_usages_client.go b/sdk/resourcemanager/sql/armsql/usages_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_usages_client.go rename to sdk/resourcemanager/sql/armsql/usages_client.go index 03e954d5cbb3..a6940c034c5f 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_usages_client.go +++ b/sdk/resourcemanager/sql/armsql/usages_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_virtualclusters_client.go b/sdk/resourcemanager/sql/armsql/virtualclusters_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_virtualclusters_client.go rename to sdk/resourcemanager/sql/armsql/virtualclusters_client.go index 387aed686d43..5a03213e27ec 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_virtualclusters_client.go +++ b/sdk/resourcemanager/sql/armsql/virtualclusters_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_virtualnetworkrules_client.go b/sdk/resourcemanager/sql/armsql/virtualnetworkrules_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_virtualnetworkrules_client.go rename to sdk/resourcemanager/sql/armsql/virtualnetworkrules_client.go index 975183425546..9b2b67f0473d 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_virtualnetworkrules_client.go +++ b/sdk/resourcemanager/sql/armsql/virtualnetworkrules_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_workloadclassifiers_client.go b/sdk/resourcemanager/sql/armsql/workloadclassifiers_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_workloadclassifiers_client.go rename to sdk/resourcemanager/sql/armsql/workloadclassifiers_client.go index 8c4fe8652905..1e4a18470a15 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_workloadclassifiers_client.go +++ b/sdk/resourcemanager/sql/armsql/workloadclassifiers_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_workloadgroups_client.go b/sdk/resourcemanager/sql/armsql/workloadgroups_client.go similarity index 99% rename from sdk/resourcemanager/sql/armsql/zz_generated_workloadgroups_client.go rename to sdk/resourcemanager/sql/armsql/workloadgroups_client.go index 26a3460a395c..5b2078e7d013 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_workloadgroups_client.go +++ b/sdk/resourcemanager/sql/armsql/workloadgroups_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armsql diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_backupshorttermretentionpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_backupshorttermretentionpolicies_client_test.go deleted file mode 100644 index 27efda761e19..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_backupshorttermretentionpolicies_client_test.go +++ /dev/null @@ -1,137 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetShortTermRetentionPolicy.json -func ExampleBackupShortTermRetentionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - armsql.ShortTermRetentionPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/UpdateShortTermRetentionPolicy.json -func ExampleBackupShortTermRetentionPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resourceGroup", - "testsvr", - "testdb", - armsql.ShortTermRetentionPolicyNameDefault, - armsql.BackupShortTermRetentionPolicy{ - Properties: &armsql.BackupShortTermRetentionPolicyProperties{ - DiffBackupIntervalInHours: to.Ptr(armsql.DiffBackupIntervalInHours(24)), - RetentionDays: to.Ptr[int32](7), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/UpdateShortTermRetentionPolicy.json -func ExampleBackupShortTermRetentionPoliciesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "resourceGroup", - "testsvr", - "testdb", - armsql.ShortTermRetentionPolicyNameDefault, - armsql.BackupShortTermRetentionPolicy{ - Properties: &armsql.BackupShortTermRetentionPolicyProperties{ - DiffBackupIntervalInHours: to.Ptr(armsql.DiffBackupIntervalInHours(24)), - RetentionDays: to.Ptr[int32](7), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListShortTermRetentionPoliciesByDatabase.json -func ExampleBackupShortTermRetentionPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_capabilities_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_capabilities_client_test.go deleted file mode 100644 index 2c76008cccca..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_capabilities_client_test.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LocationCapabilityListByLocation.json -func ExampleCapabilitiesClient_ListByLocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewCapabilitiesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByLocation(ctx, - "eastus", - &armsql.CapabilitiesClientListByLocationOptions{Include: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseadvancedthreatprotectionsettings_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseadvancedthreatprotectionsettings_client_test.go deleted file mode 100644 index 00f4663ad836..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseadvancedthreatprotectionsettings_client_test.go +++ /dev/null @@ -1,98 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsListByDatabase.json -func ExampleDatabaseAdvancedThreatProtectionSettingsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseAdvancedThreatProtectionSettingsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("threatprotection-6852", - "threatprotection-2080", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsGet.json -func ExampleDatabaseAdvancedThreatProtectionSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseAdvancedThreatProtectionSettingsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "threatprotection-6852", - "threatprotection-2080", - "testdb", - armsql.AdvancedThreatProtectionNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsCreateMax.json -func ExampleDatabaseAdvancedThreatProtectionSettingsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseAdvancedThreatProtectionSettingsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "threatprotection-4799", - "threatprotection-6440", - "testdb", - armsql.AdvancedThreatProtectionNameDefault, - armsql.DatabaseAdvancedThreatProtection{ - Properties: &armsql.AdvancedThreatProtectionProperties{ - State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseadvisors_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseadvisors_client_test.go deleted file mode 100644 index a22a2a31e518..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseadvisors_client_test.go +++ /dev/null @@ -1,94 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorList.json -func ExampleDatabaseAdvisorsClient_ListByDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseAdvisorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByDatabase(ctx, - "workloadinsight-demos", - "misosisvr", - "IndexAdvisor_test_3", - &armsql.DatabaseAdvisorsClientListByDatabaseOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorGet.json -func ExampleDatabaseAdvisorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseAdvisorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "workloadinsight-demos", - "misosisvr", - "IndexAdvisor_test_3", - "CreateIndex", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorUpdate.json -func ExampleDatabaseAdvisorsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseAdvisorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "workloadinsight-demos", - "misosisvr", - "IndexAdvisor_test_3", - "CreateIndex", - armsql.Advisor{ - Properties: &armsql.AdvisorProperties{ - AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseautomatictuning_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseautomatictuning_client_test.go deleted file mode 100644 index 1606b734eb4c..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseautomatictuning_client_test.go +++ /dev/null @@ -1,80 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningGet.json -func ExampleDatabaseAutomaticTuningClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseAutomaticTuningClient("c3aa9078-0000-0000-0000-e36f151182d7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "default-sql-onebox", - "testsvr11", - "db1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningUpdateMax.json -func ExampleDatabaseAutomaticTuningClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseAutomaticTuningClient("c3aa9078-0000-0000-0000-e36f151182d7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "default-sql-onebox", - "testsvr11", - "db1", - armsql.DatabaseAutomaticTuning{ - Properties: &armsql.DatabaseAutomaticTuningProperties{ - DesiredState: to.Ptr(armsql.AutomaticTuningModeAuto), - Options: map[string]*armsql.AutomaticTuningOptions{ - "createIndex": { - DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredOff), - }, - "dropIndex": { - DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredOn), - }, - "forceLastGoodPlan": { - DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - }, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseblobauditingpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseblobauditingpolicies_client_test.go deleted file mode 100644 index 06eb652de73e..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseblobauditingpolicies_client_test.go +++ /dev/null @@ -1,97 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAuditingSettingsList.json -func ExampleDatabaseBlobAuditingPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("blobauditingtest-6852", - "blobauditingtest-2080", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseBlobAuditingGet.json -func ExampleDatabaseBlobAuditingPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "blobauditingtest-6852", - "blobauditingtest-2080", - "testdb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAzureMonitorAuditingCreateMin.json -func ExampleDatabaseBlobAuditingPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "blobauditingtest-4799", - "blobauditingtest-6440", - "testdb", - armsql.DatabaseBlobAuditingPolicy{ - Properties: &armsql.DatabaseBlobAuditingPolicyProperties{ - IsAzureMonitorTargetEnabled: to.Ptr(true), - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasecolumns_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databasecolumns_client_test.go deleted file mode 100644 index 4533420193a0..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasecolumns_client_test.go +++ /dev/null @@ -1,111 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnsListByDatabaseMax.json -func ExampleDatabaseColumnsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseColumnsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("myRG", - "serverName", - "myDatabase", - &armsql.DatabaseColumnsClientListByDatabaseOptions{Schema: []string{ - "dbo"}, - Table: []string{ - "customer", - "address"}, - Column: []string{ - "username"}, - OrderBy: []string{ - "schema asc", - "table", - "column desc"}, - Skiptoken: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseColumnListByTable.json -func ExampleDatabaseColumnsClient_NewListByTablePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseColumnsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByTablePager("myRG", - "serverName", - "myDatabase", - "dbo", - "table1", - &armsql.DatabaseColumnsClientListByTableOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseColumnGet.json -func ExampleDatabaseColumnsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseColumnsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myRG", - "serverName", - "myDatabase", - "dbo", - "table1", - "column1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseextensions_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseextensions_client_test.go deleted file mode 100644 index 28ae08dec3f5..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseextensions_client_test.go +++ /dev/null @@ -1,103 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetDatabaseExtensions.json -func ExampleDatabaseExtensionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseExtensionsClient("a3473687-7581-41e1-ac24-6bcca5843f07", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Get(ctx, - "rg_a1f9d6f8-30d5-4228-9504-8a364361bca3", - "srv_65858e0f-b1d1-4bdc-8351-a7da86ca4939", - "11aa6c5e-58ed-4693-b303-3b8e3131deaa", - "polybaseimport", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CreateOrUpdateDatabaseExtensions.json -func ExampleDatabaseExtensionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseExtensionsClient("a1c0814d-3c18-4e1e-a247-c128c12b1677", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rg_20cbe0f0-c2d9-4522-9177-5469aad53029", - "srv_1ffd1cf8-9951-47fb-807d-a9c384763849", - "878e303f-1ea0-4f17-aa3d-a22ac5e9da08", - "polybaseimport", - armsql.DatabaseExtensions{ - Properties: &armsql.DatabaseExtensionsProperties{ - OperationMode: to.Ptr(armsql.OperationModePolybaseImport), - StorageKey: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - StorageKeyType: to.Ptr(armsql.StorageKeyTypeStorageAccessKey), - StorageURI: to.Ptr("https://teststorage.blob.core.windows.net/testcontainer/Manifest.xml"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListDatabaseExtensions.json -func ExampleDatabaseExtensionsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseExtensionsClient("7b2515fe-f230-4017-8cf0-695163acab85", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("rg_4007c5a9-b3b0-41e1-bd46-9eef38768a4a", - "srv_3b67ec2a-519b-43a7-8533-fb62dce3431e", - "719d8fa4-bf0f-48fc-8cd3-ef40fe6ba1fe", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseoperations_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseoperations_client_test.go deleted file mode 100644 index da7dc806a12b..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseoperations_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CancelDatabaseOperation.json -func ExampleDatabaseOperationsClient_Cancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseOperationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Cancel(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-6661", - "testdb", - "f779414b-e748-4925-8cfe-c8598f7660ae", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListDatabaseOperations.json -func ExampleDatabaseOperationsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseOperationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("sqlcrudtest-7398", - "sqlcrudtest-4645", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaserecommendedactions_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databaserecommendedactions_client_test.go deleted file mode 100644 index f427de677af0..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaserecommendedactions_client_test.go +++ /dev/null @@ -1,99 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionList.json -func ExampleDatabaseRecommendedActionsClient_ListByDatabaseAdvisor() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseRecommendedActionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByDatabaseAdvisor(ctx, - "workloadinsight-demos", - "misosisvr", - "IndexAdvisor_test_3", - "CreateIndex", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionGet.json -func ExampleDatabaseRecommendedActionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseRecommendedActionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "workloadinsight-demos", - "misosisvr", - "IndexAdvisor_test_3", - "CreateIndex", - "IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionUpdate.json -func ExampleDatabaseRecommendedActionsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseRecommendedActionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "workloadinsight-demos", - "misosisvr", - "IndexAdvisor_test_3", - "CreateIndex", - "IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB", - armsql.RecommendedAction{ - Properties: &armsql.RecommendedActionProperties{ - State: &armsql.RecommendedActionStateInfo{ - CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStatePending), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databases_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databases_client_test.go deleted file mode 100644 index 5c1de9d5bc20..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databases_client_test.go +++ /dev/null @@ -1,476 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DatabaseMetricsListWithFilter.json -func ExampleDatabasesClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricsPager("sqlcrudtest-6730", - "sqlcrudtest-9007", - "3481", - "name/value eq 'cpu_percent' and timeGrain eq '00:10:00' and startTime eq '2017-06-02T18:35:00Z' and endTime eq '2017-06-02T18:55:00Z'", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DatabaseMetricsDefinitionsList.json -func ExampleDatabasesClient_NewListMetricDefinitionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricDefinitionsPager("sqlcrudtest-6730", - "sqlcrudtest-9007", - "3481", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ListVCoreDatabasesByServer.json -func ExampleDatabasesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("Default-SQL-SouthEastAsia", - "testsvr", - &armsql.DatabasesClientListByServerOptions{SkipToken: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/GetVCoreDatabase.json -func ExampleDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/CreateVCoreDatabaseByServiceObjective.json -func ExampleDatabasesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - armsql.Database{ - Location: to.Ptr("southeastasia"), - SKU: &armsql.SKU{ - Name: to.Ptr("BC"), - Capacity: to.Ptr[int32](2), - Family: to.Ptr("Gen4"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/DeleteDatabase.json -func ExampleDatabasesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/PatchVCoreDatabaseAssignMaintenanceConfiguration.json -func ExampleDatabasesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - armsql.DatabaseUpdate{ - Properties: &armsql.DatabaseUpdateProperties{ - MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("BC_Gen5_4"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ExportDatabaseWithNetworkIsolation.json -func ExampleDatabasesClient_BeginExport() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginExport(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - armsql.ExportDatabaseDefinition{ - AdministratorLogin: to.Ptr("login"), - AdministratorLoginPassword: to.Ptr("password"), - AuthenticationType: to.Ptr("Sql"), - NetworkIsolation: &armsql.NetworkIsolationSettings{ - SQLServerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr"), - StorageAccountResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink"), - }, - StorageKey: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=="), - StorageKeyType: to.Ptr(armsql.StorageKeyTypeStorageAccessKey), - StorageURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/FailoverDatabase.json -func ExampleDatabasesClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginFailover(ctx, - "group1", - "testServer", - "testDatabase", - &armsql.DatabasesClientBeginFailoverOptions{ReplicaType: to.Ptr(armsql.ReplicaTypePrimary)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ImportDatabaseWithNetworkIsolation.json -func ExampleDatabasesClient_BeginImport() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginImport(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - armsql.ImportExistingDatabaseDefinition{ - AdministratorLogin: to.Ptr("login"), - AdministratorLoginPassword: to.Ptr("password"), - AuthenticationType: to.Ptr("Sql"), - NetworkIsolation: &armsql.NetworkIsolationSettings{ - SQLServerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr"), - StorageAccountResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink"), - }, - StorageKey: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=="), - StorageKeyType: to.Ptr(armsql.StorageKeyTypeStorageAccessKey), - StorageURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/RenameDatabase.json -func ExampleDatabasesClient_Rename() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Rename(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - armsql.ResourceMoveDefinition{ - ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/newtestdb"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/PauseDatabase.json -func ExampleDatabasesClient_BeginPause() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPause(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdwdb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResumeDatabase.json -func ExampleDatabasesClient_BeginResume() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginResume(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdwdb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/UpgradeDataWarehouse.json -func ExampleDatabasesClient_BeginUpgradeDataWarehouse() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpgradeDataWarehouse(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdwdb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ListDatabasesByElasticPool.json -func ExampleDatabasesClient_NewListByElasticPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByElasticPoolPager("Default-SQL-SouthEastAsia", - "testsvr", - "pool1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ListVCoreInaccessibleDatabasesByServer.json -func ExampleDatabasesClient_NewListInaccessibleByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListInaccessibleByServerPager("Default-SQL-SouthEastAsia", - "testsvr", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseschemas_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseschemas_client_test.go deleted file mode 100644 index b4947c660003..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseschemas_client_test.go +++ /dev/null @@ -1,68 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSchemaListByDatabase.json -func ExampleDatabaseSchemasClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseSchemasClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("myRG", - "serverName", - "myDatabase", - &armsql.DatabaseSchemasClientListByDatabaseOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSchemaGet.json -func ExampleDatabaseSchemasClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseSchemasClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myRG", - "serverName", - "myDatabase", - "dbo", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasesecurityalertpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databasesecurityalertpolicies_client_test.go deleted file mode 100644 index 32d6c65c59d9..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasesecurityalertpolicies_client_test.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertGet.json -func ExampleDatabaseSecurityAlertPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "securityalert-6852", - "securityalert-2080", - "testdb", - armsql.SecurityAlertPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertCreateMax.json -func ExampleDatabaseSecurityAlertPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "securityalert-4799", - "securityalert-6440", - "testdb", - armsql.SecurityAlertPolicyNameDefault, - armsql.DatabaseSecurityAlertPolicy{ - Properties: &armsql.SecurityAlertsPolicyProperties{ - DisabledAlerts: []*string{ - to.Ptr("Sql_Injection"), - to.Ptr("Usage_Anomaly")}, - EmailAccountAdmins: to.Ptr(true), - EmailAddresses: []*string{ - to.Ptr("test@microsoft.com"), - to.Ptr("user@microsoft.com")}, - RetentionDays: to.Ptr[int32](6), - State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertListByDatabase.json -func ExampleDatabaseSecurityAlertPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("securityalert-6852", - "securityalert-2080", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasetables_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databasetables_client_test.go deleted file mode 100644 index 7615df6cf8b3..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasetables_client_test.go +++ /dev/null @@ -1,70 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseTableListBySchema.json -func ExampleDatabaseTablesClient_NewListBySchemaPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseTablesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySchemaPager("myRG", - "serverName", - "myDatabase", - "dbo", - &armsql.DatabaseTablesClientListBySchemaOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseTableGet.json -func ExampleDatabaseTablesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseTablesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myRG", - "serverName", - "myDatabase", - "dbo", - "table1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseusages_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseusages_client_test.go deleted file mode 100644 index 4988de486d63..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseusages_client_test.go +++ /dev/null @@ -1,44 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetDatabaseUsages.json -func ExampleDatabaseUsagesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseUsagesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessmentrulebaselines_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessmentrulebaselines_client_test.go deleted file mode 100644 index ca4a361bb954..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessmentrulebaselines_client_test.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineGet.json -func ExampleDatabaseVulnerabilityAssessmentRuleBaselinesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentRuleBaselinesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "vulnerabilityaseessmenttest-4711", - "vulnerabilityaseessmenttest-6411", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "VA1001", - armsql.VulnerabilityAssessmentPolicyBaselineNameMaster, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineCreate.json -func ExampleDatabaseVulnerabilityAssessmentRuleBaselinesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentRuleBaselinesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "VA1001", - armsql.VulnerabilityAssessmentPolicyBaselineNameDefault, - armsql.DatabaseVulnerabilityAssessmentRuleBaseline{ - Properties: &armsql.DatabaseVulnerabilityAssessmentRuleBaselineProperties{ - BaselineResults: []*armsql.DatabaseVulnerabilityAssessmentRuleBaselineItem{ - { - Result: []*string{ - to.Ptr("userA"), - to.Ptr("SELECT")}, - }, - { - Result: []*string{ - to.Ptr("userB"), - to.Ptr("SELECT")}, - }, - { - Result: []*string{ - to.Ptr("userC"), - to.Ptr("SELECT"), - to.Ptr("tableId_4")}, - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineDelete.json -func ExampleDatabaseVulnerabilityAssessmentRuleBaselinesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentRuleBaselinesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "VA1001", - armsql.VulnerabilityAssessmentPolicyBaselineNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessments_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessments_client_test.go deleted file mode 100644 index 7f86e75280e2..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessments_client_test.go +++ /dev/null @@ -1,129 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentGet.json -func ExampleDatabaseVulnerabilityAssessmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateMax.json -func ExampleDatabaseVulnerabilityAssessmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - armsql.DatabaseVulnerabilityAssessment{ - Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{ - RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - EmailSubscriptionAdmins: to.Ptr(true), - Emails: []*string{ - to.Ptr("email1@mail.com"), - to.Ptr("email2@mail.com")}, - IsEnabled: to.Ptr(true), - }, - StorageAccountAccessKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - StorageContainerPath: to.Ptr("https://myStorage.blob.core.windows.net/vulnerability-assessment/"), - StorageContainerSasKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentDelete.json -func ExampleDatabaseVulnerabilityAssessmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentListByDatabase.json -func ExampleDatabaseVulnerabilityAssessmentsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessmentscans_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessmentscans_client_test.go deleted file mode 100644 index feb50e728370..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessmentscans_client_test.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScansExecute.json -func ExampleDatabaseVulnerabilityAssessmentScansClient_BeginInitiateScan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentScansClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginInitiateScan(ctx, - "vulnerabilityassessmenttest-4711", - "vulnerabilityassessmenttest-6411", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "scan01", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json -func ExampleDatabaseVulnerabilityAssessmentScansClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentScansClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("vulnerabilityassessmenttest-4711", - "vulnerabilityassessmenttest-6411", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanRecordsGet.json -func ExampleDatabaseVulnerabilityAssessmentScansClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentScansClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "vulnerabilityassessmenttest-4711", - "vulnerabilityassessmenttest-6411", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "scan001", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanExport.json -func ExampleDatabaseVulnerabilityAssessmentScansClient_Export() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentScansClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Export(ctx, - "vulnerabilityassessmenttest-4799", - "vulnerabilityassessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "scan001", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_datamaskingpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_datamaskingpolicies_client_test.go deleted file mode 100644 index 21ea94a34fbd..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_datamaskingpolicies_client_test.go +++ /dev/null @@ -1,70 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyCreateOrUpdateMax.json -func ExampleDataMaskingPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDataMaskingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "sqlcrudtest-6852", - "sqlcrudtest-2080", - "sqlcrudtest-331", - armsql.DataMaskingPolicy{ - Properties: &armsql.DataMaskingPolicyProperties{ - DataMaskingState: to.Ptr(armsql.DataMaskingStateEnabled), - ExemptPrincipals: to.Ptr("testuser;"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyGet.json -func ExampleDataMaskingPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDataMaskingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-6852", - "sqlcrudtest-2080", - "sqlcrudtest-331", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_datamaskingrules_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_datamaskingrules_client_test.go deleted file mode 100644 index 161176297e18..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_datamaskingrules_client_test.go +++ /dev/null @@ -1,79 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateDefaultMax.json -func ExampleDataMaskingRulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDataMaskingRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "sqlcrudtest-6852", - "sqlcrudtest-2080", - "sqlcrudtest-331", - "rule1", - armsql.DataMaskingRule{ - Properties: &armsql.DataMaskingRuleProperties{ - AliasName: to.Ptr("nickname"), - ColumnName: to.Ptr("test1"), - MaskingFunction: to.Ptr(armsql.DataMaskingFunctionDefault), - RuleState: to.Ptr(armsql.DataMaskingRuleStateEnabled), - SchemaName: to.Ptr("dbo"), - TableName: to.Ptr("Table_1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleList.json -func ExampleDataMaskingRulesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDataMaskingRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("sqlcrudtest-6852", - "sqlcrudtest-2080", - "sqlcrudtest-331", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_datawarehouseuseractivities_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_datawarehouseuseractivities_client_test.go deleted file mode 100644 index e8d11ad83c3c..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_datawarehouseuseractivities_client_test.go +++ /dev/null @@ -1,68 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetDataWarehouseUserActivities.json -func ExampleDataWarehouseUserActivitiesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDataWarehouseUserActivitiesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - armsql.DataWarehouseUserActivityNameCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListDataWarehouseUserActivities.json -func ExampleDataWarehouseUserActivitiesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDataWarehouseUserActivitiesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_deletedservers_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_deletedservers_client_test.go deleted file mode 100644 index 414f8a7a4fbd..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_deletedservers_client_test.go +++ /dev/null @@ -1,114 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerListBySubscription.json -func ExampleDeletedServersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDeletedServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerGet.json -func ExampleDeletedServersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDeletedServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "japaneast", - "sqlcrudtest-d-1414", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerList.json -func ExampleDeletedServersClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDeletedServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByLocationPager("japaneast", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerRecover.json -func ExampleDeletedServersClient_BeginRecover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDeletedServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRecover(ctx, - "japaneast", - "sqlcrudtest-d-1414", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_distributedavailabilitygroups_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_distributedavailabilitygroups_client_test.go deleted file mode 100644 index 70e4229f024f..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_distributedavailabilitygroups_client_test.go +++ /dev/null @@ -1,159 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsListByInstance.json -func ExampleDistributedAvailabilityGroupsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDistributedAvailabilityGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("testrg", - "testcl", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsGet.json -func ExampleDistributedAvailabilityGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDistributedAvailabilityGroupsClient("f2669dff-5f08-45dd-b857-b2a60b72cdc9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testrg", - "testcl", - "dag", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsCreate.json -func ExampleDistributedAvailabilityGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDistributedAvailabilityGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testrg", - "testcl", - "dag", - armsql.DistributedAvailabilityGroup{ - Properties: &armsql.DistributedAvailabilityGroupProperties{ - PrimaryAvailabilityGroupName: to.Ptr("BoxLocalAg1"), - SecondaryAvailabilityGroupName: to.Ptr("testcl"), - SourceEndpoint: to.Ptr("TCP://SERVER:7022"), - TargetDatabase: to.Ptr("testdb"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsDelete.json -func ExampleDistributedAvailabilityGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDistributedAvailabilityGroupsClient("f2669dff-5f08-45dd-b857-b2a60b72cdc9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testrg", - "testcl", - "dag", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsUpdate.json -func ExampleDistributedAvailabilityGroupsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDistributedAvailabilityGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "testrg", - "testcl", - "dag", - armsql.DistributedAvailabilityGroup{ - Properties: &armsql.DistributedAvailabilityGroupProperties{ - ReplicationMode: to.Ptr(armsql.ReplicationModeSync), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpoolactivities_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpoolactivities_client_test.go deleted file mode 100644 index 9f46cbd0cbc9..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpoolactivities_client_test.go +++ /dev/null @@ -1,44 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ElasticPoolActivityList.json -func ExampleElasticPoolActivitiesClient_NewListByElasticPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolActivitiesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByElasticPoolPager("sqlcrudtest-4291", - "sqlcrudtest-6574", - "8749", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpooldatabaseactivities_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpooldatabaseactivities_client_test.go deleted file mode 100644 index 2e31a34f38f9..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpooldatabaseactivities_client_test.go +++ /dev/null @@ -1,44 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ElasticPoolDatabaseActivityList.json -func ExampleElasticPoolDatabaseActivitiesClient_NewListByElasticPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolDatabaseActivitiesClient("9d4e2ad0-e20b-4464-9219-353bded52513", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByElasticPoolPager("sqlcrudtest-4673", - "sqlcrudtest-603", - "7537", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpooloperations_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpooloperations_client_test.go deleted file mode 100644 index d9e293f7fc82..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpooloperations_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelElasticPoolOperation.json -func ExampleElasticPoolOperationsClient_Cancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolOperationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Cancel(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-6661", - "testpool", - "f779414b-e748-4925-8cfe-c8598f7660ae", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListElasticPoolOperations.json -func ExampleElasticPoolOperationsClient_NewListByElasticPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolOperationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByElasticPoolPager("sqlcrudtestgroup", - "sqlcrudtestserver", - "testpool", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpools_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpools_client_test.go deleted file mode 100644 index a4d5d9f21d43..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpools_client_test.go +++ /dev/null @@ -1,240 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ElasticPoolMetricsListWithFilter.json -func ExampleElasticPoolsClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricsPager("sqlcrudtest-6730", - "sqlcrudtest-9007", - "3481", - "name/value eq 'cpu_percent' and timeGrain eq '00:10:00' and startTime eq '2017-06-02T18:35:00Z' and endTime eq '2017-06-02T18:55:00Z'", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ElasticPoolMetricsDefinitionsList.json -func ExampleElasticPoolsClient_NewListMetricDefinitionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricDefinitionsPager("sqlcrudtest-6730", - "sqlcrudtest-9007", - "3481", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolListByServer.json -func ExampleElasticPoolsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("sqlcrudtest-2369", - "sqlcrudtest-8069", - &armsql.ElasticPoolsClientListByServerOptions{Skip: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/HyperscaleElasticPoolGet.json -func ExampleElasticPoolsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-2369", - "sqlcrudtest-8069", - "sqlcrudtest-8102", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/HyperscaleElasticPoolCreateOrUpdateSetHighAvailabilityReplicaCount.json -func ExampleElasticPoolsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-2369", - "sqlcrudtest-8069", - "sqlcrudtest-8102", - armsql.ElasticPool{ - Location: to.Ptr("Japan East"), - Properties: &armsql.ElasticPoolProperties{ - HighAvailabilityReplicaCount: to.Ptr[int32](2), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("HS_Gen5_4"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolDelete.json -func ExampleElasticPoolsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sqlcrudtest-3129", - "sqlcrudtest-228", - "sqlcrudtest-3851", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolUpdateAssignMaintenanceConfiguration.json -func ExampleElasticPoolsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "sqlcrudtest-2369", - "sqlcrudtest-8069", - "sqlcrudtest-8102", - armsql.ElasticPoolUpdate{ - Properties: &armsql.ElasticPoolUpdateProperties{ - MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/FailoverElasticPool.json -func ExampleElasticPoolsClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginFailover(ctx, - "group1", - "testServer", - "testElasticPool", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_encryptionprotectors_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_encryptionprotectors_client_test.go deleted file mode 100644 index 3164fc80d597..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_encryptionprotectors_client_test.go +++ /dev/null @@ -1,126 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorList.json -func ExampleEncryptionProtectorsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewEncryptionProtectorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("sqlcrudtest-7398", - "sqlcrudtest-4645", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorGet.json -func ExampleEncryptionProtectorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewEncryptionProtectorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - armsql.EncryptionProtectorNameCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorCreateOrUpdateKeyVault.json -func ExampleEncryptionProtectorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewEncryptionProtectorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - armsql.EncryptionProtectorNameCurrent, - armsql.EncryptionProtector{ - Properties: &armsql.EncryptionProtectorProperties{ - AutoRotationEnabled: to.Ptr(false), - ServerKeyName: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - ServerKeyType: to.Ptr(armsql.ServerKeyTypeAzureKeyVault), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorRevalidate.json -func ExampleEncryptionProtectorsClient_BeginRevalidate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewEncryptionProtectorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRevalidate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - armsql.EncryptionProtectorNameCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_endpointcertificates_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_endpointcertificates_client_test.go deleted file mode 100644 index 67012fef2d01..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_endpointcertificates_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/EndpointCertificatesListByInstance.json -func ExampleEndpointCertificatesClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewEndpointCertificatesClient("38e0dc56-907f-45ba-a97c-74233baad471", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("testrg", - "testcl", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/EndpointCertificatesGet.json -func ExampleEndpointCertificatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewEndpointCertificatesClient("38e0dc56-907f-45ba-a97c-74233baad471", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testrg", - "testcl", - "DATABASE_MIRRORING", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_extendeddatabaseblobauditingpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_extendeddatabaseblobauditingpolicies_client_test.go deleted file mode 100644 index 9a373079f601..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_extendeddatabaseblobauditingpolicies_client_test.go +++ /dev/null @@ -1,97 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseExtendedAuditingSettingsList.json -func ExampleExtendedDatabaseBlobAuditingPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewExtendedDatabaseBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("blobauditingtest-6852", - "blobauditingtest-2080", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseBlobAuditingGet.json -func ExampleExtendedDatabaseBlobAuditingPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewExtendedDatabaseBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "blobauditingtest-6852", - "blobauditingtest-2080", - "testdb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseAzureMonitorAuditingCreateMin.json -func ExampleExtendedDatabaseBlobAuditingPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewExtendedDatabaseBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "blobauditingtest-4799", - "blobauditingtest-6440", - "testdb", - armsql.ExtendedDatabaseBlobAuditingPolicy{ - Properties: &armsql.ExtendedDatabaseBlobAuditingPolicyProperties{ - IsAzureMonitorTargetEnabled: to.Ptr(true), - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_extendedserverblobauditingpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_extendedserverblobauditingpolicies_client_test.go deleted file mode 100644 index 614009eb4849..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_extendedserverblobauditingpolicies_client_test.go +++ /dev/null @@ -1,109 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerExtendedAuditingSettingsList.json -func ExampleExtendedServerBlobAuditingPoliciesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewExtendedServerBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("blobauditingtest-4799", - "blobauditingtest-6440", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingGet.json -func ExampleExtendedServerBlobAuditingPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewExtendedServerBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "blobauditingtest-4799", - "blobauditingtest-6440", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingCreateMax.json -func ExampleExtendedServerBlobAuditingPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewExtendedServerBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "blobauditingtest-4799", - "blobauditingtest-6440", - armsql.ExtendedServerBlobAuditingPolicy{ - Properties: &armsql.ExtendedServerBlobAuditingPolicyProperties{ - AuditActionsAndGroups: []*string{ - to.Ptr("SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP"), - to.Ptr("FAILED_DATABASE_AUTHENTICATION_GROUP"), - to.Ptr("BATCH_COMPLETED_GROUP")}, - IsAzureMonitorTargetEnabled: to.Ptr(true), - IsStorageSecondaryKeyInUse: to.Ptr(false), - PredicateExpression: to.Ptr("object_name = 'SensitiveData'"), - QueueDelayMs: to.Ptr[int32](4000), - RetentionDays: to.Ptr[int32](6), - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_failovergroups_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_failovergroups_client_test.go deleted file mode 100644 index f51d71a4f9af..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_failovergroups_client_test.go +++ /dev/null @@ -1,228 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupGet.json -func ExampleFailoverGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "failover-group-primary-server", - "failover-group-test", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupCreateOrUpdate.json -func ExampleFailoverGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default", - "failover-group-primary-server", - "failover-group-test-3", - armsql.FailoverGroup{ - Properties: &armsql.FailoverGroupProperties{ - Databases: []*string{ - to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-1"), - to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-2")}, - PartnerServers: []*armsql.PartnerInfo{ - { - ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server"), - }}, - ReadOnlyEndpoint: &armsql.FailoverGroupReadOnlyEndpoint{ - FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - }, - ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{ - FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupDelete.json -func ExampleFailoverGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default", - "failover-group-primary-server", - "failover-group-test-1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupUpdate.json -func ExampleFailoverGroupsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "Default", - "failover-group-primary-server", - "failover-group-test-1", - armsql.FailoverGroupUpdate{ - Properties: &armsql.FailoverGroupUpdateProperties{ - Databases: []*string{ - to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-1")}, - ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{ - FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](120), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupList.json -func ExampleFailoverGroupsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("Default", - "failover-group-primary-server", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupFailover.json -func ExampleFailoverGroupsClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginFailover(ctx, - "Default", - "failover-group-secondary-server", - "failover-group-test-3", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupForceFailoverAllowDataLoss.json -func ExampleFailoverGroupsClient_BeginForceFailoverAllowDataLoss() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginForceFailoverAllowDataLoss(ctx, - "Default", - "failover-group-secondary-server", - "failover-group-test-3", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_firewallrules_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_firewallrules_client_test.go deleted file mode 100644 index fa97241716a0..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_firewallrules_client_test.go +++ /dev/null @@ -1,149 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleGet.json -func ExampleFirewallRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "firewallrulecrudtest-12", - "firewallrulecrudtest-6285", - "firewallrulecrudtest-2304", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleCreate.json -func ExampleFirewallRulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "firewallrulecrudtest-12", - "firewallrulecrudtest-6285", - "firewallrulecrudtest-5370", - armsql.FirewallRule{ - Properties: &armsql.ServerFirewallRuleProperties{ - EndIPAddress: to.Ptr("0.0.0.3"), - StartIPAddress: to.Ptr("0.0.0.3"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleDelete.json -func ExampleFirewallRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "firewallrulecrudtest-9886", - "firewallrulecrudtest-2368", - "firewallrulecrudtest-7011", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleList.json -func ExampleFirewallRulesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("firewallrulecrudtest-12", - "firewallrulecrudtest-6285", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleReplace.json -func ExampleFirewallRulesClient_Replace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Replace(ctx, - "firewallrulecrudtest-12", - "firewallrulecrudtest-6285", - armsql.FirewallRuleList{ - Values: []*armsql.FirewallRule{ - { - Name: to.Ptr("firewallrulecrudtest-5370 "), - Properties: &armsql.ServerFirewallRuleProperties{ - EndIPAddress: to.Ptr("100.0.0.0"), - StartIPAddress: to.Ptr("0.0.0.0"), - }, - }}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_geobackuppolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_geobackuppolicies_client_test.go deleted file mode 100644 index 064776f4c6f1..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_geobackuppolicies_client_test.go +++ /dev/null @@ -1,98 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesCreateOrUpdate.json -func ExampleGeoBackupPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewGeoBackupPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "sqlcrudtest-4799", - "sqlcrudtest-5961", - "testdw", - armsql.GeoBackupPolicyNameDefault, - armsql.GeoBackupPolicy{ - Properties: &armsql.GeoBackupPolicyProperties{ - State: to.Ptr(armsql.GeoBackupPolicyStateEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesGet.json -func ExampleGeoBackupPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewGeoBackupPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-4799", - "sqlcrudtest-5961", - "testdw", - armsql.GeoBackupPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesList.json -func ExampleGeoBackupPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewGeoBackupPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("sqlcrudtest-4799", - "sqlcrudtest-5961", - "testdw", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_instancefailovergroups_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_instancefailovergroups_client_test.go deleted file mode 100644 index 154535b30a3e..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_instancefailovergroups_client_test.go +++ /dev/null @@ -1,193 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupGet.json -func ExampleInstanceFailoverGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstanceFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "Japan East", - "failover-group-test", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupCreateOrUpdate.json -func ExampleInstanceFailoverGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstanceFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default", - "Japan East", - "failover-group-test-3", - armsql.InstanceFailoverGroup{ - Properties: &armsql.InstanceFailoverGroupProperties{ - ManagedInstancePairs: []*armsql.ManagedInstancePairInfo{ - { - PartnerManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-secondary-mngdInstance"), - PrimaryManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-primary-mngdInstance"), - }}, - PartnerRegions: []*armsql.PartnerRegionInfo{ - { - Location: to.Ptr("Japan West"), - }}, - ReadOnlyEndpoint: &armsql.InstanceFailoverGroupReadOnlyEndpoint{ - FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - }, - ReadWriteEndpoint: &armsql.InstanceFailoverGroupReadWriteEndpoint{ - FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupDelete.json -func ExampleInstanceFailoverGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstanceFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default", - "Japan East", - "failover-group-test-1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupList.json -func ExampleInstanceFailoverGroupsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstanceFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByLocationPager("Default", - "Japan East", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupFailover.json -func ExampleInstanceFailoverGroupsClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstanceFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginFailover(ctx, - "Default", - "Japan West", - "failover-group-test-3", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupForceFailoverAllowDataLoss.json -func ExampleInstanceFailoverGroupsClient_BeginForceFailoverAllowDataLoss() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstanceFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginForceFailoverAllowDataLoss(ctx, - "Default", - "Japan West", - "failover-group-test-3", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_instancepools_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_instancepools_client_test.go deleted file mode 100644 index 92fc9b8637a1..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_instancepools_client_test.go +++ /dev/null @@ -1,186 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetInstancePool.json -func ExampleInstancePoolsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstancePoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "testIP", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateInstancePoolMax.json -func ExampleInstancePoolsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstancePoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "group1", - "testIP", - armsql.InstancePool{ - Location: to.Ptr("japaneast"), - Tags: map[string]*string{ - "a": to.Ptr("b"), - }, - Properties: &armsql.InstancePoolProperties{ - LicenseType: to.Ptr(armsql.InstancePoolLicenseTypeLicenseIncluded), - SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet1"), - VCores: to.Ptr[int32](8), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("GP_Gen5"), - Family: to.Ptr("Gen5"), - Tier: to.Ptr("GeneralPurpose"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteInstancePool.json -func ExampleInstancePoolsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstancePoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "group1", - "testIP", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PatchInstancePool.json -func ExampleInstancePoolsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstancePoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "group1", - "testIP", - armsql.InstancePoolUpdate{ - Tags: map[string]*string{ - "x": to.Ptr("y"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListInstancePoolsByResourceGroup.json -func ExampleInstancePoolsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstancePoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("group1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListInstancePoolsBySubscriptionId.json -func ExampleInstancePoolsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstancePoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_ipv6firewallrules_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_ipv6firewallrules_client_test.go deleted file mode 100644 index 472bd9e50245..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_ipv6firewallrules_client_test.go +++ /dev/null @@ -1,117 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleList.json -func ExampleIPv6FirewallRulesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewIPv6FirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("firewallrulecrudtest-12", - "firewallrulecrudtest-6285", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleGet.json -func ExampleIPv6FirewallRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewIPv6FirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "firewallrulecrudtest-12", - "firewallrulecrudtest-6285", - "firewallrulecrudtest-2304", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleCreate.json -func ExampleIPv6FirewallRulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewIPv6FirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "firewallrulecrudtest-12", - "firewallrulecrudtest-6285", - "firewallrulecrudtest-5370", - armsql.IPv6FirewallRule{ - Properties: &armsql.IPv6ServerFirewallRuleProperties{ - EndIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0003"), - StartIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0003"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleDelete.json -func ExampleIPv6FirewallRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewIPv6FirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "firewallrulecrudtest-9886", - "firewallrulecrudtest-2368", - "firewallrulecrudtest-7011", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobagents_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_jobagents_client_test.go deleted file mode 100644 index 6b5c5290e4f3..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobagents_client_test.go +++ /dev/null @@ -1,157 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobAgentsByServer.json -func ExampleJobAgentsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("group1", - "server1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobAgent.json -func ExampleJobAgentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "server1", - "agent1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobAgent.json -func ExampleJobAgentsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "group1", - "server1", - "agent1", - armsql.JobAgent{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.JobAgentProperties{ - DatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobAgent.json -func ExampleJobAgentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "group1", - "server1", - "agent1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateJobAgent.json -func ExampleJobAgentsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "group1", - "server1", - "agent1", - armsql.JobAgentUpdate{ - Tags: map[string]*string{ - "mytag1": to.Ptr("myvalue1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobcredentials_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_jobcredentials_client_test.go deleted file mode 100644 index a7b72a6a7a5c..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobcredentials_client_test.go +++ /dev/null @@ -1,121 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobCredentialsByAgent.json -func ExampleJobCredentialsClient_NewListByAgentPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobCredentialsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAgentPager("group1", - "server1", - "agent1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobCredential.json -func ExampleJobCredentialsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobCredentialsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "server1", - "agent1", - "cred1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobCredential.json -func ExampleJobCredentialsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobCredentialsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "group1", - "server1", - "agent1", - "cred1", - armsql.JobCredential{ - Properties: &armsql.JobCredentialProperties{ - Password: to.Ptr(""), - Username: to.Ptr("myuser"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobCredential.json -func ExampleJobCredentialsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobCredentialsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "group1", - "server1", - "agent1", - "cred1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobexecutions_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_jobexecutions_client_test.go deleted file mode 100644 index 3eaea9f7640c..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobexecutions_client_test.go +++ /dev/null @@ -1,194 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByAgentWithFilter.json -func ExampleJobExecutionsClient_NewListByAgentPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAgentPager("group1", - "server1", - "agent1", - &armsql.JobExecutionsClientListByAgentOptions{CreateTimeMin: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:00:00Z"); return t }()), - CreateTimeMax: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:05:00Z"); return t }()), - EndTimeMin: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:20:00Z"); return t }()), - EndTimeMax: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:25:00Z"); return t }()), - IsActive: to.Ptr(false), - Skip: nil, - Top: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelJobExecution.json -func ExampleJobExecutionsClient_Cancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Cancel(ctx, - "group1", - "server1", - "agent1", - "job1", - "5A86BF65-43AC-F258-2524-9E92992F97CA", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateJobExecution.json -func ExampleJobExecutionsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "group1", - "server1", - "agent1", - "job1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByJob.json -func ExampleJobExecutionsClient_NewListByJobPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByJobPager("group1", - "server1", - "agent1", - "job1", - &armsql.JobExecutionsClientListByJobOptions{CreateTimeMin: nil, - CreateTimeMax: nil, - EndTimeMin: nil, - EndTimeMax: nil, - IsActive: nil, - Skip: nil, - Top: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecution.json -func ExampleJobExecutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "server1", - "agent1", - "job1", - "5A86BF65-43AC-F258-2524-9E92992F97CA", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobExecution.json -func ExampleJobExecutionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "group1", - "server1", - "agent1", - "job1", - "5A86BF65-43AC-F258-2524-9E92992F97CA", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobs_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_jobs_client_test.go deleted file mode 100644 index eb774b46ac0d..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobs_client_test.go +++ /dev/null @@ -1,129 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobsByAgent.json -func ExampleJobsClient_NewListByAgentPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAgentPager("group1", - "server1", - "agent1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJob.json -func ExampleJobsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "server1", - "agent1", - "job1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobMax.json -func ExampleJobsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "group1", - "server1", - "agent1", - "job1", - armsql.Job{ - Properties: &armsql.JobProperties{ - Description: to.Ptr("my favourite job"), - Schedule: &armsql.JobSchedule{ - Type: to.Ptr(armsql.JobScheduleTypeRecurring), - Enabled: to.Ptr(true), - EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-24T23:59:59Z"); return t }()), - Interval: to.Ptr("PT5M"), - StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-24T18:30:01Z"); return t }()), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJob.json -func ExampleJobsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "group1", - "server1", - "agent1", - "job1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobstepexecutions_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_jobstepexecutions_client_test.go deleted file mode 100644 index b86d9d5f29d2..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobstepexecutions_client_test.go +++ /dev/null @@ -1,79 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionSteps.json -func ExampleJobStepExecutionsClient_NewListByJobExecutionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobStepExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByJobExecutionPager("group1", - "server1", - "agent1", - "job1", - "5A86BF65-43AC-F258-2524-9E92992F97CA", - &armsql.JobStepExecutionsClientListByJobExecutionOptions{CreateTimeMin: nil, - CreateTimeMax: nil, - EndTimeMin: nil, - EndTimeMax: nil, - IsActive: nil, - Skip: nil, - Top: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecutionStep.json -func ExampleJobStepExecutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobStepExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "server1", - "agent1", - "job1", - "5A86BF65-43AC-F258-2524-9E92992F97CA", - "step1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobsteps_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_jobsteps_client_test.go deleted file mode 100644 index 0e154b291172..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobsteps_client_test.go +++ /dev/null @@ -1,203 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobStepsByVersion.json -func ExampleJobStepsClient_NewListByVersionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobStepsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByVersionPager("group1", - "server1", - "agent1", - "job1", - 1, - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobStepByVersion.json -func ExampleJobStepsClient_GetByVersion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobStepsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByVersion(ctx, - "group1", - "server1", - "agent1", - "job1", - 1, - "step1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobStepsByJob.json -func ExampleJobStepsClient_NewListByJobPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobStepsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByJobPager("group1", - "server1", - "agent1", - "job1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobStepByJob.json -func ExampleJobStepsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobStepsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "server1", - "agent1", - "job1", - "step1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobStepMax.json -func ExampleJobStepsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobStepsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "group1", - "server1", - "agent1", - "job1", - "step1", - armsql.JobStep{ - Properties: &armsql.JobStepProperties{ - Action: &armsql.JobStepAction{ - Type: to.Ptr(armsql.JobStepActionTypeTSQL), - Source: to.Ptr(armsql.JobStepActionSourceInline), - Value: to.Ptr("select 2"), - }, - Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1"), - ExecutionOptions: &armsql.JobStepExecutionOptions{ - InitialRetryIntervalSeconds: to.Ptr[int32](11), - MaximumRetryIntervalSeconds: to.Ptr[int32](222), - RetryAttempts: to.Ptr[int32](42), - RetryIntervalBackoffMultiplier: to.Ptr[float32](3), - TimeoutSeconds: to.Ptr[int32](1234), - }, - Output: &armsql.JobStepOutput{ - Type: to.Ptr(armsql.JobStepOutputTypeSQLDatabase), - Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0"), - DatabaseName: to.Ptr("database3"), - ResourceGroupName: to.Ptr("group3"), - SchemaName: to.Ptr("myschema1234"), - ServerName: to.Ptr("server3"), - SubscriptionID: to.Ptr("3501b905-a848-4b5d-96e8-b253f62d735a"), - TableName: to.Ptr("mytable5678"), - }, - StepID: to.Ptr[int32](1), - TargetGroup: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobStep.json -func ExampleJobStepsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobStepsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "group1", - "server1", - "agent1", - "job1", - "step1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobtargetexecutions_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_jobtargetexecutions_client_test.go deleted file mode 100644 index a0f1641e425f..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobtargetexecutions_client_test.go +++ /dev/null @@ -1,117 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionTargetsByExecution.json -func ExampleJobTargetExecutionsClient_NewListByJobExecutionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobTargetExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByJobExecutionPager("group1", - "server1", - "agent1", - "job1", - "5A86BF65-43AC-F258-2524-9E92992F97CA", - &armsql.JobTargetExecutionsClientListByJobExecutionOptions{CreateTimeMin: nil, - CreateTimeMax: nil, - EndTimeMin: nil, - EndTimeMax: nil, - IsActive: nil, - Skip: nil, - Top: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionTargetsByStep.json -func ExampleJobTargetExecutionsClient_NewListByStepPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobTargetExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByStepPager("group1", - "server1", - "agent1", - "job1", - "5A86BF65-43AC-F258-2524-9E92992F97CA", - "step1", - &armsql.JobTargetExecutionsClientListByStepOptions{CreateTimeMin: nil, - CreateTimeMax: nil, - EndTimeMin: nil, - EndTimeMax: nil, - IsActive: nil, - Skip: nil, - Top: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecutionTarget.json -func ExampleJobTargetExecutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobTargetExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "server1", - "agent1", - "job1", - "5A86BF65-43AC-F258-2524-9E92992F97CA", - "step1", - "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobtargetgroups_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_jobtargetgroups_client_test.go deleted file mode 100644 index 1b96f037bd37..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobtargetgroups_client_test.go +++ /dev/null @@ -1,146 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobTargetGroups.json -func ExampleJobTargetGroupsClient_NewListByAgentPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobTargetGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAgentPager("group1", - "server1", - "agent1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobTargetGroup.json -func ExampleJobTargetGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobTargetGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "server1", - "agent1", - "targetGroup1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobTargetGroupMax.json -func ExampleJobTargetGroupsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobTargetGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "group1", - "server1", - "agent1", - "targetGroup1", - armsql.JobTargetGroup{ - Properties: &armsql.JobTargetGroupProperties{ - Members: []*armsql.JobTarget{ - { - Type: to.Ptr(armsql.JobTargetTypeSQLDatabase), - DatabaseName: to.Ptr("database1"), - MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeExclude), - ServerName: to.Ptr("server1"), - }, - { - Type: to.Ptr(armsql.JobTargetTypeSQLServer), - MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeInclude), - RefreshCredential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"), - ServerName: to.Ptr("server1"), - }, - { - Type: to.Ptr(armsql.JobTargetTypeSQLElasticPool), - ElasticPoolName: to.Ptr("pool1"), - MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeInclude), - RefreshCredential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"), - ServerName: to.Ptr("server2"), - }, - { - Type: to.Ptr(armsql.JobTargetTypeSQLShardMap), - MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeInclude), - RefreshCredential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"), - ServerName: to.Ptr("server3"), - ShardMapName: to.Ptr("shardMap1"), - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobTargetGroup.json -func ExampleJobTargetGroupsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobTargetGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "group1", - "server1", - "agent1", - "targetGroup1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobversions_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_jobversions_client_test.go deleted file mode 100644 index 495c5eaaf491..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobversions_client_test.go +++ /dev/null @@ -1,70 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobVersions.json -func ExampleJobVersionsClient_NewListByJobPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByJobPager("group1", - "server1", - "agent1", - "job1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobVersion.json -func ExampleJobVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "server1", - "agent1", - "job1", - 1, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_ledgerdigestuploads_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_ledgerdigestuploads_client_test.go deleted file mode 100644 index 3f3b419a09a7..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_ledgerdigestuploads_client_test.go +++ /dev/null @@ -1,130 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsGet.json -func ExampleLedgerDigestUploadsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLedgerDigestUploadsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "ledgertestrg", - "ledgertestserver", - "testdb", - armsql.LedgerDigestUploadsNameCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsEnable.json -func ExampleLedgerDigestUploadsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLedgerDigestUploadsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "ledgertestrg", - "ledgertestserver", - "testdb", - armsql.LedgerDigestUploadsNameCurrent, - armsql.LedgerDigestUploads{ - Properties: &armsql.LedgerDigestUploadsProperties{ - DigestStorageEndpoint: to.Ptr("https://MyAccount.blob.core.windows.net"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsList.json -func ExampleLedgerDigestUploadsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLedgerDigestUploadsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("ledgertestrg", - "ledgertestserver", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsDisable.json -func ExampleLedgerDigestUploadsClient_BeginDisable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLedgerDigestUploadsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDisable(ctx, - "ledgertestrg", - "ledgertestserver", - "testdb", - armsql.LedgerDigestUploadsNameCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionbackups_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionbackups_client_test.go deleted file mode 100644 index ffac0a224ebf..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionbackups_client_test.go +++ /dev/null @@ -1,429 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupCopy.json -func ExampleLongTermRetentionBackupsClient_BeginCopy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCopy(ctx, - "japaneast", - "testserver", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - armsql.CopyLongTermRetentionBackupParameters{ - Properties: &armsql.CopyLongTermRetentionBackupParametersProperties{ - TargetBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - TargetDatabaseName: to.Ptr("testDatabase2"), - TargetServerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver2"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupUpdate.json -func ExampleLongTermRetentionBackupsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "japaneast", - "testserver", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - armsql.UpdateLongTermRetentionBackupParameters{ - Properties: &armsql.UpdateLongTermRetentionBackupParametersProperties{ - RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupGet.json -func ExampleLongTermRetentionBackupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "japaneast", - "testserver", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupDelete.json -func ExampleLongTermRetentionBackupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "japaneast", - "testserver", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByDatabase.json -func ExampleLongTermRetentionBackupsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("japaneast", - "testserver", - "testDatabase", - &armsql.LongTermRetentionBackupsClientListByDatabaseOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByLocation.json -func ExampleLongTermRetentionBackupsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByLocationPager("japaneast", - &armsql.LongTermRetentionBackupsClientListByLocationOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByServer.json -func ExampleLongTermRetentionBackupsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("japaneast", - "testserver", - &armsql.LongTermRetentionBackupsClientListByServerOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupCopy.json -func ExampleLongTermRetentionBackupsClient_BeginCopyByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCopyByResourceGroup(ctx, - "testResourceGroup", - "japaneast", - "testserver", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - armsql.CopyLongTermRetentionBackupParameters{ - Properties: &armsql.CopyLongTermRetentionBackupParametersProperties{ - TargetBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - TargetDatabaseName: to.Ptr("testDatabase2"), - TargetServerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver2"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupUpdate.json -func ExampleLongTermRetentionBackupsClient_BeginUpdateByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdateByResourceGroup(ctx, - "testResourceGroup", - "japaneast", - "testserver", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - armsql.UpdateLongTermRetentionBackupParameters{ - Properties: &armsql.UpdateLongTermRetentionBackupParametersProperties{ - RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupGet.json -func ExampleLongTermRetentionBackupsClient_GetByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByResourceGroup(ctx, - "testResourceGroup", - "japaneast", - "testserver", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupDelete.json -func ExampleLongTermRetentionBackupsClient_BeginDeleteByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeleteByResourceGroup(ctx, - "testResourceGroup", - "japaneast", - "testserver", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByDatabase.json -func ExampleLongTermRetentionBackupsClient_NewListByResourceGroupDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupDatabasePager("testResourceGroup", - "japaneast", - "testserver", - "testDatabase", - &armsql.LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByLocation.json -func ExampleLongTermRetentionBackupsClient_NewListByResourceGroupLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupLocationPager("testResourceGroup", - "japaneast", - &armsql.LongTermRetentionBackupsClientListByResourceGroupLocationOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByServer.json -func ExampleLongTermRetentionBackupsClient_NewListByResourceGroupServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupServerPager("testResourceGroup", - "japaneast", - "testserver", - &armsql.LongTermRetentionBackupsClientListByResourceGroupServerOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionmanagedinstancebackups_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionmanagedinstancebackups_client_test.go deleted file mode 100644 index d9b2c957510e..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionmanagedinstancebackups_client_test.go +++ /dev/null @@ -1,290 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupGet.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "japaneast", - "testInstance", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupDelete.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "japaneast", - "testInstance", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByDatabase.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("japaneast", - "testInstance", - "testDatabase", - &armsql.LongTermRetentionManagedInstanceBackupsClientListByDatabaseOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByInstance.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("japaneast", - "testInstance", - &armsql.LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByLocation.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByLocationPager("japaneast", - &armsql.LongTermRetentionManagedInstanceBackupsClientListByLocationOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupGet.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_GetByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByResourceGroup(ctx, - "testResourceGroup", - "japaneast", - "testInstance", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupDelete.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_BeginDeleteByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeleteByResourceGroup(ctx, - "testResourceGroup", - "japaneast", - "testInstance", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByDatabase.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByResourceGroupDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupDatabasePager("testResourceGroup", - "japaneast", - "testInstance", - "testDatabase", - &armsql.LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByInstance.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByResourceGroupInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupInstancePager("testResourceGroup", - "japaneast", - "testInstance", - &armsql.LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByLocation.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByResourceGroupLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupLocationPager("testResourceGroup", - "japaneast", - &armsql.LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionpolicies_client_test.go deleted file mode 100644 index 86ebbbc4fb1b..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionpolicies_client_test.go +++ /dev/null @@ -1,105 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyGet.json -func ExampleLongTermRetentionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroup", - "testserver", - "testDatabase", - armsql.LongTermRetentionPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json -func ExampleLongTermRetentionPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resourceGroup", - "testserver", - "testDatabase", - armsql.LongTermRetentionPolicyNameDefault, - armsql.LongTermRetentionPolicy{ - Properties: &armsql.BaseLongTermRetentionPolicyProperties{ - MonthlyRetention: to.Ptr("P1Y"), - WeekOfYear: to.Ptr[int32](5), - WeeklyRetention: to.Ptr("P1M"), - YearlyRetention: to.Ptr("P5Y"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyListByDatabase.json -func ExampleLongTermRetentionPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("resourceGroup", - "testserver", - "testDatabase", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_maintenancewindowoptions_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_maintenancewindowoptions_client_test.go deleted file mode 100644 index 809911a9e3cb..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_maintenancewindowoptions_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetMaintenanceWindowOptions.json -func ExampleMaintenanceWindowOptionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewMaintenanceWindowOptionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - "current", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_maintenancewindows_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_maintenancewindows_client_test.go deleted file mode 100644 index 8d4ef52de1d3..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_maintenancewindows_client_test.go +++ /dev/null @@ -1,74 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetMaintenanceWindows.json -func ExampleMaintenanceWindowsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewMaintenanceWindowsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - "current", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateMaintenanceWindows.json -func ExampleMaintenanceWindowsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewMaintenanceWindowsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CreateOrUpdate(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdwdb", - "current", - armsql.MaintenanceWindows{ - Properties: &armsql.MaintenanceWindowsProperties{ - TimeRanges: []*armsql.MaintenanceWindowTimeRange{ - { - DayOfWeek: to.Ptr(armsql.DayOfWeekSaturday), - Duration: to.Ptr("PT60M"), - StartTime: to.Ptr("00:00:00"), - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedbackupshorttermretentionpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedbackupshorttermretentionpolicies_client_test.go deleted file mode 100644 index 0f74df9ee8c8..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedbackupshorttermretentionpolicies_client_test.go +++ /dev/null @@ -1,135 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedShortTermRetentionPolicy.json -func ExampleManagedBackupShortTermRetentionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - armsql.ManagedShortTermRetentionPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicy.json -func ExampleManagedBackupShortTermRetentionPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resourceGroup", - "testsvr", - "testdb", - armsql.ManagedShortTermRetentionPolicyNameDefault, - armsql.ManagedBackupShortTermRetentionPolicy{ - Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{ - RetentionDays: to.Ptr[int32](14), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicy.json -func ExampleManagedBackupShortTermRetentionPoliciesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "resourceGroup", - "testsvr", - "testdb", - armsql.ManagedShortTermRetentionPolicyNameDefault, - armsql.ManagedBackupShortTermRetentionPolicy{ - Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{ - RetentionDays: to.Ptr[int32](14), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetListManagedShortTermRetentionPolicy.json -func ExampleManagedBackupShortTermRetentionPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasecolumns_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasecolumns_client_test.go deleted file mode 100644 index d40d92a46bb9..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasecolumns_client_test.go +++ /dev/null @@ -1,111 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedColumnsListByDatabaseMax.json -func ExampleManagedDatabaseColumnsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseColumnsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("myRG", - "serverName", - "myDatabase", - &armsql.ManagedDatabaseColumnsClientListByDatabaseOptions{Schema: []string{ - "dbo"}, - Table: []string{ - "customer", - "address"}, - Column: []string{ - "username"}, - OrderBy: []string{ - "schema asc", - "table", - "column desc"}, - Skiptoken: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnListByTable.json -func ExampleManagedDatabaseColumnsClient_NewListByTablePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseColumnsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByTablePager("myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - "table1", - &armsql.ManagedDatabaseColumnsClientListByTableOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnGet.json -func ExampleManagedDatabaseColumnsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseColumnsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - "table1", - "column1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasequeries_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasequeries_client_test.go deleted file mode 100644 index a0a16bde27d4..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasequeries_client_test.go +++ /dev/null @@ -1,72 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryGet.json -func ExampleManagedDatabaseQueriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseQueriesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "database_1", - "42", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsList.json -func ExampleManagedDatabaseQueriesClient_NewListByQueryPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseQueriesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByQueryPager("sqlcrudtest-7398", - "sqlcrudtest-4645", - "database_1", - "42", - &armsql.ManagedDatabaseQueriesClientListByQueryOptions{StartTime: nil, - EndTime: nil, - Interval: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaserecommendedsensitivitylabels_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaserecommendedsensitivitylabels_client_test.go deleted file mode 100644 index cb64618822e5..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaserecommendedsensitivitylabels_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsRecommendedUpdate.json -func ExampleManagedDatabaseRecommendedSensitivityLabelsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseRecommendedSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - armsql.RecommendedSensitivityLabelUpdateList{ - Operations: []*armsql.RecommendedSensitivityLabelUpdate{ - { - Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column1"), - Op: to.Ptr(armsql.RecommendedSensitivityLabelUpdateKindEnable), - Table: to.Ptr("table1"), - }, - }, - { - Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column2"), - Op: to.Ptr(armsql.RecommendedSensitivityLabelUpdateKindDisable), - Table: to.Ptr("table2"), - }, - }, - { - Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("Column3"), - Op: to.Ptr(armsql.RecommendedSensitivityLabelUpdateKindDisable), - Table: to.Ptr("Table1"), - }, - }}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaserestoredetails_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaserestoredetails_client_test.go deleted file mode 100644 index 65b84b194bc5..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaserestoredetails_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRestoreDetails.json -func ExampleManagedDatabaseRestoreDetailsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseRestoreDetailsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - "testdb", - armsql.RestoreDetailsNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabases_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabases_client_test.go deleted file mode 100644 index 6eeb0a42d16f..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabases_client_test.go +++ /dev/null @@ -1,216 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseListByManagedInstance.json -func ExampleManagedDatabasesClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("Test1", - "managedInstance", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseGet.json -func ExampleManagedDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Test1", - "managedInstance", - "managedDatabase", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseCreateRestoreExternalBackup.json -func ExampleManagedDatabasesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - "managedDatabase", - armsql.ManagedDatabase{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.ManagedDatabaseProperties{ - AutoCompleteRestore: to.Ptr(true), - Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - CreateMode: to.Ptr(armsql.ManagedDatabaseCreateModeRestoreExternalBackup), - LastBackupName: to.Ptr("last_backup_name"), - StorageContainerSasToken: to.Ptr("sv=2015-12-11&sr=c&sp=rl&sig=1234"), - StorageContainerURI: to.Ptr("https://myaccountname.blob.core.windows.net/backups"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseDelete.json -func ExampleManagedDatabasesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - "testdb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseUpdateMax.json -func ExampleManagedDatabasesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - "testdb", - armsql.ManagedDatabaseUpdate{ - Tags: map[string]*string{ - "tagKey1": to.Ptr("TagValue1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseCompleteExternalRestore.json -func ExampleManagedDatabasesClient_BeginCompleteRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCompleteRestore(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - armsql.CompleteDatabaseRestoreDefinition{ - LastBackupName: to.Ptr("testdb1_log4"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InaccessibleManagedDatabaseListByManagedInstance.json -func ExampleManagedDatabasesClient_NewListInaccessibleByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListInaccessibleByInstancePager("testrg", - "testcl", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaseschemas_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaseschemas_client_test.go deleted file mode 100644 index 2059c0b9a32b..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaseschemas_client_test.go +++ /dev/null @@ -1,68 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSchemaListByDatabase.json -func ExampleManagedDatabaseSchemasClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSchemasClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("myRG", - "myManagedInstanceName", - "myDatabase", - &armsql.ManagedDatabaseSchemasClientListByDatabaseOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSchemaGet.json -func ExampleManagedDatabaseSchemasClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSchemasClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesecurityalertpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesecurityalertpolicies_client_test.go deleted file mode 100644 index 70b2d7655211..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesecurityalertpolicies_client_test.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertGet.json -func ExampleManagedDatabaseSecurityAlertPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "securityalert-6852", - "securityalert-2080", - "testdb", - armsql.SecurityAlertPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertCreateMax.json -func ExampleManagedDatabaseSecurityAlertPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "securityalert-4799", - "securityalert-6440", - "testdb", - armsql.SecurityAlertPolicyNameDefault, - armsql.ManagedDatabaseSecurityAlertPolicy{ - Properties: &armsql.SecurityAlertPolicyProperties{ - DisabledAlerts: []*string{ - to.Ptr("Sql_Injection"), - to.Ptr("Usage_Anomaly")}, - EmailAccountAdmins: to.Ptr(true), - EmailAddresses: []*string{ - to.Ptr("test@contoso.com"), - to.Ptr("user@contoso.com")}, - RetentionDays: to.Ptr[int32](6), - State: to.Ptr(armsql.SecurityAlertPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertListByDatabase.json -func ExampleManagedDatabaseSecurityAlertPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("securityalert-6852", - "securityalert-2080", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesecurityevents_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesecurityevents_client_test.go deleted file mode 100644 index 7165f705a4f0..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesecurityevents_client_test.go +++ /dev/null @@ -1,49 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityEventsGetMax.json -func ExampleManagedDatabaseSecurityEventsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSecurityEventsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("testrg", - "testcl", - "database1", - &armsql.ManagedDatabaseSecurityEventsClientListByDatabaseOptions{Filter: to.Ptr("ShowServerRecords eq true"), - Skip: to.Ptr[int32](0), - Top: to.Ptr[int32](1), - Skiptoken: to.Ptr("eyJCbG9iTmFtZURhdGVUaW1lIjoiXC9EYXRlKDE1MTIyODg4MTIwMTArMDIwMClcLyIsIkJsb2JOYW1lUm9sbG92ZXJJbmRleCI6IjAiLCJFbmREYXRlIjoiXC9EYXRlKDE1MTI0NjYyMDA1MjkpXC8iLCJJc1NraXBUb2tlblNldCI6ZmFsc2UsIklzVjJCbG9iVGltZUZvcm1hdCI6dHJ1ZSwiU2hvd1NlcnZlclJlY29yZHMiOmZhbHNlLCJTa2lwVmFsdWUiOjAsIlRha2VWYWx1ZSI6MTB9"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesensitivitylabels_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesensitivitylabels_client_test.go deleted file mode 100644 index 66d929de8db1..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesensitivitylabels_client_test.go +++ /dev/null @@ -1,276 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelGet.json -func ExampleManagedDatabaseSensitivityLabelsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - "myTable", - "myColumn", - armsql.SensitivityLabelSourceCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelCreate.json -func ExampleManagedDatabaseSensitivityLabelsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - "myTable", - "myColumn", - armsql.SensitivityLabel{ - Properties: &armsql.SensitivityLabelProperties{ - InformationType: to.Ptr("PhoneNumber"), - InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - LabelName: to.Ptr("PII"), - Rank: to.Ptr(armsql.SensitivityLabelRankHigh), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelDelete.json -func ExampleManagedDatabaseSensitivityLabelsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - "myTable", - "myColumn", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRecommendedColumnSensitivityLabelDisable.json -func ExampleManagedDatabaseSensitivityLabelsClient_DisableRecommendation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.DisableRecommendation(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - "myTable", - "myColumn", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRecommendedColumnSensitivityLabelEnable.json -func ExampleManagedDatabaseSensitivityLabelsClient_EnableRecommendation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.EnableRecommendation(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - "myTable", - "myColumn", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsListByDatabaseCurrent.json -func ExampleManagedDatabaseSensitivityLabelsClient_NewListCurrentByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListCurrentByDatabasePager("myRG", - "myManagedInstanceName", - "myDatabase", - &armsql.ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions{SkipToken: nil, - Count: nil, - Filter: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsCurrentUpdate.json -func ExampleManagedDatabaseSensitivityLabelsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - armsql.SensitivityLabelUpdateList{ - Operations: []*armsql.SensitivityLabelUpdate{ - { - Properties: &armsql.SensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column1"), - Op: to.Ptr(armsql.SensitivityLabelUpdateKindSet), - SensitivityLabel: &armsql.SensitivityLabel{ - Properties: &armsql.SensitivityLabelProperties{ - InformationType: to.Ptr("Financial"), - InformationTypeID: to.Ptr("1D3652D6-422C-4115-82F1-65DAEBC665C8"), - LabelID: to.Ptr("3A477B16-9423-432B-AA97-6069B481CEC3"), - LabelName: to.Ptr("Highly Confidential"), - }, - }, - Table: to.Ptr("table1"), - }, - }, - { - Properties: &armsql.SensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column2"), - Op: to.Ptr(armsql.SensitivityLabelUpdateKindSet), - SensitivityLabel: &armsql.SensitivityLabel{ - Properties: &armsql.SensitivityLabelProperties{ - InformationType: to.Ptr("PhoneNumber"), - InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - LabelName: to.Ptr("PII"), - }, - }, - Table: to.Ptr("table2"), - }, - }, - { - Properties: &armsql.SensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("Column3"), - Op: to.Ptr(armsql.SensitivityLabelUpdateKindRemove), - Table: to.Ptr("Table1"), - }, - }}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsListByDatabaseRecommended.json -func ExampleManagedDatabaseSensitivityLabelsClient_NewListRecommendedByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListRecommendedByDatabasePager("myRG", - "myManagedInstanceName", - "myDatabase", - &armsql.ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseOptions{SkipToken: nil, - IncludeDisabledRecommendations: nil, - Filter: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasetables_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasetables_client_test.go deleted file mode 100644 index 8bb2a6341c34..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasetables_client_test.go +++ /dev/null @@ -1,70 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseTableListBySchema.json -func ExampleManagedDatabaseTablesClient_NewListBySchemaPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseTablesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySchemaPager("myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - &armsql.ManagedDatabaseTablesClientListBySchemaOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseTableGet.json -func ExampleManagedDatabaseTablesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseTablesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - "table1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasetransparentdataencryption_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasetransparentdataencryption_client_test.go deleted file mode 100644 index 4c0b3fa42563..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasetransparentdataencryption_client_test.go +++ /dev/null @@ -1,98 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionGet.json -func ExampleManagedDatabaseTransparentDataEncryptionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseTransparentDataEncryptionClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "security-tde-resourcegroup", - "securitytde", - "testdb", - armsql.TransparentDataEncryptionNameCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionUpdate.json -func ExampleManagedDatabaseTransparentDataEncryptionClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseTransparentDataEncryptionClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "securitytde-42-rg", - "securitytde-42", - "testdb", - armsql.TransparentDataEncryptionNameCurrent, - armsql.ManagedTransparentDataEncryption{ - Properties: &armsql.ManagedTransparentDataEncryptionProperties{ - State: to.Ptr(armsql.TransparentDataEncryptionStateEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionList.json -func ExampleManagedDatabaseTransparentDataEncryptionClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseTransparentDataEncryptionClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("security-tde-resourcegroup", - "securitytde", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessmentrulebaselines_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessmentrulebaselines_client_test.go deleted file mode 100644 index 8eaa451aa4a9..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessmentrulebaselines_client_test.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineGet.json -func ExampleManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "vulnerabilityaseessmenttest-4711", - "vulnerabilityaseessmenttest-6411", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "VA1001", - armsql.VulnerabilityAssessmentPolicyBaselineNameMaster, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineCreate.json -func ExampleManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "VA1001", - armsql.VulnerabilityAssessmentPolicyBaselineNameDefault, - armsql.DatabaseVulnerabilityAssessmentRuleBaseline{ - Properties: &armsql.DatabaseVulnerabilityAssessmentRuleBaselineProperties{ - BaselineResults: []*armsql.DatabaseVulnerabilityAssessmentRuleBaselineItem{ - { - Result: []*string{ - to.Ptr("userA"), - to.Ptr("SELECT")}, - }, - { - Result: []*string{ - to.Ptr("userB"), - to.Ptr("SELECT")}, - }, - { - Result: []*string{ - to.Ptr("userC"), - to.Ptr("SELECT"), - to.Ptr("tableId_4")}, - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineDelete.json -func ExampleManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "VA1001", - armsql.VulnerabilityAssessmentPolicyBaselineNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessments_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessments_client_test.go deleted file mode 100644 index 18d269f4de41..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessments_client_test.go +++ /dev/null @@ -1,128 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentGet.json -func ExampleManagedDatabaseVulnerabilityAssessmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentCreateMax.json -func ExampleManagedDatabaseVulnerabilityAssessmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - armsql.DatabaseVulnerabilityAssessment{ - Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{ - RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - EmailSubscriptionAdmins: to.Ptr(true), - Emails: []*string{ - to.Ptr("email1@mail.com"), - to.Ptr("email2@mail.com")}, - IsEnabled: to.Ptr(true), - }, - StorageContainerPath: to.Ptr("https://myStorage.blob.core.windows.net/vulnerability-assessment/"), - StorageContainerSasKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentDelete.json -func ExampleManagedDatabaseVulnerabilityAssessmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentListByDatabase.json -func ExampleManagedDatabaseVulnerabilityAssessmentsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessmentscans_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessmentscans_client_test.go deleted file mode 100644 index a2b6a8958ea7..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessmentscans_client_test.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScansExecute.json -func ExampleManagedDatabaseVulnerabilityAssessmentScansClient_BeginInitiateScan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentScansClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginInitiateScan(ctx, - "vulnerabilityassessmenttest-4711", - "vulnerabilityassessmenttest-6411", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "scan01", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanExport.json -func ExampleManagedDatabaseVulnerabilityAssessmentScansClient_Export() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentScansClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Export(ctx, - "vulnerabilityassessmenttest-4799", - "vulnerabilityassessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "scan001", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json -func ExampleManagedDatabaseVulnerabilityAssessmentScansClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentScansClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("vulnerabilityassessmenttest-4711", - "vulnerabilityassessmenttest-6411", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanRecordsGet.json -func ExampleManagedDatabaseVulnerabilityAssessmentScansClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentScansClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "vulnerabilityassessmenttest-4711", - "vulnerabilityassessmenttest-6411", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "scan001", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceadministrators_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceadministrators_client_test.go deleted file mode 100644 index d2791389a5d7..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceadministrators_client_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorListByInstance.json -func ExampleManagedInstanceAdministratorsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceAdministratorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("Default-SQL-SouthEastAsia", - "managedInstance", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorGet.json -func ExampleManagedInstanceAdministratorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceAdministratorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - armsql.AdministratorNameActiveDirectory, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorCreate.json -func ExampleManagedInstanceAdministratorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceAdministratorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - armsql.AdministratorNameActiveDirectory, - armsql.ManagedInstanceAdministrator{ - Properties: &armsql.ManagedInstanceAdministratorProperties{ - AdministratorType: to.Ptr(armsql.ManagedInstanceAdministratorTypeActiveDirectory), - Login: to.Ptr("bob@contoso.com"), - Sid: to.Ptr("44444444-3333-2222-1111-000000000000"), - TenantID: to.Ptr("55555555-4444-3333-2222-111111111111"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorDelete.json -func ExampleManagedInstanceAdministratorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceAdministratorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - armsql.AdministratorNameActiveDirectory, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceazureadonlyauthentications_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceazureadonlyauthentications_client_test.go deleted file mode 100644 index b189add1e479..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceazureadonlyauthentications_client_test.go +++ /dev/null @@ -1,124 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthGet.json -func ExampleManagedInstanceAzureADOnlyAuthenticationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceAzureADOnlyAuthenticationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - armsql.AuthenticationNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthCreateOrUpdate.json -func ExampleManagedInstanceAzureADOnlyAuthenticationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceAzureADOnlyAuthenticationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - armsql.AuthenticationNameDefault, - armsql.ManagedInstanceAzureADOnlyAuthentication{ - Properties: &armsql.ManagedInstanceAzureADOnlyAuthProperties{ - AzureADOnlyAuthentication: to.Ptr(false), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthDelete.json -func ExampleManagedInstanceAzureADOnlyAuthenticationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceAzureADOnlyAuthenticationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - armsql.AuthenticationNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthListByInstance.json -func ExampleManagedInstanceAzureADOnlyAuthenticationsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceAzureADOnlyAuthenticationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("Default-SQL-SouthEastAsia", - "managedInstance", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceencryptionprotectors_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceencryptionprotectors_client_test.go deleted file mode 100644 index 7682fcd3257c..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceencryptionprotectors_client_test.go +++ /dev/null @@ -1,126 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorRevalidate.json -func ExampleManagedInstanceEncryptionProtectorsClient_BeginRevalidate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceEncryptionProtectorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRevalidate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - armsql.EncryptionProtectorNameCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorList.json -func ExampleManagedInstanceEncryptionProtectorsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceEncryptionProtectorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("sqlcrudtest-7398", - "sqlcrudtest-4645", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorGet.json -func ExampleManagedInstanceEncryptionProtectorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceEncryptionProtectorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - armsql.EncryptionProtectorNameCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorCreateOrUpdateKeyVault.json -func ExampleManagedInstanceEncryptionProtectorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceEncryptionProtectorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - armsql.EncryptionProtectorNameCurrent, - armsql.ManagedInstanceEncryptionProtector{ - Properties: &armsql.ManagedInstanceEncryptionProtectorProperties{ - AutoRotationEnabled: to.Ptr(false), - ServerKeyName: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - ServerKeyType: to.Ptr(armsql.ServerKeyTypeAzureKeyVault), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancekeys_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancekeys_client_test.go deleted file mode 100644 index fc784472d9ec..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancekeys_client_test.go +++ /dev/null @@ -1,125 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyList.json -func ExampleManagedInstanceKeysClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceKeysClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("sqlcrudtest-7398", - "sqlcrudtest-4645", - &armsql.ManagedInstanceKeysClientListByInstanceOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyGet.json -func ExampleManagedInstanceKeysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceKeysClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "someVault_someKey_01234567890123456789012345678901", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyCreateOrUpdate.json -func ExampleManagedInstanceKeysClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceKeysClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "someVault_someKey_01234567890123456789012345678901", - armsql.ManagedInstanceKey{ - Properties: &armsql.ManagedInstanceKeyProperties{ - ServerKeyType: to.Ptr(armsql.ServerKeyTypeAzureKeyVault), - URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyDelete.json -func ExampleManagedInstanceKeysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceKeysClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "someVault_someKey_01234567890123456789012345678901", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancelongtermretentionpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancelongtermretentionpolicies_client_test.go deleted file mode 100644 index 9f00a7f84eba..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancelongtermretentionpolicies_client_test.go +++ /dev/null @@ -1,105 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyGet.json -func ExampleManagedInstanceLongTermRetentionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceLongTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testResourceGroup", - "testInstance", - "testDatabase", - armsql.ManagedInstanceLongTermRetentionPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyCreateOrUpdate.json -func ExampleManagedInstanceLongTermRetentionPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceLongTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testResourceGroup", - "testInstance", - "testDatabase", - armsql.ManagedInstanceLongTermRetentionPolicyNameDefault, - armsql.ManagedInstanceLongTermRetentionPolicy{ - Properties: &armsql.BaseLongTermRetentionPolicyProperties{ - MonthlyRetention: to.Ptr("P1Y"), - WeekOfYear: to.Ptr[int32](5), - WeeklyRetention: to.Ptr("P1M"), - YearlyRetention: to.Ptr("P5Y"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyListByDatabase.json -func ExampleManagedInstanceLongTermRetentionPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceLongTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("testResourceGroup", - "testInstance", - "testDatabase", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceoperations_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceoperations_client_test.go deleted file mode 100644 index 22974b7d0f72..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceoperations_client_test.go +++ /dev/null @@ -1,87 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListManagedInstanceOperations.json -func ExampleManagedInstanceOperationsClient_NewListByManagedInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceOperationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByManagedInstancePager("sqlcrudtest-7398", - "sqlcrudtest-4645", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedInstanceOperation.json -func ExampleManagedInstanceOperationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceOperationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "00000000-1111-2222-3333-444444444444", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelManagedInstanceOperation.json -func ExampleManagedInstanceOperationsClient_Cancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceOperationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Cancel(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "11111111-1111-1111-1111-111111111111", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceprivateendpointconnections_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceprivateendpointconnections_client_test.go deleted file mode 100644 index f8c25add4e98..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceprivateendpointconnections_client_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionGet.json -func ExampleManagedInstancePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancePrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "test-cl", - "private-endpoint-connection-name", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionUpdate.json -func ExampleManagedInstancePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancePrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default", - "test-cl", - "private-endpoint-connection-name", - armsql.ManagedInstancePrivateEndpointConnection{ - Properties: &armsql.ManagedInstancePrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armsql.ManagedInstancePrivateLinkServiceConnectionStateProperty{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr("Approved"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionDelete.json -func ExampleManagedInstancePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancePrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default", - "test-cl", - "private-endpoint-connection-name", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionList.json -func ExampleManagedInstancePrivateEndpointConnectionsClient_NewListByManagedInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancePrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByManagedInstancePager("Default", - "test-cl", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceprivatelinkresources_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceprivatelinkresources_client_test.go deleted file mode 100644 index aa84a42f3dfd..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceprivatelinkresources_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateLinkResourcesList.json -func ExampleManagedInstancePrivateLinkResourcesClient_NewListByManagedInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancePrivateLinkResourcesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByManagedInstancePager("Default", - "test-cl", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateLinkResourcesGet.json -func ExampleManagedInstancePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancePrivateLinkResourcesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "test-cl", - "plr", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstances_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstances_client_test.go deleted file mode 100644 index 330d672246fa..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstances_client_test.go +++ /dev/null @@ -1,290 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListByInstancePool.json -func ExampleManagedInstancesClient_NewListByInstancePoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancesClient("20D7082A-0FC7-4468-82BD-542694D5042B", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePoolPager("Test1", - "pool1", - &armsql.ManagedInstancesClientListByInstancePoolOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceList.json -func ExampleManagedInstancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancesClient("20D7082A-0FC7-4468-82BD-542694D5042B", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armsql.ManagedInstancesClientListOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListByResourceGroup.json -func ExampleManagedInstancesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancesClient("20D7082A-0FC7-4468-82BD-542694D5042B", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("Test1", - &armsql.ManagedInstancesClientListByResourceGroupOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceGet.json -func ExampleManagedInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancesClient("20d7082a-0fc7-4468-82bd-542694d5042b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testrg", - "testinstance", - &armsql.ManagedInstancesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceCreateMax.json -func ExampleManagedInstancesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancesClient("20D7082A-0FC7-4468-82BD-542694D5042B", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testrg", - "testinstance", - armsql.ManagedInstance{ - Location: to.Ptr("Japan East"), - Tags: map[string]*string{ - "tagKey1": to.Ptr("TagValue1"), - }, - Properties: &armsql.ManagedInstanceProperties{ - AdministratorLogin: to.Ptr("dummylogin"), - AdministratorLoginPassword: to.Ptr("PLACEHOLDER"), - Administrators: &armsql.ManagedInstanceExternalAdministrator{ - AzureADOnlyAuthentication: to.Ptr(true), - Login: to.Ptr("bob@contoso.com"), - PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - }, - Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - DNSZonePartner: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"), - InstancePoolID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/pool1"), - LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - MinimalTLSVersion: to.Ptr("1.2"), - ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect), - PublicDataEndpointEnabled: to.Ptr(false), - RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - ServicePrincipal: &armsql.ServicePrincipal{ - Type: to.Ptr(armsql.ServicePrincipalTypeSystemAssigned), - }, - StorageSizeInGB: to.Ptr[int32](1024), - SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - TimezoneID: to.Ptr("UTC"), - VCores: to.Ptr[int32](8), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("GP_Gen5"), - Tier: to.Ptr("GeneralPurpose"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceDelete.json -func ExampleManagedInstancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancesClient("20D7082A-0FC7-4468-82BD-542694D5042B", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testrg", - "testinstance", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceRemoveMaintenanceConfiguration.json -func ExampleManagedInstancesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancesClient("20D7082A-0FC7-4468-82BD-542694D5042B", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "testrg", - "testinstance", - armsql.ManagedInstanceUpdate{ - Properties: &armsql.ManagedInstanceProperties{ - MaintenanceConfigurationID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceTopQueriesList.json -func ExampleManagedInstancesClient_NewListByManagedInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByManagedInstancePager("sqlcrudtest-7398", - "sqlcrudtest-4645", - &armsql.ManagedInstancesClientListByManagedInstanceOptions{NumberOfQueries: nil, - Databases: nil, - StartTime: nil, - EndTime: nil, - Interval: to.Ptr(armsql.QueryTimeGrainTypePT1H), - AggregationFunction: nil, - ObservationMetric: to.Ptr(armsql.MetricTypeDuration), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/FailoverManagedInstance.json -func ExampleManagedInstancesClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginFailover(ctx, - "group1", - "instanceName", - &armsql.ManagedInstancesClientBeginFailoverOptions{ReplicaType: to.Ptr(armsql.ReplicaTypePrimary)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancetdecertificates_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancetdecertificates_client_test.go deleted file mode 100644 index 60df7934964b..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancetdecertificates_client_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTdeCertificate.json -func ExampleManagedInstanceTdeCertificatesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceTdeCertificatesClient("00000000-0000-0000-0000-000000000001", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "testtdecert", - "testtdecert", - armsql.TdeCertificate{ - Properties: &armsql.TdeCertificateProperties{ - PrivateBlob: to.Ptr("MIIXXXXXXXX"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancevulnerabilityassessments_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancevulnerabilityassessments_client_test.go deleted file mode 100644 index a3f6ef2c5010..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancevulnerabilityassessments_client_test.go +++ /dev/null @@ -1,125 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentGet.json -func ExampleManagedInstanceVulnerabilityAssessmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - armsql.VulnerabilityAssessmentNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateMax.json -func ExampleManagedInstanceVulnerabilityAssessmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - armsql.VulnerabilityAssessmentNameDefault, - armsql.ManagedInstanceVulnerabilityAssessment{ - Properties: &armsql.ManagedInstanceVulnerabilityAssessmentProperties{ - RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - EmailSubscriptionAdmins: to.Ptr(true), - Emails: []*string{ - to.Ptr("email1@mail.com"), - to.Ptr("email2@mail.com")}, - IsEnabled: to.Ptr(true), - }, - StorageAccountAccessKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - StorageContainerPath: to.Ptr("https://myStorage.blob.core.windows.net/vulnerability-assessment/"), - StorageContainerSasKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentDelete.json -func ExampleManagedInstanceVulnerabilityAssessmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - armsql.VulnerabilityAssessmentNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentListByInstance.json -func ExampleManagedInstanceVulnerabilityAssessmentsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client_test.go deleted file mode 100644 index 0869f41bb170..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client_test.go +++ /dev/null @@ -1,135 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedShortTermRetentionPolicyRestorableDropped.json -func ExampleManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb,131403269876900000", - armsql.ManagedShortTermRetentionPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicyRestorableDropped.json -func ExampleManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resourceGroup", - "testsvr", - "testdb,131403269876900000", - armsql.ManagedShortTermRetentionPolicyNameDefault, - armsql.ManagedBackupShortTermRetentionPolicy{ - Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{ - RetentionDays: to.Ptr[int32](14), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicyRestorableDropped.json -func ExampleManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "resourceGroup", - "testsvr", - "testdb,131403269876900000", - armsql.ManagedShortTermRetentionPolicyNameDefault, - armsql.ManagedBackupShortTermRetentionPolicy{ - Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{ - RetentionDays: to.Ptr[int32](14), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetListManagedShortTermRetentionPolicyRestorableDropped.json -func ExampleManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient_NewListByRestorableDroppedDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByRestorableDroppedDatabasePager("Default-SQL-SouthEastAsia", - "testsvr", - "testdb,131403269876900000", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedserversecurityalertpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedserversecurityalertpolicies_client_test.go deleted file mode 100644 index ceacbed1882b..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedserversecurityalertpolicies_client_test.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertGet.json -func ExampleManagedServerSecurityAlertPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedServerSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "securityalert-4799", - "securityalert-6440", - armsql.SecurityAlertPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertCreateMax.json -func ExampleManagedServerSecurityAlertPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedServerSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "securityalert-4799", - "securityalert-6440", - armsql.SecurityAlertPolicyNameDefault, - armsql.ManagedServerSecurityAlertPolicy{ - Properties: &armsql.SecurityAlertsPolicyProperties{ - DisabledAlerts: []*string{ - to.Ptr("Access_Anomaly"), - to.Ptr("Usage_Anomaly")}, - EmailAccountAdmins: to.Ptr(true), - EmailAddresses: []*string{ - to.Ptr("testSecurityAlert@microsoft.com")}, - RetentionDays: to.Ptr[int32](5), - State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertListByInstance.json -func ExampleManagedServerSecurityAlertPoliciesClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedServerSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("securityalert-4799", - "securityalert-6440", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_outboundfirewallrules_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_outboundfirewallrules_client_test.go deleted file mode 100644 index 1b6d8f815f3e..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_outboundfirewallrules_client_test.go +++ /dev/null @@ -1,119 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleGet.json -func ExampleOutboundFirewallRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewOutboundFirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "server.database.windows.net", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleCreate.json -func ExampleOutboundFirewallRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewOutboundFirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "server.database.windows.net", - armsql.OutboundFirewallRule{}, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleDelete.json -func ExampleOutboundFirewallRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewOutboundFirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-6661", - "server.database.windows.net", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleList.json -func ExampleOutboundFirewallRulesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewOutboundFirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("sqlcrudtest-7398", - "sqlcrudtest-4645", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_privateendpointconnections_client_test.go deleted file mode 100644 index 41fa7d7d2535..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_privateendpointconnections_client_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "test-svr", - "private-endpoint-connection-name", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionUpdate.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default", - "test-svr", - "private-endpoint-connection-name", - armsql.PrivateEndpointConnection{ - Properties: &armsql.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default", - "test-svr", - "private-endpoint-connection-name", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionList.json -func ExamplePrivateEndpointConnectionsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("Default", - "test-svr", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_privatelinkresources_client_test.go deleted file mode 100644 index 6ec92d273555..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_privatelinkresources_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateLinkResourcesList.json -func ExamplePrivateLinkResourcesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewPrivateLinkResourcesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("Default", - "test-svr", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateLinkResourcesGet.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewPrivateLinkResourcesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "test-svr", - "plr", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_recommendedsensitivitylabels_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_recommendedsensitivitylabels_client_test.go deleted file mode 100644 index 36abe219822c..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_recommendedsensitivitylabels_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsRecommendedUpdate.json -func ExampleRecommendedSensitivityLabelsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRecommendedSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "myRG", - "myServer", - "myDatabase", - armsql.RecommendedSensitivityLabelUpdateList{ - Operations: []*armsql.RecommendedSensitivityLabelUpdate{ - { - Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column1"), - Op: to.Ptr(armsql.RecommendedSensitivityLabelUpdateKindEnable), - Table: to.Ptr("table1"), - }, - }, - { - Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column2"), - Op: to.Ptr(armsql.RecommendedSensitivityLabelUpdateKindEnable), - Table: to.Ptr("table2"), - }, - }, - { - Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column3"), - Op: to.Ptr(armsql.RecommendedSensitivityLabelUpdateKindDisable), - Table: to.Ptr("table1"), - }, - }}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_recoverabledatabases_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_recoverabledatabases_client_test.go deleted file mode 100644 index d46e1a3c7a84..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_recoverabledatabases_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/RecoverableDatabaseGet.json -func ExampleRecoverableDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRecoverableDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "recoverabledatabasetest-6852", - "recoverabledatabasetest-2080", - "recoverabledatabasetest-9187", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/RecoverableDatabaseList.json -func ExampleRecoverableDatabasesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRecoverableDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("recoverabledatabasetest-1234", - "recoverabledatabasetest-7177", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_recoverablemanageddatabases_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_recoverablemanageddatabases_client_test.go deleted file mode 100644 index 52873a2af9c7..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_recoverablemanageddatabases_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListRecoverableManagedDatabasesByServer.json -func ExampleRecoverableManagedDatabasesClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRecoverableManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("Test1", - "managedInstance", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetRecoverableManagedDatabase.json -func ExampleRecoverableManagedDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRecoverableManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Test1", - "managedInstance", - "testdb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_replicationlinks_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_replicationlinks_client_test.go deleted file mode 100644 index 0ce91ab01a8d..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_replicationlinks_client_test.go +++ /dev/null @@ -1,172 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ReplicationLinkListByDatabase.json -func ExampleReplicationLinksClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewReplicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("Default", - "sourcesvr", - "tetha-db", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ReplicationLinkGet.json -func ExampleReplicationLinksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewReplicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "sourcesvr", - "gamma-db", - "4891ca10-ebd0-47d7-9182-c722651780fb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ReplicationLinkDelete.json -func ExampleReplicationLinksClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewReplicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "Default", - "sourcesvr", - "gamma-db", - "4891ca10-ebd0-47d7-9182-c722651780fb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ReplicationLinkFailover.json -func ExampleReplicationLinksClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewReplicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginFailover(ctx, - "Default", - "sourcesvr", - "gamma-db", - "4891ca10-ebd0-47d7-9182-c722651780fb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ReplicationLinkFailoverAllowDataLoss.json -func ExampleReplicationLinksClient_BeginFailoverAllowDataLoss() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewReplicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginFailoverAllowDataLoss(ctx, - "Default", - "sourcesvr", - "gamma-db", - "4891ca10-ebd0-47d7-9182-c722651780fb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ReplicationLinkListByServer.json -func ExampleReplicationLinksClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewReplicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("Default", - "sourcesvr", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_restorabledroppeddatabases_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_restorabledroppeddatabases_client_test.go deleted file mode 100644 index 878858323c01..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_restorabledroppeddatabases_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ListRestorableDroppedDatabasesByServer.json -func ExampleRestorableDroppedDatabasesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRestorableDroppedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("Default-SQL-SouthEastAsia", - "testsvr", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/GetRestorableDroppedDatabase.json -func ExampleRestorableDroppedDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRestorableDroppedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb,131403269876900000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_restorabledroppedmanageddatabases_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_restorabledroppedmanageddatabases_client_test.go deleted file mode 100644 index a59f3bcc1104..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_restorabledroppedmanageddatabases_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/RestorableDroppedManagedDatabaseListByManagedInstance.json -func ExampleRestorableDroppedManagedDatabasesClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRestorableDroppedManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("Test1", - "managedInstance", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/GetRestorableDroppedManagedDatabase.json -func ExampleRestorableDroppedManagedDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRestorableDroppedManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Test1", - "managedInstance", - "testdb,131403269876900000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_restorepoints_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_restorepoints_client_test.go deleted file mode 100644 index 7156dde9ff3a..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_restorepoints_client_test.go +++ /dev/null @@ -1,121 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsListByDatabase.json -func ExampleRestorePointsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRestorePointsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("sqlcrudtest-6730", - "sqlcrudtest-9007", - "3481", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsPost.json -func ExampleRestorePointsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRestorePointsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "Default-SQL-SouthEastAsia", - "testserver", - "testDatabase", - armsql.CreateDatabaseRestorePointDefinition{ - RestorePointLabel: to.Ptr("mylabel"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsGet.json -func ExampleRestorePointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRestorePointsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testserver", - "testDatabase", - "131546477590000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsDelete.json -func ExampleRestorePointsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRestorePointsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "Default-SQL-SouthEastAsia", - "testserver", - "testDatabase", - "131546477590000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_sensitivitylabels_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_sensitivitylabels_client_test.go deleted file mode 100644 index e1f3943e82dd..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_sensitivitylabels_client_test.go +++ /dev/null @@ -1,278 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsListByDatabaseWithSourceCurrent.json -func ExampleSensitivityLabelsClient_NewListCurrentByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListCurrentByDatabasePager("myRG", - "myServer", - "myDatabase", - &armsql.SensitivityLabelsClientListCurrentByDatabaseOptions{SkipToken: nil, - Count: nil, - Filter: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsCurrentUpdate.json -func ExampleSensitivityLabelsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "myRG", - "myServer", - "myDatabase", - armsql.SensitivityLabelUpdateList{ - Operations: []*armsql.SensitivityLabelUpdate{ - { - Properties: &armsql.SensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column1"), - Op: to.Ptr(armsql.SensitivityLabelUpdateKindSet), - SensitivityLabel: &armsql.SensitivityLabel{ - Properties: &armsql.SensitivityLabelProperties{ - InformationType: to.Ptr("Financial"), - InformationTypeID: to.Ptr("1D3652D6-422C-4115-82F1-65DAEBC665C8"), - LabelID: to.Ptr("3A477B16-9423-432B-AA97-6069B481CEC3"), - LabelName: to.Ptr("Highly Confidential"), - Rank: to.Ptr(armsql.SensitivityLabelRankLow), - }, - }, - Table: to.Ptr("table1"), - }, - }, - { - Properties: &armsql.SensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column2"), - Op: to.Ptr(armsql.SensitivityLabelUpdateKindSet), - SensitivityLabel: &armsql.SensitivityLabel{ - Properties: &armsql.SensitivityLabelProperties{ - InformationType: to.Ptr("PhoneNumber"), - InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - LabelName: to.Ptr("PII"), - Rank: to.Ptr(armsql.SensitivityLabelRankCritical), - }, - }, - Table: to.Ptr("table2"), - }, - }, - { - Properties: &armsql.SensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("Column3"), - Op: to.Ptr(armsql.SensitivityLabelUpdateKindRemove), - Table: to.Ptr("Table1"), - }, - }}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsListByDatabaseWithSourceRecommended.json -func ExampleSensitivityLabelsClient_NewListRecommendedByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListRecommendedByDatabasePager("myRG", - "myServer", - "myDatabase", - &armsql.SensitivityLabelsClientListRecommendedByDatabaseOptions{SkipToken: nil, - IncludeDisabledRecommendations: nil, - Filter: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/RecommendedColumnSensitivityLabelEnable.json -func ExampleSensitivityLabelsClient_EnableRecommendation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.EnableRecommendation(ctx, - "myRG", - "myServer", - "myDatabase", - "dbo", - "myTable", - "myColumn", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/RecommendedColumnSensitivityLabelDisable.json -func ExampleSensitivityLabelsClient_DisableRecommendation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.DisableRecommendation(ctx, - "myRG", - "myServer", - "myDatabase", - "dbo", - "myTable", - "myColumn", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelGet.json -func ExampleSensitivityLabelsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myRG", - "myServer", - "myDatabase", - "dbo", - "myTable", - "myColumn", - armsql.SensitivityLabelSourceCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelCreateMax.json -func ExampleSensitivityLabelsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "myRG", - "myServer", - "myDatabase", - "dbo", - "myTable", - "myColumn", - armsql.SensitivityLabel{ - Properties: &armsql.SensitivityLabelProperties{ - InformationType: to.Ptr("PhoneNumber"), - InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - LabelName: to.Ptr("PII"), - Rank: to.Ptr(armsql.SensitivityLabelRankLow), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelDelete.json -func ExampleSensitivityLabelsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "myRG", - "myServer", - "myDatabase", - "dbo", - "myTable", - "myColumn", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serveradvancedthreatprotectionsettings_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serveradvancedthreatprotectionsettings_client_test.go deleted file mode 100644 index c36d0ed1fc8d..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serveradvancedthreatprotectionsettings_client_test.go +++ /dev/null @@ -1,99 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsListByServer.json -func ExampleServerAdvancedThreatProtectionSettingsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAdvancedThreatProtectionSettingsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("threatprotection-4799", - "threatprotection-6440", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsGet.json -func ExampleServerAdvancedThreatProtectionSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAdvancedThreatProtectionSettingsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "threatprotection-4799", - "threatprotection-6440", - armsql.AdvancedThreatProtectionNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsCreateMax.json -func ExampleServerAdvancedThreatProtectionSettingsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAdvancedThreatProtectionSettingsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "threatprotection-4799", - "threatprotection-6440", - armsql.AdvancedThreatProtectionNameDefault, - armsql.ServerAdvancedThreatProtection{ - Properties: &armsql.AdvancedThreatProtectionProperties{ - State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serveradvisors_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serveradvisors_client_test.go deleted file mode 100644 index 17ce003f2107..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serveradvisors_client_test.go +++ /dev/null @@ -1,91 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorList.json -func ExampleServerAdvisorsClient_ListByServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAdvisorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByServer(ctx, - "workloadinsight-demos", - "misosisvr", - &armsql.ServerAdvisorsClientListByServerOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorGet.json -func ExampleServerAdvisorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAdvisorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "workloadinsight-demos", - "misosisvr", - "CreateIndex", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorUpdate.json -func ExampleServerAdvisorsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAdvisorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "workloadinsight-demos", - "misosisvr", - "CreateIndex", - armsql.Advisor{ - Properties: &armsql.AdvisorProperties{ - AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverautomatictuning_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serverautomatictuning_client_test.go deleted file mode 100644 index bdd5bb530be6..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverautomatictuning_client_test.go +++ /dev/null @@ -1,78 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningGet.json -func ExampleServerAutomaticTuningClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAutomaticTuningClient("c3aa9078-0000-0000-0000-e36f151182d7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "default-sql-onebox", - "testsvr11", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningUpdateMax.json -func ExampleServerAutomaticTuningClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAutomaticTuningClient("c3aa9078-0000-0000-0000-e36f151182d7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "default-sql-onebox", - "testsvr11", - armsql.ServerAutomaticTuning{ - Properties: &armsql.AutomaticTuningServerProperties{ - DesiredState: to.Ptr(armsql.AutomaticTuningServerModeAuto), - Options: map[string]*armsql.AutomaticTuningServerOptions{ - "createIndex": { - DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredOff), - }, - "dropIndex": { - DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredOn), - }, - "forceLastGoodPlan": { - DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - }, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverazureadadministrators_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serverazureadadministrators_client_test.go deleted file mode 100644 index 3e221c21f122..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverazureadadministrators_client_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorGet.json -func ExampleServerAzureADAdministratorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAzureADAdministratorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-4799", - "sqlcrudtest-6440", - armsql.AdministratorNameActiveDirectory, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorCreateOrUpdate.json -func ExampleServerAzureADAdministratorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAzureADAdministratorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-4799", - "sqlcrudtest-6440", - armsql.AdministratorNameActiveDirectory, - armsql.ServerAzureADAdministrator{ - Properties: &armsql.AdministratorProperties{ - AdministratorType: to.Ptr(armsql.AdministratorTypeActiveDirectory), - Login: to.Ptr("bob@contoso.com"), - Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorDelete.json -func ExampleServerAzureADAdministratorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAzureADAdministratorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sqlcrudtest-4799", - "sqlcrudtest-6440", - armsql.AdministratorNameActiveDirectory, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorList.json -func ExampleServerAzureADAdministratorsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAzureADAdministratorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("sqlcrudtest-4799", - "sqlcrudtest-6440", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverazureadonlyauthentications_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serverazureadonlyauthentications_client_test.go deleted file mode 100644 index 1d1efc37f961..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverazureadonlyauthentications_client_test.go +++ /dev/null @@ -1,124 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthGet.json -func ExampleServerAzureADOnlyAuthenticationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAzureADOnlyAuthenticationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-4799", - "sqlcrudtest-6440", - armsql.AuthenticationNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthCreateOrUpdate.json -func ExampleServerAzureADOnlyAuthenticationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAzureADOnlyAuthenticationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-4799", - "sqlcrudtest-6440", - armsql.AuthenticationNameDefault, - armsql.ServerAzureADOnlyAuthentication{ - Properties: &armsql.AzureADOnlyAuthProperties{ - AzureADOnlyAuthentication: to.Ptr(false), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthDelete.json -func ExampleServerAzureADOnlyAuthenticationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAzureADOnlyAuthenticationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sqlcrudtest-4799", - "sqlcrudtest-6440", - armsql.AuthenticationNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthList.json -func ExampleServerAzureADOnlyAuthenticationsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAzureADOnlyAuthenticationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("sqlcrudtest-4799", - "sqlcrudtest-6440", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverblobauditingpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serverblobauditingpolicies_client_test.go deleted file mode 100644 index 157e298aa865..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverblobauditingpolicies_client_test.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAuditingSettingsList.json -func ExampleServerBlobAuditingPoliciesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("blobauditingtest-4799", - "blobauditingtest-6440", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingGet.json -func ExampleServerBlobAuditingPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "blobauditingtest-4799", - "blobauditingtest-6440", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingCreateMax.json -func ExampleServerBlobAuditingPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "blobauditingtest-4799", - "blobauditingtest-6440", - armsql.ServerBlobAuditingPolicy{ - Properties: &armsql.ServerBlobAuditingPolicyProperties{ - AuditActionsAndGroups: []*string{ - to.Ptr("SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP"), - to.Ptr("FAILED_DATABASE_AUTHENTICATION_GROUP"), - to.Ptr("BATCH_COMPLETED_GROUP")}, - IsAzureMonitorTargetEnabled: to.Ptr(true), - IsStorageSecondaryKeyInUse: to.Ptr(false), - QueueDelayMs: to.Ptr[int32](4000), - RetentionDays: to.Ptr[int32](6), - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_servercommunicationlinks_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_servercommunicationlinks_client_test.go deleted file mode 100644 index 5b1eec7a1c07..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_servercommunicationlinks_client_test.go +++ /dev/null @@ -1,118 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkDelete.json -func ExampleServerCommunicationLinksClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerCommunicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "link1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkGet.json -func ExampleServerCommunicationLinksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerCommunicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "link1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkCreateOrUpdate.json -func ExampleServerCommunicationLinksClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerCommunicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "link1", - armsql.ServerCommunicationLink{ - Properties: &armsql.ServerCommunicationLinkProperties{ - PartnerServer: to.Ptr("sqldcrudtest-test"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkList.json -func ExampleServerCommunicationLinksClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerCommunicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("sqlcrudtest-7398", - "sqlcrudtest-4645", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverconnectionpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serverconnectionpolicies_client_test.go deleted file mode 100644 index 2df12bf98758..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverconnectionpolicies_client_test.go +++ /dev/null @@ -1,99 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesGet.json -func ExampleServerConnectionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerConnectionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rgtest-12", - "servertest-6285", - armsql.ConnectionPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesUpdate.json -func ExampleServerConnectionPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerConnectionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testrg", - "testserver", - armsql.ConnectionPolicyNameDefault, - armsql.ServerConnectionPolicy{ - Properties: &armsql.ServerConnectionPolicyProperties{ - ConnectionType: to.Ptr(armsql.ServerConnectionTypeRedirect), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesList.json -func ExampleServerConnectionPoliciesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerConnectionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("rgtest-12", - "servertest-6285", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverdevopsauditsettings_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serverdevopsauditsettings_client_test.go deleted file mode 100644 index 8b99bd5f5ac9..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverdevopsauditsettings_client_test.go +++ /dev/null @@ -1,103 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDevOpsAuditGet.json -func ExampleServerDevOpsAuditSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerDevOpsAuditSettingsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "devAuditTestRG", - "devOpsAuditTestSvr", - "default", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDevOpsAuditCreateMax.json -func ExampleServerDevOpsAuditSettingsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerDevOpsAuditSettingsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "devAuditTestRG", - "devOpsAuditTestSvr", - "default", - armsql.ServerDevOpsAuditingSettings{ - Properties: &armsql.ServerDevOpsAuditSettingsProperties{ - IsAzureMonitorTargetEnabled: to.Ptr(true), - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDevOpsAuditSettingsList.json -func ExampleServerDevOpsAuditSettingsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerDevOpsAuditSettingsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("devAuditTestRG", - "devOpsAuditTestSvr", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverdnsaliases_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serverdnsaliases_client_test.go deleted file mode 100644 index 29d8369eb7d2..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverdnsaliases_client_test.go +++ /dev/null @@ -1,149 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasGet.json -func ExampleServerDNSAliasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerDNSAliasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "dns-alias-server", - "dns-alias-name-1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasCreateOrUpdate.json -func ExampleServerDNSAliasesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerDNSAliasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default", - "dns-alias-server", - "dns-alias-name-1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasDelete.json -func ExampleServerDNSAliasesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerDNSAliasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default", - "dns-alias-server", - "dns-alias-name-1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasList.json -func ExampleServerDNSAliasesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerDNSAliasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("Default", - "dns-alias-server", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasAcquire.json -func ExampleServerDNSAliasesClient_BeginAcquire() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerDNSAliasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginAcquire(ctx, - "Default", - "dns-alias-new-server", - "dns-alias-name-1", - armsql.ServerDNSAliasAcquisition{ - OldServerDNSAliasID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/dns-alias-old-server/dnsAliases/dns-alias-name-1"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverkeys_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serverkeys_client_test.go deleted file mode 100644 index 5da7af9019f4..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverkeys_client_test.go +++ /dev/null @@ -1,125 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyList.json -func ExampleServerKeysClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerKeysClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("sqlcrudtest-7398", - "sqlcrudtest-4645", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyGet.json -func ExampleServerKeysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerKeysClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "someVault_someKey_01234567890123456789012345678901", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyCreateOrUpdate.json -func ExampleServerKeysClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerKeysClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "someVault_someKey_01234567890123456789012345678901", - armsql.ServerKey{ - Properties: &armsql.ServerKeyProperties{ - ServerKeyType: to.Ptr(armsql.ServerKeyTypeAzureKeyVault), - URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyDelete.json -func ExampleServerKeysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerKeysClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "someVault_someKey_01234567890123456789012345678901", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serveroperations_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serveroperations_client_test.go deleted file mode 100644 index 8b355d0c0c94..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serveroperations_client_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListServerOperations.json -func ExampleServerOperationsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerOperationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("sqlcrudtest-7398", - "sqlcrudtest-4645", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_servers_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_servers_client_test.go deleted file mode 100644 index a4048f3bc346..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_servers_client_test.go +++ /dev/null @@ -1,252 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerListByResourceGroup.json -func ExampleServersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("sqlcrudtest-7398", - &armsql.ServersClientListByResourceGroupOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerGet.json -func ExampleServersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - &armsql.ServersClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerCreate.json -func ExampleServersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - armsql.Server{ - Location: to.Ptr("Japan East"), - Properties: &armsql.ServerProperties{ - AdministratorLogin: to.Ptr("dummylogin"), - AdministratorLoginPassword: to.Ptr("PLACEHOLDER"), - Administrators: &armsql.ServerExternalAdministrator{ - AzureADOnlyAuthentication: to.Ptr(true), - Login: to.Ptr("bob@contoso.com"), - PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - }, - PublicNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerDelete.json -func ExampleServersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-6661", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerUpdate.json -func ExampleServersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - armsql.ServerUpdate{ - Properties: &armsql.ServerProperties{ - AdministratorLogin: to.Ptr("dummylogin"), - AdministratorLoginPassword: to.Ptr("placeholder"), - PublicNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagDisabled), - RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerList.json -func ExampleServersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armsql.ServersClientListOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ImportNewDatabaseWithNetworkIsolation.json -func ExampleServersClient_BeginImportDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginImportDatabase(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - armsql.ImportNewDatabaseDefinition{ - AdministratorLogin: to.Ptr("login"), - AdministratorLoginPassword: to.Ptr("password"), - AuthenticationType: to.Ptr("Sql"), - DatabaseName: to.Ptr("testdb"), - NetworkIsolation: &armsql.NetworkIsolationSettings{ - SQLServerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr"), - StorageAccountResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink"), - }, - StorageKey: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=="), - StorageKeyType: to.Ptr(armsql.StorageKeyTypeStorageAccessKey), - StorageURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CheckNameAvailabilityServerAlreadyExists.json -func ExampleServersClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, - armsql.CheckNameAvailabilityRequest{ - Name: to.Ptr("server1"), - Type: to.Ptr("Microsoft.Sql/servers"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serversecurityalertpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serversecurityalertpolicies_client_test.go deleted file mode 100644 index 4cda37389802..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serversecurityalertpolicies_client_test.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsGet.json -func ExampleServerSecurityAlertPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "securityalert-4799", - "securityalert-6440", - armsql.SecurityAlertPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsCreateMax.json -func ExampleServerSecurityAlertPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "securityalert-4799", - "securityalert-6440", - armsql.SecurityAlertPolicyNameDefault, - armsql.ServerSecurityAlertPolicy{ - Properties: &armsql.SecurityAlertsPolicyProperties{ - DisabledAlerts: []*string{ - to.Ptr("Access_Anomaly"), - to.Ptr("Usage_Anomaly")}, - EmailAccountAdmins: to.Ptr(true), - EmailAddresses: []*string{ - to.Ptr("testSecurityAlert@microsoft.com")}, - RetentionDays: to.Ptr[int32](5), - State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsListByServer.json -func ExampleServerSecurityAlertPoliciesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("securityalert-4799", - "securityalert-6440", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_servertrustcertificates_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_servertrustcertificates_client_test.go deleted file mode 100644 index 783e473114c0..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_servertrustcertificates_client_test.go +++ /dev/null @@ -1,124 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesListByInstance.json -func ExampleServerTrustCertificatesClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerTrustCertificatesClient("38e0dc56-907f-45ba-a97c-74233baad471", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("testrg", - "testcl", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesGet.json -func ExampleServerTrustCertificatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerTrustCertificatesClient("38e0dc56-907f-45ba-a97c-74233baad471", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testrg", - "testcl", - "customerCertificateName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesCreate.json -func ExampleServerTrustCertificatesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerTrustCertificatesClient("0574222d-5c7f-489c-a172-b3013eafab53", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testrg", - "testcl", - "customerCertificateName", - armsql.ServerTrustCertificate{ - Properties: &armsql.ServerTrustCertificateProperties{ - PublicBlob: to.Ptr("308203AE30820296A0030201020210"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesDelete.json -func ExampleServerTrustCertificatesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerTrustCertificatesClient("38e0dc56-907f-45ba-a97c-74233baad471", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testrg", - "testcl", - "customerCertificateName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_servertrustgroups_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_servertrustgroups_client_test.go deleted file mode 100644 index 8c037bf8fe4e..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_servertrustgroups_client_test.go +++ /dev/null @@ -1,159 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupGet.json -func ExampleServerTrustGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerTrustGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "Japan East", - "server-trust-group-test", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupCreate.json -func ExampleServerTrustGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerTrustGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default", - "Japan East", - "server-trust-group-test", - armsql.ServerTrustGroup{ - Properties: &armsql.ServerTrustGroupProperties{ - GroupMembers: []*armsql.ServerInfo{ - { - ServerID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-1"), - }, - { - ServerID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-2"), - }}, - TrustScopes: []*armsql.ServerTrustGroupPropertiesTrustScopesItem{ - to.Ptr(armsql.ServerTrustGroupPropertiesTrustScopesItemGlobalTransactions), - to.Ptr(armsql.ServerTrustGroupPropertiesTrustScopesItemServiceBroker)}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupDelete.json -func ExampleServerTrustGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerTrustGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default", - "Japan East", - "server-trust-group-test", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupList.json -func ExampleServerTrustGroupsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerTrustGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByLocationPager("Default", - "Japan East", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupListByManagedInstance.json -func ExampleServerTrustGroupsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerTrustGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("Default-SQL-SouthEastAsia", - "managedInstance-1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverusages_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serverusages_client_test.go deleted file mode 100644 index 231c51c0144e..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverusages_client_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ServerUsageMetricsList.json -func ExampleServerUsagesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerUsagesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("sqlcrudtest-6730", - "sqlcrudtest-9007", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_servervulnerabilityassessments_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_servervulnerabilityassessments_client_test.go deleted file mode 100644 index 80eb58980dd9..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_servervulnerabilityassessments_client_test.go +++ /dev/null @@ -1,125 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentGet.json -func ExampleServerVulnerabilityAssessmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - armsql.VulnerabilityAssessmentNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateMax.json -func ExampleServerVulnerabilityAssessmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - armsql.VulnerabilityAssessmentNameDefault, - armsql.ServerVulnerabilityAssessment{ - Properties: &armsql.ServerVulnerabilityAssessmentProperties{ - RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - EmailSubscriptionAdmins: to.Ptr(true), - Emails: []*string{ - to.Ptr("email1@mail.com"), - to.Ptr("email2@mail.com")}, - IsEnabled: to.Ptr(true), - }, - StorageAccountAccessKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - StorageContainerPath: to.Ptr("https://myStorage.blob.core.windows.net/vulnerability-assessment/"), - StorageContainerSasKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentDelete.json -func ExampleServerVulnerabilityAssessmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - armsql.VulnerabilityAssessmentNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentListByServer.json -func ExampleServerVulnerabilityAssessmentsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serviceobjectives_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serviceobjectives_client_test.go deleted file mode 100644 index a45e66d0e42d..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serviceobjectives_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServiceObjectiveGet.json -func ExampleServiceObjectivesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServiceObjectivesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "sqlcrudtest", - "29dd7459-4a7c-4e56-be22-f0adda49440d", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServiceObjectiveList.json -func ExampleServiceObjectivesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServiceObjectivesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("group1", - "sqlcrudtest", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_sqlagent_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_sqlagent_client_test.go deleted file mode 100644 index 0b7758ad186e..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_sqlagent_client_test.go +++ /dev/null @@ -1,67 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlAgentConfigurationGet.json -func ExampleAgentClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewAgentClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlAgentConfigurationPut.json -func ExampleAgentClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewAgentClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - armsql.AgentConfiguration{ - Properties: &armsql.AgentConfigurationProperties{ - State: to.Ptr(armsql.SQLAgentConfigurationPropertiesStateEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_subscriptionusages_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_subscriptionusages_client_test.go deleted file mode 100644 index f5bef8b73003..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_subscriptionusages_client_test.go +++ /dev/null @@ -1,64 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SubscriptionUsageListByLocation.json -func ExampleSubscriptionUsagesClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSubscriptionUsagesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByLocationPager("WestUS", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SubscriptionUsageGet.json -func ExampleSubscriptionUsagesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSubscriptionUsagesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "WestUS", - "ServerQuota", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_syncagents_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_syncagents_client_test.go deleted file mode 100644 index e4c44c0304fe..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_syncagents_client_test.go +++ /dev/null @@ -1,174 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGet.json -func ExampleSyncAgentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "syncagentcrud-65440", - "syncagentcrud-8475", - "syncagentcrud-3187", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentCreate.json -func ExampleSyncAgentsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "syncagentcrud-65440", - "syncagentcrud-8475", - "syncagentcrud-3187", - armsql.SyncAgent{ - Properties: &armsql.SyncAgentProperties{ - SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/databases/sync"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentDelete.json -func ExampleSyncAgentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "syncagentcrud-65440", - "syncagentcrud-8475", - "syncagentcrud-3187", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentListByServer.json -func ExampleSyncAgentsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("syncagentcrud-65440", - "syncagentcrud-8475", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGenerateKey.json -func ExampleSyncAgentsClient_GenerateKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GenerateKey(ctx, - "syncagentcrud-65440", - "syncagentcrud-8475", - "syncagentcrud-3187", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGetLinkedDatabases.json -func ExampleSyncAgentsClient_NewListLinkedDatabasesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListLinkedDatabasesPager("syncagentcrud-65440", - "syncagentcrud-8475", - "syncagentcrud-3187", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_syncgroups_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_syncgroups_client_test.go deleted file mode 100644 index 2b481e6b4f6f..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_syncgroups_client_test.go +++ /dev/null @@ -1,299 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupRefreshHubSchema.json -func ExampleSyncGroupsClient_BeginRefreshHubSchema() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRefreshHubSchema(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetHubSchema.json -func ExampleSyncGroupsClient_NewListHubSchemasPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListHubSchemasPager("syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetLog.json -func ExampleSyncGroupsClient_NewListLogsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListLogsPager("syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - "2017-01-01T00:00:00", - "2017-12-31T00:00:00", - armsql.SyncGroupsTypeAll, - &armsql.SyncGroupsClientListLogsOptions{ContinuationToken: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupCancelSync.json -func ExampleSyncGroupsClient_CancelSync() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CancelSync(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupTriggerSync.json -func ExampleSyncGroupsClient_TriggerSync() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.TriggerSync(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGet.json -func ExampleSyncGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupCreate.json -func ExampleSyncGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - armsql.SyncGroup{ - Properties: &armsql.SyncGroupProperties{ - ConflictResolutionPolicy: to.Ptr(armsql.SyncConflictResolutionPolicyHubWin), - HubDatabaseUserName: to.Ptr("hubUser"), - Interval: to.Ptr[int32](-1), - SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - UsePrivateLinkConnection: to.Ptr(true), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupDelete.json -func ExampleSyncGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupPatch.json -func ExampleSyncGroupsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - armsql.SyncGroup{ - Properties: &armsql.SyncGroupProperties{ - ConflictResolutionPolicy: to.Ptr(armsql.SyncConflictResolutionPolicyHubWin), - HubDatabasePassword: to.Ptr("hubPassword"), - HubDatabaseUserName: to.Ptr("hubUser"), - Interval: to.Ptr[int32](-1), - SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - UsePrivateLinkConnection: to.Ptr(true), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupListByDatabase.json -func ExampleSyncGroupsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_syncmembers_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_syncmembers_client_test.go deleted file mode 100644 index 723b33a906b0..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_syncmembers_client_test.go +++ /dev/null @@ -1,234 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberGet.json -func ExampleSyncMembersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncMembersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - "syncmembercrud-4879", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberCreate.json -func ExampleSyncMembersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncMembersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - "syncmembercrud-4879", - armsql.SyncMember{ - Properties: &armsql.SyncMemberProperties{ - DatabaseName: to.Ptr("syncgroupcrud-7421"), - DatabaseType: to.Ptr(armsql.SyncMemberDbTypeAzureSQLDatabase), - ServerName: to.Ptr("syncgroupcrud-3379.database.windows.net"), - SyncDirection: to.Ptr(armsql.SyncDirectionBidirectional), - SyncMemberAzureDatabaseResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - UsePrivateLinkConnection: to.Ptr(true), - UserName: to.Ptr("myUser"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberDelete.json -func ExampleSyncMembersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncMembersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - "syncgroupcrud-4879", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberPatch.json -func ExampleSyncMembersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncMembersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - "syncmembercrud-4879", - armsql.SyncMember{ - Properties: &armsql.SyncMemberProperties{ - DatabaseName: to.Ptr("syncgroupcrud-7421"), - DatabaseType: to.Ptr(armsql.SyncMemberDbTypeAzureSQLDatabase), - ServerName: to.Ptr("syncgroupcrud-3379.database.windows.net"), - SyncDirection: to.Ptr(armsql.SyncDirectionBidirectional), - SyncMemberAzureDatabaseResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - UsePrivateLinkConnection: to.Ptr(true), - UserName: to.Ptr("myUser"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberListBySyncGroup.json -func ExampleSyncMembersClient_NewListBySyncGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncMembersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySyncGroupPager("syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberGetSchema.json -func ExampleSyncMembersClient_NewListMemberSchemasPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncMembersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMemberSchemasPager("syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - "syncgroupcrud-4879", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberRefreshSchema.json -func ExampleSyncMembersClient_BeginRefreshMemberSchema() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncMembersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRefreshMemberSchema(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - "syncgroupcrud-4879", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_tdecertificates_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_tdecertificates_client_test.go deleted file mode 100644 index 28dc5a30e9c5..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_tdecertificates_client_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlTdeCertificateCreate.json -func ExampleTdeCertificatesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewTdeCertificatesClient("00000000-0000-0000-0000-000000000001", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "testtdecert", - "testtdecert", - armsql.TdeCertificate{ - Properties: &armsql.TdeCertificateProperties{ - PrivateBlob: to.Ptr("MIIXXXXXXXX"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_timezones_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_timezones_client_test.go deleted file mode 100644 index fd3c549bf421..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_timezones_client_test.go +++ /dev/null @@ -1,64 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTimeZoneListByLocation.json -func ExampleTimeZonesClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewTimeZonesClient("37d5e605-6142-4d79-b564-28b6dbfeec0f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByLocationPager("canadaeast", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTimeZoneGet.json -func ExampleTimeZonesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewTimeZonesClient("37d5e605-6142-4d79-b564-28b6dbfeec0f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "canadaeast", - "Haiti Standard Time", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_transparentdataencryptions_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_transparentdataencryptions_client_test.go deleted file mode 100644 index 30f1d041e34b..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_transparentdataencryptions_client_test.go +++ /dev/null @@ -1,98 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/TransparentDataEncryptionGet.json -func ExampleTransparentDataEncryptionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewTransparentDataEncryptionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "security-tde-resourcegroup", - "securitytde", - "testdb", - armsql.TransparentDataEncryptionNameCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/TransparentDataEncryptionUpdate.json -func ExampleTransparentDataEncryptionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewTransparentDataEncryptionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "securitytde-42-rg", - "securitytde-42", - "testdb", - armsql.TransparentDataEncryptionNameCurrent, - armsql.LogicalDatabaseTransparentDataEncryption{ - Properties: &armsql.TransparentDataEncryptionProperties{ - State: to.Ptr(armsql.TransparentDataEncryptionStateEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/TransparentDataEncryptionList.json -func ExampleTransparentDataEncryptionsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewTransparentDataEncryptionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("security-tde-resourcegroup", - "securitytde", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_usages_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_usages_client_test.go deleted file mode 100644 index 046e942d5da7..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_usages_client_test.go +++ /dev/null @@ -1,44 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListInstancePoolUsageExpanded.json -func ExampleUsagesClient_NewListByInstancePoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewUsagesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePoolPager("group1", - "testIP", - &armsql.UsagesClientListByInstancePoolOptions{ExpandChildren: to.Ptr(true)}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_virtualclusters_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_virtualclusters_client_test.go deleted file mode 100644 index 1929737a8b49..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_virtualclusters_client_test.go +++ /dev/null @@ -1,144 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterList.json -func ExampleVirtualClustersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewVirtualClustersClient("20d7082a-0fc7-4468-82bd-542694d5042b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterListByResourceGroup.json -func ExampleVirtualClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewVirtualClustersClient("20d7082a-0fc7-4468-82bd-542694d5042b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("testrg", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterGet.json -func ExampleVirtualClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewVirtualClustersClient("20d7082a-0fc7-4468-82bd-542694d5042b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testrg", - "vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterDelete.json -func ExampleVirtualClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewVirtualClustersClient("20d7082a-0fc7-4468-82bd-542694d5042b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testrg", - "vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterUpdate.json -func ExampleVirtualClustersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewVirtualClustersClient("20d7082a-0fc7-4468-82bd-542694d5042b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "testrg", - "vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2", - armsql.VirtualClusterUpdate{ - Properties: &armsql.VirtualClusterProperties{ - MaintenanceConfigurationID: to.Ptr("/subscriptions/ab0e51c0-83c0-4380-8ae9-025516df392f/resourceGroups/Federation/providers/Microsoft.Maintenance/maintenanceConfigurations/MiPolicy1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_virtualnetworkrules_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_virtualnetworkrules_client_test.go deleted file mode 100644 index f0338607b03b..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_virtualnetworkrules_client_test.go +++ /dev/null @@ -1,125 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesGet.json -func ExampleVirtualNetworkRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewVirtualNetworkRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "vnet-test-svr", - "vnet-firewall-rule", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesCreateOrUpdate.json -func ExampleVirtualNetworkRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewVirtualNetworkRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default", - "vnet-test-svr", - "vnet-firewall-rule", - armsql.VirtualNetworkRule{ - Properties: &armsql.VirtualNetworkRuleProperties{ - IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - VirtualNetworkSubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesDelete.json -func ExampleVirtualNetworkRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewVirtualNetworkRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default", - "vnet-test-svr", - "vnet-firewall-rule", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesList.json -func ExampleVirtualNetworkRulesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewVirtualNetworkRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("Default", - "vnet-test-svr", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_workloadclassifiers_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_workloadclassifiers_client_test.go deleted file mode 100644 index d59ffc63255e..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_workloadclassifiers_client_test.go +++ /dev/null @@ -1,137 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadClassifier.json -func ExampleWorkloadClassifiersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewWorkloadClassifiersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - "wlm_workloadgroup", - "wlm_classifier", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadClassifierMax.json -func ExampleWorkloadClassifiersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewWorkloadClassifiersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - "wlm_workloadgroup", - "wlm_workloadclassifier", - armsql.WorkloadClassifier{ - Properties: &armsql.WorkloadClassifierProperties{ - Context: to.Ptr("test_context"), - EndTime: to.Ptr("14:00"), - Importance: to.Ptr("high"), - Label: to.Ptr("test_label"), - MemberName: to.Ptr("dbo"), - StartTime: to.Ptr("12:00"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteWorkloadClassifier.json -func ExampleWorkloadClassifiersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewWorkloadClassifiersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - "wlm_workloadgroup", - "wlm_workloadclassifier", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadClassifierList.json -func ExampleWorkloadClassifiersClient_NewListByWorkloadGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewWorkloadClassifiersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByWorkloadGroupPager("Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - "wlm_workloadgroup", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_workloadgroups_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_workloadgroups_client_test.go deleted file mode 100644 index 92e86fc4cce4..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_workloadgroups_client_test.go +++ /dev/null @@ -1,133 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadGroup.json -func ExampleWorkloadGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewWorkloadGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - "smallrc", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadGroupMax.json -func ExampleWorkloadGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewWorkloadGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - "smallrc", - armsql.WorkloadGroup{ - Properties: &armsql.WorkloadGroupProperties{ - Importance: to.Ptr("normal"), - MaxResourcePercent: to.Ptr[int32](100), - MaxResourcePercentPerRequest: to.Ptr[float64](3), - MinResourcePercent: to.Ptr[int32](0), - MinResourcePercentPerRequest: to.Ptr[float64](3), - QueryExecutionTimeout: to.Ptr[int32](0), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteWorkloadGroup.json -func ExampleWorkloadGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewWorkloadGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - "wlm_workloadgroup", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadGroupList.json -func ExampleWorkloadGroupsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewWorkloadGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_models_serde.go b/sdk/resourcemanager/sql/armsql/zz_generated_models_serde.go deleted file mode 100644 index 442fac28f2c5..000000000000 --- a/sdk/resourcemanager/sql/armsql/zz_generated_models_serde.go +++ /dev/null @@ -1,3330 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. - -package armsql - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type AdvancedThreatProtectionProperties. -func (a AdvancedThreatProtectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "creationTime", a.CreationTime) - populate(objectMap, "state", a.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdvancedThreatProtectionProperties. -func (a *AdvancedThreatProtectionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "creationTime": - err = unpopulateTimeRFC3339(val, "CreationTime", &a.CreationTime) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &a.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Advisor. -func (a Advisor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "kind", a.Kind) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AdvisorProperties. -func (a AdvisorProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "advisorStatus", a.AdvisorStatus) - populate(objectMap, "autoExecuteStatus", a.AutoExecuteStatus) - populate(objectMap, "autoExecuteStatusInheritedFrom", a.AutoExecuteStatusInheritedFrom) - populateTimeRFC3339(objectMap, "lastChecked", a.LastChecked) - populate(objectMap, "recommendationsStatus", a.RecommendationsStatus) - populate(objectMap, "recommendedActions", a.RecommendedActions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdvisorProperties. -func (a *AdvisorProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "advisorStatus": - err = unpopulate(val, "AdvisorStatus", &a.AdvisorStatus) - delete(rawMsg, key) - case "autoExecuteStatus": - err = unpopulate(val, "AutoExecuteStatus", &a.AutoExecuteStatus) - delete(rawMsg, key) - case "autoExecuteStatusInheritedFrom": - err = unpopulate(val, "AutoExecuteStatusInheritedFrom", &a.AutoExecuteStatusInheritedFrom) - delete(rawMsg, key) - case "lastChecked": - err = unpopulateTimeRFC3339(val, "LastChecked", &a.LastChecked) - delete(rawMsg, key) - case "recommendationsStatus": - err = unpopulate(val, "RecommendationsStatus", &a.RecommendationsStatus) - delete(rawMsg, key) - case "recommendedActions": - err = unpopulate(val, "RecommendedActions", &a.RecommendedActions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AutomaticTuningServerProperties. -func (a AutomaticTuningServerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actualState", a.ActualState) - populate(objectMap, "desiredState", a.DesiredState) - populate(objectMap, "options", a.Options) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BackupShortTermRetentionPolicy. -func (b BackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", b.ID) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Database. -func (d Database) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", d.ID) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "kind", d.Kind) - populate(objectMap, "location", d.Location) - populate(objectMap, "managedBy", d.ManagedBy) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseAutomaticTuning. -func (d DatabaseAutomaticTuning) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseAutomaticTuningProperties. -func (d DatabaseAutomaticTuningProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actualState", d.ActualState) - populate(objectMap, "desiredState", d.DesiredState) - populate(objectMap, "options", d.Options) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseBlobAuditingPolicyProperties. -func (d DatabaseBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "auditActionsAndGroups", d.AuditActionsAndGroups) - populate(objectMap, "isAzureMonitorTargetEnabled", d.IsAzureMonitorTargetEnabled) - populate(objectMap, "isManagedIdentityInUse", d.IsManagedIdentityInUse) - populate(objectMap, "isStorageSecondaryKeyInUse", d.IsStorageSecondaryKeyInUse) - populate(objectMap, "queueDelayMs", d.QueueDelayMs) - populate(objectMap, "retentionDays", d.RetentionDays) - populate(objectMap, "state", d.State) - populate(objectMap, "storageAccountAccessKey", d.StorageAccountAccessKey) - populate(objectMap, "storageAccountSubscriptionId", d.StorageAccountSubscriptionID) - populate(objectMap, "storageEndpoint", d.StorageEndpoint) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseIdentity. -func (d DatabaseIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tenantId", d.TenantID) - populate(objectMap, "type", d.Type) - populate(objectMap, "userAssignedIdentities", d.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseOperationProperties. -func (d DatabaseOperationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databaseName", d.DatabaseName) - populate(objectMap, "description", d.Description) - populate(objectMap, "errorCode", d.ErrorCode) - populate(objectMap, "errorDescription", d.ErrorDescription) - populate(objectMap, "errorSeverity", d.ErrorSeverity) - populateTimeRFC3339(objectMap, "estimatedCompletionTime", d.EstimatedCompletionTime) - populate(objectMap, "isCancellable", d.IsCancellable) - populate(objectMap, "isUserError", d.IsUserError) - populate(objectMap, "operation", d.Operation) - populate(objectMap, "operationFriendlyName", d.OperationFriendlyName) - populate(objectMap, "percentComplete", d.PercentComplete) - populate(objectMap, "serverName", d.ServerName) - populateTimeRFC3339(objectMap, "startTime", d.StartTime) - populate(objectMap, "state", d.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseOperationProperties. -func (d *DatabaseOperationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "databaseName": - err = unpopulate(val, "DatabaseName", &d.DatabaseName) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &d.Description) - delete(rawMsg, key) - case "errorCode": - err = unpopulate(val, "ErrorCode", &d.ErrorCode) - delete(rawMsg, key) - case "errorDescription": - err = unpopulate(val, "ErrorDescription", &d.ErrorDescription) - delete(rawMsg, key) - case "errorSeverity": - err = unpopulate(val, "ErrorSeverity", &d.ErrorSeverity) - delete(rawMsg, key) - case "estimatedCompletionTime": - err = unpopulateTimeRFC3339(val, "EstimatedCompletionTime", &d.EstimatedCompletionTime) - delete(rawMsg, key) - case "isCancellable": - err = unpopulate(val, "IsCancellable", &d.IsCancellable) - delete(rawMsg, key) - case "isUserError": - err = unpopulate(val, "IsUserError", &d.IsUserError) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &d.Operation) - delete(rawMsg, key) - case "operationFriendlyName": - err = unpopulate(val, "OperationFriendlyName", &d.OperationFriendlyName) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &d.PercentComplete) - delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &d.ServerName) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &d.StartTime) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &d.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseProperties. -func (d DatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoPauseDelay", d.AutoPauseDelay) - populate(objectMap, "catalogCollation", d.CatalogCollation) - populate(objectMap, "collation", d.Collation) - populate(objectMap, "createMode", d.CreateMode) - populateTimeRFC3339(objectMap, "creationDate", d.CreationDate) - populate(objectMap, "currentBackupStorageRedundancy", d.CurrentBackupStorageRedundancy) - populate(objectMap, "currentSku", d.CurrentSKU) - populate(objectMap, "currentServiceObjectiveName", d.CurrentServiceObjectiveName) - populate(objectMap, "databaseId", d.DatabaseID) - populate(objectMap, "defaultSecondaryLocation", d.DefaultSecondaryLocation) - populateTimeRFC3339(objectMap, "earliestRestoreDate", d.EarliestRestoreDate) - populate(objectMap, "elasticPoolId", d.ElasticPoolID) - populate(objectMap, "failoverGroupId", d.FailoverGroupID) - populate(objectMap, "federatedClientId", d.FederatedClientID) - populate(objectMap, "highAvailabilityReplicaCount", d.HighAvailabilityReplicaCount) - populate(objectMap, "isInfraEncryptionEnabled", d.IsInfraEncryptionEnabled) - populate(objectMap, "isLedgerOn", d.IsLedgerOn) - populate(objectMap, "licenseType", d.LicenseType) - populate(objectMap, "longTermRetentionBackupResourceId", d.LongTermRetentionBackupResourceID) - populate(objectMap, "maintenanceConfigurationId", d.MaintenanceConfigurationID) - populate(objectMap, "maxLogSizeBytes", d.MaxLogSizeBytes) - populate(objectMap, "maxSizeBytes", d.MaxSizeBytes) - populate(objectMap, "minCapacity", d.MinCapacity) - populateTimeRFC3339(objectMap, "pausedDate", d.PausedDate) - populate(objectMap, "readScale", d.ReadScale) - populate(objectMap, "recoverableDatabaseId", d.RecoverableDatabaseID) - populate(objectMap, "recoveryServicesRecoveryPointId", d.RecoveryServicesRecoveryPointID) - populate(objectMap, "requestedBackupStorageRedundancy", d.RequestedBackupStorageRedundancy) - populate(objectMap, "requestedServiceObjectiveName", d.RequestedServiceObjectiveName) - populate(objectMap, "restorableDroppedDatabaseId", d.RestorableDroppedDatabaseID) - populateTimeRFC3339(objectMap, "restorePointInTime", d.RestorePointInTime) - populateTimeRFC3339(objectMap, "resumedDate", d.ResumedDate) - populate(objectMap, "sampleName", d.SampleName) - populate(objectMap, "secondaryType", d.SecondaryType) - populateTimeRFC3339(objectMap, "sourceDatabaseDeletionDate", d.SourceDatabaseDeletionDate) - populate(objectMap, "sourceDatabaseId", d.SourceDatabaseID) - populate(objectMap, "sourceResourceId", d.SourceResourceID) - populate(objectMap, "status", d.Status) - populate(objectMap, "zoneRedundant", d.ZoneRedundant) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseProperties. -func (d *DatabaseProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoPauseDelay": - err = unpopulate(val, "AutoPauseDelay", &d.AutoPauseDelay) - delete(rawMsg, key) - case "catalogCollation": - err = unpopulate(val, "CatalogCollation", &d.CatalogCollation) - delete(rawMsg, key) - case "collation": - err = unpopulate(val, "Collation", &d.Collation) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &d.CreateMode) - delete(rawMsg, key) - case "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &d.CreationDate) - delete(rawMsg, key) - case "currentBackupStorageRedundancy": - err = unpopulate(val, "CurrentBackupStorageRedundancy", &d.CurrentBackupStorageRedundancy) - delete(rawMsg, key) - case "currentSku": - err = unpopulate(val, "CurrentSKU", &d.CurrentSKU) - delete(rawMsg, key) - case "currentServiceObjectiveName": - err = unpopulate(val, "CurrentServiceObjectiveName", &d.CurrentServiceObjectiveName) - delete(rawMsg, key) - case "databaseId": - err = unpopulate(val, "DatabaseID", &d.DatabaseID) - delete(rawMsg, key) - case "defaultSecondaryLocation": - err = unpopulate(val, "DefaultSecondaryLocation", &d.DefaultSecondaryLocation) - delete(rawMsg, key) - case "earliestRestoreDate": - err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &d.EarliestRestoreDate) - delete(rawMsg, key) - case "elasticPoolId": - err = unpopulate(val, "ElasticPoolID", &d.ElasticPoolID) - delete(rawMsg, key) - case "failoverGroupId": - err = unpopulate(val, "FailoverGroupID", &d.FailoverGroupID) - delete(rawMsg, key) - case "federatedClientId": - err = unpopulate(val, "FederatedClientID", &d.FederatedClientID) - delete(rawMsg, key) - case "highAvailabilityReplicaCount": - err = unpopulate(val, "HighAvailabilityReplicaCount", &d.HighAvailabilityReplicaCount) - delete(rawMsg, key) - case "isInfraEncryptionEnabled": - err = unpopulate(val, "IsInfraEncryptionEnabled", &d.IsInfraEncryptionEnabled) - delete(rawMsg, key) - case "isLedgerOn": - err = unpopulate(val, "IsLedgerOn", &d.IsLedgerOn) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &d.LicenseType) - delete(rawMsg, key) - case "longTermRetentionBackupResourceId": - err = unpopulate(val, "LongTermRetentionBackupResourceID", &d.LongTermRetentionBackupResourceID) - delete(rawMsg, key) - case "maintenanceConfigurationId": - err = unpopulate(val, "MaintenanceConfigurationID", &d.MaintenanceConfigurationID) - delete(rawMsg, key) - case "maxLogSizeBytes": - err = unpopulate(val, "MaxLogSizeBytes", &d.MaxLogSizeBytes) - delete(rawMsg, key) - case "maxSizeBytes": - err = unpopulate(val, "MaxSizeBytes", &d.MaxSizeBytes) - delete(rawMsg, key) - case "minCapacity": - err = unpopulate(val, "MinCapacity", &d.MinCapacity) - delete(rawMsg, key) - case "pausedDate": - err = unpopulateTimeRFC3339(val, "PausedDate", &d.PausedDate) - delete(rawMsg, key) - case "readScale": - err = unpopulate(val, "ReadScale", &d.ReadScale) - delete(rawMsg, key) - case "recoverableDatabaseId": - err = unpopulate(val, "RecoverableDatabaseID", &d.RecoverableDatabaseID) - delete(rawMsg, key) - case "recoveryServicesRecoveryPointId": - err = unpopulate(val, "RecoveryServicesRecoveryPointID", &d.RecoveryServicesRecoveryPointID) - delete(rawMsg, key) - case "requestedBackupStorageRedundancy": - err = unpopulate(val, "RequestedBackupStorageRedundancy", &d.RequestedBackupStorageRedundancy) - delete(rawMsg, key) - case "requestedServiceObjectiveName": - err = unpopulate(val, "RequestedServiceObjectiveName", &d.RequestedServiceObjectiveName) - delete(rawMsg, key) - case "restorableDroppedDatabaseId": - err = unpopulate(val, "RestorableDroppedDatabaseID", &d.RestorableDroppedDatabaseID) - delete(rawMsg, key) - case "restorePointInTime": - err = unpopulateTimeRFC3339(val, "RestorePointInTime", &d.RestorePointInTime) - delete(rawMsg, key) - case "resumedDate": - err = unpopulateTimeRFC3339(val, "ResumedDate", &d.ResumedDate) - delete(rawMsg, key) - case "sampleName": - err = unpopulate(val, "SampleName", &d.SampleName) - delete(rawMsg, key) - case "secondaryType": - err = unpopulate(val, "SecondaryType", &d.SecondaryType) - delete(rawMsg, key) - case "sourceDatabaseDeletionDate": - err = unpopulateTimeRFC3339(val, "SourceDatabaseDeletionDate", &d.SourceDatabaseDeletionDate) - delete(rawMsg, key) - case "sourceDatabaseId": - err = unpopulate(val, "SourceDatabaseID", &d.SourceDatabaseID) - delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &d.SourceResourceID) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &d.ZoneRedundant) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseUpdate. -func (d DatabaseUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseUpdateProperties. -func (d DatabaseUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoPauseDelay", d.AutoPauseDelay) - populate(objectMap, "catalogCollation", d.CatalogCollation) - populate(objectMap, "collation", d.Collation) - populate(objectMap, "createMode", d.CreateMode) - populateTimeRFC3339(objectMap, "creationDate", d.CreationDate) - populate(objectMap, "currentBackupStorageRedundancy", d.CurrentBackupStorageRedundancy) - populate(objectMap, "currentSku", d.CurrentSKU) - populate(objectMap, "currentServiceObjectiveName", d.CurrentServiceObjectiveName) - populate(objectMap, "databaseId", d.DatabaseID) - populate(objectMap, "defaultSecondaryLocation", d.DefaultSecondaryLocation) - populateTimeRFC3339(objectMap, "earliestRestoreDate", d.EarliestRestoreDate) - populate(objectMap, "elasticPoolId", d.ElasticPoolID) - populate(objectMap, "failoverGroupId", d.FailoverGroupID) - populate(objectMap, "federatedClientId", d.FederatedClientID) - populate(objectMap, "highAvailabilityReplicaCount", d.HighAvailabilityReplicaCount) - populate(objectMap, "isInfraEncryptionEnabled", d.IsInfraEncryptionEnabled) - populate(objectMap, "isLedgerOn", d.IsLedgerOn) - populate(objectMap, "licenseType", d.LicenseType) - populate(objectMap, "longTermRetentionBackupResourceId", d.LongTermRetentionBackupResourceID) - populate(objectMap, "maintenanceConfigurationId", d.MaintenanceConfigurationID) - populate(objectMap, "maxLogSizeBytes", d.MaxLogSizeBytes) - populate(objectMap, "maxSizeBytes", d.MaxSizeBytes) - populate(objectMap, "minCapacity", d.MinCapacity) - populateTimeRFC3339(objectMap, "pausedDate", d.PausedDate) - populate(objectMap, "readScale", d.ReadScale) - populate(objectMap, "recoverableDatabaseId", d.RecoverableDatabaseID) - populate(objectMap, "recoveryServicesRecoveryPointId", d.RecoveryServicesRecoveryPointID) - populate(objectMap, "requestedBackupStorageRedundancy", d.RequestedBackupStorageRedundancy) - populate(objectMap, "requestedServiceObjectiveName", d.RequestedServiceObjectiveName) - populate(objectMap, "restorableDroppedDatabaseId", d.RestorableDroppedDatabaseID) - populateTimeRFC3339(objectMap, "restorePointInTime", d.RestorePointInTime) - populateTimeRFC3339(objectMap, "resumedDate", d.ResumedDate) - populate(objectMap, "sampleName", d.SampleName) - populate(objectMap, "secondaryType", d.SecondaryType) - populateTimeRFC3339(objectMap, "sourceDatabaseDeletionDate", d.SourceDatabaseDeletionDate) - populate(objectMap, "sourceDatabaseId", d.SourceDatabaseID) - populate(objectMap, "status", d.Status) - populate(objectMap, "zoneRedundant", d.ZoneRedundant) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseUpdateProperties. -func (d *DatabaseUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoPauseDelay": - err = unpopulate(val, "AutoPauseDelay", &d.AutoPauseDelay) - delete(rawMsg, key) - case "catalogCollation": - err = unpopulate(val, "CatalogCollation", &d.CatalogCollation) - delete(rawMsg, key) - case "collation": - err = unpopulate(val, "Collation", &d.Collation) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &d.CreateMode) - delete(rawMsg, key) - case "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &d.CreationDate) - delete(rawMsg, key) - case "currentBackupStorageRedundancy": - err = unpopulate(val, "CurrentBackupStorageRedundancy", &d.CurrentBackupStorageRedundancy) - delete(rawMsg, key) - case "currentSku": - err = unpopulate(val, "CurrentSKU", &d.CurrentSKU) - delete(rawMsg, key) - case "currentServiceObjectiveName": - err = unpopulate(val, "CurrentServiceObjectiveName", &d.CurrentServiceObjectiveName) - delete(rawMsg, key) - case "databaseId": - err = unpopulate(val, "DatabaseID", &d.DatabaseID) - delete(rawMsg, key) - case "defaultSecondaryLocation": - err = unpopulate(val, "DefaultSecondaryLocation", &d.DefaultSecondaryLocation) - delete(rawMsg, key) - case "earliestRestoreDate": - err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &d.EarliestRestoreDate) - delete(rawMsg, key) - case "elasticPoolId": - err = unpopulate(val, "ElasticPoolID", &d.ElasticPoolID) - delete(rawMsg, key) - case "failoverGroupId": - err = unpopulate(val, "FailoverGroupID", &d.FailoverGroupID) - delete(rawMsg, key) - case "federatedClientId": - err = unpopulate(val, "FederatedClientID", &d.FederatedClientID) - delete(rawMsg, key) - case "highAvailabilityReplicaCount": - err = unpopulate(val, "HighAvailabilityReplicaCount", &d.HighAvailabilityReplicaCount) - delete(rawMsg, key) - case "isInfraEncryptionEnabled": - err = unpopulate(val, "IsInfraEncryptionEnabled", &d.IsInfraEncryptionEnabled) - delete(rawMsg, key) - case "isLedgerOn": - err = unpopulate(val, "IsLedgerOn", &d.IsLedgerOn) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &d.LicenseType) - delete(rawMsg, key) - case "longTermRetentionBackupResourceId": - err = unpopulate(val, "LongTermRetentionBackupResourceID", &d.LongTermRetentionBackupResourceID) - delete(rawMsg, key) - case "maintenanceConfigurationId": - err = unpopulate(val, "MaintenanceConfigurationID", &d.MaintenanceConfigurationID) - delete(rawMsg, key) - case "maxLogSizeBytes": - err = unpopulate(val, "MaxLogSizeBytes", &d.MaxLogSizeBytes) - delete(rawMsg, key) - case "maxSizeBytes": - err = unpopulate(val, "MaxSizeBytes", &d.MaxSizeBytes) - delete(rawMsg, key) - case "minCapacity": - err = unpopulate(val, "MinCapacity", &d.MinCapacity) - delete(rawMsg, key) - case "pausedDate": - err = unpopulateTimeRFC3339(val, "PausedDate", &d.PausedDate) - delete(rawMsg, key) - case "readScale": - err = unpopulate(val, "ReadScale", &d.ReadScale) - delete(rawMsg, key) - case "recoverableDatabaseId": - err = unpopulate(val, "RecoverableDatabaseID", &d.RecoverableDatabaseID) - delete(rawMsg, key) - case "recoveryServicesRecoveryPointId": - err = unpopulate(val, "RecoveryServicesRecoveryPointID", &d.RecoveryServicesRecoveryPointID) - delete(rawMsg, key) - case "requestedBackupStorageRedundancy": - err = unpopulate(val, "RequestedBackupStorageRedundancy", &d.RequestedBackupStorageRedundancy) - delete(rawMsg, key) - case "requestedServiceObjectiveName": - err = unpopulate(val, "RequestedServiceObjectiveName", &d.RequestedServiceObjectiveName) - delete(rawMsg, key) - case "restorableDroppedDatabaseId": - err = unpopulate(val, "RestorableDroppedDatabaseID", &d.RestorableDroppedDatabaseID) - delete(rawMsg, key) - case "restorePointInTime": - err = unpopulateTimeRFC3339(val, "RestorePointInTime", &d.RestorePointInTime) - delete(rawMsg, key) - case "resumedDate": - err = unpopulateTimeRFC3339(val, "ResumedDate", &d.ResumedDate) - delete(rawMsg, key) - case "sampleName": - err = unpopulate(val, "SampleName", &d.SampleName) - delete(rawMsg, key) - case "secondaryType": - err = unpopulate(val, "SecondaryType", &d.SecondaryType) - delete(rawMsg, key) - case "sourceDatabaseDeletionDate": - err = unpopulateTimeRFC3339(val, "SourceDatabaseDeletionDate", &d.SourceDatabaseDeletionDate) - delete(rawMsg, key) - case "sourceDatabaseId": - err = unpopulate(val, "SourceDatabaseID", &d.SourceDatabaseID) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &d.ZoneRedundant) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentRuleBaselineItem. -func (d DatabaseVulnerabilityAssessmentRuleBaselineItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "result", d.Result) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentRuleBaselineProperties. -func (d DatabaseVulnerabilityAssessmentRuleBaselineProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "baselineResults", d.BaselineResults) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DeletedServerProperties. -func (d DeletedServerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "deletionTime", d.DeletionTime) - populate(objectMap, "fullyQualifiedDomainName", d.FullyQualifiedDomainName) - populate(objectMap, "originalId", d.OriginalID) - populate(objectMap, "version", d.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServerProperties. -func (d *DeletedServerProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "deletionTime": - err = unpopulateTimeRFC3339(val, "DeletionTime", &d.DeletionTime) - delete(rawMsg, key) - case "fullyQualifiedDomainName": - err = unpopulate(val, "FullyQualifiedDomainName", &d.FullyQualifiedDomainName) - delete(rawMsg, key) - case "originalId": - err = unpopulate(val, "OriginalID", &d.OriginalID) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &d.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DistributedAvailabilityGroup. -func (d DistributedAvailabilityGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ElasticPool. -func (e ElasticPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", e.ID) - populate(objectMap, "kind", e.Kind) - populate(objectMap, "location", e.Location) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "sku", e.SKU) - populate(objectMap, "tags", e.Tags) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolActivityProperties. -func (e ElasticPoolActivityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "elasticPoolName", e.ElasticPoolName) - populateTimeRFC3339(objectMap, "endTime", e.EndTime) - populate(objectMap, "errorCode", e.ErrorCode) - populate(objectMap, "errorMessage", e.ErrorMessage) - populate(objectMap, "errorSeverity", e.ErrorSeverity) - populate(objectMap, "operation", e.Operation) - populate(objectMap, "operationId", e.OperationID) - populate(objectMap, "percentComplete", e.PercentComplete) - populate(objectMap, "requestedDatabaseDtuCap", e.RequestedDatabaseDtuCap) - populate(objectMap, "requestedDatabaseDtuGuarantee", e.RequestedDatabaseDtuGuarantee) - populate(objectMap, "requestedDatabaseDtuMax", e.RequestedDatabaseDtuMax) - populate(objectMap, "requestedDatabaseDtuMin", e.RequestedDatabaseDtuMin) - populate(objectMap, "requestedDtu", e.RequestedDtu) - populate(objectMap, "requestedDtuGuarantee", e.RequestedDtuGuarantee) - populate(objectMap, "requestedElasticPoolName", e.RequestedElasticPoolName) - populate(objectMap, "requestedStorageLimitInGB", e.RequestedStorageLimitInGB) - populate(objectMap, "requestedStorageLimitInMB", e.RequestedStorageLimitInMB) - populate(objectMap, "serverName", e.ServerName) - populateTimeRFC3339(objectMap, "startTime", e.StartTime) - populate(objectMap, "state", e.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolActivityProperties. -func (e *ElasticPoolActivityProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "elasticPoolName": - err = unpopulate(val, "ElasticPoolName", &e.ElasticPoolName) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &e.EndTime) - delete(rawMsg, key) - case "errorCode": - err = unpopulate(val, "ErrorCode", &e.ErrorCode) - delete(rawMsg, key) - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &e.ErrorMessage) - delete(rawMsg, key) - case "errorSeverity": - err = unpopulate(val, "ErrorSeverity", &e.ErrorSeverity) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &e.Operation) - delete(rawMsg, key) - case "operationId": - err = unpopulate(val, "OperationID", &e.OperationID) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &e.PercentComplete) - delete(rawMsg, key) - case "requestedDatabaseDtuCap": - err = unpopulate(val, "RequestedDatabaseDtuCap", &e.RequestedDatabaseDtuCap) - delete(rawMsg, key) - case "requestedDatabaseDtuGuarantee": - err = unpopulate(val, "RequestedDatabaseDtuGuarantee", &e.RequestedDatabaseDtuGuarantee) - delete(rawMsg, key) - case "requestedDatabaseDtuMax": - err = unpopulate(val, "RequestedDatabaseDtuMax", &e.RequestedDatabaseDtuMax) - delete(rawMsg, key) - case "requestedDatabaseDtuMin": - err = unpopulate(val, "RequestedDatabaseDtuMin", &e.RequestedDatabaseDtuMin) - delete(rawMsg, key) - case "requestedDtu": - err = unpopulate(val, "RequestedDtu", &e.RequestedDtu) - delete(rawMsg, key) - case "requestedDtuGuarantee": - err = unpopulate(val, "RequestedDtuGuarantee", &e.RequestedDtuGuarantee) - delete(rawMsg, key) - case "requestedElasticPoolName": - err = unpopulate(val, "RequestedElasticPoolName", &e.RequestedElasticPoolName) - delete(rawMsg, key) - case "requestedStorageLimitInGB": - err = unpopulate(val, "RequestedStorageLimitInGB", &e.RequestedStorageLimitInGB) - delete(rawMsg, key) - case "requestedStorageLimitInMB": - err = unpopulate(val, "RequestedStorageLimitInMB", &e.RequestedStorageLimitInMB) - delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &e.ServerName) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &e.StartTime) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &e.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolDatabaseActivityProperties. -func (e ElasticPoolDatabaseActivityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "currentElasticPoolName", e.CurrentElasticPoolName) - populate(objectMap, "currentServiceObjective", e.CurrentServiceObjective) - populate(objectMap, "databaseName", e.DatabaseName) - populateTimeRFC3339(objectMap, "endTime", e.EndTime) - populate(objectMap, "errorCode", e.ErrorCode) - populate(objectMap, "errorMessage", e.ErrorMessage) - populate(objectMap, "errorSeverity", e.ErrorSeverity) - populate(objectMap, "operation", e.Operation) - populate(objectMap, "operationId", e.OperationID) - populate(objectMap, "percentComplete", e.PercentComplete) - populate(objectMap, "requestedElasticPoolName", e.RequestedElasticPoolName) - populate(objectMap, "requestedServiceObjective", e.RequestedServiceObjective) - populate(objectMap, "serverName", e.ServerName) - populateTimeRFC3339(objectMap, "startTime", e.StartTime) - populate(objectMap, "state", e.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolDatabaseActivityProperties. -func (e *ElasticPoolDatabaseActivityProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "currentElasticPoolName": - err = unpopulate(val, "CurrentElasticPoolName", &e.CurrentElasticPoolName) - delete(rawMsg, key) - case "currentServiceObjective": - err = unpopulate(val, "CurrentServiceObjective", &e.CurrentServiceObjective) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &e.DatabaseName) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &e.EndTime) - delete(rawMsg, key) - case "errorCode": - err = unpopulate(val, "ErrorCode", &e.ErrorCode) - delete(rawMsg, key) - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &e.ErrorMessage) - delete(rawMsg, key) - case "errorSeverity": - err = unpopulate(val, "ErrorSeverity", &e.ErrorSeverity) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &e.Operation) - delete(rawMsg, key) - case "operationId": - err = unpopulate(val, "OperationID", &e.OperationID) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &e.PercentComplete) - delete(rawMsg, key) - case "requestedElasticPoolName": - err = unpopulate(val, "RequestedElasticPoolName", &e.RequestedElasticPoolName) - delete(rawMsg, key) - case "requestedServiceObjective": - err = unpopulate(val, "RequestedServiceObjective", &e.RequestedServiceObjective) - delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &e.ServerName) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &e.StartTime) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &e.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolOperationProperties. -func (e ElasticPoolOperationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", e.Description) - populate(objectMap, "elasticPoolName", e.ElasticPoolName) - populate(objectMap, "errorCode", e.ErrorCode) - populate(objectMap, "errorDescription", e.ErrorDescription) - populate(objectMap, "errorSeverity", e.ErrorSeverity) - populateTimeRFC3339(objectMap, "estimatedCompletionTime", e.EstimatedCompletionTime) - populate(objectMap, "isCancellable", e.IsCancellable) - populate(objectMap, "isUserError", e.IsUserError) - populate(objectMap, "operation", e.Operation) - populate(objectMap, "operationFriendlyName", e.OperationFriendlyName) - populate(objectMap, "percentComplete", e.PercentComplete) - populate(objectMap, "serverName", e.ServerName) - populateTimeRFC3339(objectMap, "startTime", e.StartTime) - populate(objectMap, "state", e.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolOperationProperties. -func (e *ElasticPoolOperationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &e.Description) - delete(rawMsg, key) - case "elasticPoolName": - err = unpopulate(val, "ElasticPoolName", &e.ElasticPoolName) - delete(rawMsg, key) - case "errorCode": - err = unpopulate(val, "ErrorCode", &e.ErrorCode) - delete(rawMsg, key) - case "errorDescription": - err = unpopulate(val, "ErrorDescription", &e.ErrorDescription) - delete(rawMsg, key) - case "errorSeverity": - err = unpopulate(val, "ErrorSeverity", &e.ErrorSeverity) - delete(rawMsg, key) - case "estimatedCompletionTime": - err = unpopulateTimeRFC3339(val, "EstimatedCompletionTime", &e.EstimatedCompletionTime) - delete(rawMsg, key) - case "isCancellable": - err = unpopulate(val, "IsCancellable", &e.IsCancellable) - delete(rawMsg, key) - case "isUserError": - err = unpopulate(val, "IsUserError", &e.IsUserError) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &e.Operation) - delete(rawMsg, key) - case "operationFriendlyName": - err = unpopulate(val, "OperationFriendlyName", &e.OperationFriendlyName) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &e.PercentComplete) - delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &e.ServerName) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &e.StartTime) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &e.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolProperties. -func (e ElasticPoolProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "creationDate", e.CreationDate) - populate(objectMap, "highAvailabilityReplicaCount", e.HighAvailabilityReplicaCount) - populate(objectMap, "licenseType", e.LicenseType) - populate(objectMap, "maintenanceConfigurationId", e.MaintenanceConfigurationID) - populate(objectMap, "maxSizeBytes", e.MaxSizeBytes) - populate(objectMap, "perDatabaseSettings", e.PerDatabaseSettings) - populate(objectMap, "state", e.State) - populate(objectMap, "zoneRedundant", e.ZoneRedundant) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolProperties. -func (e *ElasticPoolProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &e.CreationDate) - delete(rawMsg, key) - case "highAvailabilityReplicaCount": - err = unpopulate(val, "HighAvailabilityReplicaCount", &e.HighAvailabilityReplicaCount) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &e.LicenseType) - delete(rawMsg, key) - case "maintenanceConfigurationId": - err = unpopulate(val, "MaintenanceConfigurationID", &e.MaintenanceConfigurationID) - delete(rawMsg, key) - case "maxSizeBytes": - err = unpopulate(val, "MaxSizeBytes", &e.MaxSizeBytes) - delete(rawMsg, key) - case "perDatabaseSettings": - err = unpopulate(val, "PerDatabaseSettings", &e.PerDatabaseSettings) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &e.State) - delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolUpdate. -func (e ElasticPoolUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "sku", e.SKU) - populate(objectMap, "tags", e.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ExtendedDatabaseBlobAuditingPolicyProperties. -func (e ExtendedDatabaseBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "auditActionsAndGroups", e.AuditActionsAndGroups) - populate(objectMap, "isAzureMonitorTargetEnabled", e.IsAzureMonitorTargetEnabled) - populate(objectMap, "isManagedIdentityInUse", e.IsManagedIdentityInUse) - populate(objectMap, "isStorageSecondaryKeyInUse", e.IsStorageSecondaryKeyInUse) - populate(objectMap, "predicateExpression", e.PredicateExpression) - populate(objectMap, "queueDelayMs", e.QueueDelayMs) - populate(objectMap, "retentionDays", e.RetentionDays) - populate(objectMap, "state", e.State) - populate(objectMap, "storageAccountAccessKey", e.StorageAccountAccessKey) - populate(objectMap, "storageAccountSubscriptionId", e.StorageAccountSubscriptionID) - populate(objectMap, "storageEndpoint", e.StorageEndpoint) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ExtendedServerBlobAuditingPolicyProperties. -func (e ExtendedServerBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "auditActionsAndGroups", e.AuditActionsAndGroups) - populate(objectMap, "isAzureMonitorTargetEnabled", e.IsAzureMonitorTargetEnabled) - populate(objectMap, "isDevopsAuditEnabled", e.IsDevopsAuditEnabled) - populate(objectMap, "isManagedIdentityInUse", e.IsManagedIdentityInUse) - populate(objectMap, "isStorageSecondaryKeyInUse", e.IsStorageSecondaryKeyInUse) - populate(objectMap, "predicateExpression", e.PredicateExpression) - populate(objectMap, "queueDelayMs", e.QueueDelayMs) - populate(objectMap, "retentionDays", e.RetentionDays) - populate(objectMap, "state", e.State) - populate(objectMap, "storageAccountAccessKey", e.StorageAccountAccessKey) - populate(objectMap, "storageAccountSubscriptionId", e.StorageAccountSubscriptionID) - populate(objectMap, "storageEndpoint", e.StorageEndpoint) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type FailoverGroup. -func (f FailoverGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", f.ID) - populate(objectMap, "location", f.Location) - populate(objectMap, "name", f.Name) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "tags", f.Tags) - populate(objectMap, "type", f.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type FailoverGroupProperties. -func (f FailoverGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databases", f.Databases) - populate(objectMap, "partnerServers", f.PartnerServers) - populate(objectMap, "readOnlyEndpoint", f.ReadOnlyEndpoint) - populate(objectMap, "readWriteEndpoint", f.ReadWriteEndpoint) - populate(objectMap, "replicationRole", f.ReplicationRole) - populate(objectMap, "replicationState", f.ReplicationState) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type FailoverGroupUpdate. -func (f FailoverGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "tags", f.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type FailoverGroupUpdateProperties. -func (f FailoverGroupUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databases", f.Databases) - populate(objectMap, "readOnlyEndpoint", f.ReadOnlyEndpoint) - populate(objectMap, "readWriteEndpoint", f.ReadWriteEndpoint) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallRuleList. -func (f FirewallRuleList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "values", f.Values) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ImportExportOperationResultProperties. -func (i ImportExportOperationResultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "blobUri", i.BlobURI) - populate(objectMap, "databaseName", i.DatabaseName) - populate(objectMap, "errorMessage", i.ErrorMessage) - populate(objectMap, "lastModifiedTime", i.LastModifiedTime) - populate(objectMap, "privateEndpointConnections", i.PrivateEndpointConnections) - populate(objectMap, "queuedTime", i.QueuedTime) - populate(objectMap, "requestId", i.RequestID) - populate(objectMap, "requestType", i.RequestType) - populate(objectMap, "serverName", i.ServerName) - populate(objectMap, "status", i.Status) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type InstanceFailoverGroupProperties. -func (i InstanceFailoverGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "managedInstancePairs", i.ManagedInstancePairs) - populate(objectMap, "partnerRegions", i.PartnerRegions) - populate(objectMap, "readOnlyEndpoint", i.ReadOnlyEndpoint) - populate(objectMap, "readWriteEndpoint", i.ReadWriteEndpoint) - populate(objectMap, "replicationRole", i.ReplicationRole) - populate(objectMap, "replicationState", i.ReplicationState) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type InstancePool. -func (i InstancePool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", i.ID) - populate(objectMap, "location", i.Location) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "sku", i.SKU) - populate(objectMap, "tags", i.Tags) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type InstancePoolUpdate. -func (i InstancePoolUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", i.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type JobAgent. -func (j JobAgent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", j.ID) - populate(objectMap, "location", j.Location) - populate(objectMap, "name", j.Name) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "sku", j.SKU) - populate(objectMap, "tags", j.Tags) - populate(objectMap, "type", j.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type JobAgentUpdate. -func (j JobAgentUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", j.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type JobExecutionProperties. -func (j JobExecutionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createTime", j.CreateTime) - populateTimeRFC3339(objectMap, "currentAttemptStartTime", j.CurrentAttemptStartTime) - populate(objectMap, "currentAttempts", j.CurrentAttempts) - populateTimeRFC3339(objectMap, "endTime", j.EndTime) - populate(objectMap, "jobExecutionId", j.JobExecutionID) - populate(objectMap, "jobVersion", j.JobVersion) - populate(objectMap, "lastMessage", j.LastMessage) - populate(objectMap, "lifecycle", j.Lifecycle) - populate(objectMap, "provisioningState", j.ProvisioningState) - populateTimeRFC3339(objectMap, "startTime", j.StartTime) - populate(objectMap, "stepId", j.StepID) - populate(objectMap, "stepName", j.StepName) - populate(objectMap, "target", j.Target) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionProperties. -func (j *JobExecutionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createTime": - err = unpopulateTimeRFC3339(val, "CreateTime", &j.CreateTime) - delete(rawMsg, key) - case "currentAttemptStartTime": - err = unpopulateTimeRFC3339(val, "CurrentAttemptStartTime", &j.CurrentAttemptStartTime) - delete(rawMsg, key) - case "currentAttempts": - err = unpopulate(val, "CurrentAttempts", &j.CurrentAttempts) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) - delete(rawMsg, key) - case "jobExecutionId": - err = unpopulate(val, "JobExecutionID", &j.JobExecutionID) - delete(rawMsg, key) - case "jobVersion": - err = unpopulate(val, "JobVersion", &j.JobVersion) - delete(rawMsg, key) - case "lastMessage": - err = unpopulate(val, "LastMessage", &j.LastMessage) - delete(rawMsg, key) - case "lifecycle": - err = unpopulate(val, "Lifecycle", &j.Lifecycle) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &j.ProvisioningState) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) - delete(rawMsg, key) - case "stepId": - err = unpopulate(val, "StepID", &j.StepID) - delete(rawMsg, key) - case "stepName": - err = unpopulate(val, "StepName", &j.StepName) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &j.Target) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type JobSchedule. -func (j JobSchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enabled", j.Enabled) - populateTimeRFC3339(objectMap, "endTime", j.EndTime) - populate(objectMap, "interval", j.Interval) - populateTimeRFC3339(objectMap, "startTime", j.StartTime) - populate(objectMap, "type", j.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobSchedule. -func (j *JobSchedule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &j.Enabled) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) - delete(rawMsg, key) - case "interval": - err = unpopulate(val, "Interval", &j.Interval) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &j.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type JobTargetGroupProperties. -func (j JobTargetGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "members", j.Members) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionBackupProperties. -func (l LongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "backupExpirationTime", l.BackupExpirationTime) - populate(objectMap, "backupStorageRedundancy", l.BackupStorageRedundancy) - populateTimeRFC3339(objectMap, "backupTime", l.BackupTime) - populateTimeRFC3339(objectMap, "databaseDeletionTime", l.DatabaseDeletionTime) - populate(objectMap, "databaseName", l.DatabaseName) - populate(objectMap, "requestedBackupStorageRedundancy", l.RequestedBackupStorageRedundancy) - populateTimeRFC3339(objectMap, "serverCreateTime", l.ServerCreateTime) - populate(objectMap, "serverName", l.ServerName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionBackupProperties. -func (l *LongTermRetentionBackupProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backupExpirationTime": - err = unpopulateTimeRFC3339(val, "BackupExpirationTime", &l.BackupExpirationTime) - delete(rawMsg, key) - case "backupStorageRedundancy": - err = unpopulate(val, "BackupStorageRedundancy", &l.BackupStorageRedundancy) - delete(rawMsg, key) - case "backupTime": - err = unpopulateTimeRFC3339(val, "BackupTime", &l.BackupTime) - delete(rawMsg, key) - case "databaseDeletionTime": - err = unpopulateTimeRFC3339(val, "DatabaseDeletionTime", &l.DatabaseDeletionTime) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &l.DatabaseName) - delete(rawMsg, key) - case "requestedBackupStorageRedundancy": - err = unpopulate(val, "RequestedBackupStorageRedundancy", &l.RequestedBackupStorageRedundancy) - delete(rawMsg, key) - case "serverCreateTime": - err = unpopulateTimeRFC3339(val, "ServerCreateTime", &l.ServerCreateTime) - delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &l.ServerName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowOptionsProperties. -func (m MaintenanceWindowOptionsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowMultipleMaintenanceWindowsPerCycle", m.AllowMultipleMaintenanceWindowsPerCycle) - populate(objectMap, "defaultDurationInMinutes", m.DefaultDurationInMinutes) - populate(objectMap, "isEnabled", m.IsEnabled) - populate(objectMap, "maintenanceWindowCycles", m.MaintenanceWindowCycles) - populate(objectMap, "minCycles", m.MinCycles) - populate(objectMap, "minDurationInMinutes", m.MinDurationInMinutes) - populate(objectMap, "timeGranularityInMinutes", m.TimeGranularityInMinutes) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowsProperties. -func (m MaintenanceWindowsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "timeRanges", m.TimeRanges) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedBackupShortTermRetentionPolicy. -func (m ManagedBackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedDatabase. -func (m ManagedDatabase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseProperties. -func (m ManagedDatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoCompleteRestore", m.AutoCompleteRestore) - populate(objectMap, "catalogCollation", m.CatalogCollation) - populate(objectMap, "collation", m.Collation) - populate(objectMap, "createMode", m.CreateMode) - populateTimeRFC3339(objectMap, "creationDate", m.CreationDate) - populate(objectMap, "defaultSecondaryLocation", m.DefaultSecondaryLocation) - populateTimeRFC3339(objectMap, "earliestRestorePoint", m.EarliestRestorePoint) - populate(objectMap, "failoverGroupId", m.FailoverGroupID) - populate(objectMap, "lastBackupName", m.LastBackupName) - populate(objectMap, "longTermRetentionBackupResourceId", m.LongTermRetentionBackupResourceID) - populate(objectMap, "recoverableDatabaseId", m.RecoverableDatabaseID) - populate(objectMap, "restorableDroppedDatabaseId", m.RestorableDroppedDatabaseID) - populateTimeRFC3339(objectMap, "restorePointInTime", m.RestorePointInTime) - populate(objectMap, "sourceDatabaseId", m.SourceDatabaseID) - populate(objectMap, "status", m.Status) - populate(objectMap, "storageContainerSasToken", m.StorageContainerSasToken) - populate(objectMap, "storageContainerUri", m.StorageContainerURI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseProperties. -func (m *ManagedDatabaseProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoCompleteRestore": - err = unpopulate(val, "AutoCompleteRestore", &m.AutoCompleteRestore) - delete(rawMsg, key) - case "catalogCollation": - err = unpopulate(val, "CatalogCollation", &m.CatalogCollation) - delete(rawMsg, key) - case "collation": - err = unpopulate(val, "Collation", &m.Collation) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &m.CreateMode) - delete(rawMsg, key) - case "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &m.CreationDate) - delete(rawMsg, key) - case "defaultSecondaryLocation": - err = unpopulate(val, "DefaultSecondaryLocation", &m.DefaultSecondaryLocation) - delete(rawMsg, key) - case "earliestRestorePoint": - err = unpopulateTimeRFC3339(val, "EarliestRestorePoint", &m.EarliestRestorePoint) - delete(rawMsg, key) - case "failoverGroupId": - err = unpopulate(val, "FailoverGroupID", &m.FailoverGroupID) - delete(rawMsg, key) - case "lastBackupName": - err = unpopulate(val, "LastBackupName", &m.LastBackupName) - delete(rawMsg, key) - case "longTermRetentionBackupResourceId": - err = unpopulate(val, "LongTermRetentionBackupResourceID", &m.LongTermRetentionBackupResourceID) - delete(rawMsg, key) - case "recoverableDatabaseId": - err = unpopulate(val, "RecoverableDatabaseID", &m.RecoverableDatabaseID) - delete(rawMsg, key) - case "restorableDroppedDatabaseId": - err = unpopulate(val, "RestorableDroppedDatabaseID", &m.RestorableDroppedDatabaseID) - delete(rawMsg, key) - case "restorePointInTime": - err = unpopulateTimeRFC3339(val, "RestorePointInTime", &m.RestorePointInTime) - delete(rawMsg, key) - case "sourceDatabaseId": - err = unpopulate(val, "SourceDatabaseID", &m.SourceDatabaseID) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) - delete(rawMsg, key) - case "storageContainerSasToken": - err = unpopulate(val, "StorageContainerSasToken", &m.StorageContainerSasToken) - delete(rawMsg, key) - case "storageContainerUri": - err = unpopulate(val, "StorageContainerURI", &m.StorageContainerURI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseRestoreDetailsProperties. -func (m ManagedDatabaseRestoreDetailsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "blockReason", m.BlockReason) - populate(objectMap, "currentRestoringFileName", m.CurrentRestoringFileName) - populate(objectMap, "lastRestoredFileName", m.LastRestoredFileName) - populateTimeRFC3339(objectMap, "lastRestoredFileTime", m.LastRestoredFileTime) - populate(objectMap, "lastUploadedFileName", m.LastUploadedFileName) - populateTimeRFC3339(objectMap, "lastUploadedFileTime", m.LastUploadedFileTime) - populate(objectMap, "numberOfFilesDetected", m.NumberOfFilesDetected) - populate(objectMap, "percentCompleted", m.PercentCompleted) - populate(objectMap, "status", m.Status) - populate(objectMap, "unrestorableFiles", m.UnrestorableFiles) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseRestoreDetailsProperties. -func (m *ManagedDatabaseRestoreDetailsProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "blockReason": - err = unpopulate(val, "BlockReason", &m.BlockReason) - delete(rawMsg, key) - case "currentRestoringFileName": - err = unpopulate(val, "CurrentRestoringFileName", &m.CurrentRestoringFileName) - delete(rawMsg, key) - case "lastRestoredFileName": - err = unpopulate(val, "LastRestoredFileName", &m.LastRestoredFileName) - delete(rawMsg, key) - case "lastRestoredFileTime": - err = unpopulateTimeRFC3339(val, "LastRestoredFileTime", &m.LastRestoredFileTime) - delete(rawMsg, key) - case "lastUploadedFileName": - err = unpopulate(val, "LastUploadedFileName", &m.LastUploadedFileName) - delete(rawMsg, key) - case "lastUploadedFileTime": - err = unpopulateTimeRFC3339(val, "LastUploadedFileTime", &m.LastUploadedFileTime) - delete(rawMsg, key) - case "numberOfFilesDetected": - err = unpopulate(val, "NumberOfFilesDetected", &m.NumberOfFilesDetected) - delete(rawMsg, key) - case "percentCompleted": - err = unpopulate(val, "PercentCompleted", &m.PercentCompleted) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) - delete(rawMsg, key) - case "unrestorableFiles": - err = unpopulate(val, "UnrestorableFiles", &m.UnrestorableFiles) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseUpdate. -func (m ManagedDatabaseUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "tags", m.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedInstance. -func (m ManagedInstance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - populate(objectMap, "identity", m.Identity) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "sku", m.SKU) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceKeyProperties. -func (m ManagedInstanceKeyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoRotationEnabled", m.AutoRotationEnabled) - populateTimeRFC3339(objectMap, "creationDate", m.CreationDate) - populate(objectMap, "serverKeyType", m.ServerKeyType) - populate(objectMap, "thumbprint", m.Thumbprint) - populate(objectMap, "uri", m.URI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceKeyProperties. -func (m *ManagedInstanceKeyProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoRotationEnabled": - err = unpopulate(val, "AutoRotationEnabled", &m.AutoRotationEnabled) - delete(rawMsg, key) - case "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &m.CreationDate) - delete(rawMsg, key) - case "serverKeyType": - err = unpopulate(val, "ServerKeyType", &m.ServerKeyType) - delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &m.Thumbprint) - delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &m.URI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionBackupProperties. -func (m ManagedInstanceLongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "backupExpirationTime", m.BackupExpirationTime) - populate(objectMap, "backupStorageRedundancy", m.BackupStorageRedundancy) - populateTimeRFC3339(objectMap, "backupTime", m.BackupTime) - populateTimeRFC3339(objectMap, "databaseDeletionTime", m.DatabaseDeletionTime) - populate(objectMap, "databaseName", m.DatabaseName) - populateTimeRFC3339(objectMap, "managedInstanceCreateTime", m.ManagedInstanceCreateTime) - populate(objectMap, "managedInstanceName", m.ManagedInstanceName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceLongTermRetentionBackupProperties. -func (m *ManagedInstanceLongTermRetentionBackupProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backupExpirationTime": - err = unpopulateTimeRFC3339(val, "BackupExpirationTime", &m.BackupExpirationTime) - delete(rawMsg, key) - case "backupStorageRedundancy": - err = unpopulate(val, "BackupStorageRedundancy", &m.BackupStorageRedundancy) - delete(rawMsg, key) - case "backupTime": - err = unpopulateTimeRFC3339(val, "BackupTime", &m.BackupTime) - delete(rawMsg, key) - case "databaseDeletionTime": - err = unpopulateTimeRFC3339(val, "DatabaseDeletionTime", &m.DatabaseDeletionTime) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &m.DatabaseName) - delete(rawMsg, key) - case "managedInstanceCreateTime": - err = unpopulateTimeRFC3339(val, "ManagedInstanceCreateTime", &m.ManagedInstanceCreateTime) - delete(rawMsg, key) - case "managedInstanceName": - err = unpopulate(val, "ManagedInstanceName", &m.ManagedInstanceName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperationProperties. -func (m ManagedInstanceOperationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", m.Description) - populate(objectMap, "errorCode", m.ErrorCode) - populate(objectMap, "errorDescription", m.ErrorDescription) - populate(objectMap, "errorSeverity", m.ErrorSeverity) - populateTimeRFC3339(objectMap, "estimatedCompletionTime", m.EstimatedCompletionTime) - populate(objectMap, "isCancellable", m.IsCancellable) - populate(objectMap, "isUserError", m.IsUserError) - populate(objectMap, "managedInstanceName", m.ManagedInstanceName) - populate(objectMap, "operation", m.Operation) - populate(objectMap, "operationFriendlyName", m.OperationFriendlyName) - populate(objectMap, "operationParameters", m.OperationParameters) - populate(objectMap, "operationSteps", m.OperationSteps) - populate(objectMap, "percentComplete", m.PercentComplete) - populateTimeRFC3339(objectMap, "startTime", m.StartTime) - populate(objectMap, "state", m.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceOperationProperties. -func (m *ManagedInstanceOperationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &m.Description) - delete(rawMsg, key) - case "errorCode": - err = unpopulate(val, "ErrorCode", &m.ErrorCode) - delete(rawMsg, key) - case "errorDescription": - err = unpopulate(val, "ErrorDescription", &m.ErrorDescription) - delete(rawMsg, key) - case "errorSeverity": - err = unpopulate(val, "ErrorSeverity", &m.ErrorSeverity) - delete(rawMsg, key) - case "estimatedCompletionTime": - err = unpopulateTimeRFC3339(val, "EstimatedCompletionTime", &m.EstimatedCompletionTime) - delete(rawMsg, key) - case "isCancellable": - err = unpopulate(val, "IsCancellable", &m.IsCancellable) - delete(rawMsg, key) - case "isUserError": - err = unpopulate(val, "IsUserError", &m.IsUserError) - delete(rawMsg, key) - case "managedInstanceName": - err = unpopulate(val, "ManagedInstanceName", &m.ManagedInstanceName) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &m.Operation) - delete(rawMsg, key) - case "operationFriendlyName": - err = unpopulate(val, "OperationFriendlyName", &m.OperationFriendlyName) - delete(rawMsg, key) - case "operationParameters": - err = unpopulate(val, "OperationParameters", &m.OperationParameters) - delete(rawMsg, key) - case "operationSteps": - err = unpopulate(val, "OperationSteps", &m.OperationSteps) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &m.PercentComplete) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperationSteps. -func (m ManagedInstanceOperationSteps) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "currentStep", m.CurrentStep) - populate(objectMap, "stepsList", m.StepsList) - populate(objectMap, "totalSteps", m.TotalSteps) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateLinkProperties. -func (m ManagedInstancePrivateLinkProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupId", m.GroupID) - populate(objectMap, "requiredMembers", m.RequiredMembers) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceProperties. -func (m ManagedInstanceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "administratorLogin", m.AdministratorLogin) - populate(objectMap, "administratorLoginPassword", m.AdministratorLoginPassword) - populate(objectMap, "administrators", m.Administrators) - populate(objectMap, "collation", m.Collation) - populate(objectMap, "currentBackupStorageRedundancy", m.CurrentBackupStorageRedundancy) - populate(objectMap, "dnsZone", m.DNSZone) - populate(objectMap, "dnsZonePartner", m.DNSZonePartner) - populate(objectMap, "fullyQualifiedDomainName", m.FullyQualifiedDomainName) - populate(objectMap, "instancePoolId", m.InstancePoolID) - populate(objectMap, "keyId", m.KeyID) - populate(objectMap, "licenseType", m.LicenseType) - populate(objectMap, "maintenanceConfigurationId", m.MaintenanceConfigurationID) - populate(objectMap, "managedInstanceCreateMode", m.ManagedInstanceCreateMode) - populate(objectMap, "minimalTlsVersion", m.MinimalTLSVersion) - populate(objectMap, "primaryUserAssignedIdentityId", m.PrimaryUserAssignedIdentityID) - populate(objectMap, "privateEndpointConnections", m.PrivateEndpointConnections) - populate(objectMap, "provisioningState", m.ProvisioningState) - populate(objectMap, "proxyOverride", m.ProxyOverride) - populate(objectMap, "publicDataEndpointEnabled", m.PublicDataEndpointEnabled) - populate(objectMap, "requestedBackupStorageRedundancy", m.RequestedBackupStorageRedundancy) - populateTimeRFC3339(objectMap, "restorePointInTime", m.RestorePointInTime) - populate(objectMap, "servicePrincipal", m.ServicePrincipal) - populate(objectMap, "sourceManagedInstanceId", m.SourceManagedInstanceID) - populate(objectMap, "state", m.State) - populate(objectMap, "storageSizeInGB", m.StorageSizeInGB) - populate(objectMap, "subnetId", m.SubnetID) - populate(objectMap, "timezoneId", m.TimezoneID) - populate(objectMap, "vCores", m.VCores) - populate(objectMap, "zoneRedundant", m.ZoneRedundant) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceProperties. -func (m *ManagedInstanceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "administratorLogin": - err = unpopulate(val, "AdministratorLogin", &m.AdministratorLogin) - delete(rawMsg, key) - case "administratorLoginPassword": - err = unpopulate(val, "AdministratorLoginPassword", &m.AdministratorLoginPassword) - delete(rawMsg, key) - case "administrators": - err = unpopulate(val, "Administrators", &m.Administrators) - delete(rawMsg, key) - case "collation": - err = unpopulate(val, "Collation", &m.Collation) - delete(rawMsg, key) - case "currentBackupStorageRedundancy": - err = unpopulate(val, "CurrentBackupStorageRedundancy", &m.CurrentBackupStorageRedundancy) - delete(rawMsg, key) - case "dnsZone": - err = unpopulate(val, "DNSZone", &m.DNSZone) - delete(rawMsg, key) - case "dnsZonePartner": - err = unpopulate(val, "DNSZonePartner", &m.DNSZonePartner) - delete(rawMsg, key) - case "fullyQualifiedDomainName": - err = unpopulate(val, "FullyQualifiedDomainName", &m.FullyQualifiedDomainName) - delete(rawMsg, key) - case "instancePoolId": - err = unpopulate(val, "InstancePoolID", &m.InstancePoolID) - delete(rawMsg, key) - case "keyId": - err = unpopulate(val, "KeyID", &m.KeyID) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &m.LicenseType) - delete(rawMsg, key) - case "maintenanceConfigurationId": - err = unpopulate(val, "MaintenanceConfigurationID", &m.MaintenanceConfigurationID) - delete(rawMsg, key) - case "managedInstanceCreateMode": - err = unpopulate(val, "ManagedInstanceCreateMode", &m.ManagedInstanceCreateMode) - delete(rawMsg, key) - case "minimalTlsVersion": - err = unpopulate(val, "MinimalTLSVersion", &m.MinimalTLSVersion) - delete(rawMsg, key) - case "primaryUserAssignedIdentityId": - err = unpopulate(val, "PrimaryUserAssignedIdentityID", &m.PrimaryUserAssignedIdentityID) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &m.PrivateEndpointConnections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) - delete(rawMsg, key) - case "proxyOverride": - err = unpopulate(val, "ProxyOverride", &m.ProxyOverride) - delete(rawMsg, key) - case "publicDataEndpointEnabled": - err = unpopulate(val, "PublicDataEndpointEnabled", &m.PublicDataEndpointEnabled) - delete(rawMsg, key) - case "requestedBackupStorageRedundancy": - err = unpopulate(val, "RequestedBackupStorageRedundancy", &m.RequestedBackupStorageRedundancy) - delete(rawMsg, key) - case "restorePointInTime": - err = unpopulateTimeRFC3339(val, "RestorePointInTime", &m.RestorePointInTime) - delete(rawMsg, key) - case "servicePrincipal": - err = unpopulate(val, "ServicePrincipal", &m.ServicePrincipal) - delete(rawMsg, key) - case "sourceManagedInstanceId": - err = unpopulate(val, "SourceManagedInstanceID", &m.SourceManagedInstanceID) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) - delete(rawMsg, key) - case "storageSizeInGB": - err = unpopulate(val, "StorageSizeInGB", &m.StorageSizeInGB) - delete(rawMsg, key) - case "subnetId": - err = unpopulate(val, "SubnetID", &m.SubnetID) - delete(rawMsg, key) - case "timezoneId": - err = unpopulate(val, "TimezoneID", &m.TimezoneID) - delete(rawMsg, key) - case "vCores": - err = unpopulate(val, "VCores", &m.VCores) - delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &m.ZoneRedundant) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceUpdate. -func (m ManagedInstanceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "identity", m.Identity) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "sku", m.SKU) - populate(objectMap, "tags", m.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Metric. -func (m *Metric) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &m.EndTime) - delete(rawMsg, key) - case "metricValues": - err = unpopulate(val, "MetricValues", &m.MetricValues) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) - delete(rawMsg, key) - case "timeGrain": - err = unpopulate(val, "TimeGrain", &m.TimeGrain) - delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &m.Unit) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricValue. -func (m *MetricValue) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "average": - err = unpopulate(val, "Average", &m.Average) - delete(rawMsg, key) - case "count": - err = unpopulate(val, "Count", &m.Count) - delete(rawMsg, key) - case "maximum": - err = unpopulate(val, "Maximum", &m.Maximum) - delete(rawMsg, key) - case "minimum": - err = unpopulate(val, "Minimum", &m.Minimum) - delete(rawMsg, key) - case "timestamp": - err = unpopulateTimeRFC3339(val, "Timestamp", &m.Timestamp) - delete(rawMsg, key) - case "total": - err = unpopulate(val, "Total", &m.Total) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type QueryMetricInterval. -func (q QueryMetricInterval) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "executionCount", q.ExecutionCount) - populate(objectMap, "intervalStartTime", q.IntervalStartTime) - populate(objectMap, "intervalType", q.IntervalType) - populate(objectMap, "metrics", q.Metrics) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type QueryStatisticsProperties. -func (q QueryStatisticsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databaseName", q.DatabaseName) - populate(objectMap, "endTime", q.EndTime) - populate(objectMap, "intervals", q.Intervals) - populate(objectMap, "queryId", q.QueryID) - populate(objectMap, "startTime", q.StartTime) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RecommendedAction. -func (r RecommendedAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "kind", r.Kind) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RecommendedActionMetricInfo. -func (r RecommendedActionMetricInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "metricName", r.MetricName) - populateTimeRFC3339(objectMap, "startTime", r.StartTime) - populate(objectMap, "timeGrain", r.TimeGrain) - populate(objectMap, "unit", r.Unit) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionMetricInfo. -func (r *RecommendedActionMetricInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "metricName": - err = unpopulate(val, "MetricName", &r.MetricName) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &r.StartTime) - delete(rawMsg, key) - case "timeGrain": - err = unpopulate(val, "TimeGrain", &r.TimeGrain) - delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &r.Unit) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RecommendedActionProperties. -func (r RecommendedActionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "details", r.Details) - populate(objectMap, "errorDetails", r.ErrorDetails) - populate(objectMap, "estimatedImpact", r.EstimatedImpact) - populate(objectMap, "executeActionDuration", r.ExecuteActionDuration) - populate(objectMap, "executeActionInitiatedBy", r.ExecuteActionInitiatedBy) - populateTimeRFC3339(objectMap, "executeActionInitiatedTime", r.ExecuteActionInitiatedTime) - populateTimeRFC3339(objectMap, "executeActionStartTime", r.ExecuteActionStartTime) - populate(objectMap, "implementationDetails", r.ImplementationDetails) - populate(objectMap, "isArchivedAction", r.IsArchivedAction) - populate(objectMap, "isExecutableAction", r.IsExecutableAction) - populate(objectMap, "isRevertableAction", r.IsRevertableAction) - populateTimeRFC3339(objectMap, "lastRefresh", r.LastRefresh) - populate(objectMap, "linkedObjects", r.LinkedObjects) - populate(objectMap, "observedImpact", r.ObservedImpact) - populate(objectMap, "recommendationReason", r.RecommendationReason) - populate(objectMap, "revertActionDuration", r.RevertActionDuration) - populate(objectMap, "revertActionInitiatedBy", r.RevertActionInitiatedBy) - populateTimeRFC3339(objectMap, "revertActionInitiatedTime", r.RevertActionInitiatedTime) - populateTimeRFC3339(objectMap, "revertActionStartTime", r.RevertActionStartTime) - populate(objectMap, "score", r.Score) - populate(objectMap, "state", r.State) - populate(objectMap, "timeSeries", r.TimeSeries) - populateTimeRFC3339(objectMap, "validSince", r.ValidSince) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionProperties. -func (r *RecommendedActionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "details": - err = unpopulate(val, "Details", &r.Details) - delete(rawMsg, key) - case "errorDetails": - err = unpopulate(val, "ErrorDetails", &r.ErrorDetails) - delete(rawMsg, key) - case "estimatedImpact": - err = unpopulate(val, "EstimatedImpact", &r.EstimatedImpact) - delete(rawMsg, key) - case "executeActionDuration": - err = unpopulate(val, "ExecuteActionDuration", &r.ExecuteActionDuration) - delete(rawMsg, key) - case "executeActionInitiatedBy": - err = unpopulate(val, "ExecuteActionInitiatedBy", &r.ExecuteActionInitiatedBy) - delete(rawMsg, key) - case "executeActionInitiatedTime": - err = unpopulateTimeRFC3339(val, "ExecuteActionInitiatedTime", &r.ExecuteActionInitiatedTime) - delete(rawMsg, key) - case "executeActionStartTime": - err = unpopulateTimeRFC3339(val, "ExecuteActionStartTime", &r.ExecuteActionStartTime) - delete(rawMsg, key) - case "implementationDetails": - err = unpopulate(val, "ImplementationDetails", &r.ImplementationDetails) - delete(rawMsg, key) - case "isArchivedAction": - err = unpopulate(val, "IsArchivedAction", &r.IsArchivedAction) - delete(rawMsg, key) - case "isExecutableAction": - err = unpopulate(val, "IsExecutableAction", &r.IsExecutableAction) - delete(rawMsg, key) - case "isRevertableAction": - err = unpopulate(val, "IsRevertableAction", &r.IsRevertableAction) - delete(rawMsg, key) - case "lastRefresh": - err = unpopulateTimeRFC3339(val, "LastRefresh", &r.LastRefresh) - delete(rawMsg, key) - case "linkedObjects": - err = unpopulate(val, "LinkedObjects", &r.LinkedObjects) - delete(rawMsg, key) - case "observedImpact": - err = unpopulate(val, "ObservedImpact", &r.ObservedImpact) - delete(rawMsg, key) - case "recommendationReason": - err = unpopulate(val, "RecommendationReason", &r.RecommendationReason) - delete(rawMsg, key) - case "revertActionDuration": - err = unpopulate(val, "RevertActionDuration", &r.RevertActionDuration) - delete(rawMsg, key) - case "revertActionInitiatedBy": - err = unpopulate(val, "RevertActionInitiatedBy", &r.RevertActionInitiatedBy) - delete(rawMsg, key) - case "revertActionInitiatedTime": - err = unpopulateTimeRFC3339(val, "RevertActionInitiatedTime", &r.RevertActionInitiatedTime) - delete(rawMsg, key) - case "revertActionStartTime": - err = unpopulateTimeRFC3339(val, "RevertActionStartTime", &r.RevertActionStartTime) - delete(rawMsg, key) - case "score": - err = unpopulate(val, "Score", &r.Score) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &r.State) - delete(rawMsg, key) - case "timeSeries": - err = unpopulate(val, "TimeSeries", &r.TimeSeries) - delete(rawMsg, key) - case "validSince": - err = unpopulateTimeRFC3339(val, "ValidSince", &r.ValidSince) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RecommendedActionStateInfo. -func (r RecommendedActionStateInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actionInitiatedBy", r.ActionInitiatedBy) - populate(objectMap, "currentValue", r.CurrentValue) - populateTimeRFC3339(objectMap, "lastModified", r.LastModified) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionStateInfo. -func (r *RecommendedActionStateInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "actionInitiatedBy": - err = unpopulate(val, "ActionInitiatedBy", &r.ActionInitiatedBy) - delete(rawMsg, key) - case "currentValue": - err = unpopulate(val, "CurrentValue", &r.CurrentValue) - delete(rawMsg, key) - case "lastModified": - err = unpopulateTimeRFC3339(val, "LastModified", &r.LastModified) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RecommendedSensitivityLabelUpdateList. -func (r RecommendedSensitivityLabelUpdateList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "operations", r.Operations) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RecoverableDatabaseProperties. -func (r RecoverableDatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "edition", r.Edition) - populate(objectMap, "elasticPoolName", r.ElasticPoolName) - populateTimeRFC3339(objectMap, "lastAvailableBackupDate", r.LastAvailableBackupDate) - populate(objectMap, "serviceLevelObjective", r.ServiceLevelObjective) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableDatabaseProperties. -func (r *RecoverableDatabaseProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "edition": - err = unpopulate(val, "Edition", &r.Edition) - delete(rawMsg, key) - case "elasticPoolName": - err = unpopulate(val, "ElasticPoolName", &r.ElasticPoolName) - delete(rawMsg, key) - case "lastAvailableBackupDate": - err = unpopulateTimeRFC3339(val, "LastAvailableBackupDate", &r.LastAvailableBackupDate) - delete(rawMsg, key) - case "serviceLevelObjective": - err = unpopulate(val, "ServiceLevelObjective", &r.ServiceLevelObjective) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ReplicationLinkProperties. -func (r ReplicationLinkProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "isTerminationAllowed", r.IsTerminationAllowed) - populate(objectMap, "linkType", r.LinkType) - populate(objectMap, "partnerDatabase", r.PartnerDatabase) - populate(objectMap, "partnerLocation", r.PartnerLocation) - populate(objectMap, "partnerRole", r.PartnerRole) - populate(objectMap, "partnerServer", r.PartnerServer) - populate(objectMap, "percentComplete", r.PercentComplete) - populate(objectMap, "replicationMode", r.ReplicationMode) - populate(objectMap, "replicationState", r.ReplicationState) - populate(objectMap, "role", r.Role) - populateTimeRFC3339(objectMap, "startTime", r.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationLinkProperties. -func (r *ReplicationLinkProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "isTerminationAllowed": - err = unpopulate(val, "IsTerminationAllowed", &r.IsTerminationAllowed) - delete(rawMsg, key) - case "linkType": - err = unpopulate(val, "LinkType", &r.LinkType) - delete(rawMsg, key) - case "partnerDatabase": - err = unpopulate(val, "PartnerDatabase", &r.PartnerDatabase) - delete(rawMsg, key) - case "partnerLocation": - err = unpopulate(val, "PartnerLocation", &r.PartnerLocation) - delete(rawMsg, key) - case "partnerRole": - err = unpopulate(val, "PartnerRole", &r.PartnerRole) - delete(rawMsg, key) - case "partnerServer": - err = unpopulate(val, "PartnerServer", &r.PartnerServer) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &r.PercentComplete) - delete(rawMsg, key) - case "replicationMode": - err = unpopulate(val, "ReplicationMode", &r.ReplicationMode) - delete(rawMsg, key) - case "replicationState": - err = unpopulate(val, "ReplicationState", &r.ReplicationState) - delete(rawMsg, key) - case "role": - err = unpopulate(val, "Role", &r.Role) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &r.StartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceIdentity. -func (r ResourceIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "principalId", r.PrincipalID) - populate(objectMap, "tenantId", r.TenantID) - populate(objectMap, "type", r.Type) - populate(objectMap, "userAssignedIdentities", r.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedDatabase. -func (r RestorableDroppedDatabase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "sku", r.SKU) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedDatabaseProperties. -func (r RestorableDroppedDatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupStorageRedundancy", r.BackupStorageRedundancy) - populateTimeRFC3339(objectMap, "creationDate", r.CreationDate) - populate(objectMap, "databaseName", r.DatabaseName) - populateTimeRFC3339(objectMap, "deletionDate", r.DeletionDate) - populateTimeRFC3339(objectMap, "earliestRestoreDate", r.EarliestRestoreDate) - populate(objectMap, "maxSizeBytes", r.MaxSizeBytes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedDatabaseProperties. -func (r *RestorableDroppedDatabaseProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backupStorageRedundancy": - err = unpopulate(val, "BackupStorageRedundancy", &r.BackupStorageRedundancy) - delete(rawMsg, key) - case "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &r.CreationDate) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &r.DatabaseName) - delete(rawMsg, key) - case "deletionDate": - err = unpopulateTimeRFC3339(val, "DeletionDate", &r.DeletionDate) - delete(rawMsg, key) - case "earliestRestoreDate": - err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &r.EarliestRestoreDate) - delete(rawMsg, key) - case "maxSizeBytes": - err = unpopulate(val, "MaxSizeBytes", &r.MaxSizeBytes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedManagedDatabase. -func (r RestorableDroppedManagedDatabase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedManagedDatabaseProperties. -func (r RestorableDroppedManagedDatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "creationDate", r.CreationDate) - populate(objectMap, "databaseName", r.DatabaseName) - populateTimeRFC3339(objectMap, "deletionDate", r.DeletionDate) - populateTimeRFC3339(objectMap, "earliestRestoreDate", r.EarliestRestoreDate) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedManagedDatabaseProperties. -func (r *RestorableDroppedManagedDatabaseProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &r.CreationDate) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &r.DatabaseName) - delete(rawMsg, key) - case "deletionDate": - err = unpopulateTimeRFC3339(val, "DeletionDate", &r.DeletionDate) - delete(rawMsg, key) - case "earliestRestoreDate": - err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &r.EarliestRestoreDate) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointProperties. -func (r RestorePointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "earliestRestoreDate", r.EarliestRestoreDate) - populateTimeRFC3339(objectMap, "restorePointCreationDate", r.RestorePointCreationDate) - populate(objectMap, "restorePointLabel", r.RestorePointLabel) - populate(objectMap, "restorePointType", r.RestorePointType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointProperties. -func (r *RestorePointProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "earliestRestoreDate": - err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &r.EarliestRestoreDate) - delete(rawMsg, key) - case "restorePointCreationDate": - err = unpopulateTimeRFC3339(val, "RestorePointCreationDate", &r.RestorePointCreationDate) - delete(rawMsg, key) - case "restorePointLabel": - err = unpopulate(val, "RestorePointLabel", &r.RestorePointLabel) - delete(rawMsg, key) - case "restorePointType": - err = unpopulate(val, "RestorePointType", &r.RestorePointType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityAlertPolicyProperties. -func (s SecurityAlertPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "creationTime", s.CreationTime) - populate(objectMap, "disabledAlerts", s.DisabledAlerts) - populate(objectMap, "emailAccountAdmins", s.EmailAccountAdmins) - populate(objectMap, "emailAddresses", s.EmailAddresses) - populate(objectMap, "retentionDays", s.RetentionDays) - populate(objectMap, "state", s.State) - populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) - populate(objectMap, "storageEndpoint", s.StorageEndpoint) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlertPolicyProperties. -func (s *SecurityAlertPolicyProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "creationTime": - err = unpopulateTimeRFC3339(val, "CreationTime", &s.CreationTime) - delete(rawMsg, key) - case "disabledAlerts": - err = unpopulate(val, "DisabledAlerts", &s.DisabledAlerts) - delete(rawMsg, key) - case "emailAccountAdmins": - err = unpopulate(val, "EmailAccountAdmins", &s.EmailAccountAdmins) - delete(rawMsg, key) - case "emailAddresses": - err = unpopulate(val, "EmailAddresses", &s.EmailAddresses) - delete(rawMsg, key) - case "retentionDays": - err = unpopulate(val, "RetentionDays", &s.RetentionDays) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &s.State) - delete(rawMsg, key) - case "storageAccountAccessKey": - err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) - delete(rawMsg, key) - case "storageEndpoint": - err = unpopulate(val, "StorageEndpoint", &s.StorageEndpoint) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityAlertsPolicyProperties. -func (s SecurityAlertsPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "creationTime", s.CreationTime) - populate(objectMap, "disabledAlerts", s.DisabledAlerts) - populate(objectMap, "emailAccountAdmins", s.EmailAccountAdmins) - populate(objectMap, "emailAddresses", s.EmailAddresses) - populate(objectMap, "retentionDays", s.RetentionDays) - populate(objectMap, "state", s.State) - populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) - populate(objectMap, "storageEndpoint", s.StorageEndpoint) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlertsPolicyProperties. -func (s *SecurityAlertsPolicyProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "creationTime": - err = unpopulateTimeRFC3339(val, "CreationTime", &s.CreationTime) - delete(rawMsg, key) - case "disabledAlerts": - err = unpopulate(val, "DisabledAlerts", &s.DisabledAlerts) - delete(rawMsg, key) - case "emailAccountAdmins": - err = unpopulate(val, "EmailAccountAdmins", &s.EmailAccountAdmins) - delete(rawMsg, key) - case "emailAddresses": - err = unpopulate(val, "EmailAddresses", &s.EmailAddresses) - delete(rawMsg, key) - case "retentionDays": - err = unpopulate(val, "RetentionDays", &s.RetentionDays) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &s.State) - delete(rawMsg, key) - case "storageAccountAccessKey": - err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) - delete(rawMsg, key) - case "storageEndpoint": - err = unpopulate(val, "StorageEndpoint", &s.StorageEndpoint) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityEventProperties. -func (s SecurityEventProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "applicationName", s.ApplicationName) - populate(objectMap, "clientIp", s.ClientIP) - populate(objectMap, "database", s.Database) - populateTimeRFC3339(objectMap, "eventTime", s.EventTime) - populate(objectMap, "principalName", s.PrincipalName) - populate(objectMap, "securityEventSqlInjectionAdditionalProperties", s.SecurityEventSQLInjectionAdditionalProperties) - populate(objectMap, "securityEventType", s.SecurityEventType) - populate(objectMap, "server", s.Server) - populate(objectMap, "subscription", s.Subscription) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityEventProperties. -func (s *SecurityEventProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "applicationName": - err = unpopulate(val, "ApplicationName", &s.ApplicationName) - delete(rawMsg, key) - case "clientIp": - err = unpopulate(val, "ClientIP", &s.ClientIP) - delete(rawMsg, key) - case "database": - err = unpopulate(val, "Database", &s.Database) - delete(rawMsg, key) - case "eventTime": - err = unpopulateTimeRFC3339(val, "EventTime", &s.EventTime) - delete(rawMsg, key) - case "principalName": - err = unpopulate(val, "PrincipalName", &s.PrincipalName) - delete(rawMsg, key) - case "securityEventSqlInjectionAdditionalProperties": - err = unpopulate(val, "SecurityEventSQLInjectionAdditionalProperties", &s.SecurityEventSQLInjectionAdditionalProperties) - delete(rawMsg, key) - case "securityEventType": - err = unpopulate(val, "SecurityEventType", &s.SecurityEventType) - delete(rawMsg, key) - case "server": - err = unpopulate(val, "Server", &s.Server) - delete(rawMsg, key) - case "subscription": - err = unpopulate(val, "Subscription", &s.Subscription) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityEventsFilterParameters. -func (s *SecurityEventsFilterParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "eventTime": - err = unpopulateTimeRFC3339(val, "EventTime", &s.EventTime) - delete(rawMsg, key) - case "showServerRecords": - err = unpopulate(val, "ShowServerRecords", &s.ShowServerRecords) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SensitivityLabelUpdateList. -func (s SensitivityLabelUpdateList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "operations", s.Operations) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Server. -func (s Server) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) - populate(objectMap, "kind", s.Kind) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServerAutomaticTuning. -func (s ServerAutomaticTuning) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicyProperties. -func (s ServerBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "auditActionsAndGroups", s.AuditActionsAndGroups) - populate(objectMap, "isAzureMonitorTargetEnabled", s.IsAzureMonitorTargetEnabled) - populate(objectMap, "isDevopsAuditEnabled", s.IsDevopsAuditEnabled) - populate(objectMap, "isManagedIdentityInUse", s.IsManagedIdentityInUse) - populate(objectMap, "isStorageSecondaryKeyInUse", s.IsStorageSecondaryKeyInUse) - populate(objectMap, "queueDelayMs", s.QueueDelayMs) - populate(objectMap, "retentionDays", s.RetentionDays) - populate(objectMap, "state", s.State) - populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) - populate(objectMap, "storageAccountSubscriptionId", s.StorageAccountSubscriptionID) - populate(objectMap, "storageEndpoint", s.StorageEndpoint) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServerKeyProperties. -func (s ServerKeyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoRotationEnabled", s.AutoRotationEnabled) - populateTimeRFC3339(objectMap, "creationDate", s.CreationDate) - populate(objectMap, "serverKeyType", s.ServerKeyType) - populate(objectMap, "subregion", s.Subregion) - populate(objectMap, "thumbprint", s.Thumbprint) - populate(objectMap, "uri", s.URI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerKeyProperties. -func (s *ServerKeyProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoRotationEnabled": - err = unpopulate(val, "AutoRotationEnabled", &s.AutoRotationEnabled) - delete(rawMsg, key) - case "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &s.CreationDate) - delete(rawMsg, key) - case "serverKeyType": - err = unpopulate(val, "ServerKeyType", &s.ServerKeyType) - delete(rawMsg, key) - case "subregion": - err = unpopulate(val, "Subregion", &s.Subregion) - delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &s.Thumbprint) - delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &s.URI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServerOperationProperties. -func (s ServerOperationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", s.Description) - populate(objectMap, "errorCode", s.ErrorCode) - populate(objectMap, "errorDescription", s.ErrorDescription) - populate(objectMap, "errorSeverity", s.ErrorSeverity) - populateTimeRFC3339(objectMap, "estimatedCompletionTime", s.EstimatedCompletionTime) - populate(objectMap, "isCancellable", s.IsCancellable) - populate(objectMap, "isUserError", s.IsUserError) - populate(objectMap, "operation", s.Operation) - populate(objectMap, "operationFriendlyName", s.OperationFriendlyName) - populate(objectMap, "percentComplete", s.PercentComplete) - populate(objectMap, "serverName", s.ServerName) - populateTimeRFC3339(objectMap, "startTime", s.StartTime) - populate(objectMap, "state", s.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerOperationProperties. -func (s *ServerOperationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &s.Description) - delete(rawMsg, key) - case "errorCode": - err = unpopulate(val, "ErrorCode", &s.ErrorCode) - delete(rawMsg, key) - case "errorDescription": - err = unpopulate(val, "ErrorDescription", &s.ErrorDescription) - delete(rawMsg, key) - case "errorSeverity": - err = unpopulate(val, "ErrorSeverity", &s.ErrorSeverity) - delete(rawMsg, key) - case "estimatedCompletionTime": - err = unpopulateTimeRFC3339(val, "EstimatedCompletionTime", &s.EstimatedCompletionTime) - delete(rawMsg, key) - case "isCancellable": - err = unpopulate(val, "IsCancellable", &s.IsCancellable) - delete(rawMsg, key) - case "isUserError": - err = unpopulate(val, "IsUserError", &s.IsUserError) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &s.Operation) - delete(rawMsg, key) - case "operationFriendlyName": - err = unpopulate(val, "OperationFriendlyName", &s.OperationFriendlyName) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &s.PercentComplete) - delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &s.ServerName) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &s.StartTime) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &s.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServerProperties. -func (s ServerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "administratorLogin", s.AdministratorLogin) - populate(objectMap, "administratorLoginPassword", s.AdministratorLoginPassword) - populate(objectMap, "administrators", s.Administrators) - populate(objectMap, "federatedClientId", s.FederatedClientID) - populate(objectMap, "fullyQualifiedDomainName", s.FullyQualifiedDomainName) - populate(objectMap, "keyId", s.KeyID) - populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) - populate(objectMap, "primaryUserAssignedIdentityId", s.PrimaryUserAssignedIdentityID) - populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "restrictOutboundNetworkAccess", s.RestrictOutboundNetworkAccess) - populate(objectMap, "state", s.State) - populate(objectMap, "version", s.Version) - populate(objectMap, "workspaceFeature", s.WorkspaceFeature) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServerTrustGroupProperties. -func (s ServerTrustGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupMembers", s.GroupMembers) - populate(objectMap, "trustScopes", s.TrustScopes) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServerUpdate. -func (s ServerUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "identity", s.Identity) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerUsage. -func (s *ServerUsage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "currentValue": - err = unpopulate(val, "CurrentValue", &s.CurrentValue) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &s.DisplayName) - delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &s.Limit) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "nextResetTime": - err = unpopulateTimeRFC3339(val, "NextResetTime", &s.NextResetTime) - delete(rawMsg, key) - case "resourceName": - err = unpopulate(val, "ResourceName", &s.ResourceName) - delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &s.Unit) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SyncAgentProperties. -func (s SyncAgentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "expiryTime", s.ExpiryTime) - populate(objectMap, "isUpToDate", s.IsUpToDate) - populateTimeRFC3339(objectMap, "lastAliveTime", s.LastAliveTime) - populate(objectMap, "name", s.Name) - populate(objectMap, "state", s.State) - populate(objectMap, "syncDatabaseId", s.SyncDatabaseID) - populate(objectMap, "version", s.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgentProperties. -func (s *SyncAgentProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "expiryTime": - err = unpopulateTimeRFC3339(val, "ExpiryTime", &s.ExpiryTime) - delete(rawMsg, key) - case "isUpToDate": - err = unpopulate(val, "IsUpToDate", &s.IsUpToDate) - delete(rawMsg, key) - case "lastAliveTime": - err = unpopulateTimeRFC3339(val, "LastAliveTime", &s.LastAliveTime) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &s.State) - delete(rawMsg, key) - case "syncDatabaseId": - err = unpopulate(val, "SyncDatabaseID", &s.SyncDatabaseID) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SyncFullSchemaProperties. -func (s *SyncFullSchemaProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "lastUpdateTime": - err = unpopulateTimeRFC3339(val, "LastUpdateTime", &s.LastUpdateTime) - delete(rawMsg, key) - case "tables": - err = unpopulate(val, "Tables", &s.Tables) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SyncGroup. -func (s SyncGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupLogProperties. -func (s *SyncGroupLogProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "details": - err = unpopulate(val, "Details", &s.Details) - delete(rawMsg, key) - case "operationStatus": - err = unpopulate(val, "OperationStatus", &s.OperationStatus) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &s.Source) - delete(rawMsg, key) - case "timestamp": - err = unpopulateTimeRFC3339(val, "Timestamp", &s.Timestamp) - delete(rawMsg, key) - case "tracingId": - err = unpopulate(val, "TracingID", &s.TracingID) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SyncGroupProperties. -func (s SyncGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "conflictLoggingRetentionInDays", s.ConflictLoggingRetentionInDays) - populate(objectMap, "conflictResolutionPolicy", s.ConflictResolutionPolicy) - populate(objectMap, "enableConflictLogging", s.EnableConflictLogging) - populate(objectMap, "hubDatabasePassword", s.HubDatabasePassword) - populate(objectMap, "hubDatabaseUserName", s.HubDatabaseUserName) - populate(objectMap, "interval", s.Interval) - populateTimeRFC3339(objectMap, "lastSyncTime", s.LastSyncTime) - populate(objectMap, "privateEndpointName", s.PrivateEndpointName) - populate(objectMap, "schema", s.Schema) - populate(objectMap, "syncDatabaseId", s.SyncDatabaseID) - populate(objectMap, "syncState", s.SyncState) - populate(objectMap, "usePrivateLinkConnection", s.UsePrivateLinkConnection) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupProperties. -func (s *SyncGroupProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "conflictLoggingRetentionInDays": - err = unpopulate(val, "ConflictLoggingRetentionInDays", &s.ConflictLoggingRetentionInDays) - delete(rawMsg, key) - case "conflictResolutionPolicy": - err = unpopulate(val, "ConflictResolutionPolicy", &s.ConflictResolutionPolicy) - delete(rawMsg, key) - case "enableConflictLogging": - err = unpopulate(val, "EnableConflictLogging", &s.EnableConflictLogging) - delete(rawMsg, key) - case "hubDatabasePassword": - err = unpopulate(val, "HubDatabasePassword", &s.HubDatabasePassword) - delete(rawMsg, key) - case "hubDatabaseUserName": - err = unpopulate(val, "HubDatabaseUserName", &s.HubDatabaseUserName) - delete(rawMsg, key) - case "interval": - err = unpopulate(val, "Interval", &s.Interval) - delete(rawMsg, key) - case "lastSyncTime": - err = unpopulateTimeRFC3339(val, "LastSyncTime", &s.LastSyncTime) - delete(rawMsg, key) - case "privateEndpointName": - err = unpopulate(val, "PrivateEndpointName", &s.PrivateEndpointName) - delete(rawMsg, key) - case "schema": - err = unpopulate(val, "Schema", &s.Schema) - delete(rawMsg, key) - case "syncDatabaseId": - err = unpopulate(val, "SyncDatabaseID", &s.SyncDatabaseID) - delete(rawMsg, key) - case "syncState": - err = unpopulate(val, "SyncState", &s.SyncState) - delete(rawMsg, key) - case "usePrivateLinkConnection": - err = unpopulate(val, "UsePrivateLinkConnection", &s.UsePrivateLinkConnection) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SyncGroupSchema. -func (s SyncGroupSchema) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "masterSyncMemberName", s.MasterSyncMemberName) - populate(objectMap, "tables", s.Tables) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SyncGroupSchemaTable. -func (s SyncGroupSchemaTable) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "columns", s.Columns) - populate(objectMap, "quotedName", s.QuotedName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SyncMember. -func (s SyncMember) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualCluster. -func (v VirtualCluster) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualClusterProperties. -func (v VirtualClusterProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "childResources", v.ChildResources) - populate(objectMap, "family", v.Family) - populate(objectMap, "maintenanceConfigurationId", v.MaintenanceConfigurationID) - populate(objectMap, "subnetId", v.SubnetID) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualClusterUpdate. -func (v VirtualClusterUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentRecurringScansProperties. -func (v VulnerabilityAssessmentRecurringScansProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "emailSubscriptionAdmins", v.EmailSubscriptionAdmins) - populate(objectMap, "emails", v.Emails) - populate(objectMap, "isEnabled", v.IsEnabled) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanRecordProperties. -func (v VulnerabilityAssessmentScanRecordProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endTime", v.EndTime) - populate(objectMap, "errors", v.Errors) - populate(objectMap, "numberOfFailedSecurityChecks", v.NumberOfFailedSecurityChecks) - populate(objectMap, "scanId", v.ScanID) - populateTimeRFC3339(objectMap, "startTime", v.StartTime) - populate(objectMap, "state", v.State) - populate(objectMap, "storageContainerPath", v.StorageContainerPath) - populate(objectMap, "triggerType", v.TriggerType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanRecordProperties. -func (v *VulnerabilityAssessmentScanRecordProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &v.EndTime) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &v.Errors) - delete(rawMsg, key) - case "numberOfFailedSecurityChecks": - err = unpopulate(val, "NumberOfFailedSecurityChecks", &v.NumberOfFailedSecurityChecks) - delete(rawMsg, key) - case "scanId": - err = unpopulate(val, "ScanID", &v.ScanID) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &v.StartTime) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &v.State) - delete(rawMsg, key) - case "storageContainerPath": - err = unpopulate(val, "StorageContainerPath", &v.StorageContainerPath) - delete(rawMsg, key) - case "triggerType": - err = unpopulate(val, "TriggerType", &v.TriggerType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -}